/* ============================================
   Reusable Components
   Nav, Footer, Buttons, Cards, Placeholders
   ============================================ */

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-base);
  padding: 0.875rem 2rem;
  border-radius: var(--radius-full);
  transition: all var(--duration-normal) var(--ease-out);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.btn--primary {
  background: var(--color-gold);
  color: var(--color-navy-deep);
  box-shadow: var(--shadow-gold);
}

.btn--primary:hover {
  background: var(--color-gold-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(201, 168, 76, 0.4);
}

.btn--outline {
  background: transparent;
  color: var(--color-white);
  border: 2px solid rgba(255, 255, 255, 0.4);
}

.btn--outline:hover {
  border-color: var(--color-white);
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-2px);
}

.btn--outline-dark {
  background: transparent;
  color: var(--color-navy);
  border: 2px solid var(--color-navy);
}

.btn--outline-dark:hover {
  background: var(--color-navy);
  color: var(--color-white);
  transform: translateY(-2px);
}

.btn--small {
  font-size: var(--text-sm);
  padding: 0.625rem 1.5rem;
}

/* ---- LINK ARROW ---- */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--color-gold);
  transition: gap var(--duration-normal) var(--ease-out);
}

.link-arrow::after {
  content: '\2192';
  transition: transform var(--duration-normal) var(--ease-out);
}

.link-arrow:hover::after {
  transform: translateX(4px);
}

.link-arrow--white {
  color: var(--color-white);
}

/* ---- NAVIGATION ---- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: var(--z-sticky);
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  /* Subtle dark scrim so white logo + nav links stay legible over bright hero imagery.
     Fades to transparent at the bottom of the nav so it doesn't cut a hard line on the hero. */
  background: linear-gradient(180deg, rgba(15, 27, 51, 0.55) 0%, rgba(15, 27, 51, 0.25) 60%, rgba(15, 27, 51, 0) 100%);
  transition: all var(--duration-normal) var(--ease-out);
}

.nav--scrolled {
  background: var(--color-navy-deep);
  padding: 1rem 2rem;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

/* Text shadow reinforces nav text legibility against bright video frames where the scrim alone is borderline. */
.nav__link,
.nav__dropdown a,
.nav__mobile-overlay a {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.nav--scrolled .nav__link,
.nav--scrolled .nav__dropdown a {
  text-shadow: none;
}
.nav__logo img {
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}
.nav--scrolled .nav__logo img {
  filter: none;
}

.nav__logo {
  /* Never let the flex row squeeze the lockup: it was being compressed
     horizontally below 1600px, which distorted the mark. */
  flex: 0 0 auto;
}

.nav__logo img {
  /* Nav uses WBFFullLogoWhite-nav.webp: the same lockup with the empty canvas
     margin cropped off, so the artwork fills the height it is given instead of
     rendering at 75% of it. Heights below are the artwork itself. */
  height: 142px;
  width: auto;
  flex: 0 0 auto;
  transition: height var(--duration-normal) var(--ease-out);
}

.nav--scrolled .nav__logo img {
  height: 108px;
}

/* The cropped lockup is 2.31:1, so it grows wide quickly. Step it down as the
   link row gets tight, so the two never touch. */
@media (max-width: 1600px) {
  .nav__logo img { height: 124px; }
  .nav--scrolled .nav__logo img { height: 100px; }
}

@media (max-width: 1440px) {
  .nav__logo img { height: 112px; }
  .nav--scrolled .nav__logo img { height: 92px; }
}

@media (max-width: 1280px) {
  .nav__logo img { height: 104px; }
  .nav--scrolled .nav__logo img { height: 88px; }
}

/* Below 1024px the links collapse into the hamburger, so the logo has the
   bar to itself again until the phone steps below. */
@media (max-width: 1024px) {
  .nav__logo img { height: 120px; }
  .nav--scrolled .nav__logo img { height: 96px; }
}

/* Phones. The bar has to hold the lockup, the Español pill (on the 10 bilingual
   pages: 84px plus its inline .85rem margin) and the 26px hamburger. At the old
   98px the lockup was 227px wide and pushed the hamburger to x=420-446, off the
   edge of every phone. Sizes and spacing below are solved for a 360px screen:
   16 + 167 + 16 + 84 + 16 + 26 + 16 = 341, so 19px spare. Set 2026-09-04 on
   Tristan's call (72px lockup, pill stays in the bar). */
@media (max-width: 768px) {
  .nav__logo img { height: 88px; }
  .nav--scrolled .nav__logo img { height: 72px; }
}

@media (max-width: 480px) {
  .nav { padding: 0.75rem 1rem; gap: 1rem; }
  .nav--scrolled { padding: 0.6rem 1rem; }
  .nav__logo img { height: 72px; }
  .nav--scrolled .nav__logo img { height: 60px; }
  /* The pill's margin is an inline style on each bilingual page; the gap does its job here. */
  .nav__lang { margin-right: 0 !important; }
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav__item {
  position: relative;
}

.nav__link {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  /* Bumped up from var(--text-sm) – the small text was unreadable */
  font-size: var(--text-base);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast);
}

.nav__link:hover {
  color: var(--color-white);
  background: rgba(255, 255, 255, 0.08);
}

.nav__link .chevron {
  font-size: 0.6em;
  transition: transform var(--duration-fast);
}

.nav__item:hover .chevron {
  transform: rotate(180deg);
}

/* Dropdown */
.nav__dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 220px;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--duration-fast) var(--ease-out);
}

