/* =========================================================
   Laghuna Blog
   Loaded by single-guide.php and archive-guide.php, on top of
   laghuna-design-tokens.css, site-chrome.css and listing-plot.css.

   listing-plot.css already styles .lg-static-body headings, paragraphs
   and lists, and .lg-container.lg-static already sets the 820px reading
   column. Everything here is additive: the article furniture (byline,
   contents, callouts, FAQ) and the index grid.
   ========================================================= */

/* ---------- article head ---------- */
.lg-post-head {
  background: var(--cream-100);
  border-bottom: 1px solid var(--border-default);
  padding: 48px 0 40px;
  margin-bottom: 40px;
}
.lg-post-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  color: var(--fg-3);
  margin-bottom: 20px;
}
.lg-post-crumbs a { color: var(--fg-3); text-decoration: none; }
.lg-post-crumbs a:hover { color: var(--cat-primary); text-decoration: underline; }
.lg-post-crumbs span { color: var(--ink-300); }

.lg-post-topic {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--cat-primary);
  background: var(--cat-primary-50);
  border-radius: var(--r-pill);
  padding: 6px 12px;
  margin-bottom: 16px;
  text-decoration: none;
}
.lg-post-topic:hover { background: var(--teal-100); }

.lg-post-title { margin: 0 0 16px; max-width: 20ch; }
.lg-post-head .lg-post-title { max-width: none; }
.lg-post-standfirst { margin: 0 0 22px; max-width: 62ch; }

.lg-post-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  color: var(--fg-3);
}
.lg-post-byline__author { font-weight: 600; color: var(--fg-2); }
.lg-post-byline__dot { color: var(--ink-300); }

.lg-post-hero__figure { margin: 0 0 36px; }
.lg-post-hero__figure img {
  width: 100%;
  height: auto;
  border-radius: var(--r-lg);
  display: block;
}

/* ---------- article body ---------- */
.lg-post-body { padding-bottom: 72px; }
.lg-post-body > p { font-size: 17px; }
.lg-post-h2 {
  /* Anchor links from the contents box must not land under the sticky
     header, which is what --anchor-offset exists for. */
  scroll-margin-top: var(--anchor-offset, 96px);
  margin-top: 40px !important;
}
.lg-post-h3 { margin-top: 28px !important; }
.lg-post-body a { color: var(--link); text-underline-offset: 2px; }
.lg-post-body a:hover { color: var(--link-hover); }
.lg-post-list li { margin-bottom: 8px; }

.lg-post-quote {
  margin: 28px 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--cat-primary);
}
.lg-post-quote p {
  font-family: var(--font-display);
  font-size: 21px;
  line-height: var(--lh-snug);
  color: var(--ink-900);
  margin: 0;
}

.lg-post-figure { margin: 32px 0; }
.lg-post-figure img { width: 100%; height: auto; border-radius: var(--r-md); display: block; }
.lg-post-figure figcaption {
  margin-top: 10px;
  font-size: var(--fs-sm);
  color: var(--fg-3);
}

/* Tables scroll inside their own box rather than pushing the page wide. */
.lg-post-tablewrap { overflow-x: auto; margin: 28px 0; }
.lg-post-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  min-width: 480px;
}
.lg-post-table th,
.lg-post-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-default);
  vertical-align: top;
}
.lg-post-table th {
  background: var(--bg-subtle);
  font-weight: 600;
  color: var(--ink-900);
  white-space: nowrap;
}
.lg-post-table td { color: var(--fg-2); }
.lg-post-table tr:last-child td { border-bottom: 0; }

/* ---------- contents ---------- */
.lg-post-toc {
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  margin: 0 0 36px;
}
.lg-post-toc__title {
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--fg-3);
  margin-bottom: 12px;
}
.lg-post-toc ol { margin: 0; padding-left: 20px; }
.lg-post-toc li { margin-bottom: 6px; color: var(--fg-2); }
.lg-post-toc a { color: var(--fg-1); text-decoration: none; }
.lg-post-toc a:hover { color: var(--cat-primary); text-decoration: underline; }

