/* ==============================================================
   CampusShelf — Blog (listing + single post)
   Built on top of the design tokens + nav/footer from style.css.
   Uses a serif display font (Fraunces) just for editorial headings,
   layered on top of the site's normal Manrope/Inter for everything else.
   ============================================================== */

.blog-hero {
  padding: 150px 0 40px;
  background: var(--bg-soft);
  text-align: center;
}
.blog-hero .eyebrow {
  display: inline-block;
  margin-bottom: 14px;
}
.blog-hero h1 {
  font-family: 'Fraunces', var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 5.5vw, 54px);
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}
.blog-hero p {
  color: var(--ink-soft);
  font-size: 16px;
  max-width: 560px;
  margin: 0 auto;
}

/* ---------- Category filter pills ---------- */
.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 26px 0 8px;
}
.blog-filter-pill {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}
.blog-filter-pill:hover { border-color: var(--blue); color: var(--blue); }
.blog-filter-pill.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---------- Post grid / cards ---------- */
.blog-grid-section { padding: 30px 0 90px; }
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 10px;
}
.blog-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  box-shadow: var(--shadow-sm);
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}
.blog-card-media {
  width: 100%;
  aspect-ratio: 16 / 9.5;
  object-fit: cover;
  background: var(--bg-soft);
  display: block;
}
.blog-card-body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.blog-card-emoji {
  font-size: 34px;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  border-radius: 16px;
  margin-bottom: 18px;
}
.blog-card-cat {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 10px;
}
.blog-card h3 {
  font-family: 'Fraunces', var(--font-display);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.3;
  margin-bottom: 10px;
}
.blog-card p {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
  flex: 1;
  margin-bottom: 16px;
}
.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-soft);
  font-weight: 600;
}
.blog-card-meta .dot { opacity: 0.5; }

.blog-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}

/* ---------- Single article ---------- */
.article-shell { padding: 140px 0 90px; }
.article-narrow { max-width: 760px; margin: 0 auto; }
.article-crumb {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.article-crumb a { color: var(--blue); font-weight: 600; }
.article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 24px;
}
.article-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 18px;
}
.article-meta-row .article-cat {
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11.5px;
  background: rgba(37,99,235,0.08);
  padding: 5px 11px;
  border-radius: 999px;
}
.article-meta-row .dot { color: var(--line); }
.article-meta-row .article-when,
.article-meta-row .article-read { color: var(--ink-soft); font-weight: 600; }

.article-title {
  font-family: 'Fraunces', var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.15;
  max-width: 820px;
  margin-bottom: 16px;
}
.article-subtitle {
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 720px;
  margin-bottom: 26px;
}
.article-byline {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 32px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}
.article-byline .article-byline-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; flex-shrink: 0;
}

.article-hero-img {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  border-radius: var(--radius);
  margin: 0 0 40px;
}

.article-body { max-width: 720px; }
.article-body p {
  font-size: 17.5px;
  line-height: 1.85;
  color: var(--ink);
  margin-bottom: 22px;
}
.article-body h2 {
  font-family: 'Fraunces', var(--font-display);
  font-weight: 600;
  font-size: 27px;
  letter-spacing: -0.005em;
  margin: 44px 0 18px;
}
.article-body h3 {
  font-family: 'Fraunces', var(--font-display);
  font-weight: 600;
  font-size: 20px;
  margin: 30px 0 12px;
}
.article-body ul {
  margin: 0 0 24px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.article-body ul li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
}
.article-body ul.list-bullet li::before { content: "•"; color: var(--blue); font-weight: 800; }
.article-body ul.list-check li::before { content: "✓"; color: var(--green); font-weight: 800; }
.article-body ul.list-warning li::before { content: "!"; color: #F59E0B; font-weight: 800; }
.article-body ol {
  margin: 0 0 24px;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.article-body ol li { font-size: 16px; line-height: 1.65; }

.article-callout {
  border-radius: var(--radius-sm);
  padding: 22px 24px;
  margin: 10px 0 30px;
  border-left: 4px solid var(--blue);
  background: rgba(37,99,235,0.06);
}
.article-callout.style-warning { border-left-color: #F59E0B; background: rgba(245,158,11,0.08); }
.article-callout.style-success { border-left-color: var(--green); background: rgba(16,185,129,0.07); }
.article-callout-title {
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.article-callout p { font-size: 15px; margin: 0; color: var(--ink); line-height: 1.65; }

.article-quote {
  border-left: 4px solid var(--ink);
  padding: 6px 0 6px 24px;
  margin: 12px 0 32px;
  font-family: 'Fraunces', var(--font-display);
  font-size: 21px;
  font-weight: 500;
  font-style: italic;
  line-height: 1.5;
}
.article-quote cite {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  font-style: normal;
  color: var(--ink-soft);
  margin-top: 12px;
}

.article-image {
  width: 100%;
  border-radius: var(--radius-sm);
  margin: 10px 0 30px;
}
.article-image-caption {
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
  margin-top: -20px;
  margin-bottom: 30px;
}

.article-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 38px 0;
}

.article-author-box {
  display: flex;
  gap: 16px;
  align-items: center;
  max-width: 720px;
  margin-top: 54px;
  padding: 24px;
  background: var(--bg-soft);
  border-radius: var(--radius);
}
.article-author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
}
.article-author-box strong { display: block; font-size: 15px; }
.article-author-box span { font-size: 13.5px; color: var(--ink-soft); }

.article-share-row {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 720px;
  margin-top: 26px;
  font-size: 13.5px;
  color: var(--ink-soft);
  font-weight: 700;
}
.article-share-row a {
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  text-decoration: none;
  transition: all .15s ease;
}
.article-share-row a:hover { border-color: var(--blue); color: var(--blue); }

.article-related {
  max-width: 900px;
  margin-top: 64px;
}
.article-related h4 {
  font-family: 'Fraunces', var(--font-display);
  font-weight: 600;
  font-size: 20px;
  margin-bottom: 20px;
}
.article-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 900px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .article-related-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .blog-grid { grid-template-columns: 1fr; }
  .blog-hero { padding: 120px 0 30px; }
  .article-shell { padding: 110px 0 60px; }
  .article-hero-img { max-height: 260px; }
}

/* ==============================================================
   Per-post theming — colors + fonts set from the visual editor.
   These are pure additions: every rule falls back to the exact
   original value, so a post with no theme saved looks 100%
   unchanged. Renderer sets --post-accent/--post-text/--post-bg/
   --post-font-heading/--post-font-body on .article-narrow inline.
   ============================================================== */
.article-narrow {
  background: var(--post-bg, transparent);
  color: var(--post-text, var(--ink));
}
.article-narrow.has-bg { padding: 32px; border-radius: var(--radius); }

.article-title,
.article-body h2,
.article-body h3,
.article-related h4 {
  font-family: var(--post-font-heading, 'Fraunces', var(--font-display));
}
.article-subtitle,
.article-body p,
.article-body li {
  font-family: var(--post-font-body, var(--font-body));
}
.article-quote {
  font-family: var(--post-font-heading, 'Fraunces', var(--font-display));
  border-left-color: var(--post-accent, var(--ink));
}
.article-callout p { color: var(--post-text, var(--ink)); }

.article-cat,
.article-crumb a,
.article-body ul.list-bullet li::before {
  color: var(--post-accent, var(--blue));
}
.article-callout { border-left-color: var(--post-accent, var(--blue)); }
.article-share-row a:hover { border-color: var(--post-accent, var(--blue)); color: var(--post-accent, var(--blue)); }

/* ==============================================================
   Layout sections — media + text blocks in different arrangements,
   so posts aren't just a single linear column of text/images.
   ============================================================== */
.article-section {
  display: grid;
  gap: 30px;
  align-items: center;
  margin: 34px 0;
}
.article-section.layout-top { grid-template-columns: 1fr; }
.article-section.layout-top .article-section-media { order: 1; }
.article-section.layout-top .article-section-text { order: 2; }

.article-section.layout-left,
.article-section.layout-right { grid-template-columns: 1fr 1fr; }
.article-section.layout-left .article-section-media { order: 1; }
.article-section.layout-left .article-section-text { order: 2; }
.article-section.layout-right .article-section-media { order: 2; }
.article-section.layout-right .article-section-text { order: 1; }

.article-section-media img {
  width: 100%;
  display: block;
  border-radius: 16px;
  object-fit: cover;
  aspect-ratio: 4 / 3;
}
.article-section-text h3 {
  font-family: var(--post-font-heading, 'Fraunces', var(--font-display));
  font-weight: 600;
  font-size: 21px;
  margin-bottom: 10px;
}
.article-section-text p {
  font-family: var(--post-font-body, var(--font-body));
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--post-text, var(--ink-soft));
}

.article-feature {
  background: var(--bg-soft);
  border-left: 4px solid var(--post-accent, var(--blue));
  border-radius: var(--radius-sm);
  padding: 28px 30px;
  margin: 30px 0;
}
.article-feature h3 {
  font-family: var(--post-font-heading, 'Fraunces', var(--font-display));
  font-weight: 600;
  font-size: 22px;
  margin-bottom: 12px;
}
.article-feature p {
  font-family: var(--post-font-body, var(--font-body));
  font-size: 16px;
  line-height: 1.7;
}

@media (max-width: 640px) {
  .article-section.layout-left,
  .article-section.layout-right { grid-template-columns: 1fr; }
  .article-section.layout-left .article-section-media,
  .article-section.layout-right .article-section-media { order: 1; }
  .article-section.layout-left .article-section-text,
  .article-section.layout-right .article-section-text { order: 2; }
}
