/* =========================================================
   OPEN STORIES — CONSOLIDATED DARK MODE (CLEANED)
   ========================================================= */

/* GLOBAL RESET & BASE */
body.open-story,
.open-story-page {
  background: #1c1916;
  color: #f0ede8;
  font-family: Georgia, "Times New Roman", serif;
}

.open-story-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
  position: relative;
}

/* Kill theme pseudo-elements */
body.open-story::before,
body.open-story::after,
.open-story-page *::before,
.open-story-page *::after {
  content: none !important;
  display: none !important;
}

/* PAGE DECOR */
.open-story-page::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0rem; right: 0rem;
  border-left: 1px solid rgba(255,255,255,0.05);
  border-right: 1px solid rgba(255,255,255,0.05);
  pointer-events: none;
}

/* TITLE & BYLINE */
.open-story-page h1 {
  font-size: 2.6rem;
  font-family: "Libre Baskerville", Georgia, serif;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow: 0 1px 0 rgba(0,0,0,0.6), 0 0 12px rgba(255,230,180,0.06);
}

.open-story-page h1::after {
  content: "";
  display: block;
  width: 3rem;
  height: 1px;
  background: rgba(255,255,255,0.25);
  margin: 1.25rem auto 0;
}

.byline {
  font-style: italic;
  text-align: center;
  margin: -0.25rem 0 3.5rem;
  opacity: 0.9;
}

/* SEARCH */
.open-stories-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 420px;
  margin: 0 auto 1.5rem;
}

#openStoriesSearch {
  flex: 1;
  padding: 0.8rem 1rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: #f0ede8;
  font-size: 1rem;
}

#clearSearch {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  padding: 0.5rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}

#clearSearch:hover,
#clearSearch:focus { opacity: 1; }

#resultsCount {
  text-align: center;
  margin: 0.5rem 0 1.5rem;
  font-size: 0.95rem;
  color: rgba(255,255,255,0.6);
}

/* LIBRARY INDEX */
.library-index {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  text-align: center;
  margin: 0 0 3rem;
}

/* STORY LIST (INDEX VIEW) */
.open-story-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2.5rem 1.5rem;
  margin-top: 2rem;
}

.open-story-item {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  text-decoration: none;
  transition: transform 0.25s ease, opacity 0.2s;
}

.open-story-item:hover {
  transform: translateY(-6px);
  opacity: 0.98;
}

.open-story-thumb {
  width: 100%;
  max-width: 160px;
  height: auto;
  margin: 0 auto;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  opacity: 0.88;
  filter: grayscale(0.4) contrast(1.08);
  transition: all 0.3s ease;
}

.open-story-item:hover .open-story-thumb {
  opacity: 1;
  filter: grayscale(0.1) contrast(1.15);
  transform: scale(1.04);
}

.open-story-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.catalog-number {
  font-family: monospace;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.35);
}

.title {
  font-size: 1.35rem;
  font-weight: 600;
  color: #f5efe6;
  margin: 0;
}

.catalog-meta {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.5);
}

.description {
  font-size: 0.98rem;
  line-height: 1.5;
  color: rgba(255,255,255,0.82);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* PAGINATION */
.open-stories-pagination {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin: 3rem 0 4rem;
  flex-wrap: wrap;
}

.page-link {
  padding: 0.6rem 1.2rem;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s;
}

.page-link:hover,
.page-link.current {
  background: rgba(255,255,255,0.08);
  color: #fff;
  opacity: 1;
}

/* SHELF REEL (TOP PREVIEW) */
.open-shelf-window {
  max-width: 520px; /* ≈ 5 books visible */
  margin: 0 auto;
  padding-top: 1.25rem;
  position: relative;
  z-index: 10;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  background: #f8f5f0; /* warm off-white, or match your theme */
  
  /* FIXED: Enable horizontal scroll, keep vertical visible if needed */
  overflow-x: auto;
  overflow-y: visible;
  
  /* Edge fade mask (keeps cinematic look) */
  mask-image: linear-gradient(
    to right,
    transparent,
    black 8%,
    black 92%,
    transparent
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    black 8%,
    black 92%,
    transparent
  );

  /* Scrollbar: hidden by default, thin on hover */
  scrollbar-width: none; /* Firefox */
}

.open-shelf-window::-webkit-scrollbar {
  height: 0px; /* Chrome/Safari hidden */
}

.open-shelf-window:hover {
  scrollbar-width: thin;
  scrollbar-color: rgba(139,111,71,0.35) transparent; /* muted sepia tone, adjust to match */
}

.open-shelf-window:hover::-webkit-scrollbar {
  height: 6px;
}

.open-shelf-window:hover::-webkit-scrollbar-track {
  background: transparent;
}

.open-shelf-window:hover::-webkit-scrollbar-thumb {
  background: rgba(139,111,71,0.35);
  border-radius: 4px;
}

.open-shelf-window:hover::-webkit-scrollbar-thumb:hover {
  background: rgba(139,111,71,0.55);
}
.open-shelf-reel {
  display: inline-flex;
  gap: 1rem;
  padding: 1.5rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.open-shelf-reel::-webkit-scrollbar { display: none; }

.reel-book {
  flex: 0 0 auto;
  transform: scale(0.75);
  transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

.reel-book img {
  height: 110px;
  width: auto;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  filter: sepia(0.15) brightness(0.9);
  transition: all 0.4s ease;
}

.reel-book:hover img {
  filter: sepia(0) brightness(1.05);
}

.floating-book {
  position: fixed !important;
  pointer-events: none;
  z-index: 9999;
  box-shadow: 0 30px 80px rgba(0,0,0,0.7);
  border-radius: 8px;
  transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.34,1.56,0.64,1);
}

/* NOTE & FOOTER */
.open-stories-note {
  text-align: center;
  font-style: italic;
  color: rgba(255,255,255,0.5);
  font-size: 0.95rem;
  margin-top: 6rem;
}

/* MEDIA QUERIES */
@media (max-width: 600px) {
  .open-story-list { grid-template-columns: 1fr; }
  .open-shelf-window { max-width: 100%; }
}

.story-teaser {
  max-width: 900px;
  margin: 2rem auto 3rem;
  overflow: hidden;
}

.story-teaser video {
  width: 100%;
  height: auto;
  opacity: 0.85;
  filter: brightness(92%) contrast(95%);
  pointer-events: none; /* prevents accidental clicks */
}

.story-epilogue {
  max-width: 720px;
  margin: 4rem auto 3rem;
  padding: 0;
  text-align: center;
  isolation: isolate;
}

.story-epilogue-note {
  font-size: 0.9rem;
  opacity: 0.75;
  margin-bottom: 1.25rem;
}

.story-epilogue-cover {
  display: block;
  margin: 0 auto;
  max-width: 420px;
  width: 100%;
  height: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  border-radius: 2px;
}

.story-epilogue::before {
  content: none !important;
}
.open-story-page:has(.story-epilogue)::before {
  left: 0;
  right: 0;
}
.story-epilogue::before,
.story-epilogue::after {
  display: none !important;
}
.story-epilogue-cover {
  position: relative;
  left: 0.75rem; /* small, intentional bias */
}
.story-teaser video {
  opacity: 0.8;
}
.story-teaser {
  margin-bottom: 2rem; /* instead of 3rem */
}


