/* ======================================
   Design Tokens
   - Color, spacing, radii, shadows
   - Keep mobile‑first; prefer rem/clamp()
   ====================================== */
:root {
  /* Brand palette */
  --color-primary: #133e83;        /* main brand */
  --color-primary-700: #0c294b;    /* darker for hovers */
  --color-secondary: #1f558c;      /* complementary accent */
  --color-accent: #2a699d;         /* focus accents, subtle highlights */

  /* Text & surfaces */
  --color-text: #1f2937;           /* slate 800 */
  --color-text-light: #475569;     /* slate 600 */
  --color-border: #d5dde5;         /* light gray-blue border */
  --color-bg-light: #f7fafc;       /* light surface */
  --color-bg-lighter: #fbfdfe;     /* lighter surface */

  /* States */
  --color-success: #065f46;
  --color-success-bg: #ecfdf5;
  --color-danger: #991b1b;
  --color-danger-bg: #fef2f2;

  /* Shadows & radii */
  --shadow-sm: 0 1px 2px rgba(15, 76, 92, 0.05);
  --shadow-md: 0 2px 4px rgba(15, 76, 92, 0.08);
  --radius-sm: 6px;
  --radius-md: 8px;

  /* Spacing scale */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */

  /* Glass masthead tuning */
  /* Subtle neutral frost tint for readability */
  --glass-tint-hsl: 220 50% 16%;
  --glass-tint-hsl-submenu: 220 50% 95%;
  --glass-alpha: .18;    /* surface fill amount */
  --glass-stroke: .28;   /* border alpha */
  --glass-shadow: .28;   /* shadow opacity */
  --glass-blur: 4px;     /* blur radius */
  --radius-lg: 16px;     /* rounded menus */
}

/* ========================================================
   PPE: Pagination hide on single (hide for no index)
   ======================================================== */
.layout--single nav.pagination { display: none !important; }

/* ========================================================
   CONTACT HOURS layout (consolidated from dupe sections)
   ======================================================== */
.page__content .contact-hours {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: var(--space-6);  /* was 2rem */
  align-items: center;
  justify-items: stretch;
  margin: var(--space-6) auto;  /* tightened from 2.5rem */
  max-width: 1200px;
  padding: 0 var(--space-2);   /* was 0 0.25rem, still tight */
}

/* Hide prev/next pagination on single layouts */
.layout--single nav.pagination { display: none !important; }

/* Base layout */
.page__content .contact-hours {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
  justify-items: stretch;
  margin: 2.5rem auto;
  max-width: 1200px;
  padding: 0 0.25rem;
}

/* Map styles */
.page__content .contact-hours .map {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  transition: box-shadow 0.2s ease;
}

.page__content .contact-hours .map:hover {
  box-shadow: 0 4px 6px rgba(15, 76, 92, 0.1);
}

.page__content .contact-hours .map iframe {
  width: 100%;
  height: 420px;
  border: 0;
  display: block;
}

/* Info section styles */
.page__content .contact-hours .location-details {
  background: white;
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  text-align: center;
}

.section-subtitle {
  color: var(--color-primary);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin: 0 0 0.25rem;
}

.address-block {
  margin: 0.5rem 0;
}

.phone-block {
  margin-top: 0.75rem;
}

.hours-table-wrapper {
  background: var(--color-bg-lighter);
  border-radius: var(--radius-sm);
  padding: 0.25rem;
  margin-top: 0.25rem;
}

