/* ===== HIKAYAT - موقع الروايات والقصص ===== */
@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400;1,700&family=Cairo:wght@300;400;500;600;700;900&family=Playfair+Display:ital,wght@0,700;1,700&display=swap');

:root {
  --primary: #1a0a00;
  --accent: #c8860a;
  --accent-light: #e8a020;
  --accent-glow: rgba(200,134,10,0.15);
  --bg: #0d0600;
  --bg-card: #120800;
  --bg-card2: #1a0e02;
  --border: rgba(200,134,10,0.2);
  --border-hover: rgba(200,134,10,0.6);
  --text: #f0e6d3;
  --text-muted: #9a8060;
  --text-dim: #5a4030;
  --sidebar-width: 300px;
  --header-height: 70px;
  --radius: 4px;
  --shadow: 0 4px 30px rgba(0,0,0,0.5);
  --transition: 0.3s ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Cairo', sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 16px;
  line-height: 1.7;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ===== SELECTION ===== */
::selection { background: var(--accent); color: var(--bg); }

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5 { font-family: 'Amiri', serif; line-height: 1.4; }

a { color: inherit; text-decoration: none; transition: var(--transition); }

img { max-width: 100%; height: auto; }

/* ===== AD SLOTS ===== */
.ad-slot {
  width: 100%;
  min-height: 90px;
  background: linear-gradient(135deg, rgba(200,134,10,0.05), transparent);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
  position: relative;
  overflow: hidden;
}
.ad-slot::before {
  content: 'إعلان';
  font-size: 11px;
  color: var(--text-dim);
  position: absolute;
  top: 4px;
  left: 8px;
  letter-spacing: 1px;
}
.ad-slot.ad-header { min-height: 90px; }
.ad-slot.ad-leaderboard { min-height: 250px; max-width: 728px; margin: 0 auto; }
.ad-slot.ad-square { min-height: 250px; max-width: 300px; }
.ad-slot.ad-rectangle { min-height: 280px; max-width: 336px; }
.ad-slot iframe, .ad-slot ins { display: block; width: 100%; }

/* ===== PRELOADER ===== */
#preloader {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#preloader.hidden { opacity: 0; visibility: hidden; }
.preloader-logo {
  font-family: 'Amiri', serif;
  font-size: 48px;
  color: var(--accent);
  animation: pulse 1.5s infinite;
}
.preloader-bar {
  width: 200px; height: 2px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.preloader-bar::after {
  content: '';
  display: block;
  height: 100%;
  width: 40%;
  background: var(--accent);
  animation: loading 1s infinite;
}
@keyframes loading {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.5; } }

/* ===== HEADER ===== */
#site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,6,0,0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
}
.header-ad-bar {
  background: rgba(200,134,10,0.08);
  border-bottom: 1px solid var(--border);
  padding: 4px 0;
  text-align: center;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.logo-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--accent), #8b4500);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.logo-text .site-name {
  font-family: 'Amiri', serif;
  font-size: 24px;
  color: var(--accent);
  line-height: 1;
}
.logo-text .site-tagline {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1;
}

/* NAV */
.main-nav { display: flex; align-items: center; gap: 4px; }
.nav-link {
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  transition: var(--transition);
}
.nav-link:hover, .nav-link.active {
  color: var(--accent);
  background: var(--accent-glow);
}
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition);
  z-index: 200;
  box-shadow: var(--shadow);
}
.nav-dropdown:hover .nav-dropdown-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-dropdown-menu a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-muted);
}
.nav-dropdown-menu a:hover { color: var(--accent); background: var(--accent-glow); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.btn-search {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: var(--transition);
}
.btn-search:hover { border-color: var(--accent); color: var(--accent); }
.btn-admin {
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--accent), #8b4500);
  color: white;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}
.btn-admin:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(200,134,10,0.4); }
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  border: none;
  background: none;
}
.hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: var(--transition);
}

