/*
 * /assets/site.css: the shared look of every page (phase 2 of ARCHITECTURE.md).
 *
 * Holds the colors, base styles, the menu (desktop and phone) and the footer. A page's own
 * <style> block keeps only what is particular to that page, and each page's pasted copy of these
 * rules is deleted as it moves onto this file (phase 2b for the articles, issues and episodes).
 *
 * Link it in <head> BEFORE the page's own <style>, so a page can still adjust a shared rule (the
 * homepage's see-through menu bar does). The phone menu rules are written to win over the older
 * pasted copies regardless of order, so a page that has not been cleaned yet still gets them.
 *
 * Pages link it with a version number (site.css?v=N) because Cloudflare caches /assets/ for a
 * day: raise N on every change, on every page that links it (the content checks fail if two
 * pages disagree).
 */

/* ---- Colors (CLAUDE.md "Design tokens") ---- */
:root {
  --navy: #0d1b2a;
  --navy-mid: #162436;
  --navy-light: #1e3352;
  --gold: #c9a84c;
  --gold-light: #e2c47a;
  --gold-pale: #f5e9c8;
  --cream: #f7f3ec;
  --text-primary: #f0ece3;
  --text-muted: #8a9ab0;
  --text-dark: #1a2332;
  --border: rgba(201, 168, 76, 0.2);
  /* Readable versions for lighter backgrounds (phase 3d, WCAG AA 4.5:1 for small text):
     muted text on --navy-light panels, and gold and muted text on --cream sections. */
  --text-muted-raised: #97a6ba; /* 5.1:1 on --navy-light (--text-muted is 4.4:1 there) */
  --gold-on-light: #80651b;     /* 5.0:1 on --cream (--gold is 2.1:1 there) */
  --text-muted-light: #5a6577;  /* 5.3:1 on --cream */
}

/* ---- Base ---- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--navy);
  color: var(--text-primary);
  overflow-x: hidden;
  overflow-wrap: break-word; /* a long address in running text wraps instead of widening the page */
}
/* The faint grain over every page. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1000;
  opacity: 0.35;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---- Menu bar: <nav> with the logo and <ul id="nav-links">, which assets/site.js fills from
 * partials/nav-links.html. A page may add its own items to the list (coaching's Apply Now). ---- */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 24px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(13,27,42,0.97);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
}
.nav-logo img { height: 69px; width: auto; display: block; }
.nav-links { display: flex; align-items: center; gap: 36px; list-style: none; }
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--gold-light); }
.nav-speakr { color: var(--gold-light) !important; }
.nav-new-pill { display: inline-block; background: var(--gold); color: var(--navy); font-size: 9px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; padding: 2px 6px; border-radius: 3px; margin-left: 7px; vertical-align: 2px; }
.nav-cta {
  border: 1px solid var(--gold);
  color: var(--gold) !important;
  padding: 10px 24px;
  font-size: 12px !important;
  transition: all 0.2s !important;
}
.nav-cta:hover { background: var(--gold) !important; color: var(--navy) !important; }

/* Dropdowns (Services, Insights): open on hover and on keyboard focus. */
.nav-links li.has-dropdown { position: relative; padding-bottom: 24px; margin-bottom: -24px; }
.nav-links li.has-dropdown > a { display: inline-flex; align-items: center; cursor: pointer; }
.nav-links li.has-dropdown > a::after { content: ''; display: inline-block; width: 0; height: 0; margin-left: 7px; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 4px solid currentColor; opacity: 0.6; transition: transform 0.2s, opacity 0.2s; }
.nav-links li.has-dropdown:hover > a::after, .nav-links li.has-dropdown:focus-within > a::after { transform: rotate(180deg); opacity: 1; }
.nav-dropdown { position: absolute; top: 100%; left: -16px; min-width: 220px; list-style: none; margin: 0; padding: 8px 0; background: rgba(13,27,42,0.97); border: 1px solid var(--border); backdrop-filter: blur(8px); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity 0.2s, transform 0.2s, visibility 0.2s; box-shadow: 0 12px 32px rgba(0,0,0,0.35); }
.nav-links li.has-dropdown:hover > .nav-dropdown, .nav-links li.has-dropdown:focus-within > .nav-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-dropdown li { display: block; }
.nav-dropdown a { display: block !important; padding: 11px 20px !important; font-size: 12px !important; letter-spacing: 0.08em !important; white-space: nowrap; }
.nav-dropdown a:hover { color: var(--gold-light); background: rgba(201,168,76,0.06); }

