/* ══════════════════════════════════════════════════════════
   history.css — Modern Editorial Redesign
   Sidebar outline + clean article layout
   Navy & Gold · Playfair Display + Lora
   ══════════════════════════════════════════════════════════ */

/* ─── Scroll-reveal ──────────────────────────────────────── */
.hy-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.22,1,0.36,1),
              transform 0.6s cubic-bezier(0.22,1,0.36,1);
}
.hy-reveal.visible { opacity: 1; transform: none; }

/* ─── HERO ───────────────────────────────────────────────── */
.hy-hero {
  position: relative;
  background: var(--accent);
  background-image:
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(201,168,76,0.15) 0%, transparent 65%),
    radial-gradient(ellipse 50% 80% at 100% 100%, rgba(26,61,43,0.8) 0%, transparent 60%);
  padding: 96px 32px 80px;
  overflow: hidden;
  color: #fff;
  text-align: center;
}

.hy-hero__bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  opacity: 0.6;
}

.hy-hero__inner {
  position: relative; z-index: 1;
  max-width: 780px; margin: 0 auto;
}

.hy-hero__kicker {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; margin-bottom: 28px;
  font-family: 'Space Mono', monospace;
  font-size: 9px; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: rgba(201,168,76,0.6);
}
.hy-hero__kicker-line {
  flex: 1; max-width: 60px; height: 1px;
  background: rgba(201,168,76,0.3);
}

.hy-hero__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(42px, 6.5vw, 76px);
  font-weight: 900; line-height: 1.06;
  color: #fff; letter-spacing: -0.5px;
  margin: 0 0 24px;
}
.hy-hero__title em { color: #C9A84C; font-style: italic; }

.hy-hero__sub {
  font-family: 'Lora', Georgia, serif;
  font-size: 17px; color: rgba(255,255,255,0.55);
  max-width: 560px; margin: 0 auto 52px;
  line-height: 1.85; font-style: italic;
}

.hy-hero__stats {
  display: inline-flex; align-items: center;
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 4px;
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(8px);
  overflow: hidden;
}
.hy-hero__stat { padding: 18px 32px; }
.hy-hero__stat-n {
  display: block;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 30px; font-weight: 900;
  color: #C9A84C; line-height: 1;
  margin-bottom: 4px;
}
.hy-hero__stat-l {
  display: block;
  font-family: 'Space Mono', monospace;
  font-size: 8px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}
.hy-hero__stat-div {
  width: 1px; height: 40px;
  background: rgba(201,168,76,0.15);
  flex-shrink: 0;
}

.hy-hero__scroll {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px;
  font-family: 'Space Mono', monospace;
  font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  animation: heroScrollBob 2s ease-in-out infinite;
}
@keyframes heroScrollBob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(5px); }
}

/* ─── LAYOUT: Sidebar + Content ─────────────────────────── */
.hy-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-areas: "sidebar content";
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  gap: 48px;
  align-items: start;
}

/* ─── SIDEBAR ────────────────────────────────────────────── */
.hy-sidebar {
  grid-area: sidebar;
  position: sticky;
  top: calc(var(--navbar-height, 124px) + 24px);
  max-height: calc(100vh - var(--navbar-height, 124px) - 48px);
  overflow-y: auto;
  scrollbar-width: none;
}
.hy-sidebar::-webkit-scrollbar { display: none; }

.hy-sidebar__inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 20px;
  box-shadow: var(--shadow-sm);
}

.hy-sidebar__label {
  font-family: 'Space Mono', monospace;
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* TOC */
.hy-toc {
  display: flex; flex-direction: column; gap: 2px;
  margin-bottom: 20px;
}

.hy-toc__item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 9px 10px; border-radius: 8px;
  text-decoration: none;
  color: var(--text-dim);
  transition: all 150ms ease;
  border-left: 2px solid transparent;
}
.hy-toc__item:hover {
  background: var(--surface-2);
  color: var(--accent);
}
.hy-toc__item.active {
  background: rgba(201,168,76,0.08);
  border-left-color: #C9A84C;
  color: var(--accent);
}

.hy-toc__num {
  font-family: 'Space Mono', monospace;
  font-size: 9px; font-weight: 700;
  color: #C9A84C;
  min-width: 20px;
  margin-top: 2px;
  flex-shrink: 0;
}

