/*
Theme Name: Tamil Kathaigal Pro
Theme URI: https://yourwebsite.com
Author: Your Name
Author URI: https://yourwebsite.com
Description: A professional, SEO-optimized, fully responsive Tamil adult stories theme with dark/light mode, age verification, and all 18+ legal compliance features built-in.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tamil-kathaigal
Tags: dark-mode, responsive, seo-optimized, adult-content, stories, tamil
*/

/* ================================================
   CSS CUSTOM PROPERTIES - DESIGN TOKENS
   ================================================ */
:root {
  /* Light Mode Colors */
  --bg-primary: #faf8f5;
  --bg-secondary: #f0ece4;
  --bg-card: #ffffff;
  --bg-header: #1a0a0a;
  --text-primary: #1a1209;
  --text-secondary: #5c4a32;
  --text-muted: #8c7a62;
  --text-inverse: #faf8f5;
  --accent-primary: #c0392b;
  --accent-secondary: #e74c3c;
  --accent-gold: #d4a017;
  --accent-glow: rgba(192, 57, 43, 0.15);
  --border-color: #e0d5c5;
  --border-subtle: #ede8df;
  --shadow-sm: 0 2px 8px rgba(26, 9, 9, 0.08);
  --shadow-md: 0 4px 20px rgba(26, 9, 9, 0.12);
  --shadow-lg: 0 8px 40px rgba(26, 9, 9, 0.16);
  --shadow-card: 0 2px 12px rgba(26, 9, 9, 0.06);
  --header-height: 70px;
  --reading-width: 760px;
  --sidebar-width: 300px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-display: 'Noto Serif Tamil', 'Lora', Georgia, serif;
  --font-body: 'Noto Sans Tamil', 'Source Serif 4', Georgia, serif;
  --font-ui: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="dark"] {
  --bg-primary: #0d0808;
  --bg-secondary: #150d0d;
  --bg-card: #1c1010;
  --bg-header: #0a0505;
  --text-primary: #f0e8df;
  --text-secondary: #c4a882;
  --text-muted: #7a6248;
  --text-inverse: #0d0808;
  --accent-primary: #e05555;
  --accent-secondary: #ff6b6b;
  --accent-gold: #f0c040;
  --accent-glow: rgba(224, 85, 85, 0.2);
  --border-color: #2a1818;
  --border-subtle: #1e1212;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* ================================================
   RESET & BASE
   ================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
}

body.age-gate-active { overflow: hidden; }

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-secondary); }
ul, ol { list-style: none; }

/* ================================================
   TYPOGRAPHY
   ================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-tagline,
.widget-title,
.section-label {
  font-family: var(--font-ui);
}

/* ================================================
   AGE GATE MODAL (18+ Compliance)
   ================================================ */
#age-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(10, 5, 5, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#age-gate-overlay.hidden { display: none; }

.age-gate-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 50px 40px;
  max-width: 520px;
  width: 100%;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
  position: relative;
  overflow: hidden;
}

.age-gate-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-gold), var(--accent-primary));
  background-size: 200% 100%;
  animation: shimmer 2s infinite linear;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.age-gate-icon {
  font-size: 64px;
  margin-bottom: 20px;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(192, 57, 43, 0.4));
}

.age-gate-box h2 {
  font-size: 2rem;
  color: var(--accent-primary);
  margin-bottom: 12px;
}

.age-gate-box p {
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 8px;
}

.age-gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-primary);
  color: white;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 14px;
  border-radius: 100px;
  margin-bottom: 24px;
}

.age-gate-buttons {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

.age-gate-buttons button {
  flex: 1;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
}

.btn-enter {
  background: var(--accent-primary);
  color: white;
  box-shadow: 0 4px 20px rgba(192, 57, 43, 0.4);
}

.btn-enter:hover {
  background: var(--accent-secondary);
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(192, 57, 43, 0.5);
}

.btn-exit {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color) !important;
}

.btn-exit:hover { background: var(--border-color); }

.age-gate-legal {
  margin-top: 20px;
  font-size: 0.78rem !important;
  color: var(--text-muted) !important;
}

/* ================================================
   COOKIE CONSENT BAR
   ================================================ */
#cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  background: var(--bg-header);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  box-shadow: 0 -4px 30px rgba(0,0,0,0.4);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#cookie-consent.show { transform: translateY(0); }
#cookie-consent.hidden { display: none; }

.cookie-text {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: rgba(255,255,255,0.8);
  flex: 1;
}

.cookie-text a { color: var(--accent-secondary); }

.cookie-buttons { display: flex; gap: 10px; flex-shrink: 0; }

.btn-cookie-accept {
  background: var(--accent-primary);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background var(--transition);
}

.btn-cookie-accept:hover { background: var(--accent-secondary); }

.btn-cookie-decline {
  background: transparent;
  color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.2);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-cookie-decline:hover { border-color: rgba(255,255,255,0.5); color: white; }

