/* ===================================================================
   Site chrome + commercial-site primitives (pod.enacast.com).

   Loaded by base.html on every page, but every rule is scoped to a
   site-* class, so channel pages and the dashboard only pick up what they
   opt into (the header and its CTA).

   Tokens
     --site-ink          the filled-control colour: near-black #111 in the
                         light theme, a lifted near-white in the dark theme
     --site-ink-content  text on --site-ink (white / near-black)
     --site-ink-hover    hover fill
   Contrast, computed (WCAG 2.x relative luminance):
     light  #ffffff on #111111            = 18.9:1
     dark   #111111 on #ebedf0          = 16.1:1
   Never put the channel's --main-brand-color under white text on a site
   page: in the dark theme it is lifted to a mid grey (3.6:1 with white).
   =================================================================== */
:root {
  --site-ink: #111111;
  --site-ink-content: #ffffff;
  --site-ink-hover: #2b2b2b;
  --site-rule: var(--color-base-300);
  --site-header-h: 4.5rem;
  /* The one layout container of the commercial pages: every site page,
     the header row on site pages and the footer use this width and gutter. */
  --site-max: 72rem;
  --site-gutter: 1.25rem;
}
@media (min-width: 640px) { :root { --site-gutter: 1.5rem; } }
html[data-theme="enacastdark"] {
  --site-ink: #ebedf0;
  --site-ink-content: #111111;
  --site-ink-hover: #ffffff;
}

/* ---- The primary action (partials/_site_cta.html) ------------------ */
.site-cta,
.site-fill {
  background: var(--site-ink);
  color: var(--site-ink-content);
}
.site-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 9999px;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid var(--site-ink);
  transition: background-color 160ms ease-out, border-color 160ms ease-out, transform 160ms ease-out;
}
a.site-cta, a.site-cta:hover { color: var(--site-ink-content); }
.site-cta:hover { background: var(--site-ink-hover); border-color: var(--site-ink-hover); }
.site-cta:active { transform: translateY(1px); }
/* A submitted form[data-submit-once] (static/js/project.js): dimmed, same size. */
.site-cta[aria-disabled="true"] { opacity: 0.6; cursor: progress; transform: none; }
.site-cta:focus-visible,
.site-btn-outline:focus-visible {
  outline: 2px solid var(--site-ink);
  outline-offset: 3px;
}
.site-cta--sm { min-height: 2.75rem; padding: 0 1rem; font-size: 0.875rem; }
.site-cta--md { min-height: 2.75rem; padding: 0 1.4rem; font-size: 0.95rem; }
.site-cta--lg { min-height: 3.25rem; padding: 0 1.9rem; font-size: 1.05rem; }
/* sm is the header CTA: 44 px tall while the header is in its touch
   (collapsed) layout, 36 px once the full row shows (960 px, see header). */
@media (min-width: 960px) {
  .site-cta--sm { min-height: 2.25rem; }
}
/* Narrow phones with a long translated label ("Essayer gratuitement"):
   tighten the header so brand + CTA + menu button still fit at 360 px. */
@media (max-width: 399.98px) {
  .site-header__inner { gap: 0.375rem; padding: 0 0.625rem; }
  .site-header .site-cta--sm { padding: 0 0.75rem; font-size: 0.8125rem; }
}
@media (prefers-reduced-motion: reduce) {
  .site-cta, .site-btn-outline { transition: none; }
  .site-cta:active { transform: none; }
}

.site-cta-group {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
}
.site-cta-trust {
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--text-muted);
  text-wrap: balance;
}
/* Centre the group when the parent is centred (text-center wrappers). */
.text-center .site-cta-group { align-items: center; }

/* Secondary action: outline, never filled. */
.site-btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.75rem;
  padding: 0 1.4rem;
  border-radius: 9999px;
  border: 1px solid color-mix(in oklab, var(--text-heading) 35%, transparent);
  color: var(--text-heading);
  background: transparent;
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: border-color 160ms ease-out, background-color 160ms ease-out;
}
a.site-btn-outline:hover,
.site-btn-outline:hover {
  color: var(--text-heading);
  border-color: var(--text-heading);
  background: color-mix(in oklab, var(--text-heading) 5%, transparent);
}

