/* ==========================================================================
   Democracy Ops guides
   Loads after style.css and home.css and reuses their colors, buttons,
   navigation and footer. This file only adds the article layout.
   Works under the site's strict Content Security Policy: no inline styles.
   ========================================================================== */

/* ---- Heading block ------------------------------------------------------------- */

.guide .g-hero {
  padding: clamp(36px, 6vw, 72px) 0 clamp(8px, 2vw, 24px);
}

.guide .g-hero-wrap {
  max-width: 1200px;
}

.g-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.g-crumbs li + li::before {
  content: "/";
  margin-right: 8px;
  opacity: 0.55;
}

.g-crumbs a {
  color: inherit;
  text-decoration: none;
}

.g-crumbs a:hover,
.g-crumbs a:focus-visible {
  color: var(--primary);
  text-decoration: underline;
}

.guide .g-hero h1 {
  max-width: 17em;
  font-size: clamp(2.2rem, 1.2rem + 3.6vw, 3.9rem);
  font-weight: 850;
  line-height: 1.04;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.g-lead {
  max-width: 42em;
  margin: 22px 0 0;
  font-size: clamp(1.1rem, 1rem + 0.45vw, 1.3rem);
  line-height: 1.55;
  color: var(--text-dim);
}

.g-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.92rem;
  color: var(--text-dim);
}

.g-meta li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.g-meta svg {
  color: var(--primary);
}

/* ---- Page grid: contents list and article ----------------------------------------- */

.g-grid {
  display: grid;
  grid-template-columns: minmax(0, 15.5rem) minmax(0, 46rem);
  gap: clamp(28px, 5vw, 64px);
  justify-content: start;
  align-items: start;
  padding-top: clamp(20px, 3vw, 36px);
  padding-bottom: clamp(36px, 5vw, 64px);
}

.g-grid.g-grid-wide {
  grid-template-columns: minmax(0, 46rem);
}

.g-toc {
  position: sticky;
  top: 96px;
  padding: 18px 18px 14px;
  background: var(--lp-glass);
  border: 1px solid var(--lp-line);
  border-radius: 18px;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.g-toc-title {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
}

.g-toc ol {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.g-toc a {
  position: relative;
  display: block;
  padding: 6px 10px;
  margin: 0 -10px;
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: 10px;
}

.g-toc a:hover,
.g-toc a:focus-visible {
  color: var(--text);
  background: var(--note-bg);
}

.g-toc a[aria-current="true"] {
  padding-right: 28px;
  color: var(--primary);
  font-weight: 700;
  background: linear-gradient(90deg, rgba(36, 71, 214, 0.14), rgba(124, 58, 237, 0.06));
}

/* A small pointer shows where you are, instead of an edge stripe. */
.g-toc a[aria-current="true"]::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 13px;
  width: 6px;
  height: 6px;
  margin-top: -4px;
  border: solid currentColor;
  border-width: 2px 2px 0 0;
  transform: rotate(45deg);
  opacity: 0.75;
}

/* ---- Article text -------------------------------------------------------------------- */

.g-body {
  min-width: 0;
  font-size: 1.0625rem;
  line-height: 1.72;
  color: var(--text);
}

.g-body h2 {
  margin: 2.6em 0 0.6em;
  font-size: clamp(1.55rem, 1.25rem + 1vw, 2.05rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  scroll-margin-top: 96px;
}

.g-body > h2:first-child,
.g-body > .g-summary + h2 {
  margin-top: 1.4em;
}

.g-body h3 {
  margin: 1.8em 0 0.5em;
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.015em;
}

.g-body p {
  margin: 0 0 1.1em;
}

.g-body ul,
.g-body ol {
  margin: 0 0 1.3em;
  padding-left: 1.4em;
}

.g-body li {
  margin: 0 0 0.55em;
  padding-left: 0.2em;
}

.g-body li::marker {
  color: var(--primary);
  font-weight: 700;
}

/* The guides index uses a plain card list inside the article column. */
.g-body ul.g-list {
  margin: 0 0 1.3em;
  padding: 0;
}

.g-body ul.g-list > li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.g-body a {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
}

.g-body a:hover,
.g-body a:focus-visible {
  color: var(--primary-strong);
}

.g-body strong {
  font-weight: 750;
}

.g-small {
  font-size: 0.92rem;
  color: var(--text-dim);
}

/* Short answer box at the top of a guide */

.g-summary {
  margin: 0 0 1.6em;
  padding: 24px 30px 10px;
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(124, 58, 237, 0.08), transparent 58%),
    radial-gradient(110% 90% at 100% 100%, rgba(46, 162, 219, 0.1), transparent 60%),
    var(--lp-glass-strong);
  border-radius: 26px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.85) inset, 0 26px 50px -30px rgba(36, 50, 120, 0.5);
}

