/* ============================================================
   Dinnable – Stories (Blog) Styles
   Requires: site.css
   ============================================================ */

/* ── Page header ─────────────────────────────────────────────── */
.stories-hero {
  background: var(--primary);
  color: #fff;
  padding: 72px var(--content-pad) 56px;
  text-align: center;
}

.stories-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 14px;
}

.stories-hero p {
  font-size: 1.1rem;
  opacity: .85;
  max-width: 560px;
  margin: 0 auto;
}

/* ── Grid ────────────────────────────────────────────────────── */
.stories-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px var(--content-pad) 80px;
}

.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin-top: 0;
}

/* ── Story card ──────────────────────────────────────────────── */
.story-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
}

.story-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.story-card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--border);
  display: block;
}

.story-card-img-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--primary-light), var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-card-img-placeholder svg {
  opacity: .3;
}

.story-card-body {
  padding: 22px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

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

.story-tag {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: .68rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.story-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -.3px;
  line-height: 1.3;
  margin-bottom: 8px;
  color: var(--dark);
}

.story-card-summary {
  font-size: .9rem;
  color: var(--gray);
  line-height: 1.55;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: .78rem;
  color: var(--gray);
  font-weight: 500;
}

.story-card-meta time {
  font-weight: 600;
}

/* ── Empty state ─────────────────────────────────────────────── */
.stories-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--gray);
}

.stories-empty svg {
  opacity: .25;
  margin-bottom: 20px;
}

.stories-empty p {
  font-size: 1.05rem;
}

/* ── ─────────────────────── Story Detail ────────────────────── */

/* Hero image */
.story-detail-hero {
  width: 100%;
  height: clamp(260px, 40vw, 520px);
  object-fit: cover;
  display: block;
  background: var(--border);
}

.story-detail-hero-placeholder {
  width: 100%;
  height: clamp(260px, 40vw, 520px);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-detail-hero-placeholder svg {
  opacity: .2;
}

/* Article wrapper */
.story-detail-outer {
  max-width: 740px;
  margin: 0 auto;
  padding: 48px var(--content-pad) 80px;
}

/* Back link */
.story-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--primary);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 700;
  margin-bottom: 28px;
  transition: opacity .2s;
}

.story-back-link:hover { opacity: .7; }

/* Header */
.story-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.story-detail-title {
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.2;
  margin-bottom: 16px;
}

.story-detail-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .88rem;
  color: var(--gray);
  font-weight: 500;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
}

.story-detail-meta strong {
  color: var(--dark);
  font-weight: 700;
}

.story-detail-meta .meta-dot {
  color: var(--border);
}

/* Rich-text body */
.story-body {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--dark);
}

.story-body h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 2.2em 0 .7em;
  letter-spacing: -.3px;
}

.story-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1.8em 0 .5em;
}

.story-body p {
  margin-bottom: 1.2em;
}

.story-body ul,
.story-body ol {
  padding-left: 1.5em;
  margin-bottom: 1.2em;
}

.story-body li {
  margin-bottom: .4em;
}

.story-body a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.story-body blockquote {
  border-left: 4px solid var(--primary);
  margin: 1.5em 0;
  padding: 12px 20px;
  background: var(--primary-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--primary);
}

.story-body img {
  max-width: 100%;
  border-radius: var(--radius-md);
  margin: 1em 0;
}

.story-body strong { font-weight: 700; }
.story-body em     { font-style: italic; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 640px) {
  .stories-hero {
    padding: 48px 20px 40px;
  }

  .stories-section {
    padding: 32px 16px 60px;
  }

  .stories-grid {
    grid-template-columns: 1fr;
  }

  .story-detail-outer {
    padding: 32px 16px 60px;
  }
}

/* ══════════════════════════════════════════════════════════════
   Story-detail page layout with optional recipe sidebar
   ══════════════════════════════════════════════════════════════ */

/* Default: single-column, no sidebar */
.story-page-wrap {
  display: block;
}

/* (sidebar layout removed – recipes now shown as a grid below the article) */

/* ── Recipe sidebar (desktop) ────────────────────────────────── */
.story-recipes-sidebar {
  padding-top: 48px;
  padding-bottom: 80px;
}

.story-recipes-sidebar-inner {
  position: sticky;
  top: 24px;
}

.story-recipes-heading {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.story-recipes-sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.story-sidebar-recipe-item {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform .18s, box-shadow .18s;
}

.story-sidebar-recipe-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.story-sidebar-recipe-img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
  background: var(--border);
}

.story-sidebar-recipe-img--placeholder {
  background: linear-gradient(135deg, var(--primary-light), var(--border));
}

.story-sidebar-recipe-info {
  flex: 1;
  min-width: 0;
  padding: 10px 12px 10px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.story-sidebar-recipe-name {
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--dark);
}

.story-sidebar-recipe-meta {
  font-size: .76rem;
  color: var(--muted);
  font-weight: 500;
}

/* ── Recipe grid below article ──────────────────────────────── */
.story-recipes-below {
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding-top: 40px;
  padding-bottom: 20px;
}

.story-recipes-below .story-recipes-heading {
  margin-bottom: 24px;
}

.story-recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
