/* ===================================================================
   Reusable Components — Header, Footer, Buttons, Contact Section, etc.
   Athena Eye Care

   NOTE ON THE HERO-VIDEO COLOR BUG:
   Chrome misblends colors when a transparent/blurred element sits in a
   stacking context overlapping a <video>. Hovering the nav triggered a
   repaint that snapped the whole video's color. The fix is to remove
   every ingredient of that combination:
     - no backdrop-filter: blur() anywhere that overlaps the video
     - no transform: translateZ()/will-change layer hacks on the header
       or nav links
     - dropdown / sub-dropdown backgrounds are fully OPAQUE (#0d0d0d),
       not rgba() — opaque colors can't be misblended
   =================================================================== */

/* ===== BUTTONS ===== */

.btn {
  font-family: var(--font-montserrat);
  font-weight: var(--fw-regular);   /* F12: original button text is weight 400 */
  font-size: var(--fs-button);
  text-transform: uppercase;
  letter-spacing: var(--ls-button);
  padding: var(--button-padding-y) var(--button-padding-x);
  border-radius: var(--button-border-radius);
  border: none;
  cursor: pointer;
  display: inline-block;
  text-align: center;
  transition: all var(--transition-base);
  text-decoration: none;
}

.btn-primary {
  background-color: var(--color-black);
  color: var(--color-white);
}

.btn-primary:hover {
  background-color: var(--color-sky-blue);
  color: var(--color-white);
  text-decoration: none;
}

.btn-secondary {
  background-color: var(--color-white);
  color: var(--color-black);
  border: 1px solid var(--color-black);
}

.btn-secondary:hover {
  background-color: var(--color-black);
  color: var(--color-white);
  text-decoration: none;
}

/* ===== HERO HEADINGS (generic, used by interior pages) ===== */

.hero-h1 {
  font-family: var(--font-jost);
  font-weight: var(--fw-thin);
  font-size: var(--fs-hero-h1);
  line-height: var(--lh-hero-h1);
  color: var(--color-white);
  text-align: right;
  max-width: 277px;
  margin-left: auto;
}

.hero-subtitle {
  font-family: var(--font-times);
  font-weight: var(--fw-bold);
  font-size: var(--fs-hero-subtitle);
  line-height: var(--lh-hero-subtitle);
  letter-spacing: var(--ls-hero-subtitle);
  color: var(--color-white);
  text-align: right;
  max-width: 277px;
  margin-left: auto;
}

/* ====================================================================
   MAIN HEADER (sticky, transparent on top, dark when scrolled)
   No transform/will-change here — those created a stacking context that
   (a) triggered the video color bug and (b) broke the negative-margin
   overlap with the hero, producing a white bar at the top.
   ==================================================================== */

.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: transparent;
  transition: background-color var(--transition-base);
  /* F12 undocked: original header band (.birdseye-header) has 10px
     vertical padding, not 16px. This was making our band too thick. */
  padding: 10px 0;
}

/* When scrolled (toggled by JavaScript) — near-solid dark band.
   Fully opaque would be ideal, but the original is a hair translucent;
   0.92 is close and, with no blur and no sibling stacking-context hacks,
   no longer triggers the video misblend. */
.site-header.is-scrolled {
  background-color: rgba(0, 0, 0, 0.92);
}

/* Header inner layout */
.site-header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-lg);
}

/* Logo — file is 3154x832 (3.79:1).
   GROUND TRUTH from athenaeyecare.com via DevTools UNDOCKED (separate
   window, true desktop width). The earlier "40px" reading was a docked-
   DevTools artifact (page forced into mobile breakpoint) — invalid.
   The real computed <img> values are:
     width 334px, height 88px, max-height 1200px, max-width 600px.
   NOTE: header height = 88 + 16 + 16 = 120px; the hero offset in
   pages.css (.hero-home) is matched to this. */
.site-logo {
  flex-shrink: 0;
  display: block;
}

.site-logo img {
  height: 88px;
  width: 334px;
  max-height: 1200px;
  max-width: 600px;
  display: block;
}

.site-header.is-scrolled .site-logo img {
  opacity: 0.95;
}

/* ====================================================================
   NAVIGATION MENU
   No transform hacks on nav links — they didn't fix the hover bug and
   added stacking contexts. The real fix is removing blur + opaque
   dropdowns (below).
   ==================================================================== */