/* The short version reads as a numbered ledger: gradient numerals, hairline rows. */
.g-body .g-summary ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: sv;
}

.g-body .g-summary li {
  position: relative;
  margin: 0;
  padding: 13px 0 14px 2.9rem;
  border-top: 1px solid rgba(36, 71, 214, 0.13);
  counter-increment: sv;
}

.g-body .g-summary li::before {
  content: counter(sv, decimal-leading-zero);
  position: absolute;
  top: 13px;
  left: 0;
  font-size: 1.15rem;
  line-height: 1.72;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  background: linear-gradient(100deg, #2447d6, #7c3aed 70%, #2ea2db);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.g-body h2.g-summary-title {
  margin: 0 0 0.7em;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
}

/* Callout */

.g-callout {
  --g-fold: 26px;
  position: relative;
  margin: 1.8em 0;
  padding: 20px 26px 8px;
  background: linear-gradient(180deg, rgba(36, 71, 214, 0.085), rgba(36, 71, 214, 0.05));
  border-radius: 18px 0 18px 18px;
  clip-path: polygon(0 0, calc(100% - var(--g-fold)) 0, 100% var(--g-fold), 100% 100%, 0 100%);
}

/* The turned-down corner. */
.g-callout::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: var(--g-fold);
  height: var(--g-fold);
  background: linear-gradient(225deg, transparent 50%, rgba(36, 71, 214, 0.2) 50%);
  border-bottom-left-radius: 8px;
}

/* Run of show */

.g-body ol.g-timeline {
  padding-left: 0;
  list-style: none;
  counter-reset: step;
}

.g-body ol.g-timeline > li {
  position: relative;
  padding: 0 0 0 3.1rem;
  counter-increment: step;
}

.g-body ol.g-timeline > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.05em;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: var(--lp-grad);
  border-radius: 50%;
}

/* Checklists */

.g-checks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 1.4em;
}

.g-checks > div {
  padding: 18px 18px 8px;
  background: var(--lp-glass-strong);
  border: 1px solid var(--lp-line);
  border-radius: 16px;
}

.g-body .g-checks h3 {
  margin: 0 0 0.7em;
  font-size: 1rem;
}

.g-body ul.g-checklist {
  padding: 0;
  list-style: none;
}

.g-body ul.g-checklist li {
  position: relative;
  padding: 0 0 0 1.9rem;
  font-size: 0.97rem;
  line-height: 1.5;
}

.g-body ul.g-checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.18em;
  width: 1.1rem;
  height: 1.1rem;
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: 6px;
}

/* ---- Script templates ----------------------------------------------------------------- */

.g-script {
  margin: 1.4em 0 1.6em;
  overflow: hidden;
  background: var(--lp-glass-strong);
  border: 1px solid var(--lp-line);
  border-radius: 18px;
  box-shadow: var(--lp-shadow-lg);
}

.g-script figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 12px 20px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--note-bg);
  border-bottom: 1px solid var(--lp-line);
}

.g-copy {
  padding: 7px 14px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--primary);
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--lp-line);
  border-radius: 999px;
}

.g-copy:hover,
.g-copy:focus-visible {
  color: #fff;
  background: var(--primary);
}

.g-copy[hidden] {
  display: none;
}

.g-script-body {
  padding: 18px 20px 6px;
}

.g-script-body p {
  margin: 0 0 0.9em;
  font-size: 1.02rem;
  line-height: 1.6;
}

.g-script-body .g-branch {
  margin-left: 0.2rem;
  padding: 10px 16px;
  font-size: 0.97rem;
  color: var(--text-dim);
  background: rgba(36, 71, 214, 0.05);
  border-radius: 14px;
}

.g-script-body .g-branch i {
  font-style: italic;
  font-weight: 650;
  color: var(--text);
}

.g-field {
  padding: 0 0.28em;
  font-weight: 650;
  color: var(--primary-strong);
  background: var(--note-bg);
  border-radius: 6px;
}