/* ---- Phone menu: below 900px the links fold into a panel opened by the menu button, which
 * assets/site.js adds to the bar. Selectors start with "nav" so they outrank the older
 * ".nav-links { display: none }" copies still pasted into pages, wherever this file is linked. ---- */
.nav-toggle { display: none; }
@media (max-width: 900px) {
  nav { padding: 18px 24px; }
  .nav-links { display: none; }
  nav .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-right: -10px;
    padding: 0;
    background: transparent;
    border: 0;
    color: var(--text-primary);
    cursor: pointer;
  }
  nav .nav-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    transition: transform 0.2s, background 0.2s;
  }
  .nav-toggle-bars { position: relative; }
  .nav-toggle-bars::before, .nav-toggle-bars::after { content: ''; position: absolute; left: 0; }
  .nav-toggle-bars::before { top: -7px; }
  .nav-toggle-bars::after { top: 7px; }
  nav.nav-open .nav-toggle-bars { background: transparent; }
  nav.nav-open .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
  nav.nav-open .nav-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }

  nav.nav-open { background: rgba(13,27,42,0.97); }
  nav.nav-open .nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 105px);
    max-height: calc(100dvh - 105px);
    overflow-y: auto;
    padding: 4px 24px 24px;
    background: rgba(13,27,42,0.98);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 16px 32px rgba(0,0,0,0.35);
  }
  nav.nav-open .nav-links > li { border-bottom: 1px solid rgba(201,168,76,0.12); }
  nav.nav-open .nav-links > li:last-child { border-bottom: 0; }
  nav.nav-open .nav-links a { display: block; padding: 14px 0; font-size: 14px; }
  /* A dropdown's own label (Services, Insights) becomes a small heading over its links. */
  nav.nav-open .nav-links li.has-dropdown { padding-bottom: 8px; margin-bottom: 0; }
  nav.nav-open .nav-links li.has-dropdown > a { display: block; padding: 16px 0 4px; font-size: 11px; letter-spacing: 0.16em; color: var(--gold); cursor: default; }
  nav.nav-open .nav-links li.has-dropdown > a::after { display: none; }
  nav.nav-open .nav-dropdown {
    position: static;
    min-width: 0;
    padding: 0 0 0 16px;
    background: none;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }
  nav.nav-open .nav-dropdown a { padding: 10px 0 !important; font-size: 13px !important; white-space: normal; }
  nav.nav-open .nav-dropdown a:hover { background: none; }
  nav.nav-open .nav-links .nav-cta { display: inline-block; margin: 16px 0 4px; padding: 12px 24px; text-align: center; }
}

/* ---- Footer: partials/footer.html, injected by assets/site.js into <footer id="site-footer"> ----
 * Scoped to #site-footer so these rules win over any older footer styles still pasted into a page. */
#site-footer { background: #070e17; padding: 60px 48px 40px; font-family: 'DM Sans', sans-serif; }
#site-footer .footer-inner { max-width: 1100px; margin: 0 auto; }
#site-footer .footer-top { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 60px; padding-bottom: 48px; border-bottom: 1px solid rgba(201, 168, 76, 0.2); margin-bottom: 32px; }
#site-footer .footer-brand { font-family: 'Cormorant Garamond', serif; font-size: 24px; font-weight: 600; color: #f0ece3; margin-bottom: 16px; }
#site-footer .footer-brand span { color: #c9a84c; }
#site-footer .footer-desc { font-size: 14px; color: #8a9ab0; line-height: 1.7; max-width: 300px; }
#site-footer .footer-heading { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: #c9a84c; margin-bottom: 20px; }
#site-footer .footer-links { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; }
#site-footer .footer-links a { color: #8a9ab0; text-decoration: none; font-size: 14px; transition: color 0.2s; }
#site-footer .footer-links a:hover { color: #e2c47a; }
#site-footer .footer-bottom { display: flex; justify-content: space-between; align-items: center; }
#site-footer .footer-copy { font-size: 12px; color: #8a9ab0; }
#site-footer .footer-social { display: flex; gap: 20px; }
#site-footer .footer-social a { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: #8a9ab0; text-decoration: none; transition: color 0.2s; }
#site-footer .footer-social a:hover { color: #c9a84c; }
@media (max-width: 900px) {
  #site-footer { padding: 48px 24px 32px; }
  #site-footer .footer-top { grid-template-columns: 1fr; gap: 36px; }
  #site-footer .footer-bottom { flex-direction: column; gap: 16px; }
}
