/* ============================================================
   LIVERDECODED DESIGN SYSTEM
   Version 1.0 — Drop this in /static/css/liverdecoded.css
   Usage: <link rel="stylesheet" href="/css/liverdecoded.css">
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,600;0,8..60,700;1,8..60,400;1,8..60,600&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --color-forest:     #1a4a3c;
  --color-forest-dk:  #0f2e25;
  --color-forest-lt:  #2d6b58;
  --color-amber:      #d4762a;
  --color-amber-lt:   #f2a04e;
  --color-amber-pale: #fef3e8;
  --color-cream:      #fafaf7;
  --color-cream-dk:   #f0efe9;
  --color-ink:        #1c2826;
  --color-ink-mid:    #3d5049;
  --color-ink-soft:   #6b7f78;
  --color-rule:       #dde5e2;
  --color-teal-mist:  #e8f4f0;
  --color-warning:    #fff4e0;
  --color-warning-bd: #e8a12a;

  --font-serif:   'Source Serif 4', Georgia, serif;
  --font-sans:    'Plus Jakarta Sans', system-ui, sans-serif;

  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;

  --shadow-sm:  0 1px 3px rgba(26,74,60,.08);
  --shadow-md:  0 4px 16px rgba(26,74,60,.10);
  --shadow-lg:  0 8px 32px rgba(26,74,60,.14);

  --max-w:      1080px;
  --content-w:  720px;
}

/* ── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--color-cream);
  color: var(--color-ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--color-forest); text-decoration: underline; text-decoration-color: transparent; transition: text-decoration-color .2s; }
a:hover { text-decoration-color: currentColor; }

/* ── Navigation ─────────────────────────────────────────── */


/* ── Breadcrumb ─────────────────────────────────────────── */
.ld-breadcrumb {
  padding: 14px 24px;
  background: var(--color-cream-dk);
  border-bottom: 1px solid var(--color-rule);
  font-size: .8rem;
  color: var(--color-ink-soft);
}
.ld-breadcrumb__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ld-breadcrumb a { color: var(--color-forest); text-decoration: none; }
.ld-breadcrumb a:hover { text-decoration: underline; }
.ld-breadcrumb__sep { color: var(--color-ink-soft); }
.ld-breadcrumb__current { color: var(--color-ink-mid); font-weight: 500; }

/* ── Page Hero ──────────────────────────────────────────── */
.ld-hero {
  background: linear-gradient(135deg, var(--color-forest-dk) 0%, var(--color-forest) 60%, var(--color-forest-lt) 100%);
  color: #fff;
  padding: 64px 24px 56px;
  position: relative;
  overflow: hidden;
}
.ld-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.ld-hero__inner {
  position: relative;
  max-width: var(--max-w);
  margin: 0 auto;
}
.ld-hero__label {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-amber-lt);
  margin-bottom: 16px;
}
.ld-hero__title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.5px;
  margin-bottom: 20px;
  max-width: 680px;
}
.ld-hero__subtitle {
  font-size: 1.05rem;
  line-height: 1.7;
  color: rgba(255,255,255,.85);
  max-width: 600px;
  margin-bottom: 32px;
}
.ld-hero__meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.ld-hero__stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ld-hero__stat-number {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-amber-lt);
  line-height: 1;
}
.ld-hero__stat-label {
  font-size: .75rem;
  color: rgba(255,255,255,.65);
  letter-spacing: .5px;
}

/* ── Layout ─────────────────────────────────────────────── */
.ld-layout {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
  padding-top: 48px;
  padding-bottom: 80px;
}
.ld-layout--full {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.ld-main { min-width: 0; }
.ld-aside { position: sticky; top: 80px; }

/* ── Section Headings ───────────────────────────────────── */
.ld-section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-forest);
  margin-bottom: 8px;
}
.ld-section-tag::before {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--color-amber);
}

h2.ld-h2 {
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--color-forest-dk);
  letter-spacing: -.3px;
  margin-bottom: 12px;
  line-height: 1.25;
}
h3.ld-h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-ink);
  margin-bottom: 10px;
  line-height: 1.3;
}

