/*
Theme Name: LAODH Riddles
Theme URI: https://laodh.com
Author: LAODH
Author URI: https://laodh.com
Description: A premium editorial theme for riddles, puzzles, trivia and brain teasers. Lightweight, accessible, Gutenberg-ready, with native riddle fields, reveal-answer interaction, automatic table of contents, structured data and reserved ad slots.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: laodh-riddles
Tags: blog, education, entertainment, one-column, two-columns, custom-menu, featured-images, translation-ready, block-styles, wide-blocks
*/

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  /* Brand */
  --ld-navy: #0f1b33;
  --ld-navy-700: #17264a;
  --ld-navy-500: #24365f;
  --ld-purple: #5b3fd1;
  --ld-purple-600: #4b31b8;
  --ld-purple-100: #ede9fd;
  --ld-orange: #f2762e;
  --ld-orange-600: #d95f1b;
  --ld-orange-100: #fdeee4;

  /* Neutrals */
  --ld-bg: #fdfbf7;
  --ld-surface: #ffffff;
  --ld-surface-alt: #f7f4ee;
  --ld-line: #e7e2d8;
  --ld-line-strong: #d5cec0;
  --ld-ink: #1a2233;
  --ld-ink-soft: #4a5468;
  --ld-ink-muted: #6d7789;

  /* Semantic */
  --ld-link: var(--ld-purple-600);
  --ld-focus: #1f6feb;

  /* Type */
  --ld-font-head: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --ld-font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ld-fs-xs: 0.78rem;
  --ld-fs-sm: 0.875rem;
  --ld-fs-base: 1.0625rem;
  --ld-fs-lg: 1.1875rem;
  --ld-fs-xl: 1.5rem;
  --ld-fs-2xl: 2rem;
  --ld-fs-3xl: clamp(2.1rem, 4.4vw, 3.35rem);

  /* Space */
  --ld-gap: 1.5rem;
  --ld-radius-sm: 10px;
  --ld-radius: 16px;
  --ld-radius-lg: 24px;
  --ld-radius-pill: 999px;

  /* Elevation */
  --ld-shadow-sm: 0 1px 2px rgba(15, 27, 51, .06), 0 2px 8px rgba(15, 27, 51, .04);
  --ld-shadow: 0 2px 4px rgba(15, 27, 51, .05), 0 10px 28px rgba(15, 27, 51, .07);
  --ld-shadow-lg: 0 4px 10px rgba(15, 27, 51, .07), 0 22px 48px rgba(15, 27, 51, .12);

  --ld-wrap: 1180px;
  --ld-wrap-narrow: 760px;
  --ld-header-h: 72px;
}

/* ============================================================
   2. RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--ld-header-h) + 16px);
}

body {
  margin: 0;
  background: var(--ld-bg);
  color: var(--ld-ink);
  font-family: var(--ld-font-body);
  font-size: var(--ld-fs-base);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--ld-font-head);
  color: var(--ld-navy);
  line-height: 1.18;
  letter-spacing: -0.015em;
  margin: 0 0 .6em;
  font-weight: 700;
  text-wrap: balance;
}

h1 { font-size: var(--ld-fs-3xl); }
h2 { font-size: clamp(1.55rem, 2.6vw, 2.1rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
h4 { font-size: 1.15rem; }

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

a { color: var(--ld-link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--ld-orange-600); }

ul, ol { margin: 0 0 1.25em; padding-left: 1.35em; }
li { margin-bottom: .45em; }

blockquote {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--ld-purple);
  background: var(--ld-purple-100);
  border-radius: 0 var(--ld-radius-sm) var(--ld-radius-sm) 0;
  font-family: var(--ld-font-head);
  font-size: var(--ld-fs-lg);
  color: var(--ld-navy);
}

code, pre, kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em;
}
code { background: var(--ld-surface-alt); padding: .15em .4em; border-radius: 5px; }
pre { background: var(--ld-navy); color: #e8ecf5; padding: 1.1rem 1.25rem; border-radius: var(--ld-radius-sm); overflow-x: auto; }
pre code { background: none; padding: 0; color: inherit; }

hr { border: 0; border-top: 1px solid var(--ld-line); margin: 2.5rem 0; }

table { width: 100%; border-collapse: collapse; margin: 0 0 1.5rem; font-size: var(--ld-fs-sm); }
th, td { padding: .65rem .8rem; border-bottom: 1px solid var(--ld-line); text-align: left; }
th { background: var(--ld-surface-alt); font-weight: 700; color: var(--ld-navy); }

/* Accessibility */
:focus-visible {
  outline: 3px solid var(--ld-focus);
  outline-offset: 2px;
  border-radius: 4px;
}
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--ld-navy); color: #fff;
  padding: .8rem 1.2rem; border-radius: 0 0 var(--ld-radius-sm) 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; color: #fff; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ============================================================
   3. LAYOUT PRIMITIVES
   ============================================================ */
