/*
Theme Name: Lamb Family Dental — Design System
Template: generatepress
Description: V5 dark luxury dental spa aesthetic — Fraunces + Poppins, deep navy-black palette with sky blue and warm gold accents.
Version: 5.0.0
Author: Lamb Family Dental
*/

/* ============================================================
   SIZE-ADJUST FALLBACK FONTS
   Match Poppins / Fraunces metrics so layout doesn't shift when
   the real webfont swaps in. Eliminates font-swap CLS.
   Metrics from f-mods.dev / Bram Stein's tool.
   ============================================================ */
@font-face {
  font-family: 'Poppins-fallback';
  font-display: swap;
  src: local('Arial');
  size-adjust: 112.16%;
  ascent-override: 93.74%;
  descent-override: 31.25%;
  line-gap-override: 8.93%;
}
@font-face {
  font-family: 'Fraunces-fallback';
  font-display: swap;
  src: local('Times New Roman');
  size-adjust: 99.6%;
  ascent-override: 99%;
  descent-override: 26%;
  line-gap-override: 0%;
}

/* ============================================================
   V5 DESIGN TOKENS — Single source of truth
   Derived from approved prototype/index.html
   ============================================================ */

:root {
  /* Backgrounds */
  --bg:      #060d14;
  --bg2:     #0b1620;
  --bg3:     #12222f;
  --bg4:     #1a3040;

  /* Brand — Sky Blue */
  --sky:     #0093D3;
  --skyL:    #4fc0eb;
  --skyD:    #006da0;
  --skyG:    rgba(0,147,211,.12);

  /* Brand — Warm Gold */
  --gold:    #c9a04a;
  --goldL:   #ddb96a;
  --goldG:   rgba(201,160,74,.06);

  /* Text opacity ladder */
  --t1:      rgba(255,255,255,.96);
  --t2:      rgba(255,255,255,.72);
  --t3:      rgba(255,255,255,.60);
  --t4:      rgba(255,255,255,.1);

  /* Motion */
  --e:       cubic-bezier(.22,1,.36,1);
  --e2:      cubic-bezier(.16,1,.3,1);

  /* Shape */
  --radius:  14px;

  /* Legacy aliases (used in older page markup) */
  --brand-sky: #0093D3;
  --brand-sky-600: #0078AC;
  --brand-sky-100: rgba(0,147,211,.1);
  --brand-navy: #0b1620;
  --brand-navy-800: #060d14;
  --brand-gold: #c9a04a;
  --brand-gold-100: rgba(201,160,74,.1);
  --n-100: #060d14;
  --n-200: #0b1620;
  --n-300: rgba(255,255,255,.1);
  --n-400: rgba(255,255,255,.2);
  --n-500: rgba(255,255,255,.52);
  --n-600: rgba(255,255,255,.55);
  --n-700: rgba(255,255,255,.72);
  --n-800: rgba(255,255,255,.85);
  --n-900: rgba(255,255,255,.96);
}

/* ============================================================
   RESET & BASE
   ============================================================ */

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

