/* ═══════════════════════════════════════════════════════
   NSLA — Shared Styles
   Reset, fonts, variables, nav, footer
   ═══════════════════════════════════════════════════════ */

/* ─── GOOGLE FONTS (must be first — @import only works before other rules) ─── */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..900;1,9..144,300..900&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap');

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

/* ─── CUSTOM PROPERTIES ───────────────────────────────── */
:root {
  --cream:    #F6F5F0;
  --orange:   #F15A22;
  --lavender: #C4ADCC;
  --yellow:   #E2DE8D;
  --dark:     #3D4152;
  --sand:     #EDDBB0;
  --grey:     #6D6E6B;
  --ink:      #4D4D4F;
  --teal:     #8FADA8;

  /* ─── FONT FAMILIES ─── */
  --font-sans:  'Source Sans 3', sans-serif;
  --font-serif: 'Fraunces', Georgia, serif;

  /* ─── TYPE SCALE (font shorthand: weight size/line-height family) ─── */
  --text-h1:      400 clamp(1.65rem, 3.6vw, 2.9rem)/1.18 var(--font-serif);
  --text-h2:      600 clamp(1.5rem, 2.8vw, 1.8rem)/1.05 var(--font-sans);
  --text-h3:      600 1.2rem/1.25 var(--font-sans);
  --text-body:    400 1rem/1.5 var(--font-sans);
  --text-body-sm: 400 0.85rem/1.5 var(--font-sans);
  --text-eyebrow: 700 0.68rem/1.2 var(--font-sans);
  --text-cta:     600 0.88rem/1 var(--font-sans);

  --ned-blue:     #3E76B4;
  --ned-sky:      #98CBEE;
  --ned-midnight: #0E3252;
  --violet:       #564c7c;
  --section-anchor-offset: 4.5rem;
  /* Fluid horizontal shell padding — scales continuously with the viewport
     (equals 4rem at ≥1280px, shrinking smoothly to 1.25rem on small screens)
     so text and the hero globe never "jump" at breakpoints. */
  --shell-h-pad: clamp(1.25rem, 5vw, 4rem);
}

/* ─── TYPOGRAPHY UTILITY CLASSES ──────────────────────── */
/* Apply a token with one class. Layout (margin, max-width) stays on the
   component. Colour/transform defaults below can be overridden per use. */
.text-h1      { font: var(--text-h1);      letter-spacing: -0.02em; }
.text-h2      { font: var(--text-h2);      letter-spacing: -0.02em;
                color: var(--grey); text-transform: uppercase;
                margin-bottom: 1.5rem; }
.text-h3      { font: var(--text-h3);      letter-spacing: -0.01em;
                color: var(--dark); }
.text-body    { font: var(--text-body);    color: var(--ink); }
.text-body-sm { font: var(--text-body-sm); color: var(--ink); }
.lead, .page-body .lead {
                font: 600 1rem/1.5 var(--font-sans); color: var(--ink);
                margin-bottom: 1rem; }
/* Right column of the 2fr/1fr content grid should size to its own content and
   pin to the top, rather than stretching to match the (often taller) left
   column. Prevents a right-column box drifting down when left-side accordions
   expand. Applies to all .page-body pages (index/our work don't use it). */
.page-body > :nth-child(2) { align-self: start; }
.text-eyebrow { font: var(--text-eyebrow); letter-spacing: 0.25em;
                text-transform: uppercase; color: var(--orange); }
.text-eyebrow.muted { color: var(--grey); }
.text-cta     { font: var(--text-cta);     letter-spacing: 0.04em;
                text-transform: none; }

/* Simple text pages (privacy, copyright, disclaimer, accessibility, etc.) —
   map bare body copy to tokens. Page title uses .second-banner-heading (h2),
   in-page section headings map to h3, paragraphs/lists to body. */
.text-page h2 { font: var(--text-h3); letter-spacing: -0.01em;
                color: var(--dark); margin: 2rem 0 0.6rem; }
.text-page p  { font: var(--text-body); color: var(--ink); margin: 0 0 1rem; }
.text-page ul { font: var(--text-body); color: var(--ink);
                margin: 0 0 1rem; padding-left: 1.25rem; }
.text-page li { margin-bottom: 0.4rem; }

