/* ============================================================
   Evassentials — Digital Stories storefront (stories.php)
   assets/css/stories.css
   Moved from an inline <style> block in stories.php.
   ============================================================ */


.stories-hero {
  background: linear-gradient(135deg, #f16f91 0%, #6f9191 50%, #916f91 100%);
  padding: 4rem 2rem 3rem;
  text-align: center;
  color: white;
}
.stories-hero-eyebrow {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.stories-hero h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  margin-bottom: 1rem;
  line-height: 1.1;
}
.stories-hero p {
  font-size: 1rem;
  color: rgba(255,255,255,0.75);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.7;
}

.stories-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

/* ── Boutique shell: sidebar + main, same DNA as the account
   Dashboard Hub, so the storefront and account feel like one family ── */
.stories-shell {
  display: flex;
  align-items: flex-start;
  gap: 2.25rem;
}

.stories-sidebar {
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: 96px;
  background: white;
  border: 1px solid var(--paper3);
  border-radius: var(--radius-lg);
  padding: 0.85rem;
  box-shadow: 0 2px 12px rgba(26,26,46,0.07);
}
.stories-sidebar-title {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--gold);
  padding: 0.5rem 0.85rem 0.75rem;
}
.stories-nav {
  display: flex; flex-direction: column; gap: 0.15rem;
}
.stories-nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.6rem 0.85rem; border-radius: 9px;
  font-size: 0.85rem; font-weight: 600; color: #6f9191;
  text-decoration: none; transition: background 0.15s, color 0.15s;
}
.stories-nav-item:hover:not(.active) { background: var(--paper2); color: var(--ink); }
.stories-nav-item.active { background: var(--ink); color: white; }

.stories-main { flex: 1; min-width: 0; }

/* Quick "Your Library" access card — signed-in shoppers only */
.stories-library-card {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #2D0B4E, #541575);
  color: white; border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem; margin-bottom: 2rem;
  box-shadow: 0 2px 12px rgba(26,26,46,0.12);
}
.stories-library-card-text { font-size: 0.92rem; }
.stories-library-card-text strong { font-family: 'Fraunces', serif; font-size: 1.05rem; }
.stories-library-card-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.5rem 1.1rem; background: white; color: #2D0B4E;
  border-radius: 8px; font-weight: 700; font-size: 0.82rem;
  text-decoration: none; white-space: nowrap;
}

.stories-mobile-filter-bar { display: none; }
.stories-filter-pill {
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 2px solid var(--paper3);
  background: white;
  color: var(--text2);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.stories-filter-pill:hover,
.stories-filter-pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

@media (max-width: 860px) {
  .stories-shell     { flex-direction: column; }
  .stories-sidebar   { display: none; }
  .stories-mobile-filter-bar {
    display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 2rem;
  }
}

.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.75rem;
}

.story-card {
  background: white;
  border: 1px solid var(--paper3);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(26,26,46,0.07);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  /* Hard ceiling: a grid item can only stretch to fill its track, but if
     something upstream ever breaks the grid (e.g. a stray unclosed tag
     elsewhere on the page swallowing this <style> block, or a future
     edit dropping .stories-grid's display:grid), this stops the card —
     and the cover image inside it — from blowing up to full page width
     as a fallback block-level element instead. */
  max-width: 360px;
  min-width: 0;
}
.story-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(26,26,46,0.13);
}

.story-card-cover {
  aspect-ratio: 3/4;
  background: linear-gradient(135deg, #2D0B4E, #541575);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  position: relative;
  overflow: hidden;
}
.story-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.story-card-category {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(26,26,46,0.75);
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

.story-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.story-card-title {
  font-family: 'Fraunces', serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.story-card-excerpt {
  font-size: 0.82rem;
  color: var(--text2);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1rem;
}
.story-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.story-card-price {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--forest);
}
.story-card-formats {
  display: flex;
  gap: 0.3rem;
}
.story-format-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: var(--paper2);
  color: var(--text2);
  letter-spacing: 0.05em;
}

/* ── Single product view ── */
.story-single {
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}
.story-single-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3rem;
  align-items: start;
}
.story-single-cover {
  aspect-ratio: 3/4;
  background: linear-gradient(135deg, #2D0B4E, #541575);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  box-shadow: 0 8px 32px rgba(26,26,46,0.2);
}
.story-single-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.story-single-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 900;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 0.5rem;
}
.story-single-category {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-bottom: 1rem;
}
.story-single-excerpt {
  font-size: 1rem;
  color: var(--text2);
  line-height: 1.75;
  margin-bottom: 1.5rem;
  font-style: italic;
}
.story-single-description {
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.8;
  margin-bottom: 2rem;
}
.story-single-formats {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.story-single-format {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  background: var(--paper2);
  border: 1px solid var(--paper3);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
}
.story-buy-box {
  background: white;
  border: 2px solid var(--paper3);
  border-radius: 16px;
  padding: 1.5rem;
  margin-top: 1rem;
}
.story-buy-price {
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  font-weight: 900;
  color: var(--forest);
  margin-bottom: 0.25rem;
}
.story-buy-note {
  font-size: 0.78rem;
  color: var(--text2);
  margin-bottom: 1.25rem;
}
.btn-buy {
  display: block;
  width: 100%;
  padding: 0.85rem;
  background: var(--ink);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.18s;
  margin-bottom: 0.75rem;
}
.btn-buy:hover { background: var(--ink2); }
.btn-buy-free {
  background: var(--forest);
}
.btn-buy-free:hover { background: #1e3d29; }

@media (max-width: 680px) {
  .story-single-grid { grid-template-columns: 1fr; }
  .story-single-cover { max-width: 240px; margin: 0 auto; }
}
