/* Ridgewell Insurance: targeted fixes layered over tailwind.css and styles.css.
   Linked last on every page so these rules win on equal specificity. */

/* ============== Header nav ============== */
/* Keep multi-word labels ("How We Help") on one line in a crowded header. */
.nav-shell .nav-link { white-space: nowrap; }

/* At tablet widths the desktop links, phone, and CTA don't fit in one row;
   drop the header CTA there (every page repeats it in the hero or body). */
@media (min-width: 768px) and (max-width: 959px) {
  .nav-shell .btn-primary.btn-sm { display: none; }
}

/* "How We Help" dropdown (desktop) */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.nav-dropdown-chevron { width: 12px; height: 12px; transition: transform 0.15s ease; }
.nav-dropdown.is-open .nav-dropdown-chevron { transform: rotate(180deg); }
/* The panel's top padding bridges the gap so the pointer can travel from the trigger into the menu. */
.nav-dropdown-panel {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding-top: 18px;
  display: none;
  z-index: 60;
}
.nav-dropdown.is-open .nav-dropdown-panel,
html:not(.js) .nav-dropdown:hover .nav-dropdown-panel,
html:not(.js) .nav-dropdown:focus-within .nav-dropdown-panel { display: block; }
.nav-dropdown-card {
  width: 330px;
  background: #ffffff;
  border: 1px solid var(--rule-soft);
  border-radius: 16px;
  box-shadow: 0 22px 44px -20px rgba(28, 58, 110, 0.28);
  padding: 0.5rem;
}
.nav-dropdown-item {
  display: block;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  text-decoration: none;
}
.nav-dropdown-item:hover,
.nav-dropdown-item:focus-visible { background: var(--action-tint); outline: none; }
.nav-dropdown-title {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
}
.nav-dropdown-item[aria-current="page"] .nav-dropdown-title { color: var(--action); }
.nav-dropdown-desc {
  display: block;
  margin-top: 2px;
  font-size: 0.83rem;
  color: var(--ink-mute);
}

/* Mobile menu: "How We Help" label with indented service links */
/* A backdrop-filter nested inside the header's own backdrop-filter doesn't paint in Chromium,
   which let page text show through the open menu. Use a solid panel instead. */
