/* ════════════════════════════════════════════════════════════════════════════
   Oppenheimer Family Archive — Shared Styles
   Aligned with Apple Human Interface Guidelines (HIG)
   Typography: 17pt body, 15pt secondary, 13pt footnote, 11pt caption
   Tap targets: 44×44pt minimum on interactive elements
   Animation: 200–350ms, ease-out curves
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Common reset + base ────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Pro Display',
               'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #f2f2f7;    /* iOS system grouped background */
  overflow: hidden;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Page header / navigation bar ────────────────────────────────────────
   HIG: Navigation bars use a 44pt standard height
   ────────────────────────────────────────────────────────────────────────── */
.page-header {
  background: #2c3e50;
  color: white;
  padding: 0 24px;
  min-height: 44px;
  font-size: 17px;          /* HIG: Headline = 17pt semibold */
  font-weight: 600;
  position: relative;
  z-index: 100;
  box-shadow: 0 0.5px 0 rgba(0,0,0,0.3);  /* iOS-style hairline shadow */
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.page-header .left {
  padding: 10px 0;
}
.page-header .left .subtitle {
  font-size: 13px;           /* HIG: Footnote = 13pt */
  font-weight: 400;
  opacity: 0.65;
  margin-top: 1px;
}
.page-header .right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ── Header controls (zoom buttons etc.) ────────────────────────────────── */
.page-header .controls {
  display: flex;
  gap: 8px;
  align-items: center;
}
.page-header .controls button {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 6px 14px;
  min-height: 34px;          /* Compact iOS button height */
  border-radius: 8px;        /* HIG: Rounded rect with 8pt radius */
  cursor: pointer;
  font-size: 13px;           /* HIG: Footnote */
  font-weight: 500;
  transition: background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.page-header .controls button:hover {
  background: rgba(255,255,255,0.2);
}
.page-header .controls button:active {
  background: rgba(255,255,255,0.08);
  transition: background 0.05s;
}
.page-header .zoom-label {
  font-size: 13px;           /* HIG: Footnote */
  opacity: 0.6;
  min-width: 45px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ── Navigation links ─────────────────────────────────────────────────────
   Desktop: horizontal tabs with underline indicator
   HIG: Tab bar items use 10pt caption — but since we're using text links
   in a nav bar context, we use 13pt (Footnote) for readability
   ────────────────────────────────────────────────────────────────────────── */
.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}
.nav-links a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 13px;           /* HIG: Footnote */
  font-weight: 500;
  transition: color 0.2s ease-out, background 0.2s ease-out;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  border-radius: 8px;
  min-height: 34px;           /* Compact tappable area */
}
.nav-links a:hover {
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.08);
}
.nav-links a:active {
  background: rgba(255,255,255,0.04);
  transition: background 0.05s;
}
.nav-links a.active {
  color: white;
  font-weight: 600;
  background: rgba(255,255,255,0.1);
  position: relative;
}
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: #d6b656;
  border-radius: 1px;
}
.nav-icon {
  font-size: 14px;
  line-height: 1;
}

/* ── Animated hamburger button (NN/g: labeled for discoverability) ───── */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  min-width: 44px;            /* HIG: 44×44pt minimum tap target */
  height: 44px;
  position: relative;
  z-index: 200;
  -webkit-tap-highlight-color: transparent;
  border-radius: 10px;
  transition: background 0.2s ease;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
}
.nav-toggle:active {
  background: rgba(255,255,255,0.08);
}
.nav-label {
  display: none;               /* Hidden on desktop (whole button is hidden) */
}
.hamburger-lines {
  position: relative;          /* Relative inside flex parent (was absolute) */
  background-color: #fff;
  border-radius: 1px;
  height: 2px;
  width: 20px;
  transition: height 100ms;
}
.hamburger-lines::before,
.hamburger-lines::after {
  content: '';
  background-color: #fff;
  border-radius: 1px;
  height: 2px;
  width: 20px;
  position: absolute;
  left: 0;
  transition: all 250ms ease-out;  /* HIG: 200-400ms range, ease-out */
}
.hamburger-lines::before { top: -6px; }
.hamburger-lines::after  { bottom: -6px; }

