/*
Theme Name:  Horsham Hearing (Kadence Child)
Theme URI:   https://horshamhearing.com
Template:    kadence
Author:      Horsham Hearing
Description: Child theme for horshamhearing.com. Brand tokens, base type and component overrides — layout lives in Kadence Blocks.
Version:     0.4.3
Text Domain: kadence-child
*/

/* ── Carlito (metric-compatible Calibri), self-hosted ───────────────
   woff2 from @fontsource/carlito 5.3.0, Latin subset, OFL (assets/fonts/OFL.txt). */
@font-face {
  font-family: 'Carlito';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/carlito-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Carlito';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/carlito-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Carlito';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/carlito-latin-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Carlito';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/carlito-latin-700-italic.woff2') format('woff2');
}

/* ── Tokens (canonical values in 00_ §3; warmth direction v0.2) ──────
   Kadence global palette slots 1–9 mirror these (functions.php; slots 10–15 are Kadence's):
   1 navy · 2 navy hover · 3 navy · 4 ink · 5 taupe · 6 edge · 7 sand · 8 cream · 9 white.
   Gold and gold-tint have no palette slot; use var(--hh-gold) / var(--hh-gold-tint).
   Contrast (WCAG 2.x), on cream / sand / gold-tint / white:
     ink 13.7/12.0/12.2/14.9 · taupe 5.7/5.0/5.1/6.2 · teal-ink 6.2/5.4/5.5/6.7
     navy 13.4/11.8/12.0/14.6 · edge 4.6/4.0/4.1/5.0 · teal 4.3/3.8/3.9/4.7 (UI + ≥24px only) */
:root {
  --hh-navy: #1B2A3C;       /* headings, primary pill, footer */
  --hh-navy-hover: #2E4466;
  --hh-teal: #3D7E7C;       /* icons, focus ring, text ≥24px only (4.31:1 on cream). Body-size text uses --hh-teal-ink. */
  --hh-teal-ink: #32645F;   /* eyebrows, links, italic accents */
  --hh-gold: #C8962A;       /* waveform motif and rules; as text only on navy (5.4:1) */
  --hh-gold-tint: #F4E8CC;  /* icon badges, highlight band */
  --hh-cream: #F8F5EF;      /* page ground */
  --hh-sand: #EFE6D6;       /* alternate bands, cards, fields (replaces cream deep #EFE9DE) */
  --hh-ink: #2A2724;        /* body text */
  --hh-taupe: #6B5F52;      /* secondary text (replaces stone #5B6470) */
  --hh-edge: #7A6E62;       /* field borders, dividers, placeholders — warm-shifted from #7B7F86; ≥4:1 on every ground */
  --hh-error: #A3312A;      /* 6.9:1 on white, 6.4:1 on cream */
  --hh-white: #FFFFFF;      /* form card and floating cards only */

  /* Shape and surface */
  --hh-radius-card: 24px;
  --hh-radius-field: 12px;
  --hh-radius-pill: 999px;
  --hh-shadow-soft: 0 1px 2px rgba(42, 39, 36, .06), 0 12px 32px rgba(42, 39, 36, .06);
  --hh-band-gutter: clamp(12px, 2vw, 24px); /* keeps rounded bands off the screen edge */
  /* Static gold waveform (gold #C8962A, round caps); hh-wave.js animates a copy. */
  --hh-wave-static: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 24' fill='none' stroke='%23C8962A' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M4 10v4M10 7v10M16 4v16M22 9v6M28 11v2M38 8v8M44 3v18M50 6v12M56 2v20M62 7v10M68 10v4M78 9v6M84 5v14M90 8v8M96 11v2M106 9v6M112 6v12M116 10v4'/%3E%3C/svg%3E");

  --hh-serif: Georgia, 'Times New Roman', serif;
  --hh-sans: Calibri, Carlito, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

/* ── Base type ───────────────────────────────────────────────────── */
body {
  font-family: var(--hh-sans);
  font-size: 20px;
  line-height: 1.6;
  color: var(--hh-ink);
  background: var(--hh-cream);
}
h1, h2, h3, h4, .entry-title, .site-title {
  font-family: var(--hh-serif);
  font-weight: 400;
  color: var(--hh-navy);
}
h1 { font-size: 56px; line-height: 1.15; }
h2 { font-size: 40px; line-height: 1.2; }
h3 { font-size: 28px; line-height: 1.3; }
@media (max-width: 767px) {
  body { font-size: 18px; }
  h1 { font-size: 40px; }
  h2 { font-size: 32px; }
  h3 { font-size: 24px; }
}
a { color: var(--hh-teal-ink); text-underline-offset: 4px; }
a:hover { color: var(--hh-navy); }

.hh-eyebrow {
  font-family: var(--hh-sans);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hh-teal-ink);
  margin: 0;
}
.hh-lede { font-size: 24px; line-height: 1.5; }
.hh-small { font-size: 17px; line-height: 1.5; color: var(--hh-taupe); }