::selection { background: var(--sky); color: #fff }
html { scroll-behavior: smooth }

body {
  font-family: 'Poppins', 'Poppins-fallback', sans-serif;
  background: var(--bg);
  color: var(--t1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  padding-top: 0 !important;
}

/* Specificity bump (html a) beats WP block-editor's inline
   `a:where(:not(.wp-element-button)){text-decoration:underline}` global rule. */
html a { color: inherit; text-decoration: none }
img, video { display: block; max-width: 100% }
button { font-family: inherit }

/* Film grain overlay */
body::after {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9998;
  opacity: .025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================================
   TYPOGRAPHY — Prototype-accurate
   ============================================================ */

h1 {
  font-family: 'Fraunces', 'Fraunces-fallback', serif;
  font-weight: 200;
  font-size: clamp(2.8rem, 2rem + 4vw, 5.5rem);
  line-height: .9;
  letter-spacing: -.045em;
  color: var(--t1);
}

h2 {
  font-family: 'Fraunces', 'Fraunces-fallback', serif;
  font-weight: 200;
  font-size: clamp(2.4rem, 1.6rem + 4.2vw, 5.2rem);
  line-height: .9;
  letter-spacing: -.045em;
  color: var(--t1);
}

h3 {
  font-family: 'Fraunces', 'Fraunces-fallback', serif;
  font-weight: 300;
  font-size: clamp(1.1rem, .9rem + .8vw, 1.45rem);
  line-height: 1.2;
  letter-spacing: -.015em;
  color: var(--t1);
}

h4 {
  font-family: 'Poppins', 'Poppins-fallback', sans-serif;
  font-weight: 600;
  font-size: clamp(.85rem, .8rem + .3vw, 1rem);
  color: var(--t1);
}

h5, h6 {
  font-family: 'Poppins', 'Poppins-fallback', sans-serif;
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .05em;
  color: var(--t2);
}

p {
  line-height: 1.85;
  font-weight: 300;
  font-size: .86rem;
  color: var(--t2);
}

blockquote {
  font-family: 'Fraunces', 'Fraunces-fallback', serif;
  font-style: italic;
  font-weight: 200;
}

/* ============================================================
   SHARED COMPONENTS — Section, Eyebrow, Divider, Links
   ============================================================ */

.section {
  padding: clamp(80px, 14vw, 180px) clamp(16px, 4vw, 64px);
  position: relative;
}
.section-wrap { max-width: 1400px; margin: 0 auto }
.section-narrow { max-width: 660px; margin: 0 auto }

.eyebrow {
  font-family: 'Poppins', 'Poppins-fallback', sans-serif;
  font-size: .48rem;
  font-weight: 700;
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--sky);
  display: block;
  margin-bottom: 14px;
}

.divider {
  width: 36px; height: 1px;
  background: linear-gradient(90deg, var(--gold), var(--goldL));
  border: 0;
}

.arrow-link {
  font-size: .62rem; font-weight: 600;
  color: var(--sky); letter-spacing: .12em;
  text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 6px;
  transition: gap .3s var(--e), color .25s;
}
.arrow-link:hover { gap: 12px; color: var(--skyL) }
.arrow-link svg { width: 11px; height: 11px }

/* ============================================================
   BUTTONS — Primary (sky) + Ghost (outline)
   ============================================================ */

.btn-primary {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--sky); color: #fff;
  padding: 15px 30px; min-height: 48px; border-radius: 999px;
  font-family: 'Poppins', 'Poppins-fallback', sans-serif;
  font-weight: 600; font-size: .68rem;
  letter-spacing: .08em; text-transform: uppercase;
  border: 0; cursor: pointer;
  transition: all .3s var(--e);
  position: relative; overflow: hidden;
  text-decoration: none;
}
.btn-primary::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
  transform: translateX(-100%); transition: transform .7s;
}
.btn-primary:hover::before { transform: translateX(100%) }
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(0,147,211,.25);
}

.btn-ghost,
.btn-secondary {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; color: var(--t1);
  padding: 15px 30px; min-height: 48px; border-radius: 999px;
  font-family: 'Poppins', 'Poppins-fallback', sans-serif;
  font-weight: 400; font-size: .68rem;
  border: 1px solid var(--t3); cursor: pointer;
  transition: all .25s var(--e);
  text-decoration: none;
}
.btn-ghost:hover,
.btn-secondary:hover {
  border-color: var(--t2);
  background: rgba(255,255,255,.04);
}

.btn-text {
  color: var(--sky);
  font-weight: 600;
  font-size: .82rem;
  text-decoration: none;
  transition: color .25s;
}
.btn-text:hover { color: var(--skyL) }

/* ============================================================
   CUSTOM SCROLLBAR
   ============================================================ */

::-webkit-scrollbar { width: 6px }
::-webkit-scrollbar-track { background: var(--bg2) }
::-webkit-scrollbar-thumb { background: var(--sky); border-radius: 3px }

/* ============================================================
   SCROLL REVEAL ANIMATIONS
   ============================================================ */

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(30px) }
  to   { opacity: 1; transform: translateY(0) }
}
@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-60px) }
  to   { opacity: 1; transform: translateX(0) }
}
@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(60px) }
  to   { opacity: 1; transform: translateX(0) }
}
@keyframes scale-in {
  from { opacity: 0; transform: scale(0.95) }
  to   { opacity: 1; transform: scale(1) }
}

[data-reveal] { opacity: 0 }
[data-reveal].revealed {
  animation-duration: 600ms;
  animation-timing-function: var(--e2);
  animation-fill-mode: both;
  animation-delay: calc(var(--index, 0) * 100ms);
}
[data-reveal="fade-in-up"].revealed    { animation-name: fade-in-up }
[data-reveal="slide-in-left"].revealed { animation-name: slide-in-left }
[data-reveal="slide-in-right"].revealed { animation-name: slide-in-right }
[data-reveal="scale-in"].revealed      { animation-name: scale-in }

/* GSAP initial states */
.gs-reveal {
  opacity: 0;
  transform: translateY(50px);
}

/* ============================================================
   GLASSMORPHISM UTILITIES
   ============================================================ */

.glass-dark {
  background: rgba(6,13,20,.65);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--t4);
}

.glass-light {
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--t4);
}

/* ============================================================
   BREATHING LOGO
   ============================================================ */

@keyframes breathe {
  0%, 100% { transform: scale(1) }
  50%      { transform: scale(1.008) }
}
.site-logo img { animation: breathe 5s ease-in-out infinite }

