/* ============================================================
   MESA theme additions
   Rules the static mockup did not need but a WordPress theme does.
   Tokens only (tokens.css). Loaded after site.css and pages.css.
   ============================================================ */

/* === SKIP LINK ===
   Hidden until focused, then pinned top-left above the sticky header. */
.skip-link:focus {
  position: fixed;
  inset-block-start: var(--space-xs);
  inset-inline-start: var(--space-xs);
  z-index: var(--z-modal);
  width: auto;
  height: auto;
  margin: 0;
  padding: var(--space-xs) var(--space-s);
  overflow: visible;
  clip: auto;
  white-space: normal;
  font-size: var(--text-s);
  font-weight: 600;
  color: var(--text-light);
  background: var(--tertiary-ultra-dark);
  border-radius: var(--radius-round);
}

/* === PROMO SLIDES WITH REAL ARTWORK ===
   The mockup only ships placeholders; artwork arrives wrapped in a link and a
   <picture>, both of which must fill the slide for object-fit to work. */
.promo__link,
.promo__slide picture {
  display: block;
  height: 100%;
}

/* === FLUENT FORMS: FOOTER NEWSLETTER ===
   Used when Theme Settings sets a newsletter form ID (form 2, Subscription
   Form: name, email, consent, Turnstile, submit). Fluent's markup is laid out
   on a grid: name and email share a row, the consent line spans it, Turnstile
   and the button share the last row. One column below 768px, where the
   300px Turnstile widget no longer fits half a row.
   Every selector starts at .site-footer: Fluent's own stylesheet prints after
   this one, so equal specificity would lose. */

/* The footer's `1fr auto` grid sizes the form column from its max-content,
   which Fluent's markup blows out to the full width and squeezes the heading.
   62rem leaves each half row wide enough for Turnstile. */
@media (min-width: 992px) {
  .newsletter:has(.newsletter__form--fluent) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 62rem);
  }
}

.site-footer .newsletter__form--fluent,
.site-footer .newsletter__form--fluent .fluentform {
  display: block;
  width: 100%;
}

.site-footer .newsletter__form--fluent form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: var(--space-s) var(--space-xs);
}

@media (min-width: 768px) {
  .site-footer .newsletter__form--fluent form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.site-footer .newsletter__form--fluent fieldset {
  display: contents;
}

/* Fluent prints a zero-size legend; out of flow so it takes no grid cell. */
.site-footer .newsletter__form--fluent legend {
  position: absolute;
}

/* Fluent's wrappers carry bottom margins and a flex row of their own. */
.site-footer .newsletter__form--fluent :is(.ff-el-group, .ff-field_container, .ff-t-container, .ff-t-cell, .ff-el-input--content) {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
}

.site-footer .newsletter__form--fluent .ff-el-group:has(.ff-el-tc) {
  grid-column: 1 / -1;
}

.site-footer .newsletter__form--fluent .ff-el-input--label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.site-footer .newsletter__form--fluent .ff-el-form-control {
  width: 100%;
  padding: var(--space-xs) var(--space-s);
  font-size: var(--text-s);
  line-height: var(--btn-line-height);
  color: var(--text-light);
  background: hsl(33 60% 97% / 0.07);
  border: var(--border-width) solid hsl(33 60% 97% / 0.2);
  border-radius: var(--radius-round);
  box-shadow: none;
}

.site-footer .newsletter__form--fluent .ff-el-form-control::placeholder {
  color: var(--text-light-muted);
}

.site-footer .newsletter__form--fluent .ff-el-form-control:focus-visible {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Consent line: muted small print, checkbox on the first line of text. */
.site-footer .newsletter__form--fluent .ff_tc_label {
  display: flex;
  align-items: baseline;
  gap: var(--space-xs);
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--text-light-muted);
  cursor: pointer;
}

.site-footer .newsletter__form--fluent :is(.ff_tc_checkbox, .ff_t_c, .ff_t_c p) {
  width: auto;
  margin: 0;
  padding: 0;
  color: inherit;
}

.site-footer .newsletter__form--fluent .ff-el-form-check-input {
  width: 1.1em;
  height: 1.1em;
  margin: 0;
  accent-color: var(--primary);
}

.site-footer .newsletter__form--fluent .ff_t_c a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.site-footer .newsletter__form--fluent .ff_t_c a:hover {
  color: var(--accent-light);
}

/* Fluent prints the button colours inline (form.fluent_form_2 .wpf_has_custom_css
   .ff-btn-submit); two class names on the button outrank it. */
.site-footer .newsletter__form--fluent .ff-btn.ff-btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: var(--btn-padding-block) var(--btn-padding-inline);
  font-family: var(--btn-font-family);
  font-size: var(--btn-font-size);
  font-weight: var(--btn-font-weight);
  line-height: var(--btn-line-height);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-light);
  background: var(--primary);
  border: var(--btn-border-width) solid var(--primary);
  border-radius: var(--btn-border-radius);
  box-shadow: none;
  cursor: pointer;
  transition: var(--transition);
}

.site-footer .newsletter__form--fluent .ff-btn.ff-btn-submit:hover {
  color: var(--text-light);
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.site-footer .newsletter__form--fluent .ff-btn.ff-btn-submit:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.site-footer .newsletter__form--fluent .error {
  font-size: var(--text-xs);
  color: var(--accent-light);
}

/* Replaces the form after a successful signup. */
.site-footer .newsletter__form--fluent .ff-message-success {
  padding: var(--space-s);
  font-size: var(--text-s);
  color: var(--text-light);
  background: transparent;
  border: var(--border-width) solid hsl(33 60% 97% / 0.2);
  border-radius: var(--radius-s);
  box-shadow: none;
}

/* === EWWW PICTURE WEBP ===
   EWWW serves WebP by wrapping each <img> in <picture> (Picture WebP mode,
   switched on 30 September 2026: its JS WebP swap left lazy images that were
   already on screen blank). display: contents keeps every image rule written
   for a direct child (height: 100%, grid placement) working unchanged. */
picture { display: contents; }
/* With the wrapper gone, <source> would become a grid item and take a cell
   of its own (story row, news cards). Hiding it doesn't affect which file
   the browser picks. */
picture > source { display: none; }

/* === SMALL FIXES FROM THE 30 SEPTEMBER 2026 UI AUDIT === */
/* Arrow links never break across lines, and never shrink beside a heading
   ("All news →" wrapped on phones in .section-head). */
.link-arrow { white-space: nowrap; }
.section-head > .link-arrow { flex-shrink: 0; }

/* "Hover a panel…" means nothing on a touch screen. */
@media (hover: none) {
  .panels__hint { display: none; }
}

/* === VIDEO STILLS ===
   pages.css dims the still to 55% over the dark card, which suited the
   mockup's texture but turns a real video frame muddy brown. */
.video-card img { opacity: 0.92; }

/* === DOT LIST ===
   Bullet list printed by mesa_the_text_blocks() (franchise support rows and
   FAQ answers). The dot is drawn, one line tall, so it sits on the first
   line of an item that wraps. */
.dot-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  list-style: none;
}

.dot-list > li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-xs);
}

.dot-list > li::before {
  content: "";
  width: 0.4em;
  height: 1lh;
  background: radial-gradient(circle closest-side, var(--primary) 96%, transparent) center / 100% 0.4em no-repeat;
}
