﻿/* ===== 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);
  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.05rem;
  margin: .4rem 0 .5rem;
  line-height: 1.35;
}
.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: .875rem;
  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.1rem;
  line-height: 1.65;
  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: .975rem;
  line-height: 1.75;
  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.15rem;
  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.2rem;
  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 {
  background: linear-gradient(135deg, rgba(15,28,46,.04) 0%, rgba(201,152,58,.06) 100%);
  border-radius: var(--radius-card);
  padding: 1.75rem 2rem;
  border-bottom: 2px solid rgba(201,152,58,.25);
  margin-bottom: 1.5rem;
}
.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;
  background: rgba(201,152,58,.1);
  color: var(--color-aged-gold);
  border: 1px solid rgba(201,152,58,.25);
  text-decoration: none;
  transition: background .15s;
}
.hero__stat-pill:hover { background: rgba(201,152,58,.2); color: var(--color-aged-gold); }
.hero__stat-pill--link { opacity: .75; }
.dark-mode .hero { background: linear-gradient(135deg, rgba(255,255,255,.02) 0%, rgba(201,152,58,.05) 100%); }

/* ?? 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: .9rem;
  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; }

/* ── 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; }

/* ── 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; }
.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); }

/* "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
   ════════════════════════════════════════════════════════════════════════════ */

/* ── 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; }







