/* ============================================================
   STORY.CSS — Generalized Royal Clinical Storytelling Experience
   Dr. Marjuq Al Tuhin — ENT Surgeon & Clinical Researcher
   Clean, Unified Design System matching the entire website
   ============================================================ */

/* ── Top Reading Progress Rail ────────────────────────────── */
#story-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3.5px;
  width: 0%;
  background: linear-gradient(90deg, var(--azure), var(--gold-accent), var(--azure-deep));
  z-index: 1000;
  transition: width 0.1s ease-out;
}

/* ── Story Hero Section (Matches Website Branding) ────────── */
.story-hero-section {
  padding-top: calc(var(--nav-h) + var(--sp-12));
  padding-bottom: var(--sp-12);
  background:
    radial-gradient(ellipse 65% 70% at 75% 30%, rgba(2, 132, 199, 0.1) 0%, rgba(217, 119, 6, 0.08) 45%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 15% 20%, rgba(14, 165, 233, 0.07) 0%, transparent 60%),
    linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 60%, #F1F5F9 100%);
  position: relative;
  text-align: center;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.story-hero-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.story-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border-radius: var(--r-full);
  background: var(--gold-pale);
  border: 1px solid rgba(217, 119, 6, 0.35);
  color: var(--gold-dark);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: var(--sp-4);
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.1);
}

.story-hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.2vw, 4rem);
  font-weight: 900;
  color: var(--navy-deep);
  line-height: 1.15;
  margin-bottom: var(--sp-4);
  letter-spacing: -0.02em;
}

.story-hero-desc {
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  color: #475569;
  line-height: 1.7;
  margin: 0 auto var(--sp-6);
  max-width: 680px;
}

.story-hero-author {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy-deep);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}

/* ── Sticky Chapter Navigation Bar ────────────────────────── */
.story-nav-bar {
  position: sticky;
  top: var(--nav-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid #E2E8F0;
  z-index: 100;
  padding: var(--sp-3) var(--sp-6);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.story-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  overflow-x: auto;
  scrollbar-width: none;
}

.story-nav-inner::-webkit-scrollbar {
  display: none;
}

.story-nav-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.story-nav-pill {
  padding: 6px 14px;
  border-radius: var(--r-full);
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  color: #475569;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--t-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.story-nav-pill:hover {
  background: #E0F2FE;
  color: var(--azure-deep);
  border-color: #BAE6FD;
}

.story-nav-pill.active {
  background: var(--navy-deep);
  color: #FFFFFF;
  border-color: var(--navy-deep);
  box-shadow: 0 2px 8px rgba(8, 22, 43, 0.25);
}

/* ── Main Chapters Stream ─────────────────────────────────── */
.story-stream {
  max-width: 1140px;
  margin: 0 auto;
  padding: var(--sp-12) var(--sp-6) var(--sp-24);
  display: flex;
  flex-direction: column;
  gap: var(--sp-16);
}

/* Chapter Card */
.story-chapter-card {
  background: #FFFFFF;
  border: 1.5px solid rgba(226, 232, 240, 0.95);
  border-radius: var(--r-2xl);
  box-shadow: 0 20px 45px -15px rgba(8, 22, 43, 0.06),
              0 1px 3px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  scroll-margin-top: calc(var(--nav-h) + 70px);
}

.story-chapter-card:hover {
  box-shadow: 0 25px 50px -12px rgba(8, 22, 43, 0.1);
}

.story-chapter-grid {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .story-chapter-grid {
    grid-template-columns: 1fr 1.15fr;
  }
}

/* Left Column: Visuals & Attachments */
.story-chapter-visuals {
  position: relative;
  background: #0B192C;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 380px;
}

.story-chapter-hero-img-wrap {
  position: relative;
  flex: 1;
  min-height: 320px;
  overflow: hidden;
  cursor: pointer;
}

.story-chapter-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.story-chapter-card:hover .story-chapter-hero-img {
  transform: scale(1.03);
}

.story-chapter-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 22, 43, 0.15) 0%, rgba(8, 22, 43, 0.8) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--sp-5);
  color: #FFFFFF;
}

.story-chapter-overlay-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.story-chapter-overlay-bottom {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.story-chapter-expand-hint {
  font-size: 0.75rem;
  color: #CBD5E1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  padding: 3px 8px;
  border-radius: var(--r-full);
}

/* Gallery photos strip attached to chapter */
.story-chapter-strip {
  padding: var(--sp-3) var(--sp-5);
  background: #08162B;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: var(--sp-3);
  overflow-x: auto;
  scrollbar-width: thin;
}

.story-strip-thumb {
  width: 64px;
  height: 48px;
  border-radius: var(--r-md);
  object-fit: cover;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all var(--t-fast);
  flex-shrink: 0;
}

.story-strip-thumb:hover {
  transform: scale(1.08);
  border-color: var(--gold-accent);
}

/* Right Column: Narrative Content */
.story-chapter-narrative {
  padding: var(--sp-8) var(--sp-6);
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #FFFFFF;
}

@media (min-width: 900px) {
  .story-chapter-narrative {
    padding: var(--sp-10) var(--sp-8);
  }
}

.story-chapter-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-2);
}

.story-chapter-tag {
  font-size: 0.775rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--azure-deep);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.story-chapter-num-badge {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  color: #94A3B8;
}

.story-chapter-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  font-weight: 800;
  color: var(--navy-deep);
  line-height: 1.25;
  margin-bottom: var(--sp-2);
}

.story-chapter-sub {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gold-dark);
  margin-bottom: var(--sp-4);
}

/* Doctor's Reflective Quote Card */
.story-quote-box {
  background: var(--gold-pale);
  border-left: 3px solid var(--gold-accent);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-5);
  font-style: italic;
  font-size: 0.925rem;
  line-height: 1.6;
  color: #78350F;
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
}

.story-quote-box i {
  color: var(--gold-accent);
  font-size: 1.15rem;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Story Narrative Paragraphs */
.story-chapter-body {
  font-size: 1rem;
  line-height: 1.85;
  color: #334155;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.story-chapter-body p {
  margin: 0;
}

/* Footer / Actions */
.story-chapter-foot {
  margin-top: var(--sp-6);
  padding-top: var(--sp-4);
  border-top: 1px solid #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.story-next-link {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--azure-deep);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: all var(--t-fast);
}

.story-next-link:hover {
  color: var(--navy-deep);
  transform: translateX(4px);
}

/* ── Lightbox for Story Images ────────────────────────────── */
#story-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8, 22, 43, 0.94);
  backdrop-filter: blur(12px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6);
  opacity: 0;
  transition: opacity 0.3s ease;
}

#story-lightbox.open {
  opacity: 1;
}

#story-lightbox-img {
  max-width: 92vw;
  max-height: 82vh;
  border-radius: var(--r-xl);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#story-lightbox-close {
  position: absolute;
  top: var(--sp-6);
  right: var(--sp-6);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #FFFFFF;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all var(--t-fast);
}

#story-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.08);
}
