/* ============================================
   NIGHTS – Premium Adult Story Platform
   Cinematic Dark Glossy Mood + Elegant Day Mode
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,500;0,600;0,700;1,500&display=swap');

:root {
  /* Cinematic Dark Theme */
  --bg-primary: #050505;
  --bg-secondary: #0c0c0e;
  --bg-card: #121215;
  --bg-elevated: #1a1a1f;
  --bg-glass: rgba(12, 12, 14, 0.75);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --text-primary: #f8f8f8;
  --text-secondary: #b3b3b3;
  --text-muted: #737373;
  
  /* Rich Champagne Gold */
  --accent: #d4af37;
  --accent-soft: rgba(212, 175, 55, 0.12);
  --accent-glow: rgba(212, 175, 55, 0.35);
  --danger: #e07a7a;
  
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 4px 30px rgba(212, 175, 55, 0.15);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

[data-theme="light"] {
  /* Elegant Ivory Light Theme */
  --bg-primary: #fcfbf9;
  --bg-secondary: #f4f1eb;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.85);
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.15);
  --text-primary: #1a1a1a;
  --text-secondary: #595959;
  --text-muted: #8c8c8c;
  
  --accent: #b0891d;
  --accent-soft: rgba(176, 137, 29, 0.1);
  --accent-glow: rgba(176, 137, 29, 0.2);
  
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  --shadow-glow: 0 4px 20px rgba(176, 137, 29, 0.1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; border-radius: var(--radius-sm); }
a { color: inherit; text-decoration: none; transition: color var(--transition); }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
.container { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* =========================================
   NAVIGATION (Glassmorphism)
   ========================================= */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: var(--bg-glass);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--border);
}
.nav-container {
  max-width: 1100px; margin: 0 auto; padding: 0 24px; height: 72px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.logo-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #96791b);
  color: #050505; border-radius: 10px; font-family: var(--font-display);
  font-weight: 700; font-size: 1.2rem; box-shadow: var(--shadow-glow);
}
.logo-text { font-family: var(--font-display); font-size: 1.4rem; letter-spacing: 0.02em; }
.nav-links { display: flex; gap: 8px; }
.nav-item {
  padding: 8px 18px; border-radius: 30px; font-size: 0.95rem; font-weight: 500;
  color: var(--text-secondary); transition: all var(--transition);
}
.nav-item:hover, .nav-item.active { color: var(--accent); background: var(--accent-soft); }

.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: transparent; border: 1px solid var(--border); color: var(--text-primary);
  font-size: 1.1rem; transition: all var(--transition); cursor: pointer;
}
.theme-toggle:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }

/* =========================================
   HERO / HEADER SECTION
   ========================================= */
.hero {
  position: relative; padding: 140px 24px 60px;
  text-align: center;
  background: radial-gradient(circle at 50% -20%, var(--accent-soft), transparent 60%);
}
.hero-title {
  font-family: var(--font-display); 
  font-size: clamp(2.5rem, 6vw, 4.5rem); 
  font-weight: 700;
  margin-bottom: 16px;
  background: linear-gradient(180deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-subtitle { font-size: 1.1rem; color: var(--text-secondary); max-width: 600px; margin: 0 auto; font-weight: 300; }

/* =========================================
   FEED FILTERS
   ========================================= */
.feed-filters { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 40px; }
.filter-btn {
  padding: 8px 20px; border-radius: 30px; font-size: 0.9rem; font-weight: 500;
  color: var(--text-secondary); background: transparent; border: 1px solid var(--border); 
  transition: all var(--transition);
}
.filter-btn:hover, .filter-btn.active { 
  color: var(--bg-primary); background: var(--accent); border-color: var(--accent);
  box-shadow: 0 4px 15px var(--accent-glow);
}

/* =========================================
   NEW FEED DESIGN (Matches JS structure)
   ========================================= */
.feed-section { padding-bottom: 80px; }
.feed-container { max-width: 1000px; margin: 0 auto; }

/* Hero Post (First Post) */
.hero-section {
  margin-bottom: 60px; padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.hero-section .feed-card {
  background: transparent !important; border: none !important;
}
.hero-section .feed-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem) !important;
}

/* Grid Layout (Rest of Posts) */
.regular-stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}
.feed-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: all var(--transition);
  display: flex; flex-direction: column;
}
.feed-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.feed-card.expanded {
  grid-column: 1 / -1; /* Spans full width when clicked */
  background: var(--bg-elevated);
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: none;
}

