/* ==========================================================================
   VEDH VALLEY WORLD SCHOOL - HAPPENINGS SHOWCASE
   Modern, Premium, Responsive Styling System
   ========================================================================== */

/* --- CSS Variables & Design Tokens --- */
:root {
  /* Brand Core Colors */
  --primary-emerald: #0f5618;
  --primary-emerald-dark: #0a3d11;
  --primary-emerald-light: #15803d;
  --primary-emerald-soft: rgba(15, 86, 24, 0.08);
  --primary-emerald-glow: rgba(21, 128, 61, 0.25);

  --accent-gold: #f59e0b;
  --accent-gold-dark: #d97706;
  --accent-gold-light: #fef3c7;
  --accent-gold-soft: rgba(245, 158, 11, 0.12);

  --accent-blue: #0284c7;
  --accent-blue-soft: rgba(2, 132, 199, 0.1);

  --accent-purple: #7c3aed;
  --accent-purple-soft: rgba(124, 58, 237, 0.1);

  --accent-rose: #e11d48;
  --accent-rose-soft: rgba(225, 29, 72, 0.1);

  /* Neutrals & Surfaces */
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;

  --text-main: #0f172a;
  --text-heading: #091e0e;
  --text-muted: #475569;
  --text-dim: #94a3b8;

  --border-subtle: rgba(15, 86, 24, 0.1);
  --border-card: #e2e8f0;
  --border-card-hover: rgba(15, 86, 24, 0.35);

  /* Typography */
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', 'Plus Jakarta Sans', sans-serif;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -3px rgba(15, 86, 24, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 35px -5px rgba(15, 86, 24, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 25px rgba(21, 128, 61, 0.2);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Layout */
  --max-content-width: 1280px;
  --header-height: 70px;
}

/* --- Base & Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

button, input {
  font-family: inherit;
  font-size: inherit;
}

/* --- Reading Progress Bar --- */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0%;
  background: linear-gradient(90deg, var(--primary-emerald), var(--accent-gold), #22c55e);
  z-index: 1000;
  transition: width 0.1s ease-out;
}

/* --- Page Wrapper --- */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   HERO HEADER SECTION
   ========================================================================== */
.happening-hero {
  position: relative;
  background: linear-gradient(135deg, #092c10 0%, #0d4617 40%, #071f0c 100%);
  color: #ffffff;
  padding: 3.6rem 1.5rem 3.8rem;
  overflow: hidden;
  text-align: center;
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-grid-pattern {
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: 0.6;
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
}

.glow-1 {
  width: 380px;
  height: 380px;
  background: #22c55e;
  top: -100px;
  left: 10%;
}

.glow-2 {
  width: 420px;
  height: 420px;
  background: #f59e0b;
  bottom: -120px;
  right: 15%;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 960px;
  margin: 0 auto;
}

/* School Identity Pill */
.school-identity-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 0.45rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-bottom: 1.8rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  flex-wrap: wrap;
  justify-content: center;
}

.school-crest-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-gold);
  box-shadow: 0 0 10px var(--accent-gold);
}

.school-name {
  color: #ffffff;
}

.pill-divider {
  color: rgba(255, 255, 255, 0.4);
}

.school-loc {
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.cbse-tag {
  background: rgba(245, 158, 11, 0.25);
  color: #fef08a;
  padding: 0.15rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Hero Title */
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 5.5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 1.2rem;
}

.gradient-text {
  background: linear-gradient(135deg, #fef08a 0%, #f59e0b 50%, #86efac 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: rgba(255, 255, 255, 0.88);
  max-width: 740px;
  margin: 0 auto;
  line-height: 1.6;
  font-weight: 400;
}

/* Stats Ribbon */
.stats-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.2rem;
  max-width: 880px;
  margin: 0 auto;
}

.stat-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-align: left;
  transition: transform 0.25s ease, background 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.14);
}

.stat-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-wrapper svg {
  width: 22px;
  height: 22px;
}

