/*
 * global.css — The Capacity Institute
 * Shared design system: tokens, reset, nav, buttons, footer, utilities
 * Page-specific styles remain inline in each .php file
 */

/* =============================================
   DESIGN TOKENS
============================================= */
:root {
  --navy-950: #080f1e;
  --navy-900: #0d1b2e;
  --navy-800: #122240;
  --navy-700: #1a3055;
  --navy-600: #1e3a5f;
  --navy-500: #274d7a;
  --navy-400: #3a6496;

  --gold-500: #c9a14a;
  --gold-400: #d4ad5a;
  --gold-300: #e0c27a;
  --gold-200: #ecdfa8;
  --gold-100: #f8f2de;

  --white:    #ffffff;
  --grey-50:  #f9fafb;
  --grey-100: #f3f4f6;
  --grey-200: #e5e7eb;
  --grey-300: #d1d5db;
  --grey-400: #9ca3af;
  --grey-600: #4b5563;
  --grey-700: #374151;
  --grey-800: #1f2937;

  --font-serif: 'EB Garamond', Georgia, serif;
  --font-sans:  'Inter', system-ui, -apple-system, sans-serif;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.18);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.28);

  --transition: 0.22s ease;
  --max-width: 1200px;
}

/* =============================================
   RESET & BASE
============================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--white);
  color: var(--grey-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  display: block;
  max-width: 100%;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* =============================================
   LAYOUT
============================================= */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* =============================================
   TYPOGRAPHY UTILITIES
============================================= */
.serif {
  font-family: var(--font-serif);
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-500);
}

.gold-rule {
  display: block;
  width: 48px;
  height: 2px;
  background: var(--gold-500);
  margin: 16px 0;
}

.gold-rule--center {
  margin-left: auto;
  margin-right: auto;
}

/* =============================================
   SECTION UTILITIES
============================================= */
.section {
  padding: 96px 0;
}

.section--dark   { background: var(--navy-900); }
.section--grey   { background: var(--grey-50); }
.section--deeper { background: var(--navy-950); }

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 500;
  line-height: 1.22;
  color: var(--navy-900);
}

.section-title--light { color: var(--white); }

.body-lg {
  font-size: 17px;
  line-height: 1.78;
  color: var(--grey-600);
  margin-top: 16px;
}

.body-lg--light { color: rgba(255,255,255,.62); }

/* =============================================
   BUTTONS
============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), transform var(--transition);
  border: 1.5px solid transparent;
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-gold {
  background: var(--gold-500);
  color: var(--navy-950);
  border-color: var(--gold-500);
}
.btn-gold:hover { background: var(--gold-300); border-color: var(--gold-300); }

.btn-outline-gold {
  background: transparent;
  color: var(--gold-400);
  border-color: var(--gold-500);
}
.btn-outline-gold:hover { background: rgba(201,161,74,.12); }

.btn-outline-white {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,.45);
}
.btn-outline-white:hover { background: rgba(255,255,255,.08); border-color: var(--white); }

.btn-navy {
  background: var(--navy-600);
  color: var(--white);
  border-color: var(--navy-600);
}
.btn-navy:hover { background: var(--navy-700); }

.btn-ghost {
  background: transparent;
  color: var(--navy-600);
  border-color: var(--grey-200);
}
.btn-ghost:hover { background: var(--grey-50); border-color: var(--gold-500); color: var(--navy-900); }

.btn-arrow::after {
  content: '→';
  font-size: 14px;
  transition: transform var(--transition);
}
.btn-arrow:hover::after { transform: translateX(3px); }

/* =============================================
   NAVIGATION
============================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--navy-950);
  box-shadow: 0 1px 0 rgba(201,161,74,.15);
  transition: background var(--transition), box-shadow var(--transition);
}

.nav.scrolled {
  box-shadow: 0 1px 0 rgba(201,161,74,.25), 0 2px 12px rgba(0,0,0,.3);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 88px;
  gap: 32px;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}

.nav-logo-img {
  display: block;
  width: 160px;
  height: 40px;
  object-fit: cover;       /* crop rather than squish */
  object-position: top left; /* show the top of the image */
}

/* Desktop: show horizontal wordmark, hide icon */
.nav-logo-horizontal { display: block; }
.nav-logo-icon       { display: none; }