/* ── Coming Soon page (Home, ID 18) ──────────────────────────────── */

/* Subhead under the H1 — a lead, not a section heading. */
.hh-lead {
  font-weight: 400;
  line-height: 1.4;
  margin-block-start: 0.5em;
}

/* Sits on the cream page ground below the form card: taupe 5.7:1 (palette 5). */
.hh-microcopy {
  line-height: 1.5;
  margin-block-start: 0.75em;
  color: var(--hh-taupe);
}

.hh-footer-line {
  line-height: 1.6;
  margin-block-end: 0.25em;
}

.hh-footer-line a {
  color: inherit;
  text-decoration: underline;
}

/* ── Gold rule → waveform (v0.4.2: every .hh-rule, site-wide) ─────────
   Every .hh-rule separator draws the gold speech waveform instead of the old
   64 × 2 line, from theme CSS — page content keeps its core/separator blocks.
   Same bars as the inline .hh-wave SVG below, as a data URI (gold #C8962A,
   round caps). Gold is ~2.5:1 on cream: fine for a decorative mark, never text.
   Left-aligned by default; centered after centered text, with .aligncenter,
   and on the Coming Soon page. The centering selectors carry the
   hr.wp-block-separator prefix so they outrank the base rule. */
.hh-rule,
hr.wp-block-separator.hh-rule {
  width: 120px !important;
  max-width: 120px;
  height: 24px;
  border: 0;
  background: var(--hh-wave-static) left center / 120px 24px no-repeat;
  margin: 0 0 24px 0;
  opacity: 1;
}
/* Animation (v0.4.3): assets/js/hh-wave.js swaps in an animated copy of this
   SVG when each rule scrolls into view — 3 bursts, ~3.7 s, then at rest.
   No JS or reduced motion = this static waveform. The !important here beats
   the script's inline style if reduced motion is switched on mid-visit. */
@media (prefers-reduced-motion: reduce) {
  .hh-rule,
  hr.wp-block-separator.hh-rule {
    background-image: var(--hh-wave-static) !important;
  }
}
.has-text-align-center + hr.wp-block-separator.hh-rule,
hr.wp-block-separator.hh-rule.aligncenter,
.page-id-18 hr.wp-block-separator.hh-rule {
  margin-left: auto;
  margin-right: auto;
}

/* ── Waveform motif (replaces the 64px gold rule) ────────────────────
   Inline use — decorative, so always aria-hidden and unfocusable:
     <svg class="hh-wave" aria-hidden="true" focusable="false" viewBox="0 0 120 24">
       <path d="M4 10v4M10 7v10M16 4v16M22 9v6M28 11v2 M38 8v8M44 3v18M50 6v12M56 2v20M62 7v10M68 10v4
                M78 9v6M84 5v14M90 8v8M96 11v2 M106 9v6M112 6v12M116 10v4"/>
     </svg>
   Add .hh-wave--pulse for a gentle pulse (3 iterations, off under reduced motion).
   Bars in word-like bursts; stroke is currentColor, so color sets the gold. */
.hh-wave {
  display: block;
  width: 120px;
  height: 24px;
  margin: 0 0 24px 0;
  color: var(--hh-gold);
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  overflow: visible;
}
.has-text-align-center + .hh-wave,
.hh-wave.aligncenter,
.page-id-18 .hh-wave {
  margin-left: auto;
  margin-right: auto;
}
.hh-wave--pulse path {
  transform-box: fill-box;
  transform-origin: center;
  animation: hh-wave-pulse 1.6s ease-in-out 3;
}
@keyframes hh-wave-pulse {
  0%, 100% { transform: scaleY(1); }
  50%      { transform: scaleY(.6); }
}
@media (prefers-reduced-motion: reduce) {
  .hh-wave--pulse path { animation: none; }
}