/* ================================================
   READING PROGRESS BAR
   ================================================ */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-gold));
  z-index: 10000;
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(192, 57, 43, 0.6);
}

/* ================================================
   HEADER
   ================================================ */
#site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-header);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  height: var(--header-height);
  transition: all var(--transition);
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.header-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Logo */
.site-branding { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.site-logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 20px rgba(192, 57, 43, 0.4);
}

.site-title-wrap {}

.site-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: #fff;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.site-title span { color: var(--accent-gold); }

.site-tagline {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

/* Navigation */
#primary-nav ul {
  display: flex;
  gap: 4px;
  align-items: center;
}

#primary-nav ul li a {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

#primary-nav ul li a:hover,
#primary-nav ul li.current-menu-item > a {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

/* Header Controls */
.header-controls { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Search */
.header-search-form {
  position: relative;
  display: flex;
  align-items: center;
}

.header-search-input {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 100px;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  padding: 8px 16px 8px 40px;
  width: 200px;
  transition: all var(--transition);
  outline: none;
}

.header-search-input::placeholder { color: rgba(255,255,255,0.35); }
.header-search-input:focus { width: 260px; border-color: var(--accent-primary); background: rgba(255,255,255,0.12); }

.search-icon {
  position: absolute;
  left: 13px;
  color: rgba(255,255,255,0.4);
  font-size: 14px;
  pointer-events: none;
}

/* Dark Mode Toggle */
#theme-toggle {
  width: 44px;
  height: 24px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 100px;
  cursor: pointer;
  position: relative;
  transition: background var(--transition);
  flex-shrink: 0;
  padding: 0;
}

#theme-toggle::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

[data-theme="dark"] #theme-toggle::before { transform: translateX(20px); }
[data-theme="dark"] #theme-toggle { background: var(--accent-primary); }

.theme-toggle-label {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
}

/* 18+ Badge in Header */
.adult-badge-header {
  background: var(--accent-primary);
  color: white;
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.06em;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.08);
  border: none;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all var(--transition);
}

/* Mobile Nav Overlay */
#mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg-header);
  flex-direction: column;
  padding: 100px 30px 30px;
  gap: 8px;
  overflow-y: auto;
}

#mobile-nav.active { display: flex; }

#mobile-nav a {
  font-family: var(--font-ui);
  font-size: 1.2rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: all var(--transition);
}

#mobile-nav a:hover { color: white; background: rgba(255,255,255,0.08); }

.mobile-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

/* ================================================
   HERO / BANNER
   ================================================ */
.site-hero {
  background: linear-gradient(135deg, #1a0505 0%, #2d1010 50%, #1a0808 100%);
  padding: 60px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(192, 57, 43, 0.2);
}

.site-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 50%, rgba(192, 57, 43, 0.15) 0%, transparent 70%);
}

.hero-inner { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }

.hero-inner h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: #fff;
  margin-bottom: 16px;
  line-height: 1.2;
}

.hero-inner h1 span { color: var(--accent-gold); }

.hero-inner p {
  font-family: var(--font-ui);
  color: rgba(255,255,255,0.6);
  font-size: 1rem;
  max-width: 500px;
  margin: 0 auto 28px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.hero-stat strong {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--accent-gold);
  font-weight: 800;
}

.hero-stat span {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ================================================
   CATEGORY PILLS
   ================================================ */
.category-strip {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0;
  position: sticky;
  top: var(--header-height);
  z-index: 500;
  transition: background var(--transition);
}

.category-strip-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  align-items: center;
}

.category-strip-inner::-webkit-scrollbar { display: none; }

.cat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: all var(--transition);
  border-bottom: 3px solid transparent;
  flex-shrink: 0;
}

.cat-pill:hover { color: var(--accent-primary); border-bottom-color: var(--accent-primary); }
.cat-pill.active { color: var(--accent-primary); border-bottom-color: var(--accent-primary); }

.cat-pill-count {
  background: var(--border-color);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 100px;
}

/* ================================================
   LAYOUT
   ================================================ */
.site-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
}

.content-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 40px;
  padding: 40px 0;
  align-items: start;
}

/* ================================================
   POST CARDS
   ================================================ */
.posts-grid { display: flex; flex-direction: column; gap: 16px; }

.story-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.story-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--accent-primary);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform var(--transition);
  border-radius: 4px 0 0 4px;
}

.story-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--accent-primary);
  transform: translateY(-2px);
}

.story-card:hover::before { transform: scaleY(1); }

.story-card-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--border-color);
  line-height: 1;
  flex-shrink: 0;
  min-width: 48px;
  text-align: center;
  transition: color var(--transition);
}

.story-card:hover .story-card-number { color: var(--accent-primary); opacity: 0.4; }

.story-card-content { flex: 1; min-width: 0; }

.story-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.story-cat-tag {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-primary);
  background: var(--accent-glow);
  padding: 3px 10px;
  border-radius: 100px;
  border: 1px solid rgba(192, 57, 43, 0.2);
}

.story-card-date {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.story-card-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.35;
  transition: color var(--transition);
}

