/* ==========================================================================
   STYLE.CSS
   Base reset, typography, layout, header, footer, and reusable components.
   Paper visual system lives in paper-theme.css; breakpoints in responsive.css
   ========================================================================== */

/* =================================================
   Global / Base Styles
================================================= */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  padding: 28px 18px calc(var(--mobile-nav-height) + 28px);
}

img { max-width: 100%; display: block; }

a { color: var(--dark-blue); text-decoration: none; }

ul { list-style: none; margin: 0; padding: 0; }

button { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--dark-blue);
  outline-offset: 3px;
}

/* =================================================
   Typography
================================================= */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--dark-blue);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2.1rem, 4.2vw, 3.1rem); letter-spacing: 0.01em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.55rem); }
h4 { font-size: 1.1rem; }

p { margin: 0 0 1em; max-width: 68ch; color: #33302a; }

.eyebrow {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-blue);
  font-size: 1rem;
  margin-bottom: 0.35em;
  display: block;
}

.lede {
  font-size: 1.14rem;
  color: var(--muted-grey);
  max-width: 58ch;
}

/* =================================================
   Layout helpers
================================================= */

.content {
  padding: 18px clamp(18px, 4vw, 56px) 30px;
}

.section__head {
  margin-bottom: 18px;
  max-width: 62ch;
}

.grid {
  display: grid;
  gap: 26px;
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.stack { display: flex; flex-direction: column; gap: 10px; }

.rule-list > li + li { margin-top: 0; }

/* =================================================
   Header & Navigation
================================================= */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 8px;
  padding-bottom: 8px;
  /* Full-bleed fixed bar: padding-inline centers the same max-1120px
     content column used by .content/.site-footer, so the bar can span
     the whole viewport while the brand/nav still line up with the page
     content underneath. */
  padding-inline: calc(max(0px, (100% - 1120px) / 2) + clamp(18px, 4vw, 56px));
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 140;
  background: var(--paper);
  box-shadow: 0 1px 0 var(--ink-blue-35), 0 6px 16px -14px var(--paper-shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand__logo {
  display: block;
  height: 62px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  flex-shrink: 0;
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--dark-blue);
  letter-spacing: 0.01em;
}

.brand__tagline {
  font-size: 0.72rem;
  color: var(--muted-grey);
  font-style: italic;
  letter-spacing: 0.03em;
}

.primary-nav ul {
  display: flex;
  align-items: center;
  gap: 30px;
}

.primary-nav a {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--dark-blue);
  padding: 4px 2px;
  position: relative;
}

.primary-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: var(--ink-blue);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.primary-nav a:hover::after,
.primary-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.primary-nav a[aria-current="page"] {
  color: var(--ink-blue);
  font-style: italic;
}

.header-rule {
  margin: 0 clamp(18px, 4vw, 56px);
}

/* =================================================
   Buttons / CTAs
================================================= */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.02rem;
  padding: 12px 26px;
  border: 1.5px solid var(--dark-blue);
  color: var(--dark-blue);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn:hover,
.btn.is-pressed { background: var(--dark-blue); color: var(--paper); }

.btn--filled {
  background: var(--dark-blue);
  color: var(--paper);
}

.btn--filled:hover {
  background: var(--ink-blue);
  border-color: var(--ink-blue);
}

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* =================================================
   Reusable components
================================================= */

.content-panel {
  border: 1px solid var(--ink-blue-35);
  background: var(--paper-secondary);
  padding: clamp(12px, 1.8vw, 16px) clamp(14px, 2vw, 18px);
  position: relative;
}

.content-panel::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid var(--ink-blue-10);
  pointer-events: none;
}

.content-panel h2 { margin-bottom: 0.3em; }
.content-panel > p { margin-bottom: 0.6em; }

.content-panel__num {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--faded-blue);
  font-size: 0.95rem;
  display: block;
  margin-bottom: 6px;
}

.stat-row {
  display: flex;
  gap: 34px;
  flex-wrap: wrap;
}

.stat {
  border-left: 1px solid var(--ink-blue-35);
  padding-left: 16px;
}

.stat__num {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--dark-blue);
  font-weight: 700;
  display: block;
}

.stat__label {
  color: var(--muted-grey);
  font-size: 0.9rem;
}

.quote-block {
  border-top: 1px solid var(--ink-blue-35);
  border-bottom: 1px solid var(--ink-blue-35);
  padding: 22px 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--dark-blue);
}

.cta-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(82px + env(safe-area-inset-top, 0px)) 16px 16px;
  overflow: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 100001;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.cta-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.cta-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 18, 26, 0.58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.cta-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  max-height: min(82vh, 700px);
  overflow: auto;
  margin: auto;
  background: rgba(255, 252, 244, 0.98);
  border: 1px solid rgba(20, 58, 90, 0.2);
  border-radius: 18px;
  box-shadow: 0 22px 60px rgba(15, 33, 52, 0.2);
  padding: clamp(22px, 4vw, 32px);
  box-sizing: border-box;
  transform: translateY(0) scale(1);
  transition: transform 0.25s ease;
}

.cta-modal.is-open .cta-modal__dialog {
  transform: translateY(0) scale(1);
}

.cta-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink-blue-35);
  background: transparent;
  color: var(--dark-blue);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.cta-modal__close:hover,
.cta-modal__close:focus-visible {
  background: var(--dark-blue);
  color: var(--paper);
  border-color: var(--dark-blue);
}

.cta-modal h3 {
  margin: 0 0 18px;
  color: var(--dark-blue);
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.2;
}

.cta-modal__form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cta-modal .field {
  margin-bottom: 0;
  width: 100%;
}