/* Segmented toggle (e.g. pricing yearly / monthly). Put .site-segmented on
   the wrapper and .site-segmented__option on each <button>; mark the active
   one with aria-pressed="true" (or the class .is-active). */
.site-segmented {
  display: inline-flex;
  padding: 0.25rem;
  gap: 0.25rem;
  border-radius: 9999px;
  border: 1px solid var(--site-rule);
  background: var(--card-bg);
}
.site-segmented__option {
  min-height: 2.75rem;
  padding: 0 1.1rem;
  border-radius: 9999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-heading);
  background: transparent;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.site-segmented__option[aria-pressed="true"],
.site-segmented__option.is-active {
  background: var(--site-ink);
  color: var(--site-ink-content);
}
.site-segmented__option:focus-visible { outline: 2px solid var(--site-ink); outline-offset: 2px; }

/* Small pill for "−15 %" style labels and plain badges. .site-badge is the
   quiet outline one; .site-badge--ink is filled with the ink (AA in both
   themes, same pair as the CTA). Inside an active .site-segmented option
   the ink badge inverts so it stays visible. */
.site-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.55rem;
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.5;
  color: var(--text-heading);
  border: 1px solid color-mix(in oklab, var(--text-heading) 30%, transparent);
}
.site-badge--ink {
  background: var(--site-ink);
  color: var(--site-ink-content);
  border-color: var(--site-ink);
}
.site-segmented__option[aria-pressed="true"] .site-badge--ink,
.site-segmented__option.is-active .site-badge--ink {
  background: var(--site-ink-content);
  color: var(--site-ink);
  border-color: var(--site-ink-content);
}

/* Layout. .site-container = the centred max width + side gutter every
   commercial page uses (landing sections, pricing, about, the directory,
   the trial pages, privacy, legal; the footer and the site header row read
   the same variables). Never add a page-level max-width that moves the left
   edge: narrower content (.site-measure for long text) sits left-aligned
   inside it. .site-section = .site-container + vertical rhythm;
   .site-band = full-bleed tinted band (wrap a .site-section in it). */
.site-container,
.site-section {
  width: 100%;
  max-width: var(--site-max);
  margin-inline: auto;
  padding-inline: var(--site-gutter);
}
.site-section { padding-block: 4rem; }
@media (min-width: 640px) { .site-section { padding-block: 5rem; } }
.site-section--narrow { max-width: 48rem; }
/* Readable measure for long-form text (privacy, legal), left-aligned. */
/* In rem, not ch: a ch measure changes width when the web font swaps in and
   reflowed the whole policy (CLS 0.08 at 1440 px). 42rem ~ 65ch of Inter. */
.site-measure { max-width: 42rem; }
/* Inline links in running text (legal pages): underlined, so they do not
   read like the bold labels next to them. */