.ld-wrap { width: 100%; max-width: var(--ld-wrap); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.ld-wrap--narrow { max-width: var(--ld-wrap-narrow); }
.ld-section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.ld-section--tight { padding-block: clamp(1.75rem, 4vw, 2.75rem); }
.ld-section--alt { background: var(--ld-surface-alt); }

.ld-eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: var(--ld-fs-xs); font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ld-purple-600); margin-bottom: .9rem;
}
.ld-eyebrow::before {
  content: ""; width: 22px; height: 2px; background: var(--ld-orange); border-radius: 2px;
}

.ld-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: 2rem; flex-wrap: wrap; }
.ld-section-head h2 { margin: 0; }
.ld-section-head p { margin: .4rem 0 0; color: var(--ld-ink-muted); max-width: 60ch; }

/* ============================================================
   4. HEADER
   ============================================================ */
.ld-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(253, 251, 247, .88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--ld-line);
}
.ld-header__inner {
  display: flex; align-items: center; gap: 1.25rem;
  min-height: var(--ld-header-h);
}

.ld-brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; flex-shrink: 0; min-width: 0; }
.ld-brand__mark { width: 40px; height: 40px; flex-shrink: 0; object-fit: contain; }
.ld-brand__text { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.ld-brand__name {
  font-family: var(--ld-font-head); font-weight: 700; font-size: 1.32rem;
  letter-spacing: .06em; color: var(--ld-navy);
}
.ld-brand__tag {
  font-size: .625rem; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ld-ink-muted); margin-top: 4px; font-weight: 600;
  max-width: 250px; line-height: 1.3;
}

.ld-nav { margin-left: auto; min-width: 0; }
.ld-nav ul { display: flex; align-items: center; gap: 0; list-style: none; margin: 0; padding: 0; }
.ld-nav li { margin: 0; position: relative; }
.ld-nav a {
  display: block; padding: .5rem .55rem; border-radius: var(--ld-radius-pill);
  font-size: .8125rem; font-weight: 600; color: var(--ld-navy);
  text-decoration: none; white-space: nowrap;
  transition: background .18s ease, color .18s ease;
}
.ld-nav a:hover, .ld-nav a:focus-visible { background: var(--ld-purple-100); color: var(--ld-purple-600); }
.ld-nav .current-menu-item > a,
.ld-nav .current_page_item > a,
.ld-nav .current-menu-parent > a { background: var(--ld-navy); color: #fff; }

/* Dropdown */
.ld-nav ul ul {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 230px;
  flex-direction: column; align-items: stretch; gap: 2px;
  background: var(--ld-surface); border: 1px solid var(--ld-line);
  border-radius: var(--ld-radius); box-shadow: var(--ld-shadow-lg);
  padding: .5rem; opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.ld-nav li:hover > ul, .ld-nav li:focus-within > ul { opacity: 1; visibility: visible; transform: translateY(0); }
.ld-nav ul ul a { border-radius: var(--ld-radius-sm); padding: .55rem .7rem; }

.ld-header__actions { display: flex; align-items: center; gap: .5rem; }

.ld-search-toggle, .ld-nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--ld-line); background: var(--ld-surface);
  color: var(--ld-navy); cursor: pointer; padding: 0;
  transition: border-color .18s, background .18s;
}
.ld-search-toggle:hover, .ld-nav-toggle:hover { border-color: var(--ld-purple); background: var(--ld-purple-100); }
.ld-nav-toggle { display: none; }

.ld-search-panel {
  display: none; border-top: 1px solid var(--ld-line);
  background: var(--ld-surface); padding: 1rem 0;
}
.ld-search-panel.is-open { display: block; }

/* ============================================================
   5. BUTTONS
   ============================================================ */