.nav-mobile-panel {
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  background: #ffffff;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.nav-mobile-label {
  padding: 1.05rem 0.4rem 0.35rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.nav-mobile-sublink {
  padding: 0.7rem 0.4rem 0.7rem 1.4rem;
  font-size: 1rem;
  color: var(--ink-soft);
}

/* ============== Home hero ============== */
.hero-title {
  font-size: clamp(2.25rem, 5.5vw, 4.25rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  text-wrap: balance;
  /* With the container's 24px side padding, this keeps both headline lines
     at least 32px from the viewport edges at every width. */
  max-width: calc(100% - 16px);
  margin-left: auto;
  margin-right: auto;
}
/* Each headline line is its own block so the two phrases never run together. */
.hero-line {
  display: block;
  text-wrap: balance;
}
.hero-sub {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.35rem;
  font-weight: 600;
  text-wrap: balance;
}
@media (max-width: 639px) {
  .hero-sub { font-size: 1.15rem; }
}

/* ============== Cards with a bottom-aligned button ============== */
.card-with-action {
  display: flex;
  flex-direction: column;
}
.card-with-action .card-action {
  margin-top: auto;
  padding-top: 1.5rem;
}

/* ============== Footer tagline ============== */
.footer-tagline {
  margin-top: 16px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  line-height: 1.9;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}
/* Long email addresses must be able to wrap in narrow columns (footer, contact sidebar). */
a[href^="mailto:"] { overflow-wrap: anywhere; }

/* ============== Home: the mortgage math ============== */
/* Four stats: one row from 1024px, 2x2 on tablets, stacked on phones. */
.stat-grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
/* From 768px every card matches the tallest; stacked cards below that size to their content. */
@media (min-width: 768px) { .stat-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 1fr; } }
@media (min-width: 1024px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card { padding: 2.25rem; }
.stat-big {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--action);
}
.stat-text { margin-top: 0.75rem; font-size: 1.125rem; line-height: 1.6; color: var(--ink-soft); }
@media (min-width: 1024px) {
  .stat-card { padding: 1.75rem; }
  .stat-big { font-size: clamp(2rem, 2.9vw, 3rem); white-space: nowrap; }
  .stat-text { font-size: 1.05rem; }
}

/* ============== MAP: calculator ============== */
/* Keep the section heading clear of the fixed header when arriving via /mortgage-accelerator-program#calculator. */
.calc-section { scroll-margin-top: 24px; }

.calc-h3 { font-size: clamp(1.5rem, 2.6vw, 1.875rem); line-height: 1.2; letter-spacing: -0.01em; }
.calc-card { padding: 2.25rem; }
.calc-card:hover { transform: none; }
@media (max-width: 639px) {
  .calc-card { padding: 1.5rem 1.25rem; }
}

/* Inputs */
.calc-inputs { display: grid; grid-template-columns: 1fr; gap: 1.75rem; margin-top: 2rem; }
.calc-card > .calc-inputs:first-child { margin-top: 0; }
@media (min-width: 900px) {
  .calc-inputs { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
}
.calc-field-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.calc-field-head .calc-label { letter-spacing: 0.08em; white-space: nowrap; }
.calc-label {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-mute);
}
.calc-num-wrap {
  cursor: text;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 44px;
  padding: 0 0.75rem;
  border: 1.5px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
}
.calc-num-wrap:focus-within { border-color: var(--action); box-shadow: 0 0 0 3px var(--action-glow); }
.calc-affix { font-family: 'Space Grotesk', sans-serif; font-weight: 600; color: var(--ink-soft); }
.calc-num {
  width: 7.5ch;
  min-height: 42px;
  border: 0;
  background: transparent;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  text-align: right;
  -moz-appearance: textfield;
  appearance: textfield;
}
.calc-num:focus { outline: none; }
.calc-num::-webkit-outer-spin-button,
.calc-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#calc-balance-num { width: 10ch; }

/* Range slider: the 44px-tall input is the touch target; the visible track stays thin. */
.calc-range {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 44px;
  margin-top: 0.5rem;
  background: transparent;
  cursor: pointer;
}
.calc-range:focus { outline: none; }
.calc-range::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: var(--rule); }
.calc-range::-moz-range-track { height: 6px; border-radius: 999px; background: var(--rule); }
.calc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -10px;
  border-radius: 50%;
  background: var(--action);
  border: 3px solid #ffffff;
  box-shadow: 0 2px 8px rgba(28, 58, 110, 0.35);
}
.calc-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--action);
  border: 3px solid #ffffff;
  box-shadow: 0 2px 8px rgba(28, 58, 110, 0.35);
}
.calc-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--action-glow), 0 2px 8px rgba(28, 58, 110, 0.35); }
.calc-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--action-glow), 0 2px 8px rgba(28, 58, 110, 0.35); }

/* Outputs */
.calc-results { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--rule-soft); }
.calc-outputs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1.25rem; }
@media (max-width: 639px) {
  .calc-outputs-3 { grid-template-columns: 1fr; gap: 1.25rem; }
}
@media (min-width: 900px) {
  .calc-outputs { grid-template-columns: repeat(4, 1fr); }
  .calc-outputs-3 { grid-template-columns: repeat(3, 1fr); }
}
.calc-out-value {
  margin-top: 0.4rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.calc-out-accent { color: var(--action); }
.calc-sentence { margin-top: 1.75rem; font-size: 1.125rem; line-height: 1.6; color: var(--ink); font-weight: 500; }

/* ============== Home: why families trust Ridgewell ============== */
.trust-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3.5rem;
  margin-top: 3.5rem;
}
@media (min-width: 1024px) {
  .trust-grid { grid-template-columns: 5fr 7fr; gap: 5rem; }
}
.trust-founder-name {
  margin-top: 1.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink);
}
.trust-founder .pullquote-attribution { margin-top: 0.25rem; }
.trust-founder-bio { margin-top: 1.25rem; color: var(--ink-soft); line-height: 1.7; }
.trust-founder .pullquote-rule { margin: 1.75rem 0 1.25rem; }
.trust-founder .founder-quote-text { font-size: clamp(1.25rem, 2vw, 1.5rem); }
.trust-promises { display: flex; flex-direction: column; gap: 2.25rem; }
.trust-promise { display: flex; gap: 1.25rem; align-items: flex-start; }
.trust-promise .card-icon { flex-shrink: 0; margin-bottom: 0; }
/* Longer button labels must stay inside narrow cards on phones. */
.card-action .btn { max-width: 100%; white-space: normal; text-align: center; }

/* Very small phones: long single words in section headings ("recommendation") must fit the column. */
@media (max-width: 359px) {
  h2.text-4xl { font-size: 1.75rem; }
}

/* Text for screen readers and crawlers only (e.g. "Learn more" link context). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
