/*----------------------------------------*/
/*  Loading skeleton
/*----------------------------------------*/
/* <html class="sk"> is set by an inline script in app/layout.tsx before first
   paint and removed by components/TemplateScripts.tsx once the animation
   scripts are ready, so the template's entrance animations play on the real
   content instead of the text flashing up and then vanishing.

   The skeleton is drawn on the real elements, so it matches the layout
   exactly and nothing moves when it lifts:
   - text (headings, paragraphs, list items) becomes shimmering line bars,
     one per line, with a shorter last line; form fields get one bar, like
     a placeholder;
   - buttons, tags, chips and eyebrows become solid shapes.
   Colours come from the text colour around them, so the bars read on the
   light sections and on the dark hero alike.

   Photos still downloading shimmer on their own (img[data-sk-img]) and fade
   in as they arrive, before and after the skeleton lifts. */

@keyframes sk-shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}

@keyframes sk-fade {
  from {
    opacity: 0;
  }
}

/* The two kinds are spelled out in full in each rule below (no nesting, for
   older browsers). Text: h1-h6, p, li, .accordion-button, .footer-7__nav-link,
   .footer-7__copy, input, textarea, select, skipping any that wrap another
   text element or a button. Shapes: buttons, tags, chips, CTA circles,
   eyebrows, the hero coordinates, avatars and feature icons. */

/* Shared paint: text, shapes and pending photos. */
html.sk #smooth-content :is(h1, h2, h3, h4, h5, h6, p, li:not([class*="__sep"]), .accordion-button, .footer-7__nav-link, .footer-7__copy, input, textarea, select):not(:has(h1, h2, h3, h4, h5, h6, p, li, input, textarea, button, .at-btn)),
html.sk #smooth-content :is(.at-btn, button:not(.accordion-button), [class*="__tag"]:not([class*="__tags"]), [class*="__chip"]:not([class*="__chips"]), [class*="__cta-btn"], [class*="__cta-circle"], [class*="__cta-arrow"], [class*="__eyebrow"]:not(img), [class*="__coords"], [class*="__avatar"]:not([class*="__avatars"]), [class*="__feature-icon"]),
html.sk #smooth-content img:not([src$=".svg"], [src$=".png"]),
img[data-sk-img] {
  --sk-base: color-mix(in srgb, currentColor 10%, transparent);
  --sk-shine: color-mix(in srgb, currentColor 22%, transparent);
  -webkit-text-fill-color: transparent;
  border-color: transparent;
  box-shadow: none;
  background: rgba(128, 128, 128, 0.14);
  /* Fixed attachment sizes the sweep to the viewport, so every bar on
     screen shimmers as one band rather than each on its own. */
  background: linear-gradient(100deg, var(--sk-base) 40%, var(--sk-shine) 50%, var(--sk-base) 60%) 0 0 / 300% 100% fixed;
  animation: sk-shimmer 1.6s linear infinite;
}

/* Shapes: tint from the surrounding text colour, not their own. A dark
   button's own text is white, which would vanish on a white page. */
html.sk #smooth-content :is(.at-btn, button:not(.accordion-button), [class*="__tag"]:not([class*="__tags"]), [class*="__chip"]:not([class*="__chips"]), [class*="__cta-btn"], [class*="__cta-circle"], [class*="__cta-arrow"], [class*="__eyebrow"]:not(img), [class*="__coords"], [class*="__avatar"]:not([class*="__avatars"]), [class*="__feature-icon"]) {
  color: inherit;
}

/* Text: cut the shimmer into one bar per line, the last one shorter. */
html.sk #smooth-content :is(h1, h2, h3, h4, h5, h6, p, li:not([class*="__sep"]), .accordion-button, .footer-7__nav-link, .footer-7__copy, input, textarea, select):not(:has(h1, h2, h3, h4, h5, h6, p, li, input, textarea, button, .at-btn)) {
  --sk-gap: calc((var(--sk-line, 1lh) - 0.62em) / 2);
  border-radius: 0;
  /* Full-width bars down to the last line, then a 72% one. */
  mask:
    repeating-linear-gradient(transparent 0 var(--sk-gap), #000 0 calc(var(--sk-line, 1lh) - var(--sk-gap)), transparent 0 var(--sk-line, 1lh)) content-box,
    linear-gradient(#000 0 0) top / 100% var(--sk-body, calc(100% - var(--sk-line, 1lh))) no-repeat content-box,
    linear-gradient(#000 0 0) var(--sk-last, bottom left) / 72% var(--sk-line, 1lh) no-repeat content-box;
  mask-composite: intersect, add, add;
}

/* Single-line fields: one bar centred in the box. Their line-height can be
   taller than the padded box, which would push a per-line bar out of it. */
html.sk #smooth-content :is(input, select) {
  --sk-line: 100%;
}

/* A multi-row message box still gets one placeholder bar, on its first line. */
html.sk #smooth-content textarea {
  --sk-body: 0px;
  --sk-last: top left;
}

html.sk #smooth-content :is(h1, h2, h3, h4, h5, h6, p, li, .accordion-button, .footer-7__nav-link) :is(svg, img),
html.sk #smooth-content :is(.at-btn, button:not(.accordion-button), [class*="__tag"]:not([class*="__tags"]), [class*="__chip"]:not([class*="__chips"]), [class*="__cta-btn"], [class*="__cta-circle"], [class*="__cta-arrow"], [class*="__eyebrow"]:not(img), [class*="__coords"], [class*="__avatar"]:not([class*="__avatars"]), [class*="__feature-icon"]) > * {
  visibility: hidden;
}

/* Eyebrows have no box of their own; give the shape rounded ends. */
html.sk #smooth-content :is([class*="__eyebrow"]:not(img), [class*="__coords"]) {
  border-radius: 999px;
}

/* The hero coordinates row spans the column on phones; keep its shape to
   roughly the length of the text. */
html.sk #smooth-content [class*="__coords"] {
  mask: linear-gradient(#000 0 0) left center / min(100%, 13em) 100% no-repeat;
}

html.sk #smooth-content ::placeholder {
  -webkit-text-fill-color: transparent;
}

img[data-sk-in] {
  animation: sk-fade 0.5s ease;
}

@media (prefers-reduced-motion: reduce) {
  html.sk #smooth-content *,
  img[data-sk-img],
  img[data-sk-in] {
    animation: none !important;
  }
}