.story-card-title a { color: inherit; }
.story-card:hover .story-card-title a { color: var(--accent-primary); }

.story-card-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.story-card-stats {
  display: flex;
  gap: 16px;
}

.story-stat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.story-stat svg { width: 14px; height: 14px; opacity: 0.7; }

.read-more-btn {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.03em;
}

.read-more-btn::after {
  content: '→';
  transition: transform var(--transition);
}

.story-card:hover .read-more-btn::after { transform: translateX(4px); }

/* Featured Card */
.story-card.featured {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-secondary));
  border-color: var(--accent-gold);
  padding: 28px;
}

.story-card.featured::before { background: var(--accent-gold); }

.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent-gold);
  color: #1a0808;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
}

/* Hot badge */
.hot-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #ff4444, #ff8800);
  color: white;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 100px;
  animation: pulse-hot 2s infinite;
}

@keyframes pulse-hot {
  0%, 100% { box-shadow: 0 0 6px rgba(255, 68, 68, 0.4); }
  50% { box-shadow: 0 0 16px rgba(255, 68, 68, 0.7); }
}

/* ================================================
   SECTION HEADERS
   ================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  display: block;
  width: 4px;
  height: 22px;
  background: var(--accent-primary);
  border-radius: 4px;
}

.section-view-all {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ================================================
   SIDEBAR
   ================================================ */
.sidebar { position: sticky; top: calc(var(--header-height) + 60px); }

.widget {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 20px;
  transition: border-color var(--transition);
}

.widget:hover { border-color: var(--border-color); }

.widget-title {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

/* Popular Posts Widget */
.popular-posts-list { display: flex; flex-direction: column; gap: 14px; }

.popular-post-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.popular-post-item:last-child { border-bottom: none; padding-bottom: 0; }

.popular-post-rank {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--border-color);
  line-height: 1;
  min-width: 28px;
  flex-shrink: 0;
}

.popular-post-item:nth-child(1) .popular-post-rank { color: var(--accent-gold); }
.popular-post-item:nth-child(2) .popular-post-rank { color: var(--text-muted); }
.popular-post-item:nth-child(3) .popular-post-rank { color: #cd7f32; }

.popular-post-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  transition: color var(--transition);
}

.popular-post-title:hover { color: var(--accent-primary); }

.popular-post-views {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Category Cloud Widget */
.category-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

.cloud-tag {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  white-space: nowrap;
}

.cloud-tag:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

/* Recent Posts Widget */
.recent-post-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.recent-post-item:last-child { border-bottom: none; }

.recent-post-title {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  transition: color var(--transition);
}

.recent-post-title:hover { color: var(--accent-primary); }

.recent-post-date {
  font-family: var(--font-ui);
  font-size: 0.73rem;
  color: var(--text-muted);
}

/* ================================================
   SINGLE POST / STORY VIEW
   ================================================ */
.story-header {
  background: var(--bg-secondary);
  padding: 48px 0 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 0;
}

.story-header-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px 40px;
}

.story-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.story-breadcrumb a { color: var(--text-muted); }
.story-breadcrumb a:hover { color: var(--accent-primary); }
.story-breadcrumb-sep { opacity: 0.4; }

.story-categories { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.story-cat-link {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-primary);
  background: var(--accent-glow);
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid rgba(192, 57, 43, 0.2);
  transition: all var(--transition);
}

.story-cat-link:hover { background: var(--accent-primary); color: white; }

.entry-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 20px;
  max-width: 820px;
}

.story-meta-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

.story-meta-item { display: flex; align-items: center; gap: 6px; }

.story-meta-item svg { width: 14px; height: 14px; opacity: 0.6; }

.story-meta-item a { color: var(--text-muted); }
.story-meta-item a:hover { color: var(--accent-primary); }

/* Reading Settings Bar */
.reading-settings-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 0;
  position: sticky;
  top: var(--header-height);
  z-index: 490;
  transition: background var(--transition);
}

.reading-settings-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.reading-settings-label {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.font-size-controls { display: flex; align-items: center; gap: 6px; }

.font-ctrl-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.9rem;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.font-ctrl-btn:hover { background: var(--accent-primary); color: white; border-color: var(--accent-primary); }

.font-size-display {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 30px;
  text-align: center;
}

.font-family-select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition);
}

.font-family-select:focus { border-color: var(--accent-primary); }

.reading-width-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  transition: all var(--transition);
}

.reading-width-btn:hover,
.reading-width-btn.active { background: var(--accent-primary); color: white; border-color: var(--accent-primary); }

/* Story Body */
.single-content-layout {
  max-width: 1300px;
  margin: 0 auto;
  padding: 40px 24px;
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 40px;
  align-items: start;
}

.entry-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 48px 52px;
  font-family: var(--font-body);
  font-size: var(--reading-font-size, 1.05rem);
  line-height: 1.85;
  color: var(--text-primary);
  transition: all var(--transition);
}

.entry-content p {
  margin-bottom: 1.5em;
  color: var(--text-primary);
}