.nav__item:hover .nav__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav__dropdown a {
  display: block;
  padding: 0.7rem 1.1rem;
  /* Matched to new nav link size */
  font-size: var(--text-base);
  color: var(--color-text-primary);
  border-radius: var(--radius-md);
  transition: background var(--duration-fast);
}

.nav__dropdown a:hover {
  background: var(--color-off-white);
  color: var(--color-navy);
}

.nav__cta {
  margin-left: 0.75rem;
}

/* Hamburger (mobile) */
.nav__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: calc(var(--z-overlay) + 1);
}

.nav__hamburger span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--color-white);
  border-radius: 2px;
  transition: all var(--duration-normal) var(--ease-out);
}

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

.nav__hamburger.active span:nth-child(2) {
  opacity: 0;
}

.nav__hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile overlay */
.nav__mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--color-navy-deep);
  z-index: var(--z-overlay);
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
}

.nav__mobile-overlay.active {
  display: flex;
  opacity: 1;
}

/* Header row inside the mobile menu: WIF logo on the left, close X on the right */
.nav__mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  background: var(--color-navy-deep);
  z-index: 2;
}

.nav__mobile-logo img {
  height: 38px;
  width: auto;
  display: block;
}

.nav__mobile-close {
  background: transparent;
  border: 0;
  color: var(--color-white);
  padding: 0.5rem;
  margin-right: -0.5rem;
  cursor: pointer;
  line-height: 0;
  border-radius: var(--radius-full);
  transition: background var(--duration-fast);
}

.nav__mobile-close:hover,
.nav__mobile-close:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

/* Stack of links, scrollable, centred text */
.nav__mobile-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  padding: 1.75rem 1.25rem 2.5rem;
}

.nav__mobile-overlay a {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  color: var(--color-white);
  padding: 0.5rem 1rem;
  transition: color var(--duration-fast);
}

.nav__mobile-overlay a:hover {
  color: var(--color-gold);
}

@media (max-width: 1024px) {
  .nav__links,
  .nav__cta {
    display: none;
  }

  .nav__hamburger {
    display: flex;
  }
}

/* ---- FOOTER ---- */
.footer {
  background: var(--color-navy-deep);
  color: var(--color-text-on-dark);
  padding: var(--space-xl) var(--space-md) var(--space-md);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: var(--space-lg);
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer__brand img {
  height: 120px;
  margin-bottom: var(--space-sm);
}

.footer__tagline {
  font-size: var(--text-sm);
  color: rgba(247, 246, 242, 0.6);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-md);
  max-width: 280px;
}

.footer__social {
  display: flex;
  gap: var(--space-sm);
}

.footer__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(247, 246, 242, 0.7);
  font-size: var(--text-sm);
  transition: all var(--duration-fast);
}

.footer__social a:hover {
  background: var(--color-gold);
  color: var(--color-navy-deep);
}

.footer__col h4 {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-white);
  margin-bottom: var(--space-sm);
}

.footer__col a {
  display: block;
  font-size: var(--text-sm);
  color: rgba(247, 246, 242, 0.6);
  padding: 0.3rem 0;
  transition: color var(--duration-fast);
}

