/* ============================================
   SECOND SELF STUDIOS - Complete Stylesheet
   Palette: Iron & Gold
   Zero inline styles needed in HTML files.
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=Source+Sans+3:wght@300;400;500;600&display=swap');

/* --- Palette --- */
:root {
  --bg:          #131313;
  --bg-card:     #1C1C1C;
  --bg-hover:    #242424;
  --border:      #2C2C2C;
  --text:        #C5C0B8;
  --text-muted:  #808080;
  --gold:        #C9A84C;
  --gold-dim:    #A8893E;
  --teal:        #4ECDC4;
  --teal-dim:    #3DA89F;
  --heading:     #EDEBE8;
  --white:       #FFFFFF;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Source Sans 3', 'Segoe UI', sans-serif;
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --ease: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--teal); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--teal-dim); }
img { max-width: 100%; display: block; }

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--heading);
  font-weight: 300;
  line-height: 1.3;
}
h1 { font-size: 2.25rem; letter-spacing: 1px; }
h2 { font-size: 1.5rem; letter-spacing: 0.5px; }
h3 { font-size: 1.125rem; font-weight: 400; }

/* --- Labels (section headers, categories) --- */
.label {
  font-size: 0.625rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-family: var(--font-body);
  font-weight: 500;
}
.label--gold  { color: var(--gold); }
.label--teal  { color: var(--teal); }
.label--muted { color: var(--text-muted); }

/* --- Layout --- */
.container        { max-width: 800px;  margin: 0 auto; padding: 0 var(--space-xl); }
.container--narrow { max-width: 640px; margin: 0 auto; padding: 0 var(--space-xl); }
.page-body        { padding-top: 56px; padding-bottom: var(--space-3xl); }

/* --- Site Header --- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 999;
  background: rgba(19, 19, 19, 0.9);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--space-xl);
}
.site-logo {
  display: flex; align-items: center; gap: var(--space-sm);
  cursor: pointer; text-decoration: none;
}
.site-logo__second {
  font-family: var(--font-display); font-size: 1rem;
  font-weight: 600; color: var(--white); letter-spacing: 1px;
}
.site-logo__self {
  font-family: var(--font-display); font-size: 1rem;
  font-weight: 600; color: var(--teal); letter-spacing: 1px;
}
.site-logo__studios {
  font-family: var(--font-display); font-size: 1rem;
  font-weight: 300; color: var(--text-muted); letter-spacing: 1px;
}
.site-nav {
  display: flex; gap: var(--space-lg); align-items: center; list-style: none;
}
.site-nav a {
  font-size: 0.6875rem; letter-spacing: 2px; text-transform: uppercase;
  color: var(--text-muted); font-family: var(--font-body);
  transition: color var(--ease);
}
.site-nav a:hover,
.site-nav a.active { color: var(--teal); }

/* --- Breadcrumbs --- */
.breadcrumbs {
  display: flex; gap: var(--space-sm); align-items: center;
  margin-bottom: var(--space-md);
}
.breadcrumbs a { font-size: 0.6875rem; }
.breadcrumbs__sep { font-size: 0.625rem; color: var(--text-muted); }
.breadcrumbs__current { font-size: 0.6875rem; color: var(--text); }

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: var(--space-lg);
  transition: border-color var(--ease);
}
.card:hover { border-color: var(--gold-dim); }
.card--clickable { cursor: pointer; }
.card + .card { margin-top: var(--space-sm); }

/* --- Character Card --- */
.character-card {
  display: flex; gap: var(--space-md); align-items: center;
}
.character-card__portrait {
  width: 48px; height: 48px; border-radius: 50%;
  background: linear-gradient(135deg, var(--bg-hover), var(--bg-card));
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 1.125rem;
  font-family: var(--font-display);
  flex-shrink: 0; overflow: hidden;
}
.character-card__portrait img {
  width: 100%; height: 100%; object-fit: cover;
}
.character-card__name {
  font-size: 0.875rem; color: var(--heading);
  font-family: var(--font-display); margin-bottom: 2px;
}
.character-card__role {
  font-size: 0.6875rem; color: var(--teal); margin-bottom: 4px;
}
.character-card__note {
  font-size: 0.75rem; color: var(--text-muted); font-style: italic;
}