.main-nav {
  display: flex;
  align-items: center;
}

.main-nav__list {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav__item {
  position: relative;
}

.main-nav__link {
  font-family: var(--font-montserrat);
  /* F12: original nav computes to weight 500 but RENDERS as "Montserrat
     Thin" (the Weebly site loads a font file literally named that, so any
     weight renders thin). Our build loads normal Montserrat, where the
     weight number behaves normally — so an exact replication isn't
     possible. User feedback: weight 100 was too light / hard to read.
     Set to 300: readable, still light. Deliberate calibration, not a
     number match. Size 12px, letter-spacing 0.6px per F12. */
  font-weight: var(--fw-light);
  font-size: 12px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--color-white);
  text-decoration: none;
  padding: 8px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition-fast);
  cursor: pointer;
  background: none;
  border: none;
}

.main-nav__link:hover {
  color: var(--color-sky-blue);
  text-decoration: none;
}

/* Dropdown arrow */
/* Dropdown caret — HIDDEN to match the original site, which shows no
   carets on the nav items. The <span class="main-nav__arrow"> is left in
   the HTML (harmless empty span; the dropdown JS doesn't depend on it)
   so markup stays parallel, but it renders nothing. */
.main-nav__arrow {
  display: none;
}

/* ====================================================================
   DROPDOWN MENUS — opaque background, NO backdrop-filter
   ==================================================================== */

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 280px;
  background-color: #0d0d0d;     /* OPAQUE — no rgba, no blur */
  padding: var(--space-sm) 0;
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity var(--transition-base), visibility var(--transition-base), transform var(--transition-base);
  pointer-events: none;
}

.main-nav__item:hover > .dropdown,
.main-nav__item.is-open > .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown__item {
  position: relative;
}

.dropdown__link {
  display: block;
  padding: 10px var(--space-md);
  color: var(--color-white);
  font-family: var(--font-montserrat);
  font-size: 12px;
  font-weight: var(--fw-medium);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.dropdown__link:hover {
  background-color: rgba(94, 195, 240, 0.2);
  color: var(--color-sky-blue);
  text-decoration: none;
}

/* Sub-dropdown indicator arrow */
.dropdown__item--has-submenu > .dropdown__link::after {
  content: '\25B6';
  float: right;
  font-size: 8px;
  margin-top: 5px;
  opacity: 0.6;
}

/* Highlight parent item when its sub-menu is open */
.dropdown__item--has-submenu:hover > .dropdown__link,
.dropdown__item--has-submenu.is-open > .dropdown__link {
  background-color: rgba(94, 195, 240, 0.2);
  color: var(--color-sky-blue);
}

/* ====================================================================
   SUB-DROPDOWN — opens to the RIGHT, opaque background, NO blur
   ==================================================================== */

.sub-dropdown {
  position: absolute;
  top: 0;
  left: 100%;
  margin-left: 4px;
  min-width: 320px;
  background-color: #0d0d0d;     /* OPAQUE — no rgba, no blur */
  padding: var(--space-sm) 0;
  list-style: none;
  margin-top: -8px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
  pointer-events: none;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

.dropdown__item--has-submenu:hover > .sub-dropdown,
.dropdown__item--has-submenu.is-open > .sub-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ====================================================================
   MOBILE HAMBURGER MENU
   ==================================================================== */

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 102;
}

.mobile-menu-toggle__line {
  display: block;
  width: 28px;
  height: 2px;
  background-color: var(--color-white);
  margin: 6px 0;
  transition: all var(--transition-base);
}

.mobile-menu-toggle.is-active .mobile-menu-toggle__line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.mobile-menu-toggle.is-active .mobile-menu-toggle__line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.is-active .mobile-menu-toggle__line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ====================================================================
   SKY BLUE CONTACT SECTION
   ==================================================================== */

.contact-section {
  background-color: var(--color-sky-blue);
  color: var(--color-white);
  padding: var(--space-3xl) 0;
}

.contact-section__title {
  font-family: var(--font-playfair);
  font-weight: var(--fw-regular);
  font-size: 28px;
  text-align: center;
  color: var(--color-white);
  margin-bottom: var(--space-2xl);
}

.contact-section__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  align-items: start;
}

