/* ==========================================================================
   PATTERN CSS — styles for the section pattern library, one bundle.

   Loaded after framework.css on the front end (non-blocking, like
   framework.css) and in the block editor's canvas (functions.php). Released
   with the theme at the same tag. Private: the theme is its only home.

   Only what framework classes and Brand Kit variables cannot do: hero
   heights and tint layering, overlap, the card component, eyebrow line
   and pill, FAQ split layout, step numbers, gallery grid,
   footer layout. Widths, alignment, centring and spacing come from
   framework classes (grid-N columns, text-center, justify-*, pad-*,
   marg-*). No colours, fonts or type sizes of its own.

   Rules (dev-tools/check-patterns-css.js enforces them; run it before every
   commit to this file):
   - Reads tokens only: --color-*, --font-*, --fs-*, --space-*, --radius-*,
     --container-max, --shadow-*, and from v0.5.0 --card-*, --radius-image,
     --tag-transform, --hero-tint-soft, --hero-tint-strong, and from v0.5.2
     the one button variable --btn-ghost-dark-hover-text (the dark-surface
     link hover, below). Never --type-scale (printed nowhere).
   - Every variable newer than v0.3.0 is read with a fallback equal to
     v0.3.0 behaviour, e.g. var(--shadow-soft, 0 4px 20px rgba(0, 0, 0, 0.08)).
     Colour literals appear only inside such fallbacks. The one colour
     function allowed: color-mix(in srgb, A, B), A and B each
     var(--color-*) or transparent, with an optional N% or local
     var(--sbk-*) (which may hold var(--hero-tint-soft, 50%)).
   - px only for hairlines (1px, 2px), apart from media queries and fallbacks.
   - Class names: only the pattern classes listed below, plus the script's
     short list of framework classes (on-dark, on-light, tag-left,
     tag-center, text-center, justify-center, and the non-light section backgrounds
     bg-primary, bg-secondary, bg-accent, bg-dark, bg-muted). Every selector
     uses at least one listed name. Listed names are flat, like the
     framework's: lowercase words joined by single hyphens
     (hero-photo-panel), no sbk- prefix, no double hyphens or underscores.
     They are saved in pages, so pick each one once and check it against
     the framework's class names first. Never a class starting sbk-bg,
     sbk-logo, sbk-header or sbk-menu, with one exception: the body class
     sbk-header-overlay (the theme prints it when the header is
     transparent), only as ".sbk-header-overlay .<listed pattern class>"
     and in no other form.
   - At most two classes per selector; no IDs; no !important unless a
     comment on the same line says why.
   - Mobile first; breakpoints 768px and 1024px only (767px and 1023px for
     max-width).
   - No motion of its own (no animation, transition or @keyframes); use the
     framework's animate-* classes.
   - No url(), image-set(), @import or @font-face.
   - About 20 KB at most.

   Pattern classes (the checking script reads this list; add a name here
   before using it, separated by spaces or new lines):
   [pattern-classes]
   arrow-link
   heading-rule
   hero-medium hero-tall hero-full tint-soft tint-strong
   footer-section footer-icons footer-copyright
   [/pattern-classes]
   ========================================================================== */

/* ---- arrow-link: a text link with an arrow, on a core/button ----
   Used only as one fixed class set on the button's wrapper, in this
   order: button-ghost arrow-link font-small font-uppercase. The colours
   (and the switch under .on-dark) come from the ghost button tokens, the
   small capitals from the framework's text classes.
   Ours: the letter spacing, and the arrow, drawn, not typed. No box: padding and
   border width go, a small vertical hit area stays. A label that wraps
   lines up at the start like a text link, not centred like a button.
   The arrow steps a little on hover and focus (no transition: no motion
   of our own), and not at all under reduced motion. The focus outline is left alone. */
