:root {
  --bg:             #F7F5F0;
  --bg-card:        #FFFFFF;
  --text:           #1C1B1A;
  --text-secondary: #4A4641;
  --text-muted:     #8B857A;
  --accent:         #9D1A1A;
  --rule:           #E4DFD5;
  --rule-heavy:     #1C1B1A;
  --cw-bg:          #FFF4F4;
  --cw-text:        #8C1818;
}

:root.dark-mode {
  --bg:             #1C1B1A;
  --bg-card:        #262422;
  --text:           #F7F5F0;
  --text-secondary: #C8C3BC;
  --text-muted:     #8B857A;
  --accent:         #FF6B6B;
  --rule:           #363330;
  --rule-heavy:     #F7F5F0;
  --cw-bg:          #3D1F1F;
  --cw-text:        #FF9E9E;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
}

/* Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
}

.sidebar {
  width: 280px;
  flex-shrink: 0;
  padding: 3rem 1.5rem;
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.main-content {
  flex: 1;
  min-width: 0;
  padding: 3rem 2.5rem;
}

/* Mobile Toggle */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  background: var(--text);
  border: none;
  border-radius: 4px;
  padding: 0.5rem;
  cursor: pointer;
}

.hamburger {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--bg);
  margin: 4px 0;
}

/* Masthead */
.masthead-brand {
  display: flex;
  flex-direction: column;
  margin-bottom: 2rem;
}

.masthead-title {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1.1;
}

.masthead-link {
  color: inherit;
  text-decoration: none;
}

.masthead-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 0.5rem;
}

/* Navigation Links */
.sidebar-nav {
  margin-bottom: 2.5rem;
}

.nav-links {
  list-style: none;
}

.nav-links li {
  margin-bottom: 0.25rem;
}

.nav-link {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: rgba(0,0,0,0.03);
  color: var(--text);
}

.nav-link.active {
  background: rgba(0,0,0,0.05);
  color: var(--text);
  font-weight: 600;
}



.sidebar-footer {
  margin-top: auto;
  padding-top: 2rem;
}

.sidebar-footer-actions {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.cw-toggle {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--rule-heavy);
  border-radius: 40px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.cw-toggle.active {
  background: var(--text);
  color: var(--bg);
}

.cw-toggle:hover { opacity: 0.8; }

.theme-toggle {
  background: transparent;
  border: 1px solid var(--rule-heavy);
  border-radius: 40px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.8rem;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--text);
  color: var(--bg);
}

/* Intro */
.home-intro {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}