/* ---------- callouts ---------- */
.lg-post-takeaways {
  background: var(--cat-primary-50);
  border-radius: var(--r-lg);
  padding: 24px 28px;
  margin: 0 0 36px;
}
.lg-post-takeaways__title {
  font-family: var(--font-sans) !important;
  font-size: var(--fs-xs) !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--teal-800);
  margin: 0 0 12px !important;
}
.lg-post-takeaways ul { margin: 0; padding-left: 20px; }
.lg-post-takeaways li {
  margin-bottom: 8px;
  color: var(--ink-900);
  line-height: var(--lh-relaxed);
}
.lg-post-takeaways li:last-child { margin-bottom: 0; }

.lg-post-note {
  background: var(--bg-subtle);
  border-left: 3px solid var(--amber-500);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 18px 22px;
  margin: 28px 0;
}
.lg-post-note__title {
  font-weight: 600;
  color: var(--ink-900);
  margin-bottom: 6px;
}
.lg-post-note p { margin: 0 0 8px; }
.lg-post-note p:last-child { margin-bottom: 0; }

/* ---------- inline CTA into the directory ---------- */
.lg-post-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  margin: 32px 0;
  text-decoration: none;
  transition: box-shadow var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.lg-post-cta:hover {
  border-color: var(--cat-primary);
  box-shadow: var(--elev-2);
}
.lg-post-cta__label {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink-900);
  display: block;
}
.lg-post-cta__blurb {
  display: block;
  font-size: var(--fs-sm);
  color: var(--fg-3);
  margin-top: 4px;
}
.lg-post-cta > span:not(.lg-post-cta__arrow) { flex: 1; }
.lg-post-cta__arrow {
  font-size: 20px;
  color: var(--cat-primary);
  flex: 0 0 auto;
}

/* ---------- FAQ ---------- */
.lg-post-faq { margin-top: 48px; }
.lg-post-faq__item {
  border-bottom: 1px solid var(--border-default);
  padding: 4px 0;
}
.lg-post-faq__item summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 32px 16px 0;
  font-weight: 600;
  color: var(--ink-900);
  position: relative;
  line-height: var(--lh-snug);
}
.lg-post-faq__item summary::-webkit-details-marker { display: none; }
.lg-post-faq__item summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 14px;
  font-size: 20px;
  font-weight: 400;
  color: var(--cat-primary);
}
.lg-post-faq__item[open] summary::after { content: "\2212"; }
.lg-post-faq__answer { padding: 0 0 16px; }
.lg-post-faq__answer p { margin: 0; color: var(--fg-2); line-height: var(--lh-relaxed); }

/* ---------- sources ---------- */
.lg-post-sources {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border-default);
}
.lg-post-sources__title {
  font-family: var(--font-sans) !important;
  font-size: var(--fs-xs) !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--fg-3);
  margin: 0 0 12px !important;
}
.lg-post-sources ul { margin: 0; padding-left: 20px; }
.lg-post-sources li { font-size: var(--fs-sm); color: var(--fg-3); margin-bottom: 6px; }
.lg-post-sources__date { color: var(--ink-300); }

/* ---------- end card ---------- */
.lg-post-endcard {
  margin-top: 48px;
  background: var(--teal-900);
  border-radius: var(--r-xl);
  padding: 36px 40px;
  color: var(--white);
}
.lg-post-endcard__title {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: var(--lh-snug);
  margin: 0 0 10px !important;
  color: var(--white) !important;
}
.lg-post-endcard p { color: var(--teal-100) !important; margin: 0 0 20px; }
.lg-post-endcard__btn {
  display: inline-block;
  background: var(--white);
  color: var(--teal-900) !important;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--r-pill);
  text-decoration: none !important;
}
.lg-post-endcard__btn:hover { background: var(--cream-50); }

/* =========================================================
   Index and topic archives
   ========================================================= */