/* Modern table styles */
.hours-table {
  width: auto;
  min-width: 0;
  max-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  background: var(--color-bg-lighter);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.hours-table thead th {
  background: var(--color-bg-light);
  color: var(--color-primary);
  font-weight: 600;
  text-align: center;
  padding: clamp(0.55rem, 0.6vw + 0.4rem, 0.9rem) clamp(0.75rem, 1vw, 1.1rem);
  border-bottom: 2px solid var(--color-border);
  font-size: clamp(0.85rem, 0.4vw + 0.8rem, 1rem);
}

.hours-table tbody tr:not(:last-child) td {
  border-bottom: 1px solid var(--color-border);
}

.hours-table td {
  padding: 0.875rem 1rem;
  color: var(--color-text-light);
  line-height: 1.4;
}

.hours-table td:first-child {
  font-weight: 600;
  color: var(--color-text);
  width: 30%;
}

/* Section styling */
.section-title {
  font-size: 1.75rem;
  color: #1e293b;
  margin-bottom: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

/* Contact info styling */
.contact-info {
  margin-bottom: 0;
}

.contact-hours h3 {
  color: #1e293b;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  text-transform: none;
  letter-spacing: 0.025em;
}

.contact-hours address {
  font-style: normal;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #475569;
  display: grid;
  gap: 0.25rem;
  margin: 0;
}

.contact-hours address strong {
  color: #1e293b;
  font-weight: 600;
  display: block;
  margin: 0 0 0.25rem 0;
  line-height: 1.25;
}

.contact-hours .address-line,
.contact-hours .phone {
  display: block;
}

.contact-hours .phone {
  display: block;
  margin-top: 0.5rem;
}

.contact-hours .phone-link {
  color: #0f4c5c;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.contact-hours .phone-link:hover {
  color: #2d6a4f;
  text-decoration: underline;
}

@media (max-width: 900px) {
  .page__content .contact-hours {
    display: block;
    margin: 1rem 0.25rem;
    padding: 0;
  }
  .page__content .contact-hours .location-details {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }
  .page__content .contact-hours .map {
    margin-bottom: 1.25rem;
  }
  .page__content .contact-hours .map iframe {
    height: 240px;
  }
  .page__content .contact-hours .hours {
    padding: 1rem 0.5rem;
    gap: 1rem;
    min-width: 0;
  }
  .section-subtitle {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
  }
  .contact-info address {
    font-size: 0.92rem;
    word-break: break-word;
    min-width: 0;
  }
  .hours-table-wrapper {
    margin: 0;
    padding: 0;
    border-radius: 0;
  }
  .hours-table {
    font-size: 0.85rem;
    align-items: center;
    text-align: center;
    margin: 0.25rem 0 0 0;
    width: 100%;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    min-width: 0;
    table-layout: fixed;
    word-break: break-word;
  }
  .hours-table thead th {
    padding: 0.5rem 0.5rem;
    font-size: 0.8rem;
  }
  .hours-table td, .hours-table th {
    padding: 0.5rem 0.5rem;
    min-width: 0;
    word-break: break-word;
  }
  .page__content .contact-hours .hours { display: block; }
  .page__content .contact-hours .hours .contact-info,
  .page__content .contact-hours .hours .hours-info {
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }
  .page__content .contact-hours .hours .hours-info .hours-table {
    margin-left: auto;
    margin-right: auto;
  }
}

/* Very small screens */
@media (max-width: 400px) {
  .hours-table {
    font-size: 0.8125rem;
  }

  .hours-table thead th {
    padding: 0.5rem;
    font-size: 0.75rem;
  }

  .hours-table td {
    padding: 0.5rem;
  }
}

/* Ensure proper spacing between sections */
.page__content .contact-hours .location-details > *:last-child {
  margin-bottom: 0;
}
/* ===== END OF FINAL OVERRIDES ===== */
/* Contact actions */
.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2.5rem;
  justify-content: center;
}


.contact-actions .btn {
  flex: 1;
  min-width: 150px;
  max-width: 300px;
  text-align: center;
  padding: 0.875rem 1.5rem;
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  background-color: rgba(15, 76, 92, 0.07); /* semi-transparent version of --color-primary */
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
  box-shadow: 0 1px 4px rgba(15, 76, 92, 0.06);
  transition: background 0.18s, border 0.18s, box-shadow 0.18s;
}


.contact-actions .btn--primary {
  background-color: rgba(15, 76, 92, 0.13); /* slightly more opaque for primary */
  color: white;
  border: 1.5px solid var(--color-primary);
  box-shadow: 0 2px 8px rgba(15, 76, 92, 0.10);
}

.contact-actions .btn--primary:hover {
  background-color: var(--color-secondary);
  border-color: var(--color-secondary);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(15, 76, 92, 0.15);
}


.contact-actions .btn:hover {
  background-color: white;
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px rgba(15, 76, 92, 0.1);
}

.contact-actions .btn:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.contact-actions .btn:active {
  transform: translateY(0);
}

/* Responsive button adjustments */
@media (max-width: 600px) {
  .contact-actions {
    flex-direction: column;
    gap: 0.625rem;
    margin-top: 2rem;
    padding: 0 0.5rem;
  }
  .contact-actions .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    flex: 1 1 auto; /* allow buttons to shrink */
    margin-left: auto;
    margin-right: auto;
    text-align: center;
  }
}
/* End of custom styles */
/* Custom styles for contact hours */

/* References section: slightly smaller text */
.page__content h4.refs-small { font-size: 0.75em; }
.page__content h4.refs-small + ul { font-size: 0.65em; }

/* Typography and spacing */
.page__content .contact-hours h3 {
  font-size: clamp(1.15rem, 0.6vw + 1rem, 1.45rem);
  margin: 0 0 0.5rem 0;
}

.page__content .contact-hours .hours p {
  font-size: clamp(1rem, 0.25vw + 0.95rem, 1.1rem);
  line-height: 1.5;
  margin: 0 0 1rem 0;
}

/* Hours table styling */
.hours-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  font-size: 0.875rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

/* Table header */
.hours-table thead {
  background: #f8fafc;
}

.hours-table th {
  padding: 0.25rem;
  font-weight: 600;
  color: #1e293b;
  border-bottom: 2px solid #e2e8f0;
  font-size: 0.75rem;
  text-transform: none;
  letter-spacing: 0.05em;
}

/* Day column header */
.hours-table thead th:first-child {
  width: 4rem;
  text-align: center;
}

/* Time columns */
.hours-table thead th:not(:first-child) {
  text-align: center;
}

