/* Site Engine standard components: accordion, tabs, CTA strip, media, split, video, form. See docs/BLOCKS.md.
   Loaded BEFORE the site stylesheet, with single-class selectors: they beat the site's element rules (a, h2...)
   and any site rule using the same classes wins. Theme them with the custom properties below, e.g.
   :root { --c-accent: var(--color-primary); } */
:where(:root) {
  --c-accent: #0b5cad;
  --c-on-accent: #fff;
  --c-border: #d9e0e6;
  --c-text-muted: #5b6770;
  --c-radius: 0.5rem;
  --c-gap: clamp(1.25rem, 4vw, 3rem);
  --c-cta-bg: var(--c-accent);
  --c-cta-text: var(--c-on-accent);
}

/* ---------- Button ---------- */
.c-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem;
  padding: 0.6rem 1.4rem; border: 2px solid currentColor; border-radius: 999px;
  font-weight: 600; text-decoration: none; color: inherit;
}
.c-btn--primary { background: var(--c-accent); border-color: var(--c-accent); color: var(--c-on-accent); }
.c-cta .c-btn--primary { background: var(--c-cta-text); border-color: var(--c-cta-text); color: var(--c-cta-bg); }

/* ---------- Accordion (native <details>, no JavaScript needed) ---------- */
.c-accordion { border-top: 1px solid var(--c-border); margin-block: 1.5em; }
.c-accordion__item { border-bottom: 1px solid var(--c-border); }
.c-accordion__title {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1rem 0; font-weight: 600; cursor: pointer; list-style: none;
}
.c-accordion__title::-webkit-details-marker { display: none; }
.c-accordion__title::after {
  content: ""; flex: none; width: 0.6em; height: 0.6em; margin-right: 0.2em;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; rotate: 45deg; translate: 0 -0.15em;
}
.c-accordion__item[open] > .c-accordion__title::after { rotate: -135deg; translate: 0 0.15em; }
.c-accordion__body { padding: 0 0 1rem; }
.c-accordion__body > :last-child { margin-bottom: 0; }

/* ---------- Tabs (without JavaScript the panels are simply stacked) ---------- */
.c-tabs { margin-block: 1.5em; }
.c-tabs__list { display: flex; flex-wrap: wrap; gap: 0.25rem; border-bottom: 1px solid var(--c-border); }
.c-tabs__tab {
  min-height: 2.75rem; padding: 0.6rem 1rem; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px;
  background: none; font: inherit; font-weight: 600; color: var(--c-text-muted); cursor: pointer;
}
.c-tabs__tab[aria-selected="true"] { color: inherit; border-bottom-color: var(--c-accent); }
.c-tabs__tab:focus-visible { outline: 3px solid var(--c-accent); outline-offset: -3px; }
.c-tabs__panel { padding-block: 1.25rem; }
.c-tabs.is-enhanced .c-tabs__title {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- CTA strip ---------- */
.c-cta { background: var(--c-cta-bg); color: var(--c-cta-text); padding-block: var(--c-gap); }
.c-cta__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem;
  width: min(100% - 2rem, 72rem); margin-inline: auto;
}
.c-cta__text { flex: 1 1 28rem; }
.c-cta__text h2, .c-cta__text h3 { color: inherit; margin: 0 0 0.35em; }
.c-cta__text p { margin: 0; opacity: 0.9; }
.c-cta__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.c-cta__actions p { margin: 0; }
.c-cta--center .c-cta__inner { flex-direction: column; text-align: center; }
.c-cta--center .c-cta__text { flex-basis: auto; }

/* ---------- Media (image or video with caption) ---------- */
.c-media { margin: 1.5em 0; }
.c-media img, .c-media video { display: block; width: 100%; height: auto; border-radius: var(--c-radius); }
.c-media figcaption { margin-top: 0.5em; font-size: 0.875em; color: var(--c-text-muted); }
.c-media--narrow { max-width: 40rem; margin-inline: auto; }

/* ---------- Split: media + text side by side ---------- */
.c-split { display: grid; gap: var(--c-gap); align-items: center; margin-block: 2em; }
@media (min-width: 48rem) {
  .c-split { grid-template-columns: 1fr 1fr; }
  .c-split--reverse > .c-split__media { order: 2; }
}
.c-split__media > * { margin: 0; }
.c-split__media img { display: block; width: 100%; height: auto; border-radius: var(--c-radius); }
.c-split__text > :last-child { margin-bottom: 0; }

/* ---------- Video (click-to-load YouTube/Vimeo: no third-party request before the click) ---------- */
.c-video {
  position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--c-radius); background: #000; color: #fff;
}
.c-video img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; opacity: 0.85; }
.c-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.c-video__play {
  position: absolute; inset: 0; margin: auto; width: 4.5rem; height: 4.5rem; border-radius: 50%;
  background: rgb(0 0 0 / 0.65); transition: background 0.2s;
}
.c-video__play::before {
  content: ""; position: absolute; inset: 0; margin: auto; width: 0; height: 0; translate: 0.2rem 0;
  border-style: solid; border-width: 0.85rem 0 0.85rem 1.4rem; border-color: transparent transparent transparent #fff;
}
.c-video:hover .c-video__play, .c-video:focus-visible .c-video__play { background: var(--c-accent); }
.c-video__label {
  position: absolute; left: 1rem; right: 1rem; bottom: 0.75rem; font-size: 0.875rem; text-shadow: 0 1px 3px #000;
}
@media (prefers-reduced-motion: reduce) { .c-video__play { transition: none; } }

/* ---------- Block titles ---------- */
.c-block-title { margin-bottom: 0.75em; }

/* ---------- Latest news (block "news": the list is the engine news-list markup) ---------- */
.c-news__more { margin: 1.5em 0 0; }

/* ---------- Form (block "form": POST /forms/submit; statuses shown with :target without JavaScript) ---------- */
.c-form__form { position: relative; }
.c-form__fields { display: grid; gap: 0 var(--c-gap); }
@media (min-width: 48rem) { .c-form--columns .c-form__fields { grid-template-columns: 1fr 1fr; } }
.c-form__field { display: flex; flex-direction: column; gap: 0.35rem; margin: 0 0 1rem; }
.c-form__label { font-weight: 600; }
.c-form__input {
  width: 100%; min-height: 2.75rem; padding: 0.55rem 0.75rem; border: 1px solid var(--c-border);
  border-radius: calc(var(--c-radius) / 2); background: #fff; color: inherit; font: inherit;
}
textarea.c-form__input { min-height: 10rem; resize: vertical; }
.c-form__input:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 0; }
.c-form__check { display: flex; align-items: flex-start; gap: 0.6rem; margin: 0 0 1rem; }
.c-form__check input { flex: none; width: 1.1rem; height: 1.1rem; margin: 0.2rem 0 0; accent-color: var(--c-accent); }
.c-form__actions { margin: 0; }
.c-form__actions .c-btn { font: inherit; font-weight: 600; cursor: pointer; }
.c-form__hp, .c-form__live { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.c-form__status {
  display: none; margin: 1rem 0 0; padding: 0.75rem 1rem;
  border-left: 3px solid var(--c-accent); background: color-mix(in srgb, var(--c-accent) 10%, transparent);
}
.c-form__status--error, .c-form__status--fail { border-left-color: #c62828; }
.c-form__status:target, .c-form__status.is-visible { display: block; }
.c-form [aria-invalid="true"] { border-color: #c62828; }