/* --- Story Card --- */
.story-card__header {
  display: flex; justify-content: space-between;
  align-items: baseline; margin-bottom: var(--space-sm);
}
.story-card__title {
  font-size: 1rem; font-weight: 400; color: var(--heading);
  font-family: var(--font-display);
}
.story-card__time {
  font-size: 0.6875rem; color: var(--text-muted);
  flex-shrink: 0; margin-left: var(--space-md);
}
.story-card__excerpt {
  font-size: 0.8125rem; color: var(--text-muted);
  font-style: italic; line-height: 1.6;
}

/* --- Audio Player --- */
.audio-bar {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px var(--space-lg);
  display: flex; align-items: center; gap: 14px;
}
.audio-bar__play {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(78, 205, 196, 0.08);
  border: 1px solid rgba(78, 205, 196, 0.25);
  display: flex; align-items: center; justify-content: center;
  color: var(--teal); font-size: 0.875rem;
  cursor: pointer; flex-shrink: 0;
}
.audio-bar__play:hover { background: rgba(78, 205, 196, 0.15); }
.audio-bar__info { flex: 1; }
.audio-bar__title { font-size: 0.75rem; color: var(--text); margin-bottom: 4px; }
.audio-bar__track {
  height: 3px; background: var(--border);
  border-radius: 2px; overflow: hidden;
}
.audio-bar__progress {
  height: 100%; background: var(--teal);
  border-radius: 2px; width: 0%;
}
.audio-bar__duration {
  font-size: 0.6875rem; color: var(--text-muted);
  font-family: monospace; flex-shrink: 0;
}

/* --- Tags --- */
.tag-group { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.tag {
  font-size: 0.625rem; padding: 4px 12px; border-radius: 4px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); cursor: pointer;
  transition: border-color var(--ease);
}
.tag:hover { border-color: var(--teal-dim); }
.tag--character {
  border-radius: 20px;
  background: rgba(78, 205, 196, 0.06);
  border-color: rgba(78, 205, 196, 0.15);
  color: var(--teal-dim);
}

/* --- Prose (story/lore body text) --- */
.prose { font-size: 1rem; line-height: 1.85; color: var(--text); }
.prose p { margin-bottom: var(--space-lg); }
.prose p:first-child { color: var(--heading); }
.drop-cap::first-letter {
  font-size: 3rem; font-weight: 300; color: var(--gold);
  float: left; line-height: 0.85; margin-right: 8px; margin-top: 4px;
  font-family: var(--font-display);
}

/* --- Location Hero --- */
.location-hero {
  position: relative;
  padding: var(--space-3xl) var(--space-xl) var(--space-xl);
  margin-top: 56px;
}
.location-hero h1 { margin-bottom: var(--space-xs); }
.location-hero__subtitle {
  font-size: 0.875rem; color: var(--gold);
  font-family: var(--font-display);
  letter-spacing: 3px; font-style: italic;
}

/* --- Story Page --- */
.story-header {
  padding-top: var(--space-2xl);
}
.story-meta {
  display: flex; gap: var(--space-md); align-items: center;
  flex-wrap: wrap; margin-bottom: var(--space-md);
}
.story-meta__time {
  font-size: 0.6875rem; color: var(--text-muted);
}
.story-meta__sep {
  color: var(--border);
}
.story-meta__location {
  font-size: 0.6875rem; color: var(--gold);
}
.story-continuation {
  text-align: center;
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--border);
  margin-top: var(--space-md);
}
.story-continuation p {
  font-size: 0.75rem; color: var(--text-muted); font-style: italic;
}
.related-story {
  display: flex; justify-content: space-between; align-items: center;
}
.related-story__arrow {
  color: var(--teal); font-size: 1rem;
}

/* --- Map --- */
#map { width: 100%; height: calc(100vh - 56px); margin-top: 56px; }
.map-placeholder {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; height: 200px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 0.6875rem;
  letter-spacing: 4px; text-transform: uppercase;
}