/* Table body */
.hours-table tbody th,
.hours-table tbody td {
  padding: 0.425rem 0.5rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

/* Day column */
.hours-table tbody th {
  font-weight: 600;
  color: #1e293b;
  text-align: center;
}

/* Time slots */
.hours-table tbody td {
  color: #475569;
  text-align: center;
}

/* Last row */
.hours-table tbody tr:last-child th,
.hours-table tbody tr:last-child td {
  border-bottom: 0;
}

/* Closed indicator */
.hours-table td:last-child:contains("Closed") {
  color: #94a3b8;
  font-size: 0.8125rem;
  letter-spacing: 0.025em;
}

/* ------------------------------
   Small-window polish
   ------------------------------ */
@media (max-width: 900px) {
  /* Keep map full-width on top (you already stack it), then two-column grid for content */
  .page__content .contact-hours .hours {
    grid-template-columns: 1.1fr 1fr;   /* Address a touch wider than Hours */
    gap: 1rem 1.2rem;
  }

  /* Tighter type and padding on narrow screens */
  .page__content .contact-hours h3 {
    font-size: clamp(1.05rem, 0.8vw + 0.9rem, 1.25rem);
    margin-bottom: 0.4rem;
  }
  .page__content .contact-hours .hours p {
    font-size: clamp(0.95rem, 0.4vw + 0.85rem, 1.02rem);
    margin-bottom: 0.75rem;
  }

  .hours-table {
    font-size: clamp(0.9rem, 0.6vw + 0.8rem, 1rem);
  }
  .hours-table td,
  .hours-table thead th {
    padding: 0.5rem 0.75rem;
  }
}

/* ======================================
   Lazy Map placeholder
   ====================================== */
.map-embed {
  position: relative;
  width: 100%;
  display: block;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #f3f4f6;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  min-height: 200px;
}

.map-placeholder {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  cursor: pointer;
  background:
    radial-gradient(200px 200px at 80% 20%, rgba(255,255,255,.5), transparent 60%),
    linear-gradient(135deg, #e5e7eb, #f8fafc);
  color: #1f2937;
  font-weight: 600;
}
.map-placeholder__label { background: rgba(255,255,255,.8); padding: .5rem .75rem; border-radius: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.08); }

.map-embed.is-loaded { background: #fff; box-shadow: var(--shadow-md); }

/* ===== FINAL CLEAN POLISH (desktop + mobile) ===== */
/* Desktop: smaller, single-line times and tighter address */
@media (min-width: 901px) {
  .page__content .contact-hours h3.section-subtitle { font-size: 1rem; }
  .page__content .contact-hours .contact-info address { font-size: 0.92rem; }

  .hours-table { font-size: 0.9rem; table-layout: fixed; }
  .hours-table thead th {
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
    white-space: nowrap;        /* keep MORNING/AFTERNOON on one line */
    letter-spacing: 0;          /* avoid forced wrapping from tracking */
    text-transform: none;       /* remove uppercase to save width */
    text-align: center;
  }
  .hours-table thead th:first-child { text-align: center; width: 4.75rem; }
  .hours-table tbody th,
  .hours-table tbody td {
    white-space: nowrap;        /* keep times on one line */
    padding: 0.4rem 0.75rem;
  }
}

/* Mobile: ensure both blocks are centered under the map */
@media (max-width: 900px) {
  .page__content .contact-hours .hours .contact-info,
  .page__content .contact-hours .hours .hours-info { text-align: center; }
}

/* === FINAL CENTERING OVERRIDES (both desktop & mobile) === */
/* Center the right column content within its grid column */
.page__content .contact-hours .location-details {
  margin-left: auto;
  margin-right: auto;
}
/* Constrain inner blocks so they don't stretch edge-to-edge */
.page__content .contact-hours .location-details .contact-info,
.page__content .contact-hours .location-details .hours-info {
  max-width: 520px;
  width: auto;
  min-width: 0;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}
/* Center the hours table within its container */
.page__content .contact-hours .location-details .hours-info .hours-table {
  margin-left: auto;
  margin-right: auto;
}
/* Center headers and data for the table on all breakpoints */
.hours-table thead th,
.hours-table tbody th,
.hours-table td { text-align: center; }
/* If any earlier rules force the first column left, override that */
.hours-table thead th:first-child,
.hours-table tbody th { text-align: center; }

/* ====================================== */
/* ===== Masthead Services dropdown ===== */
/* ====================================== */
.greedy-nav .has-submenu { position: relative; }
.greedy-nav .has-submenu > a { position: relative; touch-action: manipulation; }
.greedy-nav .has-submenu > a::after {
  content: ""; display: inline-block; width: 0; height: 0; margin-left: 6px;
  border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor;
  vertical-align: middle; opacity: 0.7;
}
.greedy-nav .submenu {
  /* Desktop / wide: animate dropdown */
  position: absolute; left: 0; top: 100%; z-index: 1000;
  min-width: 240px; padding: 8px 0; margin: 8px 0 0 0;
  background: hsl(var(--glass-tint-hsl-submenu) / .95) !important; /* increased opacity for readability */
  border: 0px solid var(--color-border); border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.08);
  /* animation state */
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .greedy-nav .submenu { transition: none; }
  .greedy-nav .has-submenu:hover > .submenu,
  .greedy-nav .has-submenu.submenu-open > .submenu { transition: none; }
}
.greedy-nav .submenu li { list-style: none; }
.greedy-nav .submenu a {
  display: block; padding: 8px 14px; text-decoration: none;
  color: var(--color-text); white-space: nowrap;
}
.greedy-nav .submenu a:hover {
  background: var(--color-bg-light); color: var(--color-primary);
  text-decoration: none; border-bottom: 0;
}

/* Keyboard focus states */
.greedy-nav a:focus-visible,
.greedy-nav .submenu a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Active trail and current item highlighting */
.greedy-nav .has-submenu.is-active-trail > a,
.greedy-nav .visible-links > li > a[aria-current="page"],
.greedy-nav .hidden-links > li > a[aria-current="page"] {
  color: var(--color-primary);
  font-weight: 700;
}
.greedy-nav .submenu a[aria-current="page"] {
  color: var(--color-primary);
  background: var(--color-bg-light);
  position: relative;
}
.greedy-nav .submenu a[aria-current="page"]::before {
  content: "";
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--color-primary);
}

