/* ==========================================================================
   Header Component — header.css
   BEM naming: .scc-header, .scc-header__[element], .scc-header--[modifier]
   ========================================================================== */

/* ---------- Base Header ---------- */
.scc-header {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 50;
  transition: all 0.25s ease;
  color: white;
  background: var(--scc-primary);
  height: 4rem;
  display: flex;
  align-items: center;
  top: 0;
  /* Contain any absolute-positioned child so it can't bleed past the
     viewport edge on narrow screens (hamburger toggle, mobile drawer). */
  overflow-x: clip;
  box-sizing: border-box;
}

.scc-header__container {
  box-sizing: border-box;
  max-width: 100%;
}

.scc-header--notification-open {
  top: 2.5rem;
}

@media (min-width: 577px) {
  .scc-header--notification-open {
    top: 2.75rem;
  }
}

.scc-header--scrolled {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

@media (min-width: 768px) {
  .scc-header {
    height: 120px;
  }
}

/* ---------- Header Container ---------- */
.scc-header__container {
  width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

@media (min-width: 768px) {
  .scc-header__container {
    padding-left: 1.5rem;
    padding-right: 2rem;
  }
}

@media (min-width: 1200px) {
  .scc-header__container {
    padding-right: calc(50vw - 640px + 2rem);
  }
}

/* ---------- Logo ---------- */
.scc-header__logo-link {
  flex-shrink: 0;
  cursor: pointer;
  flex: 1;
  min-width: 0;
  max-width: 70%;
  display: flex;
  align-items: center;
  margin-top: -0.5rem;
}

@media (min-width: 768px) {
  .scc-header__logo-link {
    flex: none;
    max-width: none;
    margin-top: 0;
  }
}

.scc-header__logo-mobile {
  display: block;
  height: 3rem;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

@media (max-width: 480px) {
  .scc-header__logo-mobile {
    height: 2.25rem;
  }
}

@media (min-width: 768px) {
  .scc-header__logo-mobile {
    display: none;
  }
}

.scc-header__logo-desktop {
  display: none;
}

@media (min-width: 768px) {
  .scc-header__logo-desktop {
    display: block;
    width: 560px;
    height: 80px;
    object-fit: contain;
    object-position: left;
  }
}

/* ---------- Desktop Navigation ---------- */
.scc-header__nav {
  display: none;
}

@media (min-width: 992px) {
  .scc-header__nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
  }
}

@media (min-width: 1200px) {
  .scc-header__nav {
    gap: 2rem;
  }
}

.scc-header__nav-list {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 1200px) {
  .scc-header__nav-list {
    gap: 2rem;
  }
}

/* ---------- Nav Item ---------- */
.scc-header__nav-item {
  position: relative;
}

.scc-header__nav-link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--scc-font-heading);
  font-weight: var(--scc-weight-medium);
  color: white;
  transition: color 0.2s;
  padding: 0.5rem 0;
  cursor: pointer;
  text-decoration: none;
}

.scc-header__nav-link:hover {
  color: white;
}

.scc-header__nav-link-chevron {
  height: 1rem;
  width: 1rem;
  opacity: 0.7;
  transition: transform 0.2s;
}

.scc-header__nav-item:hover .scc-header__nav-link-chevron {
  transform: rotate(180deg);
}

/* ---------- Dropdown ---------- */
.scc-header__dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(0.5rem);
  margin-top: 0.5rem;
  width: 16rem;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  border-top: 2px solid var(--scc-primary-light);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  z-index: 50;
}

.scc-header__nav-item:hover .scc-header__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.scc-header__dropdown-list {
  padding: 0.5rem;
  margin: 0;
  list-style: none;
}

.scc-header__dropdown-link {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  transition: background-color 0.2s;
  cursor: pointer;
  text-decoration: none;
}

.scc-header__dropdown-link:hover {
  background: var(--scc-muted);
}

.scc-header__dropdown-title {
  font-family: var(--scc-font-heading);
  font-weight: var(--scc-weight-medium);
  color: var(--scc-primary);
  font-size: var(--scc-text-sm);
}

.scc-header__dropdown-desc {
  font-family: var(--scc-font-sans);
  font-size: var(--scc-text-xs);
  color: rgba(74, 74, 74, 0.7);
  margin-top: 0.125rem;
}