.entry-content p:last-child { margin-bottom: 0; }

.entry-content h2 {
  font-family: var(--font-display);
  font-size: 1.4em;
  margin: 1.8em 0 0.8em;
  color: var(--accent-primary);
  border-left: 4px solid var(--accent-primary);
  padding-left: 14px;
}

.entry-content h3 {
  font-family: var(--font-display);
  font-size: 1.2em;
  margin: 1.5em 0 0.6em;
}

.entry-content blockquote {
  border-left: 4px solid var(--accent-gold);
  padding: 16px 24px;
  background: var(--bg-secondary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.5em 0;
  font-style: italic;
  color: var(--text-secondary);
}

/* Story Navigation */
.story-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 32px;
}

.story-nav-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all var(--transition);
}

.story-nav-btn:hover { border-color: var(--accent-primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }

.story-nav-label {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

/* Tags */
.story-tags-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}

.tags-label {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 12px;
}

.tags-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

.story-tag {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.story-tag:hover { background: var(--accent-primary); color: white; border-color: var(--accent-primary); }

/* Share Section */
.story-share-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 24px;
  text-align: center;
}

.share-title {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}

.share-buttons { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

.share-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  color: white;
}

.share-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,0.2); }
.share-btn-copy { background: var(--text-muted); }
.share-btn-wa { background: #25d366; }
.share-btn-tg { background: #0088cc; }
.share-btn-fb { background: #1877f2; }
.share-btn-tw { background: #1da1f2; }

.share-btn-copy.copied { background: #2ecc71 !important; }

/* Related Stories */
.related-stories-section { margin-top: 40px; }

.related-stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.related-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition);
}

.related-card:hover { border-color: var(--accent-primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }

.related-card-cat {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.related-card-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 10px;
  transition: color var(--transition);
}

.related-card:hover .related-card-title { color: var(--accent-primary); }

.related-card-excerpt {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.related-card-read {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-primary);
}

/* ================================================
   PAGINATION
   ================================================ */
.pagination-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 40px 0;
  flex-wrap: wrap;
}

.page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  font-family: var(--font-ui);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.page-btn:hover, .page-btn.current {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(192, 57, 43, 0.3);
}

/* ================================================
   ARCHIVE / CATEGORY PAGE
   ================================================ */
.archive-header {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
  padding: 40px 0;
  border-bottom: 1px solid var(--border-color);
}

.archive-header-inner {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
}

.archive-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.archive-title span { color: var(--accent-primary); }

.archive-description {
  color: var(--text-secondary);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  max-width: 600px;
}

.archive-count {
  margin-top: 12px;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ================================================
   SEARCH PAGE
   ================================================ */
.search-hero {
  background: var(--bg-secondary);
  padding: 48px 0;
  border-bottom: 1px solid var(--border-color);
}

.search-hero-inner {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}

.search-hero h1 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin-bottom: 20px;
}

.search-hero h1 span { color: var(--accent-primary); }

.big-search-form {
  display: flex;
  gap: 10px;
}

.big-search-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 1rem;
  padding: 14px 20px;
  outline: none;
  transition: border-color var(--transition);
}

.big-search-input:focus { border-color: var(--accent-primary); }

.big-search-btn {
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 24px;
  font-family: var(--font-ui);
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition);
}

.big-search-btn:hover { background: var(--accent-secondary); }

/* ================================================
   FOOTER
   ================================================ */
#site-footer {
  background: var(--bg-header);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 60px 0 0;
  margin-top: 60px;
}

.footer-grid {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
}

.footer-brand-col .site-title { color: white; font-size: 1.4rem; }
.footer-brand-col .site-tagline { margin-bottom: 16px; display: block; }

.footer-desc {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.7;
  margin-bottom: 20px;
}

.footer-adult-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(192, 57, 43, 0.15);
  border: 1px solid rgba(192, 57, 43, 0.3);
  color: var(--accent-secondary);
  font-family: var(--font-ui);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-md);
}

.footer-col-title {
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 800;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 18px;
}

.footer-links { display: flex; flex-direction: column; gap: 10px; }

.footer-links a {
  font-family: var(--font-ui);
  font-size: 0.88rem;
  color: rgba(255,255,255,0.55);
  transition: color var(--transition);
}

.footer-links a:hover { color: rgba(255,255,255,0.9); }

/* Footer Bottom */
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 20px 24px;
}