.ld-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .78rem 1.5rem; border-radius: var(--ld-radius-pill);
  font-family: var(--ld-font-body); font-size: var(--ld-fs-sm); font-weight: 700;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease;
}
.ld-btn--primary { background: var(--ld-purple); color: #fff; box-shadow: 0 6px 18px rgba(91, 63, 209, .26); }
.ld-btn--primary:hover { background: var(--ld-purple-600); color: #fff; transform: translateY(-1px); box-shadow: 0 10px 24px rgba(91, 63, 209, .32); }
.ld-btn--accent { background: var(--ld-orange); color: #fff; box-shadow: 0 6px 18px rgba(242, 118, 46, .28); }
.ld-btn--accent:hover { background: var(--ld-orange-600); color: #fff; transform: translateY(-1px); }
.ld-btn--ghost { background: transparent; color: var(--ld-navy); border-color: var(--ld-line-strong); }
.ld-btn--ghost:hover { border-color: var(--ld-navy); background: var(--ld-surface); color: var(--ld-navy); }
.ld-btn--sm { padding: .55rem 1.1rem; font-size: var(--ld-fs-xs); }

/* ============================================================
   6. HERO
   ============================================================ */
.ld-hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 420px at 88% -10%, rgba(91, 63, 209, .13), transparent 62%),
    radial-gradient(700px 380px at 6% 108%, rgba(242, 118, 46, .12), transparent 60%),
    var(--ld-bg);
  border-bottom: 1px solid var(--ld-line);
}
.ld-hero__inner {
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(2rem, 5vw, 4rem); align-items: center;
  padding-block: clamp(2.75rem, 7vw, 5.5rem);
}
.ld-hero__badge {
  display: inline-flex; align-items: center; gap: .55rem;
  background: var(--ld-surface); border: 1px solid var(--ld-line);
  padding: .42rem .9rem .42rem .55rem; border-radius: var(--ld-radius-pill);
  font-size: var(--ld-fs-xs); font-weight: 700; color: var(--ld-ink-soft);
  box-shadow: var(--ld-shadow-sm); margin-bottom: 1.4rem;
}
.ld-hero__badge span.dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ld-orange);
  box-shadow: 0 0 0 4px rgba(242, 118, 46, .18);
}
.ld-hero h1 { margin-bottom: 1rem; }
.ld-hero h1 em {
  font-style: normal; color: var(--ld-purple);
  background: linear-gradient(180deg, transparent 62%, rgba(242, 118, 46, .28) 62%);
  padding-inline: .06em;
}
.ld-hero__lede { font-size: var(--ld-fs-lg); color: var(--ld-ink-soft); max-width: 56ch; margin-bottom: 1.9rem; }
.ld-hero__cta { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 2rem; }
.ld-hero__stats { display: flex; gap: 2.25rem; flex-wrap: wrap; }
.ld-hero__stat strong {
  display: block; font-family: var(--ld-font-head); font-size: 1.6rem;
  color: var(--ld-navy); line-height: 1;
}
.ld-hero__stat span { font-size: var(--ld-fs-xs); color: var(--ld-ink-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }

.ld-hero__art { position: relative; }
.ld-hero__art img { border-radius: var(--ld-radius-lg); box-shadow: var(--ld-shadow-lg); width: 100%; }

/* Daily riddle card */
.ld-daily {
  background: var(--ld-surface); border: 1px solid var(--ld-line);
  border-radius: var(--ld-radius-lg); padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: var(--ld-shadow); position: relative; overflow: hidden;
}
.ld-daily::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--ld-purple), var(--ld-orange));
}
.ld-daily__label {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: var(--ld-fs-xs); font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ld-orange-600); margin-bottom: .9rem;
}
.ld-daily__q {
  font-family: var(--ld-font-head); font-size: clamp(1.2rem, 2.2vw, 1.5rem);
  line-height: 1.35; color: var(--ld-navy); margin: 0 0 1.25rem;
}

/* ============================================================
   7. CARDS / GRIDS
   ============================================================ */
.ld-grid { display: grid; gap: var(--ld-gap); }
.ld-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ld-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ld-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.ld-card {
  display: flex; flex-direction: column;
  background: var(--ld-surface); border: 1px solid var(--ld-line);
  border-radius: var(--ld-radius); overflow: hidden;
  box-shadow: var(--ld-shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.ld-card:hover { transform: translateY(-3px); box-shadow: var(--ld-shadow); border-color: var(--ld-line-strong); }

.ld-card__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--ld-surface-alt); }
.ld-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.ld-card:hover .ld-card__media img { transform: scale(1.035); }

.ld-card__body { padding: 1.15rem 1.25rem 1.35rem; display: flex; flex-direction: column; flex: 1; }

.ld-card__cat {
  align-self: flex-start; font-size: .68rem; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--ld-purple-600); background: var(--ld-purple-100);
  padding: .28rem .6rem; border-radius: var(--ld-radius-pill);
  text-decoration: none; margin-bottom: .7rem;
}
.ld-card__cat:hover { background: var(--ld-purple); color: #fff; }

.ld-card__title { font-size: 1.14rem; line-height: 1.3; margin: 0 0 .55rem; }
.ld-card__title a { color: var(--ld-navy); text-decoration: none; }
.ld-card__title a:hover { color: var(--ld-purple-600); }

.ld-card__excerpt { font-size: var(--ld-fs-sm); color: var(--ld-ink-soft); margin: 0 0 1rem; flex: 1; }

.ld-card__meta {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  font-size: var(--ld-fs-xs); color: var(--ld-ink-muted);
  padding-top: .85rem; border-top: 1px solid var(--ld-line);
}
.ld-card__meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--ld-line-strong); }

