/*
Theme Name: Keldik Sleep Medicine
Description: Lean custom theme for Keldik Sleep Medicine Clinic, Orlando FL. Built on the KELDIK brand manual (Montserrat, green/orange/blue palette). No page builder, no bundled demo content.
Author: Custom build for Keldik
Version: 1.0
Text Domain: keldik
*/

/* ============================================
   TOKENS
   ============================================ */
:root {
  /* Brand colors — from KELDIK Manual de Identidad Corporativa */
  --green: #97B438;
  --green-deep: #5F7423;   /* darkened for text-on-light contrast (AA) */
  --green-tint: #F0F4E4;
  --orange: #EF7A2C;
  --orange-tint: #FDECDE;
  --blue: #22B2E5;
  --blue-deep: #146686;    /* darkened for text-on-light contrast */
  --blue-tint: #E4F6FC;

  /* Neutrals */
  --ink: #24291F;          /* warm charcoal, not pure black */
  --ink-soft: #545C48;
  --paper: #FBFBF8;        /* soft warm white */
  --surface: #FFFFFF;
  --line: #E4E4DC;

  /* Type */
  --font: 'Montserrat', -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Layout */
  --max: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 3px;
}

/* ============================================
   RESET / BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { font-family: var(--font); margin: 0; line-height: 1.15; font-weight: 800; letter-spacing: -0.01em; }
p { margin: 0 0 1rem; max-width: 62ch; }
button { font-family: inherit; }

.container { max-width: var(--max); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* Focus visibility — accessibility floor */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ============================================
   HEADER / NAV
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 251, 248, 0.94);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.3rem; color: var(--ink); }
.brand img { height: 38px; width: auto; }

.primary-nav ul { display: flex; align-items: center; gap: 2rem; }
.primary-nav > ul > li { position: relative; }
.primary-nav a {
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
}
.primary-nav > ul > li > a:hover,
.primary-nav > ul > li.current-menu-item > a { color: var(--ink); border-bottom-color: var(--green); }

.primary-nav li:hover > .sub-menu,
.primary-nav li:focus-within > .sub-menu { display: block; }
.sub-menu {
  display: none;
  position: absolute;
  top: 100%; left: -1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 220px;
  padding: 0.5rem;
  box-shadow: 0 12px 24px rgba(36,41,31,0.08);
}
.sub-menu li a { display: block; padding: 0.55rem 0.75rem; border-radius: 3px; font-weight: 500; }
.sub-menu li a:hover { background: var(--green-tint); border-bottom-color: transparent; }

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  white-space: nowrap;
}
.header-cta:hover { background: var(--green-deep); }

.nav-toggle { display: none; }

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 1.25rem;
}
.lang-switcher li a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.lang-switcher li a:hover { background: var(--green-tint); color: var(--ink); }
.lang-switcher li.is-current a { background: var(--green-tint); color: var(--green-deep); }
.lang-flag {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(36,41,31,0.12);
}

@media (max-width: 900px) {
  .primary-nav { display: none; }
  .lang-switcher { margin: 0 0.5rem 0 auto; }
  .lang-switcher li a span { display: none; } /* icon-only on small screens to save header space */
  .nav-toggle {
    display: block; background: none; border: 2px solid var(--ink); border-radius: 4px;
    padding: 0.5rem 0.7rem; font-weight: 700;
  }
}

/* ============================================
   HERO — light, calm, photo-led. No dark wash,
   no blended tri-color gradient (kept the brand
   colors as separate accents elsewhere instead).
   ============================================ */
.hero {
  background: var(--surface);
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 0;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.hero-content { max-width: 46ch; }
.hero-kicker { color: var(--green-deep); font-weight: 700; font-size: 0.95rem; margin-bottom: 0.75rem; }
.hero h1 {
  font-size: clamp(2.1rem, 4.4vw, 3.2rem);
  color: var(--green-deep);
  margin-bottom: 1rem;
  overflow-wrap: break-word;
}
.hero-sub { font-size: 1.12rem; color: var(--ink-soft); margin-bottom: 1.75rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-media-wrap {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 40px -12px rgba(36,41,31,0.18);
}
.hero-media { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 4/3; }

@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-media-wrap { order: -1; }
}

/* Buttons — rounded, fresh, single flat colors (no mixed hues) */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: 700; font-size: 0.98rem;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  border: 2px solid transparent;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-deep); }
.btn-ghost { border-color: var(--green); color: var(--green-deep); background: transparent; }
.btn-ghost:hover { background: var(--green-tint); }
.btn-dark { background: var(--blue); color: #fff; }
.btn-dark:hover { background: var(--blue-deep); }
@media (prefers-reduced-motion: no-preference) {
  .btn:hover { transform: translateY(-1px); }
}

/* ============================================
   INFO TABLE — reusable 3-column format
   (image on top, caption below, thin dividers).
   Matches the image+caption layout already used
   on keldik.com for Visit Types / Test Types.
   Use .cols-2 when a row has only 2 items —
   the grid still reads as the same "table" system.
   ============================================ */
.info-section { padding: 4.5rem 0; }
.info-section + .info-section { border-top: 1px solid var(--line); }
.section-head { max-width: 56ch; margin-bottom: 2.75rem; }
.section-head .eyebrow { color: var(--green-deep); font-weight: 700; font-size: 0.95rem; margin-bottom: 0.5rem; }
.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }

.info-table {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.info-table.cols-2 { grid-template-columns: repeat(2, 1fr); }

.info-cell {
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
.info-cell img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.info-cell-body {
  padding: 1.5rem 1.5rem 1.75rem;
  border-top: 3px solid var(--green);
  flex: 1;
  display: flex;
  flex-direction: column;
}
.info-table .info-cell:nth-child(2) .info-cell-body { border-top-color: var(--blue); }
.info-table .info-cell:nth-child(3) .info-cell-body { border-top-color: var(--orange); }

.info-cell-body h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.info-cell-body p { font-size: 0.96rem; color: var(--ink-soft); margin-bottom: 1rem; }
.info-cell-body a.more { margin-top: auto; font-weight: 700; font-size: 0.92rem; color: var(--ink); border-bottom: 2px solid var(--green); align-self: flex-start; }

@media (max-width: 800px) {
  .info-table, .info-table.cols-2 { grid-template-columns: 1fr; }
}

/* ============================================
   PROVIDER PANEL — same bordered "table" system
   as the info-tables above, so this section reads
   as part of the same structure, not a separate style.
   ============================================ */
.provider-panel {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.provider-photo, .provider-text {
  background: var(--surface);
}
.provider-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.provider-text {
  padding: clamp(2rem, 4vw, 3rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-top: 3px solid var(--green);
}
.provider-text h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: 1rem; }
.provider-text p { color: var(--ink-soft); }
.provider-text .btn { align-self: flex-start; margin-top: 0.5rem; }

@media (max-width: 800px) {
  .provider-panel { grid-template-columns: 1fr; }
  .provider-photo { aspect-ratio: 4/3; }
}

/* ============================================
   GENERIC PAGE CONTENT (page.php)
   ============================================ */
.page-hero {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 3rem 0 2.25rem;
}
.page-hero h1 {
  font-size: clamp(1.7rem, 4.5vw, 2.6rem);
  color: var(--green-deep);
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}
.page-body { padding: 3.5rem 0; }
.page-body .container { max-width: 780px; }
.page-body h2 { font-size: 1.4rem; margin: 2rem 0 0.75rem; color: var(--green-deep); }
.page-body h3 { font-size: 1.15rem; margin: 1.5rem 0 0.5rem; }
.page-body ul { list-style: disc; padding-left: 1.4rem; margin-bottom: 1rem; }
.page-body ul li { margin-bottom: 0.4rem; }

@media (max-width: 480px) {
  .page-hero { padding: 2.25rem 0 1.75rem; }
  .page-hero .container { padding-left: 1.25rem; padding-right: 1.25rem; }
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--green-tint);
  color: var(--ink-soft);
  padding: 4rem 0 2rem;
  border-top: 1px solid var(--line);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(95,116,35,0.18);
}
.footer-brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.15rem; color: var(--green-deep); margin-bottom: 0.75rem; }
.footer-brand img { height: 30px; }
.footer-tagline { color: var(--ink-soft); font-size: 0.95rem; max-width: 34ch; }
.footer-col h4 { font-size: 0.85rem; text-transform: none; color: var(--green-deep); margin-bottom: 1rem; letter-spacing: 0.01em; }
.footer-col ul li { margin-bottom: 0.65rem; }
.footer-col a { color: var(--ink-soft); font-size: 0.95rem; }
.footer-col a:hover { color: var(--green-deep); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 1.75rem; font-size: 0.85rem; color: var(--ink-soft); flex-wrap: wrap; gap: 1rem;
}

@media (max-width: 800px) {
  .footer-grid { grid-template-columns: 1fr; }
}

/* ============================================
   UTILS
   ============================================ */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: #fff; color: var(--ink); padding: 0.75rem 1rem; z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }
