/* ═══════════════════════════════════════════
   STORIES & LORE ARCHIVE — stories.css
   Drake Hendrickson Portfolio
   ═══════════════════════════════════════════ */

:root {
  --st-bg: #1f2026;
  --st-surface: #2a2b34;
  --st-surface-hover: #31323e;
  --st-accent: #cfcdf8;
  --st-purp: #6B52FF;
  --st-text: #ffffff;
  --st-text-body: #eaeaf0;
  --st-text-dim: rgba(234, 234, 240, 0.65);
  --st-glass-border: rgba(207, 205, 248, 0.15);
  --st-radius: 16px;
}

/* ── HERO ── */
.stories-hero {
  position: relative;
  width: 100%;
  padding: 6vh 6vw 4vh;
  text-align: center;
  background: var(--st-bg);
}

.stories-hero-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 900px;
  margin: 0 auto;
}

.stories-tagline {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--st-accent);
}

.stories-hero h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3rem, 7vw, 5.2rem);
  letter-spacing: 0.06em;
  color: var(--st-text);
  line-height: 1;
  margin-bottom: 4px;
}

.stories-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  color: var(--st-text-dim);
}

/* Live Stats Badge */
.stories-stats-bar {
  display: inline-flex;
  gap: 16px;
  align-items: center;
  margin-top: 12px;
  padding: 6px 18px;
  background: var(--st-surface);
  border: 1px solid var(--st-glass-border);
  border-radius: 50px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: var(--st-accent);
}

.stories-stats-bar span {
  color: var(--st-text-dim);
}

/* ── MAIN CONTAINER ── */
.stories-main {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 4vw 8vh;
}

.stories-controls-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 220px;
}

.stories-stats-bar {
  margin: 0;
}

/* ── CONTROLS: SEARCH & FILTERS ── */
.stories-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4vh;
  padding: 20px 0;
  border-bottom: 1px solid var(--st-glass-border);
}

.stories-filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.story-filter-btn {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  padding: 8px 22px;
  border: 1px solid var(--st-glass-border);
  border-radius: 8px;
  background: var(--st-surface);
  color: var(--st-text-dim);
  cursor: pointer;
  transition: all 0.25s ease;
  text-transform: uppercase;
}

.story-filter-btn:hover {
  background: rgba(207, 205, 248, 0.15);
  color: #fff;
  border-color: var(--st-accent);
  transform: translateY(-2px);
}

.story-filter-btn.active {
  background: var(--st-accent);
  color: var(--st-bg);
  border-color: var(--st-accent);
  box-shadow: 0 4px 15px rgba(207, 205, 248, 0.3);
}

/* Search Input */
.stories-search-wrapper {
  flex: 1;
  min-width: 260px;
  max-width: 400px;
}

.stories-search-input {
  width: 100%;
  padding: 10px 18px;
  border: 1px solid var(--st-glass-border);
  border-radius: 8px;
  background: var(--st-surface);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s ease;
}

.stories-search-wrapper {
  display: none !important;
}

.stories-search-input::placeholder {
  color: var(--st-text-dim);
}

.stories-search-input:focus {
  border-color: var(--st-accent);
  background: var(--st-surface-hover);
  box-shadow: 0 0 15px rgba(207, 205, 248, 0.2);
}

/* ── STORY LIST (ARCHIVE VIEW) ── */
.stories-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.story-card {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  background: var(--st-surface);
  border: 1px solid var(--st-glass-border);
  border-radius: var(--st-radius);
  padding: 28px 32px;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.story-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--st-accent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.story-card:hover {
  transform: translateY(-4px);
  background: var(--st-surface-hover);
  border-color: var(--st-accent);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4), 0 0 25px rgba(207, 205, 248, 0.15);
}

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

.story-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.story-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.story-tag-pill {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(207, 205, 248, 0.15);
  color: var(--st-accent);
  border: 1px solid rgba(207, 205, 248, 0.2);
}

.story-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  letter-spacing: 0.04em;
  color: var(--st-text);
  line-height: 1.15;
  margin-bottom: 8px;
  transition: color 0.2s ease;
}

.story-card:hover .story-title {
  color: var(--st-accent);
}

.story-excerpt {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: var(--st-text-dim);
  line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: var(--st-text-dim);
}

.story-meta-sep {
  opacity: 0.4;
}

/* Thumbnail */
.story-thumb {
  width: 140px;
  height: 110px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--st-glass-border);
  align-self: center;
}

.story-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.story-card:hover .story-thumb img {
  transform: scale(1.08);
}

@media (max-width: 640px) {
  .story-card {
    flex-direction: column;
    padding: 20px 24px;
  }
  .story-thumb {
    width: 100%;
    height: 180px;
  }
}

/* ── STORY READER DETAIL VIEW (MODAL OVERLAY) ── */
.story-reader-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 0 80px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s ease;
  overflow-y: auto;
}

.story-reader-overlay.open {
  opacity: 1;
  visibility: visible;
}

.story-reader-container {
  width: 100%;
  max-width: 860px;
  background: var(--st-bg);
  border-left: 1px solid var(--st-glass-border);
  border-right: 1px solid var(--st-glass-border);
  padding: 40px 6vw 80px;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.8);
  transform: translateY(30px);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0 auto;
}

.story-reader-overlay.open .story-reader-container {
  transform: translateY(0);
}

.reader-bottom-controls {
  display: flex;
  justify-content: center;
  margin: 32px 0 0;
}

.story-reader-end-top {
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  border: 1px solid var(--st-glass-border);
  border-radius: 999px;
  background: rgba(207, 205, 248, 0.12);
  color: var(--st-accent);
  padding: 12px 26px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.story-reader-end-top:hover {
  background: rgba(207, 205, 248, 0.18);
  color: #fff;
  transform: translateY(-1px);
}

@media (max-width: 640px) {
  .reader-bottom-controls {
    margin: 28px 0 0;
  }
}

/* Reader Top Bar */
.reader-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--st-glass-border);
  margin-bottom: 32px;
}

.reader-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.1em;
  color: var(--st-accent);
  background: none;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  transition: color 0.2s ease, transform 0.2s ease;
}

.reader-back-btn:hover {
  color: #fff;
  transform: translateX(-3px);
}

.reader-stats-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  color: var(--st-text-dim);
}

.reader-close-btn {
  background: none;
  border: none;
  color: var(--st-text-dim);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s ease;
}

.reader-close-btn:hover {
  color: var(--st-accent);
}

/* Reader Header */
.reader-header {
  margin-bottom: 32px;
}

.reader-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.5rem, 6vw, 3.8rem);
  letter-spacing: 0.04em;
  color: var(--st-text);
  line-height: 1.1;
  margin: 12px 0 8px;
}

.reader-date {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: var(--st-text-dim);
}

/* Reader Content Body */
.reader-body {
  font-family: 'Lora', serif;
  font-size: 1.15rem;
  line-height: 1.9;
  color: var(--st-text-body);
  margin-bottom: 48px;
}

.reader-body p {
  margin-bottom: 24px;
}

.reader-body h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  color: var(--st-accent);
  margin: 36px 0 16px;
  letter-spacing: 0.06em;
}

/* ── GALLERY SECTION (SUPPORT ART & COVER) ── */
.story-gallery-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--st-glass-border);
}

.story-gallery-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem;
  letter-spacing: 0.08em;
  color: var(--st-accent);
  margin-bottom: 20px;
  text-transform: uppercase;
}

.story-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.story-gallery-item {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--st-surface);
  border: 1px solid var(--st-glass-border);
  cursor: pointer;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.story-gallery-item:hover {
  transform: scale(1.03);
  border-color: var(--st-accent);
}

.story-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-gallery-caption {
  position: absolute;
  bottom: 0;
  inset-x: 0;
  padding: 8px 12px;
  background: rgba(31, 32, 38, 0.85);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
