@charset "utf-8";

/* =========================================================
   GLOBAL CONTROLS (single place to tune the whole site)
   ========================================================= */
:root{
  /* Header sizing */
  --header-h: 115px;
  --header-h-scrolled: 115px;
  --header-pad-x: 40px;

  /* Mobile header sizing */
  --header-h-m: 100px;              /* only for phones */
  --header-h-scrolled-m: 100px;     /* keep stable to avoid jump */
  --header-pad-x-m: 15px;
  --header-pad-y-m: 10px;

  /* Brand */
  --logo-size: 50px;
  --logo-size-m: 40px;
  --logo-text: 32px;
  --logo-text-768: 24px;
  --logo-text-m: 18px;

  /* Section content width + padding */
  --content-max: 1400px;
  --content-pad: 40px;
  --content-pad-m: 20px;

  /* “Section header” block spacing */
  --sec-header-pad-top: 40px;
  --sec-header-margin-top: -50px;
  --sec-header-margin-bottom-m: 50px;

  /* Typography */
  --h2: 48px;
  --h2-768: 36px;
  --p: 20px;
  --p-m: 16px;
  --p-line: 1.8;

  /* Shared text width */
  --text-max: 950px;

  /* Two-column main layout */
  --main-gap: 20px;
  --main-gap-1024: 60px;
  --visual-h: 600px;
  --visual-h-1024: 400px;

  /* Showcase cards */
  --showcase-max: 500px;
  --showcase-h: 500px;
  --showcase-main-w: 900px;
  --showcase-main-h: 360px;
  --showcase-main-pad: 10px;
  --showcase-768-max: 350px;
  --showcase-768-h: 400px;
  --showcase-768-main-h: 350px;
  --showcase-768-main-pad: 30px;
}

/* =========================================================
   RESET + BASE
   ========================================================= */
*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html{ scroll-behavior: smooth; }

body{
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow-x: hidden;
  background: linear-gradient(135deg, #0f0f0f 0%, #1a1a2e 100%);
  color: #fff;
}

/* =========================================================
   SECTION BASE
   ========================================================= */
.section{
  min-height: 100vh;
  width: 100%;
  display: block;
  scroll-margin-top: 90px; /* anchor jumps vs fixed header */
}

/* =========================================================
   HEADER
   ========================================================= */
.header{
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 1000;

  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--header-pad-x);
  transition: all 0.3s ease;

  /* prevents long titles from forcing overflow */
  min-width: 0;
}

.header.scrolled{
  background: rgba(0, 0, 0, 0.95);
  height: var(--header-h-scrolled);
}

.logo-container{
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.3s ease;

  /* critical for wrapping/shrinking inside flex header */
  min-width: 0;
}

.logo-container:hover{ transform: translateY(-2px); }