/* Open state: middle line disappears, top/bottom rotate to X */
.nav-toggle.open .hamburger-lines { height: 0; }
.nav-toggle.open .hamburger-lines::before,
.nav-toggle.open .hamburger-lines::after { top: 0; bottom: auto; }
.nav-toggle.open .hamburger-lines::before { transform: rotate(45deg); }
.nav-toggle.open .hamburger-lines::after  { transform: rotate(-45deg); }

/* ── Mobile: animated dropdown nav ────────────────────────────────────── */
@media (max-width: 680px) {
  .page-header {
    flex-wrap: wrap;
    padding: 0 16px;
    font-size: 15px;          /* HIG: Subheadline = 15pt on compact */
  }
  .page-header .left {
    flex: 1;
    min-width: 0;
    padding: 10px 0;
  }
  .page-header .left > div:first-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .page-header .right {
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
  }
  .nav-toggle { display: flex; }  /* flex for icon + "Menu" label */
  .nav-label {
    display: block;
    font-size: 11px;            /* HIG: Caption 2 = 11pt */
    font-weight: 500;
    color: rgba(255,255,255,0.8);
    letter-spacing: 0.3px;
    text-transform: uppercase;
  }

  /* Smooth dropdown — iOS-style frosted glass panel
     HIG Materials: systemChromeMaterial with blur + saturation boost */
  .nav-links {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0;
    background: rgba(44, 62, 80, 0.92);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-radius: 13px;       /* HIG: iOS sheet corner radius */
    padding: 0;
    margin: 8px 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 350ms ease-out, opacity 200ms ease-out, padding 350ms ease-out;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15), 0 0 0 0.5px rgba(255,255,255,0.08);
  }
  .nav-links.open {
    max-height: 400px;
    opacity: 1;
    padding: 4px 0;
  }

  /* Links: staggered entrance */
  .nav-links a {
    padding: 14px 20px;
    font-size: 17px;           /* HIG: Body = 17pt for list items */
    font-weight: 400;
    min-height: 44px;          /* HIG: 44pt minimum tap target */
    border-bottom: none;
    border-radius: 0;
    background: transparent;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 250ms ease-out, transform 250ms ease-out, background 0.15s ease;
    position: relative;
  }
  /* Hairline separator (iOS style — inset from left) */
  .nav-links a:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 0;
    height: 0.5px;
    background: rgba(255,255,255,0.1);
  }
  .nav-links a:active {
    background: rgba(255,255,255,0.06);
  }

  /* Staggered entrance when open */
  .nav-links.open a:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 30ms; }
  .nav-links.open a:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 60ms; }
  .nav-links.open a:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 90ms; }
  .nav-links.open a:nth-child(4) { opacity: 1; transform: translateY(0); transition-delay: 120ms; }
  .nav-links.open a:nth-child(5) { opacity: 1; transform: translateY(0); transition-delay: 150ms; }
  .nav-links.open a:nth-child(6) { opacity: 1; transform: translateY(0); transition-delay: 180ms; }

  .nav-links a.active {
    font-weight: 600;          /* HIG: Headline = 17pt semibold */
    color: white;
  }
  .nav-links a.active::after {
    display: none;
  }
  .nav-links a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: #d6b656;
    border-radius: 0 2px 2px 0;
  }
  .nav-links a:last-child::after { display: none; }
  .nav-icon { font-size: 18px; }

  .page-header .controls {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .page-header .controls button {
    min-width: 44px;           /* HIG: 44×44pt tap target */
    min-height: 44px;
    padding: 8px 14px;
    font-size: 15px;           /* HIG: Subheadline on mobile */
    border-radius: 10px;
  }
  .page-header .zoom-label {
    font-size: 15px;           /* HIG: Subheadline */
    min-width: 50px;
  }
}