@media (min-width: 768px) {
  .contact-section__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
  }
}

.contact-info {
  color: var(--color-white);
}

.contact-info__name {
  font-family: var(--font-playfair);
  font-weight: var(--fw-bold);
  font-size: 20px;
  margin-bottom: var(--space-sm);
}

.contact-info__address {
  font-family: var(--font-playfair);
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

.contact-info__phone {
  font-family: var(--font-playfair);
  font-weight: var(--fw-bold);
  font-size: 18px;
  color: var(--color-white);
  text-decoration: none;
  display: inline-block;
  margin-bottom: var(--space-lg);
}

.contact-info__phone:hover {
  text-decoration: underline;
  color: var(--color-white);
}

.contact-info__hours {
  font-family: var(--font-playfair);
  font-size: 15px;
  line-height: 1.8;
}

.contact-info__hours-row {
  display: flex;
  gap: var(--space-md);
}

.contact-info__hours-day {
  min-width: 50px;
  display: inline-block;
}

.contact-form-wrapper {
  background-color: var(--color-white);
  color: var(--color-black);
  padding: var(--space-xl);
}

.contact-form-wrapper__title {
  font-family: var(--font-playfair);
  font-weight: var(--fw-bold);
  font-size: 18px;
  color: var(--color-black);
  margin-bottom: var(--space-md);
}

.contact-form__placeholder {
  padding: var(--space-2xl) var(--space-md);
  text-align: center;
  background-color: var(--color-gray-100);
  border: 2px dashed var(--color-gray-300);
  color: var(--color-gray-500);
  font-style: italic;
  font-size: 14px;
}

/* ====================================================================
   GOOGLE MAPS EMBED
   ==================================================================== */

.map-section {
  width: 100%;
}

.map-section iframe {
  display: block;
  width: 100%;
  height: 400px;
  border: 0;
}

/* ====================================================================
   FOOTER
   ==================================================================== */

.site-footer {
  background-color: var(--color-sky-blue);
  color: var(--color-white);
  padding: var(--space-2xl) 0 var(--space-xl);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  text-align: center;
}

@media (min-width: 768px) {
  .site-footer__inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.social-icons {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.social-icons__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--color-white);
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

.social-icons__link:hover {
  opacity: 0.75;
  color: var(--color-white);
  text-decoration: none;
}

.social-icons__link svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.footer-links {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links__link {
  color: var(--color-white);
  text-decoration: none;
  font-family: var(--font-playfair);
  font-size: 14px;
  transition: opacity var(--transition-fast);
}

.footer-links__link:hover {
  opacity: 0.75;
  color: var(--color-white);
  text-decoration: underline;
}

.footer-links__divider {
  color: var(--color-white);
  opacity: 0.6;
}

.site-footer__copyright {
  font-family: var(--font-playfair);
  font-size: 13px;
  text-align: center;
  margin-top: var(--space-md);
  opacity: 0.9;
}

/* ====================================================================
   RESPONSIVE: MOBILE NAVIGATION
   ==================================================================== */

@media (max-width: 1023px) {
  .mobile-menu-toggle {
    display: block;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 360px;
    height: 100vh;
    background-color: #0d0d0d;
    padding: 80px var(--space-xl) var(--space-xl);
    transition: right var(--transition-base);
    overflow-y: auto;
    z-index: 101;
  }

  .main-nav.is-open {
    right: 0;
  }

  .main-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .main-nav__item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .main-nav__link {
    padding: var(--space-md) 0;
    justify-content: space-between;
    width: 100%;
    font-size: 14px;
  }

  .dropdown {
    position: static;
    background-color: transparent;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base);
    padding: 0;
  }

  .main-nav__item.is-open > .dropdown {
    max-height: 1000px;
    padding-bottom: var(--space-sm);
  }

  .dropdown__link {
    padding-left: var(--space-md);
    font-size: 13px;
  }

  .sub-dropdown {
    position: static;
    background-color: transparent;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base);
    padding: 0;
    margin-left: 0;
    margin-top: 0;
    border-left: none;
    min-width: auto;
  }

  .dropdown__item--has-submenu.is-open > .sub-dropdown {
    max-height: 1000px;
    padding-left: var(--space-lg);
  }
}
