/* =====================================================================
   UNB College — shared polish layer (assets/unb-polish.css)
   One spacing rhythm, one type scale and one nav treatment across
   unb.college, matching the Alpha School standard while keeping UNB's
   own navy + gold identity, Playfair Display headings and page content.
   Loaded LAST in <head> on every page so these rules win ties.
   Does not touch behaviour, data, analytics, the chatbot, the map
   data, or any api/_data file. Colours below are UNB's own tokens.
   ===================================================================== */

/* ---------- 1. Type scale (Alpha: h1 2.5rem/2rem, h2 1.35rem/1.2rem,
   h3 1.05rem, body 1rem/1.6, meta 0.85rem, buttons 0.95rem/600) ---------- */
body{font-size:1rem;line-height:1.6}
body h1{font-size:clamp(2rem,4.5vw,2.5rem)!important;line-height:1.15!important}
body h2{font-size:1.35rem!important;line-height:1.3!important;margin:.5rem 0!important}
body h3{font-size:1.05rem!important;line-height:1.35!important}
@media (max-width:640px){
  body h1{font-size:2rem!important}
  body h2{font-size:1.2rem!important}
}

/* ---------- 2. Spacing rhythm (section gap 1.25rem, page bottom 1.75rem) ----------
   Was: .section 90-100px, page headers 100px, join-cta bottom 120px,
   footers 48px. Now one tight rhythm everywhere. */
body .section{padding:3rem 3rem}
body>section.page-header{padding:4rem 3rem 3rem}
body .join-cta{padding-bottom:3rem}
body .articles-section{padding:3rem 3rem}
body .featured-article{margin-bottom:2rem;padding-bottom:2rem;gap:1.5rem}
body .cta-banner{padding:2rem 1.5rem}
body .cta-banner p{margin-bottom:1rem}
body .wrap{padding:2.5rem 6vw 3rem}
body .page-wrap{padding:2rem 6% 3rem}
body .step-header{margin-bottom:1.75rem}
body footer,body .footer{margin-top:1.75rem!important;padding:1.75rem 1.25rem 1.25rem}
@media (max-width:900px){
  body .section,body .articles-section{padding:2rem 1.25rem}
  body>section.page-header{padding:3rem 1.25rem 2rem}
}

/* Home hero: was min-height:100vh (~900px tall). Content-height now. */
body .hero{min-height:auto}
body .hero-content{gap:2.5rem}
body .hero-title{margin-bottom:1rem}
body .hero-eyebrow{margin-bottom:1rem}
body .hero-desc{margin-bottom:1.5rem;font-size:1rem;line-height:1.6}
body .hero-stats{margin-top:1.75rem;padding-top:1.25rem}
body .hero-announcement{flex-wrap:wrap}

/* ---------- 3. Cards: padding 1rem, grid gap 1rem, sized to content ----------
   Was: card padding 28-56px, grid gaps 20-40px, views .card-excerpt
   stretched with flex:1 (equal heights with voids). */
body .programs-grid,body .competitions-grid,body .about-grid,body .board-grid,
body .articles-grid,body .pillar-grid,body .comp-grid,body .checklist-grid,
body .events-grid{gap:1rem}
body .about-grid,body .board-grid{margin-top:1.25rem}
body .platform-card,body .pillar-card,body .program-card,body .comp-card,
body .board-card,body .article-card,body .checklist-card,body .join-card,
body .event-tile-body{padding:1rem}
body .board-card-top{margin-bottom:1rem;padding-bottom:1rem}
body .card-excerpt{flex:none}

/* ---------- 4. NAV — one treatment on every page ----------
   Dark navy bar (the treatment 7 of 9 nav pages already used), gold
   hover/active, one set of sizes. This also fixes the home nav CTA,
   which was dark-green bg with dark text (unreadable). */
body nav{position:sticky;top:0;z-index:100;display:flex;align-items:center;gap:12px;
  height:68px!important;min-height:68px;padding:0 clamp(12px,2vw,32px)!important;
  background:rgba(10,22,40,.95)!important;backdrop-filter:blur(16px);
  border-bottom:1px solid rgba(201,168,76,.25)}