/* Links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

/* Individual nav item wrapper */
.nav-item {
  position: relative;
  list-style: none;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: rgba(255,255,255,.78);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--gold-400);
  background: rgba(255,255,255,.05);
}

/* Chevron icon inside link */
.nav-chevron {
  width: 9px;
  height: 6px;
  stroke: currentColor;
  transition: transform var(--transition);
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item.has-dropdown:hover .nav-chevron,
.nav-item.has-dropdown:focus-within .nav-chevron {
  transform: rotate(180deg);
}

/* ── Dropdown panel ─────────────────────────── */
.dropdown {
  position: absolute;
  top: 100%;           /* flush against the nav-item — no gap to cross */
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  padding-top: 10px;   /* invisible bridge + visual breathing room */
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 200;
}

/* The visible panel sits inside a wrapper so padding-top acts as the bridge */
.dropdown-inner {
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.08);
  overflow: hidden;
}

/* Small arrow pointing up */
.dropdown::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 6px;
  background: var(--white);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  filter: drop-shadow(0 -1px 0 var(--grey-200));
  z-index: 1;
}

.nav-item.has-dropdown:hover .dropdown,
.nav-item.has-dropdown:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.dropdown-col {
  display: flex;
  flex-direction: column;
  min-width: 200px;
  padding: 8px 0;
}

.dropdown-heading {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-500);
  padding: 8px 18px 6px;
}

.dropdown-link {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--grey-700);
  padding: 8px 18px;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.dropdown-link:hover {
  background: var(--grey-50);
  color: var(--navy-900);
}

/* CTA */
.nav-cta { flex-shrink: 0; }

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all var(--transition);
}

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 88px; left: 0; right: 0;
  background: var(--navy-950);
  border-top: 1px solid rgba(201,161,74,.2);
  z-index: 99;
  padding: 16px 24px 32px;
  flex-direction: column;
  gap: 0;
  max-height: calc(100vh - 88px);
  overflow-y: auto;
}

.mobile-menu.open { display: flex; }

/* Flat nav links (NCIx, Contact, Partner) */
.mobile-nav-link {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,.75);
  padding: 13px 8px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: color var(--transition);
  text-decoration: none;
  display: block;
}

.mobile-nav-link:hover  { color: var(--gold-400); }
.mobile-nav-link.active { color: var(--gold-400); }

/* ── Mobile accordion groups ────────────────── */
.mobile-group {
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.mobile-group-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  cursor: pointer;
  padding: 13px 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,.75);
  text-align: left;
  transition: color var(--transition);
}

.mobile-group-toggle svg {
  width: 10px;
  height: 7px;
  stroke: currentColor;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.mobile-group-toggle:hover,
.mobile-group-toggle.active { color: var(--gold-400); }

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

.mobile-group-links {
  display: none;
  flex-direction: column;
  padding: 4px 0 12px 16px;
  gap: 2px;
}

.mobile-group-links.open { display: flex; }

.mobile-sub-link {
  font-size: 13px;
  font-weight: 400;
  color: rgba(255,255,255,.55);
  padding: 8px 8px;
  text-decoration: none;
  transition: color var(--transition);
  display: block;
}

.mobile-sub-link:hover { color: var(--gold-400); }

/* =============================================
   FOOTER
============================================= */
.footer {
  background: var(--navy-950);
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 64px 0 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 56px;
}

.footer-brand p {
  font-size: 13.5px;
  line-height: 1.75;
  color: rgba(255,255,255,.45);
  margin-top: 16px;
  max-width: 280px;
}

.footer-tagline {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-500);
  margin-top: 8px;
  display: block;
}

.footer-col-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  margin-bottom: 20px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-link {
  font-size: 13px;
  color: rgba(255,255,255,.5);
  transition: color var(--transition);
  text-decoration: none;
}

.footer-link:hover { color: var(--gold-400); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.07);
  padding-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-copy {
  font-size: 12px;
  color: rgba(255,255,255,.3);
}

/* =============================================
   RESPONSIVE — NAV & FOOTER
============================================= */
@media (max-width: 900px) {
  .nav-links  { display: none; }
  .nav-cta    { display: none; }
  .nav-hamburger { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }

  /* Swap to square icon on mobile */
  .nav-logo-horizontal { display: none; }
  .nav-logo-icon       { display: block; height: 32px; }
}

@media (max-width: 600px) {
  .section { padding: 64px 0; }
  .footer-grid   { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}