/* Inline body-copy links: semibold violet, orange on hover, no underline. */
.text-page a, .page-body p a, .post-expanded a {
  color: var(--violet); font-weight: 600; text-decoration: none; transition: color .2s;
}
.text-page a:hover, .page-body p a:hover, .post-expanded a:hover { color: var(--orange); }

/* ─── BASE ────────────────────────────────────────────── */
html { scroll-behavior: smooth; overflow-x: clip; }
body {
  font-family: var(--font-sans);
  font-weight: 400;
  background: var(--cream);
  color: var(--dark);
  overflow-x: clip;
  /* ── Sticky footer: ensure acknowledgement+footer always sit at viewport bottom ── */
  min-height: 100vh;
  min-height: 100dvh; /* dynamic viewport height — adjusts for mobile browser chrome */
  display: flex;
  flex-direction: column;
}

/* Push footer to bottom on short-content pages */
#footer-placeholder { margin-top: auto; }

/* In flex-column body context, margin: 0 auto on flex children overrides
   align-self: stretch — forcing explicit width restores full-viewport width. */
body > div { width: 100%; }

/* ─── LAYOUT SHELL ────────────────────────────────────── */
.site-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--shell-h-pad);
}
/* --shell-h-pad is now fluid (clamp, declared in :root); no stepped breakpoints needed. */

/* ─── NAV ─────────────────────────────────────────────── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  background: var(--cream);
  transition: background 0.45s, box-shadow 0.45s;
  border-bottom: 6px solid white;
}
nav.measuring, nav.measuring *, nav.measuring *::before, nav.measuring *::after {
  transition: none !important;
}
nav.scrolled {
  background: rgba(246,245,240,0.98);
  backdrop-filter: blur(14px);
  box-shadow: 0 2px 40px rgba(0,0,0,0.08);
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px var(--shell-h-pad);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}
@media (min-width: 769px) {
  nav.scrolled .nav-links a {
    color: var(--ink);
  }
  nav.scrolled .nav-links a:hover { color: var(--orange); }
}
.nav-logo {
  height: 100px;
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: height 0.45s cubic-bezier(0.4,0,0.2,1);
}
.nav-logo img {
  height: 65px;
  width: auto;
  max-width: 100%;
  display: block;
  transform-origin: left center;
  transition: height 0.45s cubic-bezier(0.4,0,0.2,1), opacity 0.45s cubic-bezier(0.4,0,0.2,1), transform 0.45s cubic-bezier(0.4,0,0.2,1);
}
nav.scrolled .nav-logo {
  height: 48px;
}
nav.scrolled .nav-logo img {
  height: 44px;
  opacity: 0.92;
  transform: translateY(4px) scale(0.98);
}
@media (min-width: 769px) {
  .nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    align-items: flex-end;
    height: 100%;
    padding-bottom: 1.25rem;
  }
  nav.scrolled .nav-links {
    padding-bottom: 0.4rem;
  }
}
.nav-links a {
  color: var(--ink);
  text-decoration: none;
  font: var(--text-cta);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--orange); }

/* ── 920px: Pre-hamburger nav tidy-up ── */
@media (max-width: 920px) and (min-width: 769px) {
  .nav-logo { height: 82px; }
  .nav-logo img { height: 76px; }
  nav.scrolled .nav-logo { height: 48px; }
  nav.scrolled .nav-logo img { height: 44px; }
  .nav-links { gap: 1rem; }
  .nav-links a {
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    white-space: nowrap;
  }
}