.lg-blog-main { padding-bottom: 80px; }
.lg-blog-hero {
  background: var(--cream-100);
  border-bottom: 1px solid var(--border-default);
  padding: 48px 0 40px;
  margin-bottom: 40px;
}
.lg-blog-hero .lg-h1 { margin: 0 0 14px; }
.lg-blog-hero__intro {
  font-size: 18px;
  line-height: var(--lh-relaxed);
  color: var(--fg-2);
  margin: 0;
  max-width: 68ch;
}

.lg-blog-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}
.lg-blog-topic {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--fg-2);
  background: var(--white);
  border: 1px solid var(--border-default);
  border-radius: var(--r-pill);
  padding: 8px 14px;
  text-decoration: none;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.lg-blog-topic:hover { border-color: var(--cat-primary); color: var(--cat-primary); }
.lg-blog-topic.is-active {
  background: var(--cat-primary);
  border-color: var(--cat-primary);
  color: var(--cat-on-primary, #fff);
}
.lg-blog-topic__count { font-size: var(--fs-xs); opacity: 0.7; font-variant-numeric: tabular-nums; }

.lg-blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}
.lg-blog-card {
  background: var(--white);
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: box-shadow var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.lg-blog-card:hover { border-color: var(--border-strong); box-shadow: var(--elev-2); }
.lg-blog-card__link { display: block; text-decoration: none; color: inherit; height: 100%; }
.lg-blog-card__media { aspect-ratio: 16 / 9; background: var(--bg-subtle); overflow: hidden; }
.lg-blog-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lg-blog-card__placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--teal-700), var(--teal-500) 55%, var(--amber-400));
}
.lg-blog-card__body { padding: 20px 22px 24px; }
.lg-blog-card__topic {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--cat-primary);
  margin-bottom: 10px;
}
.lg-blog-card__title {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: var(--lh-snug);
  color: var(--ink-900);
  margin: 0 0 10px;
  letter-spacing: var(--tracking-tight);
}
.lg-blog-card__link:hover .lg-blog-card__title { color: var(--cat-primary); }
.lg-blog-card__dek {
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  color: var(--fg-2);
  margin: 0 0 14px;
}
.lg-blog-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  color: var(--fg-3);
}

/* Lead story: full width on wide screens, image beside the text. */
@media (min-width: 900px) {
  .lg-blog-card--lead { grid-column: 1 / -1; }
  .lg-blog-card--lead .lg-blog-card__link { display: grid; grid-template-columns: 1.15fr 1fr; }
  .lg-blog-card--lead .lg-blog-card__media { aspect-ratio: auto; height: 100%; min-height: 280px; }
  .lg-blog-card--lead .lg-blog-card__body { padding: 36px 40px; align-self: center; }
  .lg-blog-card--lead .lg-blog-card__title { font-size: 30px; }
  .lg-blog-card--lead .lg-blog-card__dek { font-size: var(--fs-base); }
}

.lg-blog-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
}
.lg-blog-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  color: var(--fg-2);
  text-decoration: none;
  font-size: var(--fs-sm);
}
.lg-blog-pagination .page-numbers:hover { border-color: var(--cat-primary); color: var(--cat-primary); }
.lg-blog-pagination .page-numbers.current {
  background: var(--cat-primary);
  border-color: var(--cat-primary);
  color: var(--cat-on-primary, #fff);
}

.lg-blog-empty {
  text-align: center;
  padding: 64px 0 80px;
}
.lg-blog-empty h2 { font-family: var(--font-display); font-size: 26px; margin: 0 0 10px; }
.lg-blog-empty p { color: var(--fg-2); margin: 0 0 22px; }
.lg-blog-empty .lg-post-endcard__btn { background: var(--cat-primary); color: var(--white) !important; }

/* ---------- small screens ---------- */
@media (max-width: 640px) {
  .lg-post-head { padding: 32px 0 28px; margin-bottom: 28px; }
  .lg-post-endcard { padding: 28px 24px; }
  .lg-post-cta { flex-direction: column; align-items: flex-start; gap: 8px; }
  .lg-blog-grid { grid-template-columns: 1fr; gap: 20px; }
  .lg-blog-hero { padding: 32px 0 28px; margin-bottom: 28px; }
}