.site-prose a:not(.site-cta):not(.site-btn-outline) {
  color: var(--text-heading);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.site-prose a:hover { text-decoration-thickness: 2px; }
.site-band {
  background: var(--color-base-200);
  border-block: 1px solid var(--site-rule);
}

/* Safety net for filled controls that still carry the old inline
   "background: var(--main-brand-color); color: #fff" on a site page: in the
   dark theme base.html lifts the site brand to --site-ink (near-white), so
   the text must turn dark. New markup should use .site-fill / .site-cta. */
html[data-theme="enacastdark"] .site-page [style*="--main-brand-color"][style*="color: #fff"] {
  color: var(--site-ink-content) !important;
}

/* ---- Skip link ------------------------------------------------------ */
.site-skip-link {
  position: absolute;
  left: 0.75rem;
  top: -100px;
  z-index: 100;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: var(--site-ink);
  color: var(--site-ink-content);
  font-weight: 600;
  font-size: 0.9rem;
}
.site-skip-link:focus,
.site-skip-link:focus-visible { top: 0.75rem; color: var(--site-ink-content); outline: 2px solid var(--site-ink); outline-offset: 2px; }

/* ---- Radio strip (partials/_radio_strip.html) ----------------------- */
.site-radio-strip {
  border-bottom: 1px solid var(--site-rule);
  background: var(--color-base-200);
  font-size: 0.8125rem;
  line-height: 1.35;
  text-align: center;
}
.site-radio-strip a {
  display: block;
  padding: 0.55rem 1rem;
  color: var(--text-muted);
  text-wrap: balance;
}
.site-radio-strip a:hover,
.site-radio-strip a:focus-visible { color: var(--text-heading); text-decoration: underline; text-underline-offset: 3px; }
.site-radio-strip strong { color: var(--text-heading); font-weight: 600; }

/* ---- "Made with" bar (partials/_made_with_bar.html) -----------------
   Show and episode pages on the root host, anonymous visitors only. In
   normal flow above the header: covers nothing, no shift (server-side). */
.site-made-with {
  border-bottom: 1px solid var(--color-base-300);
  background: var(--color-base-200);
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--text-muted);
}
/* The whole line is one link (one 44 px target, at most two short lines
   on a phone); "Try it free" is its underlined label. */
.site-made-with__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  column-gap: 0.6rem;
  min-height: 2.75rem;
  padding: 0.25rem var(--site-gutter);
  text-align: center;
  color: var(--text-muted);
}
@media (min-width: 640px) { .site-made-with__inner { min-height: 2.25rem; } }
.site-made-with strong { color: var(--text-heading); font-weight: 600; }
.site-made-with__link {
  font-weight: 600;
  color: var(--text-heading);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.site-made-with__inner:hover { color: var(--text-heading); }
.site-made-with__inner:hover .site-made-with__link { text-decoration-thickness: 2px; }
.site-made-with__inner:focus-visible { outline: 2px solid var(--text-heading); outline-offset: -2px; }

/* ---- Header (base.html) --------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--color-base-100);
  border-bottom: 1px solid var(--color-base-200);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: var(--site-header-h);
  padding: 0 0.75rem;
}
@media (min-width: 640px) { .site-header__inner { padding: 0 1.25rem; gap: 0.75rem; } }
/* On site pages the header row lines up with the page container. Show
   pages and the dashboard keep the full-width row (their layouts are). */
.site-page .site-header__inner {
  max-width: var(--site-max);
  margin-inline: auto;
  padding-inline: var(--site-gutter);
}

.site-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  margin-right: auto;
  border-radius: 0.5rem;
  color: var(--text-heading);
  flex-shrink: 0;
}
.site-header__brand:focus-visible { outline: 2px solid var(--site-ink); outline-offset: 2px; }
.site-header__brand img { width: auto; height: 1.5rem; }
.site-header__wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.site-header__logo { font-size: 1.125rem; font-weight: 650; letter-spacing: -0.01em; }
.site-header__tag {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  white-space: nowrap;
}
@media (min-width: 480px) {
  .site-header__wordmark { flex-direction: row; align-items: baseline; gap: 0.45rem; }
}

/* The collapsible part: nav links, "Sign in", language, theme. Above the
   breakpoint `display: contents` lets its children join the header's flex
   row (ordered with `order`); below it, it is a panel under the header,
   closed unless the header carries [data-menu-open]. The closed state is
   plain CSS, so nothing moves when the scripts start. */
/* Phones: DOM order is brand, menu button, panel, CTA (tab order: the open
   panel right after its button); `order` draws the CTA before the button. */
@media (max-width: 959.98px) {
  .site-header__cta { order: 1; }
  .site-header__toggle { order: 2; }
}
.site-header__collapse { display: none; }
/* Without JavaScript the menu cannot open: show the panel's content as a
   full-width row under the header instead, and drop the dead button. With
   JS the pre-paint script sets html.js first, so nothing shifts. */