/* Open submenu on hover, focus, or JS toggle */
.greedy-nav .has-submenu:hover > .submenu,
.greedy-nav .has-submenu.submenu-open > .submenu {
  opacity: 1; visibility: visible; transform: translateY(0);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: auto;
}

@media (max-width: 800px) {
  /* Mobile: slide-down animation */
  .greedy-nav .has-submenu > .submenu {
    position: static;            /* stack below parent link */
    min-width: 100%;
    margin: 0.25rem 0 0 0;
    border-radius: 6px;
    box-shadow: none;            /* flatter on mobile */
    overflow: hidden;
    max-height: 0;               /* collapsed by default */
    opacity: 0;                  /* fade for polish */
    border: 1px solid var(--color-border);
    border-color: transparent;   /* hide border when closed */
    transition: max-height .25s ease, opacity .2s ease, border-color .2s ease;
  }
  .greedy-nav .has-submenu.submenu-open > .submenu {
    max-height: 600px;           /* enough for several items */
    opacity: 1;
    border-color: var(--color-border);
  }
  .greedy-nav .submenu a { padding: 10px 12px; }
}

/* ===== Masthead dropdown visibility fixes ===== */
.masthead,
.masthead .greedy-nav,
.masthead .greedy-nav .visible-links { overflow: visible; }

.masthead { position: relative; z-index: 1000; }

.greedy-nav .submenu { z-index: 10000; margin-top: 8px; }

/* --- Hero text outline for better contrast over images --- */
 .page__hero--overlay .page__title,
 .page__hero--overlay .page__lead,
 .page__hero--overlay .page__lead p {
   color: #fff; /* readable fill */
   /* Subtle, clean outline: fewer, softer shadows */
   text-shadow:
     0 1px 2px rgba(0,0,0,.35),
     0 3px 10px rgba(0,0,0,.22);
   /* Very light stroke (helps on bright areas without haloing) */
   -webkit-text-stroke: 0.4px rgba(0,0,0,.5);
 }

/* ======================================
   Glass Masthead (frosted nav)
   ====================================== */