.cta-modal .field input {
  width: 100%;
  box-sizing: border-box;
  border-radius: 10px;
}

.cta-modal .btn {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
}

.cta-modal .field--error input {
  border-color: #9c4234;
  background: #fbf1ee;
}

.cta-modal .field__error {
  color: #9c4234;
  font-size: 0.8rem;
  min-height: 1.1em;
}

.cta-modal__success {
  margin: 12px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(20, 110, 63, 0.3);
  background: rgba(227, 244, 233, 0.9);
  color: #214f37;
  font-size: 0.92rem;
}

.cta-modal__error {
  margin: 12px 0 0;
  padding: 10px 12px;
  background: rgba(156, 66, 52, 0.08);
  border: 1px solid rgba(156, 66, 52, 0.2);
  color: #9c4234;
  font-size: 0.85rem;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .cta-modal {
    padding: calc(78px + env(safe-area-inset-top, 0px)) 12px 12px;
  }

  .cta-modal__dialog {
    width: min(100%, 440px);
    max-height: min(84vh, 640px);
    border-radius: 14px;
    padding: 18px 16px 16px;
  }

  .cta-modal__close {
    top: 10px;
    right: 10px;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 18px;
}

.field label {
  font-family: var(--font-display);
  color: var(--dark-blue);
  font-size: 0.98rem;
}

.field input,
.field textarea,
.field select {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 11px 12px;
  border: 1px solid var(--ink-blue-35);
  background: var(--paper-secondary);
  color: #2c2620;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--ink-blue);
  background: var(--paper);
}

.field textarea { resize: vertical; min-height: 120px; }

.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted-grey);
  opacity: 0.85;
  font-style: italic;
}

.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-blue) 50%),
                     linear-gradient(135deg, var(--ink-blue) 50%, transparent 50%);
  background-position: calc(100% - 18px) center, calc(100% - 13px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.map-frame {
  position: relative;
  border: 1.5px solid var(--ink-blue);
  outline: 1px solid var(--ink-blue-35);
  outline-offset: -6px;
  padding: 6px;
  background: var(--paper-secondary);
  margin-top: 34px;
}

.map-frame::before {
  content: "SERVICE AREA — SPECIMEN VIEW";
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1;
  background: var(--paper);
  border: 1px solid var(--ink-blue-35);
  color: var(--dark-blue);
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  pointer-events: none;
}

.map-frame iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 0;
  filter: sepia(18%) saturate(85%) contrast(96%);
}

.info-line {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px dashed var(--ink-blue-35);
}

.info-line dt {
  font-family: var(--font-display);
  color: var(--ink-blue);
  min-width: 120px;
}

.info-line dd { margin: 0; color: #33302a; }

.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted-grey);
  font-style: italic;
  margin-bottom: 10px;
}

/* =================================================
   Footer
================================================= */

.site-footer {
  padding: 40px clamp(18px, 4vw, 56px) 26px;
}

.site-footer > .printed-rule {
  margin-bottom: 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 30px;
  margin-bottom: 26px;
}

.footer-col h4 {
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.footer-col p { font-size: 0.92rem; color: var(--muted-grey); }

.footer-col ul { display: flex; flex-direction: column; gap: 9px; }

.footer-col a {
  font-size: 0.92rem;
  color: #33302a;
}

.footer-col a:hover { color: var(--ink-blue); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 16px;
  font-size: 0.8rem;
  color: var(--muted-grey);
}

.footer-bottom span.doc-ref {
  font-style: italic;
}

/* =================================================
   Hero Section
================================================= */

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding-bottom: 44px;
}

.hero__seal-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 26px;
}

.hero__aside {
  border-left: 1px solid var(--ink-blue-35);
  padding-left: 28px;
}

.hero__aside .info-line:last-child { border-bottom: none; }

/* =================================================
   Hero 3D document container (Part 2)
   Three.js mounts a <canvas> here; a pure-CSS layered-paper fallback
   sits underneath and stays visible if WebGL/Three.js is unavailable.
================================================= */

.hero__3d {
  position: relative;
  width: 100%;
  max-width: 440px;
  aspect-ratio: 4 / 5;
  margin: 0 auto;
  justify-self: center;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Part 3 — once the hero has scrolled out of view, the same 3D panel
   docks as a small fixed corner document that keeps reflecting scroll
   progress through the rest of the Home page, then fades near the
   footer so it never sits on top of it. It releases back to its normal
   in-flow position the moment the hero is back on screen, and never
   traps scrolling — it is purely a floating visual, not a scroll-lock. */
.hero__3d.is-docked {
  position: fixed;
  right: 22px;
  bottom: 26px;
  left: auto;
  top: auto;
  width: 130px;
  max-width: 130px;
  aspect-ratio: 4 / 5;
  margin: 0;
  z-index: 40;
  filter: drop-shadow(0 16px 28px var(--paper-shadow));
}

.hero__3d.is-docked.is-faded {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.hero__3d canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.hero__3d.is-active canvas { opacity: 1; }
.hero__3d.is-active .hero__3d-fallback { opacity: 0; pointer-events: none; }

.hero__3d-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}

.fallback-paper {
  position: absolute;
  width: 72%;
  aspect-ratio: 4 / 5;
  background: var(--paper);
  border: 1.5px solid var(--ink-blue);
  outline: 1px solid var(--ink-blue-35);
  outline-offset: -6px;
  box-shadow: 0 20px 36px -18px var(--paper-shadow);
}

.fallback-paper--back {
  background: var(--paper-secondary);
  border-color: var(--faded-blue);
  outline: none;
  transform: rotate(6deg) translate(10%, 6%);
  opacity: 0.7;
}

.fallback-paper--main {
  transform: rotate(-3deg);
  display: grid;
  place-items: center;
}

.fallback-seal {
  width: 25%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px solid var(--ink-blue);
  outline: 1px solid var(--faded-blue);
  outline-offset: -4px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--ink-blue);
  position: absolute;
  right: 12%;
  bottom: 12%;
}

