/* =========================================================
   Hidden Spot Cafe — Stories Styles (Magical but Clean)
   File: /stories/stories.css
   Notes:
   - Loads after /style.css, so it can override global styles safely.
   - Avoids using .badge (global menu uses .badge with absolute positioning).
   - Goal here is refinement, not redesign:
     keep the current Stories page vibe, but align it more closely
     with the approved premium dark cafe root system.
   - This version also improves the story detail reading experience
     without changing the shared HTML structure.
   ========================================================= */


/* =========================================================
   1) PAGE LAYOUT / CONTAINER
   ========================================================= */

.stories-container{
  max-width: 1020px;
  margin: 16px auto 0;
  padding: 14px 14px 44px;
}


/* =========================================================
   2) HERO (Stories header)
   - Keeps the current premium hero look
   - Tightens alignment with root glass cards and depth system
   ========================================================= */

.stories-hero{
  text-align:center;
  padding: 78px 18px 28px;
  margin: 0 auto 18px;
  border-radius: 22px;

  /* Magical but cleaner / more controlled than before */
  background:
    radial-gradient(circle at 30% 0%, rgba(176,108,255,0.20), transparent 55%),
    linear-gradient(180deg, rgba(30,30,48,0.90), rgba(12,12,22,0.94));

  border: 1px solid var(--border-mid);
  box-shadow:
    0 16px 34px rgba(0,0,0,0.36),
    0 0 22px rgba(176,108,255,0.08);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.stories-hero h1{
  margin: 0 0 8px;
  font-size: 34px;
  letter-spacing: 0.2px;
  color: #ffffff;
}

.stories-hero p{
  margin: 0 auto;
  max-width: 52ch;
  color: var(--text-soft);
  line-height: 1.6;
  font-size: 15px;
}


/* =========================================================
   3) HERO BUTTONS (Fix alignment mismatch)
   - Your global buttons are <a> tags with different padding/baseline behavior.
   - We standardize them inside this hero actions wrapper.
   ========================================================= */

.stories-hero-actions{
  display:flex;
  justify-content:center;
  align-items:center;
  gap: 16px;
  flex-wrap:wrap;
  margin-top: 16px;
}

.stories-hero-actions .message-btn,
.stories-hero-actions .share-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height: 1;
  min-height: 20px;
  padding: 12px 25px;
  border-radius: 999px;
  text-align:center;
  white-space: nowrap;
}


/* =========================================================
   4) SEARCH BAR (Big, bordered, icon inside)
   - Styled like a premium dark glass input shell
   ========================================================= */

.stories-search{
  position: relative;
  max-width: 860px;
  margin: 14px auto 18px;

  padding: 14px 14px;
  border-radius: 18px;

  background:
    linear-gradient(180deg, rgba(26,26,42,0.86), rgba(14,14,26,0.88));
  border: 1px solid var(--border-soft);
  box-shadow:
    0 12px 24px rgba(0,0,0,0.22),
    0 0 0 1px rgba(255,255,255,0.02) inset;

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  transition: 0.22s ease;
}

.stories-search:hover{
  border-color: rgba(176,108,255,0.16);
}

.stories-search:focus-within{
  border-color: rgba(176,108,255,0.22);
  box-shadow:
    0 12px 24px rgba(0,0,0,0.24),
    0 0 0 1px rgba(255,255,255,0.02) inset,
    0 0 18px rgba(176,108,255,0.10);
}

.stories-search .search-icon{
  position:absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.9;
  pointer-events:none;
  font-size: 16px;
}

.stories-search input{
  width:100%;
  border:none;
  outline:none;
  background:transparent;
  color: var(--text-main);
  font-size: 16px;
  padding: 6px 10px 6px 40px; /* space for icon */
}

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


/* =========================================================
   5) FEATURED STORY (Premium top card)
   - Stronger hierarchy than the regular cards
   - Slight warm accent to feel more “featured” / intentional
   ========================================================= */