.home-stats {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Categories */
.category-section {
  margin-bottom: 5rem;
}

.category-section:last-child {
  margin-bottom: 0;
}

.colophon p { margin-bottom: 0.5rem; }
.colophon p:last-child { margin-bottom: 0; }

.footer-callout {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 1rem !important;
}

.category-eyebrow {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.category-header {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.category-count {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.view-all-link {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  margin-top: 1rem;
  transition: opacity 0.2s ease;
}

.view-all-link:hover {
  opacity: 0.7;
}

/* Entry */
.entry {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  box-shadow: 0 4px 20px rgba(0,0,0,0.02);
  border-radius: 6px;
  padding: 2.5rem 3rem;
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.3s ease;
}

.entry.visible {
  opacity: 1;
  transform: translateY(0);
}

.entry:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.05);
}

.entry-date {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.entry-location {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 1.75rem;
}

.entry-title {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.entry-body {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.entry-source-link {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 1.5rem;
  transition: opacity 0.2s ease;
}
.entry-source-link:hover { opacity: 0.7; }

.entry-tags {
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.entry-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
  margin-top: 1rem;
}

.verified-stamp {
  display: inline-flex;
  align-items: center;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #1A7B4A;
  border: 1px solid #1A7B4A;
  border-radius: 3px;
  padding: 0.15rem 0.4rem;
  line-height: 1.4;
}

/* Image Gallery */
.entry-gallery {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.entry-gallery.gallery-multi {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.entry-gallery.gallery-double {
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.entry-gallery.gallery-single {
  grid-template-columns: 1fr;
}

.gallery-thumb {
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  border-radius: 6px;
  border: 1px solid var(--rule);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  background: var(--bg);
}

.gallery-multi .gallery-thumb {
  aspect-ratio: 1 / 1;
}

.gallery-double .gallery-thumb {
  aspect-ratio: 4 / 3;
}

.gallery-single .gallery-thumb {
  max-width: 350px;
  max-height: 350px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: transparent;
  border: none;
}

.gallery-thumb:hover {
  border-color: var(--text-secondary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.gallery-single .gallery-thumb:hover {
  transform: scale(1.01);
  box-shadow: none;
}

.gallery-multi .gallery-thumb img,
.gallery-double .gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-single .gallery-thumb img {
  max-width: 350px;
  max-height: 350px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--rule);
}

/* Content Warning Bar */
.cw-bar {
  background: var(--cw-bg);
  border-left: 3px solid var(--cw-text);
  border-radius: 0 4px 4px 0;
  padding: 1.25rem 1.5rem;
  margin: 1rem 0 2rem;
}

.cw-bar.hidden { display: none; }
.entry-content.hidden { display: none; }

.cw-bar-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.cw-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cw-text);
  flex-shrink: 0;
}

.cw-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  flex: 1;
  min-width: 150px;
}

.cw-reveal {
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cw-text);
  background: transparent;
  border: 1px solid var(--cw-text);
  border-radius: 3px;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.cw-reveal:hover {
  background: var(--cw-text);
  color: #fff;
}

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(28, 27, 26, 0.95);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.25s ease;
}

.lightbox-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.lightbox-close, .lightbox-nav {
  position: absolute;
  color: rgba(255,255,255,0.6);
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  transition: color 0.15s ease;
}

.lightbox-close {
  top: 1.5rem;
  right: 2rem;
  font-size: 2.5rem;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  padding: 1rem;
}

.lightbox-close:hover, .lightbox-nav:hover { color: #fff; }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  user-select: none;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.lightbox-counter {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.05em;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 5rem 1.5rem;
}

.empty-state.hidden { display: none; }

.empty-text {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.empty-reset {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  background: none;
  border: 1px solid var(--text);
  border-radius: 40px;
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.empty-reset:hover {
  background: var(--text);
  color: var(--bg);
}

/* Footer */
.colophon {
  border-top: 1px solid var(--rule);
  padding: 3rem 1.5rem;
  text-align: left;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-callout {
  font-family: 'Inter', sans-serif !important;
  font-style: normal !important;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.colophon-links { margin-top: 0.5rem; }

.colophon-links a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.colophon-links a:hover { color: var(--text); }

.sep { margin: 0 0.5rem; color: var(--rule); }

/* Responsive */
/* Submit Page */
.submit-intro {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-style: italic;
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 3rem;
  text-align: center;
}

.submit-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto 5rem auto;
}

.submit-card {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  padding: 2.5rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}

.submit-card h3 {
  font-family: 'Libre Baskerville', Georgia, serif;
  font-size: 1.35rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.submit-card p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2rem;
  flex: 1;
}

.submit-btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.8rem 1.5rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 4px;
  text-align: center;
  transition: opacity 0.2s ease;
}
.submit-btn:hover { opacity: 0.9; }

.submit-btn-outline {
  display: inline-block;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--text);
  padding: 0.8rem 1.5rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 4px;
  text-align: center;
  transition: all 0.2s ease;
  margin-bottom: 1rem;
}
.submit-btn-outline:hover {
  background: var(--text);
  color: var(--bg);
}

.submit-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: underline;
  text-align: center;
}
.submit-link:hover {
  color: var(--text);
}

/* Search Input */
.search-container {
  position: relative;
  margin-bottom: 2rem;
}
.search-input {
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  color: var(--text);
  transition: border-color 0.2s ease;
}
.search-input:focus {
  outline: none;
  border-color: var(--text-secondary);
}
.search-input::placeholder {
  color: var(--text-muted);
}
.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 1rem;
  height: 1rem;
}
.clear-search-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
}
.clear-search-btn:hover { color: var(--text); }
.clear-search-btn.hidden { display: none; }

/* Lucide Icon */
.lucide {
  width: 1em;
  height: 1em;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: text-bottom;
}

/* Tag Button */
.tag-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.2s ease;
}
.tag-btn:hover, .tag-btn.active {
  opacity: 0.7;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.active-tag-filter {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--rule);
  color: var(--text);
  padding: 0.25rem 0.75rem;
  border-radius: 40px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.active-tag-filter button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
}
.active-tag-filter button:hover { color: var(--text); }

/* City Filters */
.city-filters-container {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.city-pill {
  background: var(--bg-card);
  border: 1px solid var(--rule);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.4rem 0.8rem;
  border-radius: 40px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.city-pill:hover, .city-pill.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* Share Button */
.share-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: inherit;
  font-size: inherit;
  transition: color 0.2s ease;
  margin-left: auto;
}
.share-btn:hover { color: var(--text); }

/* Load More */
#load-more-trigger {
  height: 50px;
  width: 100%;
}

/* Force light theme for Tally Form */
.tally-container {
  --bg-card:        #FFFFFF;
  --text:           #1C1B1A;
  --text-secondary: #4A4641;
  --rule:           #E4DFD5;
  background: var(--bg-card);
  color: var(--text);
}

@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 900;
    background: var(--bg);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding: 4rem 1.5rem 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  }
  
  .sidebar.open {
    transform: translateY(0);
  }
  
  .main-content {
    padding: 5rem 1.5rem 2rem;
  }

  .entry {
    padding: 1.5rem;
  }
  
  .category-header {
    font-size: 1.8rem;
  }
  
  .entry-title { font-size: 1.35rem; }

  .cw-bar-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .submit-options {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
  }
  .entry { opacity: 1; transform: none; }
}

/* Social Handles */
.social-handles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.social-handle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  background-color: var(--bg-card);
  border: 1px solid var(--rule);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.social-handle svg {
  width: 14px;
  height: 14px;
}

.social-handle:hover {
  background-color: var(--rule);
  color: var(--text);
}