.math-color { background: rgba(245, 158, 11, 0.2); color: #fef08a; }
.science-color { background: rgba(56, 189, 248, 0.2); color: #7dd3fc; }
.gold-color { background: rgba(251, 191, 36, 0.2); color: #fde047; }
.green-color { background: rgba(74, 222, 128, 0.2); color: #86efac; }

.stat-data {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
}

/* ==========================================================================
   TOOLBAR SECTION (Search, Filter Chips, View Modes)
   ========================================================================== */
.toolbar-section {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-card);
  box-shadow: var(--shadow-sm);
  padding: 0.9rem 1.5rem;
}

.toolbar-container {
  max-width: var(--max-content-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
}

/* Search Box */
.search-box-wrapper {
  position: relative;
  flex: 1 1 280px;
  max-width: 380px;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.65rem 2.4rem 0.65rem 2.6rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-card);
  background: var(--bg-card-subtle);
  color: var(--text-main);
  font-size: 0.88rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  background: #ffffff;
  border-color: var(--primary-emerald);
  box-shadow: 0 0 0 3px var(--primary-emerald-soft);
}

.clear-search-btn {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clear-search-btn svg {
  width: 15px;
  height: 15px;
}

/* Filter Category Chips */
.filter-chips-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.filter-chips-wrapper::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-card);
  background: #ffffff;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.filter-chip svg {
  width: 14px;
  height: 14px;
}

.filter-chip:hover {
  background: var(--bg-card-subtle);
  color: var(--text-main);
  border-color: var(--text-dim);
}

.filter-chip.active {
  background: var(--primary-emerald);
  color: #ffffff;
  border-color: var(--primary-emerald);
  box-shadow: 0 2px 8px var(--primary-emerald-glow);
}

.chip-count {
  background: rgba(0, 0, 0, 0.08);
  font-size: 0.75rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.filter-chip.active .chip-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* View Switcher */
.toolbar-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.view-switcher {
  display: flex;
  background: var(--bg-card-subtle);
  padding: 0.25rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-card);
}

.view-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.view-btn svg {
  width: 15px;
  height: 15px;
}

.view-btn.active {
  background: #ffffff;
  color: var(--primary-emerald);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   QUICK NAVIGATION DOCK
   ========================================================================== */
.quick-nav-dock {
  max-width: var(--max-content-width);
  margin: 1.2rem auto 0;
  padding: 0.6rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.quick-nav-dock::-webkit-scrollbar {
  display: none;
}

.quick-nav-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary-emerald);
  white-space: nowrap;
}

.quick-nav-title svg {
  width: 14px;
  height: 14px;
}

.quick-nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

.quick-link {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: rgba(15, 86, 24, 0.06);
  color: var(--primary-emerald-dark);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.quick-link:hover, .quick-link.active {
  background: var(--primary-emerald);
  color: #ffffff;
  border-color: var(--primary-emerald);
}

/* ==========================================================================
   HAPPENING FEED & STORY CARDS
   ========================================================================== */
.happening-feed-container {
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
  flex: 1;
  width: 100%;
}

/* Section Header Banner */
.feed-header-banner {
  text-align: center;
  margin-bottom: 3.5rem;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-emerald-soft);
  color: var(--primary-emerald);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.9rem;
  border: 1px solid rgba(15, 86, 24, 0.15);
}

.live-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--primary-emerald);
  box-shadow: 0 0 0 0 rgba(15, 86, 24, 0.7);
  animation: pulse-ring 1.8s infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(15, 86, 24, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(15, 86, 24, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(15, 86, 24, 0);
  }
}

.feed-section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.8vw, 2.6rem);
  font-weight: 800;
  color: var(--text-heading);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.feed-section-desc {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto;
}

/* No Results Box */
.no-results-box {
  text-align: center;
  padding: 4rem 2rem;
  background: #ffffff;
  border-radius: var(--radius-xl);
  border: 1px dashed var(--border-card);
  max-width: 500px;
  margin: 2rem auto;
}

.no-results-icon svg {
  width: 48px;
  height: 48px;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.no-results-box h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-heading);
}

.no-results-box p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.btn-reset-filters {
  padding: 0.6rem 1.4rem;
  background: var(--primary-emerald);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-reset-filters:hover {
  background: var(--primary-emerald-dark);
}

/* ==========================================================================
   STORY CARD (MAGAZINE EDITORIAL FLOW)
   ========================================================================== */
.events-stream.magazine-layout {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

.happening-story-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-md);
  padding: 2.2rem;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.happening-story-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-emerald), var(--accent-gold));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.happening-story-card:hover {
  box-shadow: var(--shadow-xl);
  border-color: var(--border-card-hover);
  transform: translateY(-4px);
}

.happening-story-card:hover::before {
  opacity: 1;
}

.story-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 3rem;
  align-items: center;
}

/* Layout Reverse (alternating image left / text right) */
.happening-story-card.layout-reverse .story-grid {
  grid-template-columns: 1fr 1.15fr;
}

/* Story Narrative Column */
.story-narrative {
  display: flex;
  flex-direction: column;
}

.story-meta-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

/* Category Badges */
.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.category-badge svg {
  width: 13px;
  height: 13px;
}