.masthead {
  position: sticky; top: 0; z-index: 1000;
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(120%);
  backdrop-filter: blur(var(--glass-blur)) saturate(120%);
  background-color: hsl(var(--glass-tint-hsl) / var(--glass-alpha));
  border-bottom: 1px solid hsl(var(--glass-tint-hsl) / var(--glass-stroke));
  box-shadow: 0 8px 26px rgba(0,0,0,var(--glass-shadow));
}
.masthead__inner-wrap {
  padding-left: .75rem; padding-right: .75rem;
  background: transparent !important; /* override theme white background */
  box-shadow: none; border: 0;
}
.masthead .masthead__menu,
.masthead .greedy-nav { background: transparent !important; box-shadow: none; border: 0; }
.masthead .greedy-nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .75rem;
}
.masthead .site-title,
.masthead .greedy-nav a { color: var(--color-primary, #0f4c5c); text-decoration: none; border-bottom: none; -webkit-text-stroke: .3px rgba(0,0,0,.4); }
.masthead .site-title { font-weight: 700; }
.masthead .greedy-nav a { font-weight: 600; letter-spacing: .2px; }
.masthead .greedy-nav a:hover,
.masthead .greedy-nav a:focus {
  text-decoration: none; border-bottom: none; box-shadow: none;
}

/* No animated underline on masthead links */

/* Greedy toggle button polish */
.masthead .greedy-nav__toggle {
  width: 42px; height: 42px; border-radius: 50%;
  border: none;
  background-color: hsl(var(--glass-tint-hsl) / .40);
  color: #fff; cursor: pointer;
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-appearance: none; appearance: none; background-clip: padding-box;
}
.masthead .greedy-nav__toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* Remove any white fill on active/open - match base tint */
.masthead .greedy-nav__toggle:hover,
.masthead .greedy-nav__toggle:focus,
.masthead .greedy-nav__toggle:active,
.masthead .greedy-nav__toggle.close,
.masthead .greedy-nav__toggle[aria-expanded="true"] {
  background-color: hsl(var(--glass-tint-hsl) / .01) !important;
  border-color: hsl(var(--glass-tint-hsl) / .28) !important;
  box-shadow: none !important;
}
.masthead .navicon,
.masthead .navicon::before,
.masthead .navicon::after {
  content: "";
  display: block;
  width: 1.5rem;            /* bar length */
  height: 0.25rem;          /* bar thickness */
  background: var(--color-primary);
  border-radius: 2px;
}
.masthead .navicon { position: relative; margin: 0 auto; transition: 0.3s ease-in-out; }
.masthead .navicon::before,
.masthead .navicon::after { position: absolute; left: 0; transition: 0.3s ease-in-out; }
.masthead .navicon::before { top: -0.5rem; }
.masthead .navicon::after  { bottom: -0.5rem; }

/* Animate to X when menu is open: support both aria-expanded and .close */
.masthead .greedy-nav__toggle[aria-expanded="true"] .navicon,
.masthead .greedy-nav__toggle.close .navicon { background: transparent; }
.masthead .greedy-nav__toggle[aria-expanded="true"] .navicon::before,
.masthead .greedy-nav__toggle.close .navicon::before {
  top: 0; transform-origin: 50% 50%; transform: rotate(45deg);
}
.masthead .greedy-nav__toggle[aria-expanded="true"] .navicon::after,
.masthead .greedy-nav__toggle.close .navicon::after {
  top: 0; bottom: auto; transform-origin: 50% 50%; transform: rotate(-45deg);
}

/* Hidden links panel as frosted dropdown when visible */
.masthead .greedy-nav { position: relative; }
/* Default: immediate tinted background (prevent white box flash) */
.masthead .greedy-nav .hidden-links { background: hsl(var(--glass-tint-hsl-submenu) / .8) !important; box-shadow: none; border: 0; }
/* When open, show frosted panel */
.masthead .greedy-nav .hidden-links:not(.hidden) {
  position: absolute; top: calc(100% + 8px); right: .75rem; display: flex; flex-direction: column;
  gap: .25rem; padding: .5rem; border-radius: var(--radius-lg);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  backdrop-filter: blur(16px) saturate(180%);
  background-color: hsl(var(--glass-tint-hsl-submenu) / .8) !important;
  border: 1px solid hsl(var(--glass-tint-hsl-submenu) / .60);
  box-shadow: 0 12px 32px rgba(0,0,0,.40);
}
.masthead .greedy-nav .hidden-links:not(.hidden) a { color: var(--color-primary) !important; text-shadow: none; -webkit-text-stroke: 0; }
/* Tinted hover, remove white highlight */
.masthead .greedy-nav .hidden-links:not(.hidden) a:hover {
  background: hsl(var(--glass-tint-hsl-submenu) / .32);
  text-decoration: none; border-bottom: 0; box-shadow: none;
}
/* Underline in mobile dropdown too */
.masthead .greedy-nav .hidden-links:not(.hidden) a { position: relative; }
.masthead .greedy-nav .hidden-links:not(.hidden) a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px;
  height: 2px; background: var(--color-primary); border-radius: 1px;
  transform: scaleX(0); transform-origin: left; transition: transform .18s ease;
}
.masthead .greedy-nav .hidden-links:not(.hidden) a:hover::after,
.masthead .greedy-nav .hidden-links:not(.hidden) a:focus::after { transform: scaleX(1); }

/* Override Services submenu panel to use frosted tint instead of white */
.masthead .greedy-nav .submenu {
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  backdrop-filter: blur(12px) saturate(160%);
  background-color: hsl(var(--glass-tint-hsl-submenu) / .60) !important;
  border: 1px solid hsl(var(--glass-tint-hsl-submenu) / .70) !important;
  box-shadow: 0 12px 32px rgba(0,0,0,.30);
  border-radius: 12px;
}
.masthead .greedy-nav .submenu a { color: var(--color-primary) !important; text-shadow: none; -webkit-text-stroke: 0; }
.masthead .greedy-nav .submenu a:hover,
.masthead .greedy-nav .submenu a:focus {
  background: hsl(var(--glass-tint-hsl-submenu) / .45) !important; color: var(--color-primary);
  text-decoration: none; border-bottom: 0; box-shadow: none;
}
/* Subtle underline for Services submenu items */
.masthead .greedy-nav .submenu a { position: relative; }
.masthead .greedy-nav .submenu a::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 6px;
  height: 2px; background: var(--color-primary); border-radius: 1px;
  transform: scaleX(0); transform-origin: left; transition: transform .18s ease;
}
.masthead .greedy-nav .submenu a:hover::after,
.masthead .greedy-nav .submenu a:focus::after { transform: scaleX(1); }

/* Prevent double underline when submenu renders inside hidden-links (mobile)
   Keep only the submenu's animated underline, disable the hidden-links one */
.masthead .greedy-nav .hidden-links:not(.hidden) .submenu a::after {
  content: none !important;
}

/* Ensure no static border underlines are applied to submenu links */
.masthead .greedy-nav .submenu a {
  border-bottom: 0 !important;
}

/* Remove thinner, inner animated underline for submenu items
   Keep the main visible-links underline effect instead */
.masthead .greedy-nav .submenu a::after {
  content: none !important;
}

/* Mobile layout: rely on theme behavior but ensure visibility */
@media (max-width: 900px) {
  /* Keep visible-links rendered so Greedy Nav can measure/move items */
  .masthead .visible-links { display: flex !important; }
  .masthead .greedy-nav__toggle { display: inline-flex; align-items: center; justify-content: center; }
}

/* Scrolled-state tint for readability */
.masthead.is-scrolled {
  background-color: hsl(var(--glass-tint-hsl) / calc(var(--glass-alpha) + .06));
  border-bottom-color: hsl(var(--glass-tint-hsl) / calc(var(--glass-stroke) + .06));
  box-shadow: 0 10px 28px rgba(0,0,0, calc(var(--glass-shadow) + .05));
}

