/*
 * Utilities product design layer
 *
 * This stylesheet is loaded after page-level styles so the legacy calculator
 * templates and the newer search-calculator template share one visual system.
 * The direction is intentionally quiet and editorial: ink navy, warm coral,
 * paper-white surfaces, firm borders, and tabular numbers where users compare
 * estimates.
 */

:root {
  --product-ink: #102a56;
  --product-ink-strong: #071b3d;
  --product-muted: #607089;
  --product-line: #d8e2ef;
  --product-line-strong: #b9c9dd;
  --product-surface: #ffffff;
  --product-surface-soft: #f5f8fc;
  --product-accent: #c63d34;
  --product-accent-dark: #a62f28;
  --product-accent-soft: #fff3f0;
  --product-blue: #245fbd;
  --product-radius: 14px;
  --product-shadow: 0 14px 34px rgba(16, 42, 86, 0.08);
}

html {
  scroll-behavior: smooth;
}

/* Shared shell for all non-hub calculator and guide pages. */
body:not(.home-hub) {
  background: #f7f8fb;
  color: var(--product-ink);
  font-family: "Avenir Next", "Hiragino Sans", "Yu Gothic", "Segoe UI", system-ui, sans-serif;
  line-height: 1.6;
}

body:not(.home-hub) .entry-shell {
  width: min(100%, 1180px);
  margin-inline: auto;
  padding: 0 24px 64px;
}

body:not(.home-hub):not(.search-calculator-page) .entry-nav {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0;
  border-bottom: 1px solid var(--product-line);
}

body:not(.home-hub):not(.search-calculator-page) .entry-nav a {
  color: var(--product-ink);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
  text-underline-offset: 4px;
}

body:not(.home-hub):not(.search-calculator-page) .entry-nav a:first-child::before {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 9px;
  border-radius: 2px;
  background: var(--product-accent);
  content: "";
  vertical-align: 1px;
}

body:not(.home-hub):not(.search-calculator-page) .entry-nav a:hover,
body:not(.home-hub):not(.search-calculator-page) .entry-nav a:focus-visible {
  color: var(--product-accent-dark);
  text-decoration: underline;
}

body:not(.home-hub):not(.search-calculator-page) .entry-hero {
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
  margin: 0;
  padding: clamp(52px, 7vw, 86px) 0 40px;
}

body:not(.home-hub):not(.search-calculator-page) .entry-hero h1 {
  max-width: 720px;
  margin: 0 0 18px;
  color: var(--product-ink-strong);
  font-size: clamp(2.35rem, 5vw, 4.35rem);
  font-weight: 850;
  letter-spacing: -0.055em;
  line-height: 1.02;
  text-wrap: balance;
}

body:not(.home-hub):not(.search-calculator-page) .entry-hero p {
  max-width: 700px;
  margin: 0 0 24px;
  color: var(--product-muted);
  font-size: clamp(1rem, 2vw, 1.13rem);
  line-height: 1.72;
}

body:not(.home-hub) .entry-card,
body:not(.home-hub) .entry-section {
  border-color: var(--product-line);
  border-radius: var(--product-radius);
  background: var(--product-surface);
  box-shadow: var(--product-shadow);
}

body:not(.home-hub):not(.search-calculator-page) .entry-card.entry-calculator-card {
  align-self: start;
  border-color: var(--product-line-strong);
  box-shadow: 0 18px 40px rgba(16, 42, 86, 0.12);
}

body:not(.home-hub):not(.search-calculator-page) .entry-card.entry-calculator-card h2 {
  color: var(--product-ink-strong);
  font-size: 1.28rem;
  letter-spacing: -0.025em;
}

body:not(.home-hub) .entry-section {
  margin-top: 24px;
  padding: clamp(24px, 4vw, 36px);
}

body:not(.home-hub) .entry-section h2,
body:not(.home-hub) .mini-card h3,
body:not(.home-hub) .priority-card h3,
body:not(.home-hub) .intent-step h3,
body:not(.home-hub) .link-panel h3 {
  color: var(--product-ink-strong);
  letter-spacing: -0.025em;
}

body:not(.home-hub) .entry-section h2 {
  margin-bottom: 18px;
  font-size: clamp(1.4rem, 3vw, 1.95rem);
  line-height: 1.2;
}

body:not(.home-hub) .entry-section p,
body:not(.home-hub) .entry-section li,
body:not(.home-hub) .mini-card p,
body:not(.home-hub) .priority-card p,
body:not(.home-hub) .intent-step p,
body:not(.home-hub) .link-panel p {
  color: var(--product-muted);
  line-height: 1.7;
}

body:not(.home-hub) .mini-card,
body:not(.home-hub) .priority-card,
body:not(.home-hub) .intent-step,
body:not(.home-hub) .link-panel {
  border-color: var(--product-line);
  border-radius: 10px;
  background: var(--product-surface-soft);
  box-shadow: none;
}

