/* ==========================================================================
   CHOUSE - Chrome Layer Styles (Header, Navigation, Footer)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Top Project Bar (.project-bar)
   -------------------------------------------------------------------------- */
.project-bar {
  background-color: var(--color-navy-950, #071522);
  color: #8A96A3;
  height: 34px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 101;
}

.project-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.project-bar-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.project-bar-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #F28C28;
  display: inline-block;
  flex-shrink: 0;
}

.project-bar-note {
  color: #9BA7B3;
  white-space: nowrap;
}

.project-bar-tags {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.project-bar-tag {
  color: #7E8C9A;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.project-bar-tag::before {
  content: "•";
  display: inline-block;
  margin-right: 8px;
  opacity: 0.4;
}

.project-bar-tags li:first-child .project-bar-tag::before {
  display: none;
}

@media (max-width: 1040px) {
  .project-bar {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   2. Site Header & Navigation (.site-header / .site-nav)
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 24px rgba(7, 21, 34, 0.05);
  border: none !important;
}

.site-nav {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: none !important;
}

/* 2.1 Brand / Logo */
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  border: none !important;
  color: inherit;
  flex-shrink: 0;
}

.brand-symbol {
  width: 28px;
  height: 28px;
  background-color: #0B1F33;
  position: relative;
  border-radius: 2px;
  flex-shrink: 0;
}

.brand-dot {
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 6px;
  height: 6px;
  background-color: #F28C28;
  border-radius: 1px;
}

.brand-text-group {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
}

.brand-name {
  font-size: 19px;
  font-weight: 800;
  color: #0B1F33;
  letter-spacing: 0.08em;
  font-family: var(--font-sans);
}

.brand-meta {
  font-size: 9.5px;
  font-weight: 600;
  color: #8A96A3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* 2.2 Navigation Menu */
.nav-menu {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 100%;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  height: 100%;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
  font-size: 13.5px;
  font-weight: 650;
  color: #52616C;
  text-decoration: none;
  transition: color 180ms ease;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.is-active {
  color: #0B1F33;
}

/* Navigation Line Animation (§5.5) — underline sits below the label */
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  /* Anchored to the label's vertical centre, so the rule stays just under the
     text whatever height the surrounding header gives the link. */
  top: calc(50% + 13px);
  width: 100%;
  height: 2px;
  background: #F28C28;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 280ms cubic-bezier(.2, .75, .25, 1);
}

.nav-link:hover::after,
.nav-link.is-active::after {
  transform: scaleX(1);
}

/* 2.3 Navigation CTA Button */
.nav-actions {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 22px;
  background-color: #F28C28;
  color: #FFFFFF !important;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-radius: 6px;
  border: none !important;
  outline: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 180ms ease, transform 180ms ease;
}

.nav-cta:hover {
  background-color: #E27E1A;
  transform: translateY(-1px);
}

.nav-cta:active {
  transform: translateY(0);
}

/* 2.4 Mobile Header */
@media (max-width: 1040px) {
  .site-header {
    height: 68px;
  }

  .site-nav {
    height: 68px;
  }

  .nav-menu {
    display: none;
  }

  .brand-meta {
    display: none;
  }

  .nav-cta {
    height: 42px;
    padding: 0 16px;
    font-size: 12.5px;
  }
}

/* 2.5 Compact desktop header (1041–1200px)
   Seven navigation items plus the CTA need the room: the brand tagline steps
   aside and the menu tightens before the header reaches its mobile form. */
@media (max-width: 1200px) and (min-width: 1041px) {
  .brand-meta {
    display: none;
  }

  .nav-menu {
    gap: 20px;
  }

  .nav-link {
    font-size: 13px;
  }
}

/* --------------------------------------------------------------------------
   3. Site Footer (.site-footer)
   -------------------------------------------------------------------------- */
.site-footer {
  background-color: var(--color-navy-950, #071522);
  color: #8A96A3;
  padding-top: 80px;
  padding-bottom: 40px;
  margin-top: auto;
  border: none !important;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 64px;
}

/* 3.1 Brand column */
.footer-brand-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 380px;
}

.footer-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  width: fit-content;
}

.footer-brand-symbol {
  width: 32px;
  height: 32px;
  background-color: #12314D;
  position: relative;
  border-radius: 3px;
  flex-shrink: 0;
}

.footer-brand-dot {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 7px;
  height: 7px;
  background-color: #F28C28;
  border-radius: 1px;
}

.footer-brand-title {
  font-size: 20px;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: 0.08em;
}

.footer-desc {
  font-size: 13.5px;
  line-height: 1.65;
  color: #8A96A3;
  margin: 0;
}

/* 3.2 Navigation columns */
.footer-nav-col {
  display: flex;
  flex-direction: column;
}

.footer-heading {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #FFFFFF;
  margin-bottom: 20px;
}

.footer-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-nav-link {
  font-size: 13.5px;
  color: #8A96A3;
  text-decoration: none;
  transition: color 160ms ease;
  display: inline-block;
}

.footer-nav-link:hover {
  color: #FFFFFF;
}

/* 3.3 Bottom bar */
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  padding-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: 12px;
  color: #6E7C8B;
}

.footer-copyright {
  margin: 0;
}

.footer-sub {
  margin: 0;
  text-align: right;
  letter-spacing: 0.02em;
}

/* 3.4 Responsive adjustments for Footer */
@media (max-width: 1040px) {
  .footer-top {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
  }

  .footer-brand-col {
    max-width: 100%;
    grid-column: 1 / -1;
  }
}