/* =================================================
   Scroll reveal (Part 2) — lightweight fade/slide, respects
   prefers-reduced-motion via responsive.css and interactions.js
================================================= */

[data-reveal] {
  opacity: 0;
  transform: translateY(16px) scale(0.985);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* No-JavaScript visitors: show content immediately. This replaces the
   former <noscript><style> block, so no CSS lives inside the HTML. */
@media (scripting: none) {
  [data-reveal] { opacity: 1; transform: none; }
}

.rule-draw {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.9s ease;
}

.rule-draw.is-visible { transform: scaleX(1); }

/* =================================================
   Introduction info blocks (Part 2)
================================================= */

.info-blocks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--ink-blue-35);
  border-bottom: 1px solid var(--ink-blue-35);
  margin-top: 24px;
}

.info-blocks > div {
  padding: 16px 20px;
  border-left: 1px solid var(--ink-blue-18);
}

.info-blocks > div:first-child { border-left: none; }

.info-blocks dt {
  font-family: var(--font-display);
  color: var(--ink-blue);
  font-size: 0.92rem;
  margin-bottom: 4px;
}

.info-blocks dd {
  margin: 0;
  font-size: 1.02rem;
  color: #2c2620;
}

/* =================================================
   Services preview list (Part 2)
================================================= */

.service-line {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 22px 0;
  border-bottom: 1px solid var(--ink-blue-18);
}

.service-line:first-child { border-top: 1px solid var(--ink-blue-18); }

.service-line__icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: 1px solid var(--ink-blue-35);
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-top: 3px;
}

.service-line__icon svg {
  width: 17px;
  height: 17px;
  stroke: var(--ink-blue);
  fill: none;
  stroke-width: 1.4;
}

.service-line__body { flex: 1; }

.service-line__body h3 { margin-bottom: 4px; }

.service-line__link {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--ink-blue);
  white-space: nowrap;
  margin-top: 6px;
  display: inline-block;
}

/* =================================================
   Trust / document section (Part 2)
================================================= */

.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.trust-item {
  text-align: left;
  padding: 18px 18px;
  border: 1px solid var(--ink-blue-35);
  background: var(--paper-secondary);
  position: relative;
}

.trust-item::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid var(--ink-blue-10);
  pointer-events: none;
}

.trust-item svg {
  width: 26px;
  height: 26px;
  stroke: var(--ink-blue);
  fill: none;
  stroke-width: 1.3;
  margin-bottom: 12px;
  transition: transform 300ms ease;
}

.trust-item h4 { margin-bottom: 6px; }
.trust-item p { font-size: 0.92rem; color: var(--muted-grey); margin: 0; }

/* =================================================
   CTA section (Part 2)
================================================= */

.cta-band {
  text-align: center;
  padding: 50px 20px;
  border: 1px solid var(--ink-blue-35);
  position: relative;
}

.cta-band::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid var(--ink-blue-10);
  pointer-events: none;
}

.cta-band h2 { margin-bottom: 10px; }

.cta-band p {
  margin: 0 auto 22px;
  color: var(--muted-grey);
}

.cta-band .btn-row { justify-content: center; }

/* =================================================
   Part 4 — shared small 3D document panel (About + Services pages)
   Same fallback/canvas pattern as the Home hero's .hero__3d, kept as
   its own class so the Home page markup/CSS is never touched.
================================================= */

.doc3d {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 4 / 5;
  margin: 0 auto;
  overflow: hidden;
}

.doc3d canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.doc3d.is-active canvas { opacity: 1; }
.doc3d.is-active .doc3d__fallback { opacity: 0; pointer-events: none; }

.doc3d__fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease;
}

.doc3d__fallback .fallback-paper { width: 78%; }

/* Services page: a wider stage so the 4-sheet stack has room to fan out */
.doc3d--stack { max-width: 380px; aspect-ratio: 5 / 4; cursor: pointer; }

/* =================================================
   Part 4 — "Our Approach" numbered document blocks (About page)
================================================= */

.approach-block {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 18px;
  padding: 22px 0;
  border-top: 1px solid var(--ink-blue-18);
}

.approach-block:last-child { border-bottom: 1px solid var(--ink-blue-18); }

.approach-block__num {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--faded-blue);
  font-weight: 700;
  line-height: 1;
}

.approach-block h3 { margin-bottom: 6px; }
.approach-block p { margin: 0; }

/* =================================================
   Part 4 — vertical printed timeline ("Our Journey", About page)
================================================= */

.timeline {
  position: relative;
  padding-left: 34px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--ink-blue-35);
}

.timeline-item {
  position: relative;
  padding-bottom: 34px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 4px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--ink-blue);
}

.timeline-item__num {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-blue);
  font-size: 0.95rem;
  display: block;
  margin-bottom: 2px;
}

.timeline-item h4 { margin-bottom: 6px; }
.timeline-item p { margin: 0; color: var(--muted-grey); }

/* =================================================
   Part 4 — accessible text list standing in for / alongside the 3D
   hotspots and service-stack (never the only way to reach content)
================================================= */

