/* =========================================================
   HC Header – Olivia Foster Theme
========================================================= */

:root {
  --hc-adminbar-h: 0px;
  --hc-header-h: 123px;
  --hc-header-bg: var(--wp--custom--of--color--header, #f5f0e8e6);
  --hc-header-cream: var(--wp--custom--of--color--cream, #f5f0e8);
  --hc-header-ink: var(--wp--custom--of--color--ink, #1e2a38);
  --hc-header-gold: var(--wp--custom--of--color--gold, #b8914d);
  --hc-header-gold-hover: var(--wp--custom--of--color--gold-hover, #a07c3c);
  --hc-header-width: var(--wp--custom--of--layout--wide, 1200px);
  --hc-header-gutter: var(--wp--custom--of--layout--page-gutter, clamp(20px, 4vw, 56px));
}

body.admin-bar { --hc-adminbar-h: 32px; }
@media (max-width: 782px) {
  body.admin-bar { --hc-adminbar-h: 46px; }
}


body.home .wp-site-blocks > header.wp-block-template-part { height: 0; }

.hc-header :where(.is-layout-flow) > * { margin-block-start: 0 !important; }

.hc-header {
  position: fixed;
  top: var(--hc-adminbar-h);
  left: 0;
  right: 0;
  z-index: 100;
  transition: background-color .25s ease, box-shadow .25s ease, transform .35s cubic-bezier(.22, .61, .36, 1);
  width: 100%;
  margin-inline: 0;
  padding-inline: 0 !important;
  box-sizing: border-box;
}

.hc-header:not(.has-background) {
  background-color: var(--hc-header-bg);
}

.hc-header > .wp-block-group,
.hc-header__row {
  width: min(var(--hc-header-width), calc(100% - (var(--hc-header-gutter) * 2))) !important;
  max-width: none;
  margin-inline: auto;
}

.hc-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  width: 100%;
}

.hc-header__brand,
.hc-header__nav-wrap,
.hc-header .header-cta-row {
  margin: 0;
}

.hc-header__nav-wrap { min-width: 0; }

.hc-header .wp-block-group.alignwide { width: 100%; }
.hc-header .wp-block-site-logo { margin: 0; }

.hc-header .hc-header__logo {
  width: 146px;
  margin: 0;
  line-height: 0;
}
.hc-header .hc-header__logo img {
  width: 146px;
  height: auto;
}

.hc-header .of-main-navigation,
.hc-header .header-cta-row,
.hc-header .header-cta-row .wp-block-buttons,
.hc-header .header-cta-row .wp-block-button {
  margin: 0;
}

.hc-header .header-cta-row {
  display: flex;
  align-items: center;
}

.hc-header .of-main-navigation .wp-block-navigation__container { gap: 32px !important; }

.hc-header .of-main-navigation .wp-block-navigation-item__content {
  padding: 0 !important;
  font-size: 20px !important;
  font-weight: 400;
  line-height: 1.4;
}

/* Active / current menu item */
.hc-header .of-main-navigation .wp-block-navigation-item.current-menu-item .wp-block-navigation-item__content,
.hc-header .of-main-navigation .wp-block-navigation-item__content.hc-nav-current,
.hc-header .of-main-navigation .wp-block-navigation-item__content[aria-current="page"] {
  color: var(--wp--preset--color--custom-rose-beige) !important;
}

.hc-header .header-cta-btn .wp-block-button__link {
  min-height: 56px;
  min-width: 153px;
  padding: 0 32px !important;
  border: 0;
  border-radius: 999px;
  font-size: 14px !important;
  font-weight: 500;
  line-height: 1 !important;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: none;
}

.hc-header .header-cta-btn .wp-block-button__link:not(.has-background) {
  background: var(--hc-header-gold);
}
.hc-header .header-cta-btn .wp-block-button__link:not(.has-text-color) { color: #fff; }
.hc-header .header-cta-btn .wp-block-button__link:hover {
  background: var(--hc-header-gold-hover) !important;
  color: #fff !important;
}

/* Home: transparent until solid */
.home .hc-header:not(.hc-header--solid) { background: transparent !important; }

/* ---- State modifiers ---- */
.hc-header--solid { box-shadow: 0 0 15px 0 rgba(0,0,0,0.24); }
.hc-header--solid:not(.has-background) { background-color: var(--hc-header-bg); }
.hc-header--hidden { transform: translateY(calc(-100% - var(--hc-adminbar-h, 0px))); }

body.hc-has-fixed-header {
  scroll-padding-top: calc(var(--hc-adminbar-h) + var(--hc-header-h));
}
body.hc-menu-open .hc-header,
body.hc-menu-open .hc-header--hidden { transform: none !important; }

/* Navigation overlay stacking */
.wp-block-navigation__responsive-container,
.wp-block-navigation__responsive-dialog { z-index: 100000; }

/* Active/hover link */
.of-main-navigation .wp-block-navigation-item__content[aria-current="page"],
.of-main-navigation .current-menu-item > .wp-block-navigation-item__content,
.of-main-navigation .wp-block-navigation-item__content:hover {
  color: var(--hc-header-gold) !important;
}

.of-main-navigation .wp-block-navigation-item__content:focus { outline: none; box-shadow: none !important; }
.of-main-navigation .wp-block-navigation-item__content:focus-visible {
  outline: 2px solid var(--hc-header-gold);
  outline-offset: 3px;
  border-radius: 2px;
}
.of-main-navigation a { -webkit-tap-highlight-color: transparent; }

/* =========================================================
   Mobile
========================================================= */
/* ---- Mobile Book Now button in nav overlay ---- */
/* Hide on desktop */
.hc-header .of-main-navigation .wp-block-navigation__container .mobile-book-now {
  display: none;
}

@media (max-width: 767px) {
  /* Hide the desktop CTA button on mobile */
  .hc-header .header-cta-row {
    display: none !important;
  }

  /* Adjust overlay for admin bar */
  .admin-bar .wp-block-navigation__responsive-container.is-menu-open {
    top: var(--hc-adminbar-h, 46px) !important;
    min-height: calc(100vh - var(--hc-adminbar-h, 46px)) !important;
  }

  /* Show mobile Book Now at top of overlay */
  .wp-block-navigation__responsive-container.is-menu-open .mobile-book-now {
    display: block !important;
  }
  .wp-block-navigation__responsive-container.is-menu-open .mobile-book-now {
    width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
  }
  .wp-block-navigation__responsive-container.is-menu-open .mobile-book-now .wp-block-navigation-item__content {
    display: block !important;
    background: var(--hc-header-gold) !important;
    color: #fff !important;
    text-align: center !important;
    padding: 12px 20px !important;
    border-radius: 999px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    box-sizing: border-box !important;
    width: 100% !important;
    margin-bottom: 16px !important;
    line-height: 1 !important;
  }
  .wp-block-navigation__responsive-container.is-menu-open .mobile-book-now .wp-block-navigation-item__label {
    color: #fff !important;
  }
  .wp-block-navigation__responsive-container.is-menu-open .mobile-book-now .wp-block-navigation-item__content:hover {
    background: var(--hc-header-gold-hover) !important;
    color: #fff !important;
  }
}

@media (max-width: 767px) {
  .hc-header .hc-header__logo,
  .hc-header .hc-header__logo img {
    width: 136px !important;
  }

  .hc-header { width: 100%; }
  .hc-header > .wp-block-group,
  .hc-header__row { width: calc(100% - 36px) !important; }
  .hc-header__row { gap: 12px; }

  .is-menu-open { background-color: var(--hc-header-cream) !important; }
  .is-menu-open .wp-block-navigation__responsive-container-close svg {
    fill: var(--hc-header-ink) !important;
  }

  .of-main-navigation.wp-block-navigation,
  .of-main-navigation .wp-block-navigation,
  .items-justified-right.of-main-navigation.wp-block-navigation {
    --navigation-layout-justify: flex-start !important;
    --navigation-layout-justification-setting: flex-start !important;
  }

  .of-main-navigation .wp-block-navigation__container { justify-content: flex-start !important; }
  .of-main-navigation .wp-block-navigation__responsive-container .wp-block-navigation__container {
    justify-content: flex-start !important;
    align-items: flex-start !important;
    width: 100%;
  }

  .wp-block-navigation__responsive-container-close svg,
  .wp-block-navigation__responsive-container-open svg {
    width: 40px !important;
    height: 40px !important;
  }

  .wp-block-navigation__responsive-container-content
    .wp-block-navigation-item
    .wp-block-navigation-item__label {
    line-height: 56px !important;
    font-size: 22px !important;
    color: var(--hc-header-ink) !important;
  }
}

/* When sticky on mobile — snap to very top, remove admin bar offset */
@media (max-width: 782px) {
  body.admin-bar .hc-header--solid {
    top: 0 !important;
  }
  body.admin-bar .wp-block-navigation__responsive-container.is-menu-open {
    top: 0 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hc-header { transition: background-color .2s ease, box-shadow .2s ease; }
  .hc-header--hidden { transform: none; }
}

/* Submenu */
@media (min-width: 768px) {
  .wp-block-navigation__container > .wp-block-navigation-item { padding: 14px 0 !important; }
  .wp-block-navigation__container .wp-block-navigation__submenu-container {
    box-shadow: 0 10px 15px -3px rgba(0,0,0,.18), 0 4px 6px -2px rgba(0,0,0,.07);
    border-radius: 6px !important;
  }
  .wp-block-navigation__container .wp-block-navigation__submenu-container a {
    padding-top: 7px !important;
    padding-bottom: 7px !important;
    font-size: 1rem;
  }
}