.arrow-link a {
    padding: 0.6rem 0;
    border-width: 0;
    letter-spacing: 0.12em;
    text-align: start;
}
.arrow-link a::after {
    content: "→"; /* for browsers without alt text in content (older Safari) */
    content: "→" / "";
    display: inline-block;
    margin-inline-start: 0.5em;
}
.arrow-link a:hover::after,
.arrow-link a:focus-visible::after {
    transform: translateX(0.4rem);
}
@media (prefers-reduced-motion: reduce) {
    .arrow-link a:hover::after,
    .arrow-link a:focus-visible::after { transform: none; }
}

/* ---- hero-split: text in one column, a photo in the other ----
   No rules of its own; recorded here so the pattern stays in one place.
   Markup: an sbk/row holding two grid-6 columns, the photo column first,
   so phones show the photo first. The photo is a core/image with
   WordPress's own aspect ratio (3:4, cover). Widths, padding, the panel's
   colour and its text colour come from the Column settings. Image right from 768:
   the Row's "Reverse order on desktop" (reverse-desktop). Overlap: the
   panel Column's Overlap setting, overlap-start-large with the image on
   the left, overlap-end-large with it on the right (reversed); from 768
   the panel runs var(--space-large) over the photo and grows by as much. */

/* ---- heading-rule: a short line under a heading ----
   On the Heading block itself (hero-plain and anywhere else). A short
   --color-accent line drawn with ::after, so nothing is added to content.
   It sits var(--space-xsmall) under the heading text and keeps
   var(--space-small) clear below it.
   Left-aligned; centred when the heading sits under text-center. */
.heading-rule::after {
    content: "";
    display: block;
    inline-size: 4rem;
    block-size: 2px;
    margin-block-start: var(--space-xsmall);
    margin-block-end: var(--space-small);
    margin-inline: 0;
    background-color: var(--color-accent);
}
.text-center .heading-rule::after {
    margin-inline: auto;
}

/* ---- hero-photo: a full-width photo with text over it ----
   On an sbk/section with a background image. Layout from framework classes
   on the section: flex-col with justify-end (text at the bottom) or
   justify-center (middle); the text in a Row with a grid-6 Column. Heights
   hero-medium, hero-tall, hero-full: svh with a vh fallback, at most 75svh
   on phones. Tint (design 17.1): the section's backgroundOverlay is
   var(--sbk-hero-tint), so content holds no colour. tint-soft and
   tint-strong set --sbk-hero-tint, a --color-dark gradient at full
   strength across the text band and light (10%) outside it. The strength
   is the Brand Kit's minimum for readable white text over a white patch:
   --hero-tint-soft (3:1, headings and large text) and --hero-tint-strong
   (4.5:1, normal text), 50% and 62% until a kit sets them (v0.5.0). Text
   at the bottom: the band is the lower 65%. Text in the middle
   (justify-center): the band runs from 22% to 78%. Under an overlay header
   (.sbk-header-overlay on the body) both gradients add a top band at the
   strong strength (--hero-tint-strong, 62% until a kit sets it) over the
   header, at full strength for var(--space-xlarge) (the header's height
   and a little more), then fading straight into the text band over at
   least as much again, with no lighter stop between (a lighter strip there
   reads as a bar); max() moves the text band's start down when needed, so
   the stops stay in order and the fade keeps its length on a short hero.
   Without an overlay header --sbk-top-on stays 0 and the band is off. No
   image: no overlay, and the section's own background (bg-dark) shows.
   Panel: the text Column carries the framework's overlap-bottom-large (its
   colour, padding, shadow and text colour from the Column settings) and
   runs var(--space-large) below the photo's bottom edge (the overlap minus
   the section's bottom padding, none here), over the next section's top
   padding. A next section with a photo needs top padding at least as large
   as that hang. */