.featured-wrap{
  margin: 14px auto 16px;
}

.featured-card-link{
  display:block;
  text-decoration:none;
  color:inherit;
}

.featured-card{
  border-radius: 22px;
  padding: 18px 18px;

  background:
    radial-gradient(circle at 22% 0%, rgba(176,108,255,0.20), transparent 50%),
    radial-gradient(circle at 88% 18%, rgba(240,199,122,0.07), transparent 28%),
    linear-gradient(180deg, rgba(34,28,52,0.92), rgba(12,12,24,0.95));

  border: 1px solid rgba(255,255,255,0.12);
  box-shadow:
    0 20px 44px rgba(0,0,0,0.42),
    0 0 28px rgba(176,108,255,0.12);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: 0.25s ease;
}

.featured-card:hover{
  transform: translateY(-3px);
  border-color: rgba(240,199,122,0.18);
  box-shadow:
    0 22px 48px rgba(0,0,0,0.44),
    0 0 30px rgba(176,108,255,0.14);
}

.featured-kicker{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
  color: var(--text-soft);
  font-size: 13px;
}

.featured-badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(176,108,255,0.12);
  color:#ffffff;
  font-size: 12px;
  box-shadow: 0 6px 14px rgba(176,108,255,0.08);
}

.featured-title{
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.18;
  letter-spacing: 0.2px;
  color: #ffffff;
}

.featured-excerpt{
  margin: 0 0 14px;
  color: var(--text-soft);
  line-height: 1.65;
  font-size: 15px;
  max-width: 70ch;
}

.featured-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 8px;
}

.read-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 11px 14px;
  border-radius: 14px;
  font-weight:bold;
  color:#fff;

  background: linear-gradient(135deg, var(--accent-purple-deep), var(--accent-purple));
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow:
    0 10px 20px rgba(141,76,230,0.24),
    0 0 0 1px rgba(255,255,255,0.03) inset;

  transition: 0.2s ease;
}

.read-btn:hover{
  transform: translateY(-1px);
  box-shadow:
    0 12px 24px rgba(141,76,230,0.28),
    0 0 14px rgba(176,108,255,0.16);
}


/* =========================================================
   6) LIST GRID + CARDS (Whole card clickable)
   - Keeps the current structure
   - Refined to match root card gradients / borders / shadows
   ========================================================= */

#stories-list{
  display:grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.story-card-link{
  display:block;
  text-decoration:none;
  color:inherit;
}

.story-card-link *{
  text-decoration:none;
}

.story-card{
  border-radius: 18px;
  padding: 16px 16px;

  background:
    radial-gradient(circle at 20% 0%, rgba(176,108,255,0.14), transparent 52%),
    linear-gradient(180deg, rgba(30,30,48,0.90), rgba(15,15,28,0.92));

  border: 1px solid var(--border-soft);
  box-shadow:
    0 14px 28px rgba(0,0,0,0.28),
    0 0 0 1px rgba(255,255,255,0.02) inset;

  transition: 0.22s ease;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.story-card:hover{
  transform: translateY(-4px);
  border-color: rgba(240,199,122,0.16);
  box-shadow:
    0 18px 34px rgba(0,0,0,0.34),
    0 0 18px rgba(176,108,255,0.10);
}

.story-title{
  margin:0 0 8px;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: 0.2px;
  color: #ffffff;
}

.story-excerpt{
  margin:0 0 12px;
  color: var(--text-soft);
  line-height: 1.6;
  font-size: 14.5px;
}

.story-meta{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 10px;
}

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


/* =========================================================
   7) TAG PILLS (Used both on index + story pages)
   - Tuned to the root purple system with cleaner borders
   ========================================================= */

.tag{
  display:inline-flex;
  align-items:center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  color: #d8cff0;
  font-size: 12px;
  line-height: 1.2;
  background: rgba(176,108,255,0.10);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}


/* =========================================================
   8) STORY BADGES (TRENDING / NEW TODAY)
   - Uses .story-badge so it won't conflict with global .badge
   ========================================================= */

.badge-row{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
  margin-bottom:10px;
}

.story-badge{
  position: static; /* important: avoid absolute overlap */
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  letter-spacing:0.3px;
  border:1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: #ffffff;
}

.story-badge-new{
  background: rgba(46, 204, 113, 0.14);
  border-color: rgba(46, 204, 113, 0.30);
  color: rgba(255,255,255,0.92);
}

.story-badge-trending{
  background: rgba(255, 77, 109, 0.14);
  border-color: rgba(255, 77, 109, 0.34);
  color: rgba(255,255,255,0.92);
}


/* =========================================================
   9) PAGINATION
   - Aligned to the same glass-dark control style
   ========================================================= */

.pagination{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 12px;
  margin: 18px 0 6px;
}

.pagination button{
  border: 1px solid var(--border-soft);
  background:
    linear-gradient(180deg, rgba(24,24,38,0.86), rgba(12,12,22,0.88));
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: 14px;
  cursor: pointer;
  transition: 0.2s ease;
  box-shadow:
    0 10px 18px rgba(0,0,0,0.18),
    0 0 0 1px rgba(255,255,255,0.02) inset;
}

.pagination button:hover{
  transform: translateY(-1px);
  border-color: rgba(176,108,255,0.24);
  box-shadow:
    0 12px 22px rgba(0,0,0,0.24),
    0 0 14px rgba(176,108,255,0.10);
}

.pagination button:disabled{
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow:
    0 8px 14px rgba(0,0,0,0.12),
    0 0 0 1px rgba(255,255,255,0.02) inset;
}

#pageInfo{
  color: var(--text-soft);
  font-size: 13px;
}


/* =========================================================
   10) STORY DETAIL PAGE (Reading card + actions)
   - Your story pages use: <article class="story-reading-card">...</article>
   - Matched to the premium card system used on the homepage
   - Optimized for long-form reading comfort
   ========================================================= */

.story-reading-card{
  max-width: 860px;        /* centers reading card even if container is wider */
  margin: 0 auto;
  border-radius: 22px;
  padding: 22px 20px 20px;

  background:
    radial-gradient(circle at 25% 0%, rgba(176,108,255,0.16), transparent 55%),
    linear-gradient(180deg, rgba(28,28,44,0.92), rgba(12,12,22,0.94));

  border: 1px solid var(--border-mid);
  box-shadow:
    0 18px 40px rgba(0,0,0,0.40),
    0 0 20px rgba(176,108,255,0.06);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.story-reading-card p{
  margin: 0 0 18px;
  line-height: 1.95;
  font-size: 16px;
  color: rgba(255,255,255,0.88);
  letter-spacing: 0.01em;
  max-width: 70ch;
}

.story-reading-card > p{
  margin-left: auto;
  margin-right: auto;
}

.story-reading-card strong{
  color: #ffffff;
}

.story-reading-card em{
  color: rgba(255,255,255,0.80);
}

.story-divider{
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.12), rgba(255,255,255,0.04));
  margin: 16px 0 18px;
}

.story-reading-card .story-meta{
  align-items:center;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--text-soft);
  font-size: 13px;
}

.story-reading-card .story-meta > span:first-child{
  color: var(--text-muted);
  margin-right: 2px;
}

.story-reading-card .tag{
  background: rgba(176,108,255,0.10);
  border-color: rgba(255,255,255,0.08);
  color: #d8cff0;
}

.story-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 22px;
  padding-top: 2px;
}

.story-actions .action-btn{
  border: 1px solid var(--border-soft);
  background:
    linear-gradient(180deg, rgba(24,24,38,0.86), rgba(12,12,22,0.88));
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: 14px;
  cursor: pointer;
  text-decoration:none;
  transition: 0.2s ease;
  box-shadow:
    0 10px 18px rgba(0,0,0,0.18),
    0 0 0 1px rgba(255,255,255,0.02) inset;
}