.category-math {
  background: var(--accent-gold-soft);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.category-science {
  background: var(--accent-blue-soft);
  color: #0369a1;
  border: 1px solid rgba(2, 132, 199, 0.25);
}

.category-vocational {
  background: var(--primary-emerald-soft);
  color: var(--primary-emerald-dark);
  border: 1px solid rgba(15, 86, 24, 0.2);
}

.category-culinary {
  background: var(--accent-rose-soft);
  color: #be123c;
  border: 1px solid rgba(225, 29, 72, 0.2);
}

.category-literature {
  background: var(--accent-purple-soft);
  color: #6d28d9;
  border: 1px solid rgba(124, 58, 237, 0.2);
}

.read-time-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-dim);
  font-size: 0.76rem;
  font-weight: 600;
}

.read-time-pill svg {
  width: 12px;
  height: 12px;
}

/* Headings */
.story-heading {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.5vw, 1.95rem);
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-bottom: 0.75rem;
}

.accent-decorative-line {
  width: 64px;
  height: 3px;
  border-radius: var(--radius-full);
  margin-bottom: 1.2rem;
}

.math-accent { background: var(--accent-gold); }
.science-accent { background: var(--accent-blue); }
.vocational-accent { background: var(--primary-emerald); }
.culinary-accent { background: var(--accent-rose); }
.literature-accent { background: var(--accent-purple); }

/* Highlight Tags */
.highlight-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.3rem;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
}

.tag-chip svg {
  width: 12px;
  height: 12px;
  color: var(--primary-emerald);
}

/* Story Body Text */
.story-body-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.72;
}

.story-body-text p {
  margin-bottom: 0.95rem;
}

.story-body-text strong {
  color: var(--text-main);
  font-weight: 600;
}

.story-quote {
  position: relative;
  font-style: italic;
  font-size: 0.92rem;
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-md);
  margin: 1.1rem 0;
  line-height: 1.6;
}

.math-quote {
  background: var(--accent-gold-soft);
  border-left: 4px solid var(--accent-gold);
  color: #78350f;
}

.science-quote {
  background: var(--accent-blue-soft);
  border-left: 4px solid var(--accent-blue);
  color: #0c4a6e;
}

.vocational-quote {
  background: var(--primary-emerald-soft);
  border-left: 4px solid var(--primary-emerald);
  color: #064e3b;
}

.culinary-quote {
  background: var(--accent-rose-soft);
  border-left: 4px solid var(--accent-rose);
  color: #881337;
}

.literature-quote {
  background: var(--accent-purple-soft);
  border-left: 4px solid var(--accent-purple);
  color: #4c1d95;
}

/* Story Action Bar */
.story-action-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border-card);
  flex-wrap: wrap;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-card);
  background: #ffffff;
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action svg {
  width: 15px;
  height: 15px;
}

.btn-open-gallery {
  background: var(--primary-emerald);
  color: #ffffff;
  border-color: var(--primary-emerald);
}

.btn-open-gallery:hover {
  background: var(--primary-emerald-dark);
  box-shadow: 0 4px 12px var(--primary-emerald-glow);
}

.btn-like-story:hover {
  background: var(--accent-rose-soft);
  color: #e11d48;
  border-color: rgba(225, 29, 72, 0.3);
}

.btn-like-story.liked {
  background: #ffe4e6;
  color: #e11d48;
  border-color: #f43f5e;
}

.btn-like-story.liked svg {
  fill: #e11d48;
}

.btn-share-story:hover {
  background: var(--bg-card-subtle);
  border-color: var(--text-dim);
}

/* ==========================================================================
   STORY VISUAL COLUMN & MINI GALLERY
   ========================================================================== */
.story-visual-column {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.featured-image-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 4 / 3;
  cursor: pointer;
  background: #0f172a;
}

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

.featured-image-wrapper:hover .featured-img {
  transform: scale(1.05);
}

.image-overlay-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,0.7) 100%);
  pointer-events: none;
}

.image-badge-count {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.image-badge-count svg {
  width: 13px;
  height: 13px;
}

.quick-expand-btn {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-heading);
  cursor: pointer;
  opacity: 0;
  transform: scale(0.85);
  transition: all 0.25s ease;
}

.quick-expand-btn svg {
  width: 16px;
  height: 16px;
}

.featured-image-wrapper:hover .quick-expand-btn {
  opacity: 1;
  transform: scale(1);
}

.image-caption-overlay {
  position: absolute;
  bottom: 0.85rem;
  left: 1rem;
  right: 1rem;
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.82rem;
  font-weight: 500;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Thumbnail Filmstrip */
.thumbnail-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.55rem;
}

.thumb-btn {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  background: var(--bg-card-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
}

.thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-btn:hover {
  transform: translateY(-2px);
  border-color: var(--text-dim);
}

.thumb-btn.active {
  border-color: var(--primary-emerald);
  box-shadow: 0 0 0 2px var(--primary-emerald-soft);
}

.more-thumbs-pill .more-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   GRID CARDS LAYOUT (Alternative View Mode)
   ========================================================================== */
.events-stream.grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 2rem;
}

