:root {
  --bg: #0b0b0f;
  --bg-soft: #12121a;
  --surface: #181824;
  --surface-2: #222233;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #ff6b35;
  --accent-2: #ff9f1c;
  --accent-glow: rgba(255, 107, 53, 0.35);
  --border: rgba(148, 163, 184, 0.18);
  --chip: #1a1a28;
  --chip-active: rgba(255, 107, 53, 0.18);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

.hidden { display: none !important; }

body.lb-open,
body.modal-open {
  overflow: hidden;
}

/* Ad slots hidden until ads-config.js sets data-ads=on */
html:not([data-ads="on"]) .ad-slot {
  display: none !important;
}

html[data-ads="on"] .ad-slot:not(.ad-active):not(.ad-infeed-native) {
  display: none !important;
}

/* Age gate */
#age-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  overflow: hidden;
}

.gate-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 107, 53, 0.25), transparent 40%),
    radial-gradient(circle at 80% 10%, rgba(255, 159, 28, 0.18), transparent 35%),
    linear-gradient(160deg, #0b0b0f, #151525 55%, #0b0b0f);
}

.gate-card {
  position: relative;
  z-index: 1;
  max-width: 28rem;
  width: 100%;
  background: rgba(24, 24, 36, 0.92);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  padding: 2.25rem 2rem;
  text-align: center;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.gate-logo {
  font-family: "Space Grotesk", sans-serif;
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-bottom: 0.35rem;
}

.gate-logo span { color: var(--accent); }

.gate-tagline {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 0.75rem;
  line-height: 1.25;
}

.gate-sub {
  font-size: 0.95rem;
  color: var(--muted);
}

.gate-pills {
  font-size: 0.82rem;
  color: var(--accent-2);
  font-weight: 600;
}

.gate-tag {
  color: var(--accent-2);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 1rem;
}

.gate-card p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0.65rem 0;
}

.gate-warn { color: #fecaca; }

.gate-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 0.9rem 1.35rem;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #111;
  box-shadow: 0 10px 28px var(--accent-glow);
}

.btn-ghost {
  background: var(--chip);
  color: var(--muted);
  border: 1px solid var(--border);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 11, 15, 0.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.header-top {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.9rem 1rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 800;
  font-size: 1.55rem;
  letter-spacing: -0.04em;
  flex-shrink: 0;
}

.logo-accent { color: var(--accent); }

.search-wrap {
  flex: 1;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.1rem;
  height: 1.1rem;
  fill: var(--muted);
  pointer-events: none;
}

#search {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.72rem 1rem 0.72rem 2.6rem;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--text);
}

#search:focus {
  outline: 2px solid rgba(255, 107, 53, 0.45);
  outline-offset: 1px;
}

.hero {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.35rem 1rem 0.75rem;
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 768px) {
  .hero { grid-template-columns: 1fr 1.2fr; align-items: end; }
}

.hero h1 {
  font-family: "Space Grotesk", sans-serif;
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.03em;
}

.hero-sub {
  margin: 0.5rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
  max-width: 36rem;
}

#hero-stats {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.date-counts,
.cat-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-start;
}

.date-pill,
.cat-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.date-pill strong,
.cat-pill strong {
  color: var(--text);
  margin-left: 0.25rem;
}

/* Browse bar + calendar modal */
.browse-bar {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-browse {
  flex-shrink: 0;
  padding: 0.65rem 1.1rem;
  font-size: 0.88rem;
}

.browse-context {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.browse-day-nav {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.browse-step {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--chip);
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease;
}

.browse-step:hover {
  border-color: rgba(255, 107, 53, 0.55);
  color: #ffd7c2;
}

.date-modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.date-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 8, 0.72);
  backdrop-filter: blur(4px);
}

.date-modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 26rem);
  max-height: min(92vh, 36rem);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 1.1rem 1rem 1rem;
}

.date-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.date-modal-header h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.date-modal-close {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--chip);
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.date-modal-close:hover {
  color: var(--text);
  border-color: rgba(255, 107, 53, 0.45);
}

.date-modal-month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

#cal-month-label {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1rem;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  margin-bottom: 0.35rem;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.3rem;
}

.cal-cell {
  aspect-ratio: 1;
  min-height: 2.6rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--chip);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  padding: 0.2rem;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.cal-cell-empty {
  background: transparent;
  border: none;
  pointer-events: none;
}

.cal-cell-disabled {
  opacity: 0.28;
  cursor: not-allowed;
}

.cal-day-num {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
}