.footer-bottom-inner {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-copyright {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: rgba(255,255,255,0.3);
}

.footer-legal-links { display: flex; gap: 16px; flex-wrap: wrap; }

.footer-legal-links a {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
  transition: color var(--transition);
}

.footer-legal-links a:hover { color: rgba(255,255,255,0.7); }

/* Footer Warning */
.footer-warning {
  background: rgba(192, 57, 43, 0.08);
  border-top: 1px solid rgba(192, 57, 43, 0.15);
  border-bottom: 1px solid rgba(192, 57, 43, 0.15);
  padding: 14px 24px;
  text-align: center;
}

.footer-warning p {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
  max-width: 900px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ================================================
   SCROLL TO TOP
   ================================================ */
#scroll-top-btn {
  position: fixed;
  bottom: 30px;
  right: 24px;
  width: 46px;
  height: 46px;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 16px rgba(192, 57, 43, 0.4);
  transition: all var(--transition);
  z-index: 5000;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

#scroll-top-btn.visible { opacity: 1; pointer-events: all; transform: translateY(0); }
#scroll-top-btn:hover { background: var(--accent-secondary); transform: translateY(-3px); box-shadow: 0 6px 22px rgba(192, 57, 43, 0.5); }

/* ================================================
   BACK TO TOP FLOATING READ BAR (single post)
   ================================================ */
#floating-read-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 4999;
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
}

#floating-read-bar.show { transform: translateY(0); opacity: 1; }

.floating-read-title {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.floating-progress-track {
  flex: 1;
  height: 4px;
  background: var(--border-color);
  border-radius: 100px;
  overflow: hidden;
}

.floating-progress-fill {
  height: 100%;
  background: var(--accent-primary);
  border-radius: 100px;
  width: 0%;
  transition: width 0.15s linear;
}

/* ================================================
   TABLE OF CONTENTS
   ================================================ */
.toc-widget {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
}

.toc-title {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toc-list { display: flex; flex-direction: column; gap: 6px; }

.toc-list a {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition);
  border-left: 2px solid transparent;
}

.toc-list a:hover,
.toc-list a.active {
  background: var(--accent-glow);
  color: var(--accent-primary);
  border-left-color: var(--accent-primary);
}

/* ================================================
   NOTICE / DISCLAIMER BOXES
   ================================================ */
.content-disclaimer {
  background: rgba(212, 160, 23, 0.08);
  border: 1px solid rgba(212, 160, 23, 0.25);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 24px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.disclaimer-icon { font-size: 18px; flex-shrink: 0; }

.disclaimer-text {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.disclaimer-text strong { color: var(--text-primary); }

/* ================================================
   EMPTY STATE
   ================================================ */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.5; }

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

/* ================================================
   UTILITY
   ================================================ */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0; }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

/* ================================================
   ANIMATIONS
   ================================================ */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in-up { animation: fade-in-up 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards; }

.story-card { animation: fade-in-up 0.35s cubic-bezier(0.4, 0, 0.2, 1) both; }
.story-card:nth-child(1) { animation-delay: 0.05s; }
.story-card:nth-child(2) { animation-delay: 0.10s; }
.story-card:nth-child(3) { animation-delay: 0.15s; }
.story-card:nth-child(4) { animation-delay: 0.20s; }
.story-card:nth-child(5) { animation-delay: 0.25s; }

/* ================================================
   RESPONSIVE — LARGE DESKTOP (1200px+)
   ================================================ */
@media (min-width: 1200px) {
  .site-container { padding: 0 32px; }
  .header-inner    { padding: 0 32px; }
}

/* ================================================
   RESPONSIVE — TABLET LANDSCAPE (900px–1199px)
   ================================================ */
@media (max-width: 1199px) {
  :root { --sidebar-width: 260px; }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  .entry-content { padding: 36px 36px; }

  .header-search-input { width: 160px; }
  .header-search-input:focus { width: 200px; }
}

/* ================================================
   RESPONSIVE — TABLET PORTRAIT (768px–899px)
   ================================================ */
@media (max-width: 899px) {
  :root {
    --header-height: 62px;
    --sidebar-width: 240px;
  }

  /* Header */
  #primary-nav      { display: none; }
  .hamburger        { display: flex; }
  .adult-badge-header { display: none; }
  .header-search-input { width: 140px; }
  .header-search-input:focus { width: 180px; }

  /* Layouts — switch to single column but keep sidebar as bottom block */
  .content-layout {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 28px 0;
  }
  .single-content-layout {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 28px 24px;
  }

  /* Sidebar below main on tablet */
  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .sidebar .widget { margin-bottom: 0; }

  /* Entry content */
  .entry-content { padding: 32px 28px; }

  /* Hero */
  .site-hero { padding: 48px 20px; }
  .hero-stats { gap: 28px; }

  /* Story cards */
  .story-card { padding: 18px; }

  /* Story header */
  .story-header-inner { padding: 0 24px 32px; }
  .entry-title { font-size: clamp(1.4rem, 3.5vw, 2rem); }

  /* Reading settings — compress */
  .reading-settings-label { display: none; }
  .font-family-select { display: none; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-bottom-inner { flex-wrap: wrap; gap: 12px; }

  /* Related stories */
  .related-stories-grid { grid-template-columns: 1fr 1fr; gap: 14px; }

  /* Pagination */
  .pagination-wrap { gap: 6px; }

  /* Category strip */
  .category-strip { top: 62px; }
}

/* ================================================
   RESPONSIVE — MOBILE LANDSCAPE + SMALL TABLET (600px–767px)
   ================================================ */
@media (max-width: 767px) {
  :root { --header-height: 58px; }

  /* Site container */
  .site-container { padding: 0 16px; }

  /* Header */
  .header-inner { padding: 0 16px; gap: 10px; }
  .site-tagline { display: none; }
  .header-search-form { display: none; } /* hidden on mobile — search via menu */
  .theme-toggle-label { display: none; }

  /* Category strip */
  .category-strip { top: 58px; }
  .category-strip-inner { padding: 0 16px; }
  .cat-pill { padding: 10px 12px; font-size: 0.78rem; }

  /* Hero */
  .site-hero { padding: 36px 16px; }
  .hero-inner h1 { font-size: clamp(1.6rem, 6vw, 2.4rem); }
  .hero-inner p  { font-size: 0.88rem; }
  .hero-stats { gap: 20px; flex-wrap: wrap; justify-content: center; }
  .hero-stat strong { font-size: 1.3rem; }

  /* Layout */
  .content-layout {
    grid-template-columns: 1fr;
    padding: 20px 0;
    gap: 24px;
  }
  .single-content-layout {
    grid-template-columns: 1fr;
    padding: 20px 16px;
    gap: 24px;
  }

  /* Sidebar — single column stack */
  .sidebar {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .sidebar .widget { margin-bottom: 0; }

  /* Story cards */
  .story-card { padding: 16px; gap: 12px; }
  .story-card-number { font-size: 1.6rem; min-width: 30px; }
  .story-card-title  { font-size: 1.05rem; }
  .story-card-excerpt { display: none; } /* save space on small screens */
  .story-card-footer { margin-top: 10px; }

  /* Featured card */
  .story-card.featured { padding: 18px; }

  /* Section header */
  .section-header { margin-bottom: 16px; padding-bottom: 12px; }
  .section-title  { font-size: 1.15rem; }

  /* Story header */
  .story-header { padding: 32px 0 0; }
  .story-header-inner { padding: 0 16px 24px; }
  .entry-title { font-size: clamp(1.3rem, 5vw, 1.8rem); margin-bottom: 14px; }
  .story-meta-bar { gap: 12px; font-size: 0.76rem; flex-wrap: wrap; padding-top: 14px; }
  .story-breadcrumb { font-size: 0.74rem; }

  /* Reading settings bar */
  .reading-settings-bar { padding: 8px 0; }
  .reading-settings-inner { padding: 0 16px; gap: 8px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .reading-settings-inner::-webkit-scrollbar { display: none; }
  .reading-settings-label  { display: none; }
  .font-family-select      { display: none; }
  .font-ctrl-btn           { width: 28px; height: 28px; font-size: 0.8rem; }
  .font-size-display       { font-size: 0.74rem; }
  .reading-width-btn       { padding: 5px 10px; font-size: 0.74rem; white-space: nowrap; flex-shrink: 0; }

  /* Entry content */
  .entry-content { padding: 22px 16px; font-size: 1rem; border-radius: var(--radius-md); }
  .entry-content h2 { font-size: 1.2em; }
  .entry-content blockquote { padding: 12px 16px; }

  /* Story navigation */
  .story-navigation { grid-template-columns: 1fr; gap: 12px; }
  .story-nav-btn    { padding: 16px; }
  .story-nav-title  { font-size: 0.88rem; }

  /* Tags */
  .story-tags-section { margin-top: 20px; padding-top: 18px; }
  .tags-cloud { gap: 6px; }
  .story-tag  { font-size: 0.74rem; padding: 4px 10px; }

  /* Share */
  .story-share-section { padding: 18px 14px; margin-top: 18px; }
  .share-buttons { gap: 8px; justify-content: flex-start; flex-wrap: wrap; }
  .share-btn     { padding: 8px 12px; font-size: 0.78rem; gap: 5px; }

  /* Related stories */
  .related-stories-grid  { grid-template-columns: 1fr; gap: 12px; }
  .related-stories-section { margin-top: 28px; }
  .related-card { padding: 16px; }

  /* Age gate */
  .age-gate-box     { padding: 32px 20px; border-radius: var(--radius-lg); }
  .age-gate-box h2  { font-size: 1.5rem; }
  .age-gate-icon    { font-size: 48px; }
  .age-gate-buttons { flex-direction: column; gap: 10px; }
  .age-gate-buttons button { padding: 13px 16px; font-size: 0.95rem; }

  /* Cookie consent */
  #cookie-consent { flex-direction: column; padding: 16px; gap: 12px; text-align: center; }
  .cookie-buttons { justify-content: center; flex-wrap: wrap; }

  /* Search page */
  .search-hero { padding: 32px 0; }
  .search-hero-inner { padding: 0 16px; }
  .search-hero h1    { font-size: 1.4rem; }
  .big-search-form   { flex-direction: column; gap: 10px; }
  .big-search-input  { padding: 12px 16px; }

  /* Archive header */
  .archive-header { padding: 28px 0; }
  .archive-header-inner { padding: 0 16px; }
  .archive-title { font-size: 1.5rem; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; gap: 24px; padding: 0 16px 36px; }
  .footer-bottom { padding: 16px; }
  .footer-bottom-inner { flex-direction: column; align-items: center; text-align: center; gap: 10px; }
  .footer-legal-links { justify-content: center; flex-wrap: wrap; gap: 10px; }
  .footer-warning { padding: 12px 16px; }
  .footer-warning p { font-size: 0.74rem; }
  #site-footer { padding: 40px 0 0; margin-top: 40px; }

  /* Pagination */
  .pagination-wrap { gap: 6px; padding: 28px 0; }
  .page-btn { min-width: 36px; height: 36px; font-size: 0.82rem; padding: 0 10px; }

  /* Floating read bar */
  #floating-read-bar { padding: 10px 16px; gap: 10px; }
  .floating-read-title { display: none; } /* too cramped */

  /* Scroll to top */
  #scroll-top-btn { bottom: 20px; right: 16px; width: 42px; height: 42px; font-size: 16px; }

  /* Category cloud */
  .category-cloud { gap: 6px; }
  .cloud-tag { font-size: 0.76rem; padding: 4px 10px; }

  /* Widget */
  .widget { padding: 18px 16px; }
  .popular-post-rank { font-size: 1.1rem; min-width: 22px; }
  .popular-post-title { font-size: 0.84rem; }

  /* Disclaimer */
  .content-disclaimer { padding: 12px 14px; gap: 10px; }
  .disclaimer-text { font-size: 0.78rem; }

  /* TOS/page template */
  .story-header + .site-container .entry-content { margin-top: 0; }
}

/* ================================================
   RESPONSIVE — SMALL MOBILE (max 480px)
   ================================================ */
@media (max-width: 480px) {
  :root { --header-height: 54px; }

  /* Header — tighten further */
  .header-inner { padding: 0 12px; gap: 8px; }
  .site-logo-icon { width: 34px; height: 34px; font-size: 16px; }
  .site-title     { font-size: 1.1rem; }
  .site-title span { display: inline; }

  /* Category strip */
  .category-strip { top: 54px; }
  .category-strip-inner { padding: 0 12px; }

  /* Hero */
  .site-hero { padding: 28px 12px; }
  .hero-inner h1 { font-size: clamp(1.4rem, 7vw, 2rem); }
  .hero-stats { gap: 16px; }
  .hero-stat strong { font-size: 1.2rem; }
  .hero-stat span   { font-size: 0.7rem; }

  /* Layout */
  .site-container { padding: 0 12px; }
  .content-layout { padding: 16px 0; gap: 20px; }
  .single-content-layout { padding: 16px 12px; gap: 20px; }

  /* Story cards — minimal */
  .story-card           { padding: 14px; gap: 0; flex-direction: column; }
  .story-card-number    { display: none; }
  .story-card-title     { font-size: 1rem; margin-bottom: 8px; }
  .story-card-meta      { margin-bottom: 8px; gap: 6px; }
  .story-cat-tag        { font-size: 0.68rem; padding: 2px 8px; }
  .story-card-date      { font-size: 0.72rem; }
  .story-card-footer    { flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 8px; }
  .story-card-stats     { gap: 12px; }
  .story-stat           { font-size: 0.72rem; }
  .read-more-btn        { font-size: 0.78rem; }

  /* Entry */
  .entry-content        { padding: 18px 14px; font-size: 0.97rem; border-radius: var(--radius-sm); }

  /* Story header */
  .story-header-inner   { padding: 0 12px 20px; }
  .entry-title          { font-size: clamp(1.2rem, 6vw, 1.6rem); }
  .story-meta-bar       { gap: 8px; font-size: 0.72rem; }
  .story-meta-item      { font-size: 0.72rem; }
  .story-breadcrumb     { font-size: 0.7rem; gap: 6px; }

  /* Reading settings — ultra compact */
  .reading-settings-inner { padding: 0 12px; gap: 6px; }
  .font-ctrl-btn           { width: 26px; height: 26px; font-size: 0.75rem; }
  .font-size-display       { min-width: 24px; font-size: 0.7rem; }
  .reading-width-btn       { padding: 4px 8px; font-size: 0.7rem; }

  /* Share buttons — 2-column wrap */
  .share-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .share-btn     { justify-content: center; padding: 9px 10px; font-size: 0.76rem; }
  .share-btn-copy { grid-column: 1 / -1; } /* copy link spans full width */

  /* Footer */
  .footer-grid { padding: 0 12px 28px; gap: 20px; }
  .footer-desc { font-size: 0.8rem; }
  .footer-col-title { font-size: 0.72rem; }
  .footer-links a   { font-size: 0.82rem; }
  .footer-copyright { font-size: 0.74rem; }
  .footer-legal-links a { font-size: 0.72rem; }
  .footer-adult-badge   { font-size: 0.76rem; padding: 6px 12px; }

  /* Age gate */
  .age-gate-box { padding: 28px 16px; }
  .age-gate-box h2 { font-size: 1.3rem; }
  .age-gate-box p  { font-size: 0.85rem; }
  .age-gate-legal  { font-size: 0.72rem !important; }

  /* Cookie consent */
  #cookie-consent  { padding: 14px 12px; }
  .cookie-text     { font-size: 0.78rem; }

  /* Archive */
  .archive-title { font-size: 1.3rem; }
  .archive-description { font-size: 0.84rem; }

  /* Search */
  .search-hero h1   { font-size: 1.2rem; }

  /* Pagination */
  .pagination-wrap { padding: 20px 0; gap: 4px; }
  .page-btn { min-width: 32px; height: 32px; font-size: 0.78rem; padding: 0 8px; }

  /* Related stories */
  .related-card { padding: 14px; }
  .related-card-title   { font-size: 0.88rem; }
  .related-card-excerpt { font-size: 0.78rem; }

  /* Scroll top */
  #scroll-top-btn { width: 38px; height: 38px; font-size: 14px; bottom: 16px; right: 12px; }

  /* Widget */
  .widget       { padding: 14px 12px; }
  .widget-title { font-size: 0.72rem; margin-bottom: 12px; }
  .cloud-tag    { font-size: 0.72rem; padding: 3px 8px; }

  /* Popular posts */
  .popular-post-item    { gap: 10px; padding-bottom: 10px; }
  .popular-post-title   { font-size: 0.8rem; }
  .popular-post-views   { font-size: 0.68rem; }

  /* Recent posts */
  .recent-post-title { font-size: 0.82rem; }
  .recent-post-date  { font-size: 0.68rem; }

  /* Toc */
  .toc-list a { font-size: 0.8rem; padding: 5px 8px; }

  /* Content disclaimer */
  .content-disclaimer { padding: 10px 12px; flex-direction: column; gap: 8px; }
  .disclaimer-icon { font-size: 16px; }

  /* Section header */
  .section-title  { font-size: 1rem; }

  /* Empty state */
  .empty-state { padding: 48px 16px; }
  .empty-state-icon { font-size: 40px; }
  .empty-state h3   { font-size: 1.1rem; }
}

/* ================================================
   RESPONSIVE — EXTRA SMALL MOBILE (max 360px)
   ================================================ */
@media (max-width: 360px) {
  .site-title   { font-size: 0.98rem; }
  .hero-stats   { flex-direction: column; align-items: center; gap: 10px; }
  .share-buttons { grid-template-columns: 1fr; }
  .share-btn-copy { grid-column: unset; }
  .age-gate-buttons button { font-size: 0.88rem; padding: 12px 14px; }
  .entry-content { padding: 16px 12px; }
  .story-header-inner { padding: 0 10px 16px; }
  .single-content-layout { padding: 14px 10px; }
  .site-container { padding: 0 10px; }
  .footer-grid   { padding: 0 10px 24px; }
}

/* ================================================
   RESPONSIVE — TOUCH DEVICE HOVER FIXES
   ================================================ */
@media (hover: none) and (pointer: coarse) {
  /* Disable hover transforms on touch — prevent sticky states */
  .story-card:hover       { transform: none; }
  .btn-enter:hover        { transform: none; }
  #scroll-top-btn:hover   { transform: none; }
  .related-card:hover     { transform: none; }
  .story-nav-btn:hover    { transform: none; }
  .cloud-tag:hover        { transform: none; }
  .share-btn:hover        { transform: none; }
  .popular-post-title:hover { color: var(--accent-primary); }
}

/* ================================================
   RESPONSIVE — LANDSCAPE PHONE (short + wide)
   ================================================ */
@media (max-width: 767px) and (orientation: landscape) {
  .site-hero { padding: 24px 16px; }
  .hero-stats { gap: 32px; }
  .age-gate-overlay { align-items: flex-start; padding-top: 16px; overflow-y: auto; }
  .age-gate-box { margin: auto; }
  .reading-settings-bar { position: relative; top: auto; }
  #floating-read-bar    { display: none !important; } /* no space in landscape */
}

/* ================================================
   PRINT STYLES
   ================================================ */
@media print {
  #site-header, #site-footer, .sidebar, .reading-settings-bar,
  #age-gate-overlay, #cookie-consent, #scroll-top-btn,
  .story-share-section, .related-stories-section, #reading-progress,
  .category-strip, #floating-read-bar, .story-navigation,
  .content-disclaimer, .hamburger, #mobile-nav { display: none !important; }

  body                 { background: #fff !important; color: #000 !important; font-size: 12pt; }
  .single-content-layout,
  .content-layout      { grid-template-columns: 1fr !important; display: block !important; }
  .entry-content       { border: none !important; box-shadow: none !important; padding: 0 !important; font-size: 12pt; }
  .entry-title         { font-size: 20pt; }
  a                    { color: #000 !important; text-decoration: underline; }
  .story-header        { background: none !important; border: none !important; }
  .story-header-inner  { padding: 0 !important; }
}