.doc3d-index {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.doc3d-index button,
.doc3d-index a {
  font-family: var(--font-display);
  font-size: 0.92rem;
  color: var(--ink-blue);
  background: none;
  border: 1px solid var(--ink-blue-35);
  padding: 7px 14px;
  cursor: pointer;
}

.doc3d-index button:hover,
.doc3d-index a:hover,
.doc3d-index button.is-active,
.doc3d-index a.is-active {
  background: var(--ink-blue);
  color: var(--paper);
  border-color: var(--ink-blue);
}

/* =================================================
   Part 4 — service detail sections
================================================= */

.service-detail {
  scroll-margin-top: calc(var(--header-height, 100px) + 14px);
}

.service-detail__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 8px 0 10px;
}

.service-detail__meta h5 {
  font-family: var(--font-display);
  color: var(--ink-blue);
  font-size: 0.95rem;
  margin: 0 0 4px;
}

.service-detail__meta p {
  margin: 0;
  font-size: 0.94rem;
  color: var(--muted-grey);
  font-style: italic;
}

.key-points { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; }

.key-points li {
  padding-left: 18px;
  position: relative;
}

.key-points li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--ink-blue);
}

/* =================================================
   Part 4 — responsive comparison table (Services page)
   Real <table> on tablet/desktop; on mobile it becomes stacked
   document-style rows with printed labels, never a horizontal scroll.
================================================= */

.comparison-table {
  width: 100%;
  border-collapse: collapse;
}

.comparison-table caption {
  text-align: left;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-blue);
  margin-bottom: 12px;
}

.comparison-table th,
.comparison-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--ink-blue-18);
  font-size: 0.95rem;
}

.comparison-table thead th {
  font-family: var(--font-display);
  color: var(--dark-blue);
  border-bottom: 1.5px solid var(--ink-blue);
}

.comparison-table tbody tr:first-child td { padding-top: 16px; }

/* =================================================
   Part 4 — small printed metadata strip (About hero)
================================================= */

.metadata-strip {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  color: var(--ink-blue);
  margin: 18px 0 0;
}

.metadata-strip span {
  color: var(--faded-blue);
  margin: 0 8px;
}

/* ==========================================================================
   PART 5 — Contact / FAQ / Testimonials
   ========================================================================== */

.doc-ref-badge {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--ink-blue);
  border: 1px solid var(--ink-blue-35);
  padding: 5px 12px;
  margin: 0 0 14px;
}

/* =================================================
   Contact form: validation + success
================================================= */

.field--error input,
.field--error select,
.field--error textarea {
  border-color: #9c4234;
  background: #fbf1ee;
}

.field__error {
  color: #9c4234;
  font-size: 0.85rem;
  font-style: italic;
  min-height: 1.1em;
}

.field__hint {
  color: var(--muted-grey);
  font-size: 0.82rem;
}

.form-required-note {
  font-size: 0.85rem;
  color: var(--muted-grey);
  margin: -8px 0 18px;
}

.form-success {
  border: 1px solid var(--ink-blue-35);
  background: var(--paper-secondary);
  padding: 24px;
  text-align: center;
  display: none;
}

.form-success.is-visible { display: block; }

.form-success h3 { margin-bottom: 8px; }

.form-success p { margin: 0; color: var(--muted-grey); }

.contact-form.is-submitted form { display: none; }

/* =================================================
   FAQ: flat, full-width accordion list
================================================= */

.faq-item {
  border-bottom: 1px solid var(--ink-blue-18);
  transition: border-color 250ms ease, background 250ms ease, margin 250ms ease, padding 250ms ease;
}

.faq-item:last-child { border-bottom: none; }

@media (hover: hover) and (pointer: fine) {
  .faq-item:hover { border-bottom-color: var(--ink-blue-35); }
}

/* The open question gets a clear thin rectangular border, like the
   reference layout — every other row stays a plain divided line. */
.faq-item:has(.faq-item__panel-wrap.is-open) {
  border: 1px solid var(--ink-blue);
  border-radius: 3px;
  background: var(--paper-secondary);
  margin: 8px 0;
  padding: 0 18px;
}

.faq-item__trigger {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  padding: 20px 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  font-family: var(--font-display);
  font-size: 1.08rem;
  color: var(--dark-blue);
}

.faq-item__trigger::after {
  content: "+";
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink-blue);
  flex-shrink: 0;
  width: 1ch;
  text-align: center;
}

.faq-item__trigger[aria-expanded="true"]::after { content: "\2212"; }

.faq-item__panel-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s ease;
}

.faq-item__panel-wrap.is-open { grid-template-rows: 1fr; }

.faq-item__panel {
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.faq-item__panel-wrap.is-open .faq-item__panel { opacity: 1; }

.faq-item__panel p {
  margin: 0 0 20px;
  padding: 0 2px;
  color: var(--muted-grey);
}

/* ---- Testimonials: horizontal auto-carousel ---------------------------
   Desktop shows exactly 3 landscape cards at once (no partial/cropped
   card at either edge); tablet shows 2; mobile shows 1, full-width.
   --tgap is the single source of truth for the list's gap so each
   card's flex-basis can divide the row evenly at every tier. */

.testimonial-carousel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  --tgap: 20px;
}

.testimonial-list {
  display: flex;
  flex-wrap: nowrap;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: var(--tgap);
  align-items: stretch;
  scrollbar-width: none;
}

.testimonial-list::-webkit-scrollbar { display: none; }

.testimonial-carousel__nav {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-blue);
  background: var(--paper);
  color: var(--ink-blue);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, color 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  .testimonial-carousel__nav:hover {
    background: var(--ink-blue);
    color: var(--paper);
  }
}

/* Landscape, compact card: wide and short rather than tall. Exactly
   3 fit per row on desktop with the list's own gap, so none is ever
   sliced by the container edge. */
