:root {
  /* brand palette (primary colors used across UI) */
  --gold: #CFB87C;
  --gold-600: #b59e66;
  --ink: #111111;   /* near-black for backgrounds */
  --ink-2: #1d1d1f; /* dark gray for body text */
  --charcoal: #333333;
  --stone: #6b7280; /* gray-500 (utility text) */
  --white: #ffffff;

  /* typography (global font family & rhythm) */
  --font-sans: 'Lato', 'Open Sans', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --font-size: 16px;  /* root font size (1rem) */
  --leading: 1.6;     /* comfortable line-height */

  /* layout (container width, side padding, radius, shadows) */
  --container: 1280px;        /* max width for centered content */
  --gutter: 1.25rem;          /* ≈20px side padding inside .container */
  --radius: 12px;             /* default rounded corners for cards, etc */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);   /* subtle default shadow */
  --shadow-md: 0 8px 24px rgba(0,0,0,.15);  /* lifted hover shadow */

  /* header heights (stacking bars at top of page)
     Order top→bottom: utility (white), header (black), primary (gray), accent (gold).
     If you change any heights, body padding (below) auto-updates because it uses these vars.
  */
  --utility-h: 10px;   /* thin white CU bar */
  --header-h: 72px;    /* black brand bar (logo/title) */
  --subnav-h: 44px;    /* optional sticky section bar (breadcrumbs, etc) */
  --primary-h: 52px;   /* gray nav height (main menu) */
  --gold-h: 6px;       /* thin gold bar (accent line; can be made taller if it holds content) */
}

/* 1) Reset & base -------------------------------------------------------
   - Minimal reset and base typography/colors.
   - The .container class centers content and applies side padding from --gutter.
*/
* { box-sizing: border-box; }
html { font-size: 100%; height: 100%; }
body {
  margin: 0;
  font: 400 var(--font-size)/var(--leading) var(--font-sans);
  color: var(--ink-2);
  background: var(--white);
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-600); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.hidden { display: none !important; }