@media (max-width: 680px) {
  .site-footer {
    padding-top: 60px;
    padding-bottom: 36px;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-bottom: 44px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .footer-sub {
    text-align: left;
  }
}

/* ==========================================================================
   2.6 Library dropdown (shared by the header menu and the library pages)
   Rendered by components/audience-dropdown.php. It lives here rather than in
   books.css because the header uses the same component on every page.
   ========================================================================== */
.audience-menu {
  position: relative;
}

.audience-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  color: var(--color-navy-900);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s var(--ease-brand), background-color 0.2s var(--ease-brand);
}

.audience-menu__trigger:hover,
.audience-menu__trigger[aria-expanded="true"] {
  border-color: var(--color-navy-900);
  background: var(--color-canvas);
}

.audience-menu__caret {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.audience-menu__panel {
  min-width: 244px;
  padding: 8px;
  background: var(--color-white);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.audience-menu__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 2px;
}

.audience-menu__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-graphite);
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
  transition: background-color 0.2s var(--ease-brand), color 0.2s var(--ease-brand);
}

.audience-menu__item:hover {
  background: var(--color-surface);
  color: var(--color-navy-900);
}

.audience-menu__item.is-active {
  background: var(--color-blue-100);
  color: var(--color-navy-900);
  font-weight: 600;
}

.audience-menu__count {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-muted);
}

.audience-menu__foot {
  margin: 8px 0 0;
  padding: 10px 12px 4px;
  border-top: 1px solid var(--color-line);
}

.audience-menu__all {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-blue-600);
  text-decoration: none;
}

.audience-menu__all:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Library super menu (header): the panel lists every taxonomy attached to the
   book post type and its terms. It opens on hover and on focus-within, which is
   plain CSS so the library navigation also works without JavaScript; the caret
   button toggles it through assets/js/library-mega.js and owns aria-expanded. */
.library-mega {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 40;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-6px);
  background: var(--color-white);
  border-top: 1px solid var(--color-line);
  box-shadow: 0 26px 48px rgba(7, 21, 34, 0.13);
  transition: opacity 180ms var(--ease-brand), transform 180ms var(--ease-brand), visibility 180ms var(--ease-brand);
}

.nav-item--library:hover .library-mega,
.nav-item--library:focus-within .library-mega,
.nav-item--library.is-open .library-mega {
  visibility: visible;
  opacity: 1;
  transform: none;
}

.library-mega__inner {
  padding: 40px 0 32px;
}

.library-mega__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px 40px;
}

.library-mega__title {
  margin: 0 0 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.library-mega__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
}

.library-mega__link {
  font-size: 14px;
  line-height: 1.4;
  color: var(--color-graphite);
  text-decoration: none;
  transition: color 180ms ease;
}

.library-mega__link:hover,
.library-mega__link.is-active {
  color: var(--color-navy-900);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.library-mega__all {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--color-line);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--color-navy-900);
  text-decoration: none;
}

.library-mega__all:hover {
  color: var(--color-orange-500);
}

.library-mega__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 100%;
  padding: 0;
  border: none;
  background: none;
  color: #52616C;
  cursor: pointer;
  transition: color 180ms ease;
}

.library-mega__toggle:hover,
.library-mega__toggle[aria-expanded="true"] {
  color: #0B1F33;
}

.library-mega__chevron {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 180ms var(--ease-brand);
}

.nav-item--library:hover .library-mega__chevron,
.nav-item--library.is-open .library-mega__chevron {
  transform: translateY(2px) rotate(225deg);
}

@media (max-width: 1200px) and (min-width: 1041px) {
  .library-mega__inner {
    padding: 32px 0 26px;
  }

  .library-mega__grid {
    gap: 24px 28px;
  }
}

@media (max-width: 680px) {
  .audience-menu__panel {
    min-width: 0;
  }
}
/* ==========================================================================
   2.7 Mega Menu Media Additions (YouTube Modal & File Download)
   ========================================================================== */
.library-mega__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.library-mega__action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-family: var(--font-mono);
  text-decoration: none;
  line-height: 1;
  border: 1px solid var(--color-line);
  background: var(--color-surface);
  color: var(--color-steel);
  cursor: pointer;
  transition: all 180ms ease;
  flex-shrink: 0;
}

.library-mega__action-btn:hover {
  background: var(--color-navy-900);
  color: #fff;
  border-color: var(--color-navy-900);
}

.library-mega__action-btn--video:hover {
  background: #E52D27;
  border-color: #E52D27;
  color: #fff;
}

.library-mega__action-btn--pdf:hover {
  background: var(--color-blue-600);
  border-color: var(--color-blue-600);
  color: #fff;
}

.library-mega__action-icon {
  display: inline-block;
  width: 12px;
  height: 12px;
  fill: currentColor;
}

/* Video Modal */
.mega-video-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(7, 21, 34, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 240ms ease, visibility 240ms ease;
}

.mega-video-modal.is-active {
  opacity: 1;
  visibility: visible;
}

.mega-video-modal__box {
  position: relative;
  width: 100%;
  max-width: 860px;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.mega-video-modal__ratio {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
}

.mega-video-modal__ratio iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.mega-video-modal__close {
  position: absolute;
  top: -42px;
  right: 0;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  transition: opacity 180ms ease;
}

.mega-video-modal__close:hover {
  opacity: 0.8;
}

/* 3.4 Footer Legal Links */
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom-right {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
}

.footer-legal-link {
  color: #8A96A3;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-legal-link:hover {
  color: #fff;
}

.footer-legal-sep {
  color: var(--color-orange-500);
}