/* Metadata & Typography in Feed */
.feed-card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.feed-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: var(--bg-primary);
  display: grid; place-items: center; font-family: var(--font-display); font-weight: 700;
}
.feed-author { font-weight: 600; font-size: 0.95rem; color: var(--text-primary); }
.feed-time { font-size: 0.8rem; color: var(--text-muted); }
.feed-type-badge {
  margin-left: auto; font-size: 0.75rem; padding: 4px 10px; border-radius: 20px;
  background: var(--accent-soft); color: var(--accent); text-transform: uppercase; letter-spacing: 1px;
}

.feed-title { font-family: var(--font-display); color: var(--text-primary); font-weight: 600; line-height: 1.35; }
.feed-excerpt { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.6; }

/* Expanded Content */
.feed-full-content {
  font-size: 1.05rem; line-height: 1.8; color: var(--text-primary); margin-top: 20px;
}
.feed-full-content p { margin-bottom: 1em; }
.feed-full-content img { border-radius: var(--radius-sm); margin: 20px 0; width: 100%; max-height: 500px; object-fit: cover; }

/* Buttons & Tags */
.read-more-btn {
  display: inline-block; width: 100%; padding: 12px; margin-top: auto;
  border-radius: var(--radius-sm); background: var(--bg-secondary);
  color: var(--text-primary); font-weight: 500; font-size: 0.95rem;
  transition: all var(--transition);
}
.read-more-btn:hover { background: var(--accent); color: var(--bg-primary); }

.inline-next {
  display: block; width: 100%; padding: 14px; margin-top: 24px;
  border-radius: var(--radius-sm); background: var(--accent-soft);
  color: var(--accent); font-weight: 600; border: 1px solid var(--accent);
  transition: all var(--transition);
}
.inline-next:hover { background: var(--accent); color: var(--bg-primary); }

.feed-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.feed-tag { font-size: 0.8rem; color: var(--text-muted); padding: 4px 12px; border-radius: 20px; background: var(--bg-secondary); border: 1px solid var(--border); }

/* =========================================
   SERIES & CATEGORIES
   ========================================= */
.series-grid, .category-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 24px;
}
.series-card, .category-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; transition: all var(--transition); text-align: center; cursor: pointer;
}
.series-card:hover, .category-card:hover {
  border-color: var(--accent); box-shadow: var(--shadow-glow); transform: translateY(-4px);
}
.series-card-title, .category-card h3 { font-family: var(--font-display); font-size: 1.25rem; color: var(--text-primary); margin-bottom: 8px; }

/* =========================================
   CATEGORY TICKER (left-to-right auto-scroll strip, below the navbar —
   never part of <nav class="nav-links">)
   ========================================= */
.category-ticker {
  overflow: hidden; white-space: nowrap; background: var(--bg-secondary);
  border-bottom: 1px solid var(--border); padding: 9px 0;
  position: sticky; top: var(--nav-h, 70px); z-index: 90;
}
.category-ticker-track { display: inline-flex; gap: 10px; animation: category-ticker-scroll 55s linear infinite; }
.category-ticker:hover .category-ticker-track { animation-play-state: paused; }
.category-ticker-item {
  flex-shrink: 0; font-size: 0.82rem; font-weight: 500; color: var(--text-secondary);
  text-decoration: none; padding: 5px 14px; border-radius: 999px;
  border: 1px solid var(--border); white-space: nowrap; transition: color var(--transition), border-color var(--transition);
}
.category-ticker-item:hover { color: var(--accent); border-color: var(--accent); }
@keyframes category-ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .category-ticker-track { animation: none; padding-left: 0; overflow-x: auto; }
}
@media (max-width: 768px) {
  .category-ticker { top: var(--nav-h, 62px); }
}

