/* ==========================================================================
   Guides (blog) — list + article. Used by layouts/blog/*.html, both the classic
   site and the redesign. Light/dark tokens are defined here, so this file does
   not depend on the generated dark theme.
   ========================================================================== */
.gd, .gd-list {
  /* Guide variables point at the design tokens (assets/css/tokens.css): light and dark from one set */
  --gd-bg: var(--c-surface);
  --gd-page: var(--c-surface-2);
  --gd-ink: var(--c-ink);
  --gd-body: var(--c-ink);
  --gd-muted: var(--c-muted);
  --gd-line: var(--c-line);
  --gd-soft: var(--c-surface-2);
  --gd-brand: var(--c-brand);
  --gd-brand-ink: var(--c-link);
  --gd-brand-soft: var(--c-success-bg);
  --gd-mark: var(--c-marker);
  --gd-font-head: var(--f-serif);
  --gd-font-body: var(--f-sans);
  color: var(--gd-body);
}

/* ── Reading progress (top of the page, under the sticky header) ── */
.gd-progress { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 1001; pointer-events: none; }
.gd-progress span { display: block; height: 100%; width: 0; background: var(--c-brand); transition: width 0.1s linear; }
body.mea-redesign .gd-progress { top: 64px; }
@media (max-width: 520px) { body.mea-redesign .gd-progress { top: 60px; } }

/* ── Article ── */
.gd { max-width: calc(var(--w-page) + 2 * var(--gutter)); margin: 0 auto; padding: var(--s-5) var(--gutter) var(--s-8); box-sizing: border-box; }
.gd-hero { max-width: var(--w-text); margin: 0 0 var(--s-5); }
.gd-crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 16px; font-size: 13px; color: var(--gd-muted); }
.gd-crumbs a { color: var(--gd-muted); text-decoration: none; }
.gd-crumbs a:hover { color: var(--gd-brand-ink); text-decoration: underline; }
.gd-crumbs [aria-current] { color: var(--gd-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; }
.gd-chip, .gd-kicker {
  display: inline-block; padding: 2px var(--s-2); border-radius: var(--r-1); background: var(--c-success-bg);
  color: var(--c-success); font-size: var(--t-caption); font-weight: 600; text-decoration: none;
}
.gd-title {
  margin: var(--s-3) 0 var(--s-3); font-family: var(--gd-font-head); font-size: var(--t-h1);
  line-height: 1.08; font-weight: 700; letter-spacing: -0.01em; color: var(--c-heading);
}
.gd-dek { margin: 0 0 16px; font-size: 1.15rem; line-height: 1.6; color: var(--gd-muted); }
.gd-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--gd-muted); }
.gd-meta span + span::before { content: "·"; margin-right: 18px; margin-left: -12px; opacity: 0.6; }
.gd-tools { display: flex; gap: 8px; margin-top: 18px; }
.gd-tool {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--gd-line); border-radius: var(--r-1); background: var(--gd-bg); color: var(--gd-ink);
  font: 600 14px var(--gd-font-body); cursor: pointer;
}
.gd-tool:hover { border-color: var(--gd-brand); color: var(--gd-brand-ink); }
.gd-tool[aria-pressed="true"] { background: var(--c-brand); border-color: var(--c-brand); color: var(--c-on-brand); }