.hy-toc__text {
  display: flex; flex-direction: column; gap: 1px;
}
.hy-toc__text strong {
  font-size: 12px; font-weight: 600;
  color: inherit; line-height: 1.3;
}
.hy-toc__text small {
  font-family: 'Space Mono', monospace;
  font-size: 9px; color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* Progress */
.hy-sidebar__progress-wrap {
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.hy-sidebar__progress-label {
  font-family: 'Space Mono', monospace;
  font-size: 8px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.hy-sidebar__progress-track {
  height: 3px; border-radius: 2px;
  background: var(--surface-2);
  overflow: hidden;
}
.hy-sidebar__progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #C9A84C, #E2BB5C);
  border-radius: 2px;
  transition: width 150ms linear;
}

/* ─── CONTENT AREA ───────────────────────────────────────── */
.hy-content {
  grid-area: content;
  min-width: 0;
}

/* ─── CHAPTER ────────────────────────────────────────────── */
.hy-chapter {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 44px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.hy-chapter::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #C9A84C 0%, rgba(201,168,76,0.2) 100%);
}

/* Dark variant */
.hy-chapter--dark {
  background: var(--accent);
  border-color: rgba(201,168,76,0.15);
}
.hy-chapter--dark::before {
  background: linear-gradient(90deg, rgba(201,168,76,0.4), transparent);
}

/* Gold/present variant */
.hy-chapter--gold {
  background: linear-gradient(135deg, #fdfbf4 0%, #fdf8e8 100%);
  border-color: rgba(201,168,76,0.3);
}
.hy-chapter--gold::before {
  background: linear-gradient(90deg, #C9A84C, #E2BB5C);
}

/* Chapter header */
.hy-chapter__meta {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}

.hy-chapter__num-badge {
  display: inline-block;
  padding: 3px 10px; border-radius: 20px;
  font-family: 'Space Mono', monospace;
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  background: rgba(26,61,43,0.07);
  color: var(--accent);
  border: 1px solid rgba(26,61,43,0.1);
}
.hy-chapter__num-badge--light {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  border-color: rgba(255,255,255,0.15);
}
.hy-chapter__num-badge--gold {
  background: rgba(201,168,76,0.15);
  color: #8a6d1a;
  border-color: rgba(201,168,76,0.3);
}

.hy-chapter__era {
  font-family: 'Space Mono', monospace;
  font-size: 10px; font-weight: 700;
  color: #C9A84C; letter-spacing: 0.06em;
}
.hy-chapter__era--light { color: rgba(201,168,76,0.7); }

.hy-chapter__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(26px, 3.5vw, 36px);
  font-weight: 800; line-height: 1.15;
  color: var(--accent);
  margin: 0 0 8px;
  letter-spacing: -0.3px;
}
.hy-chapter__title--light { color: #fff; }

.hy-chapter__subtitle {
  font-family: 'Lora', Georgia, serif;
  font-size: 14px; font-style: italic;
  color: var(--text-muted); margin: 0 0 28px;
}
.hy-chapter__subtitle--light { color: rgba(255,255,255,0.45); }

/* Body text */
.hy-chapter__body p {
  font-family: 'Lora', Georgia, serif;
  font-size: 16px; line-height: 1.85;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.hy-chapter__body p:last-child { margin-bottom: 0; }
.hy-chapter__body p strong { color: var(--accent); font-weight: 600; }

.hy-chapter__body--light p { color: rgba(255,255,255,0.7); }
.hy-chapter__body--light p strong { color: rgba(255,255,255,0.9); }

.hy-chapter__body { margin-bottom: 28px; }

/* Stamps */
.hy-chapter__stamps {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 28px; padding-top: 24px;
  border-top: 1px solid var(--border);
}
.hy-chapter--dark .hy-chapter__stamps { border-top-color: rgba(255,255,255,0.1); }
.hy-chapter--gold .hy-chapter__stamps { border-top-color: rgba(201,168,76,0.2); }

.hy-stamp {
  display: flex; flex-direction: column; gap: 2px;
  padding: 10px 16px;
  background: rgba(26,61,43,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 120px;
}
.hy-stamp--light {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
}
.hy-stamp--gold {
  background: rgba(201,168,76,0.08);
  border-color: rgba(201,168,76,0.2);
}
.hy-stamp__label {
  font-family: 'Space Mono', monospace;
  font-size: 8px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted);
}
.hy-stamp--light .hy-stamp__label { color: rgba(255,255,255,0.35); }
.hy-stamp--gold .hy-stamp__label { color: #8a6d1a; }

.hy-stamp__val {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 14px; font-weight: 700;
  color: var(--accent);
}
.hy-stamp--light .hy-stamp__val { color: #C9A84C; }
.hy-stamp--gold .hy-stamp__val { color: #6b520e; }

/* ─── BLOCKQUOTE ─────────────────────────────────────────── */
.hy-quote {
  margin: 28px 0 0;
  padding: 20px 24px;
  border-left: 3px solid #C9A84C;
  background: rgba(201,168,76,0.05);
  border-radius: 0 8px 8px 0;
}
.hy-quote p {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16px; font-style: italic;
  color: var(--accent); line-height: 1.7;
  margin: 0 0 8px;
}
.hy-quote cite {
  font-family: 'Space Mono', monospace;
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: #C9A84C;
}
.hy-quote--light {
  background: rgba(255,255,255,0.05);
  border-left-color: rgba(201,168,76,0.5);
}
.hy-quote--light p { color: rgba(255,255,255,0.8); }
.hy-quote--light cite { color: rgba(201,168,76,0.7); }

.hy-quote--gold {
  background: rgba(201,168,76,0.1);
  border-left-color: #C9A84C;
}
.hy-quote--gold p { color: #5a3f0a; }
.hy-quote--gold cite { color: #8a6d1a; }

/* ─── HIGHLIGHT BOX ──────────────────────────────────────── */
.hy-highlight {
  display: flex; gap: 16px; align-items: flex-start;
  margin: 24px 0 0;
  padding: 18px 20px;
  background: rgba(26,61,43,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.hy-highlight__icon { font-size: 22px; flex-shrink: 0; margin-top: 2px; }
.hy-highlight div {
  font-family: 'Lora', Georgia, serif;
  font-size: 15px; line-height: 1.75;
  color: var(--text-dim);
}
.hy-highlight div strong { color: var(--accent); }

/* ─── MILESTONES ─────────────────────────────────────────── */
.hy-milestones {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 24px;
}
.hy-milestone {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px;
  background: var(--surface-2);
  border-radius: 8px;
  border-left: 3px solid rgba(201,168,76,0.4);
}
.hy-milestone__year {
  font-family: 'Space Mono', monospace;
  font-size: 11px; font-weight: 700;
  color: #C9A84C; flex-shrink: 0; min-width: 38px;
}
.hy-milestone__text {
  font-size: 13.5px; color: var(--text-dim);
  font-family: 'Lora', Georgia, serif;
}

/* ─── TIMELINE LIST ──────────────────────────────────────── */
.hy-timeline-list {
  margin-top: 24px;
  display: flex; flex-direction: column;
  position: relative; padding-left: 24px;
}
.hy-timeline-list::before {
  content: '';
  position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(to bottom, #C9A84C, rgba(201,168,76,0.15));
}
.hy-tl-item {
  display: flex; align-items: baseline; gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.hy-tl-item:last-child { border-bottom: none; }
.hy-tl-item::before {
  content: '';
  position: absolute; left: -20px; top: 50%; transform: translateY(-50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: #C9A84C;
  box-shadow: 0 0 0 2px rgba(201,168,76,0.2);
}
.hy-tl-year {
  font-family: 'Space Mono', monospace;
  font-size: 10px; font-weight: 700;
  color: #C9A84C; flex-shrink: 0; min-width: 72px;
}
.hy-tl-name {
  font-size: 14px; color: var(--text-dim);
  font-family: 'Lora', Georgia, serif;
}
.hy-tl-name em { color: var(--text-muted); font-style: italic; font-size: 12px; }

/* ─── DIVIDER ────────────────────────────────────────────── */
.hy-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,0.2) 30%, rgba(201,168,76,0.2) 70%, transparent);
  margin: 32px 0;
}

/* ─── SUPERINTENDENTS ────────────────────────────────────── */
.hy-supts {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 44px;
  box-shadow: var(--shadow-sm);
}
.hy-supts__header { margin-bottom: 32px; }
.hy-supts__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 30px; font-weight: 800;
  color: var(--accent); margin: 12px 0 8px;
  letter-spacing: -0.3px;
}
.hy-supts__sub {
  font-family: 'Lora', Georgia, serif;
  font-size: 14px; font-style: italic;
  color: var(--text-muted);
}

.hy-supts__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.hy-supt {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: box-shadow 160ms ease, transform 160ms ease;
}
.hy-supt:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.hy-supt--current {
  background: linear-gradient(135deg, rgba(201,168,76,0.08), rgba(201,168,76,0.03));
  border-color: rgba(201,168,76,0.3);
  grid-column: span 2;
  flex-direction: row; align-items: center; gap: 16px;
}

.hy-supt__photo {
  width: 56px; height: 56px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  border: 2px solid rgba(201,168,76,0.25);
}
.hy-supt--current .hy-supt__photo { width: 70px; height: 70px; }
.hy-supt__photo img { width: 100%; height: 100%; object-fit: cover; }
.hy-supt__initials {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 16px; font-weight: 700; color: #C9A84C;
}
.hy-supt--current .hy-supt__initials { font-size: 20px; }

.hy-supt__badge {
  font-family: 'Space Mono', monospace;
  font-size: 8px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: #C9A84C; margin-bottom: 2px;
}
.hy-supt__name {
  font-size: 11px; font-weight: 700;
  color: var(--accent); line-height: 1.35;
  letter-spacing: 0.01em;
}
.hy-supt__tenure {
  font-family: 'Space Mono', monospace;
  font-size: 9px; color: var(--text-muted);
  margin-top: 2px;
}

/* ─── COLOPHON ───────────────────────────────────────────── */
.hy-colophon {
  margin-top: 32px;
  padding: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.hy-colophon__seal {
  width: 64px; height: 64px; object-fit: contain;
  opacity: 0.7; margin: 0 auto 20px; display: block;
  transition: opacity 200ms;
}
.hy-colophon__seal:hover { opacity: 1; }
.hy-colophon__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 24px; font-weight: 800;
  color: var(--accent); margin-bottom: 12px;
}
.hy-colophon__text {
  font-family: 'Lora', Georgia, serif;
  font-size: 15px; font-style: italic;
  color: var(--text-dim); line-height: 1.8;
  max-width: 520px; margin: 0 auto 20px;
}
.hy-colophon__meta {
  font-family: 'Space Mono', monospace;
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted);
}

/* ─── MOBILE TOC BUTTON ──────────────────────────────────── */
.hy-mob-toc-btn {
  display: none;
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: 30px;
  background: var(--accent); color: #C9A84C;
  border: 1px solid rgba(201,168,76,0.3);
  font-family: 'Space Mono', monospace;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(26,61,43,0.3);
  transition: all 160ms ease;
}
.hy-mob-toc-btn:hover { background: var(--accent-mid); }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .hy-layout { grid-template-columns: 220px 1fr; gap: 32px; }
  .hy-chapter, .hy-supts { padding: 32px; }
}

@media (max-width: 800px) {
  .hy-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "content";
    padding: 24px 16px 60px;
  }
  .hy-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    max-height: 100vh;
    background: var(--surface);
    z-index: 300;
    box-shadow: 4px 0 24px rgba(26,61,43,0.2);
    transform: translateX(-100%);
    transition: transform 300ms cubic-bezier(0.22,1,0.36,1);
    overflow-y: auto;
    border-radius: 0;
    padding: 24px 0;
  }
  .hy-sidebar.mob-open { transform: translateX(0); }
  .hy-sidebar__inner { border-radius: 0; border: none; box-shadow: none; }
  .hy-mob-toc-btn { display: flex; }

  .hy-hero { padding: 72px 20px 60px; }
  .hy-hero__stats { flex-wrap: wrap; }
  .hy-hero__stat { padding: 14px 20px; min-width: 100px; }

  .hy-chapter, .hy-supts { padding: 24px 20px; border-radius: 12px; }
  .hy-supts__grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .hy-supt--current { grid-column: span 1; flex-direction: column; }

  .hy-colophon { padding: 28px 20px; border-radius: 12px; }
}

@media (max-width: 480px) {
  .hy-hero__title { font-size: 36px; }
  .hy-chapter__title { font-size: 24px; }
  .hy-chapter__stamps { flex-direction: column; }
  .hy-stamp { min-width: unset; }
  .hy-supts__grid { grid-template-columns: 1fr 1fr; }
}