/* ── 768px: Hamburger + mobile overlay ── */
@media (max-width: 768px) {
  .nav-logo { height: 82px; }
  .nav-logo img { height: 44px; }
  nav.scrolled .nav-logo { height: 82px; }
  nav.scrolled .nav-logo img { height: 44px; transform: none; opacity: 1; }
  nav, nav.scrolled {
    background: rgba(246,245,240,0.98);
    backdrop-filter: blur(14px);
  }

  /* ── Hamburger button ── */
  .nav-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 210;
    background: none;
    border: none;
    padding: 6px;
    margin-right: calc(var(--shell-h-pad) * -1 + 3px);
  }
  .nav-hamburger img {
    width: 50px;
    height: 50px;
    transition: opacity 0.2s ease;
  }
  .nav-hamburger .nav-icon-open  { display: block; }
  .nav-hamburger .nav-icon-close { display: none; }
  .nav-hamburger.open .nav-icon-open  { display: none; }
  .nav-hamburger.open .nav-icon-close { display: block; }

  /* ── Mobile nav overlay — drops below nav bar ── */
  .nav-links {
    display: flex;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    bottom: auto;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    pointer-events: none;
    background: #4d4d4f;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    margin: 0;
    list-style: none;
    padding: 0;
    border-bottom: 6px solid transparent;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    z-index: 190;
    transition: max-height 0.42s cubic-bezier(0.4,0,0.2,1), opacity 0.28s ease, transform 0.42s cubic-bezier(0.4,0,0.2,1), padding 0.32s ease, border-bottom-color 0.25s ease, visibility 0s linear 0.42s;
  }
  .nav-links.open {
    max-height: 22rem;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
    padding: 0.35rem 0;
    border-bottom-color: white;
    transition-delay: 0s;
  }
  .nav-links li {
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,0.12);
  }
  .nav-links li:last-child { border-bottom: none; }
  .nav-links a {
    display: block;
    width: 100%;
    padding: 1rem var(--shell-h-pad);
    text-align: left;
    font-size: 1.05rem;
    letter-spacing: 0.12em;
    color: #ffffff;
  }
  .nav-links a:hover { color: var(--orange); }
}

/* ── Hamburger hidden on desktop ── */
@media (min-width: 769px) {
  .nav-hamburger { display: none; }
}

html.is-resizing .nav-links {
  transition: none !important;
}

/* ─── DROPDOWN NAV ───────────────────────────────────── */
.has-dropdown { position: relative; }
.dropdown { list-style: none; display: none; }

@media (min-width: 769px) {
  .has-dropdown > a::after {
    content: '';
    display: inline-block;
    margin-left: 0.35em;
    width: 0;
    height: 0;
    border-left: 3.5px solid transparent;
    border-right: 3.5px solid transparent;
    border-top: 4px solid currentColor;
    vertical-align: middle;
    opacity: 0.55;
  }
  .has-dropdown:hover .dropdown {
    display: block;
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    background: #ffffff;
    border: 1px solid rgba(61,65,82,0.12);
    border-radius: 6px;
    min-width: 210px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    z-index: 210;
    padding: 0.4rem 0;
  }
  .has-dropdown:hover > a { color: var(--orange); }
  .dropdown li a {
    display: block;
    padding: 0.5rem 1.1rem;
    font: var(--text-cta);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink);
    white-space: nowrap;
    transition: color 0.2s, background 0.2s;
  }
  .dropdown li a:hover { color: var(--orange); background: rgba(61,65,82,0.04); }
}

@media (max-width: 768px) {
  .nav-links.open { max-height: 40rem; }
  /* Accordion: static down chevron on parent links (matches old version) */
  .has-dropdown > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .has-dropdown > a::after {
    content: '';
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 3px;
    border-right: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    transform: rotate(-45deg);
    flex-shrink: 0;
    transition: transform 0.25s ease;
  }
  /* Rotate chevron down to signpost the open accordion */
  .has-dropdown.submenu-open > a::after {
    transform: rotate(45deg);
    border-color: var(--orange);
  }
  .has-dropdown.submenu-open > a {
    color: var(--orange);
  }
  /* Show dropdown only when accordion is open */
  .has-dropdown.submenu-open .dropdown {
    display: block;
  }
  .nav-links .dropdown li {
    width: 100%;
    border-bottom: none;
    border-top: none;
  }
  .dropdown li a {
    display: block;
    width: 100%;
    padding: 0.65rem var(--shell-h-pad);
    padding-left: calc(var(--shell-h-pad) + 1rem);
    text-align: left;
    font: var(--text-cta);
    font-size: 0.95rem;
    letter-spacing: 0.1em;
    color: #ffffff;
  }
  .dropdown li a:hover { color: var(--orange); }
  /* Reduce space between "Our Work" parent and "Current Work" child */
  .nav-links > li.has-dropdown:first-child .dropdown li:first-child a {
    padding-top: 0.3rem;
  }
  /* Add more space after last child of "Our Work" */
  .nav-links > li.has-dropdown:first-child .dropdown li:last-child a {
    padding-bottom: 1.5rem;
  }
  /* Reduce space between "Who we are" parent and first child */
  .nav-links > li.has-dropdown:nth-child(2) .dropdown li:first-child a {
    padding-top: 0.3rem;
  }
  /* Add more space after last child of "Who we are" */
  .nav-links > li.has-dropdown:nth-child(2) .dropdown li:last-child a {
    padding-bottom: 1.5rem;
  }
}