.testimonial-card {
  border: 1px solid var(--ink-blue-35);
  background: var(--paper-secondary);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-height: 176px;
  flex: 0 0 calc((100% - 2 * var(--tgap)) / 3);
  scroll-snap-align: start;
  transition: transform 300ms ease, box-shadow 300ms ease, border-color 300ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px -20px var(--paper-shadow), 0 2px 0 var(--ink-blue-18);
    border-color: var(--ink-blue);
  }
}

.testimonial-card.is-active { border-color: var(--ink-blue); }

/* Small printed-style badge, reused outside the testimonial cards
   (e.g. the Career section's "We Are Hiring" tag). */
.badge-stamp {
  display: inline-block;
  align-self: flex-start;
  border: 1px solid var(--ink-blue-35);
  color: var(--dark-blue);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  margin-top: 10px;
}

.testimonial-card__person { margin-bottom: 2px; }

.testimonial-card__name {
  display: block;
  font-family: var(--font-display);
  font-size: 1.04rem;
  color: var(--dark-blue);
}

.testimonial-card__location {
  display: block;
  font-size: 0.84rem;
  color: var(--muted-grey);
  margin-top: 1px;
}

.testimonial-card__body {
  border: none;
  padding: 0 0 0 20px;
  margin: 0;
  font-size: 0.96rem;
  max-width: none;
  position: relative;
  display: block;
}

.testimonial-card__body::before {
  content: "\201C";
  position: absolute;
  left: -4px;
  top: -8px;
  font-family: var(--font-display);
  font-size: 2.2rem;
  color: var(--faded-blue);
  line-height: 1;
}

.testimonial-card__body--placeholder {
  color: var(--muted-grey);
  font-style: italic;
}

.disclaimer-note {
  margin-top: 18px;
  padding: 12px 14px;
  border-left: 2px solid var(--faded-blue);
  color: var(--muted-grey);
  font-size: 0.85rem;
  font-style: italic;
}

/* ---- 3D loading caption --------------------------------------------
   A quiet document-style caption over the static paper fallback while
   the 3D scene spins up. Timed, not state-driven: it always fades on
   its own, so it can never get stuck showing "loading" forever even if
   WebGL never becomes available — the static paper underneath already
   is the permanent fallback in that case. */

.doc3d__loading-note,
.hero__3d-loading-note {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.78rem;
  color: var(--muted-grey);
  pointer-events: none;
  opacity: 0;
  animation: doc3dLoadingFade 1.8s ease forwards;
}

@keyframes doc3dLoadingFade {
  0%   { opacity: 0; }
  15%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0; }
}

/* =================================================
   Structured single-page layout correction
================================================= */

body {
  padding: 0 20px 48px;
  overflow-x: hidden;
}

.paper-sheet,
.paper-sheet__inner {
  max-width: none;
  background: var(--paper);
  border: 0;
  outline: 0;
  box-shadow: none;
  padding: 0;
}

.paper-sheet__inner {
  /* Header is now position: fixed and out of normal flow, so this
     spacer keeps the hr/content from sliding underneath it. Kept in
     sync with the header's real rendered height via JS (main.js),
     with a same-order-of-magnitude fallback for no-JS/first paint. */
  padding-top: var(--header-height, 100px);
}

.paper-sheet__inner::before,
.paper-sheet__inner::after,
.corner-bl,
.corner-br {
  display: none;
}

.content,
.site-footer {
  width: min(100%, 1120px);
  margin-inline: auto;
}

.site-header {
  width: 100%;
}

.content {
  display: flex;
  flex-direction: column;
  padding: 0 clamp(20px, 4vw, 56px);
}

/* Sections now appear in the order they are written in index.html. */

.section,
.page-block > .section {
  width: 100%;
  padding: clamp(14px, 2.2vw, 26px) 0;
  scroll-margin-top: calc(var(--header-height, 100px) + 14px);
}

.hero.section {
  padding-top: clamp(26px, 4.5vw, 48px);
  border-top: 0;
}

.page-block {
  display: block;
  position: relative;
}

.section__head {
  max-width: 70ch;
  margin-bottom: clamp(10px, 1.8vw, 18px);
}

.section__head h2,
.page-block h1 {
  text-wrap: balance;
}

.page-block > .section:first-child {
  padding-top: clamp(16px, 2.6vw, 26px);
}

.page-block > .section:last-child,
.content > .section:last-child {
  padding-bottom: clamp(16px, 2.6vw, 26px);
}

.grid--3 .content-panel { height: 100%; }

.hero__3d {
  width: min(100%, 400px);
  max-width: 400px;
  overflow: hidden;
  contain: layout paint;
}

.hero__3d.is-docked {
  position: relative;
  inset: auto;
  width: min(100%, 400px);
  max-width: 400px;
  filter: none;
  z-index: auto;
}

.hero__3d.is-docked.is-faded {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.final-cta {
  border-top: 1px solid var(--ink-blue-18);
}

.cta-band {
  border: 1px solid var(--ink-blue-35);
  padding: clamp(30px, 5vw, 58px) clamp(20px, 5vw, 56px);
}

/* =================================================
   Service cards — the 4 insurance services as a consistent card grid
================================================= */

.service-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 2px;
}

.service-grid .service-detail.section {
  padding: 0;
}

.service-grid .service-detail .content-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.service-detail__icon {
  width: 46px;
  height: 46px;
  border: 1px solid var(--ink-blue-35);
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  transition: transform 300ms ease, border-color 300ms ease;
}

.service-detail__icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--ink-blue);
  fill: none;
  stroke-width: 1.4;
}

/* =================================================
   Card hover effects — content panels, trust/feature cards, testimonials
   Desktop-only (pointer: fine) so mobile never depends on hover.
================================================= */