body nav .nav-brand-title{white-space:nowrap}
body nav .nav-brand-title{color:#f5f0e8!important}
body nav .nav-brand-sub{color:rgba(245,240,232,.55)!important}
body nav .nav-logo-box{border-color:#c9a84c!important;color:#c9a84c!important}
body nav .nav-links{display:flex;align-items:center;gap:clamp(8px,.8vw,16px);list-style:none;margin:0 auto;padding:0}
body nav .nav-links a{font-size:.78rem!important;font-weight:500;letter-spacing:.08em;text-transform:uppercase;color:rgba(245,240,232,.65)!important;text-decoration:none;padding:.3rem .4rem!important;border-radius:8px;line-height:1.4;white-space:nowrap}
body nav .nav-links a:hover,body nav .nav-links a.active{color:#c9a84c!important}
body nav .nav-links a:focus-visible{outline:2px solid #c9a84c;outline-offset:2px}
body nav .nav-cta{display:flex;align-items:center;gap:10px;flex-shrink:0}
body nav .btn-ghost{font-size:.78rem!important;font-weight:600;letter-spacing:.08em;text-transform:uppercase;padding:9px 20px!important;border:1px solid rgba(245,240,232,.25);border-radius:6px;color:#f5f0e8!important;background:transparent;text-decoration:none;line-height:1.2;white-space:nowrap}
body nav .btn-ghost:hover{border-color:#c9a84c;color:#c9a84c}
body nav .btn-gold{font-family:'Bebas Neue',sans-serif;font-size:.95rem!important;font-weight:400;letter-spacing:.1em;padding:9px 16px!important;border-radius:6px;background:#c9a84c!important;color:#0a1628!important;text-decoration:none;line-height:1.2;white-space:nowrap}
body nav .btn-gold:hover{background:#e8c96a;transform:translateY(-1px);box-shadow:0 6px 20px rgba(201,168,76,.3)}
body nav .btn-gold:focus-visible,body nav .btn-ghost:focus-visible{outline:2px solid #c9a84c;outline-offset:2px}
body nav #navSignOut{font-size:.72rem!important;font-weight:600;letter-spacing:.08em;text-transform:uppercase;padding:8px 12px!important;border:1px solid rgba(245,240,232,.25);border-radius:6px;color:#f5f0e8!important;background:transparent;text-decoration:none;line-height:1.2;white-space:nowrap}
body nav #navSignOut:hover{border-color:#c9a84c;color:#c9a84c}
body nav #navPersonaBadge{font-size:.7rem!important;padding:5px 10px!important;line-height:1.2}
body nav .nav-free{background:#c9a84c;color:#0a1628}
body nav .search-trigger{display:flex;align-items:center;justify-content:center;width:40px!important;height:40px!important;border-radius:8px;border:1px solid rgba(245,240,232,.25);background:transparent;color:rgba(245,240,232,.75);cursor:pointer;flex-shrink:0;margin-left:auto}
body nav .search-trigger:hover{border-color:#c9a84c;color:#c9a84c}
body nav .search-trigger:focus-visible{outline:2px solid #c9a84c;outline-offset:2px}
body nav .search-trigger svg{width:16px;height:16px}

/* Mobile menu toggle: one 40px button everywhere (Alpha .nav-toggle metrics). */
body .nav-burger{display:none;flex-direction:column;justify-content:center;gap:4px;width:40px!important;height:40px!important;padding:0 10px!important;border:1px solid rgba(245,240,232,.3);border-radius:8px;background:transparent;cursor:pointer;flex-shrink:0}
body .nav-burger span{display:block;height:2px;background:#f5f0e8;border-radius:2px;transition:transform .2s,opacity .2s}
body .nav-burger:hover{border-color:#c9a84c}
body .nav-burger:focus-visible{outline:2px solid #c9a84c;outline-offset:2px}
body .nav-burger[aria-expanded="true"] span:nth-child(1){transform:translateY(6px) rotate(45deg)}
body .nav-burger[aria-expanded="true"] span:nth-child(2){opacity:0}
body .nav-burger[aria-expanded="true"] span:nth-child(3){transform:translateY(-6px) rotate(-45deg)}

/* One switch point: burger menu at 1024px and below on every page. */
@media (max-width:1024px){
  body .nav-burger{display:flex}
  body nav .nav-links{display:none!important}
  body nav .nav-links.open{display:flex!important;position:absolute;top:100%;left:0;right:0;flex-direction:column;align-items:stretch;gap:0;margin:0;padding:6px clamp(20px,3vw,48px) 14px;background:rgba(10,22,40,.98);border-bottom:1px solid rgba(201,168,76,.25)}
  body nav .nav-links.open li{list-style:none}
  body nav .nav-links.open a{display:block;padding:14px 2px;border-bottom:1px solid rgba(201,168,76,.25);font-size:.78rem}
  body nav .nav-links.open li:last-child a{border-bottom:none}
  body nav .nav-links.open .nav-extra{display:block}
  body nav .nav-cta .btn-ghost,body nav #navPersonaBadge,body nav #navSignOut{display:none!important}
  body nav .btn-gold{padding:8px 14px!important;font-size:.82rem!important}
  body nav .nav-brand-sub{display:none}
}
@media (max-width:640px){
  body nav{padding:0 10px!important;gap:6px}
  body nav .nav-brand{flex-shrink:1;min-width:0}
  body nav .nav-brand-title{font-size:.9rem;overflow:hidden;text-overflow:ellipsis}
  body nav .search-trigger{display:none}
  body nav .btn-gold{padding:8px 10px!important;font-size:.78rem!important}
  /* Worksheet topbar: was 383px wide at 375px (back-link + brand). */
  body .topbar:has(.back-link){padding:12px 16px}
  body .topbar:has(.back-link) .back-link{padding:.35rem .5rem;font-size:.8rem}
}

/* ---------- 5. Slim headers (strategy-session, college-map, worksheet, privacy) ---------- */
body>header{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:56px;padding:12px clamp(20px,3vw,48px)}
body>header .brand{font-family:'Playfair Display',serif;font-weight:700;font-size:1.05rem;color:inherit;text-decoration:none;white-space:nowrap}
body>header .brand em{font-style:normal;color:var(--accent,#3d5a45)}
body>header a.back{font-size:.85rem;font-weight:600;color:var(--accent,#3d5a45);text-decoration:none;padding:.4rem .7rem;border-radius:8px;white-space:nowrap}
body>header a.back:hover{background:var(--surface,#f4f1ea)}
body>header a.back:focus-visible{outline:2px solid var(--accent,#3d5a45);outline-offset:2px}
body nav .nav-back{font-size:.85rem!important;font-weight:600;color:rgba(245,240,232,.75)!important;text-decoration:none;padding:.4rem .7rem!important;border-radius:8px;display:flex;align-items:center;gap:6px}
body nav .nav-back:hover{color:#c9a84c!important}
body nav .nav-back:focus-visible{outline:2px solid #c9a84c;outline-offset:2px}
body .topbar .back-link,body .topbar .topbar-back{font-size:.85rem;font-weight:600;text-decoration:none;padding:.4rem .7rem;border-radius:8px;white-space:nowrap}
body .topbar .back-link:hover,body .topbar .topbar-back:hover{color:#c9a84c}
body .topbar .back-link:focus-visible,body .topbar .topbar-back:focus-visible{outline:2px solid #c9a84c;outline-offset:2px}
body .topbar .brand{white-space:nowrap}

/* Disability guide: keep the app chrome, just stop the topbar pills
   overflowing on small screens (was 470px wide at a 375px viewport). */
@media (max-width:640px){
  body .topbar:has(.topbar-right){flex-wrap:wrap;height:auto;min-height:60px;padding:8px 16px;row-gap:8px}
  body .topbar:has(.topbar-right) .topbar-right{margin-left:0}
}
body .sidebar .nav-item{font-size:.85rem}
body .sidebar .nav-item:focus-visible{outline:2px solid var(--gold,#c9a84c);outline-offset:-2px}

/* ---------- 6. Focus states everywhere ---------- */
body a:focus-visible,body button:focus-visible{outline:2px solid var(--accent,#3d5a45);outline-offset:2px}