/* =========================================
   CATEGORY INTRO + THEMED SECTION BACKGROUNDS
   Deliberately gradient/color-mood based, not photographic — no licensed
   image source for "category photos", and this site's own DMCA/Content
   Removal pages commit to not using real people's images without rights.
   Scoped to .section-header only (via body.cat-theme-*), never the whole
   page, so story cards below stay on the normal readable background.
   ========================================= */
.cat-intro { margin: -8px 0 28px; max-width: 760px; }
.cat-intro h2 { font-family: var(--font-display); font-size: 1.3rem; color: var(--text-primary); margin-bottom: 8px; }
.cat-intro p { color: var(--text-secondary); line-height: 1.7; }

.section-header { transition: background var(--transition); border-radius: var(--radius); }
body.cat-theme-danger .section-header { background: radial-gradient(circle at 20% 0%, rgba(224,122,122,0.18), transparent 65%); }
body.cat-theme-luxury .section-header { background: radial-gradient(circle at 20% 0%, var(--accent-glow), transparent 65%); }
body.cat-theme-mystic .section-header { background: radial-gradient(circle at 20% 0%, rgba(155,120,224,0.18), transparent 65%); }
body.cat-theme-rose .section-header { background: radial-gradient(circle at 20% 0%, rgba(224,122,170,0.18), transparent 65%); }
body.cat-theme-earthy .section-header { background: radial-gradient(circle at 20% 0%, rgba(196,148,90,0.18), transparent 65%); }
body.cat-theme-warm .section-header { background: radial-gradient(circle at 20% 0%, rgba(224,180,110,0.16), transparent 65%); }
body.cat-theme-accent .section-header { background: radial-gradient(circle at 20% 0%, var(--accent-soft), transparent 65%); }
[class*="cat-theme-"] .section-header { padding: 20px 20px 4px; margin: -20px -20px 0; }

/* Category hero background image (photo or mood-art SVG, resolved at
   build time by script/blog-builder.js's resolveCategoryBackground()).
   The inline background-image (set per-page) already bakes in a dark
   gradient overlay for text contrast, so this just handles the shared
   box treatment — bigger padding, rounded corners, light text. */
.cat-hero {
  padding: 56px 24px 40px !important;
  margin: -20px -20px 0 !important;
  border-radius: var(--radius);
  background-color: #0a0a0a;
}
.cat-hero .section-title,
.cat-hero .section-desc { color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,0.5); }
.cat-hero .section-desc { color: rgba(255,255,255,0.82); }
@media (max-width: 640px) { .cat-hero { padding: 44px 18px 32px !important; } }

/* =========================================
   MID-PAGE STORY PROMO
   Auto-inserted before the footer by assets/js/story-promo.js on every
   public content page — a "you might also like" grid so pages that
   would otherwise end at a legal/FAQ/premium page's own content still
   give the reader a next click into a story.
   ========================================= */