/* --- Divider --- */
.divider {
  width: 40px; height: 1px; background: var(--gold);
  opacity: 0.3; margin: var(--space-xl) auto;
}

/* --- Sections --- */
.section { margin-bottom: var(--space-2xl); }
.section__label { margin-bottom: var(--space-md); }

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-2xl) var(--space-xl);
  text-align: center; margin-top: var(--space-3xl);
}
.site-footer p { font-size: 0.75rem; color: var(--text-muted); }

/* --- Link Resets (for wrapping cards in <a> tags) --- */
a.card-link { text-decoration: none; color: inherit; display: block; }
a.map-link  { font-size: 0.75rem; letter-spacing: 1px; }

/* --- Spacing Utilities --- */
.mt-xs  { margin-top: var(--space-xs); }
.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mt-xl  { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mb-xs  { margin-bottom: var(--space-xs); }
.mb-sm  { margin-bottom: var(--space-sm); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }
.mb-xl  { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

/* --- Text Utilities --- */
.text-center { text-align: center; }
.text-gold   { color: var(--gold); }
.text-teal   { color: var(--teal); }
.text-muted  { color: var(--text-muted); }

/* --- Responsive --- */
@media (max-width: 768px) {
  :root { --space-xl: 20px; }
  h1 { font-size: 1.75rem; }
  .site-nav { gap: var(--space-md); }
  .site-nav a { font-size: 0.625rem; letter-spacing: 1px; }
  .site-logo__studios { display: none; }
}
@media (max-width: 480px) {
  .site-header { padding: 0 var(--space-md); }
  .container, .container--narrow { padding: 0 var(--space-md); }
}


/* ============================================
   ADDITIONS - Paste at end of styles.css
   ============================================ */

/* --- Homepage --- */
.home-hero {
  text-align: center;
  padding: var(--space-3xl) 0 var(--space-xl);
}
.home-hero__label {
  margin-bottom: var(--space-md);
}
.home-hero__title {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}
.home-hero__desc {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  max-width: 560px;
  margin: 0 auto var(--space-lg);
}
.home-hero__note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-style: italic;
}

.home-card__link {
  font-size: 0.75rem;
  color: var(--teal);
  letter-spacing: 1px;
}

/* --- 404 Page --- */
.error-page {
  text-align: center;
  padding-top: var(--space-3xl);
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.error-code {
  font-family: var(--font-display);
  font-size: 8rem;
  font-weight: 300;
  color: var(--border);
  line-height: 1;
  margin-bottom: var(--space-lg);
}
.error-title {
  font-size: 1.75rem;
  color: var(--heading);
  margin-bottom: var(--space-md);
}
.error-desc {
  font-size: 1rem;
  color: var(--text);
  max-width: 420px;
  line-height: 1.7;
  margin-bottom: var(--space-xl);
}
.error-links {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  justify-content: center;
}
.error-btn {
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 12px 24px;
  border: 1px solid var(--teal);
  border-radius: 4px;
  color: var(--teal);
  transition: all var(--ease);
}
.error-btn:hover {
  background: rgba(78, 205, 196, 0.1);
  color: var(--teal);
}
.error-btn--secondary {
  border-color: var(--border);
  color: var(--text-muted);
}
.error-btn--secondary:hover {
  border-color: var(--gold-dim);
  color: var(--gold);
  background: rgba(201, 168, 76, 0.05);
}
.error-flavor {
  margin-top: var(--space-3xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
  max-width: 380px;
}
.error-flavor p {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
}

@media (max-width: 600px) {
  .error-code { font-size: 5rem; }
  .error-title { font-size: 1.4rem; }
  .home-hero__title { font-size: 1.75rem; }
  .error-links { flex-direction: column; width: 100%; max-width: 260px; }
  .error-btn { width: 100%; text-align: center; }
}

/* ============================================
   ADDITIONS — Paste at end of styles.css
   ============================================ */

/* --- Homepage Map --- */
#map {
  width: 100%;
  height: calc(100vh - 56px);
  margin-top: 56px;
  background: var(--bg);
}

/* --- Map Fallback (when no map image exists yet) --- */
.map-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 40% 45%, rgba(201, 168, 76, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 55%, rgba(78, 205, 196, 0.03) 0%, transparent 50%),
    var(--bg);
}
.map-fallback__content {
  text-align: center;
  max-width: 440px;
  padding: var(--space-xl);
}
.map-fallback__icon {
  font-size: 2.5rem;
  color: var(--gold);
  opacity: 0.4;
  margin-bottom: var(--space-md);
}
.map-fallback__title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 300;
  color: var(--heading);
  margin-bottom: var(--space-md);
}
.map-fallback__desc {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: var(--space-xl);
}
.map-fallback__links {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  align-items: center;
}
.map-fallback__links a {
  font-size: 0.75rem;
  letter-spacing: 1px;
  color: var(--teal);
}
.map-fallback__sep {
  color: var(--border);
}