/* ── Focus: 3px teal, 3px offset, everywhere ─────────────────────── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.wp-block-button__link:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--hh-teal);
  outline-offset: 3px;
}

/* ── Buttons and fields ──────────────────────────────────────────────
   :not(.fluentform *) keeps these generic rules off Fluent Forms markup, which
   is styled by its own stylesheet plus the submit-button rules further down. */
.wp-block-button__link,
.button:not(.fluentform *),
button[type="submit"]:not(.fluentform *),
input[type="submit"]:not(.fluentform *) {
  min-height: 56px;
  padding: 0 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--hh-radius-pill);
  background: var(--hh-navy);
  color: #FFFFFF;
  font-family: var(--hh-sans);
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
  box-sizing: border-box;
}
.wp-block-button__link:hover,
.button:not(.fluentform *):hover,
button[type="submit"]:not(.fluentform *):hover,
input[type="submit"]:not(.fluentform *):hover {
  background: var(--hh-navy-hover);
  color: #FFFFFF;
}
.wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  color: var(--hh-navy);
  border: 2px solid var(--hh-navy);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: var(--hh-navy);
  color: #FFFFFF;
}
.wp-block-button.hh-phone .wp-block-button__link { background: var(--hh-teal-ink); }
.wp-block-button.hh-phone .wp-block-button__link:hover { background: var(--hh-navy); }

/* Sand fill + 1px warm edge (4.0:1 on sand, WCAG 1.4.11) */
:is(input[type="text"], input[type="email"], input[type="tel"], select, textarea):not(.fluentform *) {
  min-height: 56px;
  box-sizing: border-box;
  padding: 0 16px;
  border: 1px solid var(--hh-edge);
  border-radius: var(--hh-radius-field);
  background: var(--hh-sand);
  font-family: var(--hh-sans);
  font-size: 20px;
  color: var(--hh-ink);
}
textarea:not(.fluentform *) { padding: 12px 16px; }
:is(input, select, textarea):not(.fluentform *):focus {
  border: 2px solid var(--hh-navy);
  background: #FFFFFF;
}
label:not(.fluentform *) { font-size: 18px; font-weight: 700; color: var(--hh-navy); }

/* ── Waitlist submit button (Fluent Forms) ───────────────────────────
   Fluent Forms ships #1a7efb and injects
     form.fluent_form_3 .ff-btn-submit:not(.ff_btn_no_style)   → (0,3,1)
   from a late, JS-added inline <style>. A plain `.fluentform .ff-btn-submit`
   (0,2,0) loses to it, and matching its specificity would still lose on source
   order — so these selectors are deliberately one step more specific (0,4,1).
   No !important needed. Tokens, not palette slots: gold has no slot. */

.fluentform form.frm-fluent-form .ff-btn-submit:not(.ff_btn_no_style) {
  background-color: var(--hh-navy);
  color: var(--hh-cream);                     /* 13.4:1 on navy */
  border: 1px solid var(--hh-navy);
  border-radius: var(--hh-radius-pill);       /* navy pill */
  min-height: 52px;                           /* ≥44px target */
  padding: 0 32px;
  transition: background-color .15s ease-in-out,
              color .15s ease-in-out,
              border-color .15s ease-in-out;
}

.fluentform form.frm-fluent-form .ff-btn-submit:not(.ff_btn_no_style):hover,
.fluentform form.frm-fluent-form .ff-btn-submit:not(.ff_btn_no_style):focus-visible {
  background-color: var(--hh-gold);
  /* Gold against cream is 2.46:1, under the 3:1 that WCAG 1.4.11 needs for the
     button's boundary, so the 1px border stays navy on hover (13.4:1 on cream). */
  border-color: var(--hh-navy);
  /* Navy on gold is 5.4:1. Keeping cream here would be 2.5:1 and fail AA,
     so the label flips to navy rather than staying cream. */
  color: var(--hh-navy);
  /* Fluent Forms drops the button to opacity .8 on hover, which dulls the gold. */
  opacity: 1;
}

/* Fluent Forms sets `outline: 0` on :focus; restore a real, visible ring.
   Navy reads 5.4:1 against the gold button and 13.4:1 against the cream page,
   so the ring is clearly visible on both sides of its edge. */
.fluentform form.frm-fluent-form .ff-btn-submit:not(.ff_btn_no_style):focus-visible {
  outline: 3px solid var(--hh-navy);
  outline-offset: 2px;
}