.logo{
  width: var(--logo-size);
  height: var(--logo-size);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.logo svg{ width: 100%; height: 100%; }

.logo img{
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-text{
  color: #fff;
  font-size: var(--logo-text);
  font-weight: 600;
  letter-spacing: -0.5px;

  /* allow wrapping on smaller screens */
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.1;
}

/* =========================================================
   MENU
   ========================================================= */
.main-menu{
  display: flex;
  align-items: center;
  gap: 40px;
  flex: 0 0 auto;
}

.menu-item{
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  padding: 8px 0;
  white-space: nowrap;
}

.menu-item:hover{
  color: #fff;
  transform: translateY(-2px);
}

.menu-item::after{
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transition: width 0.3s ease;
}

.menu-item:hover::after{ width: 100%; }

.menu-item.active{ color: #fff; }
.menu-item.active::after{ width: 100%; }

/* =========================================================
   ON THIS PAGE (hamburger)
   ========================================================= */
.onpage{
  position: relative;
  display: flex;
  align-items: center;
}

.onpage-btn{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.onpage-btn:hover{
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.22);
}

.onpage-label{
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.2px;
  white-space: nowrap;
}

.hamburger{
  width: 18px;
  height: 14px;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger span{
  height: 2px;
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 2px;
}

/* Dropdown panel */
.onpage-panel{
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 320px;
  max-width: 420px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 10, 12, 0.95);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  z-index: 2000;

  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.onpage.open .onpage-panel{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.onpage-link{
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.25;
  transition: background 0.18s ease, transform 0.18s ease;
}

.onpage-link:hover{
  background: rgba(102, 126, 234, 0.16);
  transform: translateX(2px);
  color: #fff;
}

/* On This Page: small phones */
@media (max-width: 520px){
  .onpage-label{ display: none; }
  .onpage-panel{ min-width: 260px; }
}

/* =========================================================
   GLOBAL HIGHLIGHT STYLE (kept from your file)
   ========================================================= */
.section h3 strong{
  color: #7b7fe8;
  text-shadow: 0 0 10px rgba(123, 127, 232, 0.35);
}

/* =========================================================
   INTRO SECTION (kept, but cleaned)
   ========================================================= */
.intro-content{
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0;
}

.intro-header{
  text-align: center;
  margin-bottom: 80px;
  padding-top: 60px; /* space under fixed header */
  margin-top: 60px;
}

.intro-header h2{
  font-size: var(--h2);
  margin-bottom: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.intro-header p{
  font-size: var(--p);
  color: rgba(255, 255, 255, 0.8);
  max-width: var(--text-max);
  margin: 0 auto;
  line-height: var(--p-line);
  text-align: left;
}

/* =========================================================
   SCROLL TO TOP
   ========================================================= */
.scroll-to-top{
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(100px);
  transition: all 0.3s ease;
  z-index: 999;
}

.scroll-to-top.visible{
  opacity: 1;
  transform: translateY(0);
}

.scroll-to-top:hover{
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
}

/* =========================================================
   CLICK-TO-ENLARGE + OVERLAY
   ========================================================= */
.click-enlarge{ cursor: zoom-in; }

.image-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.image-overlay img{
  width: auto;
  height: auto;
  object-fit: contain;
  max-width: 85vw;
  max-height: 96vh;
  touch-action: pinch-zoom;
}

/* Standalone article figures */
.responsive-figure{
  display: block;
  width: 85%;
  max-width: 960px;
  height: auto;
  margin: 18px auto;
}

/* =========================================================
   SECTION-AGNOSTIC STYLING (applies to all sections)
   Works with your naming pattern: X-content, X-header, X-main, ...
   ========================================================= */

/* Content wrapper: .NNDB-content, .SAV-content, .Women-content, ... */
.section > [class$="-content"]{
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--content-pad);
}

/* Header wrapper: .NNDB-header, .SAV-header, ... */
.section [class$="-header"]{
  text-align: center;
  padding-top: var(--sec-header-pad-top);
  margin-top: var(--sec-header-margin-top);
}

/* H2 inside any section header */
.section [class$="-header"] h2{
  font-size: var(--h2);
  margin-bottom: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;

  line-height: 1.15;
  overflow-wrap: anywhere;
}

/* Paragraphs inside any section header */
.section [class$="-header"] p{
  font-size: var(--p);
  color: rgba(255, 255, 255, 0.8);
  max-width: var(--text-max);
  margin: 0 auto;
  line-height: var(--p-line);
  text-align: left;
}

/* Two-column layout: .NNDB-main, .SAV-main, ... */
.section [class$="-main"]{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--main-gap);
  align-items: center;
  margin-top: 10px;
  margin-bottom: -30px;
}

/* Visual column: .NNDB-visual, .SAV-visual, ... */
.section [class$="-visual"]{
  position: relative;
  height: var(--visual-h);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Info column: .NNDB-info, .SAV-info, ... */
.section [class$="-info"]{
  padding-left: 40px;
}

.section [class$="-info"] h3{
  font-size: 36px;
  margin-bottom: 30px;
  line-height: 1.3;
  text-align: left;
}

/* Feature list: .NNDB-feature-list, .SAV-feature-list, ... */
.section ul[class$="-feature-list"]{
  list-style: none;
  margin-bottom: 40px;
}

.section ul[class$="-feature-list"] li{
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 20px;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
}

.section ul[class$="-feature-list"] li::before{
  content: "\25B6";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  flex-shrink: 0;
}

/* Showcase display: .NNDB-showcase-display, .SAV-showcase-display, ... */
.section [class$="-showcase-display"]{
  position: relative;
  width: 100%;
  max-width: var(--showcase-max);
  height: var(--showcase-h);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

/* Showcase main panel: .NNDB-showcase-main, .SAV-showcase-main, ... */
.section [class$="-showcase-main"]{
  position: relative;
  width: 100%;
  max-width: var(--showcase-main-w);
  height: var(--showcase-main-h);
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.1) 0%,
    rgba(118, 75, 162, 0.1) 100%
  );
  border-radius: 20px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  padding: var(--showcase-main-pad);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
  box-sizing: border-box;
  overflow: visible;
}

.section [class$="-showcase-main"] img{
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  object-fit: contain;
  transform: translate(-50%, -50%);
  z-index: 1;
}

/* Corner decoration: .NNDB-corner-decoration, .SAV-corner-decoration, ... */
.section [class*="-corner-decoration"]{
  position: absolute;
  width: 64px;
  height: 64px;
  border: 2px solid rgba(102, 126, 234, 0.85);
  z-index: 3;
  pointer-events: none;
}

.section [class*="-corner-decoration"].top-left{
  top: -20px;
  left: -20px;
  border-right: none;
  border-bottom: none;
  border-radius: 20px 0 0 0;
}

.section [class*="-corner-decoration"].bottom-right{
  bottom: -20px;
  right: -20px;
  border-left: none;
  border-top: none;
  border-radius: 0 0 20px 0;
}

/* =========================================================
   PER-SECTION BACKGROUNDS (kept exactly as in your file)
   ========================================================= */
#intro,
#NNDB,
#SAV,
#Women,
#HouseholdJoint,
#Children{
  background: linear-gradient(135deg, #0f0f0f 0%, #1a1a2e 100%);
}

/* =========================================================
   RESPONSIVE (single, clean set of breakpoints)
   ========================================================= */

/* 1024px: stack the two-column section layouts */
@media (max-width: 1024px){
  .section [class$="-main"]{
    grid-template-columns: 1fr;
    gap: var(--main-gap-1024);
  }

  .section [class$="-visual"]{ height: var(--visual-h-1024); }

  .section [class$="-info"]{
    padding-left: 0;
    text-align: center;
  }

  .section [class$="-info"] h3{ text-align: center; }
}

/* 768px: tighten header + scale down H2 + showcase */
@media (max-width: 768px){
  .header{ padding: 0 20px; }

  .logo-text{ font-size: var(--logo-text-768); }

  .intro-header h2{ font-size: var(--h2-768); }

  .section [class$="-header"] h2{ font-size: var(--h2-768); }

  .section [class$="-info"] h3{ font-size: 28px; }

  .section [class$="-showcase-display"]{
    max-width: var(--showcase-768-max);
    height: var(--showcase-768-h);
  }

  .section [class$="-showcase-main"]{
    width: 100%;
    height: var(--showcase-768-main-h);
    padding: var(--showcase-768-main-pad);
  }
}

/* 480px: mobile header + mobile content typography + spacing */
@media (max-width: 480px){
  /* Mobile header: increases only on phones */
  .header{
    height: var(--header-h-m);
    padding: var(--header-pad-y-m) var(--header-pad-x-m);
    align-items: flex-start;

    /* crucial for preventing overflow: let header wrap into two rows */
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .header.scrolled{
    height: var(--header-h-scrolled-m);
  }

  .logo{
    width: var(--logo-size-m);
    height: var(--logo-size-m);
  }

  .logo-text{
    font-size: var(--logo-text-m);
  }

  /* Put brand on row 1 and menu on row 2 (no HTML changes needed) */
  .logo-container{ flex: 1 1 100%; }
  .main-menu{
    flex: 0 0 100%;
    justify-content: flex-end;
    gap: 16px;
  }

  /* Intro mobile */
  .intro-content{ padding: var(--content-pad-m); }
  .intro-header{ margin-bottom: 50px; }
  .intro-header p{ font-size: var(--p-m); line-height: 1.7; }

  /* All sections mobile */
  .section > [class$="-content"]{ padding: var(--content-pad-m); }
  .section [class$="-header"]{ margin-bottom: var(--sec-header-margin-bottom-m); }
  .section [class$="-header"] p{ font-size: var(--p-m); line-height: 1.7; }
}

/* Optional: avoid hover “jump” on touch devices */
@media (hover: none){
  .logo-container:hover{ transform: none; }
  .menu-item:hover{ transform: none; }
  .onpage-btn:hover{ transform: none; }
}

/* =========================================================
   Prevent content being hidden under the fixed header
   ========================================================= */

.section:first-of-type [class$="-header"]{
  margin-top: 0; /* cancel the -50px only for the first section */
}

/* Optional: add a controlled top breathing room for the first section */
.section:first-of-type > [class$="-content"]{
  padding-top: calc(var(--content-pad) + var(--header-h));
}

@media (max-width: 480px){
  .section:first-of-type > [class$="-content"]{
    padding-top: calc(var(--content-pad-m) + var(--header-h-m));
  }
}