/* ---------- CTA Button ---------- */
.scc-header__cta {
  background: var(--scc-accent);
  color: white;
  font-family: var(--scc-font-heading);
  font-weight: var(--scc-weight-medium);
  padding: 0.625rem 1.5rem;
  border-radius: 9999px;
  transition: all 0.2s;
  margin-left: 0.5rem;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
}

.scc-header__cta:hover {
  background: rgba(162, 92, 47, 0.9);
  transform: scale(1.05);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* ----------------------------------------------------------------------------
   WordPress nav markup bridge.
   wp_nav_menu() emits bare <a> and <ul class="sub-menu"> rather than BEM
   classes, so the rules below mirror the prototype styles onto the WP output
   for top-level links, dropdowns, and the CTA pill.
---------------------------------------------------------------------------- */

.scc-header__nav a {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--scc-font-heading);
  font-size: var(--scc-text-base);
  font-weight: var(--scc-weight-medium);
  color: white;
  text-decoration: none;
  padding: 0.5rem 0;
  cursor: pointer;
  transition: color 0.2s;
}

.scc-header__nav a:hover {
  color: white;
}

.scc-header__nav .menu-item-has-children {
  position: relative;
}

/* Chevron indicator on parent menu items. The prototype ships a static inline
   SVG inside each anchor; wp_nav_menu() doesn't, so the chevron is rendered
   as a background-image on an ::after pseudo-element instead. Rotates 180deg
   on hover to match prototype .scc-header__nav-link-chevron behavior. */
.scc-header__nav .menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  width: 1rem;
  height: 1rem;
  margin-left: 0.25rem;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.7;
  transition: transform 0.2s;
}

.scc-header__nav .menu-item-has-children:hover > a::after {
  transform: rotate(180deg);
}

.scc-header .sub-menu {
  margin: 0;
  padding: 0;
  list-style: none;
}

.scc-header__nav .sub-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(0.5rem);
  margin-top: 0.5rem;
  width: 16rem;
  background: white;
  border-radius: 0.5rem;
  border-top: 2px solid var(--scc-primary-light);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  padding: 0.5rem;
  z-index: 50;
}

.scc-header__nav .menu-item-has-children:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.scc-header__nav .sub-menu a {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 0.375rem;
  color: var(--scc-primary);
  font-family: var(--scc-font-heading);
  font-size: var(--scc-text-sm);
  font-weight: var(--scc-weight-medium);
  white-space: nowrap;
  transition: background-color 0.2s;
}

.scc-header__nav .sub-menu a:hover {
  background: var(--scc-muted);
}

/* The wp_nav_menu()-wrapped CTA needs explicit padding because the
   .scc-header__cta base rule is unset when the anchor renders inside
   an <li> without the BEM class on the <a>. Matches prototype values. */
a.scc-header__cta,
.scc-header__nav-list a.scc-header__cta {
  display: inline-flex;
  align-items: center;
  padding: 0.625rem 1.5rem;
  background: var(--scc-accent);
  color: white;
  font-family: var(--scc-font-heading);
  font-size: var(--scc-text-base);
  font-weight: var(--scc-weight-medium);
  letter-spacing: 0.02em;
  white-space: nowrap;
  border-radius: 9999px;
  text-decoration: none;
  transition: all 0.2s;
  margin-left: 0.5rem;
}

a.scc-header__cta:hover,
.scc-header__nav-list a.scc-header__cta:hover {
  background: rgba(162, 92, 47, 0.9);
  color: white;
  transform: scale(1.05);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* The CTA <li> sits inside the nav-list so the generic `a::after` would
   paint a chevron on it. Suppress. */
.scc-header__nav-list li:last-child > a.scc-header__cta::after {
  content: none;
}

@media (max-width: 991px) {
  .scc-header__nav .sub-menu {
    display: none;
  }
}

/* ---------- Mobile Toggle ---------- */
.scc-header__mobile-toggle {
  display: block;
  padding: 0.5rem;
  color: white;
  position: relative;
  z-index: 100;
  background: none;
  border: none;
  cursor: pointer;
}

@media (min-width: 992px) {
  .scc-header__mobile-toggle {
    display: none;
  }
}

.scc-header__mobile-toggle-icon {
  width: 1.5rem;
  height: 1.5rem;
}

/* ---------- Mobile Overlay ---------- */
.scc-mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  transition: opacity 0.3s;
  opacity: 0;
  pointer-events: none;
}