/* ── Waitlist form card + fields (Fluent Forms, Form 3) ──────────────
   White card with the soft shadow on the cream ground. Fields: 12px radius and
   a warm edge, replacing FF's #dadbdd border (1.4:1 on white, fails 1.4.11).
   FF's `.ff-default .ff-el-form-control:focus` (0,3,0) sets outline:none, which
   beats the global teal ring, so the ring is restated here at (0,4,1). */
.fluentform.fluentform_wrapper_3 {
  background: var(--hh-white);
  border-radius: var(--hh-radius-card);
  box-shadow: var(--hh-shadow-soft);
  padding: 32px;
  /* FF's default error red #f56c6c is 2.9:1 on white; --hh-error is 6.9:1. */
  --fluentform-danger: var(--hh-error);
}
@media (max-width: 767px) {
  .fluentform.fluentform_wrapper_3 { padding: 24px; }
}
.fluentform form.frm-fluent-form .ff-el-input--content .ff-el-form-control {
  border-color: var(--hh-edge);               /* 5.0:1 on white */
  border-radius: var(--hh-radius-field);
  color: var(--hh-ink);
}
.fluentform form.frm-fluent-form .ff-el-input--content .ff-el-form-control:focus {
  border-color: var(--hh-navy);
}
.fluentform form.frm-fluent-form .ff-el-input--content .ff-el-form-control:focus-visible {
  outline: 3px solid var(--hh-teal);          /* 4.7:1 on white */
  outline-offset: 3px;
}
.fluentform form.frm-fluent-form .ff-el-is-error .text-danger {
  font-size: 16px;                            /* FF ships 12px */
}

/* ── Cards and bands ─────────────────────────────────────────────────
   No 1px gray borders. Cards sit on sand by default; on a sand band they
   become white "floating" cards with the soft shadow (white is reserved for
   the form card and floating cards). Bands are rounded panels (24px) held
   off the screen edge by a gutter, so the corners never meet the viewport. */
.hh-card {
  background: var(--hh-sand);
  border: 0;
  border-radius: var(--hh-radius-card);
}
:is(.hh-band-deep, .hh-band-sand, .hh-band-gold-tint) .hh-card {
  background: var(--hh-white);
  box-shadow: var(--hh-shadow-soft);
}
.hh-band-white { background: var(--hh-white); }
.hh-band-deep,
.hh-band-sand { background: var(--hh-sand); }
.hh-band-gold-tint { background: var(--hh-gold-tint); }
.hh-band-navy { background: var(--hh-navy); color: var(--hh-cream); }
:is(.hh-band-white, .hh-band-deep, .hh-band-sand, .hh-band-gold-tint, .hh-band-navy) {
  border-radius: var(--hh-radius-card);
  margin-inline: var(--hh-band-gutter);
}
.hh-band-navy h1, .hh-band-navy h2, .hh-band-navy h3 { color: #FFFFFF; }
.hh-band-navy a { color: #FFFFFF; }

/* Icon badge: gold-tint disc behind a teal icon (teal 3.9:1 on gold-tint, UI ≥3:1). */
.hh-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--hh-radius-pill);
  background: var(--hh-gold-tint);
  color: var(--hh-teal);
}

/* Utility / top bar (no template uses one yet): sand ground, never navy —
   navy is reserved for the footer and primary buttons. */
.hh-topbar,
.site-top-header-wrap .site-header-row-container-inner {
  background: var(--hh-sand);
  color: var(--hh-ink);
}

/* Placeholder content marker (staging only) */
.hh-placeholder {
  border: 1px dashed var(--hh-edge);
  border-radius: var(--hh-radius-card);
  background: var(--hh-sand);
  color: var(--hh-taupe);
}

/* ── Header branding ─────────────────────────────────────────────────
   The horizontal logo SVG already carries the "HORSHAM HEARING" wordmark, so
   Kadence's typed site title beside it is redundant. Hidden here (theme-owned,
   ships with the theme); the logo <img alt="Horsham Hearing"> stays inside the
   home link, so the link's accessible name is unchanged — and no longer doubled. */
.site-branding .brand.has-logo-image .site-title-wrap {
  display: none;
}

/* ── Mobile tap-to-call bar (markup in functions.php) ────────────── */
.hh-callbar { display: none; }
@media (max-width: 767px) {
  .hh-callbar {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    height: 60px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--hh-navy);
    color: #FFFFFF;
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
  }
  .hh-callbar:hover { color: #FFFFFF; }
  body { padding-bottom: 60px; }
}