.content-panel,
.trust-item {
  transition: transform 300ms ease, box-shadow 300ms ease, border-color 300ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .content-panel:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px -20px var(--paper-shadow), 0 2px 0 var(--ink-blue-18);
    border-color: var(--ink-blue);
  }

  .content-panel:hover .service-detail__icon {
    transform: scale(1.08) rotate(-4deg);
    border-color: var(--ink-blue);
  }
}

/* =================================================
   Subtle alternating section backgrounds
   Home/Services/Contact stay on the plain paper tone; About/FAQ/Career
   get a very slightly cooler wash, Testimonials an even softer version
   of the same wash — full-bleed via a breakout pseudo-element so the
   colour reads edge-to-edge rather than boxed to the content column.
================================================= */

.page-block--alt::before,
.page-block--soft::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  margin-left: -50vw;
  z-index: -1;
  pointer-events: none;
}

.page-block--alt::before {
  background: linear-gradient(var(--ink-blue-10), var(--ink-blue-10)), var(--paper);
}

.page-block--soft::before {
  background: linear-gradient(var(--ink-blue-05), var(--ink-blue-05)), var(--paper);
}

/* =================================================
   Consistent end-of-section printed divider — one per major section
   (Hero and every .page-block section)
================================================= */

.hero.section::after,
.page-block::after {
  content: "";
  display: block;
  margin-top: clamp(8px, 1.5vw, 14px);
  height: 3px;
  background:
    linear-gradient(var(--ink-blue), var(--ink-blue)) top / 100% 1px no-repeat,
    linear-gradient(var(--faded-blue), var(--faded-blue)) bottom / 100% 1px no-repeat;
  opacity: 0.85;
}

@media (prefers-reduced-motion: reduce) {
  .doc3d__loading-note,
  .hero__3d-loading-note { display: none; }

  .content-panel,
  .trust-item,
  .faq-item,
  .content-panel:hover,
  .trust-item:hover,
  .trust-item:hover svg,
  .content-panel:hover .service-detail__icon {
    transition: none !important;
    transform: none !important;
  }
}

/* =================================================
   Completion polish: service images, review cards, floating actions
================================================= */
.service-detail__img{display:block;width:100%;height:auto;aspect-ratio:2/1;object-fit:cover;border:1px solid var(--ink-blue-35);margin-bottom:12px;transition:transform 300ms ease}
.service-grid .service-detail .content-panel{overflow:hidden}
.service-grid{grid-template-columns:minmax(0,1fr)}
@media (hover:hover) and (pointer:fine){.content-panel:hover .service-detail__img{transform:scale(1.03)}}
.testimonial-card{flex-basis:calc((100% - 2*var(--tgap))/3);min-height:0;justify-content:flex-start}
.testimonial-card__stars{color:var(--ink-blue);letter-spacing:2px;font-size:.95rem}
.testimonial-card__person{display:flex;flex-direction:column;margin:auto 0 0}
.testimonial-card__sample{font-size:.7rem;color:var(--muted-grey);text-transform:uppercase;letter-spacing:.08em;margin-top:2px}
.fab-group{position:fixed;right:14px;bottom:calc(14px + env(safe-area-inset-bottom,0px));z-index:120;display:flex;flex-direction:column;gap:10px}
.fab{width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:var(--paper);border:1.5px solid var(--ink-blue);box-shadow:0 6px 16px -8px var(--paper-shadow);transition:transform 250ms ease,box-shadow 250ms ease}
.fab svg{width:22px;height:22px;fill:none;stroke:var(--ink-blue);stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.fab--wa{background:#1f7a4d;border-color:#1f7a4d;animation:fabPulse 3.2s ease-out infinite;color:#fff}
.fab--wa svg{stroke:none;fill:currentColor;width:22px;height:22px}
.fab:hover,.fab:focus-visible,.fab:active{transform:translateY(-3px) scale(1.05)}
@keyframes fabPulse{0%{box-shadow:0 0 0 0 rgba(31,122,77,.35)}70%,100%{box-shadow:0 0 0 12px rgba(31,122,77,0)}}
@media (prefers-reduced-motion:reduce){.fab--wa{animation:none}}

/* =================================================
   Service cards v2: photo frame in bond-paper style, compact 4-up
================================================= */
.service-detail__img{padding:5px;background:var(--paper);border:1px solid var(--ink-blue);outline:1px solid var(--ink-blue-35);outline-offset:2px;box-shadow:0 8px 16px -12px var(--paper-shadow);filter:sepia(.1) saturate(.92);margin:2px auto 14px;width:100%;max-width:320px;aspect-ratio:16/10;object-fit:cover;object-position:center}
.service-grid .service-detail .content-panel{padding:14px}
.service-grid .service-detail .content-panel h2{font-size:1.15rem}
.service-grid .service-detail .content-panel p,.service-grid .service-detail .key-points li{font-size:.86rem;line-height:1.45}
.service-grid .service-detail__icon{width:38px;height:38px;margin-bottom:10px}
@media (hover:hover) and (pointer:fine){.service-grid .service-detail .content-panel:hover{transform:translateY(-5px)}}
@media (min-width:1180px){.service-grid .service-detail .content-panel h2{min-height:2.5em}}


/* =================================================
   Hero Section — insurance additions
   Sub-heading, category strip and seal note used by the new hero copy.
================================================= */

.hero__subhead {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink-blue);
  max-width: 40ch;
  margin: 0 0 0.7em;
}

.hero .btn-row { margin-top: 6px; }

.hero__seal-note {
  margin: 0;
  color: var(--muted-grey);
  font-size: 0.92rem;
  max-width: 34ch;
}

/* =================================================
   Shared Insurance Components
   Card titles/text, check lists, small buttons, tighter grids and the
   "call to action" card that fills the sixth slot of a three-column grid.
================================================= */

[id].page-block,
.final-cta,
.content-panel[id] {
  scroll-margin-top: calc(var(--header-height, 100px) + 14px);
}

.grid--tight { gap: 16px; }

.card-title {
  font-size: 1.12rem;
  line-height: 1.25;
  margin: 0 0 0.35em;
}

.card-text {
  font-size: 0.92rem;
  color: var(--muted-grey);
  margin: 0 0 0.6em;
}

.btn--small {
  padding: 9px 16px;
  font-size: 0.9rem;
}

.check-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin: 0 0 14px;
}