/* ─── ACTIVE NAV UNDERLINE ──────────────────────────── */
@media (min-width: 769px) {
  .nav-links > li.nav-section-active > a {
    display: inline-block;
    position: relative;
  }
  .nav-links > li.nav-section-active > a::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 100%;
    height: 2px;
    background: var(--orange);
    border-radius: 1px;
  }
  .nav-links > li.has-dropdown.nav-section-active > a::before {
    width: calc(100% - 14px);
  }
}

/* ─── WORK CARDS ─────────────────────────────────────── */
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.news-card.work-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  height: 110px;
  padding: 0.8rem 1.1rem;
  overflow: hidden;
  border: 1px solid rgba(68,70,85,0.1);
  border-radius: 8px;
  text-decoration: none;
  transition: opacity 0.75s ease, transform 0.2s ease, border-color 0.3s, box-shadow 0.3s;
}
.news-card.work-card:hover {
  border-color: var(--orange);
  box-shadow: 0 10px 35px rgba(241,90,34,0.08);
  transform: translateY(-4px);
}
.work-card .work-card-logo {
  width: 83px;
  height: 83px;
  max-height: 83px;
  padding: 7.5px;
  box-sizing: border-box;
  object-fit: contain;
  object-position: center;
  display: block;
  margin: 0;
  flex-shrink: 0;
}
.work-card .news-card-arrow {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: inherit;
  font: var(--text-body-sm);
  font-weight: 600;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
}
.work-card-more { color: inherit; font-weight: 700; white-space: nowrap; }

@media (max-width: 768px) {
  .work-grid { grid-template-columns: 1fr; }
  .news-card.work-card {
    gap: 1rem;
    padding: 1.25rem 1.5rem;
  }
  .work-card .work-card-logo {
    width: 52px;
    height: 52px;
    max-height: 52px;
    padding: 0;
  }
}

@media (max-width: 640px) {
  .news-card.work-card { padding: 1rem 1.25rem; }
}

/* ─── FOOTER ACKNOWLEDGEMENT ─────────────────────────── */
.footer-acknowledgement {
  background: var(--sand);
  border-top: 6px solid white;
  padding: 1.25rem 0;
  text-align: center;
}
.footer-acknowledgement p {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--shell-h-pad);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.7;
  color: var(--dark);
}
.footer-acknowledgement a {
  color: var(--dark);
  font-weight: 600;
  text-decoration: none;
}
.footer-acknowledgement a:hover { color: var(--orange); }