/* MOBILE NAV */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-height);
  right: 0; left: 0;
  background: rgba(13,6,0,0.98);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 20px;
  z-index: 99;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}
.mobile-nav.open { transform: translateY(0); display: block; }
.mobile-nav a {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 16px;
}
.mobile-nav a:hover { color: var(--accent); }

/* SEARCH OVERLAY */
.search-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0; visibility: hidden;
  transition: var(--transition);
}
.search-overlay.open { opacity: 1; visibility: visible; }
.search-box {
  width: 90%; max-width: 600px;
  position: relative;
}
.search-box input {
  width: 100%;
  padding: 18px 60px 18px 20px;
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: 50px;
  color: var(--text);
  font-family: 'Cairo', sans-serif;
  font-size: 18px;
  direction: rtl;
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box input:focus { outline: none; box-shadow: 0 0 30px rgba(200,134,10,0.3); }
.search-close {
  position: absolute;
  left: 16px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}
.search-results {
  margin-top: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  max-height: 400px;
  overflow-y: auto;
}
.search-result-item {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.search-result-item:hover { background: var(--accent-glow); }
.search-result-item h4 { font-size: 15px; color: var(--text); margin-bottom: 4px; }
.search-result-item p { font-size: 13px; color: var(--text-muted); }

/* ===== LAYOUT ===== */
.page-wrapper { max-width: 1400px; margin: 0 auto; padding: 0 20px; }
.content-grid {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 30px;
  padding: 30px 0;
}

/* ===== HERO SLIDER ===== */
.hero-section {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 30px;
  height: 500px;
}
.hero-slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.hero-slide.active { opacity: 1; }
.hero-slide-bg {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.4);
}
.hero-slide-bg-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(13,6,0,0.9) 0%, rgba(200,134,10,0.1) 100%);
}
.hero-content {
  position: absolute;
  bottom: 0; right: 0; left: 0;
  padding: 40px;
  background: linear-gradient(transparent, rgba(13,6,0,0.95));
}
.hero-badge {
  display: inline-block;
  padding: 4px 14px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 50px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
}
.hero-title {
  font-family: 'Amiri', serif;
  font-size: 36px;
  line-height: 1.3;
  margin-bottom: 12px;
  color: var(--text);
}
.hero-excerpt {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 600px;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.hero-btn {
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--accent), #8b4500);
  color: white;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}