@media (max-width: 959.98px) {
  html:not(.js) .site-header__inner { flex-wrap: wrap; }
  html:not(.js) .site-header__toggle { display: none; }
  html:not(.js) .site-header__collapse {
    display: block;
    order: 3;
    flex-basis: 100%;
    padding-bottom: 0.75rem;
  }
}
.site-header[data-menu-open] .site-header__collapse {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-base-100);
  border-bottom: 1px solid var(--color-base-300);
  box-shadow: 0 12px 24px -12px rgb(0 0 0 / 0.18);
  padding: 0.5rem 0.75rem 1rem;
}
.site-header__nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.site-header__link {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-heading);
  white-space: nowrap;
}
.site-header__link:hover { background: var(--color-base-200); }
.site-header__link[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.site-header__link:focus-visible { outline: 2px solid var(--site-ink); outline-offset: -2px; }
.site-header__tools {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-base-200);
}

.site-header__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.5rem;
  border: 0;
  background: transparent;
  color: var(--text-heading);
  cursor: pointer;
  flex-shrink: 0;
}
.site-header__toggle:hover { background: var(--color-base-200); }
.site-header__toggle:focus-visible { outline: 2px solid var(--site-ink); outline-offset: 2px; }
.site-header__toggle .site-header__icon-close { display: none; }
.site-header[data-menu-open] .site-header__toggle .site-header__icon-open { display: none; }
.site-header[data-menu-open] .site-header__toggle .site-header__icon-close { display: inline-block; }

/* Tap targets in the header: 44 px on phones. */
.site-header .theme-toggle,
.site-header .site-lang > summary {
  min-height: 2.75rem;
  height: 2.75rem;
}
.site-header .theme-toggle { width: 2.75rem; }
.site-lang__menu button { min-height: 2.75rem; }
/* In the phone panel the language list opens in place, under its button,
   instead of as a floating dropdown anchored off-screen. */
@media (max-width: 959.98px) {
  .site-header .site-lang { position: static; }
  .site-header .site-lang > .dropdown-content {
    position: absolute;
    left: 0.75rem;
    right: auto;
    top: auto;
    bottom: auto;
    translate: none;
    transform: none;
  }
}

@media (min-width: 960px) {
  .site-header__toggle { display: none; }
  .site-header__collapse,
  .site-header[data-menu-open] .site-header__collapse {
    display: contents;
  }

  .site-header__nav ul { flex-direction: row; gap: 0.125rem; }
  .site-header__link { font-size: 0.9rem; padding: 0 0.7rem; }

  .site-header__tools { margin: 0; padding: 0; border: 0; }
  .site-header .theme-toggle,
  .site-header .site-lang > summary { min-height: 2.25rem; height: 2.25rem; }
  .site-header .theme-toggle { width: 2.25rem; }
  .site-lang__menu button { min-height: 2.25rem; }
}
.site-header__cta { display: inline-flex; flex-shrink: 0; }

/* ---- Footer (partials/_site_footer.html) ----------------------------- */
.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--site-rule);
  background: var(--color-base-200);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.site-footer__inner {
  max-width: var(--site-max);
  margin-inline: auto;
  padding: 3rem var(--site-gutter) 2rem;
}
@media (min-width: 640px) { .site-footer__inner { padding-top: 3.5rem; } }
.site-footer__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 1.5rem;
}
@media (min-width: 768px) {
  .site-footer__grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; }
}
.site-footer__products { grid-column: 1 / -1; }
@media (min-width: 768px) { .site-footer__products { grid-column: auto; } }
.site-footer__heading {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.5rem;
}
.site-footer__list { list-style: none; margin: 0; padding: 0; }
.site-footer__list a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  min-width: 2.75rem;
  color: var(--text-heading);
}
@media (min-width: 768px) { .site-footer__list a { min-height: 2rem; min-width: 0; } }
.site-footer__list a:hover,
.site-footer__list a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
.site-footer__product { margin-bottom: 0.75rem; }
.site-footer__product a { font-weight: 600; }
.site-footer__product p { margin: 0.15rem 0 0; line-height: 1.45; font-size: 0.85rem; }
.site-footer__bottom {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--site-rule);
  font-size: 0.8125rem;
}