/* ─── FOOTER ──────────────────────────────────────────── */
footer { background:#4d4d4f; border-top: 6px solid white; padding-bottom: 1.5rem; }
.footer-inner { max-width:1280px; margin:0 auto; padding:1.25rem var(--shell-h-pad) 0; }
.footer-top {
  display: grid;
  grid-template-columns: 1fr 2fr;
  grid-template-rows: auto auto auto;
  gap: 0 3rem;
  padding-bottom: 0;
}
.footer-col {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.footer-col-1 {
  grid-row: 1 / 4;
  display: grid;
  grid-template-rows: subgrid;
  min-width: 220px;
  max-width: 320px;
}
.footer-col-2 {
  grid-row: 1 / 4;
  display: grid;
  grid-template-rows: subgrid;
  align-items: end;
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
}
.footer-col-2-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: flex-end;
  align-self: center;
}
.footer-col-2-links a {
  font-size: 0.92rem;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-col-2-links a:hover { color: var(--sand); }
.footer-col-2-social {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: flex-end;
  align-self: start;
}
.footer-brand { display:flex; align-items:flex-start; gap:1rem; }
.footer-logo-png {
  width: 200px;
  height: 48px;
  max-width: 100%;
  flex-shrink: 0;
  opacity: 0.9;
  display: block;
  margin-top: 5px;
  margin-bottom: 10px;
}
.footer-bottom { display:flex; align-items:center; justify-content:space-between; padding:1.5rem 0 2rem; }
.footer-social { display:flex; gap:0.75rem; }
.social-btn { width:38px; height:38px; border-radius:50%; background:var(--orange); color:white; display:flex; align-items:center; justify-content:center; text-decoration:none; font-size:0.75rem; font-weight:700; transition:background 0.2s,transform 0.2s; }
.social-btn:hover { background:#d94e1c; transform:translateY(-2px); }
.newsletter-btn { font-size:0.82rem; font-weight:600; color:rgba(255,255,255,0.6); text-decoration:none; border:1px solid rgba(255,255,255,0.2); padding:0.6rem 1.25rem; border-radius:3px; transition:color 0.2s,border-color 0.2s; display:inline-block; }
.newsletter-btn:hover { color:white; border-color:rgba(255,255,255,0.5); }
.footer-credit { font-size:0.85rem; color:rgba(255,255,255,0.2); text-align:right; padding:0; align-self: start; }
.footer-ai-link { color:inherit; text-decoration:none; transition:color 0.2s; }
.footer-ai-link:hover { color:var(--sand); }

/* ─── SECOND BANNER ───────────────────────────────────── */
.second-banner-breadcrumb a,
.second-banner-breadcrumb .bc-current {
  color: var(--ink);
  text-decoration: none;
}
.second-banner-breadcrumb a:hover {
  color: var(--orange);
}
.second-banner-breadcrumb .bc-sep {
  margin: 0 0.3em;
  color: var(--ink);
}

.second-banner-breadcrumb {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding: 0 calc(max(0px, (100vw - 1280px) / 2) + var(--shell-h-pad));
  min-height: 3rem;
  display: flex;
  align-items: center;
  border-bottom: 6px solid white;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-align: left;
}
.second-banner-heading {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding: 0 calc(max(0px, (100vw - 1280px) / 2) + var(--shell-h-pad));
  min-height: 3rem;
  display: flex;
  align-items: center;
  font: var(--text-h2);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--dark);
  text-align: left;
  border-bottom: 6px solid white;
  margin-bottom: 3rem;
}

/* ─── FOOTER RESPONSIVE ───────────────────────────────── */
@media (max-width: 768px) {
  .footer-top {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .footer-col-1 {
    grid-row: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 100%;
    align-items: center;
    text-align: center;
  }
  .footer-col-2 {
    grid-row: auto;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    align-items: center;
  }
  .footer-col-2-links {
    justify-content: center;
    align-self: auto;
    text-align: center;
  }
  .footer-col-2-links > div {
    justify-content: center;
  }
  .footer-col-2-social {
    justify-content: center;
    align-self: auto;
  }
  .footer-credit {
    text-align: center;
    align-self: auto;
  }
}

/* ─── MEMBER LOGOS GRID (shared by index.html and about.html) ─────────── */
/* Scoped to .members-grid so it never collides with about.html's board .member-card. */
.members-grid { display:grid; grid-template-columns:repeat(5,1fr); gap:1.1rem; }
.members-grid .member-card {
  background:white; border:1px solid rgba(68,70,85,0.09); border-radius:3px;
  padding:1.75rem 1.4rem; text-decoration:none; display:block;
  opacity:0; transform:scale(0.94) translateY(10px);
  transition:opacity 0.75s ease,transform 0.2s ease,border-color 0.3s,box-shadow 0.3s;
}
.members-grid .member-card.visible { opacity:1; transform:scale(1) translateY(0); }
.members-grid .member-card:hover { border-color:var(--orange); box-shadow:0 10px 35px rgba(241,90,34,0.1); transform:translateY(-5px); }
.members-grid .member-card.logo-only {
  background:transparent; border:none; box-shadow:none;
  padding:1rem; display:flex; align-items:center; justify-content:center;
}
.members-grid .member-card.logo-only:hover { border-color:transparent; box-shadow:none; }
.members-grid .member-card.logo-only img { max-width:100%; max-height:80px; object-fit:contain; }

@media (max-width: 1100px) { .members-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px)  { .members-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px)  { .members-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px)  { .members-grid { grid-template-columns: repeat(2, 1fr); } }