/* --- Hub Pages --- */
.hub-card__location {
  font-size: 0.6875rem;
  color: var(--gold);
  margin-top: var(--space-sm);
}
.hub-card__date {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

/* --- Home Cards (shared by hub pages) --- */
.home-card__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--heading);
  margin-bottom: var(--space-xs);
}
.home-card__subtitle {
  font-size: 0.8125rem;
  color: var(--gold);
  font-family: var(--font-display);
  letter-spacing: 2px;
  font-style: italic;
  margin-bottom: var(--space-md);
}
.home-card__desc {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text);
}

/* --- 404 Page --- */
.error-page {
  text-align: center;
  padding-top: var(--space-3xl);
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.error-code {
  font-family: var(--font-display);
  font-size: 8rem;
  font-weight: 300;
  color: var(--border);
  line-height: 1;
  margin-bottom: var(--space-lg);
}
.error-title {
  font-size: 1.75rem;
  color: var(--heading);
  font-family: var(--font-display);
  margin-bottom: var(--space-md);
}
.error-desc {
  font-size: 1rem;
  color: var(--text);
  max-width: 400px;
  line-height: 1.7;
  margin-bottom: var(--space-xl);
}
.error-links {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
}
.error-btn {
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 12px 24px;
  border: 1px solid var(--teal);
  border-radius: 4px;
  color: var(--teal);
  transition: all var(--ease);
}
.error-btn:hover {
  background: rgba(78, 205, 196, 0.1);
  color: var(--teal);
}

@media (max-width: 600px) {
  .error-code { font-size: 5rem; }
  .error-title { font-size: 1.4rem; }
  .error-links { flex-direction: column; width: 100%; max-width: 260px; }
  .error-btn { width: 100%; text-align: center; }
}


/* ============================================
   MAP PINS & POPUPS — Paste at end of styles.css
   (These replace the old JS-injected styles)
   ============================================ */

/* --- Map Pin Base --- */
.map-pin div {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  cursor: pointer;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.6));
}
.map-pin div:hover {
  transform: scale(1.3);
}

/* --- Pin Types --- */
.map-pin--city     { color: #FF6B6B; font-size: 18px; }
.map-pin--region   { color: var(--gold); font-size: 22px; }
.map-pin--landmark { color: var(--text-muted); font-size: 16px; }
.map-pin--ruin     { color: #8B4513; font-size: 16px; }
.map-pin--npc      { color: var(--teal); font-size: 14px; }
.map-pin--shop     { color: #E8A87C; font-size: 14px; }
.map-pin--district { color: var(--gold-dim); font-size: 16px; opacity: 0.7; }

/* --- Leaflet Popup --- */
.leaflet-popup-content-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}
.leaflet-popup-tip {
  background: var(--bg-card);
}
.map-popup {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--text);
}
.map-popup strong {
  color: var(--teal-dim);
  font-family: var(--font-display);
  font-size: 0.9375rem;
}
.map-popup__tagline {
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-style: italic;
}
.map-popup a {
  color: var(--teal);
  font-size: 0.75rem;
}
.leaflet-popup-close-button {
  color: var(--text-muted);
}
.leaflet-popup-close-button:hover {
  color: var(--heading);
}

/* ============================================
   HOMEPAGE — Paste at end of styles.css
   ============================================ */












.container--wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-3xl);
}

