/* The GRID — shared stylesheet
   Handles: reset, hover states (converted from source's style-hover), services dropdown,
   mobile hamburger nav, FAQ accordion, scroll-reveal, lead form validation states,
   Reviews stat bars. Page-specific visual design (colors, section layout, hero SVGs,
   per-page @keyframes) stays inline / in each page's own <style> block, per the build
   brief's "preserve inline styles exactly" rule. */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img { max-width: 100%; }
a { -webkit-tap-highlight-color: rgba(153,99,33,0.15); }

/* ================= Hover utilities (source used style-hover, a design-tool-only
   attribute; these are the real CSS equivalents, one definition reused everywhere) ===== */
.hover-navlink:hover { color: #996321; }
.hover-dropdown-item:hover { background: #efece4; }
.btn-gold-solid:hover { background: #82541c; border-color: #82541c; }
.btn-gold-bright:hover { background: #dc9c4c; border-color: #dc9c4c; }
.btn-gold-bright-arrow:hover { background: #dc9c4c; border-color: #dc9c4c; transform: translateX(2px); }
.hover-paincard:hover { background: #e8e3d8; box-shadow: inset 0 -2px 0 #996321; }
.hover-paincard:hover .arrow-icon { transform: translateX(4px); }
.arrow-icon { transition: transform .15s; }
.hover-democard:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(28,43,58,0.16); }
.hover-crosslink:hover { background: #e8e3d8; }

/* ================= Header / services dropdown ================= */
.logo-link { display: flex; align-items: center; text-decoration: none; }
.nav-panel { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.services-dropdown { position: relative; }
.services-toggle {
  display: flex; align-items: center; gap: 6px;
  font-family: 'IBM Plex Sans', sans-serif; font-weight: 600; font-size: 13px; color: #1c2b3a;
  background: none; border: 1px solid rgba(28,43,58,0.2); padding: 8px 14px; cursor: pointer;
}
.services-chevron { transition: transform .2s; }
.services-dropdown.open .services-chevron { transform: rotate(180deg); }
.services-panel {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px;
  background: #f7f5f0; border: 1px solid rgba(28,43,58,0.16);
  box-shadow: 0 12px 28px rgba(28,43,58,0.18); z-index: 50;
  transform-origin: top right;
  opacity: 0; transform: scale(0.96); pointer-events: none;
  transition: opacity .15s, transform .15s;
}
.services-dropdown.open .services-panel { opacity: 1; transform: scale(1); pointer-events: auto; }
.services-panel a:last-child { border-bottom: none; }

.nav-toggle {
  display: none; align-items: center; justify-content: center;
  background: none; border: 1px solid rgba(28,43,58,0.2); padding: 8px 10px; cursor: pointer;
}
.nav-toggle svg { display: block; width: 22px; height: 22px; color: #1c2b3a; }
.nav-toggle .icon-close { display: none; }
.nav-toggle.open .icon-menu { display: none; }
.nav-toggle.open .icon-close { display: block; }

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-panel {
    display: none !important; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #f7f5f0; border-bottom: 1px solid rgba(28,43,58,0.16);
    box-shadow: 0 12px 20px rgba(28,43,58,0.12);
    padding: 6px clamp(20px,5vw,64px) 20px; max-height: calc(100vh - 78px); overflow-y: auto;
  }
  .nav-panel.open { display: flex !important; }
  .nav-link-story { display: block; padding: 14px 0; }
  .services-dropdown { width: 100%; }
  .services-toggle { width: 100%; justify-content: space-between; }
  .services-panel {
    position: static; box-shadow: none; border: none; min-width: 0;
    border-top: 1px solid rgba(28,43,58,0.12);
    opacity: 1; transform: none; pointer-events: auto;
    max-height: 0; overflow: hidden; transition: max-height .25s ease;
  }
  .services-dropdown.open .services-panel { max-height: 420px; }
  .nav-cta { margin-top: 12px; justify-content: center; text-align: center; }
}

/* ================= FAQ accordion ================= */
.faq-item { border-bottom: 1px solid rgba(28,43,58,0.16); }
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: none; border: none; padding: 20px 0; text-align: left;
  font-family: 'IBM Plex Sans', sans-serif; font-weight: 600; font-size: 17px; color: #1c2b3a; cursor: pointer;
}
.faq-chevron { flex: none; transition: transform .2s; }
.faq-item.open .faq-chevron { transform: rotate(180deg); }
.faq-answer-wrap { overflow: hidden; max-height: 0; opacity: 0; transition: max-height .35s ease, opacity .3s ease; }
.faq-item.open .faq-answer-wrap { max-height: 200px; opacity: 1; }
.faq-answer { font-size: 15px; opacity: 0.8; margin: 0 0 22px; max-width: 640px; }

/* ================= Scroll reveal ================= */
[data-reveal] > * {
  opacity: 0; transform: translateY(12px);
  transition: opacity .5s ease, transform .5s ease;
  transition-delay: calc(var(--i, 0) * 100ms);
}
[data-reveal].is-revealed > * { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] > * { transition: none !important; }
}

/* ================= Lead form ================= */
.field-error { font-size: 12px; color: #996321; margin-top: 4px; min-height: 1px; }
.field-error-consent { margin-top: -6px; }
.field-invalid { border-color: #996321 !important; }
.form-error-banner {
  display: none; border: 1px solid #996321; background: rgba(153,99,33,0.08); color: #1c2b3a;
  font-family: 'IBM Plex Sans', sans-serif; font-size: 14px; padding: 14px 16px; margin: 0 0 24px;
  text-align: center;
}
.form-error-banner.show { display: block; }

/* ================= Reviews page stat bars ================= */
.stat-bar-track { height: 6px; background: rgba(28,43,58,0.12); }
.stat-bar-fill { height: 100%; background: #647268; transition: width 1s ease; width: 0%; }