/* Difficulty pill */
.ld-diff {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: .26rem .6rem; border-radius: var(--ld-radius-pill);
}
.ld-diff--easy { background: #e6f6ec; color: #1c7a45; }
.ld-diff--medium { background: #fff4dd; color: #96650b; }
.ld-diff--hard { background: #fdeaea; color: #a52222; }

/* Featured (large) card */
.ld-card--feature { grid-column: span 2; }
.ld-card--feature .ld-card__media { aspect-ratio: 2 / 1; }
.ld-card--feature .ld-card__title { font-size: clamp(1.35rem, 2.4vw, 1.85rem); }
.ld-card--feature .ld-card__body { padding: 1.5rem 1.6rem 1.7rem; }

/* Category tiles */
.ld-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 1rem; }
.ld-tile {
  display: flex; align-items: center; gap: .9rem;
  padding: 1.05rem 1.15rem; background: var(--ld-surface);
  border: 1px solid var(--ld-line); border-radius: var(--ld-radius);
  text-decoration: none; box-shadow: var(--ld-shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.ld-tile:hover { transform: translateY(-2px); box-shadow: var(--ld-shadow); border-color: var(--ld-purple); }
.ld-tile__icon {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px;
  display: grid; place-items: center; font-size: 1.35rem;
  background: var(--ld-purple-100);
}
.ld-tile:nth-child(3n+2) .ld-tile__icon { background: var(--ld-orange-100); }
.ld-tile:nth-child(3n+3) .ld-tile__icon { background: #e6f6ec; }
.ld-tile__name { font-weight: 700; color: var(--ld-navy); font-size: .95rem; line-height: 1.25; }
.ld-tile__count { font-size: var(--ld-fs-xs); color: var(--ld-ink-muted); }

/* ============================================================
   8. RIDDLE / REVEAL ANSWER
   ============================================================ */
.ld-riddle {
  margin: 2rem 0;
  background: linear-gradient(180deg, #fff, var(--ld-surface-alt));
  border: 1px solid var(--ld-line);
  border-radius: var(--ld-radius-lg);
  padding: clamp(1.35rem, 3vw, 2rem);
  box-shadow: var(--ld-shadow-sm);
  position: relative;
}
.ld-riddle__head {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  margin-bottom: 1rem;
}
.ld-riddle__tag {
  font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ld-purple-600);
}
.ld-riddle__q {
  font-family: var(--ld-font-head); font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  line-height: 1.4; color: var(--ld-navy); margin: 0 0 1.4rem;
}
.ld-riddle__hint {
  display: flex; gap: .6rem; align-items: flex-start;
  background: var(--ld-orange-100); border-radius: var(--ld-radius-sm);
  padding: .85rem 1rem; margin-bottom: 1.35rem; font-size: var(--ld-fs-sm);
  color: #7a4413;
}
.ld-riddle__hint strong { flex-shrink: 0; }

/* details/summary reveal — works without JS, no page reload */
.ld-reveal { border-top: 1px dashed var(--ld-line-strong); padding-top: 1.25rem; }
.ld-reveal > summary {
  list-style: none; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; gap: .5rem;
  background: var(--ld-purple); color: #fff;
  padding: .8rem 1.6rem; border-radius: var(--ld-radius-pill);
  font-weight: 700; font-size: var(--ld-fs-sm);
  box-shadow: 0 6px 18px rgba(91, 63, 209, .26);
  transition: background .16s ease, transform .16s ease;
  user-select: none;
}
.ld-reveal > summary::-webkit-details-marker { display: none; }
.ld-reveal > summary::after {
  content: "▾"; font-size: .8em; transition: transform .2s ease;
}
.ld-reveal[open] > summary { background: var(--ld-navy); }
.ld-reveal[open] > summary::after { transform: rotate(180deg); }
.ld-reveal > summary:hover { transform: translateY(-1px); }

.ld-reveal__body {
  margin-top: 1.35rem; padding: 1.25rem 1.35rem;
  background: #fff; border: 1px solid var(--ld-line);
  border-left: 4px solid var(--ld-orange);
  border-radius: var(--ld-radius-sm);
  animation: ldFade .28s ease both;
}
@keyframes ldFade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ld-reveal__label {
  font-size: .68rem; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ld-orange-600); margin-bottom: .35rem;
}
.ld-reveal__answer {
  font-family: var(--ld-font-head); font-size: 1.3rem; color: var(--ld-navy);
  margin: 0 0 .9rem;
}
.ld-reveal__why { font-size: var(--ld-fs-sm); color: var(--ld-ink-soft); margin: 0; }

/* ============================================================
   9. SINGLE POST
   ============================================================ */
.ld-breadcrumb { font-size: var(--ld-fs-xs); color: var(--ld-ink-muted); padding-block: 1rem; }
.ld-breadcrumb ol { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.ld-breadcrumb li { margin: 0; display: flex; align-items: center; gap: .4rem; }
.ld-breadcrumb li + li::before { content: "/"; color: var(--ld-line-strong); }
.ld-breadcrumb a { color: var(--ld-ink-muted); text-decoration: none; }
.ld-breadcrumb a:hover { color: var(--ld-purple-600); text-decoration: underline; }

.ld-article { padding-block: 1rem clamp(2.5rem, 6vw, 4rem); }
.ld-article__layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(2rem, 5vw, 3.5rem); align-items: start;
}
.ld-article__header { margin-bottom: 1.75rem; }
.ld-article__cats { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .9rem; }
.ld-article__title { margin-bottom: 1rem; }
.ld-article__dek { font-size: var(--ld-fs-lg); color: var(--ld-ink-soft); margin-bottom: 1.35rem; }

.ld-byline {
  display: flex; align-items: center; gap: .85rem; flex-wrap: wrap;
  padding-block: 1rem; border-top: 1px solid var(--ld-line); border-bottom: 1px solid var(--ld-line);
  font-size: var(--ld-fs-sm); color: var(--ld-ink-muted);
}
.ld-byline__avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.ld-byline__name { font-weight: 700; color: var(--ld-navy); }
.ld-byline__dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ld-line-strong); }

.ld-featured { margin: 1.75rem 0 2rem; }
.ld-featured img { width: 100%; border-radius: var(--ld-radius); box-shadow: var(--ld-shadow); }
.ld-featured figcaption { font-size: var(--ld-fs-xs); color: var(--ld-ink-muted); margin-top: .6rem; text-align: center; }

.ld-content { font-size: var(--ld-fs-base); color: #232c3d; }
.ld-content > * + * { margin-top: 0; }
.ld-content h2 { margin-top: 2.4rem; padding-top: .2rem; }
.ld-content h3 { margin-top: 1.9rem; }
.ld-content img { border-radius: var(--ld-radius-sm); margin-block: 1.75rem; }
.ld-content ul, .ld-content ol { padding-left: 1.4rem; }
.ld-content li { margin-bottom: .55rem; }
.ld-content a { font-weight: 500; }

/* Table of contents */
.ld-toc {
  background: var(--ld-surface-alt); border: 1px solid var(--ld-line);
  border-radius: var(--ld-radius); padding: 1.15rem 1.35rem; margin: 0 0 2rem;
  font-size: var(--ld-fs-sm);
}
.ld-toc__title {
  display: flex; align-items: center; gap: .5rem;
  font-size: .72rem; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ld-navy); margin-bottom: .7rem;
}
.ld-toc ol { margin: 0; padding-left: 1.1rem; }
.ld-toc li { margin-bottom: .35rem; }
.ld-toc a { color: var(--ld-ink-soft); text-decoration: none; }
.ld-toc a:hover { color: var(--ld-purple-600); text-decoration: underline; }

/* Share */
.ld-share { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: 2.5rem 0; padding-top: 1.5rem; border-top: 1px solid var(--ld-line); }
.ld-share__label { font-size: var(--ld-fs-xs); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ld-ink-muted); margin-right: .35rem; }
.ld-share a, .ld-share button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--ld-line); background: var(--ld-surface);
  color: var(--ld-navy); text-decoration: none; cursor: pointer; padding: 0;
  transition: background .16s, color .16s, border-color .16s, transform .16s;
}
.ld-share a:hover, .ld-share button:hover { transform: translateY(-2px); border-color: transparent; color: #fff; }
.ld-share .s-pin:hover { background: #e60023; }
.ld-share .s-fb:hover { background: #1877f2; }
.ld-share .s-x:hover { background: #0f1419; }
.ld-share .s-wa:hover { background: #25d366; }
.ld-share .s-mail:hover { background: var(--ld-purple); }
.ld-share .s-copy:hover { background: var(--ld-navy); }

/* Author box */
.ld-author {
  display: flex; gap: 1.15rem; align-items: flex-start;
  background: var(--ld-surface); border: 1px solid var(--ld-line);
  border-radius: var(--ld-radius); padding: 1.4rem; margin-top: 2.5rem;
}
.ld-author img { width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.ld-author__name { font-family: var(--ld-font-head); font-size: 1.1rem; margin: 0 0 .3rem; }
.ld-author__bio { font-size: var(--ld-fs-sm); color: var(--ld-ink-soft); margin: 0; }

/* Prev/next */
.ld-pn { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.ld-pn a {
  display: block; padding: 1.1rem 1.25rem; background: var(--ld-surface);
  border: 1px solid var(--ld-line); border-radius: var(--ld-radius);
  text-decoration: none; transition: border-color .18s, box-shadow .18s;
}
.ld-pn a:hover { border-color: var(--ld-purple); box-shadow: var(--ld-shadow-sm); }
.ld-pn__dir { font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ld-ink-muted); display: block; margin-bottom: .35rem; }
.ld-pn__title { font-weight: 700; color: var(--ld-navy); font-size: .95rem; line-height: 1.35; }
.ld-pn--next { text-align: right; }

/* Sidebar */
.ld-sidebar { position: sticky; top: calc(var(--ld-header-h) + 1.5rem); display: flex; flex-direction: column; gap: 1.5rem; }
.ld-widget { background: var(--ld-surface); border: 1px solid var(--ld-line); border-radius: var(--ld-radius); padding: 1.25rem; }
.ld-widget__title {
  font-family: var(--ld-font-body); font-size: .72rem; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ld-navy);
  margin: 0 0 1rem; padding-bottom: .7rem; border-bottom: 1px solid var(--ld-line);
}
.ld-widget ul { list-style: none; margin: 0; padding: 0; }
.ld-widget li { margin: 0; }
.ld-widget li + li { border-top: 1px solid var(--ld-line); }
.ld-widget li a { display: flex; justify-content: space-between; gap: .75rem; padding: .6rem 0; font-size: var(--ld-fs-sm); color: var(--ld-ink-soft); text-decoration: none; }
.ld-widget li a:hover { color: var(--ld-purple-600); }
.ld-widget li .count { color: var(--ld-ink-muted); font-size: var(--ld-fs-xs); flex-shrink: 0; }

/* Widgets must never exceed their column. Core search blocks and third-party
   form markup both default to intrinsic widths that overflow narrow sidebars. */
.ld-widget, .ld-widget * { box-sizing: border-box; }
.ld-widget { min-width: 0; overflow-wrap: anywhere; }
.ld-widget form, .ld-widget .wp-block-search,
.ld-widget .wp-block-search__inside-wrapper { max-width: 100%; min-width: 0; }
.ld-widget .wp-block-search__inside-wrapper { display: flex; gap: .4rem; }
.ld-widget .wp-block-search__input,
.ld-widget input[type="search"], .ld-widget input[type="text"] {
  flex: 1 1 auto; min-width: 0; width: 100%;
}
.ld-widget .wp-block-search__button { flex: 0 0 auto; white-space: nowrap; }

/* Theme search form */
.ld-searchform { display: flex; gap: .5rem; align-items: stretch; }
.ld-searchform input[type="search"] {
  flex: 1 1 auto; min-width: 0; width: 100%;
  padding: .7rem .9rem; border: 1px solid var(--ld-line-strong);
  border-radius: var(--ld-radius-pill); font: inherit; font-size: .95rem;
  background: var(--ld-surface); color: var(--ld-navy);
}
.ld-searchform input[type="search"]:focus-visible {
  outline: 2px solid var(--ld-purple); outline-offset: 2px; border-color: var(--ld-purple);
}
.ld-searchform .ld-btn { flex: 0 0 auto; }

/* ============================================================
   10. AD SLOTS (reserved space, no layout shift)
   ============================================================ */
.ld-ad {
  display: flex; align-items: center; justify-content: center;
  background: var(--ld-surface-alt); border: 1px dashed var(--ld-line-strong);
  border-radius: var(--ld-radius-sm); color: var(--ld-ink-muted);
  font-size: var(--ld-fs-xs); letter-spacing: .08em; text-transform: uppercase;
  margin-block: 2rem; overflow: hidden;
}
.ld-ad--inline { min-height: 250px; }
.ld-ad--leaderboard { min-height: 90px; }
.ld-ad--sidebar { min-height: 600px; }
.ld-ad--footer { min-height: 90px; margin-bottom: 0; }
.ld-ad__inner { width: 100%; text-align: center; }
.ld-ad.is-live { border: 0; background: transparent; }

/* ============================================================
   11. NEWSLETTER
   ============================================================ */
.ld-news {
  background:
    radial-gradient(600px 300px at 15% 10%, rgba(91, 63, 209, .35), transparent 65%),
    radial-gradient(500px 260px at 90% 90%, rgba(242, 118, 46, .28), transparent 62%),
    var(--ld-navy);
  color: #fff; border-radius: var(--ld-radius-lg);
  padding: clamp(1.75rem, 4vw, 3rem);
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 2rem; align-items: center;
}
.ld-news h2 { color: #fff; margin-bottom: .6rem; }
.ld-news p { color: rgba(255, 255, 255, .78); margin: 0; font-size: var(--ld-fs-sm); }
.ld-news form { display: flex; gap: .5rem; flex-wrap: wrap; }
.ld-news input[type="email"] {
  flex: 1 1 220px; min-width: 0; padding: .85rem 1.1rem;
  border-radius: var(--ld-radius-pill); border: 1px solid rgba(255, 255, 255, .25);
  background: rgba(255, 255, 255, .1); color: #fff; font-size: var(--ld-fs-sm);
  font-family: var(--ld-font-body);
}
.ld-news input[type="email"]::placeholder { color: rgba(255, 255, 255, .55); }
.ld-news input[type="email"]:focus { outline: 2px solid #fff; outline-offset: 1px; background: rgba(255, 255, 255, .16); }
.ld-news__note { font-size: var(--ld-fs-xs); color: rgba(255, 255, 255, .55); margin-top: .7rem; }

/* ============================================================
   12. ARCHIVE / PAGINATION / 404
   ============================================================ */
.ld-archive-head { padding-block: clamp(2rem, 5vw, 3.25rem) 1.5rem; border-bottom: 1px solid var(--ld-line); margin-bottom: 2.5rem; }
.ld-archive-head h1 { margin-bottom: .75rem; }
.ld-archive-head p { color: var(--ld-ink-soft); max-width: 70ch; margin: 0; }

.ld-pagination { display: flex; justify-content: center; margin-top: 3rem; }
.ld-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; height: 42px; padding: 0 .75rem; margin: 0 .2rem;
  border-radius: var(--ld-radius-sm); border: 1px solid var(--ld-line);
  background: var(--ld-surface); color: var(--ld-navy);
  text-decoration: none; font-weight: 600; font-size: var(--ld-fs-sm);
}
.ld-pagination .page-numbers:hover { border-color: var(--ld-purple); color: var(--ld-purple-600); }
.ld-pagination .page-numbers.current { background: var(--ld-navy); border-color: var(--ld-navy); color: #fff; }
.ld-pagination .page-numbers.dots { border: 0; background: none; }

.ld-404 { text-align: center; padding-block: clamp(3rem, 9vw, 6rem); }
.ld-404__code {
  font-family: var(--ld-font-head); font-size: clamp(5rem, 18vw, 11rem);
  line-height: .9; color: var(--ld-purple); opacity: .16; margin: 0;
}
.ld-404 h1 { margin-top: -1.5rem; }
.ld-404 p { color: var(--ld-ink-soft); max-width: 48ch; margin-inline: auto; }

/* ============================================================
   13. FOOTER
   ============================================================ */
.ld-footer { background: var(--ld-navy); color: rgba(255, 255, 255, .72); margin-top: 0; }
.ld-footer a { color: rgba(255, 255, 255, .72); text-decoration: none; }
.ld-footer a:hover { color: #fff; text-decoration: underline; }
.ld-footer__top {
  display: grid; grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 2.5rem; padding-block: clamp(2.5rem, 6vw, 4rem);
}
.ld-footer__brand .ld-brand__name { color: #fff; }
.ld-footer__brand .ld-brand__tag { color: rgba(255, 255, 255, .5); }
.ld-footer__about { font-size: var(--ld-fs-sm); margin-top: 1.1rem; max-width: 38ch; }
.ld-footer h3 {
  font-family: var(--ld-font-body); font-size: .72rem; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase; color: #fff; margin: 0 0 1rem;
}
.ld-footer ul { list-style: none; margin: 0; padding: 0; }
.ld-footer li { margin-bottom: .55rem; font-size: var(--ld-fs-sm); }
.ld-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding-block: 1.35rem; display: flex; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; font-size: var(--ld-fs-xs);
}

/* ============================================================
   14. WORDPRESS CORE ALIGNMENTS / BLOCKS
   ============================================================ */
.alignwide { width: min(var(--ld-wrap), calc(100vw - 2rem)); margin-inline: auto; }
.alignfull { width: 100vw; margin-left: calc(50% - 50vw); }
.alignleft { float: left; margin: .35rem 1.5rem 1rem 0; }
.alignright { float: right; margin: .35rem 0 1rem 1.5rem; }
.aligncenter { margin-inline: auto; display: block; }
.wp-caption { max-width: 100%; }
.wp-caption-text, .wp-block-image figcaption { font-size: var(--ld-fs-xs); color: var(--ld-ink-muted); text-align: center; margin-top: .5rem; }
.sticky { position: relative; }
.bypostauthor { display: block; }
.wp-block-button__link { border-radius: var(--ld-radius-pill); font-weight: 700; }
.wp-block-quote { border-left: 4px solid var(--ld-purple); padding-left: 1.25rem; }

/* ============================================================
   15. RESPONSIVE
   ============================================================ */
/* Between 900px and 1240px the 12-item nav plus the full brand lockup
   exceeds the 1180px container. Tighten the nav and drop the tagline
   rather than forcing a hamburger on desktop users. */
@media (max-width: 1240px) {
  .ld-header__inner { gap: .9rem; }
  .ld-brand__tag { display: none; }
  .ld-nav ul { gap: 0; }
  .ld-nav a { padding: .5rem .48rem; font-size: .8125rem; }
}

@media (max-width: 1080px) {
  .ld-article__layout { grid-template-columns: minmax(0, 1fr); }
  .ld-sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
  .ld-sidebar > * { flex: 1 1 260px; }
  .ld-footer__top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .ld-hero__inner { grid-template-columns: minmax(0, 1fr); }
  .ld-hero__art { order: -1; max-width: 520px; }
  .ld-grid--3, .ld-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ld-card--feature { grid-column: span 2; }
  .ld-news { grid-template-columns: 1fr; }

  .ld-nav {
    position: fixed; inset: var(--ld-header-h) 0 auto 0;
    background: var(--ld-surface); border-bottom: 1px solid var(--ld-line);
    box-shadow: var(--ld-shadow-lg); padding: 1rem;
    max-height: calc(100vh - var(--ld-header-h)); overflow-y: auto;
    display: none;
  }
  .ld-nav.is-open { display: block; }
  .ld-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .ld-nav ul ul {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; border-left: 2px solid var(--ld-line);
    border-radius: 0; padding: 0 0 0 .75rem; margin: .25rem 0 .25rem .5rem;
    min-width: 0;
  }
  .ld-nav a { padding: .7rem .8rem; border-radius: var(--ld-radius-sm); font-size: .95rem; }
  .ld-nav-toggle { display: inline-flex; }
  .ld-header__actions { margin-left: auto; }
}

@media (max-width: 640px) {
  :root { --ld-fs-base: 1.0625rem; --ld-header-h: 64px; }
  .ld-grid--3, .ld-grid--4, .ld-grid--2 { grid-template-columns: minmax(0, 1fr); }
  .ld-card--feature { grid-column: span 1; }
  .ld-pn { grid-template-columns: 1fr; }
  .ld-pn--next { text-align: left; }
  .ld-hero__stats { gap: 1.5rem; }
  .ld-footer__top { grid-template-columns: 1fr; gap: 2rem; }
  .ld-brand__tag { display: none; }
  .ld-author { flex-direction: column; }
  .ld-ad--sidebar { min-height: 250px; }
}

/* Print */
@media print {
  .ld-header, .ld-footer, .ld-sidebar, .ld-share, .ld-news, .ld-ad, .ld-nav { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .ld-article__layout { grid-template-columns: 1fr; }
  a { color: #000; text-decoration: underline; }
  .ld-reveal__body { display: block !important; }
}

/* ============================================================
   16. SEARCH FORM / QUIZ / COMMENTS / SOURCES
   ============================================================ */
.ld-searchform { display: flex; gap: .5rem; flex-wrap: wrap; }
.ld-searchform input[type="search"] {
  flex: 1 1 240px; min-width: 0; padding: .8rem 1.1rem;
  border: 1px solid var(--ld-line-strong); border-radius: var(--ld-radius-pill);
  background: var(--ld-surface); font-family: var(--ld-font-body);
  font-size: var(--ld-fs-sm); color: var(--ld-ink);
}
.ld-searchform input[type="search"]:focus { outline: 2px solid var(--ld-purple); outline-offset: 1px; border-color: var(--ld-purple); }

.ld-quiz {
  background: var(--ld-surface); border: 1px solid var(--ld-line);
  border-radius: var(--ld-radius-lg); padding: clamp(1.35rem, 3vw, 2.25rem);
  box-shadow: var(--ld-shadow); max-width: 780px;
}
.ld-quiz__bar {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: var(--ld-fs-xs); font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ld-ink-muted);
  padding-bottom: .9rem; border-bottom: 1px solid var(--ld-line); margin-bottom: 1.25rem;
}
.ld-quiz__score { color: var(--ld-purple-600); }
.ld-quiz__q {
  font-family: var(--ld-font-head); font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.4; color: var(--ld-navy); margin: 0 0 1.25rem; min-height: 3.2em;
}
.ld-quiz__answer {
  background: var(--ld-surface-alt); border-left: 4px solid var(--ld-orange);
  border-radius: var(--ld-radius-sm); padding: 1.1rem 1.25rem; margin-bottom: 1.25rem;
}
.ld-quiz__actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.ld-quiz__done { margin: 1.25rem 0 0; font-weight: 600; color: var(--ld-navy); }

.ld-sources {
  margin-top: 2.5rem; padding: 1.15rem 1.35rem;
  background: var(--ld-surface-alt); border: 1px solid var(--ld-line);
  border-radius: var(--ld-radius); font-size: var(--ld-fs-sm);
}
.ld-sources__title {
  font-family: var(--ld-font-body); font-size: .7rem; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase; margin: 0 0 .5rem; color: var(--ld-navy);
}
.ld-sources p { margin: 0 0 .4rem; }
.ld-sources__note { color: var(--ld-ink-muted); font-size: var(--ld-fs-xs); }

.ld-empty { text-align: center; padding-block: 3rem; }
.ld-empty h2 { margin-bottom: .5rem; }
.ld-empty p { color: var(--ld-ink-soft); margin-bottom: 1.75rem; }
.ld-empty .ld-tiles { text-align: left; margin-top: 2rem; }

.ld-comments { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--ld-line); }
.ld-comments__title { font-size: 1.35rem; margin-bottom: 1.25rem; }
.ld-comments__list { list-style: none; margin: 0 0 2rem; padding: 0; }
.ld-comments__list li { margin-bottom: 1.25rem; }
.ld-comments__list .comment-body {
  background: var(--ld-surface); border: 1px solid var(--ld-line);
  border-radius: var(--ld-radius); padding: 1.1rem 1.25rem;
}
.ld-comments__list .comment-meta { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; font-size: var(--ld-fs-xs); }
.ld-comments__list .avatar { border-radius: 50%; }
.ld-comments__list .children { list-style: none; margin: 1rem 0 0 1.5rem; padding: 0; }
.ld-comment-form p { margin-bottom: 1rem; }
.ld-comment-form label { display: block; font-weight: 600; font-size: var(--ld-fs-sm); margin-bottom: .35rem; }
.ld-comment-form input[type="text"],
.ld-comment-form input[type="email"],
.ld-comment-form input[type="url"],
.ld-comment-form textarea {
  width: 100%; padding: .75rem .9rem; border: 1px solid var(--ld-line-strong);
  border-radius: var(--ld-radius-sm); font-family: var(--ld-font-body);
  font-size: var(--ld-fs-sm); background: var(--ld-surface); color: var(--ld-ink);
}
.ld-comment-form .submit {
  background: var(--ld-purple); color: #fff; border: 0; cursor: pointer;
  padding: .8rem 1.6rem; border-radius: var(--ld-radius-pill);
  font-weight: 700; font-size: var(--ld-fs-sm); font-family: var(--ld-font-body);
}
.ld-comment-form .submit:hover { background: var(--ld-purple-600); }

.ld-card__placeholder {
  display: block; width: 100%; height: 100%;
  background:
    radial-gradient(circle at 30% 30%, rgba(91, 63, 209, .16), transparent 55%),
    radial-gradient(circle at 75% 70%, rgba(242, 118, 46, .16), transparent 55%),
    var(--ld-surface-alt);
}
.ld-share .is-copied { background: var(--ld-navy) !important; color: #fff !important; }


/* ============================================================
   17. THIRD-PARTY CONTAINMENT
   ============================================================ */
/* The CookieAdmin consent banner is injected with a fixed 100vw width plus a
   16px offset, which overflows narrow viewports. Constrain it to the viewport
   without altering its behaviour or its own styling. */
.cookieadmin_law_container,
.cookieadmin_consent_inside {
  max-width: calc(100vw - 32px) !important;
  box-sizing: border-box !important;
}
