/**
 * Header Styles - Exact match to ccolor.com
 */

.site-header {
  background: rgb(20, 20, 20); /* ADO 6826: fully opaque by Ken's choice; live's 0.96 lets a faint ghost of page text through */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
  /* ADO 5426 (L7): the bar is one height on every page, whatever sits in it (a taller quiz button, a page's own header rules). 62px is what
     base.css reserves under it on phones (body padding-top), so the first section starts exactly at the bar's bottom; 64px from 768px up. */
  height: 62px;
}

@media (min-width: 768px) { /* tablet breakpoint - min */
  .site-header {
    height: 64px;
  }
}

.header-container {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.site-logo {
  flex-shrink: 0;
}

.site-logo img {
  height: 32px;
  width: auto;
  display: block;
}

/* Navigation */
.main-nav {
  display: none;
  flex: 1;
  margin-left: 40px;
}

@media (min-width: 992px) {
  .main-nav {
    display: flex;
  }
}

.main-nav > ul {
  list-style: none;
  display: flex;
  gap: 30px;
  align-items: center;
  margin: 0;
  padding: 0;
}

.main-nav > ul > li {
  position: relative;
}

.main-nav a {
  color: #ffffff;
  text-decoration: none;
  font-size: 17px;
  font-weight: 400;
  transition: color 0.3s;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a:active,
.main-nav a:focus {
  color: #788ABE;
}

.main-nav .active {
  color: #788ABE;
}

/* Dropdown Menu Styles */
.has-dropdown {
  position: relative;
}

.has-dropdown > a::after {
  content: '';
  display: inline-block;
  width: 10px;
  height: 6px;
  margin-left: 8px;
  background-image: url('../images/chevron-down.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.3s;
  vertical-align: middle;
}

.main-nav .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: rgb(20, 20, 20); /* ADO 6875: the open dropdown is solid like the bar (ADO 6826), Ken's choice */
  min-width: 220px;
  padding: 0;
  margin-top: 0;
  list-style: none;
  display: block;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  z-index: 1000;
  pointer-events: none;
}

.main-nav .has-dropdown:hover .dropdown-menu,
.main-nav .has-dropdown.is-open .dropdown-menu {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

.main-nav .dropdown-menu li {
  padding: 0;
  border-bottom: 1px solid #8B8B8B;
}

.main-nav .dropdown-menu li:last-child {
  border-bottom: none;
}

.main-nav .dropdown-menu a {
  display: block;
  padding: 10px 20px;
  color: #ffffff;
  font-size: 17px;
  transition: color 0.3s ease;
}

.main-nav .dropdown-menu a:hover,
.main-nav .dropdown-menu a:active,
.main-nav .dropdown-menu a:focus,
.main-nav .dropdown-menu a.active {
  color: #788ABE;
}

/* CTA Button */
.header-cta {
  flex-shrink: 0;
  margin-left: auto;
  margin-right: 15px;
  display: block;
}

@media (min-width: 992px) {
  .header-cta {
    margin-left: 20px;
    margin-right: 0;
  }
}

/* Header-specific CTA button sizing */
.header-cta .cta-btn {
  padding: calc(6px + var(--cta-trim-pad, 0px)) 12px; /* ADO 5994, Ken: "quiz button padding still uneven visually" (trim add-back) */
  font-size: 11px;
  border-radius: 4px;
}

@media (min-width: 992px) {
  .header-cta .cta-btn {
    padding: calc(8px + var(--cta-trim-pad, 0px)) 16px; /* ADO 5994, Ken: "quiz button padding still uneven visually" (trim add-back) */
    font-size: 13px;
  }
}

/*
 * The phone bar (ADO 5562, Ken's three notes on the phone header; this replaces the layout fix of ADO 5359, which hid the quiz button under 576px).
 * - Wordmark: "on mobile can you make this about 15% smaller? The quiz button is really close to it on mobile". Under 768px it is 85% of its size from 768px up:
 *   27.2px high instead of 32px, and 85% of 170.2px wide because the width follows the picture. The picture file is untouched.
 * - The quiz button STAYS in the bar at every phone width. The bar has to hold the wordmark, 12px of air, the quiz button and the 44px menu button, so
 *   on phones the bar's side padding is 12px (was 20px), the quiz button has no right margin and 6px 8px of padding (the menu button's three lines sit
 *   9.5px inside its 44px box, so the air to the button stays), and the button may wrap its words onto two or more lines (same words; 11px on most pages, 12px on Spectrum 1-4 where page-spectrum.css sets it) when the
 *   screen is narrow. The wordmark keeps at least 12px (margin-right) between itself and the quiz button.
 */
@media (max-width: 767px) { /* mobile breakpoint */
  .site-logo img {
    height: 27.2px;
  }

  .header-container {
    padding: 0 12px;
  }

  .site-logo {
    margin-right: 12px;
  }

  .header-cta {
    min-width: 0;
    flex-shrink: 1;
    margin-right: 0;
  }

  .header-cta .cta-btn {
    padding: 6px 8px;
    line-height: 1.2;
  }

  /* ADO 5621 (Ken, 2026-10-24: "can you please adjust the button padding so it is equal on all 4 sides visually?"). The font's own spare room above the capitals and
     below the baseline (its ascent and descent) made the space round the words uneven, and it differs from font to font. Trim the line box to the capitals and the
     baseline, then give top and bottom the same 8px as the sides: the space above the capitals is border + 8px and below the baseline border + 8px, whatever the font.
     Where the browser has no text-box-trim (Chrome before 133, Safari before 18.2) the 6px 8px above stays, as today. */
  @supports (text-box: trim-both cap alphabetic) {
    .header-cta .cta-btn {
      text-box: trim-both cap alphabetic;
      padding-top: 8px;
      padding-bottom: 8px;
    }
  }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  gap: 4px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

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

@media (max-width: 991px) { /* tablet breakpoint */
  .mobile-menu-toggle {
    display: flex;
  }
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background-color: #ffffff;
  display: block;
  transition: all 0.3s;
}

.mobile-menu-toggle.is-active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

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

.mobile-menu-toggle.is-active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Menu */
.mobile-nav {
  display: none;
  background: rgb(20, 20, 20); /* ADO 6875: the open phone menu is solid like the bar (ADO 6826), Ken's choice */
  position: fixed;
  top: 62px;
  left: 0;
  right: 0;
  max-height: calc(100vh - 62px);
  overflow-y: auto;
  scroll-padding-bottom: 4px; /* ADO 6564: keyboard focus scrolls this list in whole pixels; 4 px keeps a link it brings up from below clear of the bottom edge, so its whole ring shows */
  z-index: 999;
}

@media (min-width: 768px) and (max-width: 991px) { /* tablet breakpoint; ADO 7260: the bar is taller from this width (top of this file), so the open menu starts under it */
  .mobile-nav {
    top: 64px;
    max-height: calc(100vh - 64px);
  }
}

@media (min-width: 992px) {
  .mobile-nav {
    top: 65px;
    max-height: calc(100vh - 65px);
  }
}

.mobile-nav.is-open {
  display: block;
}

.mobile-nav > ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-nav > ul > li {
  border-bottom: 1px solid #8B8B8B;
}

.mobile-nav > ul > li:last-child {
  border-bottom: none;
}

.mobile-nav a {
  color: #ffffff;
  text-decoration: none;
  font-size: 20px;
  display: block;
  padding: 15px 20px;
  transition: color 0.3s;
}

.mobile-nav a:hover,
.mobile-nav a:active,
.mobile-nav a:focus {
  color: #788ABE;
}

.mobile-nav .active {
  color: #788ABE;
}

/*
 * Mobile menu accordions (ADO 5401, Ken: "these should be expanding accordions").
 * About C Color and C Color Spectrums are real buttons (aria-expanded, aria-controls); Shop is a plain link (ADO 5409). Each opens and closes its own list in place
 * and pushes the rows below it down; they are independent. The state is the aria-expanded attribute alone: the lists read it, so the
 * picture cannot disagree with what a screen reader is told. A closed list is hidden (visibility, after the slide) so Tab skips its
 * links. Every rule is scoped to .mobile-nav: the desktop menu and footer do not move.
 */
@media (max-width: 991px) { /* tablet breakpoint */
  /* Hide desktop nav dropdowns completely on mobile */
  .main-nav .dropdown-menu {
    display: none !important;
  }

  .mobile-nav .has-dropdown {
    width: 100%;
  }

  /* The parent row: a button dressed like the link rows (font, size, colour, padding), with room on the right for the chevron */
  .mobile-nav .mobile-accordion-toggle {
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
    padding: 15px 50px 15px 20px;
    border: 0;
    border-radius: 0;
    background: none;
    -webkit-appearance: none;
    appearance: none;
    color: #ffffff;
    font: inherit;
    font-size: 20px;
    text-align: left;
    text-transform: none;
    cursor: pointer;
    transition: color 0.3s;
  }

  .mobile-nav .mobile-accordion-toggle:hover,
  .mobile-nav .mobile-accordion-toggle:active,
  .mobile-nav .mobile-accordion-toggle.active {
    color: #788ABE;
  }

  /* ADO 5415: links get the buttons' inset ring (base.css draws it outside the box, where the menu's overflow clips it). */
  .mobile-nav .mobile-accordion-toggle:focus-visible,
  .mobile-nav a:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: -2px;
  }

  /* The chevron is drawn with borders (no picture file): a box that turns 180 degrees, holding a bordered corner that points down. */
  .mobile-nav .accordion-chevron {
    position: absolute;
    right: 20px;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    transition: transform 0.6s ease;
  }

  .mobile-nav .accordion-chevron::before {
    content: '';
    position: absolute;
    left: 2px;
    top: -2px;
    box-sizing: border-box;
    width: 11px;
    height: 11px;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    transform: rotate(45deg);
  }

  .mobile-nav .mobile-accordion-toggle[aria-expanded="true"] .accordion-chevron {
    transform: rotate(180deg);
  }

  /* The list: closed = no height, hidden after the slide; open = as tall as its rows. site-nav.js sets --sub-h (the rows' height) on opening
     so the slide takes 0.4 s whatever the row count. site-main.css gives .dropdown-menu a float, a border, a white background and an offset:
     all reset here. */
  .mobile-nav .dropdown-menu {
    display: block;
    position: static;
    float: none;
    z-index: auto;
    min-width: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
    list-style: none;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.4s ease, visibility 0s linear 0.4s;
  }

  .mobile-nav .mobile-accordion-toggle[aria-expanded="true"] + .dropdown-menu {
    max-height: var(--sub-h, 600px);
    visibility: visible;
    transition: max-height 0.4s ease, visibility 0s;
  }

  .mobile-nav .dropdown-menu li {
    border-bottom: 1px solid #8B8B8B;
  }

  .mobile-nav .dropdown-menu li:last-child {
    border-bottom: none;
  }

  .mobile-nav .dropdown-menu a {
    font-size: 20px;
    padding: 15px 20px 15px 40px;
    color: #ffffff;
    display: block;
    width: 100%;
  }
}

/* Under prefers-reduced-motion nothing slides or turns. The open list has its own transition rule (more specific), so it is named here too. */
@media (prefers-reduced-motion: reduce) {
  .mobile-nav .dropdown-menu,
  .mobile-nav .mobile-accordion-toggle[aria-expanded="true"] + .dropdown-menu,
  .mobile-nav .accordion-chevron {
    transition: none;
  }
}

/*
 * Mask behind the open phone menu (ADO 5562, Ken: "an 80% opacity black mask over the entire page when the menu is open so you just barely see the
 * items below. Add some blurring to the mask as well"). A fixed box over the whole screen, below the bar (1000), the menu (999) and the menu button
 * (1001), above the page. site-nav.js adds is-open while the menu is open and removes it on the X, Escape, a tap on the mask and a resize to desktop.
 * 80% black is rgba(0, 0, 0, 0.8); the blur is 6px (inside the 4-8px asked for), with the -webkit- form for Safari.
 */
.mobile-nav-mask {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 998;
}

.mobile-nav-mask.is-open {
  display: block;
}

/* sections.css still holds old WordPress rules that give every <header> z-index: 7 !important up to 991px, which would put the bar UNDER the mask (998) and
   the open menu (999). The bar must stay sharp above the mask, so it keeps its own 1000 there too (a class beats the bare element selector). */
@media (max-width: 991px) { /* tablet breakpoint */
  .site-header {
    z-index: 1000 !important;
  }
}