.events-stream.grid-layout .happening-story-card {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.events-stream.grid-layout .story-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.events-stream.grid-layout .happening-story-card.layout-reverse .story-grid {
  display: flex;
  flex-direction: column;
}

.events-stream.grid-layout .story-visual-column {
  order: -1;
}

.events-stream.grid-layout .story-heading {
  font-size: 1.35rem;
}

.events-stream.grid-layout .story-body-text {
  font-size: 0.9rem;
  line-height: 1.6;
}

.events-stream.grid-layout .story-quote {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
}

/* ==========================================================================
   FULLSCREEN INTERACTIVE LIGHTBOX MODAL
   ========================================================================== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 25, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.lightbox-dialog {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1100px;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  background: rgba(20, 28, 45, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  color: #ffffff;
}

/* Lightbox Header */
.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.8);
  gap: 1rem;
}

.lightbox-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  overflow: hidden;
}

.lightbox-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lightbox-top-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.lb-counter {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
}

.lb-icon-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lb-icon-btn svg {
  width: 17px;
  height: 17px;
}

.lb-icon-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.05);
}

.lb-close-btn:hover {
  background: #e11d48;
  border-color: #e11d48;
}

/* Lightbox Stage */
.lightbox-stage {
  position: relative;
  flex: 1;
  min-height: 380px;
  max-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: #090e17;
  overflow: hidden;
}

.lightbox-image-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.lb-active-img {
  max-width: 100%;
  max-height: 56vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  transition: transform 0.3s ease;
  user-select: none;
}

.lb-active-img.zoomed {
  transform: scale(1.6);
  cursor: grab;
}

.lb-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lb-nav-btn svg {
  width: 24px;
  height: 24px;
}

.lb-nav-btn:hover {
  background: var(--primary-emerald);
  border-color: var(--primary-emerald);
  transform: translateY(-50%) scale(1.1);
}

.lb-prev-btn { left: 1.2rem; }
.lb-next-btn { right: 1.2rem; }

/* Lightbox Caption */
.lightbox-caption-bar {
  padding: 0.75rem 1.5rem;
  background: rgba(15, 23, 42, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.lb-caption-text {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

/* Lightbox Thumbnails Strip */
.lightbox-thumbnails-container {
  display: flex;
  gap: 0.55rem;
  padding: 0.9rem 1.5rem;
  background: rgba(10, 15, 25, 0.95);
  overflow-x: auto;
  justify-content: center;
}

.lb-thumb {
  width: 60px;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.6;
  transition: all 0.2s ease;
}

.lb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lb-thumb:hover {
  opacity: 0.9;
  border-color: rgba(255, 255, 255, 0.5);
}

.lb-thumb.active {
  opacity: 1;
  border-color: var(--accent-gold);
  transform: scale(1.08);
}

/* ==========================================================================
   FLOATING BACK TO TOP BUTTON
   ========================================================================== */
.floating-back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary-emerald);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 15px rgba(15, 86, 24, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transform: translateY(15px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-back-to-top svg {
  width: 22px;
  height: 22px;
}

.floating-back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.floating-back-to-top:hover {
  background: var(--primary-emerald-dark);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(15, 86, 24, 0.45);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

.toast {
  background: #0f172a;
  color: #ffffff;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  animation: toast-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.toast-success {
  background: #064e3b;
  border-color: #059669;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   ANIMATIONS & KEYFRAMES
   ========================================================================== */
.animate-fade-in {
  animation: fadeIn 0.8s ease forwards;
}

.animate-fade-up {
  opacity: 0;
  animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ========================================================================== */
@media (max-width: 1024px) {
  .story-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .happening-story-card.layout-reverse .story-grid {
    grid-template-columns: 1fr;
  }

  /* In mobile/tablet, visual gallery is always displayed on top of the narrative */
  .story-visual-column {
    order: -1;
  }

  .quick-nav-dock {
    display: none;
  }
}

@media (max-width: 768px) {
  .happening-hero {
    padding: 3.5rem 1rem 4rem;
  }

  .toolbar-section {
    padding: 0.75rem 1rem;
  }

  .toolbar-container {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box-wrapper {
    max-width: 100%;
  }

  .filter-chips-wrapper {
    width: 100%;
  }

  .toolbar-tools {
    justify-content: flex-end;
  }

  .happening-feed-container {
    padding: 1.5rem 1rem 4rem;
  }

  .happening-story-card {
    padding: 1.5rem;
  }

  .events-stream.magazine-layout {
    gap: 2.2rem;
  }

  .events-stream.grid-layout {
    grid-template-columns: 1fr;
  }

  .floating-back-to-top {
    bottom: 1.2rem;
    right: 1.2rem;
    width: 42px;
    height: 42px;
  }
}
