/* === Story Page — Editorial Layout === */

/* Hero */
.story-hero {
  background: #0b1220;
  background-image:
    radial-gradient(ellipse at top, rgba(37,99,235,0.18), transparent 60%),
    linear-gradient(to bottom right, #000 0%, #0b1220 100%);
  border-bottom: 1px solid #111827;
  padding: 2.5rem 1rem;
  display: flex;
  justify-content: center;
}
.story-stage {
  max-width: 720px;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}
.story-hero-img {
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
  transition: filter 0.3s;
}
.story-hero-img:hover {
  filter: brightness(1.05);
}

/* Main content wrapper */
.story-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.2rem 4rem;
}

/* Breadcrumb */
.story-breadcrumb {
  font-size: 0.82rem;
  color: var(--c-text-muted);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.story-breadcrumb a {
  color: var(--c-text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.story-breadcrumb a:hover {
  color: var(--c-primary);
}
.bc-sep {
  color: var(--c-border);
  font-size: 0.9rem;
}
.bc-current {
  color: var(--c-text);
  font-weight: 600;
}

/* Article */
.story-article {
  margin-bottom: 2.5rem;
}

/* Header — meta + tags + title */
.story-header {
  margin-bottom: 2rem;
}
.story-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--c-text-muted);
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace;
}
.story-reading-time {
  padding: 0.15rem 0.55rem;
  background: #f1f5f9;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.story-draft-badge {
  background: #fee2e2;
  color: #991b1b;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.78rem;
}

/* Story tags */
.story-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}
a.story-tag {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  background: #f1f5f9;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--c-text);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: all 0.2s;
}
a.story-tag:hover {
  background: rgba(37,99,235,0.08);
  border-color: rgba(37,99,235,0.3);
  color: #2563eb;
}

/* Title */
.story-title {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--c-text);
}

/* Story content — editorial typography */
.story-content {
  margin-top: 1.5rem;
  font-size: 1.1rem;
  line-height: 1.85;
  color: var(--c-text);
}
.story-content p {
  margin: 0 0 1.4rem;
}
.story-content img {
  max-width: 100%;
  border-radius: 12px;
  margin: 1rem 0;
}
.story-content a {
  color: var(--c-primary);
  text-decoration: underline;
  text-decoration-color: rgba(37,99,235,0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s;
}
.story-content a:hover {
  text-decoration-color: var(--c-primary);
}
.story-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
}
.story-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
}
.story-content blockquote {
  border-inline-start: 4px solid var(--c-primary);
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  background: #f8fafc;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--c-text-muted);
}

/* Empty story placeholder */
.story-empty {
  color: var(--c-text-muted);
  padding: 1.5rem;
  border: 1px dashed var(--c-border);
  border-radius: 12px;
  text-align: center;
}

/* Bottom nav */
.story-bottom-nav {
  padding-top: 1.5rem;
  border-top: 1px solid var(--c-border);
}

/* === Lightbox === */
.story-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}
.story-lightbox[aria-hidden="false"] {
  display: flex;
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.92);
  cursor: pointer;
}
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  font-size: 2.2rem;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}
.lightbox-close:hover {
  background: rgba(255,255,255,0.15);
}
.lightbox-img {
  position: relative;
  z-index: 5;
  max-width: 95vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

/* === RTL === */
html[dir="rtl"] .story-title { letter-spacing: 0; }
html[dir="rtl"] .story-breadcrumb { direction: rtl; }
html[dir="rtl"] .lightbox-close { right: auto; left: 1rem; }
html[dir="rtl"] .story-content blockquote {
  border-inline-start: 4px solid var(--c-primary);
  border-radius: 8px 0 0 8px;
}

/* === Responsive === */
@media (max-width: 600px) {
  .story-hero { padding: 1.5rem 0.75rem; }
  .story-stage { border-radius: 10px; }
  .story-wrap { padding: 1.5rem 1rem 3rem; }
  .story-title { font-size: 1.5rem; }
  .story-content { font-size: 1rem; line-height: 1.75; }
  .story-content p { margin-bottom: 1.1rem; }
  .story-meta { font-size: 0.8rem; }
  .story-breadcrumb { font-size: 0.78rem; }
}