.hero-medium { min-height: 60vh; min-height: 60svh; }
.hero-tall,
.hero-full { min-height: 75vh; min-height: 75svh; }
@media (min-width: 768px) {
    .hero-tall { min-height: 80vh; min-height: 80svh; }
    .hero-full { min-height: 100vh; min-height: 100svh; }
}
.tint-soft { --sbk-tint-a: var(--hero-tint-soft, 50%); }
.tint-strong { --sbk-tint-a: var(--hero-tint-strong, 62%); }
.tint-soft,
.tint-strong {
    --sbk-a: color-mix(in srgb, var(--color-dark) var(--sbk-tint-a), transparent);
    --sbk-l: color-mix(in srgb, var(--color-dark) 10%, transparent);
    --sbk-t: color-mix(in srgb, var(--color-dark) var(--sbk-tint-top, 10%), transparent);
    --sbk-top-end: calc(var(--sbk-top-on, 0) * var(--space-xlarge));
    --sbk-band: max(35%, calc(2 * var(--sbk-top-end)));
    --sbk-f: var(--sbk-l);
    --sbk-hero-tint: linear-gradient(to bottom, var(--sbk-t) 0%, var(--sbk-t) var(--sbk-top-end), var(--sbk-f) var(--sbk-top-end), var(--sbk-a) var(--sbk-band), var(--sbk-a) 100%);
}
.sbk-header-overlay .tint-soft,
.sbk-header-overlay .tint-strong {
    --sbk-top-on: 1;
    --sbk-tint-top: var(--hero-tint-strong, 62%);
    --sbk-f: var(--sbk-t);
}
.justify-center.tint-soft,
.justify-center.tint-strong {
    --sbk-band: max(22%, calc(2 * var(--sbk-top-end)));
    --sbk-hero-tint: linear-gradient(to bottom, var(--sbk-t) 0%, var(--sbk-t) var(--sbk-top-end), var(--sbk-f) var(--sbk-top-end), var(--sbk-a) var(--sbk-band), var(--sbk-a) 78%, var(--sbk-l) 100%);
}

/* ---- footer: the site footer (brand design rev 2.39, 15.2; v0.5.2) ----
   Class placement, set by the footer pattern (and Build's interim
   plain-footer):
   - footer-section on the footer's sbk/section, next to its background
     (bg-dark) and text context (on-dark);
   - footer-icons on the nested sbk/row that holds the sbk/social-icon
     blocks (gap-1);
   - footer-copyright on the copyright sbk/brand-element (with
     marg-top-medium for the space above it).
   On a dark footer (on-dark) the menu links, text links and the social
   icons (outline and glyph, both currentColor) are white, and on hover
   and keyboard focus take the kit's dark-surface ghost hover
   (button_styles.ghost.dark.hover_text, printed as
   --btn-ghost-dark-hover-text; white unless the kit sets it), so every
   hover on a dark surface matches. The board checks it is 4.5:1 on the
   dark colour. Links are picked by place (a menu's li > a, a link in a
   paragraph), never every a, so a button in the footer keeps its own
   colours. A light footer is left as the framework draws it. The
   copyright's own paragraph sets the body size, so the small step is set
   on the p itself.
   Both colours are read through variables (request 28): set
   --sbk-footer-link-color or --sbk-footer-link-hover-color on the
   footer, on a paragraph or menu, or on one link, to recolour those
   links (say, a phone number in the primary colour); a colour class on
   the link alone loses to these selectors. Unset, they are white and the
   ghost hover. */
.footer-section.on-dark li > a,
.footer-section.on-dark p a,
.on-dark .footer-icons a {
    color: var(--sbk-footer-link-color, var(--color-link-on-dark, var(--color-white)));
}
.footer-section.on-dark li > a:hover,
.footer-section.on-dark li > a:focus-visible,
.footer-section.on-dark p a:hover,
.footer-section.on-dark p a:focus-visible,
.on-dark .footer-icons a:hover,
.on-dark .footer-icons a:focus-visible {
    color: var(--sbk-footer-link-hover-color, var(--color-link-hover-on-dark, var(--btn-ghost-dark-hover-text)));
}
.footer-copyright p {
    font-size: var(--fs-small-mobile);
}
@media (min-width: 768px) {
    .footer-copyright p { font-size: var(--fs-small-desktop); }
}