/* Fallbacks for browsers without backdrop-filter */
@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)) {
  .masthead { background-color: hsl(var(--glass-tint-hsl) / .85); }
  .masthead .greedy-nav .hidden-links:not(.hidden) { background-color: hsl(var(--glass-tint-hsl) / .8); }
}

/* ======================================
   Utilities
   - Spacing helpers for quick tweaks
   ====================================== */
.mt-1 { margin-top: var(--space-1) !important; }
.mt-2 { margin-top: var(--space-2) !important; }
.mt-3 { margin-top: var(--space-3) !important; }
.mt-4 { margin-top: var(--space-4) !important; }
.mb-1 { margin-bottom: var(--space-1) !important; }
.mb-2 { margin-bottom: var(--space-2) !important; }
.mb-3 { margin-bottom: var(--space-3) !important; }
.mb-4 { margin-bottom: var(--space-4) !important; }
.pt-1 { padding-top: var(--space-1) !important; }
.pt-2 { padding-top: var(--space-2) !important; }
.pt-3 { padding-top: var(--space-3) !important; }
.pt-4 { padding-top: var(--space-4) !important; }
.pb-1 { padding-bottom: var(--space-1) !important; }
.pb-2 { padding-bottom: var(--space-2) !important; }
.pb-3 { padding-bottom: var(--space-3) !important; }
.pb-4 { padding-bottom: var(--space-4) !important; }
.px-2 { padding-left: var(--space-2) !important; padding-right: var(--space-2) !important; }
.px-4 { padding-left: var(--space-4) !important; padding-right: var(--space-4) !important; }
.py-2 { padding-top: var(--space-2) !important; padding-bottom: var(--space-2) !important; }
.py-4 { padding-top: var(--space-4) !important; padding-bottom: var(--space-4) !important; }

@media (max-width: 600px) {
  .page__hero--overlay .page__title,
  .page__hero--overlay .page__lead,
  .page__hero--overlay .page__lead p {
    -webkit-text-stroke-width: 0.3px;
    text-shadow:
      0 1px 2px rgba(0,0,0,.28),
      0 2px 6px rgba(0,0,0,.18);
  }
}

/* ===== Modern micro-interactions & scroll reveals ===== */
html { scroll-behavior: smooth; }

/* Accessible focus outline (keyboard only) */
:focus-visible { outline: 2px solid var(--color-primary, #103d2d); outline-offset: 2px; }

/* Subtle lift on cards/tiles */
.home-tile { transition: transform .22s ease, box-shadow .22s ease; }
.home-tile:hover, .home-tile:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15,76,92,0.12);
}

/* Scroll reveal utility */
:root { --reveal-duration: .5s; --reveal-ease: cubic-bezier(.215,.61,.355,1); }
.reveal { opacity: 0; transform: translateY(12px); filter: blur(.25px);
  transition: opacity var(--reveal-duration) var(--reveal-ease),
              transform var(--reveal-duration) var(--reveal-ease),
              filter var(--reveal-duration) var(--reveal-ease);
  will-change: opacity, transform, filter;
}
.reveal.is-revealed { opacity: 1; transform: none; filter: none; }
.reveal--fade { transform: none; }
.reveal--up { transform: translateY(16px); }
.reveal--scale { transform: scale(.985); }

/* Reduced-motion: disable fancy transitions */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; filter: none !important; }
}

/* Optional: tighten vertical rhythm for revealed section titles */
.section-title.reveal { margin-top: 1.2rem; }

/* Place hero caption under buttons and style review links */
.page__hero--overlay .page__hero-caption {
  position: static; /* make it flow under buttons */
  margin-top: .75rem;
  margin-left: .5rem;
  text-align: center;
  font-size: .95rem;
  color: #fff;
  opacity: .98;
  background: transparent !important; /* remove dark strip */
  padding: 0; /* no box look */
  /* Subtle outline so text reads over busy photos */
  text-shadow:
    0 1px 2px rgba(0,0,0,.34),
    0 3px 10px rgba(0,0,0,.2);
  -webkit-text-stroke: 0.35px rgba(0,0,0,.45);
}
.page__hero--overlay .page__hero-caption .review-links a {
  color: #fff;
  text-decoration: underline;
  background: transparent !important;
  text-shadow:
    0 1px 2px rgba(0,0,0,.34),
    0 3px 10px rgba(0,0,0,.2);
  -webkit-text-stroke: 0.35px rgba(0,0,0,.45);
}
.page__hero--overlay .page__hero-caption .review-links a:hover,
.page__hero--overlay .page__hero-caption .review-links a:focus {
  text-decoration: none;
}
@media (max-width: 600px) {
  .page__hero--overlay .page__hero-caption {
    -webkit-text-stroke-width: 0.3px;
    text-shadow:
      0 1px 2px rgba(0,0,0,.28),
      0 2px 6px rgba(0,0,0,.18);
  }
}

/* ===== FAQ Accordion ===== */
.faq { margin: 1rem 0 2rem; }

.faq details {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  margin-bottom: .75rem;
  overflow: hidden;
}

.faq summary {
  list-style: none;
  cursor: pointer;
  padding: .9rem 1rem;
  position: relative;
  font-weight: 600;
  color: #1e293b;
  display: flex;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  margin-left: auto;
  font-weight: 700;
  color: #1f2937;
  transition: transform .2s ease, opacity .2s ease;
}