/* ============================================================
   SKIP LINK (a11y)
   ============================================================ */

.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 10001;
  padding: 8px 16px;
  background: var(--sky);
  color: #fff;
  font-weight: 600;
  font-size: .75rem;
  border-radius: 0 0 8px 8px;
  transition: top .2s;
}
.skip-link:focus {
  top: 0;
}

/* Focus-visible for all interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="slider"]:focus-visible,
details summary:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ============================================================
   READING PROGRESS BAR
   ============================================================ */

.reading-progress {
  position: fixed;
  top: 0; left: 0;
  width: 0%; height: 2px;
  background: var(--sky);
  z-index: 101;
  transition: width 50ms linear;
  pointer-events: none;
}

/* ============================================================
   DROP CAP
   ============================================================ */

.drop-cap::first-letter {
  float: left;
  font-family: 'Fraunces', 'Fraunces-fallback', serif;
  font-weight: 700;
  font-size: 4.5em;
  line-height: 0.8;
  padding-right: 0.08em;
  color: var(--gold);
}

/* ============================================================
   DARK BACKGROUND SECTIONS
   ============================================================ */

.dark-bg {
  background-color: var(--bg3);
  color: var(--t1);
}
.dark-bg h1, .dark-bg h2, .dark-bg h3, .dark-bg h4 { color: var(--t1) }
.dark-bg p { color: var(--t2) }
.dark-bg a { color: var(--skyL) }
.dark-bg a:hover { color: #fff }

.alt-bg {
  background: var(--bg2);
}

/* ============================================================
   FORM FIELDS — Dark treatment
   ============================================================ */

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="password"],
input[type="search"],
textarea,
select {
  background: var(--bg2);
  color: var(--t1);
  border: 1px solid var(--t4);
  padding: 14px 20px;
  border-radius: 12px;
  font-family: 'Poppins', 'Poppins-fallback', sans-serif;
  font-size: 1rem;
  transition: border-color .2s var(--e), box-shadow .2s var(--e);
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px var(--skyG);
  outline: none;
}
::placeholder { color: var(--t3) }
label { color: var(--t2); font-weight: 600; font-size: .9375rem }

/* ============================================================
   404 PAGE
   ============================================================ */

.error-404 {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  padding: 64px 16px;
}
.error-404-inner { text-align: center; max-width: 480px }
.error-illustration {
  margin: 0 auto 48px; display: block;
  color: var(--t3);
}
.error-404 h1 {
  font-family: 'Fraunces', 'Fraunces-fallback', serif;
  font-size: clamp(2rem, 1.5rem + 2.5vw, 3rem);
  font-weight: 300; margin: 0 0 16px;
}
.error-404 p { margin: 0 0 32px; max-width: none }
.error-404 .btn-primary { margin-bottom: 32px; display: inline-flex }
.error-search { margin-top: 16px }
.error-search input[type="search"] {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--t4);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  width: 100%; max-width: 320px;
}
.error-search input[type="search"]::placeholder { color: var(--t3) }
.error-search input[type="search"]:focus {
  outline: 2px solid var(--sky);
  outline-offset: 2px;
  border-color: var(--sky);
}
.error-search .search-submit { display: none }

/* ============================================================
   GENERATEPRESS OVERRIDES — Kill GP default elements
   ============================================================ */

/* GP default header */
.site-header.has-inline-mobile-toggle,
header.site-header:not([role="banner"]),
.inside-header,
.main-navigation,
.mobile-menu-control-wrapper,
#site-navigation,
.inside-navigation {
  display: none !important;
}

/* GP default footer */
.site-footer:not(.lfd-footer),
.site-info, .inside-site-info,
footer.site-footer:not(.lfd-footer) {
  display: none !important;
}

/* GP content wrappers — full width */
.full-width-content .site-content,
.full-width-content .content-area,
.full-width-content .inside-article {
  padding: 0 !important;
  margin: 0 !important;
  max-width: 100% !important;
}
.full-width-content .entry-content {
  padding: 0 !important;
  margin: 0 !important;
}
.full-width-content article { padding: 0 !important }

/* Ensure our custom header shows */
header.site-header[role="banner"] { display: flex !important }

/* GP container breakouts for full-bleed sections */
.hero, .service-hero, .location-hero, .doctor-hero,
.about-team-hero, .cta-band, .dark-bg, .alt-bg {
  margin-left: calc(-50vw + 50%) !important;
  margin-right: calc(-50vw + 50%) !important;
  width: 100vw !important;
  max-width: 100vw !important;
}
.grid-container .hero,
.grid-container .service-hero,
.grid-container .cta-band,
.grid-container .dark-bg {
  margin-left: calc(-50vw + 50%) !important;
  width: 100vw !important;
}

/* GP separator containers */
.separate-containers .inside-article,
.separate-containers .page-header {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* ============================================================
   INLINE STYLE SAFETY NET — override hardcoded light backgrounds
   ============================================================ */

[style*="background-color:#ffffff"],
[style*="background-color: #ffffff"],
[style*="background-color:#FFFFFF"],
[style*="background-color: #FFFFFF"],
[style*="background-color:#F7F7F8"],
[style*="background-color: #F7F7F8"],
[style*="background-color: rgb(255, 255, 255)"],
[style*="background-color:rgb(247,247,248)"] {
  background-color: var(--bg2) !important;
}
[style*="color:#2A4656"],
[style*="color: #2A4656"],
[style*="color:#1F2937"],
[style*="color: #1F2937"] {
  color: var(--t1) !important;
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .gs-reveal, [data-reveal] { opacity: 1 !important; transform: none !important }
  body::after { display: none }
  .site-logo img { animation: none !important }
}

/* ============================================================
   TABLES — V5 Dark Treatment
   ============================================================ */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
  margin: 1.5rem 0;
}

thead {
  border-bottom: 2px solid var(--sky);
}

th {
  font-family: 'Poppins', 'Poppins-fallback', sans-serif;
  font-weight: 600;
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--skyL);
  text-align: left;
  padding: 12px 16px;
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  color: var(--t2);
  border-bottom: 1px solid var(--t4);
  vertical-align: top;
  line-height: 1.6;
}

tr:hover td {
  background: rgba(255,255,255,.02);
  color: var(--t1);
}

td a {
  color: var(--skyL);
  text-decoration: none;
  font-weight: 500;
  transition: color .25s;
}
td a:hover {
  color: #fff;
}

td strong {
  color: var(--t1);
  font-weight: 500;
}

/* Responsive table wrapper */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--t4);
  border-radius: var(--radius);
  background: var(--bg2);
}
.table-wrap table {
  margin: 0;
}
.table-wrap th:first-child,
.table-wrap td:first-child {
  padding-left: 20px;
}
.table-wrap th:last-child,
.table-wrap td:last-child {
  padding-right: 20px;
}

/* Even row subtle stripe */
tbody tr:nth-child(even) td {
  background: rgba(255,255,255,.015);
}

/* ============================================================
   MOBILE RESPONSIVE — Force inline grids to stack
   ============================================================ */

@media (max-width: 767px) {
  /* Force ALL inline grid columns to single column on mobile */
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns:repeat(3"],
  [style*="grid-template-columns: repeat(2"],
  [style*="grid-template-columns:repeat(2"] {
    grid-template-columns: 1fr !important;
  }

  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Tables scroll horizontally */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-wrap table {
    min-width: 500px;
  }

  /* Hero content stacks */
  .service-hero-inner {
    grid-template-columns: 1fr !important;
  }
  .service-hero-image {
    margin-top: 24px;
  }

  /* Doctor hero stacks */
  .doctor-hero-inner {
    grid-template-columns: 1fr !important;
  }
  .doctor-hero-portrait {
    max-width: 300px;
    margin: 0 auto 24px;
  }

  /* Location map stacks */
  .location-map-split {
    grid-template-columns: 1fr !important;
  }

  /* Contact split stacks */
  .contact-split {
    grid-template-columns: 1fr !important;
  }

  /* Procedure step numbers smaller */
  .procedure-step {
    grid-template-columns: 50px 1fr !important;
    gap: 12px !important;
  }

  /* Benefit grid stacks */
  .benefit-grid {
    grid-template-columns: 1fr !important;
  }

  /* Cost compare stacks */
  .cost-compare {
    grid-template-columns: 1fr !important;
  }

  /* Section padding reduced */
  .section {
    padding: clamp(48px, 10vw, 80px) 16px;
  }

  /* Hero h1 sizing */
  .hero-h1 {
    font-size: clamp(2.4rem, 8vw, 3.5rem);
  }

  h1 {
    font-size: clamp(2rem, 7vw, 3rem);
  }

  h2 {
    font-size: clamp(1.8rem, 6vw, 2.8rem);
  }

  /* Gallery grid - always single column on mobile */
  .gallery-grid {
    grid-template-columns: 1fr !important;
  }

  /* Office gallery stacks */
  .office-gallery {
    grid-template-columns: 1fr !important;
  }

  /* Full-bleed sections - prevent margin issues */
  .hero, .service-hero, .location-hero, .doctor-hero,
  .about-team-hero, .cta-band, .dark-bg, .alt-bg {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
  }

  /* Mobile CTA bar spacing */
  body {
    padding-bottom: 54px;
  }

  /* Topbar hidden on mobile */
  .topbar { display: none }
}

/* Tablet breakpoint */
@media (max-width: 1023px) and (min-width: 768px) {
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns:repeat(3"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .office-gallery {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