.check-list li {
  position: relative;
  padding-left: 24px;
}

.check-list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--ink-blue);
  font-weight: 700;
}

.check-list--compact {
  gap: 5px;
  font-size: 0.88rem;
}

.cta-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: var(--paper);
  border-style: dashed;
  border-color: var(--ink-blue);
}

.solution-card.cta-card { align-items: center; }

.cta-card .card-text { max-width: 30ch; }

.cta-card .btn {
  text-align: center;
  justify-content: center;
}

.section-cta { margin-top: 18px; }

/* =================================================
   Consultation Form
   Compact one-row quick form, shared by the callback section, plus
   the extra field styles used by the main lead form.
================================================= */

.quick-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 12px 14px;
  align-items: start;
}

.quick-form .field { margin-bottom: 0; }

.quick-form .field__error { min-height: 0; }

.quick-form__submit { margin-top: 32px; }

.form-consent {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  max-width: none;
  font-size: 0.8rem;
  color: var(--muted-grey);
}

.contact-form form > .btn + .form-consent { margin-top: 12px; }

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field--radio {
  display: block;
  border: 0;
  padding: 0;
  margin: 0 0 18px;
  min-width: 0;
}

.field--radio legend {
  padding: 0;
  margin-bottom: 6px;
  font-family: var(--font-display);
  color: var(--dark-blue);
  font-size: 0.98rem;
}

.radio-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 22px;
  font-size: 1rem;
  cursor: pointer;
}

/* =================================================
   Insurance Solutions
================================================= */

.solution-card,
.health-card,
.contact-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.solution-card .service-detail__icon,
.health-card .service-detail__icon,
.motor-card .service-detail__icon,
.contact-card .service-detail__icon { margin-bottom: 12px; }

.solution-card .check-list { flex: 1; }

/* =================================================
   Life Insurance
================================================= */

#life .content-panel__num { margin-bottom: 4px; }

/* =================================================
   Health Insurance
================================================= */

.health-card .card-text { flex: 1; }

/* =================================================
   General Insurance
   A light list layout (not cards) so it reads differently from the
   dedicated Motor and Business sections.
================================================= */

.line-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 36px;
}

.line-grid .service-line { border-top: 1px solid var(--ink-blue-18); }

.line-grid .service-line:nth-child(n+3) { border-top: none; }

.service-line__body h3 { font-size: 1.15rem; }

.service-line__body p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted-grey);
}

/* =================================================
   Motor Insurance
================================================= */

.motor-card .check-list { margin-bottom: 0; }

/* =================================================
   Business Insurance
================================================= */

#business .health-card .card-text { margin-bottom: 0; }

/* =================================================
   Insurance Review
================================================= */

.review-grid { align-items: start; }

.review-note {
  margin: 14px 0 0;
  font-style: italic;
  color: var(--muted-grey);
  font-size: 0.95rem;
}

.review-grid .check-list { margin-bottom: 0; }

/* =================================================
   How It Works
   Horizontal four-step timeline on desktop; stacked on small screens
   (see responsive.css) so it never overflows.
================================================= */

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.steps__item {
  position: relative;
  padding-top: 48px;
}

.steps__item::before {
  content: "";
  position: absolute;
  top: 17px;
  left: 40px;
  right: -12px;
  height: 1px;
  background: var(--ink-blue-35);
}

.steps__item:last-child::before { display: none; }

.steps__num {
  position: absolute;
  top: 0;
  left: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ink-blue);
  border-radius: 50%;
  background: var(--paper);
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--ink-blue);
  z-index: 1;
}

/* =================================================
   Insurance Calculators
================================================= */

.calc-card {
  display: flex;
  flex-direction: column;
}

.calc-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 8px;
  align-items: end;
}

.calc-fields .field:last-child:nth-child(odd) { grid-column: 1 / -1; }

.calc-card .field {
  margin-bottom: 0;
  gap: 4px;
}

.calc-card .field label {
  font-size: 0.8rem;
  line-height: 1.25;
}

.calc-card .field input {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  font-size: 0.92rem;
}

.calc-card .field__hint {
  margin: 0 0 4px;
  font-size: 0.78rem;
  line-height: 1.4;
}

.calc-card .btn {
  align-self: flex-start;
  margin: 6px 0 12px;
}

.calc-result {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--ink-blue-35);
}

.calc-result__value {
  margin: 0 0 8px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--dark-blue);
}

.calc-result__value.is-error { color: #9c4234; }

.calc-note {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.4;
  font-style: italic;
  color: var(--muted-grey);
}

/* =================================================
   Why Choose Us
================================================= */

.trust-grid--3 { grid-template-columns: repeat(3, 1fr); }

.trust-item .card-title { margin-bottom: 6px; }

/* =================================================
   About Advisor
================================================= */

#about .info-line dt { min-width: 100px; }

#about .check-list { margin-bottom: 0; }

/* =================================================
   FAQ
================================================= */

#faq .faq-item h3 {
  font-size: inherit;
  margin: 0;
}