.faq details[open] summary::after { content: "–"; }

.faq__content {
  padding: .75rem 1rem 1rem;
  border-top: 1px solid var(--color-border);
  color: #475569;
  line-height: 1.6;
  animation: faq-open .18s ease;
}
.faq__content > *:last-child { margin-bottom: 0; }

@keyframes faq-open {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

.faq details:focus-within {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .faq__content { animation: none !important; }
}

/* Footer polish */
footer .footer__address address { line-height: 1.35; }
footer nav a { text-decoration: none; }
footer nav a:hover, footer nav a:focus { text-decoration: underline; }

@media (min-width: 900px) {
  footer .footer__address { font-size: 0.85rem; }
}

/* ===== Contact page: form styles (base) ===== */
.contact-form { max-width: 860px; margin: 0 auto 2rem; }
.contact-form .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.contact-form .form-field.full { grid-column: 1 / -1; }

.contact-form label { display:block; font-weight:600; margin: 0 0 .35rem; }

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea {
  width: 100%; padding: .65rem .75rem; font-size: 1rem;
  border: 1px solid var(--color-border, #d6d6d6); border-radius: 8px;
  background: #fff; color: inherit; box-shadow: 0 1px 0 rgba(0,0,0,.02) inset;
}
.contact-form textarea { min-height: 140px; resize: vertical; }

/* Fieldset for contact preferences */
.contact-form fieldset {
  border: 1px solid var(--color-border, #d6d6d6);
  border-radius: 8px; padding: .6rem .75rem; margin: 0;
}
.contact-form legend { font-weight: 600; padding: 0 .25rem; }
.contact-form fieldset label { font-weight: 500; }

/* Choice pills (checkboxes styled as toggles) */
.choice-pills { display:flex; gap:.5rem; flex-wrap: wrap; }
.choice-pills label { position:relative; display:inline-flex; align-items:center; cursor:pointer; }
.choice-pills input[type="checkbox"] { position:absolute; opacity:0; inset:0; }
.choice-pills span { display:inline-block; padding:.45rem .75rem; border:1px solid var(--color-border, #d6d6d6); border-radius:999px; background:#fff; font-weight:600; }
.choice-pills input[type="checkbox"]:checked + span { background: var(--color-primary, #103d2d); color:#fff; border-color: var(--color-primary, #103d2d); }
.choice-pills input[type="checkbox"]:focus-visible + span { outline:2px solid rgba(16,61,45,.22); outline-offset:2px; }

/* Actions row */
.contact-form .actions { grid-column: 1 / -1; display:flex; gap:.75rem; align-items:center; flex-wrap: wrap; }

/* Mobile tweaks */
@media (max-width: 720px) {
  .contact-form .form-grid { grid-template-columns: 1fr; }
  .contact-form .actions .btn { flex: 1 1 100%; text-align: center; }
}

/* ===== Contact page: polish & accessibility ===== */
/* Subtle transitions for inputs */
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form input[type="tel"],
.contact-form textarea {
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
/* Hover hint */
.contact-form input:hover,
.contact-form textarea:hover {
  border-color: rgba(16,61,45,.35);
}
/* Focus-visible for keyboards */
.contact-form input:focus-visible,
.contact-form textarea:focus-visible,
.choice-pills input[type="checkbox"]:focus-visible + span {
  outline: 2px solid rgba(16,61,45,.28);
  outline-offset: 2px;
}
/* Placeholder tone */
.contact-form ::placeholder { color: #94a3b8; opacity: 1; }
/* Error state (JS will set aria-invalid=true when invalid) */
.contact-form [aria-invalid="true"] {
  border-color: #b91c1c !important;
  box-shadow: 0 0 0 3px rgba(185,28,28,.12);
}
/* Success & failure banners (for future JS) */
.form-status {
  margin: 0 auto 1rem; padding: .75rem 1rem; border-radius: 8px; max-width: 860px;
}
.form-status--ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.form-status--err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
/* Tighten legend spacing */
.contact-form fieldset { margin-top: .25rem; }
.contact-form legend { margin-bottom: .25rem; }

/* Buttons alignment when long helper text wraps */
.contact-form .actions { align-items: flex-start; }

/* Choice pills polish */
.choice-pills span { transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
.choice-pills label:hover span { border-color: rgba(16,61,45,.45); }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .contact-form input[type="text"],
  .contact-form input[type="email"],
  .contact-form input[type="tel"],
  .contact-form textarea,
  .choice-pills span { transition: none !important; }
}
/* === Contact preference pills: keep side-by-side === */
.choice-pills {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: .5rem;
  flex-wrap: nowrap; /* don’t stack by default */
}
.choice-pills label {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;  /* prevent stretching to full width */
  margin: 0;
}
.choice-pills span { white-space: nowrap; }

/* Allow wrap only on ultra-narrow screens */
@media (max-width: 380px) {
  .choice-pills { flex-wrap: wrap; }
}
/* === Contact form: fix overflow & center full-width rows on desktop === */
/* Ensure borders/padding don’t cause overflow */
.contact-form, .contact-form * , .contact-form *::before, .contact-form *::after { box-sizing: border-box; }

@media (min-width: 900px) {
  /* Narrow the very wide single-row elements (Message + Preference fieldset) */
  .contact-form .form-field.full label[for="message"],
  .contact-form .form-field.full textarea,
  .contact-form .form-field.full fieldset,
  .contact-form .form-field.full .help {
    max-width: 820px; /* sweet spot for readability */
    margin-left: 0;     /* align with left edge of the grid */
    margin-right: auto; /* do not center */
    width: 100%;
    text-align: left;
  }

  /* Keep the pills row tidy and left-aligned inside the narrowed fieldset */
  .contact-form .form-field.full fieldset { display: block; }
  .choice-pills { justify-content: flex-start; }
}

/* === Contact page: larger buttons & phone size on mobile === */
@media (max-width: 720px) {
  /* Make form action buttons larger and full-width */
  .contact-form .actions .btn,
  .contact-actions .btn {
    font-size: 1.0625rem; /* ~17px to avoid iOS auto-zoom quirks */
    line-height: 1.2;
    padding: 0.95rem 1.15rem;
    min-height: 48px; /* comfortable tap target */
    border-radius: 12px;
  }
  .contact-actions .btn .btn-label { font-size: inherit; }
  .contact-form .actions .btn { flex: 1 1 100%; text-align: center; }
  .contact-form .actions { align-items: stretch; }

    /* Emphasize inline phone link under the address */
  .location-details .phone-link {
    font-size: 1.125rem;
    font-weight: 700;
  }
}

/* === Hero banner: vertically center background image === */
/* Only Services (or any page with hero-services) */
.hero-services .page__hero--overlay {
  background-position: 50% 50% !important;
}

/* Only Home (or any page with hero-home) */
.hero-home .page__hero--overlay {
  background-position: 50% 60% !important;
}

/* Only Contact (or any page with hero-contact) */
.hero-contact .page__hero--overlay {
  background-position: 50% 40% !important;
}

/* Only New Patients (or any page with hero-newpatients) */
.hero-newpatients .page__hero--overlay {
  background-position: 50% 40% !important;
}


/* === Doctor page: keep headshot on right on mobile === */
@media (max-width: 720px) {
  .doctor-page .page__content img.align-right{
    float: right !important;      /* override theme's mobile reset */
    width: 120px !important;      /* smaller on mobile */
    height: auto;
    margin-left: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem !important;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(15,76,92,0.12); /* subtle shadow */
    object-fit: cover;
  }
}

/* === Insurance cards (used on Insurance & New Patients pages) === */
.page__content #insurance-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1rem 0 2rem;
}
.page__content #insurance-cards .card {
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  padding: 1.25rem;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: box-shadow .18s ease, transform .18s ease;
}
.page__content #insurance-cards .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15,76,92,.10);
}
.page__content #insurance-cards .card strong { font-size: 1.05rem; }
.page__content #insurance-cards .card img {
  max-width: 160px;
  height: auto;
  margin-top: 0.5rem;
  filter: grayscale(100%) brightness(0.8);
  transition: filter .18s ease;
}
.page__content #insurance-cards .card img:hover { filter: none; }
@media (max-width: 400px) {
  .page__content #insurance-cards { grid-template-columns: 1fr; }
}
.page__content #insurance-cards .card {
  padding: 1rem;
}
.page__content #insurance-cards .card strong { font-size: 1rem; }
.page__content #insurance-cards .card img { max-width: 140px; }

/* === Treat page: two-column summaries for conditions list === */
#treat-conditions details > summary {
  display: grid;
  grid-template-columns: minmax(140px, 38%) 1fr;
  column-gap: 1rem;
  align-items: start;
}
#treat-conditions details > summary .term {
  font-weight: 700;
  line-height: 1.3;
}
#treat-conditions details > summary .desc {
  font-weight: 400;
}
@media (min-width: 900px) {
  #treat-conditions details > summary { grid-template-columns: minmax(180px, 34%) 1fr; }
}

/* Keep the +/– toggle vertically centered at the far right */
#treat-conditions details > summary {
  position: relative;          /* anchor for the pseudo element */
  padding-right: 2.25rem;      /* room for the +/– glyph */
  min-height: 44px;            /* comfortable tap target */
}
#treat-conditions details > summary::after {
  content: "+";
  position: absolute;
  right: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1;
  color: #1f2937;
  pointer-events: none;        /* avoid catching clicks */
}
#treat-conditions details[open] > summary::after { content: "–"; }

/* Ensure the control stays aligned on narrow screens too */
@media (max-width: 520px) {
  #treat-conditions details > summary {
    padding-right: 2.25rem;
  }
}

/* ============================
   Greedy Nav toggle overrides
   - Remove gray idle background
   - Prevent white overlay flash
   ============================ */
/* Make the hamburger button fully transparent at rest */
.masthead .greedy-nav__toggle {
  background-color: transparent !important;
}

/* Keep hover/active subtle if desired (optional) */
.masthead .greedy-nav__toggle:hover,
.masthead .greedy-nav__toggle:focus,
.masthead .greedy-nav__toggle:active,
.masthead .greedy-nav__toggle.close,
.masthead .greedy-nav__toggle[aria-expanded="true"] {
  background-color: transparent !important;
  box-shadow: none !important;
}

/* Neutralize the theme's full-viewport overlay to avoid white flash
   while preserving outside-click behavior (still captures clicks) */
.greedy-nav__toggle::before,
.greedy-nav__toggle.close::before {
  background-color: transparent !important;
}