/* 2) Utility Bar (top CU bar) -----------------------------------------
   - Fixed white strip at very top (often holds campus/parent links).
   - Stacks above content; height controlled by --utility-h.
*/
.utility-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--utility-h);
  background: var(--ink);
  color: var(--white);
  z-index: 1000;
  border-bottom: 1px solid #1a1a1a;
}
.utility-bar .container {
  height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.utility-left, .utility-right { display: flex; align-items: center; gap: 1rem; }
.utility-logo img { height: 18px; width: auto; }
.utility-link { font-size: .875rem; color: #d1d5db; }
.utility-link:hover { color: var(--gold); }

/* 3) Main Header (brand + primary nav) --------------------------------
   - Black brand/title bar (logo + site name).
   - Sits directly below utility bar using top: var(--utility-h).
   - The actual main menu lives in the separate gray .primary-nav below.
*/
.site-header {
  position: fixed; left: 0; right: 0;
  top: var(--utility-h); /* sits under utility bar */
  height: var(--header-h);
  background: var(--ink);
  color: var(--white);
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}
.site-header .container { height: 100%; display: flex; align-items: center; justify-content: flex-start; }

.brand { display: flex; align-items: center; gap: .75rem; }
.brand-logo { height: calc(var(--header-h) - 16px); width: auto; display: block; }


/* 3b) Gray Primary Nav (menu lives here)
   - Fixed gray bar containing the UL-based main navigation.
   - Positioned below the brand bar using calc of utility + header heights.
*/
.primary-nav {
  position: fixed;
  left: 0; right: 0;
  top: calc(var(--utility-h) + var(--header-h));
  height: var(--primary-h);
  background: #2f2f2f;            /* gray bar */
  color: var(--white);
  z-index: 960;
  border-top: 1px solid #000;
  border-bottom: 1px solid #1a1a1a;
}
.primary-nav .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;         
}

/* UL-based menu in the gray bar
   - Horizontal list on desktop; mobile behavior defined in the media query below.
*/
.primary-nav nav ul {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.primary-nav nav a {
  color: var(--white);
  font-weight: 700;
  padding: .35rem .25rem;
  border-bottom: 2px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.primary-nav nav a:hover,
.primary-nav nav a[aria-current="page"] {
  color: var(--gold);
  border-color: var(--gold);
}

/* Submenu/dropdown styles for multi-level navigation */
.primary-nav nav > ul > li {
  position: relative;
}

.primary-nav nav > ul > li > .submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #1f1f1f;
  min-width: 220px;
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
  box-shadow: var(--shadow-md);
  border-top: 2px solid var(--gold);
  z-index: 1000;
  flex-direction: column;  /* Force vertical layout */
  gap: 0;                  /* Remove the gap from parent ul */
}

.primary-nav nav > ul > li:hover > .submenu {
  display: flex;  /* Changed from block to flex for better control */
}

.primary-nav .submenu li {
  display: block;
  width: 100%;
}

.primary-nav .submenu a {
  display: block;
  padding: 0.75rem 1.25rem;
  white-space: nowrap;
  border-bottom: none !important;  /* Force override parent style */
  font-weight: 600;
}

.primary-nav .submenu a:hover {
  background: #2a2a2a;
  color: var(--gold);
  padding-left: 1.5rem;
  transition: padding-left 0.2s ease;
}

/* 3c) Thin gold accent bar under the gray nav
   - Decorative line (or can hold content if you increase --gold-h and add children).
*/
.accent-bar {
  position: fixed;
  left: 0; right: 0;
  top: calc(var(--utility-h) + var(--header-h) + var(--primary-h));
  height: var(--gold-h);
  background: var(--gold);
  z-index: 955;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.2);
}

/* Mobile menu for the gray bar
   - On small screens, the UL becomes a hidden vertical menu.
   - Toggling adds .is-open on .primary-nav to display the menu (handled by JS).
   - The dropdown is positioned using top: calc(...) so it always appears below the gold bar.
*/
.menu-toggle { display: none; }
@media (max-width: 980px) {
  .primary-nav .container { justify-content: space-between; }
  .menu-toggle { display: inline-flex; color: var(--white); font-size: 1.5rem; background: transparent; border: 0; cursor: pointer; }
  .primary-nav nav ul {
    display: none;
    position: absolute;
    left: 0; right: 0;
    top: calc(var(--utility-h) + var(--header-h) + var(--primary-h) + var(--gold-h));
    flex-direction: column;
    background: #1f1f1f;
    padding: .75rem var(--gutter);
    border-top: 1px solid #222;
  }
  
  /* Only show main menu when is-open class is added */
  .primary-nav.is-open nav ul { 
    display: flex; 
  }
  
  /* Mobile submenu fixes - only apply when parent menu is open */
  .primary-nav.is-open nav > ul > li > .submenu {
    position: static !important;
    display: flex !important;
    background: #2a2a2a;
    padding: 0.5rem 0 0.5rem 1.5rem;
    margin-top: 0.5rem;
    border-top: none;
    box-shadow: none;
    min-width: auto;
    flex-direction: column;
  }
  
  /* Override hover behavior in mobile */
  .primary-nav.is-open nav > ul > li:hover > .submenu {
    position: static !important;
  }
  
  .primary-nav.is-open .submenu a {
    padding: 0.5rem 1rem !important;
    white-space: normal !important;
  }
  
  .primary-nav.is-open .submenu a:hover {
    padding-left: 1rem !important;
  }
}
/* 3d) Nav fixes: no wrapping in the bar, styled search form, scrollable mobile menu */
.primary-nav nav > ul > li > a { white-space: nowrap; }
.primary-nav nav ul { align-items: center; gap: 1.25rem; }
.primary-nav .nav-search { display: flex; align-items: center; gap: .25rem; margin: 0 0 0 .5rem; }
.primary-nav .nav-search input { padding: 4px; border: 1px solid #ccc; width: 10rem; min-width: 0; }
.primary-nav .nav-search button { padding: 4px 8px; background: #333; color: #fff; border: 0; cursor: pointer; }

@media (max-width: 980px) {
  .primary-nav nav ul {
    top: calc(100% + var(--gold-h));   /* relative to the fixed nav bar, not the viewport */
    max-height: calc(100vh - var(--utility-h) - var(--header-h) - var(--primary-h) - var(--gold-h));
    max-height: calc(100dvh - var(--utility-h) - var(--header-h) - var(--primary-h) - var(--gold-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    align-items: stretch;
    gap: .5rem;
  }
  .primary-nav .nav-search { margin: .5rem 0 0; }
  .primary-nav .nav-search input { flex: 1; width: auto; }
}

/* 4) Optional Subnav / Breadcrumb bar ---------------------------------
   - Sticky bar for section nav or breadcrumbs.
   - If used, add 'has-subnav' to <body> so global padding accounts for it.
*/
.subnav {
  position: sticky; top: calc(var(--utility-h) + var(--header-h));
  height: var(--subnav-h);
  background: #1f2937; /* slightly lighter than header */
  color: #d1d5db;
  z-index: 900;
  border-bottom: 1px solid #111827;
}
.subnav .container { height: 100%; display: flex; align-items: center; gap: 1rem; }
.subnav a { color: #e5e7eb; font-size: .875rem; }
.subnav a:hover { color: var(--gold); }

/* 5) Page offset so content clears fixed bars --------------------------
   - Helper spacers (optional) + the global body padding that pushes content below the stacked bars.
   - If you change any header heights, you do NOT need to touch the calc—variables handle it.
*/
.main-offset { height: calc(var(--utility-h) + var(--header-h)); }
/* If subnav is present, add this additional spacer under the main offset */
.main-offset.has-subnav { height: calc(var(--utility-h) + var(--header-h) + var(--subnav-h)); }

body {
  padding-top: calc(var(--utility-h) + var(--header-h) + var(--primary-h) + var(--gold-h));
}
body.has-subnav {
  padding-top: calc(var(--utility-h) + var(--header-h) + var(--primary-h) + var(--gold-h) + var(--subnav-h));
}

/* 6) Hero (video or image) --------------------------------------------
   - Full-bleed media with gradient overlay and centered text block.
   - Use in home/landing pages.
*/
.hero {
  position: relative;
  background: #000;
  min-height: 48vh; /* roomy on desktop, shrinks on mobile */
  display: grid; place-items: end center;
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; }
.hero-media video, .hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.1) 0%, rgba(0,0,0,.55) 65%, rgba(0,0,0,.75) 100%); }
.hero-content {
  position: relative; z-index: 1; text-align: center; color: var(--white);
  padding: 3rem 1rem 4rem;
}
.hero h1 { margin: 0 0 .5rem; font-weight: 800; font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
.hero p { margin: 0 auto 1.25rem; max-width: 60ch; font-size: clamp(1rem, 2.2vw, 1.125rem); color: #e5e7eb; }
.btn {
  display: inline-block; padding: .85rem 1.25rem; border-radius: 999px; font-weight: 700; letter-spacing: .02em;
  background: var(--gold); color: #1A1406; border: 1px solid transparent; box-shadow: var(--shadow-sm);
}
.btn:hover { filter: brightness(.95); box-shadow: var(--shadow-md); }
.btn-outline { background: transparent; color: var(--white); border-color: rgba(255,255,255,.35); }
.btn-outline:hover { color: var(--gold); border-color: var(--gold); }

/* 7) Icon grid (home quick-links) -------------------------------------
   - Small tile grid for quick navigation on the homepage.
   - Responsive columns at common breakpoints.
*/
.icon-grid { padding: 2.5rem 0; background: var(--white); }
.icon-grid .grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
@media (min-width: 720px) { .icon-grid .grid { grid-template-columns: repeat(4, 1fr); gap: 1.25rem; } }
@media (min-width: 1100px) { .icon-grid .grid { grid-template-columns: repeat(6, 1fr); } }
.icon-tile {
  display: grid; place-items: center; text-align: center; padding: 1.25rem .75rem; border-radius: var(--radius);
  background: #0b0b0b; color: var(--white); transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.icon-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); background: #141414; }
.icon-tile .icon { width: 48px; height: 48px; margin-bottom: .5rem; }
.icon-tile .label { font-weight: 700; letter-spacing: .02em; }

/* 8) Sections & cards --------------------------------------------------
   - Generic section padding + base card component styles.
   - The page card gallery uses .card-grid below.
*/
.section { padding: 3rem 0; }
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.card:hover { box-shadow: var(--shadow-md); }
.card .body { padding: 1.25rem; }
.card .title { margin: 0 0 .5rem; font-weight: 700; }

/* Page card grid (used by page_card_block)
   - Responsive gallery that fills rows with min 250px cards.
   - Centered and capped at 1200px to avoid over-wide rows on large screens.
*/
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;

  justify-content: center;  /* center the grid items */
  max-width: 1200px;        /* optional: keeps them from stretching full page */
  margin: 0 auto;           /* centers the whole grid block */
}

/* 9) Footer ------------------------------------------------------------
   - Dark footer with lighter text and hover accents.
*/
.footer { background: #0a0a0a; color: #d1d5db; padding: 3rem 0; }
.footer a { color: #e5e7eb; }
.footer a:hover { color: var(--gold); }

/* 10) Utilities --------------------------------------------------------
   - Simple utility classes for quick text casing, spacing tweaks, etc.
*/
.upper { text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
.m-0 { margin: 0 !important; }
.mt-2 { margin-top: .5rem; } .mt-4 { margin-top: 1rem; } .mt-8 { margin-top: 2rem; }
.pb-0 { padding-bottom: 0 !important; }

/* 11) Responsive tweaks ------------------------------------------------
   - Minor header height adjustment and title size on small screens.
*/
@media (max-width: 640px) {
  :root { --header-h: 64px; }
  .brand-title { font-size: 1rem; font-weight: 700; }
}

/* 12) Dark-on-light page content area (if needed) ----------------------
   - Main content background + top border (sits under the stacked bars).
   - Content centering is handled by wrapping templates in <div class="container">.
*/
.main {
  background: var(--white);
  border-top: 1px solid #e5e7eb;
}

/* 13) Skip-link for accessibility -------------------------------------
   - Keyboard users can jump directly to content.
   - Appears when focused (e.g., via Tab key).
*/
.skip-link {
  position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus {
  left: 0; top: calc(var(--utility-h) + 8px); width: auto; height: auto; padding: .5rem .75rem; background: var(--gold); color: #111; z-index: 1100;
}
/* Documentation page cards */
.documentation-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e7eb;
}

.documentation-section h2 {
  margin-bottom: 1.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ink);
}

.doc-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.doc-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  background: var(--white);
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  text-decoration: none;
  color: var(--ink-2);
}

.doc-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
  border-color: var(--gold);
}

.doc-card-icon {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  border-radius: 8px;
  overflow: hidden;
}

.doc-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.75rem;
}

.doc-card-content {
  flex: 1;
}

.doc-card-content h3 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
}

.doc-card-content p {
  margin: 0;
  color: var(--stone);
  line-height: 1.5;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .doc-card {
    flex-direction: column;
    text-align: center;
  }

  .doc-card-icon {
    width: 80px;
    height: 80px;
  }
}