.site-logo__icon {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  margin-right: var(--space-xs);
}

/* ============================================
   SIDEBAR + TYPOGRAPHY UPGRADE
   Replace old map pin CSS and add these.
   ============================================ */

/* --- Typography Bump --- */
h1 { font-size: 2.75rem; letter-spacing: 1px; }
h2 { font-size: 1.75rem; letter-spacing: 0.5px; }
h3 { font-size: 1.25rem; font-weight: 400; }

.site-nav a {
  font-size: 0.8125rem;
  letter-spacing: 3px;
}
.site-logo__second,
.site-logo__self,
.site-logo__studios {
  font-size: 1.125rem;
}



#map-sidebar {
  position: absolute;
  top: 0;
  right: 0;
  width: 440px;
  height: 100%;
  background: rgba(19, 19, 19, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 1px solid var(--border);
  z-index: 900;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overflow-x: hidden;
}
#map-sidebar.is-open {
  transform: translateX(0);
}

/* Sidebar close button */
.sidebar__close {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: flex-end;
  padding: 16px 20px 8px;
  z-index: 2;
}
.sidebar__close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 1.125rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ease);
}
.sidebar__close-btn:hover {
  border-color: var(--teal-dim);
  color: var(--heading);
}

/* Sidebar content */
#map-sidebar-content {
  padding: 0 28px 32px;
}

.sidebar__type {
  font-size: 0.625rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  font-family: var(--font-body);
  font-weight: 500;
  margin-bottom: 8px;
}

.sidebar__name {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 300;
  color: var(--heading);
  line-height: 1.2;
  margin-bottom: 6px;
}

.sidebar__tagline {
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.sidebar__divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.sidebar__desc {
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--text);
}

/* Quick facts grid */
.sidebar__facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.sidebar__fact {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar__fact-label {
  font-size: 0.625rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.sidebar__fact-value {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--heading);
}

/* Sidebar section label */
.sidebar__section-label {
  font-size: 0.625rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 500;
  margin-bottom: 12px;
}

/* Character entries */
.sidebar__character {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.sidebar__character + .sidebar__character {
  border-top: 1px solid var(--border);
}
.sidebar__character-initial {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 1rem;
  flex-shrink: 0;
}
.sidebar__character-name {
  font-size: 0.875rem;
  color: var(--heading);
  font-family: var(--font-display);
}
.sidebar__character-role {
  font-size: 0.6875rem;
  color: var(--teal-dim);
}

/* Story entries */
.sidebar__story {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color var(--ease);
  text-decoration: none;
}
.sidebar__story:hover {
  border-color: var(--gold-dim);
}
.sidebar__story + .sidebar__story {
  margin-top: 6px;
}
.sidebar__story-title {
  font-size: 0.875rem;
  color: var(--heading);
  font-family: var(--font-display);
}
.sidebar__story-time {
  font-size: 0.6875rem;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 12px;
}

/* Explore link */
.sidebar__explore {
  display: block;
  text-align: center;
  padding: 12px 20px;
  border: 1px solid var(--teal);
  border-radius: 6px;
  color: var(--teal);
  font-size: 0.8125rem;
  letter-spacing: 1px;
  transition: all var(--ease);
}
.sidebar__explore:hover {
  background: rgba(78, 205, 196, 0.1);
  color: var(--teal);
}

/* Region name labels on map */
.map-label {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}
.map-label--region {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 300;
  color: var(--heading);
  letter-spacing: 4px;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(0,0,0,0.8), 0 0 16px rgba(0,0,0,0.6);
  white-space: nowrap;
}

/* Scrollbar styling for sidebar */
#map-sidebar::-webkit-scrollbar {
  width: 4px;
}
#map-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
#map-sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* Mobile */
@media (max-width: 768px) {
  #map-sidebar {
    width: 100%;
  }
  .sidebar__name {
    font-size: 1.5rem;
  }
}