.story-actions .action-btn:hover{
  transform: translateY(-1px);
  border-color: rgba(176,108,255,0.24);
  box-shadow:
    0 12px 22px rgba(0,0,0,0.24),
    0 0 14px rgba(176,108,255,0.10);
}


/* =========================================================
   11) RESPONSIVE (2-column grid on wider screens)
   ========================================================= */

@media (min-width: 820px){
  #stories-list{
    grid-template-columns: 1fr 1fr;
  }

  .stories-hero{
    padding: 84px 24px 34px;
  }

  .story-reading-card{
    padding: 26px 24px 24px;
  }
}


/* =========================================================
   12) SAFETY OVERRIDE
   - If someone accidentally uses <header> without .stories-hero on stories pages
   ========================================================= */

body.stories-page header:not(.stories-hero){
  padding: 60px 18px;
  background: linear-gradient(rgba(10,10,20,0.55), rgba(10,10,20,0.75));
}


/* =========================================================
   13) STORY DETAIL MOBILE TUNING
   - Keeps long stories comfortable on smaller screens
   ========================================================= */

@media (max-width: 640px){
  .story-reading-card{
    padding: 18px 16px 18px;
    border-radius: 18px;
  }

  .story-reading-card p{
    font-size: 15.5px;
    line-height: 1.9;
    margin-bottom: 16px;
  }

  .story-reading-card .story-meta{
    gap: 6px;
  }

  .story-actions{
    gap: 8px;
  }
}


/* =========================================================
   14) STORY PAGE SEARCH + DISCOVERY
   - Adds search after the story title and again near the bottom
   - Shows relevant defaults even before typing
   - Keeps the current premium dark card language
   ========================================================= */

.story-page-search{
  max-width: 860px;
  margin: 0 auto 18px;
}

.story-page-search-top{
  margin-top: 0;
}

.story-page-search-bottom{
  margin-top: 10px;
}

.story-page-search-heading{
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.2;
  color: #ffffff;
  letter-spacing: 0.2px;
}

.story-page-search-bar{
  position: relative;
  width: 100%;
  padding: 14px 14px;
  border-radius: 18px;

  background:
    linear-gradient(180deg, rgba(26,26,42,0.86), rgba(14,14,26,0.88));
  border: 1px solid var(--border-soft);
  box-shadow:
    0 12px 24px rgba(0,0,0,0.22),
    0 0 0 1px rgba(255,255,255,0.02) inset;

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: 0.22s ease;
}

.story-page-search-bar:hover{
  border-color: rgba(176,108,255,0.16);
}

.story-page-search-bar:focus-within{
  border-color: rgba(176,108,255,0.22);
  box-shadow:
    0 12px 24px rgba(0,0,0,0.24),
    0 0 0 1px rgba(255,255,255,0.02) inset,
    0 0 18px rgba(176,108,255,0.10);
}

.story-page-search-icon{
  position:absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.9;
  pointer-events:none;
  font-size: 16px;
}

.story-page-search input{
  width:100%;
  border:none;
  outline:none;
  background:transparent;
  color: var(--text-main);
  font-size: 16px;
  padding: 6px 10px 6px 40px;
}

.story-page-search input::placeholder{
  color: var(--text-muted);
}

.story-page-search-results{
  display:grid;
  gap: 12px;
  margin-top: 12px;
}

.story-page-search-result{
  display:block;
  text-decoration:none;
  color:inherit;
  border-radius: 16px;
  padding: 14px 14px;

  background:
    radial-gradient(circle at 20% 0%, rgba(176,108,255,0.12), transparent 52%),
    linear-gradient(180deg, rgba(30,30,48,0.90), rgba(15,15,28,0.92));

  border: 1px solid var(--border-soft);
  box-shadow:
    0 14px 28px rgba(0,0,0,0.24),
    0 0 0 1px rgba(255,255,255,0.02) inset;

  transition: 0.22s ease;
}

