/* ============================================================
   Design refresh — shared layer. docs/design-refresh-rules.md.

   Everything here is scoped to `[data-design="refresh"]`. Refresh-only
   components carry the attribute fixed on their root; two-look components
   set it only when their `design` prop is `refresh`, so their current look
   never sees these rules. It reaches every section through `section.css`.
   Each Webflow component has its own shadow root, so the attribute sits on
   each section root, never on a page wrapper. A section's own differences
   live in its stylesheet.
   ============================================================ */


/* ---- Ground (BG-1) and section rhythm ---------------------
   White ground; `.hp-section--stepped`'s steps, restated because the class
   isn't on these sections. Two attributes' weight beats each section's own
   single-class background. */
.hp-section[data-design="refresh"] {
  background: var(--card);
}

@media (max-width: 1199px) {
  .hp-section[data-design="refresh"] { padding-block: 6rem; }   /* 96px */
}

@media (max-width: 991px) {
  .hp-section[data-design="refresh"] { padding-block: 5rem; }   /* 80px */
}

@media (max-width: 767px) {
  .hp-section[data-design="refresh"] { padding-block: 4rem; }   /* 64px */
}


/* ---- Section card (BG-4, BG-5, BG-5a) ---------------------
   Beige, inset 16px, 32px visible radius. The 16px is a white border, the
   repo's inset-panel recipe (docs/redesign-design-language.md §4). Figma's
   112 / 128 padding counts from the outer edge, so the CSS is 96 / 112, and
   each container hands the border back. */
.hp-section[data-design="refresh"][data-surface="card"] {
  padding-block: 6rem 7rem;   /* 96 / 112 */
  background:    var(--secondary);
  border:        16px solid var(--card);
  border-radius: 48px;
}

@media (max-width: 1479.98px) {
  [data-design="refresh"][data-surface="card"] > .container {
    max-width:     calc(1024px + 128px);
    padding-inline: 64px;
  }
}

[data-design="refresh"][data-surface="card"] > .container-wide {
  max-width:      calc(1384px + 64px);
  padding-inline: 2rem;
}

@media (max-width: 1199px) {
  .hp-section[data-design="refresh"][data-surface="card"] { padding-block: 5rem 6rem; }
}

@media (max-width: 991px) {
  .hp-section[data-design="refresh"][data-surface="card"] {
    padding-block: 4rem 5rem;
    border-radius: 32px;
  }

  [data-design="refresh"][data-surface="card"] > .container      { padding-inline: 44px; }
  [data-design="refresh"][data-surface="card"] > .container-wide { padding-inline: 28px; }
}

@media (max-width: 767px) {
  .hp-section[data-design="refresh"][data-surface="card"] {
    padding-block: 3rem 4rem;
    border-width:  12px;
    border-radius: 24px;
  }

  [data-design="refresh"][data-surface="card"] > .container      { padding-inline: 20px; }
  [data-design="refresh"][data-surface="card"] > .container-wide { padding-inline: 4px; }
}


/* ---- Tag pill (TG-1, replaces C2) ---------------------------
   `--background` on white, as the new homepage draws every rail badge and chip
   (`.hp-badge--cream`); white on a beige section card. */
[data-design="refresh"] .hp-badge {
  background: var(--background);
}

[data-design="refresh"][data-surface="card"] .hp-badge {
  background: var(--card);
}


/* ---- Headings (TY-1, TY-2, TY-14) --------------------------
   Rowan Light. A bold run in a heading becomes the italic marker run, here
   rather than in the markup, so the same heading prop serves both looks.
   Values are `.marker-highlight`'s. */
[data-design="refresh"] .hp-heading,
[data-design="refresh"] .hp-heading.fw-bold {
  font-family: var(--font-family-serif);
  font-weight: var(--font-weight-light);
}

/* A bold run written into a heading's markup (a JSX fallback, a rich-text
   <strong>, `.page-h1__line.fw-bold`) becomes the marker in the refresh.
   Still needed after the old `**` syntax went (2026-11-17): the Redesign
   Preview stories of AIR, AIR Pricing, Hybrid, Law Practice, Legal Hub,
   Partners and VR rely on it. A styling tag's bold (.txt-b) is bold in every
   look, so it is left out. */
[data-design="refresh"] :is(.hp-heading, .page-h1, .inline-banner__heading) :is(.fw-bold, strong):not(.txt-b) {
  font-style:  italic;
  font-weight: var(--font-weight-light);
  background:  linear-gradient(90deg, var(--marker-highlight-from), var(--marker-highlight-to));
  border-radius: 2px;
  padding:             0 0 0.111em;
  background-size:     100% calc(100% - 0.056em);
  background-position: 0 100%;
  background-repeat:   no-repeat;
  -webkit-box-decoration-break: clone;
  box-decoration-break:         clone;
}

/* The marker tag (*m* … closed with its slash tag) on a component with the
   refresh switch: plain text in the current look (no rule), the marker here.
   Values are `.marker-highlight`'s. */
[data-design="refresh"] .txt-m {
  font-style:  italic;
  background:  linear-gradient(90deg, var(--marker-highlight-from), var(--marker-highlight-to));
  border-radius: 2px;
  padding:             0 0 0.111em;
  background-size:     100% calc(100% - 0.056em);
  background-position: 0 100%;
  background-repeat:   no-repeat;
  -webkit-box-decoration-break: clone;
  box-decoration-break:         clone;
}

/* A marker run inside a bold run (the combined *mb* tag, or *m* nested in *b*,
   italic or not) — bold in the current look, the marker in the refresh: the
   marker keeps the heading's light weight, as the rule for bold runs above does. */
[data-design="refresh"] :is(h1, h2, h3, h4, h5, h6, .hp-heading, .page-h1, .inline-banner__heading) .txt-b :is(.txt-m, .marker-highlight) {
  font-weight: var(--font-weight-light);
}

/* `page-h1__line` is a block, and a wrapped block is as wide as its column, so
   the marker would paint the empty space after a short last line. Inline, it
   paints only the text, line by line (box-decoration-break above). It still
   gets its own line: its neighbours are block lines. */
[data-design="refresh"] :is(.hp-heading, .page-h1) .page-h1__line.fw-bold {
  display: inline;
}