/* Cover */
.gd-cover-wrap { max-width: 1120px; margin: 0 auto 32px; }
.gd-cover {
  position: relative; display: flex; align-items: flex-end; overflow: hidden; width: 100%;
  border-radius: 0; color: #fff; isolation: isolate;
}
.gd-cover--lg { aspect-ratio: 21 / 8; min-height: 180px; }
.gd-cover--sm { aspect-ratio: 16 / 9; }
.gd-cover--img { display: block; object-fit: cover; }
/* One flat cover set (design system: flat colour fields, no gradients); the icon tells topics apart */
.gd-cover--green, .gd-cover--teal, .gd-cover--amber, .gd-cover--indigo, .gd-cover--blue { background: #064E3B; }
.gd-cover-icon { position: absolute; right: 8%; top: 50%; width: 30%; max-width: 160px; height: auto; transform: translateY(-50%); opacity: 0.9; }
.gd-cover--sm .gd-cover-icon { width: 34%; right: 7%; }
.gd-cover-roof { position: absolute; left: -4%; bottom: -10%; width: 46%; opacity: 0.14; }
.gd-cover-kicker {
  position: relative; margin: 0 0 var(--s-4) var(--s-4); padding: 2px var(--s-2); border-radius: var(--r-1);
  background: rgba(255, 255, 255, 0.18); font-size: var(--t-caption); font-weight: 600;
}

/* Layout: "On this page" + content */
.gd-layout { display: grid; grid-template-columns: 240px minmax(0, 720px); gap: 48px; justify-content: center; }
.gd-layout--no-toc { grid-template-columns: minmax(0, 720px); }
.gd-toc { position: relative; }
.gd-toc details { position: sticky; top: 96px; padding: var(--s-3) 0 0; border-top: var(--line-heavy); background: none; }
.gd-toc summary { cursor: pointer; font-size: var(--t-caption); font-weight: 600; color: var(--c-muted); list-style: none; }
.gd-toc summary::-webkit-details-marker { display: none; }
.gd-toc nav ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }
.gd-toc nav ul ul { margin: 2px 0 4px 12px; }
.gd-toc nav a {
  display: block; padding: var(--s-2) var(--s-3); border-left: 3px solid transparent; border-radius: 0;
  color: var(--gd-muted); font-size: 14px; line-height: 1.4; text-decoration: none;
}
.gd-toc nav a:hover { color: var(--gd-ink); background: var(--gd-soft); }
.gd-toc nav a.is-active { color: var(--gd-brand-ink); border-left-color: var(--gd-brand); background: var(--gd-brand-soft); font-weight: 600; }