.cal-day-count {
  font-size: 0.58rem;
  font-weight: 600;
  opacity: 0.9;
  line-height: 1;
}

.cal-heat-1 {
  background: rgba(255, 107, 53, 0.12);
  border-color: rgba(255, 107, 53, 0.18);
}

.cal-heat-2 {
  background: rgba(255, 107, 53, 0.22);
  border-color: rgba(255, 107, 53, 0.28);
}

.cal-heat-3 {
  background: rgba(255, 107, 53, 0.34);
  border-color: rgba(255, 107, 53, 0.42);
}

.cal-heat-4 {
  background: rgba(255, 107, 53, 0.48);
  border-color: rgba(255, 159, 28, 0.55);
  color: #fff4eb;
}

.cal-cell:not(.cal-cell-disabled):not(.cal-cell-empty):hover {
  transform: translateY(-1px);
  border-color: rgba(255, 159, 28, 0.65);
  box-shadow: 0 6px 16px rgba(255, 107, 53, 0.2);
}

.cal-cell-selected {
  outline: 2px solid var(--accent-2);
  outline-offset: 1px;
}

.date-modal-footer {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.date-modal-footer .btn {
  flex: 1;
  padding: 0.7rem 0.85rem;
  font-size: 0.84rem;
}

/* Legacy chip styles (admin) */
.filters {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem 0.85rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.chip-day {
  font-size: 0.8rem;
  padding: 0.42rem 0.8rem;
}

.filters::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  background: var(--chip);
  color: var(--text);
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.chip-emoji { font-size: 1rem; }

.chip.active {
  background: var(--chip-active);
  border-color: rgba(255, 107, 53, 0.55);
  color: #ffd7c2;
  box-shadow: inset 0 0 0 1px rgba(255, 107, 53, 0.15);
}

.chip-count {
  font-size: 0.72rem;
  opacity: 0.8;
}

/* Main layout */
.main-layout {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.75rem 1rem 5rem;
  display: grid;
  gap: 1rem;
}

@media (min-width: 1100px) {
  .main-layout {
    grid-template-columns: 1fr 320px;
    align-items: start;
  }
}

.content-area { min-width: 0; }

.stats {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 0.85rem;
}

/* Ad placements */
.ad-slot {
  border: 1px dashed rgba(148, 163, 184, 0.45);
  background: repeating-linear-gradient(
    -45deg,
    rgba(24, 24, 36, 0.9),
    rgba(24, 24, 36, 0.9) 12px,
    rgba(28, 28, 45, 0.9) 12px,
    rgba(28, 28, 45, 0.9) 24px
  );
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  text-align: center;
  gap: 0.25rem;
  padding: 0.75rem;
  color: #64748b;
}

.ad-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
}

.ad-size {
  font-size: 0.72rem;
  color: #64748b;
}

.ad-banner.ad-native-loaded {
  min-height: 0;
  margin-bottom: 0.85rem;
}

.ad-banner-bottom { margin-top: 1.25rem; }

.ad-rail { display: none; }

@media (min-width: 1100px) {
  .ad-rail {
    display: block;
  }
  .ad-rail-sticky {
    position: sticky;
    top: 5.5rem;
    display: grid;
    gap: 1rem;
  }
  .ad-tower {
    min-height: 0;
  }
  .ad-tower:first-child { min-height: 0; }
}

.ad-infeed {
  min-height: 0;
  cursor: default;
  box-shadow: none;
}

.ad-infeed:hover { transform: none; }

.ad-infeed-native {
  grid-column: 1 / -1 !important;
  width: 100%;
  min-height: 0;
  padding: 0;
  margin: 0.25rem 0;
  background: transparent;
  border: none;
  border-radius: var(--radius);
  display: none;
  overflow: visible;
  text-align: left;
  place-items: unset;
}

.ad-infeed-native.ad-has-content {
  display: block !important;
  min-height: 0;
  padding: 0.35rem 0;
  background: var(--surface);
  border: 1px solid var(--border);
}

.ad-infeed-native.ad-empty {
  display: none !important;
}

.ad-infeed-native ins {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
}

.ad-infeed-native .exo-native-widget {
  display: flex !important;
  width: 100% !important;
  max-width: 100% !important;
}

.ad-infeed-native .exo-native-widget-outer-container {
  display: flex !important;
  flex-wrap: wrap !important;
  width: 100% !important;
  max-width: 100% !important;
}

.ad-infeed-native .exo-native-widget-outer-container .exo-native-widget-item-container {
  flex: 0 0 25% !important;
  max-width: 25% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

@media (max-width: 720px) {
  .ad-infeed-native .exo-native-widget-outer-container .exo-native-widget-item-container {
    flex: 0 0 50% !important;
    max-width: 50% !important;
  }
}

.ad-infeed-native .exo-native-widget-item-title {
  color: #e2e8f0 !important;
}

.ad-infeed-native .exo-native-widget-item-text {
  color: #94a3b8 !important;
}

/* ExoClick native — top/bottom/lightbox rails */
.ad-native-rail.ad-native-loaded,
.ad-lightbox.ad-native-loaded {
  min-height: 0;
  padding: 0.5rem 0;
  background: transparent;
  border: none;
}

.ad-native-rail .exo-native-widget,
.ad-lightbox .exo-native-widget {
  width: 100% !important;
  max-width: 100% !important;
}

.ad-native-rail .exo-native-widget-item-title,
.ad-lightbox .exo-native-widget-item-title {
  color: #e2e8f0 !important;
}

/* ExoClick native — desktop sidebar (single column) */
.ad-native-sidebar.ad-native-loaded {
  min-height: 0;
  padding: 0;
  background: transparent;
  border: none;
}

.ad-native-sidebar .exo-native-widget {
  width: 100% !important;
  max-width: 300px !important;
}

.ad-native-sidebar .exo-native-widget-outer-container .exo-native-widget-item-container {
  flex-basis: 100% !important;
}

.ad-native-sidebar .exo-native-widget-item-title {
  color: #e2e8f0 !important;
  font-size: 12px !important;
}

.ad-tower.ad-native-loaded {
  min-height: 0;
}

.ad-lightbox.hidden {
  display: none !important;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.9rem; }
}

@media (min-width: 960px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1200px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.card {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
}

.card img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: var(--surface-2);
}

.card .badge {
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  background: rgba(11, 11, 15, 0.78);
  color: white;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.card.broken {
  opacity: 0.45;
  border-style: dashed;
}

.card.broken::after {
  content: "missing";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.ad-slot.ad-infeed-native,
.ad-slot.ad-native-rail,
.ad-slot.ad-native-sidebar {
  display: block !important;
  place-items: unset !important;
  text-align: left !important;
  background: transparent;
  border: none;
  padding: 0;
}

.ad-slot.ad-infeed-native.ad-has-content,
.ad-slot.ad-native-sidebar.ad-has-content {
  background: var(--surface);
  border: 1px solid var(--border);
}

.ad-slot.ad-empty {
  display: none !important;
}

.loader, .empty, .error {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
}

.error {
  color: #fecaca;
  background: rgba(127, 29, 29, 0.25);
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.load-more {
  display: block;
  margin: 1.75rem auto 0;
}

.site-footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  color: #64748b;
  font-size: 0.78rem;
  border-top: 1px solid var(--border);
}

.footer-admin {
  color: #475569;
  text-decoration: none;
}

.footer-admin:hover {
  color: var(--accent);
}

/* Lightbox */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4, 4, 8, 0.94);
  display: grid;
  place-items: center;
  padding: 1rem;
}

#lightbox:not(.hidden) {
  overflow-y: auto;
}

.lb-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  max-width: min(96vw, 920px);
  width: 100%;
}

#lightbox img {
  max-width: 100%;
  max-height: 68vh;
  border-radius: 14px;
  object-fit: contain;
  box-shadow: var(--shadow);
}

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 52px;
  height: 52px;
  border-radius: 999px;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
  transition: background 0.15s ease;
}

.lb-nav:hover:not(:disabled) {
  background: rgba(255, 107, 53, 0.35);
}

.lb-nav:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.lb-prev { left: max(0.75rem, 2vw); }
.lb-next { right: max(0.75rem, 2vw); }

.lb-counter {
  color: #e2e8f0;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}

.ad-lightbox {
  width: 100%;
  min-height: 0;
  max-width: 728px;
  padding: 0;
  background: transparent;
  border: none;
}

.ad-lightbox.ad-native-loaded .exo-native-widget {
  width: 100% !important;
  max-width: 100% !important;
}

.ad-lightbox.ad-empty {
  display: none !important;
}

#lightbox .close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.15);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  font-size: 1.5rem;
  cursor: pointer;
}

#lightbox .meta {
  color: white;
  font-size: 0.85rem;
  opacity: 0.9;
  background: rgba(0, 0, 0, 0.45);
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  text-align: center;
}