/* =================================================
   Contact
================================================= */

.contact-card__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.95rem;
}

.contact-card__list a { color: var(--dark-blue); }

.contact-card .btn { margin-top: 4px; }

#contact aside .map-frame { margin-top: 12px; }

/* =================================================
   Legal Information
================================================= */

.legal-grid .card-text { font-size: 0.88rem; margin-bottom: 0; }

/* =================================================
   Footer
   Legal links row and the visible insurance disclaimer.
================================================= */

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0 0 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--ink-blue-35);
}

.footer-legal a {
  font-size: 0.85rem;
  color: var(--dark-blue);
}

.footer-legal a:hover { color: var(--ink-blue); }

.footer-disclaimer {
  max-width: none;
  margin: 0 0 6px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted-grey);
}


/* =================================================
   MODIFICATION v3 — Card alignment (equal height, bottom-aligned CTAs)
   Every card inside a grid becomes a full-height flex column so cards in
   one row share a height, and the button/link is pushed to the bottom
   with margin-top:auto. Titles in the long-title grids reserve two lines
   on desktop so headings, text and buttons line up row by row.
================================================= */
.grid { align-items: stretch; }

.grid > .content-panel,
.trust-grid > .trust-item,
.steps > .steps__item {
  height: 100%;
  min-width: 0;
}

.grid--tight > .content-panel,
.trust-grid > .trust-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.card-title { overflow-wrap: break-word; }
.card-text { line-height: 1.55; }

/* body copy grows; the action sits at the bottom of the card */
.grid--tight > .content-panel > .card-text,
.trust-item > p { flex: 1 1 auto; }
.motor-card .check-list,
.solution-card .check-list { flex: 1 1 auto; }

.card-cta,
.solution-card > .btn,
.health-card > .service-line__link,
.contact-card > .btn {
  margin-top: auto;
  align-self: flex-start;
}

.health-card > .service-line__link { padding-top: 6px; }
.cta-card > .btn { margin-top: 10px; align-self: center; }

.trust-item svg { flex-shrink: 0; }

@media (min-width: 1025px) {
  .calc-card .card-title { min-height: 2.5em; }
}

/* =================================================
   MODIFICATION v3 — Photo frames (card-media)
   Reserved aspect-ratio boxes (no layout shift), object-fit:cover, a
   very light warm tone so photos sit naturally on the bond paper.
================================================= */
.anchor-offset {
  display: block;
  height: 0;
  scroll-margin-top: calc(var(--header-height, 100px) + 14px);
}

.card-label {
  display: block;
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--ink-blue);
}

.card-media {
  position: relative;
  margin: 0 0 12px;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--ink-blue-35);
  flex-shrink: 0;
}

.card-media__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: sepia(0.06) saturate(0.95);
}

/* icon badge sits on the photo's lower-left corner */
.card-media .service-detail__icon {
  position: absolute;
  left: 10px;
  bottom: 10px;
  margin: 0;
  background: var(--paper);
}

.card-media figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 8px 6px;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(to top, rgba(22, 75, 104, 0.82), rgba(22, 75, 104, 0));
  text-shadow: none;
}

.card-media--banner {
  aspect-ratio: 21 / 7;
  margin-bottom: 16px;
}

.card-media--tile { aspect-ratio: 4 / 3; margin: 0; }

/* Shown by main.js if an image file is missing: keeps the frame, no broken icon */
.card-media.is-missing {
  background:
    repeating-linear-gradient(45deg, var(--ink-blue-10) 0 1px, transparent 1px 8px),
    var(--paper-secondary);
}

.card-media.is-missing .card-media__img { visibility: hidden; }

.card-media.is-missing::after {
  content: attr(data-alt);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 14px;
  text-align: center;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--muted-grey);
}

/* =================================================
   MODIFICATION v3 — Life: Protection + Wealth Creation feature panel
================================================= */
.feature-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 24px;
  align-items: center;
  margin-bottom: 16px;
}

.feature-split .check-list { margin-bottom: 0; }

.photo-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

/* =================================================
   MODIFICATION v3 — General / Motor / Contact / Legal grids
================================================= */
.general-card .card-media,
.motor-card .card-media { aspect-ratio: 16 / 9; }

.contact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Legal: 5 cards as 3 + 2 with no empty slot (6-column track) */
.legal-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.legal-grid > .content-panel { grid-column: span 2; }
.legal-grid > .content-panel:nth-child(n+4) { grid-column: span 3; }

/* MODIFICATION v3 — spacing fix: in cards with a list, the list (not the text)
   absorbs spare height; CTA cards keep their content centred. */
.solution-card > .card-text,
.motor-card > .card-text { flex: 0 0 auto; }
.cta-card > .card-text { flex: 0 0 auto; }
.cta-card { justify-content: center; }

/* MODIFICATION v3 — specificity correction for the spacing fix above */
.grid--tight > .solution-card > .card-text,
.grid--tight > .motor-card > .card-text,
.grid--tight > .cta-card > .card-text { flex: 0 0 auto; }
.grid--tight > .cta-card > .btn { margin-top: 10px; align-self: center; }

/* MODIFICATION v3 — keep the missing-image note clear of captions/badges */
.card-media.is-missing::after { padding-bottom: 34px; }

/* MODIFICATION v3 — photo credit line in the footer */
.footer-credits { max-width: none; margin: 0 0 6px; font-size: 0.78rem; line-height: 1.5; color: var(--muted-grey); }
.footer-credits a { text-decoration: underline; text-underline-offset: 2px; }