/* ---- Table of replies ---------------------------------------------------------------------- */

.g-table-wrap {
  margin: 1.2em 0 1.8em;
  overflow-x: auto;
  border: 1px solid var(--lp-line);
  border-radius: 16px;
  background: var(--lp-glass-strong);
}

.g-table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: 0.97rem;
  line-height: 1.5;
}

.g-table th,
.g-table td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--lp-line);
}

.g-table thead th {
  font-size: 0.78rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--note-bg);
}

.g-table tbody tr:last-child td {
  border-bottom: 0;
}

.g-table td:first-child {
  width: 26%;
  font-weight: 650;
}

/* ---- FAQ inside an article ------------------------------------------------------------------ */

.g-faq {
  margin: 0 0 1em;
}

.g-faq details p {
  margin: 0 0 1.2em;
}

/* ---- Guides index and "keep reading" cards --------------------------------------------------- */

.g-list,
.g-more ul {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.g-more ul {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}

.g-card {
  display: grid;
  gap: 10px;
  height: 100%;
  padding: 24px 26px;
  color: var(--text);
  text-decoration: none;
  background: var(--lp-glass-strong);
  border: 1px solid var(--lp-line);
  border-radius: 20px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
  transition: transform 0.25s var(--lp-ease), box-shadow 0.25s var(--lp-ease), border-color 0.25s var(--lp-ease);
}

.g-body a.g-card {
  color: var(--text);
  text-decoration: none;
}

.g-card:hover,
.g-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--note-border);
  box-shadow: var(--lp-shadow-lg);
}

.g-card-title {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.g-card-lg .g-card-title {
  font-size: 1.5rem;
}

.g-card-text {
  line-height: 1.55;
  color: var(--text-dim);
}

.g-card-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--primary);
}

.g-body h2.g-h2-plain {
  margin-top: 2.2em;
}

/* ---- Closing call to action ---------------------------------------------------------------------- */

.guide .g-cta-section {
  padding-top: clamp(24px, 4vw, 48px);
}

.g-cta {
  max-width: 62rem;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px);
  text-align: center;
  color: #eef1f9;
  background: linear-gradient(160deg, #0a1230 0%, #101c4a 55%, #1b1f66 100%);
  border: 1px solid rgba(125, 155, 255, 0.2);
  border-radius: clamp(24px, 4vw, 40px);
}

.g-cta h2 {
  font-size: clamp(1.7rem, 1.2rem + 2vw, 2.6rem);
  font-weight: 850;
  letter-spacing: -0.03em;
  color: #fff;
}

.g-cta p {
  max-width: 40em;
  margin: 16px auto 0;
  font-size: 1.1rem;
  line-height: 1.55;
  color: #c9d3f5;
}

.g-cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.g-cta .lp-btn-ghost {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
}

.g-cta .lp-btn-ghost:hover,
.g-cta .lp-btn-ghost:focus-visible {
  background: rgba(255, 255, 255, 0.16);
}

.g-more {
  max-width: 62rem;
  margin: clamp(36px, 5vw, 56px) auto 0;
}

.g-more h2 {
  margin: 0 0 18px;
  font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}

/* ---- Small screens ---------------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .g-grid {
    grid-template-columns: minmax(0, 46rem);
  }

  .g-toc {
    position: static;
  }

  .g-checks {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .g-summary,
  .g-callout {
    padding-left: 18px;
    padding-right: 18px;
  }

  .g-script figcaption {
    padding-left: 16px;
  }

  .g-script-body {
    padding-left: 16px;
    padding-right: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .g-card {
    transition: none;
  }

  .g-card:hover,
  .g-card:focus-visible {
    transform: none;
  }
}

@media print {
  .guide .lp-nav-wrap,
  .guide .lp-bg,
  .g-toc,
  .g-cta-section,
  .g-copy,
  .guide .lp-foot {
    display: none !important;
  }

  .g-grid {
    display: block;
  }

  .g-script,
  .g-summary,
  .g-callout,
  .g-checks > div {
    box-shadow: none;
    break-inside: avoid;
  }
}

/* ---- Windows high-contrast mode: give the shapes a visible edge ------------------ */

@media (forced-colors: active) {
  .g-summary,
  .g-callout,
  .g-script-body .g-branch {
    border: 1px solid CanvasText;
    clip-path: none;
  }

  .g-callout::after {
    display: none;
  }
}
