﻿/* ===== OTD Design System ===== */

:root {
  --color-deep-navy: #0F1C2E;
  --color-aged-gold: #C9983A;
  --color-crimson: #8B1A1A;
  --color-off-white: #F7F9FB;
  --color-text-primary: #1a1a2e;
  --color-text-muted: #6b7280;
  --color-border: rgba(0,0,0,.08);
  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
  --radius-card: 8px;
  --shadow-card: 0 2px 8px rgba(0,0,0,.08);
  --shadow-hover: 0 6px 20px rgba(0,0,0,.14);
  --transition: all 0.2s ease;
}

/* ?? Dark mode ?????????????????????????????????????????????????????????????? */
.dark-mode {
  --color-off-white: #0d1117;
  --color-text-primary: #e6edf3;
  --color-text-muted: #8b949e;
  --color-border: rgba(255,255,255,.08);
  background-color: #0d1117;
  color: #e6edf3;
  transition: background-color .3s ease, color .3s ease;
}
.dark-mode .card,
.dark-mode .event-card       { background: #161b22; border-color: rgba(255,255,255,.06); }
.dark-mode .person-card      { background: #161b22; border-color: rgba(255,255,255,.08); }
.dark-mode .event-card__footer { border-top-color: rgba(255,255,255,.06); }
.dark-mode .table            { --bs-table-bg: #161b22; --bs-table-striped-bg: #1c2128; color: #e6edf3; }
.dark-mode .list-group-item  { background: #161b22; border-color: rgba(255,255,255,.06); color: #e6edf3; }
.dark-mode .navbar           { border-bottom: 1px solid rgba(255,255,255,.06); }
.dark-mode footer            { background-color: #010409 !important; }
.dark-mode .badge.bg-secondary { background-color: #30363d !important; }
.dark-mode pre, .dark-mode code { background: #1c2128; color: #e6edf3; }
.dark-mode .form-control,
.dark-mode .form-select      { background-color: #1c2128; border-color: #30363d; color: #e6edf3; }
.dark-mode .form-control:focus,
.dark-mode .form-select:focus { background-color: #1c2128; border-color: var(--color-aged-gold); color: #e6edf3; box-shadow: none; }
.dark-mode .comment-body     { background: #1c2128 !important; border-color: #30363d !important; color: #e6edf3; }
.dark-mode .alert-success    { background-color: #0d2818; border-color: #196830; color: #3fb950; }

body {
  font-family: var(--font-body);
  font-size: 1rem; /* explicit 16px baseline */
  background-color: var(--color-off-white);
  color: var(--color-text-primary);
  transition: background-color .3s ease, color .3s ease;
}
h1, h2, h3, .hero__date { font-family: var(--font-display); }

.bg-deep-navy  { background-color: var(--color-deep-navy) !important; }
.text-aged-gold { color: var(--color-aged-gold); }
.btn-aged-gold {
  background-color: var(--color-aged-gold);
  color: #fff;
  border-color: var(--color-aged-gold);
}
.btn-aged-gold:hover { background-color: #b5872f; color: #fff; }

/* ?? Year badge ????????????????????????????????????????????????????????????? */
.year-badge {
  display: inline-block;
  padding: .2em .65em;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 700;
  background-color: var(--badge-color, var(--color-deep-navy));
  color: #fff;
  letter-spacing: .03em;
}
.year-badge--lg { font-size: 1rem; padding: .3em .9em; }

/* ?? Event tabs ????????????????????????????????????????????????????????????? */
.event-tabs { display: flex; flex-wrap: wrap; gap: .5rem; }
.event-tab {
  padding: .35rem .9rem;
  border: 2px solid currentColor;
  border-radius: 20px;
  font-size: .875rem;
  font-weight: 600;
  background: transparent;
  color: var(--tab-color, #555);
  cursor: pointer;
  transition: var(--transition);
  line-height: 1.4;
  text-decoration: none;
}
.event-tab:hover,
.event-tab.active {
  background-color: var(--tab-color, #555);
  color: #fff !important;
  border-color: var(--tab-color, #555);
}

/* ?? Event grid ????????????????????????????????????????????????????????????? */
.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.event-grid__empty { grid-column: 1 / -1; text-align: center; padding: 3rem 0; }

/* ?? Event card ????????????????????????????????????????????????????????????? */
.event-card {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: var(--transition);
  height: 100%;
}
.event-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.event-card__image-link { display: block; overflow: hidden; aspect-ratio: 3/2; }
.event-card__image { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.event-card__image-link:hover .event-card__image { transform: scale(1.04); }
.event-card__body { padding: 1rem; flex: 1; }
.event-card__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: .4rem 0 .5rem;
  line-height: 1.35;
  font-weight: 800;
}
.event-card__title a { color: var(--color-text-primary); text-decoration: none; }
.event-card__title a:hover { color: var(--color-aged-gold); }
.event-card__description {
  font-size: .9375rem;
  color: var(--color-text-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.event-card__footer {
  padding: .75rem 1rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: .75rem;
}

/* ?? Engagement ????????????????????????????????????????????????????????????? */
.btn-like, .btn-comments {
  background: none;
  border: none;
  font-size: .875rem;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 0;
  transition: color .2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.btn-like:hover  { color: var(--color-crimson); }
.btn-like.liked  { color: var(--color-crimson); }
.btn-comments:hover { color: var(--color-aged-gold); }
.btn-bookmark { background: none; border: none; font-size: .875rem; color: var(--color-text-muted); cursor: pointer; padding: 0; transition: color .2s; }
.btn-bookmark:hover, .btn-bookmark.bookmarked { color: var(--color-aged-gold); }
.btn-read-more { font-size: .8125rem; color: var(--color-aged-gold); text-decoration: none; font-weight: 600; }
.btn-read-more:hover { text-decoration: underline; }

/* ?? Person card ???????????????????????????????????????????????????????????? */
.person-card {
  display: flex;
  gap: 1rem;
  padding: .75rem;
  background: var(--color-off-white);
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
  transition: var(--transition);
}
.person-card:hover { box-shadow: var(--shadow-card); }
.person-card__avatar { width: 64px; height: 64px; object-fit: cover; border-radius: 50%; flex-shrink: 0; }
.person-card__name a { color: var(--color-text-primary); text-decoration: none; font-size: 1rem; }
.person-card__name a:hover { color: var(--color-aged-gold); }

/* ?? Event detail ??????????????????????????????????????????????????????????? */
.event-detail__image { max-height: 480px; width: 100%; object-fit: cover; border-radius: var(--radius-card); }
.event-detail__title { font-size: 2rem; line-height: 1.25; }
@media (max-width: 576px) { .event-detail__title { font-size: 1.5rem; } }

/* ─── Redesigned Event Detail ──────────────────────────────────────────────── */

/* Hero image + optional thumbnail strip */
.ed-hero {
  margin-bottom: 1.5rem;
}
.ed-hero__main {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: #000;
  line-height: 0;
}
.ed-hero__img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: var(--radius-card);
  transition: opacity .25s ease;
}
.ed-hero__caption {
  padding: .45rem .75rem;
  font-size: .78rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem;
}
.ed-hero__orig-link {
  color: var(--color-text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .2rem;
}
.ed-hero__orig-link:hover { color: var(--color-aged-gold); }

/* Thumbnail strip */
.ed-hero__thumbs {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: .5rem;
}
.ed-hero__thumb {
  border: 2px solid transparent;
  border-radius: 4px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s, opacity .15s;
  opacity: .65;
  flex-shrink: 0;
  background: none;
}
.ed-hero__thumb img {
  display: block;
  width: 80px;
  height: 60px;
  object-fit: cover;
}
.ed-hero__thumb:hover { opacity: 1; }
.ed-hero__thumb.active {
  border-color: var(--color-aged-gold);
  opacity: 1;
}
.ed-hero__gallery-count {
  font-size: .78rem;
}

/* Main two-column content grid */
.ed-content-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
  margin-bottom: 2.5rem;
}
@media (max-width: 991px) {
  .ed-content-grid {
    grid-template-columns: 1fr;
  }
  .ed-sidebar {
    order: -1;
  }
}

/* Article header */
.ed-title {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.2;
  margin-bottom: .5rem;
  color: var(--color-text-primary);
}
@media (max-width: 576px) { .ed-title { font-size: 1.5rem; } }
.ed-lead {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--color-text-primary);
  margin-bottom: 0;
}

/* Event type badge */
.ed-type-badge {
  background-color: color-mix(in srgb, var(--type-color, #555) 15%, transparent);
  color: var(--type-color, #555) !important;
  border: 1px solid color-mix(in srgb, var(--type-color, #555) 35%, transparent);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
}

/* Extract / Wikipedia body */
.ed-extract {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--color-text-primary);
}
.ed-extract p { margin-bottom: 1rem; }
.ed-extract h2,
.ed-extract h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: .5rem;
  color: var(--color-text-primary);
}
.ed-extract a { color: var(--color-aged-gold); }
.ed-extract a:hover { text-decoration: underline; }
.ed-extract ul,
.ed-extract ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.ed-extract li { margin-bottom: .3rem; }

/* Tags */
.ed-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
}
.ed-tag {
  display: inline-block;
  padding: .2em .7em;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  background: rgba(0,0,0,.05);
  color: var(--color-text-muted);
  text-decoration: none;
  border: 1px solid var(--color-border);
  transition: background .15s, color .15s;
}
.ed-tag:hover {
  background: var(--color-aged-gold);
  color: #fff;
  border-color: var(--color-aged-gold);
}

/* External links */
.ed-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.ed-link-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .9rem;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--color-border);
  color: var(--color-text-primary);
  background: var(--color-off-white);
  transition: var(--transition);
}
.ed-link-btn:hover {
  background: var(--color-deep-navy);
  color: #fff;
  border-color: var(--color-deep-navy);
}
.ed-link-btn--wiki:hover {
  background: #3366cc;
  border-color: #3366cc;
  color: #fff;
}
.ed-link-btn--muted {
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Sidebar info card */
.ed-sidebar {
  position: sticky;
  top: 1rem;
}
.ed-info-card {
  background: var(--color-off-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.ed-info-card__heading {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-text-muted);
  margin: 0;
  padding: .6rem .9rem;
  background: rgba(0,0,0,.03);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
}
.ed-info-card__list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.ed-info-card__row {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  padding: .45rem .9rem;
  border-bottom: 1px solid var(--color-border);
  font-size: .85rem;
}
.ed-info-card__row:last-child { border-bottom: none; }
.ed-info-card__row dt {
  flex: 0 0 90px;
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.ed-info-card__row dd {
  margin: 0;
  color: var(--color-text-primary);
  flex: 1;
  word-break: break-word;
}

/* Engagement mini-card */
.ed-info-card--engage .ed-engage-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: .65rem .5rem;
  font-size: .85rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

/* Section headers */
.ed-section { margin-bottom: 2.5rem; }
.ed-section__heading {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 1.1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid rgba(201,152,58,.2);
  display: flex;
  align-items: center;
}

/* People grid */
.ed-people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: .85rem;
}

/* Map */
.ed-map {
  height: 300px;
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

/* ── Dark mode overrides ──────────────────────────────────────────────────── */
.dark-mode .ed-info-card {
  background: #161b22;
  border-color: rgba(255,255,255,.08);
}
.dark-mode .ed-info-card__heading {
  background: rgba(255,255,255,.04);
  border-color: rgba(255,255,255,.08);
  color: #8b949e;
}
.dark-mode .ed-info-card__row {
  border-color: rgba(255,255,255,.06);
}
.dark-mode .ed-info-card__row dd { color: #e6edf3; }
.dark-mode .ed-info-card__row dt { color: #8b949e; }
.dark-mode .ed-tag {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.08);
  color: #8b949e;
}
.dark-mode .ed-tag:hover { background: var(--color-aged-gold); color: #fff; border-color: var(--color-aged-gold); }
.dark-mode .ed-link-btn {
  background: #161b22;
  border-color: rgba(255,255,255,.1);
  color: #e6edf3;
}
.dark-mode .ed-link-btn:hover { background: var(--color-aged-gold); border-color: var(--color-aged-gold); color: #fff; }
.dark-mode .ed-title,
.dark-mode .ed-lead,
.dark-mode .ed-extract { color: #e6edf3; }
.dark-mode .ed-extract h2,
.dark-mode .ed-extract h3 { color: #e6edf3; }
.dark-mode .ed-section__heading { color: #e6edf3; border-color: rgba(201,152,58,.25); }
.dark-mode .ed-hero__thumb { border-color: transparent; }
.dark-mode .ed-hero__thumb.active { border-color: var(--color-aged-gold); }

/* ?? Hero ??????????????????????????????????????????????????????????????????? */
.hero {
  /* Dark navy base so the SVG pattern and gradient sit on a solid foundation  */
  background-color: var(--color-deep-navy);
  /*
   * Layer 1 (top)  – directional gradient: keeps the left edge darkest for
   *                  maximum text contrast, warms toward the bottom-right.
   * Layer 2 (bottom) – tiling SVG cartographic grid pattern.
   */
  background-image:
    linear-gradient(
      135deg,
      rgba(15,28,46,.92)  0%,
      rgba(15,28,46,.80) 50%,
      rgba(80,46,6,.72)  100%
    ),
    url("/images/hero-pattern.svg");
  background-size: auto, 120px 120px;
  background-repeat: no-repeat, repeat;
  /* Inner shadow gives a subtle vignette — vintage document feel */
  box-shadow: inset 0 0 90px rgba(0,0,0,.35);
  border-radius: var(--radius-card);
  padding: 1.75rem 2rem;
  border-bottom: 2px solid rgba(201,152,58,.45);
  margin-bottom: 1.5rem;
}

/* ── Hero text — all light against the dark background ──────────────────── */
/* Contrast ratios on #0F1C2E base:
   #ffffff          → 16.2 : 1  ✅ (WCAG AAA)
   rgba(255,255,255,.65) → ≈ 7.8 : 1  ✅ (WCAG AA)
   #e8b84d (gold)   →  5.1 : 1  ✅ (WCAG AA)               */
/* All heading levels inside .hero are white regardless of Bootstrap class overrides */
.hero h1, .hero h2, .hero h3 { color: #fff; }
.hero__date { color: #fff; }
.hero__sub  { color: rgba(255,255,255,.7) !important; }
/* Override Bootstrap/utility .text-muted inside the hero */
.hero .text-muted { color: rgba(255,255,255,.6) !important; }
.hero__inner { display: flex; align-items: flex-start; gap: 1.1rem; }
.hero__icon  { flex-shrink: 0; color: var(--color-aged-gold); margin-top: .25rem; }
.hero__date  { font-family: var(--font-display); font-size: clamp(1.75rem, 5vw, 3rem); font-weight: 700; line-height: 1.1; }
.hero__sub   { font-size: 1rem; }
.hero__stat-pills { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; }
.hero__stat-pill {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .25em .8em; border-radius: 20px;
  font-size: .82rem; font-weight: 600;
  /* Slightly more opaque on the dark background so the pill reads clearly */
  background: rgba(201,152,58,.18);
  color: #e8b84d;
  border: 1px solid rgba(201,152,58,.5);
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.hero__stat-pill:hover { background: rgba(201,152,58,.32); color: #f0c96a; border-color: rgba(201,152,58,.7); }
.hero__stat-pill--link { opacity: .8; }

/* Dark mode — deepen the base slightly; the pattern and colours stay the same */
.dark-mode .hero {
  background-color: #040b16;
  background-image:
    linear-gradient(
      135deg,
      rgba(4,11,22,.94)  0%,
      rgba(4,11,22,.84) 50%,
      rgba(60,34,4,.76) 100%
    ),
    url("/images/hero-pattern.svg");
  border-color: rgba(201,152,58,.38);
  box-shadow: inset 0 0 90px rgba(0,0,0,.5);
}

/* ?? Birthday tool ?????????????????????????????????????????????????????????? */
.birthday-hero {
  background: linear-gradient(135deg, var(--color-deep-navy), #1e3a5f);
  color: #fff;
  border-radius: var(--radius-card);
  padding: 2.5rem;
}

/* ?? Chart container ???????????????????????????????????????????????????????? */
.chart-container { position: relative; height: 280px; }

/* ?? Timeline strip (year page) ????????????????????????????????????????????? */
.century-nav { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1rem; }
.century-btn {
  padding: .25rem .6rem;
  font-size: .8rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.century-btn:hover, .century-btn.active { background: var(--color-deep-navy); color: #fff; border-color: var(--color-deep-navy); }
.dark-mode .century-btn { border-color: rgba(255,255,255,.15); }
.dark-mode .century-btn:hover, .dark-mode .century-btn.active { background: var(--color-aged-gold); border-color: var(--color-aged-gold); }

/* ?? HTMX indicator ????????????????????????????????????????????????????????? */
.htmx-indicator { opacity: 0; transition: opacity 200ms ease-in; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { opacity: 1; }

/* ?? Lazy-load blur-up ?????????????????????????????????????????????????????? */
.lazyload, .lazyloading { opacity: 0; transition: opacity .3s; }
.lazyloaded { opacity: 1; }

/* ?? Preload fade-in ???????????????????????????????????????????????????????? */
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn .4s ease forwards; }

/* ?? Search autocomplete ???????????????????????????????????????????????????? */
.search-autocomplete {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  box-shadow: var(--shadow-hover);
  z-index: 1000;
  max-height: 320px;
  overflow-y: auto;
}
.dark-mode .search-autocomplete { background: #161b22; border-color: #30363d; }
.search-autocomplete-item {
  padding: .5rem .85rem;
  font-size: .9375rem;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-primary);
}
.search-autocomplete-item:last-child { border-bottom: none; }
.search-autocomplete-item:hover, .search-autocomplete-item.focused { background: rgba(201,152,58,.1); color: var(--color-aged-gold); }

/* ?? Pagination ????????????????????????????????????????????????????????????? */
.pagination-wrapper { margin-top: 2rem; display: flex; justify-content: center; }

/* ?? Site footer ??????????????????????????????????????????????????????????? */
.site-footer { border-top: 1px solid rgba(255,255,255,.08); }
.site-footer__top { border-bottom: 1px solid rgba(255,255,255,.08); }
.site-footer__brand { font-family: var(--font-display); font-size: 1.25rem; }
.site-footer__tagline { line-height: 1.6; }
.site-footer__heading {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-aged-gold);
  margin-bottom: .75rem;
}
.site-footer__links li { margin-bottom: .4rem; }
.site-footer__links a {
  font-size: .875rem;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  transition: color .2s;
}
.site-footer__links a:hover { color: var(--color-aged-gold); }
.site-footer__bottom { border-top: 1px solid rgba(255,255,255,.06); }
.dark-mode .site-footer { background-color: #010409 !important; }

/* ???????????????????????????????????????????????????????????????
   Admin Panel Layout
   ??????????????????????????????????????????????????????????????? */

:root {
  --admin-sidebar-width: 220px;
  --admin-topbar-height: 52px;
  --admin-sidebar-bg: #0F1C2E;
  --admin-sidebar-hover: rgba(201,152,58,.12);
  --admin-sidebar-active: rgba(201,152,58,.2);
  --admin-sidebar-active-border: var(--color-aged-gold);
  --admin-main-bg: #f0f4f8;
}

body.admin-layout {
  background: var(--admin-main-bg);
  font-family: var(--font-body);
}

/* Top bar */
.admin-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--admin-topbar-height);
  background: var(--admin-sidebar-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 1040;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

/* Shell */
.admin-shell {
  display: flex;
  padding-top: var(--admin-topbar-height);
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: var(--admin-sidebar-width);
  background: var(--admin-sidebar-bg);
  position: fixed;
  top: var(--admin-topbar-height);
  bottom: 0;
  left: 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width .22s ease;
  z-index: 1030;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
}
.admin-sidebar.collapsed {
  width: 56px;
}
.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

/* Sidebar nav */
.admin-nav {
  padding: 1rem 0 2rem;
}
.admin-nav-section {
  margin-bottom: .25rem;
}
.admin-nav-label {
  display: block;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  padding: .85rem 1rem .3rem;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity .18s;
}
.admin-sidebar.collapsed .admin-nav-label { opacity: 0; }
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .55rem 1rem;
  font-size: .875rem;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
  overflow: hidden;
}
.admin-nav-link:hover {
  background: var(--admin-sidebar-hover);
  color: #fff;
  text-decoration: none;
}
.admin-nav-link.active {
  background: var(--admin-sidebar-active);
  color: var(--color-aged-gold);
  border-left-color: var(--admin-sidebar-active-border);
  font-weight: 600;
}
.admin-nav-link svg { flex-shrink: 0; }
.admin-sidebar.collapsed .admin-nav-link span,
.admin-sidebar.collapsed .admin-nav-link .admin-badge-danger { display: none; }

/* Pending badge in sidebar */
.admin-badge-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: .68rem;
  font-weight: 700;
  border-radius: 9px;
  background: #dc3545;
  color: #fff;
  margin-left: auto;
}

/* Main content area */
.admin-main {
  margin-left: var(--admin-sidebar-width);
  padding: 1.75rem 2rem;
  flex: 1;
  min-width: 0;
  transition: margin-left .22s ease;
}
.admin-main.sidebar-collapsed {
  margin-left: 56px;
}
@media (max-width: 767px) {
  .admin-sidebar { width: 56px; }
  .admin-main { margin-left: 56px; padding: 1.25rem 1rem; }
  .admin-sidebar .admin-nav-label { opacity: 0; }
}

/* ?? Extra-small button (admin action columns) ????????????????? */
.btn-xs {
  padding: .18rem .45rem;
  font-size: .72rem;
  line-height: 1.4;
  border-radius: 4px;
}

/* ?? Admin page header ????????????????????????????????????????? */
.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: .75rem;
}
.admin-page-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
  color: var(--color-text-primary);
  font-family: var(--font-display);
}
.admin-breadcrumb {
  font-size: .8rem;
  color: var(--color-text-muted);
  margin-top: .15rem;
}
.admin-section-label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: .5rem;
}

/* ?? Admin stat cards ?????????????????????????????????????????? */
.admin-stat-card {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
}
.admin-stat-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.admin-stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
}
.admin-stat-icon--blue   { background: #e8f0fe; color: #3b6fe0; }
.admin-stat-icon--green  { background: #e6f4ea; color: #2e7d32; }
.admin-stat-icon--amber  { background: #fff8e1; color: #f59e0b; }
.admin-stat-icon--red    { background: #fce8e8; color: #c62828; }
.admin-stat-icon--purple { background: #f3e8fd; color: #7b1fa2; }
.admin-stat-icon--teal   { background: #e0f7fa; color: #00796b; }
.admin-stat-icon--muted  { background: #f1f3f4; color: #9ca3af; }
.admin-stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-text-primary);
}
.admin-stat-label {
  font-size: .78rem;
  color: var(--color-text-muted);
  margin-top: .1rem;
}
.admin-stat-card--danger .admin-stat-value { color: #c62828; }

/* ?? Admin table ??????????????????????????????????????????????? */
.admin-card {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.admin-card-header {
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.admin-card-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin: 0;
}
.admin-table {
  width: 100%;
  font-size: .875rem;
  border-collapse: collapse;
}
.admin-table th {
  padding: .6rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--color-border);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-text-muted);
  white-space: nowrap;
}
.admin-table td {
  padding: .7rem 1rem;
  border-bottom: 1px solid rgba(0,0,0,.04);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(201,152,58,.04); }
.admin-table tr.row-danger td { background: #fff5f5; }

/* ?? Status badges ????????????????????????????????????????????? */
.status-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2em .6em;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.status-badge--success  { background: #e6f4ea; color: #2e7d32; }
.status-badge--danger   { background: #fce8e8; color: #c62828; }
.status-badge--warning  { background: #fff8e1; color: #b45309; }
.status-badge--info     { background: #e3f2fd; color: #1565c0; }
.status-badge--muted    { background: #f1f3f4; color: #666; }

/* ?? Quick action grid ????????????????????????????????????????? */
.admin-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .75rem;
}
.admin-quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 1rem;
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: .8rem;
  font-weight: 600;
  transition: var(--transition);
  border: 1px solid transparent;
}
.admin-quick-action:hover {
  color: var(--color-aged-gold);
  border-color: var(--color-aged-gold);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.admin-quick-action svg { color: var(--color-aged-gold); }

/* ?? Moderation comment card ??????????????????????????????????? */
.mod-comment-card {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1rem 1.25rem;
  margin-bottom: .75rem;
  border-left: 4px solid transparent;
}
.mod-comment-card--pending { border-left-color: #f59e0b; }
.mod-comment-card--approved { border-left-color: #2e7d32; }
.mod-comment-body {
  background: #f8fafc;
  border-radius: 4px;
  padding: .6rem .85rem;
  font-size: .875rem;
  line-height: 1.6;
  margin: .65rem 0;
  border: 1px solid var(--color-border);
}

/* ?? User management ??????????????????????????????????????????? */
.user-avatar-initials {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--color-deep-navy);
  color: var(--color-aged-gold);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; flex-shrink: 0;
  text-transform: uppercase;
}
.user-avatar-initials--banned { background: #c62828; color: #fff; }

/* ?? Admin event row (dashboard list) ?????????????????????????? */
.admin-event-row {
  border-bottom: 1px solid var(--color-border);
  transition: background .12s;
}
.admin-event-row:last-child { border-bottom: none; }
.admin-event-row:hover { background: rgba(201,152,58,.04); }

/* ?? Content enrichment tier badges ??????????????????????????????????????? */
.admin-content-tier {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: .18em .55em;
  border-radius: 20px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
  flex-shrink: 0;
}
.admin-content-tier--admin     { background: #e6f4ea; color: #2e7d32; }
.admin-content-tier--ai        { background: #e3f2fd; color: #1565c0; }
.admin-content-tier--wikipedia { background: #fff8e1; color: #b45309; }
.admin-content-tier--extract   { background: #f1f3f4; color: #666; }

/* ?? Form search bar ??????????????????????????????????????????? */
.admin-search-bar {
  display: flex;
  gap: .5rem;
  align-items: center;
}
.admin-search-bar .form-control {
  max-width: 260px;
}

/* ?? Dark mode adjustments for admin ?????????????????????????? */
.dark-mode.admin-layout { background: #0d1117; }
.dark-mode .admin-stat-card,
.dark-mode .admin-card,
.dark-mode .admin-quick-action,
.dark-mode .mod-comment-card { background: #161b22; border-color: rgba(255,255,255,.06); color: #e6edf3; }
.dark-mode .admin-table th  { background: #1c2128; color: #8b949e; border-color: rgba(255,255,255,.06); }
.dark-mode .admin-table td  { border-color: rgba(255,255,255,.04); }
.dark-mode .admin-table tr:hover td { background: rgba(201,152,58,.06); }
.dark-mode .admin-table tr.row-danger td { background: #2a0e0e; }
.dark-mode .admin-card-header { border-color: rgba(255,255,255,.06); }
.dark-mode .admin-page-header h1 { color: #e6edf3; }
.dark-mode .admin-stat-value { color: #e6edf3; }
.dark-mode .admin-main { background: #0d1117; }
.dark-mode .mod-comment-body { background: #1c2128; border-color: #30363d; color: #e6edf3; }
.dark-mode .status-badge--muted { background: #30363d; color: #8b949e; }
.dark-mode .user-avatar-initials { background: #1c2128; }

/* ── Admin Login Page ────────────────────────────────────────────────────── */

body.admin-login-body {
  min-height: 100vh;
  background: linear-gradient(145deg, #0F1C2E 0%, #1a2e46 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  padding: 1rem;
}

.admin-login-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-login-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}

.admin-login-header {
  background: var(--admin-sidebar-bg, #0F1C2E);
  padding: 2rem 2rem 1.5rem;
  text-align: center;
}

.admin-login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  background: rgba(201,152,58,.15);
  border-radius: 12px;
  margin-bottom: .75rem;
  border: 1px solid rgba(201,152,58,.3);
}

.admin-login-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 .25rem;
  font-family: var(--font-display);
}

.admin-login-subtitle {
  font-size: .8rem;
  color: rgba(255,255,255,.5);
  margin: 0;
}

.admin-login-form {
  padding: 1.75rem 2rem 1.25rem;
}

.admin-login-error {
  background: #fce8e8;
  border: 1px solid #f5c6cb;
  border-radius: 6px;
  padding: .65rem .85rem;
  font-size: .875rem;
  color: #c62828;
  margin-bottom: 1rem;
}
.admin-login-error:empty { display: none; }

.admin-login-btn {
  font-weight: 600;
  padding: .65rem;
  font-size: .95rem;
  letter-spacing: .01em;
}

.admin-login-footer {
  padding: .85rem 2rem 1.25rem;
  text-align: center;
  border-top: 1px solid var(--color-border);
}

/* ═══════════════════════════════════════════════════════════════════════════
   User Panel Layout
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --up-sidebar-width: 230px;
  --up-topbar-height: 52px;
  --up-sidebar-bg: #0F1C2E;
  --up-bg: #f4f6f9;
}

body.up-body {
  background: var(--up-bg);
  font-family: var(--font-body);
  min-height: 100vh;
}

/* ── Top bar ──────────────────────────────────────────────────────────────── */
.up-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--up-topbar-height);
  background: var(--up-sidebar-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 1040;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.up-topbar-brand {
  font-size: 1.1rem;
  text-decoration: none;
  font-family: var(--font-display);
  white-space: nowrap;
}

/* ── Shell ────────────────────────────────────────────────────────────────── */
.up-shell {
  display: flex;
  padding-top: var(--up-topbar-height);
  min-height: 100vh;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.up-sidebar {
  width: var(--up-sidebar-width);
  background: var(--up-sidebar-bg);
  position: fixed;
  top: var(--up-topbar-height);
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1030;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
  transition: transform .24s ease;
}
.up-sidebar::-webkit-scrollbar { width: 4px; }
.up-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

/* ── User block ───────────────────────────────────────────────────────────── */
.up-user-block {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.up-user-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--color-aged-gold);
  color: #fff;
  font-size: .85rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.up-user-name {
  font-size: .9rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.up-user-role {
  font-size: .72rem;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ── Nav ──────────────────────────────────────────────────────────────────── */
.up-nav { padding: .75rem 0 1rem; flex: 1; }
.up-nav-section { margin-bottom: .25rem; }
.up-nav-label {
  display: block;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.28);
  padding: .7rem 1rem .2rem;
}
.up-nav-link {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .5rem 1rem;
  font-size: .875rem;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background .14s, color .14s, border-color .14s;
}
.up-nav-link:hover {
  background: rgba(201,152,58,.1);
  color: #fff;
  text-decoration: none;
}
.up-nav-link.active {
  background: rgba(201,152,58,.18);
  color: var(--color-aged-gold);
  border-left-color: var(--color-aged-gold);
  font-weight: 600;
}
.up-nav-link svg { flex-shrink: 0; }

/* ── Sign-out ─────────────────────────────────────────────────────────────── */
.up-sidebar-footer {
  padding: .75rem 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,.06);
}
.up-signout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem .75rem;
  font-size: .85rem;
  color: rgba(255,255,255,.5);
  background: none;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.up-signout-btn:hover { background: rgba(255,255,255,.06); color: #fff; }

/* ── Main content ─────────────────────────────────────────────────────────── */
.up-main {
  margin-left: var(--up-sidebar-width);
  padding: 2rem 2.25rem;
  flex: 1;
  min-width: 0;
}

/* ── Mobile ───────────────────────────────────────────────────────────────── */
@media (max-width: 991px) {
  .up-sidebar {
    transform: translateX(-100%);
  }
  .up-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.35);
  }
  .up-main {
    margin-left: 0;
    padding: 1.25rem 1rem;
  }
}

/* ── Page header ──────────────────────────────────────────────────────────── */
.up-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: .75rem;
}
.up-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  font-family: var(--font-display);
  color: var(--color-text-primary);
}
.up-page-subtitle {
  font-size: .85rem;
  color: var(--color-text-muted);
  margin: .2rem 0 0;
}

/* ── Stat row ─────────────────────────────────────────────────────────────── */
.up-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.up-stat-card {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
}
.up-stat-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.up-stat-card--accent { border-left: 3px solid var(--color-aged-gold); }
.up-stat-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.up-stat-icon--gold   { background: #fff8e1; color: var(--color-aged-gold); }
.up-stat-icon--blue   { background: #e8f0fe; color: #3b6fe0; }
.up-stat-icon--red    { background: #fce8e8; color: #c62828; }
.up-stat-icon--green  { background: #e6f4ea; color: #2e7d32; }
.up-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--color-text-primary);
}
.up-stat-label {
  font-size: .78rem;
  color: var(--color-text-muted);
  margin-top: .1rem;
}

/* ── Cards ────────────────────────────────────────────────────────────────── */
.up-card {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.up-card-header {
  padding: .85rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.up-card-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  gap: .4rem;
}

/* ── Notifications ────────────────────────────────────────────────────────── */
.up-notification-list { padding: .25rem 0; }
.up-notification {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: .75rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  transition: background .12s;
}
.up-notification:last-child { border-bottom: none; }
.up-notification:hover { background: rgba(201,152,58,.03); }
.up-notification--unread { background: rgba(59,110,224,.03); }
.up-notification-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-text-muted);
  margin-top: .35rem;
  flex-shrink: 0;
}
.up-notification--unread .up-notification-dot { background: #3b6fe0; }
.up-notification-body { flex: 1; font-size: .875rem; }
.up-notification-msg { color: var(--color-text-primary); }
.up-notification-time { font-size: .78rem; color: var(--color-text-muted); white-space: nowrap; }
.up-notification-icon { display: flex; align-items: center; flex-shrink: 0; width: 22px; color: var(--color-text-muted); }

/* ── Navbar notification bell badge ──────────────────────────────────────── */
.notif-bell { position: relative; }
.notif-badge {
    position: absolute;
    top: -4px; right: -4px;
    min-width: 18px; height: 18px;
    padding: 0 4px;
    border-radius: 9px;
    background: #dc3545;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    pointer-events: none;
}

/* ── Section header ───────────────────────────────────────────────────────── */
.up-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.up-section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  font-family: var(--font-display);
}
.up-section-link {
  font-size: .85rem;
  color: var(--color-aged-gold);
  text-decoration: none;
  font-weight: 600;
}
.up-section-link:hover { text-decoration: underline; }

/* ── Comment rows ─────────────────────────────────────────────────────────── */
.up-comment-row {
  padding: .9rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}
.up-comment-row:last-child { border-bottom: none; }
.up-comment-row-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .4rem;
}
.up-comment-row-event {
  font-size: .875rem;
  font-weight: 600;
  color: var(--color-aged-gold);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.up-comment-row-event:hover { text-decoration: underline; }
.up-comment-row-date { font-size: .78rem; color: var(--color-text-muted); white-space: nowrap; }
.up-comment-row-body {
  font-size: .875rem;
  line-height: 1.6;
  color: var(--color-text-primary);
}
.up-comment-row-body p:last-child { margin-bottom: 0; }

/* ── Event-page threaded comments ────────────────────────────────────────── */
.comment { padding: .75rem 0; }
.comment-body { font-size: .9375rem; line-height: 1.7; }
.comment-body p:last-child { margin-bottom: 0; }
.comment--reply { border-left-color: var(--color-aged-gold) !important; opacity: .96; }
.comment-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--color-aged-gold); color: #fff;
    font-size: .65rem; font-weight: 700; flex-shrink: 0;
}
.comment-vote-btn { font-size: .8rem; }
.comment-vote-btn--active { color: var(--bs-primary) !important; }
.comment-vote-wrap { line-height: 1; }
.comment-top-badge {
    background: rgba(201,152,58,.15);
    color: var(--color-aged-gold);
    border: 1px solid rgba(201,152,58,.35);
    font-size: .68rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
}
.dark-mode .comment-top-badge { background: rgba(201,152,58,.1); }
.comment-actions { flex-wrap: wrap; }
.reply-form-wrap .comment-form { background: var(--bs-tertiary-bg, #f8f9fa); border-radius: 6px; padding: .75rem; }
.dark-mode .reply-form-wrap .comment-form { background: #161b22; }

/* ── Bookmark meta ────────────────────────────────────────────────────────── */
.up-bookmark-wrap { display: flex; flex-direction: column; }
.up-bookmark-meta {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
  color: var(--color-text-muted);
  padding: .35rem .5rem 0;
}
.up-bookmark-note { color: var(--color-aged-gold); }

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.up-alert {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .75rem 1rem;
  border-radius: 6px;
  font-size: .875rem;
}
.up-alert--success { background: #e6f4ea; color: #2e7d32; border: 1px solid #c3e6cb; }
.up-alert--danger  { background: #fce8e8; color: #c62828; border: 1px solid #f5c6cb; }
.up-alert:empty { display: none; }

/* ── Empty states ─────────────────────────────────────────────────────────── */
.up-empty-state {
  text-align: center;
  padding: 4rem 2rem;
}
.up-empty-icon { font-size: 3rem; margin-bottom: 1rem; display:flex; align-items:center; justify-content:center; }
.up-empty-icon svg { width:3rem; height:3rem; opacity:.4; color:var(--color-text-muted); }
.up-empty-state h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: .5rem;
  font-family: var(--font-display);
}
.up-empty-state p { color: var(--color-text-muted); margin-bottom: 1.5rem; }

/* ── Profile fields ───────────────────────────────────────────────────────── */
.up-field-label {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-text-muted);
  display: block;
}
.up-field-value {
  font-size: 1rem;
  color: var(--color-text-primary);
  font-weight: 500;
  padding: .3rem 0;
}
.up-field-hint { font-size: .78rem; color: var(--color-text-muted); margin: .2rem 0 0; }

.up-stat-row {
  display: flex;
  align-items: center;
  gap: .85rem;
}
.up-stat-row-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* ── Dark mode ────────────────────────────────────────────────────────────── */
.dark-mode body.up-body,
body.up-body.dark-mode { background: #0d1117; }
.dark-mode .up-stat-card,
.dark-mode .up-card { background: #161b22; border-color: rgba(255,255,255,.06); }
.dark-mode .up-stat-value,
.dark-mode .up-page-title { color: #e6edf3; }
.dark-mode .up-card-header { border-color: rgba(255,255,255,.06); }
.dark-mode .up-notification { border-color: rgba(255,255,255,.06); }
.dark-mode .up-notification:hover { background: rgba(201,152,58,.04); }
.dark-mode .up-comment-row { border-color: rgba(255,255,255,.06); }
.dark-mode .up-alert--success { background: #0d2818; border-color: #196830; color: #3fb950; }
.dark-mode .up-field-value { color: #e6edf3; }
.dark-mode .up-signout-btn { color: rgba(255,255,255,.4); border-color: rgba(255,255,255,.08); }

/* ═══════════════════════════════════════════════════════════════════════════
   Auth Split (Login / Register)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Override the public layout's container padding for auth pages */
.auth-split {
  display: flex;
  min-height: calc(100vh - 56px);  /* minus navbar */
  margin: -1.5rem -12px;           /* bleed to container edges */
}

/* Left branding panel */
.auth-split__brand {
  flex: 0 0 42%;
  background: linear-gradient(160deg, #0F1C2E 0%, #1a3050 100%);
  padding: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-brand-content { max-width: 380px; }
.auth-brand-logo {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  margin-bottom: 2.5rem;
}
.auth-brand-quote {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: rgba(255,255,255,.85);
  font-style: italic;
  border-left: 3px solid var(--color-aged-gold);
  padding-left: 1.1rem;
  margin: 0 0 2.5rem;
  line-height: 1.6;
}
.auth-brand-quote cite {
  display: block;
  font-size: .85rem;
  color: rgba(255,255,255,.5);
  font-style: normal;
  margin-top: .5rem;
}
.auth-brand-tagline {
  color: rgba(255,255,255,.7);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 2.5rem;
}
.auth-brand-features { display: flex; flex-direction: column; gap: .9rem; }
.auth-brand-feature {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: rgba(255,255,255,.7);
  font-size: .9rem;
}
.auth-brand-feature svg { color: var(--color-aged-gold); flex-shrink: 0; }

/* Right form panel */
.auth-split__form {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  background: #fff;
}
.auth-form-wrap { width: 100%; max-width: 400px; }
.auth-form-header { margin-bottom: 2rem; }
.auth-form-title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin: 0 0 .3rem;
}
.auth-form-subtitle { font-size: .9rem; color: var(--color-text-muted); }
.auth-submit-btn { padding: .7rem; font-size: 1rem; font-weight: 600; }
.auth-form-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: .9rem;
  color: var(--color-text-muted);
}
.auth-form-terms {
  text-align: center;
  font-size: .78rem;
  color: var(--color-text-muted);
  margin-top: 1rem;
}

/* Mobile: stack vertically */
@media (max-width: 991px) {
  .auth-split { flex-direction: column; min-height: auto; margin: -1.5rem -12px 0; }
  .auth-split__brand { display: none !important; }
  .auth-split__form { padding: 2.5rem 1.25rem; min-height: calc(100vh - 56px); }
}
.dark-mode .auth-split__form { background: #161b22; }
.dark-mode .auth-form-title  { color: #e6edf3; }


/* ═══════════════════════════════════════════════════════════════════════════
   Social Sharing — engagement bar share buttons
   ═══════════════════════════════════════════════════════════════════════════ */

.share-btn-group { flex-shrink: 0; }

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: var(--color-off-white);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
  cursor: pointer;
  padding: 0;
  position: relative;
  flex-shrink: 0;
}
.share-btn:hover { color: #fff; border-color: transparent; }
.share-btn--twitter:hover  { background: #000; }
.share-btn--facebook:hover { background: #1877f2; }
.share-btn--linkedin:hover { background: #0a66c2; }
.share-btn--copy:hover     { background: var(--color-deep-navy); }
.share-btn--image          { color: var(--color-aged-gold); border-color: var(--color-aged-gold); text-decoration: none; }
.share-btn--image:hover    { background: var(--color-aged-gold); color: #fff; }

/* "Copied!" tooltip */
.share-btn__copied-msg {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  color: #fff;
  font-size: .72rem;
  font-weight: 600;
  padding: .2em .55em;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
}
.share-btn--copy.copied .share-btn__copied-msg { display: block; }
.share-btn--copy.copied { background: #2e7d32; border-color: #2e7d32; color: #fff; }

/* Dark mode */
.dark-mode .share-btn {
  background: #161b22;
  border-color: rgba(255,255,255,.1);
  color: #8b949e;
}
.dark-mode .share-btn:hover { color: #fff; border-color: transparent; }

/* ═══════════════════════════════════════════════════════════════════════════
   Footer Social Icons
   ═══════════════════════════════════════════════════════════════════════════ */

.footer-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.6);
  text-decoration: none;
  transition: background .15s, color .15s, transform .15s;
  flex-shrink: 0;
}
.footer-social-btn:hover                { transform: translateY(-2px); color: #fff; }
.footer-social-btn--facebook:hover      { background: #1877f2; }
.footer-social-btn--twitter:hover       { background: #000; }
.footer-social-btn--instagram:hover     { background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); }
.footer-social-btn--youtube:hover       { background: #ff0000; }
.footer-social-btn--linkedin:hover      { background: #0a66c2; }
.footer-social-btn--rss:hover           { background: #f26522; }

/* ─── Historical Context Block ──────────────────────────────────────────────── */
.ed-context-block {
  background: rgba(201,152,58,.06);
  border-left: 4px solid var(--color-aged-gold);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
  font-size: .95rem;
  line-height: 1.7;
  color: var(--color-text-primary);
}
.ed-context-block p:last-child { margin-bottom: 0; }
.dark-mode .ed-context-block {
  background: rgba(201,152,58,.08);
  border-color: var(--color-aged-gold);
}

/* ─── Body Content ───────────────────────────────────────────────────────────── */
.ed-body-content { font-size: .975rem; line-height: 1.75; }
.ed-body-content p  { margin-bottom: 1rem; }
.ed-body-content h2 { font-family: var(--font-display); font-size: 1.25rem; margin-top: 1.75rem; margin-bottom: .5rem; color: var(--color-text-primary); border-bottom: 1px solid rgba(201,152,58,.2); padding-bottom: .3rem; }
.ed-body-content h3 { font-family: var(--font-display); font-size: 1.05rem; margin-top: 1.25rem; margin-bottom: .35rem; }
.ed-body-content a  { color: var(--color-aged-gold); text-decoration: none; }
.ed-body-content a:hover { text-decoration: underline; }
.ed-body-content ul,
.ed-body-content ol  { padding-left: 1.5rem; margin-bottom: 1rem; }
.ed-body-content li  { margin-bottom: .35rem; }
.ed-body-content blockquote {
  border-left: 4px solid var(--color-aged-gold);
  padding: .75rem 1.25rem;
  margin: 1.25rem 0;
  background: rgba(201,152,58,.06);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  font-style: italic;
  color: var(--color-text-primary);
}
.dark-mode .ed-body-content h2,
.dark-mode .ed-body-content h3 { color: #e6edf3; }
.dark-mode .ed-body-content blockquote { background: rgba(201,152,58,.08); }

/* ─── Attribution Notice ─────────────────────────────────────────────────────── */
.ed-attribution {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .5rem .75rem;
  background: rgba(0,0,0,.03);
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border);
}
.ed-attribution a { color: var(--color-aged-gold); }
.dark-mode .ed-attribution { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.08); }

/* ─── Key Facts ───────────────────────────────────────────────────────────────── */
.ed-keyfacts {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ed-keyfacts li {
  padding: .5rem 0 .5rem 1.6rem;
  position: relative;
  border-bottom: 1px solid var(--color-border);
  font-size: .9rem;
  line-height: 1.5;
}
.ed-keyfacts li:last-child { border-bottom: none; }
.ed-keyfacts li::before {
  content: "\25B8";
  position: absolute;
  left: 0;
  color: var(--color-aged-gold);
  font-size: .85rem;
}
.dark-mode .ed-keyfacts li { border-color: rgba(255,255,255,.06); }

/* ─── Gallery Section ────────────────────────────────────────────────────────── */
.ed-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.ed-gallery-figure {
  margin: 0;
  background: #000;
  border-radius: var(--radius-card);
  overflow: hidden;
  position: relative;
}
.ed-gallery-figure__link { display: block; overflow: hidden; }
.ed-gallery-figure__img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  transition: opacity .25s, transform .25s;
}
.ed-gallery-figure:hover .ed-gallery-figure__img {
  opacity: .88;
  transform: scale(1.03);
}
.ed-gallery-figure__caption {
  padding: .45rem .65rem;
  font-size: .72rem;
  line-height: 1.4;
  background: rgba(0,0,0,.03);
  border-top: 1px solid var(--color-border);
}
.ed-gallery-figure__text {
  display: block;
  color: var(--color-text-primary);
  margin-bottom: .15rem;
}
.ed-gallery-figure__credit {
  display: block;
  color: var(--color-text-muted);
  font-size: .68rem;
}
.ed-gallery-figure__licence {
  display: inline-block;
  margin-top: .15rem;
  font-size: .65rem;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  padding: .1em .3em;
  text-decoration: none;
}
.ed-gallery-figure__licence:hover { color: var(--color-aged-gold); border-color: var(--color-aged-gold); }
.ed-gallery-count {
  font-size: .75rem;
  background: rgba(0,0,0,.07);
  border-radius: 20px;
  padding: .15em .6em;
  font-family: var(--font-body);
  font-weight: 600;
}
.dark-mode .ed-gallery-figure__caption { background: rgba(255,255,255,.03); border-color: rgba(255,255,255,.06); }
.dark-mode .ed-gallery-figure__text { color: #e6edf3; }

/* ─── Browse Further (Cross-links) ──────────────────────────────────────────── */
.ed-crosslinks { margin-top: .5rem; }
.ed-crosslinks__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .75rem;
}
.ed-crosslinks__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .2rem;
  padding: .85rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  text-decoration: none;
  background: var(--color-off-white);
  transition: var(--transition);
}
.ed-crosslinks__item:hover {
  border-color: var(--color-aged-gold);
  background: rgba(201,152,58,.05);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.ed-crosslinks__icon { font-size: 1.25rem; }
.ed-crosslinks__label {
  font-size: .875rem;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.3;
}
.ed-crosslinks__count {
  font-size: .75rem;
  color: var(--color-text-muted);
}
.dark-mode .ed-crosslinks__item {
  background: #161b22;
  border-color: rgba(255,255,255,.08);
}
.dark-mode .ed-crosslinks__item:hover {
  background: rgba(201,152,58,.08);
  border-color: var(--color-aged-gold);
}
.dark-mode .ed-crosslinks__label { color: #e6edf3; }

/* ─── Admin Content Editor ───────────────────────────────────────────────────── */
.ed-content-tier-tabs .nav-link.active { font-weight: 700; }
.ed-ai-status-badge { font-size: .72rem; font-weight: 700; padding: .2em .65em; border-radius: 20px; }
.ed-ai-status-badge--pending    { background: #fff8e1; color: #b45309; }
.ed-ai-status-badge--processing { background: #e3f2fd; color: #1565c0; }
.ed-ai-status-badge--done       { background: #e6f4ea; color: #2e7d32; }
.ed-ai-status-badge--failed     { background: #fce8e8; color: #c62828; }
.ed-gallery-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .75rem;
}
.ed-gallery-admin-thumb {
  border: 2px solid var(--color-border);
  border-radius: var(--radius-card);
  overflow: hidden;
  cursor: grab;
  transition: border-color .15s, box-shadow .15s;
}
.ed-gallery-admin-thumb:hover { border-color: var(--color-aged-gold); box-shadow: var(--shadow-card); }
.ed-gallery-admin-thumb img { width: 100%; height: 90px; object-fit: cover; display: block; }
.ed-gallery-admin-meta { padding: .4rem .5rem; font-size: .72rem; background: rgba(0,0,0,.03); }

/* ─── Same-Date Events Table ──────────────────────────────────────────────── */
.ed-samedate-table {
  font-size: .875rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.ed-samedate-table thead th {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-text-muted);
  background: rgba(0,0,0,.03);
  border-bottom: 2px solid var(--color-border);
  white-space: nowrap;
  padding: .55rem .85rem;
}
.ed-samedate-table tbody td { padding: .6rem .85rem; }
.ed-samedate-col--type  { width: 110px; white-space: nowrap; }
.ed-samedate-col--year  { width: 80px; }
.ed-samedate-col--date  { width: 70px; }
.ed-samedate-title {
  color: var(--color-text-primary);
  font-weight: 600;
  line-height: 1.35;
}
.ed-samedate-title:hover { color: var(--color-aged-gold); }
.ed-samedate-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dark-mode .ed-samedate-table { border-color: rgba(255,255,255,.08); }
.dark-mode .ed-samedate-table thead th { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.08); }
.dark-mode .ed-samedate-table tbody tr:hover td { background: rgba(201,152,58,.05); }
.dark-mode .ed-samedate-title { color: #e6edf3; }
.dark-mode .ed-samedate-title:hover { color: var(--color-aged-gold); }


/* ════════════════════════════════════════════════════════════════════════════
   UI/UX IMPROVEMENT PLAN — Phase 1, 2, 3 additions
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Skip-to-content link ─────────────────────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -999px; left: 1rem;
  padding: .5rem 1rem;
  background: var(--color-aged-gold);
  color: #fff;
  font-weight: 700;
  border-radius: 0 0 6px 6px;
  z-index: 9999;
  text-decoration: none;
  font-size: .9rem;
}
.skip-link:focus { top: 0; outline: 2px solid #fff; outline-offset: 2px; }

/* ── Reading progress bar ─────────────────────────────────────────────────── */
#reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--color-aged-gold);
  z-index: 2000;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  #reading-progress { transition: width .1s linear; }
}

/* ── Back-to-top button ───────────────────────────────────────────────────── */
.btn-back-top {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--color-aged-gold);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(201,152,58,.4);
  z-index: 999;
  opacity: 0;
}
.btn-back-top:not([hidden]) { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
  .btn-back-top { transition: opacity .2s, transform .2s; }
  .btn-back-top:hover { transform: translateY(-3px); }
}

/* ── SVG Logo ─────────────────────────────────────────────────────────────── */
.site-logo { display: inline-flex; align-items: center; gap: .45rem; text-decoration: none; }
.site-logo__icon { color: var(--color-aged-gold); flex-shrink: 0; }
.site-logo__text { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
.navbar-dark .site-logo__text { color: #fff; }

/* ── Active nav link highlight ────────────────────────────────────────────── */
.navbar-dark .nav-link.active {
  color: var(--color-aged-gold) !important;
  position: relative;
}
.navbar-dark .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 2px;
  background: var(--color-aged-gold);
  border-radius: 1px;
}

/* ── Today date chip in navbar ────────────────────────────────────────────── */
.nav-date-chip {
  display: inline-block;
  font-size: .62rem;
  font-weight: 700;
  padding: .1em .4em;
  border-radius: 4px;
  background: rgba(201,152,58,.2);
  color: var(--color-aged-gold);
  margin-left: .35rem;
  vertical-align: middle;
  letter-spacing: .03em;
  line-height: 1.5;
}

/* ── Navbar inline search ─────────────────────────────────────────────────── */
.navbar-search { position: relative; }
.navbar-search__form {
  display: flex;
  align-items: center;
  animation: fadeIn .15s ease;
}
.navbar-search__input {
  width: 180px;
  border-radius: 20px;
  font-size: .85rem;
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.2);
  color: #fff;
}
.navbar-search__input::placeholder { color: rgba(255,255,255,.5); }
.navbar-search__input:focus {
  background: rgba(255,255,255,.15);
  border-color: var(--color-aged-gold);
  box-shadow: none;
  color: #fff;
}
@media (max-width: 576px) {
  .navbar-search__input { width: 140px; }
}

/* ── Skeleton loaders ─────────────────────────────────────────────────────── */
.skeleton-card {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.dark-mode .skeleton-card { background: #161b22; }
.skeleton {
  background: rgba(0,0,0,.07);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.dark-mode .skeleton { background: rgba(255,255,255,.06); }
@media (prefers-reduced-motion: no-preference) {
  .skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.35) 50%, transparent 100%);
    animation: shimmer 1.4s infinite;
  }
}
@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}
.skeleton-img  { height: 200px; border-radius: 0; }
.skeleton-card__body { padding: 1rem; }
.skeleton-text { height: 13px; margin: .5rem 0; }
.skeleton-text--short { width: 35%; }

/* ── HTMX spinner (tab indicator) ────────────────────────────────────────── */
.tab-spinner { display: none; }
.htmx-request .tab-spinner { display: block; }

/* ── No-image card placeholder ────────────────────────────────────────────── */
.event-card__image-placeholder {
  aspect-ratio: 3/2;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--placeholder-color, #555) 10%, transparent);
  border-bottom: 3px solid var(--placeholder-color, #555);
  color: var(--placeholder-color, #555);
  opacity: .65;
  text-decoration: none;
}
.event-card__image-placeholder:hover { opacity: .9; }
.event-card__image-placeholder svg { width: 36px; height: 36px; }

/* ── Estimated read time badge ────────────────────────────────────────────── */
.ed-read-time {
  display: inline-flex;
  align-items: center;
  font-size: .78rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* ── Table of Contents ────────────────────────────────────────────────────── */
.ed-toc {
  background: rgba(201,152,58,.06);
  border: 1px solid rgba(201,152,58,.2);
  border-radius: var(--radius-card);
  padding: .85rem 1rem;
  margin-bottom: 1.25rem;
  font-size: .875rem;
}
.ed-toc__title {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-text-muted);
  margin: 0 0 .5rem;
}
.ed-toc__list {
  margin: 0;
  padding-left: 1.25rem;
}
.ed-toc__list li { margin-bottom: .3rem; }
.ed-toc__list a { color: var(--color-aged-gold); text-decoration: none; }
.ed-toc__list a:hover { text-decoration: underline; }
.dark-mode .ed-toc { background: rgba(201,152,58,.07); border-color: rgba(201,152,58,.25); }

/* ── Cookie consent banner ────────────────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--color-deep-navy);
  color: rgba(255,255,255,.85);
  padding: .85rem 0;
  z-index: 1500;
  border-top: 2px solid rgba(201,152,58,.3);
  box-shadow: 0 -4px 20px rgba(0,0,0,.2);
}
.cookie-banner__link { color: var(--color-aged-gold); text-decoration: none; }
.cookie-banner__link:hover { text-decoration: underline; }

/* ── Focus rings for custom interactive elements ──────────────────────────── */
.btn-like:focus-visible,
.btn-comments:focus-visible,
.btn-bookmark:focus-visible,
.btn-back-top:focus-visible,
.event-tab:focus-visible,
.navbar-search__toggle:focus-visible,
.hero__stat-pill:focus-visible {
  outline: 2px solid var(--color-aged-gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── Accessibility: content-visibility for off-screen grids ──────────────── */
@supports (content-visibility: auto) {
  .event-grid {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
  }
}

/* ════════════════════════════════════════════════════════════════════════════
   Phase 4 — Discovery & Engagement
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Featured event highlight card ────────────────────────────────────────── */
.featured-card {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .featured-card { grid-template-columns: 1.6fr 1fr; }
}
.featured-card__image-link { display: block; overflow: hidden; line-height: 0; height: 100%; min-height: 220px; }
.featured-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 220px;
  max-height: 340px;
  display: block;
}
@media (prefers-reduced-motion: no-preference) {
  .featured-card__image { transition: transform .35s ease; }
  .featured-card__image-link:hover .featured-card__image { transform: scale(1.03); }
}
.featured-card__body {
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.featured-card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .75rem;
}
.featured-card__label {
  display: inline-flex;
  align-items: center;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-aged-gold);
}
.featured-card__title {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  line-height: 1.3;
  margin: 0 0 .6rem;
  font-weight:800;
}
.featured-card__title a {
  color: var(--color-text-primary);
  text-decoration: none;
}
.featured-card__title a:hover { color: var(--color-aged-gold); }
.featured-card__desc {
  font-size: .925rem;
  line-height: 1.65;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dark-mode .featured-card { background: #161b22; border-color: rgba(255,255,255,.06); }
.dark-mode .featured-card__title a { color: #e6edf3; }

/* ── Search term highlight ────────────────────────────────────────────────── */
mark {
  background: rgba(201,152,58,.22);
  color: inherit;
  border-radius: 2px;
  padding: 0 .1em;
}
.dark-mode mark {
  background: rgba(201,152,58,.32);
}

/* ── Search empty state ───────────────────────────────────────────────────── */
.search-empty-state { max-width: 520px; margin: 0 auto; }
.search-empty-state__icon { font-size: 3.5rem; margin-bottom: 1rem; }
.search-empty-state__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: .5rem;
}
.search-empty-state__suggestions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .4rem;
}

/* ── Filter chips ─────────────────────────────────────────────────────────── */
.filter-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.filter-chip {
  padding: .3em .85em;
  border: 1.5px solid var(--color-border);
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.filter-chip:hover {
  background: var(--color-deep-navy);
  color: #fff;
  border-color: var(--color-deep-navy);
}
.filter-chip.active {
  background: var(--chip-color, var(--color-deep-navy));
  color: #fff;
  border-color: var(--chip-color, var(--color-deep-navy));
}
.filter-chip--clear {
  color: var(--color-crimson);
  border-color: rgba(139,26,26,.25);
}
.filter-chip--clear:hover { background: var(--color-crimson); border-color: var(--color-crimson); color: #fff; }
.dark-mode .filter-chip { border-color: rgba(255,255,255,.12); }
.dark-mode .filter-chip:hover { background: var(--color-aged-gold); border-color: var(--color-aged-gold); color: #fff; }

/* ── Web Share button (native) ────────────────────────────────────────────── */
.share-btn--native:hover { background: var(--color-aged-gold); border-color: var(--color-aged-gold); color: #fff; }

/* ── Month calendar widget ────────────────────────────────────────────────── */
.month-calendar {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1rem;
  font-size: .83rem;
}
.dark-mode .month-calendar { background: #161b22; border: 1px solid rgba(255,255,255,.08); }
.month-calendar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .65rem;
}
.month-calendar__title {
  font-weight: 700;
  font-family: var(--font-display);
  font-size: .9rem;
  color: var(--color-text-primary);
}
.dark-mode .month-calendar__title { color: #e6edf3; }
.month-calendar__nav {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 1.1rem;
  line-height: 1;
  padding: .15rem .4rem;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  background: transparent;
  transition: background .12s, color .12s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.month-calendar__nav:hover { background: var(--color-aged-gold); color: #fff; border-color: var(--color-aged-gold); }
.month-calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.month-calendar__dow {
  text-align: center;
  font-size: .68rem;
  font-weight: 700;
  color: var(--color-text-muted);
  padding: .2rem 0;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.month-calendar__cell {
  text-align: center;
  padding: .3rem .1rem;
  border-radius: 4px;
  font-size: .8rem;
  color: var(--color-text-primary);
  text-decoration: none;
  position: relative;
  transition: background .12s, color .12s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.month-calendar__cell:hover { background: rgba(201,152,58,.12); color: var(--color-aged-gold); }
.month-calendar__cell--empty { pointer-events: none; }
.month-calendar__cell--active {
  background: var(--color-aged-gold);
  color: #fff;
  font-weight: 700;
}
.month-calendar__cell--today {
  border: 2px solid var(--color-aged-gold);
  font-weight: 700;
  color: var(--color-aged-gold);
}
.month-calendar__dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--color-aged-gold);
  display: block;
}
.month-calendar__cell--active .month-calendar__dot { background: rgba(255,255,255,.7); }
.dark-mode .month-calendar__cell { color: #e6edf3; }
.dark-mode .month-calendar__cell:hover { background: rgba(201,152,58,.15); }

/* ── Archive two-column layout ────────────────────────────────────────────── */
.archive-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 2rem;
  align-items: start;
}
.archive-layout__sidebar { position: sticky; top: 1rem; }
@media (max-width: 991px) {
  .archive-layout { grid-template-columns: 1fr; }
  .archive-layout__sidebar { order: -1; }
}

/* Archive sidebar nav links */
.archive-sidebar-links__heading {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--color-text-muted);
  margin-bottom: .4rem;
}
.archive-sidebar-link {
  display: block;
  font-size: .85rem;
  color: var(--color-aged-gold);
  text-decoration: none;
  padding: .2rem 0;
}
.archive-sidebar-link:hover { text-decoration: underline; }

/* ── Decade timeline ──────────────────────────────────────────────────────── */
.decade-timeline {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 1.5rem;
}
.decade-timeline::-webkit-scrollbar { display: none; }
.decade-timeline__item {
  flex: 0 0 auto;
  padding: .5rem .9rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  text-decoration: none;
  transition: color .15s, border-color .15s;
}
.decade-timeline__item:hover { color: var(--color-aged-gold); }
.decade-timeline__item.active {
  color: var(--color-aged-gold);
  border-bottom-color: var(--color-aged-gold);
}
.dark-mode .decade-timeline { border-color: rgba(255,255,255,.1); }

/* ════════════════════════════════════════════════════════════════════════════
   Phase 5 — Footer & Social
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Newsletter column ────────────────────────────────────────────────────── */
.site-footer__newsletter .form-control {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.2);
  color: #fff;
}
.site-footer__newsletter .form-control::placeholder { color: rgba(255,255,255,.45); }
.site-footer__newsletter .form-control:focus {
  background: rgba(255,255,255,.15);
  border-color: var(--color-aged-gold);
  box-shadow: none;
  color: #fff;
}
.site-footer__stat { margin-bottom: 0; }

/* ════════════════════════════════════════════════════════════════════════════
   Phase 6 — Error Pages
   ════════════════════════════════════════════════════════════════════════════ */

.error-page { padding: 4rem 1rem; }
.error-page__icon { font-size: 4rem; margin-bottom: 1rem; }
.error-page__code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 15vw, 8rem);
  font-weight: 700;
  color: var(--color-aged-gold);
  line-height: 1;
  margin-bottom: .25rem;
}
.error-page__title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 4vw, 2rem);
  font-weight: 700;
  margin-bottom: .75rem;
}
.error-page__desc { font-size: 1rem; line-height: 1.65; max-width: 480px; margin: 0 auto; }
.error-page__actions { gap: .75rem; }

/* ════════════════════════════════════════════════════════════════════════════
   Phase 6 — prefers-reduced-motion wrappers
   ════════════════════════════════════════════════════════════════════════════ */

/* Remove transitions/animations when user prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .event-card,
  .event-card__image,
  .ed-hero__img,
  .btn-back-top,
  .ed-hero__thumb,
  .ed-gallery-figure__img,
  .footer-social-btn,
  .filter-chip,
  .month-calendar__cell,
  .decade-timeline__item,
  .ed-crosslinks__item,
  .share-btn,
  .hero__stat-pill {
    transition: none !important;
  }

  .fade-in { animation: none !important; }

  .skeleton::after { animation: none !important; }

  #reading-progress { transition: none !important; }

  .btn-back-top { transition: none !important; }

  @keyframes fadeIn { from { opacity: 1; transform: none; } }
}

/* ════════════════════════════════════════════════════════════════════════════
   Phase 6 — Color contrast fix
   ════════════════════════════════════════════════════════════════════════════ */

:root {
  --color-text-muted: #4b5563; /* upgraded from #6b7280 → 7.1:1 on white */
}
.site-footer__links a { color: rgba(255,255,255,.75); } /* was .6 */
.dark-mode { --color-text-muted: #9ca3af; }

/* ════════════════════════════════════════════════════════════════════════════
   Search improvements (bugs 1–2, features 3–9)
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Autocomplete label ("Recent" header row) ─────────────────────────────── */
.search-autocomplete-label {
  padding: .35rem .85rem .15rem;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  background: rgba(0,0,0,.025);
}
.dark-mode .search-autocomplete-label {
  background: rgba(255,255,255,.03);
  border-color: rgba(255,255,255,.08);
}

/* ── Sort chips (feature #4) — slightly muted so they don't compete with type chips ─ */
.filter-chip--sort {
  font-size: .75rem;
  padding: .22em .75em;
  border-style: dashed;
}
.filter-chip--sort.active {
  background: var(--color-deep-navy);
  color: #fff;
  border-color: var(--color-deep-navy);
  border-style: solid;
}

/* ── Era preset chips (feature #7) ────────────────────────────────────────── */
.filter-chip--era {
  font-size: .75rem;
  padding: .22em .75em;
}
.filter-chip--era.active {
  background: var(--color-aged-gold);
  color: #fff;
  border-color: var(--color-aged-gold);
}

/* ── Search results summary bar (feature #8) ──────────────────────────────── */
.search-summary {
  line-height: 1.5;
  margin-bottom: .85rem;
}

/* ── HTMX search spinner indicator ────────────────────────────────────────── */
#search-spinner {
  min-height: 42px;
}
#search-spinner.htmx-request,
.htmx-request #search-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── "Did you mean?" link ──────────────────────────────────────────────────── */
.did-you-mean {
  font-size: .95rem;
  color: var(--color-text-muted);
}
.did-you-mean a {
  color: var(--color-aged-gold);
  font-weight: 600;
  text-decoration: none;
}
.did-you-mean a:hover { text-decoration: underline; }

/* ── Home page search bar ──────────────────────────────────────────────────── */
.home-search {
  background: rgba(201,152,58,.06);
  border: 1px solid rgba(201,152,58,.18);
  border-radius: var(--radius-card);
  padding: 1rem 1.25rem;
}
.home-search .form-control,
.home-search .form-select {
  border-color: rgba(0,0,0,.12);
}
.home-search .form-control:focus,
.home-search .form-select:focus {
  border-color: var(--color-aged-gold);
  box-shadow: 0 0 0 .2rem rgba(201,152,58,.2);
}
.dark-mode .home-search {
  background: rgba(201,152,58,.07);
  border-color: rgba(201,152,58,.22);
}
.dark-mode .home-search .form-control,
.dark-mode .home-search .form-select {
  background-color: #1c2128;
  border-color: #30363d;
  color: #e6edf3;
}
.dark-mode .home-search .form-control:focus,
.dark-mode .home-search .form-select:focus {
  border-color: var(--color-aged-gold);
  box-shadow: 0 0 0 .2rem rgba(201,152,58,.2);
}

/* ════════════════════════════════════════════════════════════════════════════
   Feature 1.3 — "Trending Today" sidebar widget
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Widget shell ─────────────────────────────────────────────────────────── */
.trending-widget {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.trending-widget__header {
  display: flex;
  align-items: center;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--color-text-muted);
  padding: .65rem 1rem .55rem;
  background: rgba(201,152,58,.05);
  border-bottom: 1px solid var(--color-border);
}

/* ── Numbered list ────────────────────────────────────────────────────────── */
.trending-widget__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.trending-widget__item {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--color-border);
  transition: background .12s;
}
.trending-widget__item:last-child { border-bottom: none; }
.trending-widget__item:hover { background: rgba(201,152,58,.04); }

/* ── Rank number ──────────────────────────────────────────────────────────── */
.trending-widget__rank {
  flex-shrink: 0;
  width: 20px;
  font-size: .95rem;
  font-weight: 800;
  color: rgba(201,152,58,.4);
  line-height: 1;
  padding-top: .15rem;
  text-align: right;
  font-family: var(--font-display);
}
.trending-widget__item:first-child .trending-widget__rank {
  color: var(--color-aged-gold);
}

/* ── Thumbnail ────────────────────────────────────────────────────────────── */
.trending-widget__thumb-link { flex-shrink: 0; display: block; border-radius: 4px; overflow: hidden; line-height: 0; }
.trending-widget__thumb {
  width: 54px;
  height: 40px;
  object-fit: cover;
  display: block;
  transition: transform .2s ease;
}
.trending-widget__item:hover .trending-widget__thumb { transform: scale(1.05); }

/* ── Text body ────────────────────────────────────────────────────────────── */
.trending-widget__body {
  flex: 1;
  min-width: 0;
}
.trending-widget__title {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-text-primary);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: .25rem;
}
.trending-widget__title:hover { color: var(--color-aged-gold); }

.trending-widget__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .3rem;
}
.trending-widget__type {
  font-size: .68rem;
  font-weight: 600;
  text-decoration: none;
  opacity: .85;
}
.trending-widget__type:hover { opacity: 1; text-decoration: underline; }

.trending-widget__likes {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  font-size: .68rem;
  color: #e55;
  font-weight: 600;
}

/* ── Dark mode ────────────────────────────────────────────────────────────── */
.dark-mode .trending-widget {
  background: #161b22;
  border-color: rgba(255,255,255,.08);
}
.dark-mode .trending-widget__header {
  background: rgba(255,255,255,.03);
  border-color: rgba(255,255,255,.08);
  color: #8b949e;
}
.dark-mode .trending-widget__item { border-color: rgba(255,255,255,.06); }
.dark-mode .trending-widget__item:hover { background: rgba(201,152,58,.05); }
.dark-mode .trending-widget__title { color: #e6edf3; }
.dark-mode .trending-widget__title:hover { color: var(--color-aged-gold); }

/* ── Home page: trending sits below the event grid on mobile,               ──
      sticky sidebar on ≥992 px                                               */
.home-trending-sidebar {
  max-width: 340px;
}
@media (min-width: 992px) {
  /* On large screens the index page wraps events + sidebar in a grid */
  .home-content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.5rem;
    align-items: start;
  }
  .home-trending-sidebar {
    position: sticky;
    top: 1rem;
    max-width: 100%;
  }
}

/* ── Search page two-column layout ───────────────────────────────────────── */
.search-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (min-width: 992px) {
  .search-layout {
    grid-template-columns: 1fr 280px;
  }
  .search-layout__sidebar {
    position: sticky;
    top: 1rem;
  }
}

/* ── Reduced motion ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .trending-widget__thumb { transition: none !important; }
}

   ════════════════════════════════════════════════════════════════════════════ */

.week-timeline {
  margin-bottom: 1.5rem;
}

.week-timeline__header {
  display: flex;
  align-items: center;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--color-text-muted);
  margin-bottom: .6rem;
  gap: .2rem;
}

/* Scrollable track */
.week-timeline__track {
  display: flex;
  gap: .6rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: .4rem;  /* space for scrollbar on Windows */
  scrollbar-width: thin;
  scrollbar-color: rgba(201,152,58,.3) transparent;
}
.week-timeline__track::-webkit-scrollbar { height: 4px; }
.week-timeline__track::-webkit-scrollbar-thumb {
  background: rgba(201,152,58,.3);
  border-radius: 2px;
}

/* Individual day card */
.week-timeline__day {
  flex: 0 0 140px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: #fff;
  border-radius: var(--radius-card);
  border: 1.5px solid var(--color-border);
  overflow: hidden;
  text-decoration: none;
  color: var(--color-text-primary);
  transition: box-shadow .18s, border-color .18s, transform .18s;
  position: relative;
  min-height: 160px;
}
.week-timeline__day:hover {
  box-shadow: var(--shadow-hover);
  border-color: rgba(201,152,58,.45);
  transform: translateY(-2px);
  color: var(--color-text-primary);
  text-decoration: none;
}

/* Today highlight */
.week-timeline__day--today {
  border-color: var(--color-aged-gold);
  box-shadow: 0 0 0 1px var(--color-aged-gold);
}
.week-timeline__day--today:hover {
  box-shadow: var(--shadow-hover), 0 0 0 1px var(--color-aged-gold);
}

/* Empty day */
.week-timeline__day--empty {
  opacity: .6;
  pointer-events: none;
}

/* Thumbnail */
.week-timeline__thumb {
  height: 80px;
  overflow: hidden;
  background: rgba(0,0,0,.04);
  position: relative;
  flex-shrink: 0;
}
.week-timeline__thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}
.week-timeline__day:hover .week-timeline__thumb-img {
  transform: scale(1.05);
}

/* Placeholder for no-image days */
.week-timeline__thumb--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(201,152,58,.05);
}

/* Event type colour dot */
.week-timeline__type-dot {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.7);
}

/* Text area */
.week-timeline__meta {
  display: flex;
  flex-direction: column;
  padding: .45rem .55rem .15rem;
  gap: .05rem;
}
.week-timeline__label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-aged-gold);
  line-height: 1.2;
}
.week-timeline__day--today .week-timeline__label {
  color: var(--color-aged-gold);
}
.week-timeline__date {
  font-size: .7rem;
  color: var(--color-text-muted);
  line-height: 1.2;
}

/* Event count badge */
.week-timeline__count {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: var(--color-deep-navy);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.week-timeline__day--today .week-timeline__count {
  background: var(--color-aged-gold);
}

/* Top event snippet */
.week-timeline__snippet {
  font-size: .72rem;
  line-height: 1.4;
  color: var(--color-text-muted);
  margin: 0;
  padding: .15rem .55rem .5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.week-timeline__snippet--none {
  font-style: italic;
  opacity: .6;
}
.week-timeline__year {
  font-weight: 700;
  font-size: .7rem;
  margin-right: .2rem;
  white-space: nowrap;
  color: var(--color-aged-gold);
}

/* "Today" pill at the bottom of the today card */
.week-timeline__today-pill {
  display: block;
  margin: 0 .55rem .55rem;
  text-align: center;
  background: var(--color-aged-gold);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: 20px;
  padding: .15em 0;
}

/* ── Dark mode ────────────────────────────────────────────────────────────── */
.dark-mode .week-timeline__day {
  background: #161b22;
  border-color: rgba(255,255,255,.08);
  color: #e6edf3;
}
.dark-mode .week-timeline__day:hover {
  border-color: rgba(201,152,58,.45);
  color: #e6edf3;
}
.dark-mode .week-timeline__day--today {
  border-color: var(--color-aged-gold);
  box-shadow: 0 0 0 1px var(--color-aged-gold);
}
.dark-mode .week-timeline__thumb--placeholder {
  background: rgba(255,255,255,.04);
}
.dark-mode .week-timeline__count { background: #30363d; }
.dark-mode .week-timeline__day--today .week-timeline__count { background: var(--color-aged-gold); }
.dark-mode .week-timeline__date { color: #8b949e; }

/* ── Reduced motion ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .week-timeline__day,
  .week-timeline__thumb-img { transition: none !important; }
}

/* ── Responsive: wider cards on larger screens ────────────────────────────── */
@media (min-width: 768px) {
  .week-timeline__day { flex: 0 0 160px; }
}
@media (min-width: 1200px) {
  .week-timeline__day { flex: 0 0 180px; }
  .week-timeline__thumb { height: 90px; }
}

/* ════════════════════════════════════════════════════════════════════════════
   Feature 1.5 — "Years Ago Today" Anniversary Badge
   ════════════════════════════════════════════════════════════════════════════ */

.anniversary-badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .18em .6em;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  background: rgba(201,152,58,.15);
  color: var(--color-aged-gold);
  border: 1px solid rgba(201,152,58,.35);
  letter-spacing: .02em;
  white-space: nowrap;
}
.anniversary-badge--round {
  background: var(--color-aged-gold);
  color: #fff;
  border-color: var(--color-aged-gold);
}
.anniversary-badge--lg {
  font-size: .82rem;
  padding: .22em .75em;
}
.dark-mode .anniversary-badge {
  background: rgba(201,152,58,.2);
  border-color: rgba(201,152,58,.4);
}
.dark-mode .anniversary-badge--round {
  background: var(--color-aged-gold);
  border-color: var(--color-aged-gold);
  color: #fff;
}

/* Ensure card badges wrap neatly */
.event-card__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
  margin-bottom: .4rem;
}

/* ── Anniversary home-page banner ─────────────────────────────────────────── */
.anniversary-banner {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .75rem 1.1rem;
  background: linear-gradient(90deg, rgba(201,152,58,.12) 0%, rgba(201,152,58,.04) 100%);
  border: 1px solid rgba(201,152,58,.3);
  border-radius: var(--radius-card);
  text-decoration: none;
  color: var(--color-text-primary);
  margin-bottom: 1.1rem;
  transition: box-shadow .18s, border-color .18s;
}
.anniversary-banner:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--color-aged-gold);
  color: var(--color-text-primary);
  text-decoration: none;
}
.anniversary-banner__thumb {
  width: 64px;
  height: 48px;
  object-fit: cover;
  border-radius: 5px;
  flex-shrink: 0;
}
.anniversary-banner__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .65rem;
}
.anniversary-banner__pill {
  display: inline-flex;
  align-items: center;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--color-aged-gold);
  white-space: nowrap;
}
.anniversary-banner__title {
  font-weight: 600;
  font-size: .9rem;
  line-height: 1.35;
  color: var(--color-text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.anniversary-banner__year {
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
}
.anniversary-banner__arrow {
  color: var(--color-aged-gold);
  opacity: .7;
  flex-shrink: 0;
}
.anniversary-banner:hover .anniversary-banner__arrow { opacity: 1; }
.dark-mode .anniversary-banner {
  background: linear-gradient(90deg, rgba(201,152,58,.14) 0%, rgba(201,152,58,.05) 100%);
  border-color: rgba(201,152,58,.35);
}
.dark-mode .anniversary-banner__title { color: #e6edf3; }

/* ════════════════════════════════════════════════════════════════════════════
   Feature 1.4 — "Did You Know?" Trivia Card
   ════════════════════════════════════════════════════════════════════════════ */

.trivia-card {
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.trivia-card__header {
  display: flex;
  align-items: center;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--color-text-muted);
  padding: .6rem 1rem .5rem;
  background: rgba(201,152,58,.05);
  border-bottom: 1px solid var(--color-border);
}
.trivia-card__body {
  display: flex;
  gap: .75rem;
  padding: .85rem 1rem;
}
.trivia-card__thumb-link {
  flex-shrink: 0;
  display: block;
  border-radius: 5px;
  overflow: hidden;
  line-height: 0;
  align-self: flex-start;
}
.trivia-card__thumb {
  width: 80px;
  height: 60px;
  object-fit: cover;
  display: block;
  transition: transform .2s ease;
}
.trivia-card__body:hover .trivia-card__thumb { transform: scale(1.04); }
.trivia-card__text { flex: 1; min-width: 0; }
.trivia-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .3rem;
  margin-bottom: .35rem;
}
.trivia-card__title {
  display: block;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--color-text-primary);
  text-decoration: none;
  margin-bottom: .3rem;
  font-family: var(--font-display);
}
.trivia-card__title:hover { color: var(--color-aged-gold); }
.trivia-card__excerpt {
  font-size: .82rem;
  line-height: 1.55;
  color: var(--color-text-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.trivia-card__footer {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .55rem 1rem .7rem;
  border-top: 1px solid var(--color-border);
}
.trivia-card__refresh {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .78rem;
}
/* dark mode */
.dark-mode .trivia-card {
  background: #161b22;
  border-color: rgba(255,255,255,.08);
}
.dark-mode .trivia-card__header {
  background: rgba(255,255,255,.03);
  border-color: rgba(255,255,255,.08);
  color: #8b949e;
}
.dark-mode .trivia-card__title { color: #e6edf3; }
.dark-mode .trivia-card__footer { border-color: rgba(255,255,255,.08); }
.dark-mode .trivia-card__refresh { border-color: rgba(255,255,255,.15); color: #8b949e; }
.dark-mode .trivia-card__refresh:hover { border-color: var(--color-aged-gold); color: var(--color-aged-gold); }
/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .trivia-card__thumb { transition: none !important; }
}

/* ── Birthday Banner ────────────────────────────────────────────────────────── */
.birthday-banner {
  background: linear-gradient(90deg, #c9983a 0%, #f5c842 100%);
  border-radius: .75rem;
  margin-bottom: 1.25rem;
  padding: .9rem 1.1rem;
}
.birthday-banner__inner {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.birthday-banner__emoji { font-size: 1.5rem; line-height: 1; }

/* =====================================================================
   Legal pages  (Privacy · Terms · Disclaimer · Cookie Policy)
   ===================================================================== */

/* ── Full-bleed escape (same technique as About / Contact) ── */
.legal-hero,
.legal-related {
  margin-left: calc(var(--bs-gutter-x, 0px) * -.5);
  margin-right: calc(var(--bs-gutter-x, 0px) * -.5);
}
@media (min-width: 576px) {
  .legal-hero,
  .legal-related {
    margin-left:  calc((100vw - 100%) / -2);
    margin-right: calc((100vw - 100%) / -2);
    padding-left:  calc((100vw - 100%) / 2);
    padding-right: calc((100vw - 100%) / 2);
  }
}

/* ── Hero band ── */
.legal-hero {
  background: linear-gradient(135deg, var(--color-deep-navy) 0%, #1a2f4a 100%);
  padding: 3.5rem 0 3rem;
}
.legal-hero__eyebrow {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-aged-gold);
  background: rgba(201,152,58,.15);
  border-radius: 20px;
  padding: .3em .9em;
  margin-bottom: 1rem;
}
.legal-hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  color: #fff;
  line-height: 1.2;
  margin-bottom: .75rem;
}
.legal-hero__meta {
  font-size: .85rem;
  color: rgba(255,255,255,.5);
  margin-bottom: 1rem;
}
.legal-hero__meta strong { color: rgba(255,255,255,.8); }
.legal-hero__desc {
  font-size: 1.05rem;
  color: rgba(255,255,255,.7);
  max-width: 60ch;
  line-height: 1.7;
}

/* ── Breadcrumb inside hero ── */
.legal-breadcrumb { font-size: .8rem; margin-bottom: 1rem; }
.legal-breadcrumb a { color: rgba(255,255,255,.5); text-decoration: none; }
.legal-breadcrumb a:hover { color: var(--color-aged-gold); }
.legal-breadcrumb span { color: rgba(255,255,255,.35); margin: 0 .4em; }
.legal-breadcrumb .legal-breadcrumb__current { color: rgba(255,255,255,.75); }

/* ── Body layout ── */
.legal-body { padding: 3rem 0 4rem; }

/* ── TOC sidebar ── */
.legal-toc {
  position: sticky;
  top: 1.5rem;
}
.legal-toc__heading {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: .75rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--color-border);
}
.legal-toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.legal-toc__list a {
  display: block;
  font-size: .85rem;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: .35rem .6rem;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: all .15s ease;
  line-height: 1.4;
}
.legal-toc__list a:hover,
.legal-toc__list a.is-active {
  color: var(--color-aged-gold);
  border-left-color: var(--color-aged-gold);
  background: rgba(201,152,58,.06);
}

/* ── Content sections ── */
.legal-section {
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--color-border);
  scroll-margin-top: 1.5rem;
}
.legal-section:last-of-type { border-bottom: none; margin-bottom: 0; }

.legal-section__num {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  color: var(--color-aged-gold);
  letter-spacing: .08em;
  margin-bottom: .35rem;
}
.legal-section__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--color-deep-navy);
  margin-bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .65rem;
}
.legal-section__title-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 8px;
  background: rgba(201,152,58,.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-aged-gold);
}
.legal-section p,
.legal-section li {
  color: var(--color-text-muted);
  font-size: .95rem;
  line-height: 1.75;
}
.legal-section ul,
.legal-section ol {
  padding-left: 1.25rem;
}
.legal-section li { margin-bottom: .35rem; }
.legal-section strong { color: var(--color-text-primary); }
.legal-section a { color: var(--color-aged-gold); }
.legal-section a:hover { color: #b5872f; }

/* ── Callout box ── */
.legal-callout {
  background: rgba(201,152,58,.07);
  border-left: 3px solid var(--color-aged-gold);
  border-radius: 0 6px 6px 0;
  padding: .9rem 1.1rem;
  margin: 1rem 0;
  font-size: .9rem;
  color: var(--color-text-muted);
}
.legal-callout strong { color: var(--color-text-primary); }
.legal-callout--info {
  background: rgba(15,28,46,.05);
  border-left-color: var(--color-deep-navy);
}

/* ── Cookie table ── */
.legal-cookie-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .85rem;
  margin: 1rem 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.legal-cookie-table th {
  background: var(--color-deep-navy);
  color: rgba(255,255,255,.9);
  font-weight: 600;
  padding: .65rem .85rem;
  text-align: left;
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.legal-cookie-table td {
  padding: .6rem .85rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
  color: var(--color-text-muted);
}
.legal-cookie-table tr:last-child td { border-bottom: none; }
.legal-cookie-table tr:nth-child(even) td { background: rgba(0,0,0,.02); }
.legal-cookie-table code {
  font-size: .78rem;
  background: rgba(0,0,0,.05);
  padding: .1em .4em;
  border-radius: 3px;
  color: var(--color-crimson);
}

/* ── Cookie type badges ── */
.legal-type-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .04em;
  padding: .2em .55em;
  border-radius: 20px;
}
.legal-type-badge--essential   { background: rgba(15,28,46,.1);  color: var(--color-deep-navy); }
.legal-type-badge--analytics   { background: rgba(201,152,58,.15); color: #8a6520; }
.legal-type-badge--advertising { background: rgba(139,26,26,.1);  color: var(--color-crimson); }
.legal-type-badge--functional  { background: rgba(34,139,34,.1);  color: #1a6b1a; }

/* ── Related pages strip ── */
.legal-related {
  background: var(--color-deep-navy);
  padding: 2.5rem 0;
  margin-top: 3rem;
}
.legal-related__heading {
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
  margin-bottom: 1.25rem;
}
.legal-related__cards {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}
.legal-related__card {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius-card);
  padding: .65rem 1rem;
  text-decoration: none;
  color: rgba(255,255,255,.75);
  font-size: .88rem;
  transition: var(--transition);
}
.legal-related__card:hover {
  background: rgba(201,152,58,.15);
  border-color: rgba(201,152,58,.3);
  color: var(--color-aged-gold);
}
.legal-related__card svg { opacity: .6; flex-shrink: 0; }
.legal-related__card:hover svg { opacity: 1; }

/* ── Dark mode ── */
.dark-mode .legal-section__title { color: #e6edf3; }
.dark-mode .legal-callout { background: rgba(201,152,58,.05); }
.dark-mode .legal-callout--info { background: rgba(255,255,255,.04); }
.dark-mode .legal-toc__list a:hover,
.dark-mode .legal-toc__list a.is-active { background: rgba(201,152,58,.08); }
.dark-mode .legal-cookie-table { border-color: rgba(255,255,255,.06); }
.dark-mode .legal-cookie-table td { border-color: rgba(255,255,255,.06); color: #8b949e; }
.dark-mode .legal-cookie-table tr:nth-child(even) td { background: rgba(255,255,255,.02); }
.dark-mode .legal-cookie-table code { background: rgba(255,255,255,.08); color: #f97583; }
.dark-mode .legal-section { border-color: rgba(255,255,255,.06); }
.birthday-banner__text  { flex: 1; color: #1a1a2e; font-size: .92rem; }
.birthday-banner__link  { color: #1a1a2e; font-weight: 700; }
.birthday-banner__cta   {
  background: rgba(255,255,255,.25);
  border: 1px solid rgba(255,255,255,.5);
  color: #1a1a2e;
  font-weight: 600;
  white-space: nowrap;
}
.birthday-banner__cta:hover { background: rgba(255,255,255,.45); color: #1a1a2e; }

/* ── Recently Viewed ─────────────────────────────────────────────────────────── */
.recently-viewed-section .up-section-header { margin-bottom: .75rem; }

.recently-viewed-grid {
  display: flex;
  gap: .75rem;
  overflow-x: auto;
  padding-bottom: .5rem;
  scrollbar-width: thin;
}

.recently-viewed-card {
  flex: 0 0 160px;
  background: var(--color-card-bg, #fff);
  border: 1px solid var(--color-border);
  border-radius: .6rem;
  padding: .65rem .75rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  transition: box-shadow .15s, border-color .15s;
  color: inherit;
}
.recently-viewed-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
  border-color: var(--color-aged-gold);
  color: inherit;
}
.recently-viewed-card__year {
  font-size: .7rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--badge-color, #666) 15%, transparent);
  color: var(--badge-color, #666);
  padding: .15rem .45rem;
  border-radius: .3rem;
  display: inline-block;
  align-self: flex-start;
}
.recently-viewed-card__title {
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Reading Lists (continued) ───────────────────────────────────────────────── */
.up-list-card {
  border: 1px solid var(--color-border);
  border-radius: .75rem;
  transition: box-shadow .15s, border-color .15s;
  color: inherit;
}
.up-list-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  border-color: var(--color-aged-gold);
  color: inherit;
}

/* Save-to-list button + picker dropdown */
.save-to-list-wrap { position: relative; display: inline-block; }

.list-picker-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 200;
  min-width: 230px;
  max-height: 280px;
  overflow-y: auto;
}

.list-picker-item {
  border-bottom: 1px solid var(--color-border);
}
.list-picker-item:last-child { border-bottom: none; }
.list-picker-item:hover { background: var(--color-bg-subtle, #f8f9fa); }

.list-picker-btn {
  font-size: .75rem;
  padding: .2rem .55rem;
  white-space: nowrap;
}

.list-picker-empty { font-size: .8rem; }

/* List detail — wrap each card + remove button together */
.up-list-item-wrap { display: flex; flex-direction: column; }












/* --- Admin Content Editor extended UX --- */
.ed-live-strip { display:flex; align-items:center; gap:.65rem; padding:.55rem 1rem; border-radius:var(--radius-card); font-size:.82rem; font-weight:600; margin-bottom:1.25rem; border:1px solid; }
.ed-live-strip--admin { background:#e6f4ea; border-color:#a8d5b5; color:#1a5c2a; }
.ed-live-strip--ai    { background:#e3f2fd; border-color:#90caf9; color:#0d47a1; }
.ed-live-strip--wiki  { background:#fff8e1; border-color:#ffe082; color:#7c5200; }
.ed-live-strip--none  { background:#f1f3f4; border-color:#dadce0; color:#5f6368; }
.dark-mode .ed-live-strip--admin { background:#0d2818; border-color:#196830; color:#3fb950; }
.dark-mode .ed-live-strip--ai    { background:#0d1f3a; border-color:#1565c0; color:#90caf9; }
.dark-mode .ed-live-strip--wiki  { background:#2a1f00; border-color:#b45309; color:#ffd54f; }
.dark-mode .ed-live-strip--none  { background:#1c2128; border-color:#30363d; color:#8b949e; }

.ed-editor-toolbar {
  display:flex; align-items:center; justify-content:space-between;
  gap:.5rem; flex-wrap:wrap; padding:.5rem .75rem;
  background:rgba(0,0,0,.03); border:1px solid var(--color-border);
  border-bottom:none; border-radius:var(--radius-card) var(--radius-card) 0 0;
}
.dark-mode .ed-editor-toolbar { background:rgba(255,255,255,.04); border-color:rgba(255,255,255,.08); }
.ed-editor-mode-btns { display:flex; gap:0; border:1px solid var(--color-border); border-radius:6px; overflow:hidden; }
.ed-mode-btn {
  padding:.3rem .8rem; font-size:.8rem; font-weight:600;
  border:none; background:transparent; color:var(--color-text-muted);
  cursor:pointer; transition:background .15s, color .15s;
}
.ed-mode-btn.active { background:var(--color-deep-navy); color:#fff; }
.dark-mode .ed-mode-btn.active { background:var(--color-aged-gold); color:#fff; }

.ed-html-textarea {
  width:100%; font-family:monospace; font-size:.82rem; line-height:1.6;
  resize:vertical; min-height:420px;
  border-radius:0 0 var(--radius-card) var(--radius-card);
  border:1px solid var(--color-border); padding:.75rem;
  background:#fff; color:var(--color-text-primary);
  display:block; box-sizing:border-box;
}
.ed-html-textarea:focus { outline:none; border-color:var(--color-aged-gold); box-shadow:0 0 0 3px rgba(201,152,58,.15); }
.dark-mode .ed-html-textarea { background:#161b22; color:#e6edf3; border-color:rgba(255,255,255,.1); }

.ed-preview-pane {
  border:1px solid var(--color-border);
  border-radius:0 0 var(--radius-card) var(--radius-card);
  padding:1.25rem 1.5rem; min-height:420px; overflow-y:auto;
  font-size:1rem; line-height:1.8;
  color:var(--color-text-primary); background:var(--color-off-white);
  display:none;
}
.dark-mode .ed-preview-pane { background:#161b22; color:#e6edf3; border-color:rgba(255,255,255,.08); }

.ed-source-preview {
  border:1px solid var(--color-border); border-radius:var(--radius-card);
  padding:1rem 1.25rem; max-height:500px; overflow-y:auto;
  font-size:.9rem; line-height:1.75;
  color:var(--color-text-primary); background:var(--color-off-white);
}
.dark-mode .ed-source-preview { background:#161b22; color:#c9d1d9; border-color:rgba(255,255,255,.08); }

.ed-current-live-preview {
  border:1px dashed var(--color-border); border-radius:var(--radius-card);
  padding:1rem 1.25rem; margin-top:1rem; max-height:340px; overflow-y:auto;
  font-size:.9rem; line-height:1.75;
  color:var(--color-text-primary); background:rgba(0,0,0,.02);
}
.dark-mode .ed-current-live-preview { background:rgba(255,255,255,.03); border-color:rgba(255,255,255,.1); color:#c9d1d9; }
.ed-current-live-preview__label {
  display:inline-flex; align-items:center; gap:.35rem;
  font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.07em;
  padding:.2em .65em; border-radius:20px; margin-bottom:.75rem;
  background:rgba(201,152,58,.12); color:#7c5200;
}
.dark-mode .ed-current-live-preview__label { background:rgba(201,152,58,.15); color:#ffd54f; }

/* --- Reputation page -------------------------------------------------------- */
.rep-hero-card { display:flex; align-items:center; gap:1.25rem; background:#fff; border-radius:var(--radius-card); box-shadow:var(--shadow-card); padding:1.5rem; }
.rep-hero-badge { width:64px; height:64px; border-radius:50%; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.rep-hero-badge-icon { display:flex; align-items:center; justify-content:center; }
.rep-hero-badge-icon svg { width:28px; height:28px; }
.rep-hero-body { flex:1; min-width:0; }
.rep-hero-tier { font-size:.78rem; font-weight:700; text-transform:uppercase; letter-spacing:.08em; color:var(--color-text-muted); }
.rep-hero-score { font-size:2rem; font-weight:800; font-family:var(--font-display); line-height:1.1; color:var(--color-text-primary); }
.rep-hero-pts { font-size:1rem; font-weight:400; color:var(--color-text-muted); }
.rep-progress-bar { width:100%; height:8px; background:rgba(0,0,0,.07); border-radius:8px; overflow:hidden; margin-top:.5rem; }
.rep-progress-fill { height:100%; background:var(--color-aged-gold); border-radius:8px; transition:width .3s ease; }
.rep-tier--newcomer  { background:rgba(107,114,128,.12); color:#6b7280; }
.rep-tier--curious   { background:rgba(59,130,246,.12);  color:#3b82f6; }
.rep-tier--scholar   { background:rgba(16,185,129,.12);  color:#10b981; }
.rep-tier--historian { background:rgba(245,158,11,.12);  color:#f59e0b; }
.rep-tier--archivist { background:rgba(201,152,58,.18);  color:#c9983a; }
.rep-tier-ladder { display:flex; flex-direction:column; gap:.25rem; }
.rep-tier-row { display:flex; align-items:center; gap:.85rem; padding:.55rem .75rem; border-radius:6px; transition:background .12s; border:1px solid transparent; }
.rep-tier-row:hover { background:rgba(0,0,0,.03); }
.rep-tier-row--current { background:rgba(201,152,58,.07); border-color:rgba(201,152,58,.2); }
.rep-tier-row--locked { opacity:.5; }
.rep-tier-icon { width:32px; height:32px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; }
.rep-tier-icon svg { width:16px; height:16px; }
.rep-tier-name { font-size:.9rem; font-weight:500; color:var(--color-text-primary); }
.rep-badge-current { background:rgba(201,152,58,.15); color:#c9983a; font-size:.65rem; font-weight:600; padding:.15em .5em; border-radius:20px; }
.rep-tier-pts { font-size:.8rem; color:var(--color-text-muted); }
.rep-earn-list { display:flex; flex-direction:column; }
.rep-earn-row { display:flex; align-items:center; gap:.85rem; padding:.65rem .25rem; border-bottom:1px solid var(--color-border); }
.rep-earn-row:last-child { border-bottom:none; }
.rep-earn-icon { width:32px; height:32px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; background:rgba(0,0,0,.04); color:var(--color-text-muted); }
.rep-earn-icon svg { width:15px; height:15px; }
.rep-earn-pts { margin-left:auto; }
.badge-pts { background:rgba(201,152,58,.1); color:#b45309; border:1px solid rgba(201,152,58,.2); padding:.2em .65em; border-radius:20px; font-weight:600; font-size:.75rem; }
.rep-log-list { display:flex; flex-direction:column; }
.rep-log-row { display:flex; align-items:center; gap:.75rem; padding:.65rem 1.25rem; border-bottom:1px solid var(--color-border); font-size:.875rem; flex-wrap:wrap; }
.rep-log-row:last-child { border-bottom:none; }
.rep-log-label { color:var(--color-text-primary); flex-grow:1; }
.rep-log-pts { font-weight:700; font-size:.85rem; min-width:40px; text-align:right; }
.rep-log-pts--positive { color:#16a34a; }
.rep-log-pts--negative { color:#dc2626; }
.rep-log-desc { font-size:.78rem; color:var(--color-text-muted); width:100%; margin-top:.1rem; }
.rep-log-date { font-size:.75rem; color:var(--color-text-muted); white-space:nowrap; }
.rep-inline-badge { display:inline-block; font-size:.7rem; font-weight:700; padding:.15em .55em; border-radius:20px; }
.dark-mode .rep-hero-card { background:#161b22; }
.dark-mode .rep-tier-row--current { background:rgba(201,152,58,.06); }
.dark-mode .rep-earn-icon { background:rgba(255,255,255,.05); }
.dark-mode .rep-progress-bar { background:rgba(255,255,255,.08); }