.footer__col a:hover {
  color: var(--color-gold);
}

.footer__bottom {
  max-width: var(--max-width);
  margin: var(--space-lg) auto 0;
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer__disclaimer {
  font-size: var(--text-xs);
  color: rgba(247, 246, 242, 0.35);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-sm);
  max-width: 800px;
}

.footer__legal {
  font-size: var(--text-xs);
  color: rgba(247, 246, 242, 0.35);
  margin-bottom: 0.5rem;
}

.footer__legal a {
  color: rgba(247, 246, 242, 0.45);
  text-decoration: none;
  transition: color 0.3s;
}

.footer__legal a:hover {
  color: var(--color-gold);
}

.footer__copyright {
  font-size: var(--text-xs);
  color: rgba(247, 246, 242, 0.35);
}

@media (max-width: 768px) {
  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
  }

  .footer__brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .footer__grid {
    grid-template-columns: 1fr;
  }
}

/* ---- CARDS ---- */
.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-md);
  transition: all var(--duration-normal) var(--ease-out);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
}

.card--glass {
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-text-on-dark);
}

.card--glass:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ---- IMAGE PLACEHOLDER ---- */
.img-placeholder {
  background: var(--color-grey-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-grey-mid);
  font-size: var(--text-sm);
  font-family: var(--font-accent);
  border: 1px dashed var(--color-grey-mid);
  border-radius: var(--radius-md);
  text-align: center;
  padding: var(--space-sm);
  line-height: var(--leading-normal);
}


/* ---- Mobile-only hero scrim overrides (this-chat scope: not applied at desktop widths) ---- */
@media (max-width: 768px) {
  /* What is CFT + For Athletes heroes: existing inline scrim is too gentle over bright hero images on
     phones. Force the stronger Option-C gradient (start at 20%, reach 92% navy) so headline + sub stay
     legible regardless of what part of the image is behind them. !important is required because the
     base scrim is inline-styled on each page. */
  .page-hero-scrim {
    background: linear-gradient(180deg, rgba(15,27,51,0) 20%, rgba(15,27,51,0.92) 100%) !important;
  }
}


/* ---- Mobile content-pages: targeted full-bleed fix per Tristan 2026-05-16 cont.10 ----
   v16's "> section" selector accidentally targeted page-hero too, breaking the hero layout
   (absolute children no longer filled their parent). Reverted to section.section only (which
   matches <section class="section section--light"> but NOT <section class="page-hero">),
   kept the width:100% + box-sizing + container reset bits that should actually fix the
   right-side whitespace. ---- */
@media (max-width: 767px) {
  /* Body-level overflow guard so any rogue child doesn't trigger horizontal scroll */
  .lh-page, .wp-page, .blog-page, .safety-page {
    overflow-x: hidden;
  }

  /* Content sections ONLY (NOT page-hero): minimal padding, full width, border-box */
  .lh-page section.section,
  .wp-page section.section,
  .blog-page section.section,
  .safety-page section.section {
    padding-left: var(--space-sm) !important;
    padding-right: var(--space-sm) !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Container wrappers inside content sections: no padding, full width */
  .lh-page section.section .container,
  .wp-page section.section .container,
  .blog-page section.section .container,
  .safety-page section.section .container,
  .lh-page section.section .container--narrow,
  .wp-page section.section .container--narrow,
  .blog-page section.section .container--narrow,
  .safety-page section.section .container--narrow {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Known grid / list wrappers on the four pages: full width */
  .lh-page .categories-grid,
  .lh-page .learn-grid,
  .wp-page .wp-grid,
  .blog-page .blog-grid,
  .safety-page .risk-grid {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
  }

  /* Cards: tighter internal padding, full width */
  .lh-page .category-card,
  .wp-page .wp-card,
  .blog-page .blog-card,
  .safety-page .risk-card {
    padding: var(--space-md) !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}


/* ---- Safety GMP Manufacturing: inline 2-col grid wasn't collapsing on mobile because the
   safety.css rule targeted .gmp-layout (a class never present in the HTML). Force the inline
   .gmp-grid to single column on mobile so the text and image stack vertically. ---- */
@media (max-width: 767px) {
  .gmp-grid {
    grid-template-columns: 1fr !important;
    gap: var(--space-md) !important;
  }
}