/* ── Intro Prose ────────────────────────────────────────── */
.ld-intro {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--color-ink-mid);
  max-width: var(--content-w);
}
.ld-intro + * { margin-top: 40px; }

p { margin-bottom: 1.1em; }
p:last-child { margin-bottom: 0; }

/* ── Guide Cards ────────────────────────────────────────── */
.ld-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.ld-card {
  background: #fff;
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow .25s, transform .25s, border-color .25s;
  text-decoration: none;
  color: inherit;
}
.ld-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--color-forest-lt);
}
.ld-card__badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--color-teal-mist);
  color: var(--color-forest);
  align-self: flex-start;
}
.ld-card__badge--amber { background: var(--color-amber-pale); color: var(--color-amber); }
.ld-card__title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-forest-dk);
  line-height: 1.3;
}
.ld-card__desc {
  font-size: .875rem;
  color: var(--color-ink-soft);
  line-height: 1.6;
  flex: 1;
}
.ld-card__link {
  font-size: .8rem;
  font-weight: 600;
  color: var(--color-amber);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}
.ld-card__link::after { content: '→'; transition: transform .2s; }
.ld-card:hover .ld-card__link::after { transform: translateX(4px); }

/* ── Table ──────────────────────────────────────────────── */
.ld-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-rule);
  margin: 24px 0;
  box-shadow: var(--shadow-sm);
}
.ld-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
  background: #fff;
}
.ld-table th {
  background: var(--color-forest);
  color: #fff;
  text-align: left;
  padding: 12px 16px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .3px;
  white-space: nowrap;
}
.ld-table th:first-child { border-radius: var(--radius-md) 0 0 0; }
.ld-table th:last-child { border-radius: 0 var(--radius-md) 0 0; }
.ld-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--color-rule);
  vertical-align: top;
  line-height: 1.5;
  color: var(--color-ink-mid);
}
.ld-table tr:last-child td { border-bottom: none; }
.ld-table tr:nth-child(even) td { background: var(--color-cream); }
.ld-table td strong { color: var(--color-ink); }

/* ── Callout / Info box ─────────────────────────────────── */
.ld-callout {
  background: var(--color-teal-mist);
  border-left: 4px solid var(--color-forest);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 20px 24px;
  margin: 28px 0;
  font-size: .9rem;
  color: var(--color-ink-mid);
  line-height: 1.7;
}
.ld-callout--warn {
  background: var(--color-warning);
  border-left-color: var(--color-warning-bd);
}
.ld-callout__title {
  font-weight: 700;
  color: var(--color-forest-dk);
  margin-bottom: 6px;
  font-size: .9rem;
}
.ld-callout--warn .ld-callout__title { color: #7a4a00; }

/* ── FAQ ────────────────────────────────────────────────── */
.ld-faq { margin-top: 16px; }
.ld-faq__item {
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  overflow: hidden;
  background: #fff;
}
.ld-faq__question {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 18px 20px;
  font-family: var(--font-sans);
  font-size: .95rem;
  font-weight: 600;
  color: var(--color-forest-dk);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: background .2s;
}
.ld-faq__question:hover { background: var(--color-cream); }
.ld-faq__question::after {
  content: '+';
  font-size: 1.3rem;
  font-weight: 300;
  flex-shrink: 0;
  color: var(--color-forest-lt);
  transition: transform .3s;
  line-height: 1;
}
.ld-faq__item.open .ld-faq__question::after { transform: rotate(45deg); }
.ld-faq__answer {
  font-size: .9rem;
  color: var(--color-ink-mid);
  line-height: 1.75;
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height .4s ease, padding .3s;
}
.ld-faq__item.open .ld-faq__answer { max-height: 600px; padding: 0 20px 20px; }

/* ── Sidebar Widgets ────────────────────────────────────── */
.ld-widget {
  background: #fff;
  border: 1px solid var(--color-rule);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.ld-widget__head {
  background: var(--color-forest);
  color: #fff;
  padding: 14px 18px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.ld-widget__body { padding: 16px 18px; }
.ld-toc { list-style: none; }
.ld-toc li { border-bottom: 1px solid var(--color-rule); }
.ld-toc li:last-child { border-bottom: none; }
.ld-toc a {
  display: block;
  padding: 9px 0;
  font-size: .83rem;
  color: var(--color-forest);
  text-decoration: none;
  line-height: 1.4;
  transition: color .2s;
}
.ld-toc a:hover { color: var(--color-amber); }
.ld-toc li.active a { color: var(--color-amber); font-weight: 600; }

/* ── Section divider ────────────────────────────────────── */
.ld-section {
  padding-top: 48px;
  padding-bottom: 8px;
  border-top: 1px solid var(--color-rule);
  margin-top: 48px;
}
.ld-section:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }

/* ── Stat Strip ─────────────────────────────────────────── */
.ld-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 28px 0;
}
.ld-stat-card {
  background: var(--color-teal-mist);
  border: 1px solid #c9ddd8;
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}
.ld-stat-card__num {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-forest);
  line-height: 1;
  margin-bottom: 4px;
}
.ld-stat-card__label {
  font-size: .78rem;
  color: var(--color-ink-soft);
  line-height: 1.4;
}