.hero-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 25px rgba(200,134,10,0.5); }
.hero-dots {
  position: absolute;
  bottom: 20px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 8px;
}
.hero-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(200,134,10,0.4);
  cursor: pointer;
  transition: var(--transition);
  border: none;
}
.hero-dot.active { background: var(--accent); width: 24px; border-radius: 4px; }
.hero-arrows {
  position: absolute;
  top: 50%; right: 20px;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 8px;
}
.hero-arrow {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(13,6,0,0.6);
  color: var(--text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.hero-arrow:hover { border-color: var(--accent); color: var(--accent); }

/* ===== SECTION HEADERS ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.section-title {
  font-family: 'Amiri', serif;
  font-size: 24px;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: '';
  display: block;
  width: 4px; height: 24px;
  background: var(--accent);
  border-radius: 2px;
}
.section-more {
  font-size: 13px;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 5px 14px;
  border-radius: 50px;
  transition: var(--transition);
}
.section-more:hover { border-color: var(--accent); color: var(--accent); }

/* ===== STORY CARDS ===== */
.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.stories-grid.list-view { grid-template-columns: 1fr; }

.story-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: var(--transition);
  position: relative;
}
.story-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(200,134,10,0.15);
}
.story-card-cover {
  aspect-ratio: 3/4;
  max-height: 240px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #1a0e02, #2a1a08);
}
.story-card-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.story-card:hover .story-card-cover img { transform: scale(1.05); }
.story-card-cover-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 60px;
  background: linear-gradient(135deg, #1a0e02, #2a1a08);
}
.story-card-badge {
  position: absolute;
  top: 10px; right: 10px;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
}
.badge-new { background: #22c55e; color: white; }
.badge-complete { background: var(--accent); color: var(--bg); }
.badge-ongoing { background: #3b82f6; color: white; }
.badge-hot { background: #ef4444; color: white; }

.story-card-body { padding: 16px; }
.story-card-category {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.story-card-title {
  font-family: 'Amiri', serif;
  font-size: 18px;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.story-card-title a:hover { color: var(--accent); }
.story-card-excerpt {
  font-size: 13px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}
.story-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.meta-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-muted);
}
.story-card-stats {
  display: flex; gap: 12px;
}
.chapters-count {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px;
  background: var(--accent-glow);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 50px;
  border: 1px solid var(--border);
}

/* LIST VIEW */
.story-card.list-layout {
  display: grid;
  grid-template-columns: 120px 1fr;
}
.story-card.list-layout .story-card-cover { aspect-ratio: auto; height: 160px; max-height: none; }
.story-card.list-layout .story-card-title { font-size: 20px; }

/* ===== FEATURED STRIP ===== */
.featured-strip {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}
.featured-main { grid-row: 1 / 3; }
.featured-main .story-card-cover { aspect-ratio: 4/5; max-height: none; height: 100%; }

/* ===== SIDEBAR ===== */
.sidebar { display: flex; flex-direction: column; gap: 24px; }

.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.widget-title {
  font-family: 'Amiri', serif;
  font-size: 16px;
  color: var(--accent);
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.widget-title::before {
  content: '';
  width: 3px; height: 16px;
  background: var(--accent);
  border-radius: 2px;
}
.widget-body { padding: 16px; }

/* TOP STORIES WIDGET */
.top-story-item {
  display: flex; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.top-story-item:last-child { border-bottom: none; padding-bottom: 0; }
.top-story-num {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  color: var(--border);
  line-height: 1;
  flex-shrink: 0;
  width: 30px;
  font-style: italic;
}
.top-story-item:first-child .top-story-num { color: var(--accent); }
.top-story-info h4 { font-size: 14px; margin-bottom: 4px; line-height: 1.4; }
.top-story-info h4 a:hover { color: var(--accent); }
.top-story-info span { font-size: 12px; color: var(--text-muted); }

/* CATEGORIES WIDGET */
.category-list { list-style: none; }
.category-list li {
  border-bottom: 1px solid var(--border);
}
.category-list li:last-child { border-bottom: none; }
.category-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  color: var(--text-muted);
  font-size: 14px;
  transition: var(--transition);
}
.category-list a:hover { color: var(--accent); background: var(--accent-glow); }
.category-list a span {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 50px;
  font-size: 12px;
}

/* TAGS WIDGET */
.tags-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-link {
  padding: 5px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50px;
  font-size: 12px;
  color: var(--text-muted);
  transition: var(--transition);
}
.tag-link:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }

/* NEWSLETTER WIDGET */
.newsletter-form { display: flex; flex-direction: column; gap: 10px; }
.newsletter-form input {
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  direction: rtl;
}
.newsletter-form input:focus { outline: none; border-color: var(--accent); }
.newsletter-form button {
  padding: 10px;
  background: linear-gradient(135deg, var(--accent), #8b4500);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.newsletter-form button:hover { transform: translateY(-1px); box-shadow: 0 4px 20px rgba(200,134,10,0.4); }

/* ===== TABS ===== */
.tabs-nav {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  padding: 4px;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}
.tab-btn {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition);
}
.tab-btn.active { background: var(--accent); color: var(--bg); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== STORY PAGE ===== */
.story-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 30px;
}
.story-header-inner {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 30px;
  padding: 30px;
}
.story-cover-main {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  aspect-ratio: 3/4;
}
.story-cover-main img { width: 100%; height: 100%; object-fit: cover; }
.story-cover-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #1a0e02, #2a1a08);
  display: flex; align-items: center; justify-content: center;
  font-size: 80px;
}
.story-info { padding-top: 10px; }
.story-main-title {
  font-family: 'Amiri', serif;
  font-size: 36px;
  margin-bottom: 10px;
  line-height: 1.3;
}
.story-author {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px;
}
.story-author-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b4500);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  flex-shrink: 0;
}
.story-author-name { font-size: 15px; color: var(--text); font-weight: 600; }
.story-author-label { font-size: 12px; color: var(--text-muted); }
.story-description {
  font-size: 15px; color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 20px;
  border-right: 3px solid var(--accent);
  padding-right: 16px;
}
.story-info-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 20px;
}
.info-stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}
.info-stat .stat-value {
  font-family: 'Amiri', serif;
  font-size: 22px;
  color: var(--accent);
  display: block;
}
.info-stat .stat-label {
  font-size: 12px; color: var(--text-muted);
}
.story-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-read {
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--accent), #8b4500);
  color: white;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: flex; align-items: center; gap: 8px;
}
.btn-read:hover { transform: translateY(-2px); box-shadow: 0 6px 25px rgba(200,134,10,0.5); }
.btn-outline {
  padding: 12px 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  border-radius: 50px;
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Cairo', sans-serif;
  display: flex; align-items: center; gap: 6px;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.story-tags-row { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }

/* CHAPTERS LIST */
.chapters-section { margin-top: 30px; }
.chapters-list { display: flex; flex-direction: column; gap: 8px; }
.chapter-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  cursor: pointer;
}
.chapter-item:hover { border-color: var(--border-hover); background: var(--bg-card2); }
.chapter-num {
  font-family: 'Amiri', serif;
  font-size: 20px;
  color: var(--accent);
  min-width: 36px;
  text-align: center;
}
.chapter-title { font-size: 15px; color: var(--text); }
.chapter-title small { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.chapter-date { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.chapter-status {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-muted);
}
.chapter-status.read { background: var(--accent); border-color: var(--accent); color: var(--bg); }

/* CHAPTER READER */
.reader-wrapper {
  max-width: 820px;
  margin: 0 auto;
  padding: 30px 0;
}
.reader-header {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 24px;
}
.reader-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.reader-chapter-info { text-align: center; }
.reader-chapter-info .chapter-label { font-size: 12px; color: var(--text-muted); }
.reader-chapter-info h1 { font-family: 'Amiri', serif; font-size: 26px; color: var(--accent); }
.reader-settings {
  display: flex; gap: 10px; margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--border);
  align-items: center; flex-wrap: wrap;
}
.font-controls { display: flex; align-items: center; gap: 8px; }
.font-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-size: 16px;
  transition: var(--transition);
}
.font-btn:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle {
  display: flex; gap: 6px;
}
.theme-opt {
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}
.theme-opt.dark { background: #0d0600; border-color: var(--accent); }
.theme-opt.sepia { background: #f0e6d3; }
.theme-opt.light { background: #ffffff; }

.reader-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 40px;
  font-family: 'Amiri', serif;
  font-size: 22px;
  line-height: 2;
  color: var(--text);
  min-height: 600px;
}
.reader-content p { margin-bottom: 20px; }
.reader-content .chapter-start {
  font-size: 36px;
  float: right;
  margin: 0 0 10px 16px;
  color: var(--accent);
  line-height: 1;
  font-style: italic;
}

.reader-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--text-muted);
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--text-dim); }

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 30px;
  flex-wrap: wrap;
}
.page-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.page-btn.wide { width: auto; padding: 0 16px; }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  margin-top: 60px;
}
.footer-top {
  max-width: 1400px;
  margin: 0 auto;
  padding: 50px 20px;
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 40px;
}
.footer-brand p { font-size: 14px; color: var(--text-muted); margin-top: 12px; line-height: 1.8; }
.footer-social { display: flex; gap: 10px; margin-top: 16px; }
.social-btn {
  width: 38px; height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: var(--transition);
}
.social-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.footer-widget h4 {
  font-family: 'Amiri', serif;
  font-size: 18px;
  color: var(--accent);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: 14px; color: var(--text-muted); transition: var(--transition); }