.story-page-search-result:hover{
  transform: translateY(-2px);
  border-color: rgba(240,199,122,0.16);
  box-shadow:
    0 18px 34px rgba(0,0,0,0.30),
    0 0 18px rgba(176,108,255,0.10);
}

.story-page-search-result-title{
  margin: 0 0 6px;
  font-size: 17px;
  line-height: 1.3;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.story-page-search-result-excerpt{
  margin: 0 0 10px;
  color: var(--text-soft);
  line-height: 1.6;
  font-size: 14px;
}

.story-page-search-result-meta{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12.5px;
}

.story-page-search-empty{
  border-radius: 16px;
  padding: 14px 14px;
  background:
    linear-gradient(180deg, rgba(24,24,38,0.86), rgba(12,12,22,0.88));
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-size: 14px;
  box-shadow:
    0 10px 18px rgba(0,0,0,0.18),
    0 0 0 1px rgba(255,255,255,0.02) inset;
}

@media (min-width: 820px){
  .story-page-search-results{
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px){
  .story-page-search-heading{
    font-size: 20px;
  }

  .story-page-search-result{
    padding: 13px 13px;
    border-radius: 14px;
  }

  .story-page-search-result-title{
    font-size: 16px;
  }

  .story-page-search-result-excerpt{
    font-size: 13.5px;
  }
}

/* =========================================================
   15) STATIC SUGGESTED STORY LINKS
   - Real clickable internal links rendered after bottom search
   - Uses unique class names to avoid collision with existing search UI
   - Designed to match current premium dark story card system
   ========================================================= */

.story-suggested-links{
  max-width: 860px;
  margin: 0 auto 4px;
}

.story-suggested-links-heading{
  margin: 0 0 12px;
  font-size: 22px;
  line-height: 1.2;
  color: #ffffff;
  letter-spacing: 0.2px;
}

.story-suggested-links-list{
  display: grid;
  gap: 10px;
}

.story-suggested-link{
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 16px;
  padding: 14px 14px;

  background:
    radial-gradient(circle at 20% 0%, rgba(176,108,255,0.12), transparent 52%),
    linear-gradient(180deg, rgba(30,30,48,0.90), rgba(15,15,28,0.92));

  border: 1px solid var(--border-soft);
  box-shadow:
    0 14px 28px rgba(0,0,0,0.24),
    0 0 0 1px rgba(255,255,255,0.02) inset;

  transition: 0.22s ease;
}

.story-suggested-link:hover{
  transform: translateY(-2px);
  border-color: rgba(240,199,122,0.16);
  box-shadow:
    0 18px 34px rgba(0,0,0,0.30),
    0 0 18px rgba(176,108,255,0.10);
}

.story-suggested-link-title{
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.story-suggested-link-empty{
  border-radius: 16px;
  padding: 14px 14px;
  background:
    linear-gradient(180deg, rgba(24,24,38,0.86), rgba(12,12,22,0.88));
  border: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-size: 14px;
  box-shadow:
    0 10px 18px rgba(0,0,0,0.18),
    0 0 0 1px rgba(255,255,255,0.02) inset;
}

@media (min-width: 820px){
  .story-suggested-links-list{
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px){
  .story-suggested-links-heading{
    font-size: 20px;
  }

  .story-suggested-link{
    padding: 13px 13px;
    border-radius: 14px;
  }

  .story-suggested-link-title{
    font-size: 16px;
  }
}

/* =========================================================
   FIX: Story page search alignment (top + bottom)
   - Keeps both search boxes aligned with the story card width
   ========================================================= */

.story-page-search{
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.story-page-search-bar{
  width: 100%;
  box-sizing: border-box;
}

.story-reading-card .story-page-search{
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.story-reading-card .story-page-search-bar{
  width: 100%;
  box-sizing: border-box;
}