/* ============================================
   FULL-SCREEN MAP HOMEPAGE
   Replace old homepage + map-section CSS with this.
   Keep the sidebar CSS from the previous update.
   ============================================ */

/* --- Full-screen map page --- */
.page-map {
  overflow: hidden;
  height: 100vh;
}
.page-map #map {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  height: auto;
  margin-top: 0;
  border-radius: 0;
  border: none;
  z-index: 1;
}

/* --- Transparent header for map page --- */
.site-header--transparent {
  background: linear-gradient(to bottom, rgba(19, 19, 19, 0.85), rgba(19, 19, 19, 0));
  border-bottom: none;
}

/* --- Landing Overlay --- */
.map-landing {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 850;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(19,19,19,0.6) 0%, rgba(19,19,19,0.85) 100%);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.map-landing.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.map-landing__content {
  text-align: center;
  padding: var(--space-xl);
}

.map-landing__label {
  font-size: 0.8125rem;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 500;
  margin-bottom: var(--space-lg);
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
  opacity: 0.85;
}

.map-landing__title {
  font-family: var(--font-display);
  font-size: 5rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 20px;
  margin-bottom: var(--space-md);
  text-shadow: 0 2px 30px rgba(0,0,0,0.7);
}

.map-landing__sub {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 400;
  color: var(--white);
  letter-spacing: 2px;
  margin-bottom: var(--space-2xl);
  text-shadow: 0 2px 16px rgba(0,0,0,0.6);
  opacity: 0.8;
}

.map-landing__btn {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--white);
  background: rgba(19, 19, 19, 0.8);
  border: 2px solid var(--gold);
  padding: 16px 48px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.map-landing__btn:hover {
  background: rgba(19, 19, 19, 0.95);
  box-shadow: 0 0 24px rgba(201, 168, 76, 0.25);
}

/* --- Sidebar (full-screen positioning) --- */
.page-map #map-sidebar {
  position: fixed;
  top: 56px;
  right: 0;
  width: 440px;
  height: calc(100vh - 56px);
  z-index: 900;
}

/* --- Zoom control repositioned --- */
.page-map .leaflet-top.leaflet-right {
  top: 12px;
  right: 12px;
}
.leaflet-control-zoom a {
  background: var(--bg-card) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
.leaflet-control-zoom a:hover {
  background: var(--bg-hover) !important;
  color: var(--heading) !important;
}

/* --- Mobile --- */
@media (max-width: 768px) {
  .map-landing__title {
    font-size: 3rem;
    letter-spacing: 8px;
  }
  .map-landing__sub {
    font-size: 1rem;
  }
  .map-landing__btn {
    padding: 12px 28px;
    font-size: 0.75rem;
  }
  .page-map #map-sidebar {
    width: 100%;
  }
}
/* --- Map Labels (all pin types) --- */
.map-label {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}
.map-label span {
  white-space: nowrap;
  text-shadow:
    0 0 6px rgba(0,0,0,0.9),
    0 0 12px rgba(0,0,0,0.7),
    0 0 20px rgba(0,0,0,0.4);
}
.map-label--region {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 400;
  color: var(--heading);
  letter-spacing: 6px;
  text-transform: uppercase;
}
.map-label--city {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 400;
  color: var(--heading);
  letter-spacing: 2px;
}
.map-label--landmark {
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1px;
}
.map-label--ruin {
  font-family: var(--font-body);
  font-size: 10px;
  color: #8B4513;
  letter-spacing: 1px;
  font-style: italic;
}
/* ============================================
   HUB PAGE UPGRADES
   Paste at end of styles.css
   ============================================ */

/* --- Hub Header --- */
.hub-header {
  padding-top: var(--space-xl);
  margin-bottom: var(--space-lg);
}
.hub-header h1 {
  margin-bottom: var(--space-sm);
}
.hub-header__desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 560px;
}

/* --- Hub Filters --- */
.hub-filters {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
}
.tag--active {
  border-color: var(--teal-dim);
  color: var(--teal);
  background: rgba(78, 205, 196, 0.08);
}