body:not(.home-hub) .mini-card:hover,
body:not(.home-hub) .priority-card:hover,
body:not(.home-hub) .intent-step:hover,
body:not(.home-hub) .link-panel:hover {
  border-color: var(--product-line-strong);
  box-shadow: 0 10px 24px rgba(16, 42, 86, 0.07);
  transform: translateY(-1px);
}

body:not(.home-hub) .primary-cta,
body:not(.home-hub) .secondary-cta {
  min-height: 46px;
  border-radius: 8px;
  font-weight: 820;
  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

body:not(.home-hub) .primary-cta {
  border: 1px solid var(--product-accent);
  background: var(--product-accent);
  box-shadow: 0 7px 16px rgba(198, 61, 52, 0.16);
}

body:not(.home-hub) .primary-cta:hover,
body:not(.home-hub) .primary-cta:focus-visible {
  border-color: var(--product-accent-dark);
  background: var(--product-accent-dark);
  box-shadow: 0 10px 20px rgba(166, 47, 40, 0.2);
  transform: translateY(-1px);
}

body:not(.home-hub) .secondary-cta {
  border: 1px solid var(--product-line-strong);
  background: var(--product-surface);
  color: var(--product-ink);
}

body:not(.home-hub) .secondary-cta:hover,
body:not(.home-hub) .secondary-cta:focus-visible {
  border-color: var(--product-blue);
  background: #eef4ff;
  color: var(--product-blue);
}

body:not(.home-hub) .entry-field input,
body:not(.home-hub) .entry-field select,
body:not(.home-hub) .entry-field textarea {
  min-height: 46px;
  border-color: var(--product-line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--product-ink-strong);
  font-variant-numeric: tabular-nums;
}

body:not(.home-hub) .entry-field input:focus,
body:not(.home-hub) .entry-field select:focus,
body:not(.home-hub) .entry-field textarea:focus {
  border-color: var(--product-blue);
  box-shadow: 0 0 0 3px rgba(36, 95, 189, 0.13);
  outline: 0;
}

body:not(.home-hub) .ad-unit {
  min-height: 90px;
  margin: 32px 0;
}

body:not(.home-hub) .footer-note {
  color: var(--product-muted);
}

/* Search-calculator pages: keep the best existing template, add the same
 * paper background and stronger page rhythm as the legacy pages. */
body.search-calculator-page {
  background: #f7f8fb;
}

body.search-calculator-page .entry-shell {
  padding-bottom: 68px;
}

body.search-calculator-page .entry-site-header {
  border-bottom-color: var(--product-line);
}

body.search-calculator-page .entry-card.entry-calculator-card {
  border-color: var(--product-line-strong);
  box-shadow: 0 18px 40px rgba(16, 42, 86, 0.11);
}

body.search-calculator-page .entry-result-panel {
  background: #fff1ee;
}

body.search-calculator-page .entry-section {
  background: transparent;
}

body.search-calculator-page .link-panel {
  background: var(--product-surface);
}

/* The hub is the front door: add a little more product signature without
 * replacing its strong existing layout or hiding the catalog. */
body.home-hub .site-header {
  border-bottom: 1px solid var(--hub-line);
  background: var(--hub-surface-soft);
}

body.home-hub .main-content {
  background: #fff;
}

body.home-hub .hub-search-control {
  box-shadow: 0 14px 32px rgba(16, 42, 86, 0.1);
}

body.home-hub .hub-category,
body.home-hub .calculator-priority-link,
body.home-hub .hub-popular-card,
body.home-hub .search-entry-card,
body.home-hub .travel-hub .info-card,
body.home-hub .hub-journey-card,
body.home-hub .hub-tool-card,
body.home-hub .hub-language-card {
  border-radius: 12px;
}

body.home-hub .hub-category:hover,
body.home-hub .calculator-priority-link:hover,
body.home-hub .hub-popular-card:hover,
body.home-hub .search-entry-card:hover,
body.home-hub .travel-hub .info-card:hover,
body.home-hub .hub-journey-card:hover,
body.home-hub .hub-tool-card:hover,
body.home-hub .hub-language-card:hover {
  box-shadow: 0 14px 28px rgba(16, 42, 86, 0.1);
}

body.home-hub .hub-source-note {
  background: #f8fbf9;
}

body:not(.home-hub) :focus-visible {
  outline: 3px solid rgba(36, 95, 189, 0.34);
  outline-offset: 3px;
}

@media (max-width: 760px) {
  body:not(.home-hub) .entry-shell {
    padding-inline: 15px;
    padding-bottom: 44px;
  }

  body:not(.home-hub):not(.search-calculator-page) .entry-nav {
    min-height: 62px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
  }

  body:not(.home-hub):not(.search-calculator-page) .entry-hero {
    grid-template-columns: 1fr;
    padding: 42px 0 26px;
  }

  body:not(.home-hub):not(.search-calculator-page) .entry-hero h1 {
    font-size: clamp(2.2rem, 11vw, 3.15rem);
  }

  body:not(.home-hub) .entry-section {
    padding: 24px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  body:not(.home-hub) *,
  body:not(.home-hub) *::before,
  body:not(.home-hub) *::after {
    transition-duration: 0.01ms !important;
  }
}