.footer-links a:hover { color: var(--accent); padding-right: 6px; }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
.footer-bottom .ad-slot { max-width: 728px; margin: 0 auto 16px; }

/* ===== LOADING SKELETON ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card2) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes skeleton-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ===== BACK TO TOP ===== */
#back-to-top {
  position: fixed;
  bottom: 30px; left: 30px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #8b4500);
  color: white;
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  opacity: 0; visibility: hidden;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(200,134,10,0.4);
  z-index: 50;
}
#back-to-top.visible { opacity: 1; visibility: visible; }
#back-to-top:hover { transform: translateY(-3px); }

/* ===== COOKIE BANNER ===== */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  transform: translateY(100%);
  transition: transform 0.4s ease;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-text { font-size: 14px; color: var(--text-muted); flex: 1; }
.cookie-text a { color: var(--accent); }
.cookie-btn {
  padding: 8px 20px;
  border-radius: 50px;
  border: none;
  background: var(--accent);
  color: var(--bg);
  font-family: 'Cairo', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* ===== NOTIFICATIONS ===== */
.notification {
  position: fixed;
  top: 80px; left: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex; gap: 10px; align-items: flex-start;
  z-index: 500;
  box-shadow: var(--shadow);
  transform: translateX(-120%);
  transition: transform 0.3s ease;
  max-width: 320px;
}
.notification.show { transform: translateX(0); }
.notification.success { border-right: 3px solid #22c55e; }
.notification.error { border-right: 3px solid #ef4444; }
.notification.info { border-right: 3px solid #3b82f6; }
.notif-icon { font-size: 20px; }
.notif-title { font-weight: 600; font-size: 14px; }
.notif-msg { font-size: 13px; color: var(--text-muted); }

/* ===== LIGHT THEME ===== */
body.theme-light {
  --bg: #f5f0e8;
  --bg-card: #ffffff;
  --bg-card2: #f9f5f0;
  --text: #1a0a00;
  --text-muted: #6b5040;
  --border: rgba(100,60,20,0.15);
  --border-hover: rgba(200,134,10,0.5);
}

body.theme-sepia {
  --bg: #f4e8d0;
  --bg-card: #fdf5e6;
  --bg-card2: #f5ead0;
  --text: #2a1a08;
  --text-muted: #7a5a38;
  --border: rgba(120,80,30,0.2);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .content-grid { grid-template-columns: 1fr 260px; }
}

@media (max-width: 900px) {
  .content-grid { grid-template-columns: 1fr; }
  .sidebar { order: -1; }
  .featured-strip { grid-template-columns: 1fr 1fr; }
  .featured-main { grid-column: 1 / -1; grid-row: auto; }
  .featured-main .story-card-cover { height: 260px; aspect-ratio: auto; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .hero-section { height: 380px; }
  .hero-title { font-size: 26px; }
  .story-header-inner { grid-template-columns: 180px 1fr; }
  .story-info-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 650px) {
  :root { --header-height: 60px; }
  .main-nav { display: none; }
  .hamburger { display: flex; }
  .stories-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-section { height: 300px; }
  .hero-content { padding: 20px; }
  .hero-title { font-size: 20px; }
  .hero-excerpt { display: none; }
  .story-header-inner { grid-template-columns: 1fr; text-align: center; }
  .story-cover-main { max-width: 200px; margin: 0 auto; }
  .story-main-title { font-size: 26px; }
  .story-author { justify-content: center; }
  .info-stat { padding: 8px; }
  .story-actions { justify-content: center; }
  .footer-top { grid-template-columns: 1fr; }
  .reader-content { padding: 20px; font-size: 18px; }
  .btn-admin span { display: none; }
  .chapter-item { grid-template-columns: auto 1fr auto; }
  .chapter-date { display: none; }
}

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