/* --- Hub List --- */
.hub-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* --- Hub Entry Card --- */
.hub-entry {
  padding: var(--space-lg) var(--space-xl);
}
.hub-entry__meta {
  margin-bottom: var(--space-sm);
}
.hub-entry__date {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  margin-bottom: var(--space-sm);
}
.hub-entry__title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 300;
  color: var(--heading);
  margin-bottom: var(--space-sm);
}
.hub-entry__desc {
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: var(--space-md);
}
.hub-entry__tags {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.hub-entry__tag {
  font-size: 0.5625rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
}

/* ============================================
   LORE + JOURNAL PAGES
   Paste at end of styles.css
   ============================================ */

/* --- Lore Header --- */
.lore-header {
  padding-top: var(--space-xl);
  margin-bottom: var(--space-lg);
}
.lore-header__meta {
  margin-bottom: var(--space-md);
}
.lore-header h1 {
  margin-bottom: var(--space-md);
}
.lore-header__summary {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 300;
  font-style: italic;
  line-height: 1.7;
  color: var(--text);
}

/* --- Lore Quick Reference --- */
.lore-quickref {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.lore-quickref__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lore-quickref__label {
  font-size: 0.625rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}
.lore-quickref__value {
  font-size: 0.875rem;
  color: var(--heading);
  font-weight: 500;
}

/* --- Lore Related Links --- */
.lore-related {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.lore-related__link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  transition: border-color var(--ease);
}
.lore-related__link:hover {
  border-color: var(--gold-dim);
}
.lore-related__type {
  font-size: 0.625rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  min-width: 80px;
}
.lore-related__name {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--heading);
}

/* --- Prose subheadings (for lore + journal) --- */
.prose h2 {
  font-size: 1.25rem;
  color: var(--gold);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
}

/* --- Journal Header --- */
.journal-header {
  padding-top: var(--space-xl);
  margin-bottom: var(--space-lg);
}
.journal-header__date {
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}
.journal-header h1 {
  margin-bottom: var(--space-md);
}
.journal-header__tags {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .lore-quickref {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   CHARACTER PAGES
   Paste at end of styles.css
   ============================================ */

/* --- Character Header --- */
.char-header {
  padding-top: var(--space-xl);
  margin-bottom: var(--space-lg);
}
.char-header__top {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  margin-bottom: var(--space-lg);
}
.char-header__portrait {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bg-hover), var(--bg-card));
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.char-header__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.char-header__initial {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 300;
  color: var(--text-muted);
}
.char-header__info h1 {
  margin-bottom: var(--space-xs);
}
.char-header__location {
  font-size: 0.875rem;
  color: var(--text-muted);
}
.char-header__location a {
  color: var(--teal-dim);
}
.char-header__quote {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-style: italic;
  font-weight: 300;
  color: var(--text-muted);
  line-height: 1.7;
  padding-left: var(--space-lg);
  border-left: 2px solid var(--gold-dim);
}

/* --- Character Facts --- */
.char-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.char-facts__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.char-facts__label {
  font-size: 0.625rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}
.char-facts__value {
  font-size: 0.875rem;
  color: var(--heading);
  font-weight: 500;
}

/* --- Character Appearances --- */
.char-appearances {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.char-appearance {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* --- Character Connections --- */
.char-connections {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

/* --- Character Grid (hub page) --- */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-md);
}
.char-card {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-lg) var(--space-xl);
}
.char-card__portrait {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bg-hover), var(--bg));
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.char-card__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.char-card__portrait span {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-muted);
}
.char-card__name {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--heading);
  margin-bottom: 2px;
}
.char-card__role {
  font-size: 0.75rem;
  color: var(--teal-dim);
  margin-bottom: 2px;
}
.char-card__location {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .char-header__top {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }
  .char-header__portrait {
    width: 72px;
    height: 72px;
  }
  .char-facts {
    grid-template-columns: 1fr;
  }
  .char-grid {
    grid-template-columns: 1fr;
  }
}