.story-promo { border-top: 1px solid var(--border); padding: 56px 0; background: var(--bg-secondary); }
.story-promo-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.story-promo-head { text-align: center; margin-bottom: 28px; }
.story-promo-eyebrow { display: block; color: var(--accent); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px; }
.story-promo-head h2 { font-family: var(--font-display); font-size: clamp(1.4rem, 3vw, 1.8rem); color: var(--text-primary); margin: 0; }
.story-promo-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.story-promo-card {
  display: block; text-decoration: none; border-radius: var(--radius); overflow: hidden;
  background: var(--bg-card); border: 1px solid var(--border);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.story-promo-card:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.story-promo-media { aspect-ratio: 16/10; background: var(--bg-secondary); overflow: hidden; }
.story-promo-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-promo-body { padding: 12px 14px 16px; }
.story-promo-cat { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); }
.story-promo-body h3 {
  font-family: var(--font-display); font-size: 0.95rem; font-weight: 600; color: var(--text-primary);
  margin: 6px 0 0; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
@media (max-width: 860px) { .story-promo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .story-promo-grid { grid-template-columns: 1fr; } }

/* =========================================
   FOOTER
   ========================================= */
.footer { border-top: 1px solid var(--border); padding: 60px 0 40px; background: var(--bg-secondary); }
.footer-note { font-size: 0.9rem; color: var(--accent); margin-bottom: 16px; text-align: center; }
.footer-copy { font-size: 0.85rem; color: var(--text-muted); text-align: center; margin-top: 32px; line-height: 1.7; }
/* Plain, static credit line — never colorful or blinking. */
.footer-credit { font-size: 0.78rem; color: var(--text-muted); text-align: center; margin-top: 8px; opacity: .8; }

.footer-inner { display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between; text-align: left; }
.footer-brand { flex: 0 0 220px; }
.footer-tagline { font-size: 0.85rem; color: var(--text-muted); margin: 10px 0 14px; }
.footer-social { display: flex; flex-wrap: wrap; gap: 10px; }
.footer-social a {
  font-size: 0.8rem; color: var(--text-secondary); text-decoration: none;
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border);
  transition: color var(--transition), border-color var(--transition);
}
.footer-social a:hover { color: var(--accent); border-color: var(--accent); }

.footer-newsletter { margin-top: 18px; max-width: 260px; }
.footer-newsletter h4 { font-size: 0.82rem; color: var(--text-primary); margin: 0 0 8px; }
.footer-newsletter-form { display: flex; gap: 8px; }
.footer-newsletter-form input {
  flex: 1; min-width: 0; font: inherit; font-size: 0.82rem; padding: 8px 10px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text-primary);
}
.footer-newsletter-form input:focus { outline: none; border-color: var(--accent); }
.footer-newsletter-form button {
  font: inherit; font-size: 0.8rem; font-weight: 600; padding: 8px 14px; white-space: nowrap;
  border-radius: var(--radius-sm); border: none; background: var(--accent); color: var(--bg-primary); cursor: pointer;
}
.footer-newsletter-form button:hover { opacity: .9; }
.footer-newsletter-form button:disabled { opacity: .6; cursor: default; }
.footer-newsletter-hint { font-size: 0.76rem; color: var(--text-muted); margin: 6px 0 0; min-height: 1em; }

.footer-cats { margin-top: 20px; }
.footer-cats-title { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 8px; }
.footer-cats-list { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-cats-list a {
  font-size: 0.78rem; color: var(--text-secondary); text-decoration: none;
  padding: 4px 10px; border-radius: 999px; background: var(--bg-elevated);
}
.footer-cats-list a:hover { color: var(--accent); }

.footer-links { display: flex; flex-wrap: wrap; gap: 40px; flex: 1 1 auto; justify-content: flex-end; }
.footer-col h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-primary); margin: 0 0 12px; }
.footer-col { display: flex; flex-direction: column; gap: 8px; min-width: 140px; }
.footer-col a { font-size: 0.85rem; color: var(--text-muted); text-decoration: none; }
.footer-col a:hover { color: var(--accent); }

@media (max-width: 720px) {
  .footer-inner { flex-direction: column; gap: 28px; }
  /* flex-wrap here used to left-align each .footer-col at its own
     min-width (140px), so on a narrow screen two columns would clump
     together on the left with a big unused gap on the right, and any
     odd column out (Legal) restarted flush-left below them — the
     "footer text squeezed to one side" look. A real 2-column grid fills
     the actual available width evenly instead. */
  .footer-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px 20px; }
  .footer-col { min-width: 0; }
}

@media (max-width: 420px) {
  .footer-links { grid-template-columns: 1fr; }
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
  .hero { padding: 120px 20px 40px; }
  .regular-stories-grid { grid-template-columns: 1fr; gap: 20px; }
  .nav-links { display: none; } /* Add toggle logic if needed */
  .feed-card { padding: 16px; }
  .hero-section .feed-title { font-size: 1.8rem !important; }
}