@media (min-width: 992px) {
  .scc-mobile-overlay {
    display: none;
  }
}

.scc-mobile-overlay--open {
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Mobile Panel ---------- */
.scc-mobile-panel {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  width: 100%;
  background: var(--scc-primary);
  z-index: 101;
  color: white;
  padding: 1.5rem;
  box-shadow: -10px 0 15px -3px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  transition: transform 0.3s ease-in-out;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
}

@media (min-width: 577px) {
  .scc-mobile-panel {
    width: 24rem;
  }
}

@media (min-width: 992px) {
  .scc-mobile-panel {
    display: none;
  }
}

.scc-mobile-panel--open {
  transform: translateX(0);
}

/* ---------- Mobile Header ---------- */
.scc-mobile-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.scc-mobile-panel__logo {
  height: 2.5rem;
  width: auto;
  object-fit: contain;
}

.scc-mobile-panel__close {
  padding: 0.5rem;
  color: rgba(255, 255, 255, 0.8);
  background: none;
  border: none;
  cursor: pointer;
}

.scc-mobile-panel__close:hover {
  color: var(--scc-secondary);
}

.scc-mobile-panel__close-icon {
  height: 1.5rem;
  width: 1.5rem;
}

/* ---------- Mobile Content ---------- */
.scc-mobile-panel__content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* ---------- Mobile Nav ---------- */
.scc-mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.scc-mobile-nav__list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.scc-mobile-nav__item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1rem;
}

.scc-mobile-nav__link {
  display: block;
  font-size: var(--scc-text-lg);
  font-weight: var(--scc-weight-medium);
  transition: color 0.2s;
  width: 100%;
  cursor: pointer;
  color: white;
  text-decoration: none;
}

.scc-mobile-nav__link:hover {
  color: var(--scc-secondary);
}

/* ---------- Mobile Accordion ---------- */
.scc-mobile-nav__accordion-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--scc-text-lg);
  font-weight: var(--scc-weight-medium);
  transition: color 0.2s;
  color: white;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.scc-mobile-nav__accordion-toggle:hover {
  color: var(--scc-secondary);
}

.scc-mobile-nav__accordion-chevron {
  height: 1.25rem;
  width: 1.25rem;
  transition: transform 0.2s;
}

.scc-mobile-nav__accordion-chevron--open {
  transform: rotate(180deg);
}

.scc-mobile-nav__accordion-content {
  overflow: hidden;
  transition: all 0.3s;
  max-height: 0;
}

.scc-mobile-nav__accordion-content--open {
  max-height: 16rem;
  margin-top: 0.75rem;
}

.scc-mobile-nav__subnav-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-left: 1rem;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  margin: 0;
  list-style: none;
}

.scc-mobile-nav__subnav-link {
  display: block;
  font-size: var(--scc-text-sm);
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.2s;
  padding: 0.25rem 0;
  cursor: pointer;
  text-decoration: none;
}

.scc-mobile-nav__subnav-link:hover {
  color: white;
}

/* ---------- Mobile CTA ---------- */
.scc-mobile-panel__cta {
  margin-top: 2rem;
}

.scc-mobile-panel__cta-button {
  display: block;
  width: 100%;
  background: var(--scc-accent);
  color: white;
  font-weight: var(--scc-weight-medium);
  font-size: var(--scc-text-lg);
  padding: 0.75rem 1rem;
  border-radius: 0.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  text-align: center;
  cursor: pointer;
  text-decoration: none;
}

/* ---------- Mobile Social ---------- */
.scc-mobile-panel__social {
  margin-top: auto;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.scc-mobile-panel__social-link {
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.2s, transform 0.2s;
  text-decoration: none;
}

.scc-mobile-panel__social-link:hover {
  color: white;
  transform: scale(1.1);
}

.scc-mobile-panel__social-icon {
  height: 1.75rem;
  width: 1.75rem;
}