/* Body typography */
.gd-body { font-family: var(--gd-font-body); font-size: 1.08rem; line-height: 1.8; color: var(--gd-body); min-width: 0; }
.gd-body > * + * { margin-top: 1.1em; }
.gd-body h2, .gd-body h3, .gd-body h4 { font-family: var(--gd-font-head); color: var(--gd-ink); line-height: 1.3; scroll-margin-top: 16px; position: relative; }
.gd-body h2 { margin-top: 2.2em; padding-top: var(--s-3); border-top: var(--line-heavy); font-size: var(--t-h2); font-weight: 700; color: var(--c-heading); }
.gd-body h3 { margin-top: 1.8em; font-family: var(--f-sans); font-size: var(--t-h3); font-weight: 700; }
.gd-body h4 { margin-top: 1.4em; font-family: var(--f-sans); font-size: var(--t-ui); font-weight: 700; }
.gd-body strong { color: var(--gd-ink); font-weight: 700; }
.gd-body a { color: var(--gd-brand-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.gd-body a:hover { text-decoration-thickness: 2px; }
.gd-body mark { background: var(--c-marker); color: #14231C; padding: 0 .2em; border-radius: 0; }
.gd-body ul, .gd-body ol { margin: 0.8em 0; padding-left: 1.4em; }
.gd-body ul { list-style: disc; }
.gd-body ol { list-style: decimal; }
.gd-body li { margin: 0.35em 0; padding-left: 0.2em; }
.gd-body li::marker { color: var(--gd-brand); font-weight: 700; }
.gd-body img { max-width: 100%; height: auto; border-radius: 0; }
.gd-body table { width: 100%; border-collapse: collapse; font-size: 0.95rem; display: block; overflow-x: auto; }
.gd-body th, .gd-body td { padding: 10px 12px; border-bottom: 1px solid var(--gd-line); text-align: left; }
.gd-body th { color: var(--c-ink); background: none; border-bottom: 2px solid var(--c-ink); }
.gd-body hr { border: 0; border-top: 1px solid var(--gd-line); margin: 2em 0; }
.heading-anchor { display: none; }
.gd-body .heading-anchor {
  display: inline-grid; place-items: center; width: 28px; height: 28px; margin-left: 6px; vertical-align: middle;
  border-radius: var(--r-1); color: var(--gd-muted); text-decoration: none; opacity: 0; transition: opacity 0.15s;
}
.gd-body :is(h2, h3, h4):hover .heading-anchor, .gd-body .heading-anchor:focus-visible { opacity: 1; }
.gd-body .heading-anchor:hover { color: var(--gd-brand-ink); background: var(--gd-soft); }
@media (hover: none) { .gd-body .heading-anchor { display: none; } } /* phones: no hover, keep headings clean */

/* Callouts and highlights */
.callout, .quote-highlight { margin: 1.6em 0; padding: var(--s-3) var(--s-4); border-radius: 0 var(--r-1) var(--r-1) 0; border: 0; border-left: 4px solid var(--c-line); background: var(--c-surface-2); }
.callout > :last-child, .quote-highlight > :last-child { margin-bottom: 0; }
.callout-title { display: flex; align-items: center; gap: 8px; margin: 0 0 6px !important; font-weight: 700; color: var(--gd-ink); }
.callout-icon { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: var(--r-round); color: #FFFFFF; font-size: 12px; }
/* Callouts use the semantic colours (design system §2) */
.callout--note      { border-left-color: var(--c-ink); } .callout--note .callout-icon { background: var(--c-ink); color: var(--c-surface); }
.callout--tip       { border-left-color: var(--c-brand); background: var(--c-success-bg); } .callout--tip .callout-icon { background: var(--c-brand); }
.callout--important { border-left-color: var(--c-brand-deep); } .callout--important .callout-icon { background: var(--c-brand-deep); }
.callout--warning   { border-left-color: var(--c-warning); background: var(--c-warning-bg); } .callout--warning .callout-icon { background: #8A4B00; }
.callout--caution   { border-left-color: var(--c-error); background: var(--c-error-bg); } .callout--caution .callout-icon { background: #B42318; }
.quote-highlight { border-left-color: var(--c-brand); background: none; font: 700 1.25rem/1.4 var(--f-serif); color: var(--c-ink); }

/* Help box, tags, share */
.gd-help { margin-top: 2.6em !important; padding: var(--s-4) 0 0; border-radius: 0; background: none; border: 0; border-top: var(--line-heavy); }
.gd-help strong { display: block; font-size: 1.15rem; margin-bottom: 6px; }
.gd-help p { color: var(--gd-body); }
.gd-help-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.gd-btn {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 var(--s-5); border-radius: var(--r-1);
  border: 2px solid var(--c-ink); background: transparent; color: var(--c-ink) !important;
  font-weight: 600; font-size: var(--t-ui); text-decoration: none !important;
}
.gd-btn--primary { background: var(--c-brand); border-color: var(--c-brand); color: var(--c-on-brand) !important; }
.gd-btn:hover { background: var(--c-surface-2); }
.gd-btn--primary:hover { background: var(--c-brand-deep); border-color: var(--c-brand-deep); }
.gd-tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none !important; padding: 0 !important; margin-top: 2em !important; }
.gd-tags li { margin: 0; padding: 0; }
.gd-tags li::marker { content: none; }
.gd-tags a {
  display: inline-block; padding: 6px 12px; border-radius: var(--r-1); background: var(--gd-soft); border: 1px solid var(--gd-line);
  color: var(--gd-muted) !important; font-size: 13px; text-decoration: none !important;
}
.gd-share { margin-top: 2.4em !important; padding-top: 1.6em; border-top: 1px solid var(--gd-line); }
.gd-share h2 { margin: 0 0 12px; font-size: 1rem; }
.gd-share h2 { border-top: 0; padding-top: 0; font-family: var(--f-sans); }
.gd-share-row { display: flex; flex-wrap: wrap; gap: 8px; }
.gd-share-btn {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: var(--r-1);
  border: 1px solid var(--gd-line); background: var(--gd-bg); color: var(--gd-ink) !important;
  font: 600 14px var(--gd-font-body); text-decoration: none !important; cursor: pointer;
}
.gd-share-btn.is-wa { background: var(--c-brand); border-color: var(--c-brand); color: var(--c-on-brand) !important; }
.gd-share-btn:hover { border-color: var(--gd-brand); }

/* Related, pager, subscribe */
.gd-related { max-width: 1120px; margin: 56px auto 0; }
.gd-related h2, .gd-list-hero h1 { font-family: var(--gd-font-head); color: var(--gd-ink); }
.gd-related h2 { font-size: 1.4rem; margin: 0 0 16px; }
.gd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.gd-card {
  display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--gd-line); border-radius: var(--r-1);
  background: var(--gd-bg); color: inherit; text-decoration: none;
}
.gd-card:hover { border-color: var(--c-field); }
.gd-card:hover .gd-card-title { text-decoration: underline; text-underline-offset: .2em; }
.gd-card:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
.gd-card .gd-cover { border-radius: 0; }
.gd-card-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; flex: 1; }
.gd-card-cat { font-size: var(--t-caption); font-weight: 600; color: var(--c-link); }
.gd-card-title { font-family: var(--gd-font-head); font-size: 1.12rem; font-weight: 700; line-height: 1.35; color: var(--gd-ink); }
.gd-card-excerpt { font-size: 0.95rem; line-height: 1.55; color: var(--gd-muted); }
.gd-card-meta { margin-top: auto; padding-top: 6px; font-size: 13px; color: var(--gd-muted); }
.gd-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 1120px; margin: 40px auto 0; }
.gd-pager-link { display: grid; gap: 4px; padding: 16px 18px; border: 1px solid var(--gd-line); border-radius: var(--r-1); background: var(--gd-bg); color: var(--gd-ink); text-decoration: none; }
.gd-pager-link small { color: var(--gd-muted); font-size: 13px; }
.gd-pager-link.is-next { text-align: right; }
.gd-pager-link:hover { border-color: var(--gd-brand); }
.gd-subscribe { max-width: 720px; margin: 40px auto 0; }

/* ── List page ── */
.gd-list { max-width: calc(var(--w-page) + 2 * var(--gutter)); margin: 0 auto; padding: var(--s-6) var(--gutter) var(--s-8); box-sizing: border-box; }
.gd-list-hero { max-width: var(--w-text); margin: 0 0 var(--s-6); text-align: left; }
.gd-list-hero h1 { margin: var(--s-3) 0 var(--s-3); font-size: var(--t-h1); line-height: 1.08; letter-spacing: -0.01em; color: var(--c-heading); }
.gd-list-hero p { margin: 0; max-width: var(--w-text); font-size: var(--t-lead); line-height: 1.45; color: var(--c-ink); }
.gd-filter { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: var(--s-2); margin-top: var(--s-5); }
.gd-filter button {
  min-height: 40px; padding: 0 16px; border-radius: var(--r-1); border: 1px solid var(--gd-line); background: var(--gd-bg);
  color: var(--gd-ink); font: 600 14px var(--gd-font-body); cursor: pointer;
}
.gd-filter button[aria-pressed="true"] { background: var(--gd-ink); border-color: var(--gd-ink); color: var(--gd-bg); }
.gd-card--featured { grid-column: 1 / -1; flex-direction: row; }
.gd-card--featured .gd-cover { width: 56%; flex: 0 0 56%; aspect-ratio: auto; min-height: 280px; }
.gd-card--featured .gd-card-body { justify-content: center; padding: 28px; }
.gd-card--featured .gd-card-title { font-size: 1.6rem; }
.gd-card[hidden] { display: none; }
.gd-empty { text-align: left; color: var(--c-muted); }

/* ── Reading mode: just the words, bigger and calmer ── */
html.gd-reading .gd-toc, html.gd-reading .gd-related, html.gd-reading .gd-pager, html.gd-reading .gd-subscribe,
html.gd-reading .gd-share, html.gd-reading .gd-tags, html.gd-reading .gd-help, html.gd-reading .gd-cover-wrap,
html.gd-reading .mea-mobile-dock, html.gd-reading .mea-install, html.gd-reading .mea-hint-wrap { display: none !important; }
html.gd-reading .gd-layout { grid-template-columns: minmax(0, 680px); }
html.gd-reading .gd-body { font-size: 1.22rem; line-height: 1.9; }
html.gd-reading body { background: var(--c-paper) !important; }
html.gd-reading .gd { --gd-bg: transparent; }

/* ── Responsive ── */
@media (max-width: 1000px) {
  .gd-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .gd-toc details { position: static; }
  .gd-toc details:not([open]) { padding-bottom: 16px; }
  .gd-grid { grid-template-columns: repeat(2, 1fr); }
  .gd-card--featured { flex-direction: column; }
  .gd-card--featured .gd-cover { width: 100%; flex: none; min-height: 0; aspect-ratio: 16 / 9; }
}
@media (max-width: 640px) {
  .gd-grid { grid-template-columns: 1fr; }
  .gd-cover--lg { aspect-ratio: 16 / 9; }
  .gd-body { font-size: 1.05rem; }
  .gd-pager { grid-template-columns: 1fr; }
  .gd-pager-link.is-next { text-align: left; }
  .gd-crumbs [aria-current] { max-width: 24ch; }
}
@media print {
  .gd-progress, .gd-tools, .gd-toc, .gd-related, .gd-pager, .gd-subscribe, .gd-share, .gd-help { display: none !important; }
}
/* When a topic filter is on, the featured card behaves like the others */
.is-filtered .gd-card--featured { grid-column: auto; flex-direction: column; }
.is-filtered .gd-card--featured .gd-cover { width: 100%; flex: none; min-height: 0; aspect-ratio: 16 / 9; }
.is-filtered .gd-card--featured .gd-card-title { font-size: 1.12rem; }

/* ── Fixes after review ── */
/* neutralise the theme's old #TableOfContents box inside the new panel */
.gd-toc #TableOfContents { border: 0 !important; padding: 0 !important; margin: 0 !important; background: none !important; box-shadow: none !important; }
.gd-toc #TableOfContents::before, .gd-toc #TableOfContents::after { content: none !important; display: none !important; }
/* paragraph rhythm under headings */
.gd-body h2 + *, .gd-body h3 + *, .gd-body h4 + * { margin-top: 0.6em; }
.gd-body p:not(:first-child) { margin-top: 1em; }
/* the article cover doesn't repeat the topic chip shown above it */
.gd-cover-wrap .gd-cover-kicker { display: none; }
/* on phones the words come first: hide the decorative cover (real photos still show) */
@media (max-width: 640px) { .gd-cover-wrap:has(div.gd-cover) { display: none; } }
.gd-toc #TableOfContents > ul { border: 0 !important; padding: 0 !important; line-height: 1.4 !important; }
.gd-toc #TableOfContents > ul::before { content: none !important; display: none !important; }
.gd-toc #TableOfContents a { border-bottom: 0 !important; }

/* ---------- Tenant Legal Protection & Advisory (top of /blog/, page 1) ---------- */
.gd-advisory { max-width: 1120px; margin: 0 auto 40px; padding: 28px 22px; border-radius: var(--r-1); background: var(--gd-brand-soft); border: 1px solid var(--gd-line); }
.gd-advisory > h2 { margin: 10px 0 8px; font-family: var(--gd-font-head); font-size: clamp(1.5rem, 4vw, 2rem); line-height: 1.2; color: var(--gd-ink); }
.gd-advisory > p { margin: 0 0 20px; max-width: 760px; color: var(--gd-body); font-size: 1.02rem; line-height: 1.6; }
.gd-advisory-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.gd-advisory-card { display: flex; flex-direction: column; gap: 8px; min-height: 100%; padding: 18px; border-radius: var(--r-1); background: var(--gd-bg); border: 1px solid var(--gd-line); color: var(--gd-body); text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
.gd-advisory-card:hover, .gd-advisory-card:focus-visible { border-color: var(--c-brand); }
.gd-advisory-title { font-family: var(--gd-font-head); font-weight: 700; font-size: 1.08rem; line-height: 1.3; color: var(--gd-ink); }
.gd-advisory-text { font-size: .95rem; line-height: 1.5; color: var(--gd-muted); }
.gd-all-title { max-width: 1120px; margin: 0 auto 16px; font-family: var(--gd-font-head); font-size: 1.35rem; color: var(--gd-ink); }
@media (prefers-reduced-motion: reduce) { .gd-advisory-card { transition: none; } .gd-advisory-card:hover { transform: none; } }