/* ── CTA Block ──────────────────────────────────────────── */
.ld-cta-block {
  background: linear-gradient(135deg, var(--color-forest-dk), var(--color-forest));
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  margin: 48px 0 0;
}
.ld-cta-block h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.ld-cta-block p { color: rgba(255,255,255,.8); font-size: .9rem; max-width: 480px; margin: 0 auto 24px; }
.ld-btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  transition: background .2s, transform .2s;
  cursor: pointer;
}
.ld-btn--amber { background: var(--color-amber); color: #fff; }
.ld-btn--amber:hover { background: var(--color-amber-lt); transform: translateY(-1px); }
.ld-btn--ghost { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.3); margin-left: 12px; }
.ld-btn--ghost:hover { background: rgba(255,255,255,.25); }

/* ── Related links ──────────────────────────────────────── */
.ld-related { list-style: none; }
.ld-related li { border-bottom: 1px solid var(--color-rule); }
.ld-related li:last-child { border-bottom: none; }
.ld-related a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  font-size: .83rem;
  color: var(--color-forest);
  text-decoration: none;
  line-height: 1.4;
}
.ld-related a::before { content: '→'; color: var(--color-amber); flex-shrink: 0; }
.ld-related a:hover { color: var(--color-amber); }

/* ── Footer ─────────────────────────────────────────────── */
.ld-footer {
  background: var(--color-forest-dk);
  color: rgba(255,255,255,.7);
  padding: 48px 24px 32px;
}
.ld-footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}
.ld-footer__logo {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}
.ld-footer__logo span { color: var(--color-amber-lt); }
.ld-footer p { font-size: .85rem; line-height: 1.7; }
.ld-footer h4 {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,.5);
  margin-bottom: 14px;
}
.ld-footer ul { list-style: none; }
.ld-footer ul li { margin-bottom: 8px; }
.ld-footer ul a { color: rgba(255,255,255,.7); text-decoration: none; font-size: .85rem; }
.ld-footer ul a:hover { color: var(--color-amber-lt); }
.ld-footer__bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  margin-top: 40px;
  padding-top: 20px;
  font-size: .78rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.ld-footer__social { display: flex; gap: 16px; }
.ld-footer__social a { color: rgba(255,255,255,.5); font-size: .8rem; text-decoration: none; }
.ld-footer__social a:hover { color: #fff; }

/* ── Disclaimer ─────────────────────────────────────────── */
.ld-disclaimer {
  background: #f5f5f0;
  border: 1px solid #ddd;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: .78rem;
  color: #666;
  line-height: 1.65;
  margin-top: 40px;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 820px) {
  .ld-layout { grid-template-columns: 1fr; }
  .ld-aside { display: none; }
  .ld-footer__inner { grid-template-columns: 1fr 1fr; }
  .ld-hero { padding: 48px 24px 40px; }
  .ld-cta-block { padding: 32px 24px; }
  .ld-btn--ghost { margin-left: 0; margin-top: 12px; }
}
@media (max-width: 560px) {
  .ld-footer__inner { grid-template-columns: 1fr; gap: 24px; }
  .ld-nav__links { display: none; }
  .ld-card-grid { grid-template-columns: 1fr; }
}
