/* ==========================================================================
   HabitatReport — Research & Editorial Guides Styles
   Shared by all /guides/* articles
   Unified Ponytail.dev Architecture • Lean, modular & cached
   ========================================================================== */

:root {
  --urgent: #ef4444;
  --accent2: #f59e0b;
}

.guide-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.kicker {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .8rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.guide-hero h1 {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  line-height: 1.15;
  margin-bottom: 16px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.guide-lead {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.meta-row {
  display: flex;
  gap: 20px;
  align-items: center;
  font-size: .85rem;
  color: var(--text-muted);
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.meta-row span strong {
  color: var(--text-main);
}

.callout {
  background: var(--card-bg);
  border-left: 4px solid var(--accent);
  padding: 18px 22px;
  border-radius: 0 12px 12px 0;
  margin: 28px 0;
}

.callout.urgent {
  border-left-color: var(--urgent);
}

.callout p {
  margin: 0;
  color: var(--text-main);
  font-size: .95rem;
  line-height: 1.6;
}

.product {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 24px;
  transition: var(--transition);
}

.product:hover {
  border-color: rgba(45, 212, 191, 0.3);
}

.phead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 10px;
}

.pname {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.pbadge {
  font-size: .75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(45, 212, 191, 0.15);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.pbadge.gold {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.pbadge.gray {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.pdesc {
  color: var(--text-muted);
  font-size: .95rem;
  margin-bottom: 16px;
  line-height: 1.6;
}

.pfacts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  font-size: .85rem;
}

.pfacts div strong {
  color: var(--text-main);
  display: block;
}

.pfacts div span {
  color: var(--text-muted);
}

.buylinks {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.buy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.buy.uk-btn {
  background: #012169;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.buy.uk-btn:hover {
  background: #0a2f8c;
}

.buy.us-btn {
  background: #b22234;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.buy.us-btn:hover {
  background: #c82a3d;
}

.buy.accent-btn {
  background: var(--accent);
  color: #0A0F1D;
  font-weight: 700;
}

.buy.accent-btn:hover {
  background: var(--accent-hover);
}

/* ==========================================================================
   UNIFIED GUIDE ARTICLE SYSTEM (consolidated from all /guides/* inline CSS)
   Includes legacy variable aliases so older pages keep rendering identically
   ========================================================================== */

/* Legacy variable aliases (old pages reference --text, --card, --border, --card2, --radius) */
:root {
  --text: var(--text-main);
  --card: var(--card-bg);
  --border: var(--card-border);
  --card2: #0F1626;
  --radius: var(--radius-lg);
}

/* Article canvas */
body {
  background: radial-gradient(1200px 800px at 80% -10%, #10233b 0%, var(--bg) 60%);
  color: var(--text-main);
  line-height: 1.6;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 20px 80px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.2;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.deck {
  color: var(--text-muted);
  font-size: 1.06rem;
  margin-bottom: 28px;
}

.meta {
  display: flex;
  gap: 18px;
  color: var(--text-muted);
  font-size: .82rem;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Table of contents */
.toc {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  margin-bottom: 34px;
}

.toc h2 {
  font-size: 1rem;
  margin: 0 0 10px 0;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc li {
  padding: 5px 0;
  border-bottom: 1px dashed rgba(255,255,255,.06);
}

.toc li:last-child {
  border-bottom: none;
}

.toc a {
  color: var(--text-main);
  text-decoration: none;
}

.toc a:hover {
  color: var(--accent);
}

/* Editorial typography */
h2 {
  font-size: 1.5rem;
  margin: 42px 0 16px;
  line-height: 1.25;
  color: var(--text-main);
}

h3 {
  font-size: 1.15rem;
  margin: 28px 0 12px;
  color: #d7e4ee;
}

p {
  margin-bottom: 16px;
  color: #c8d3de;
}

ul {
  margin: 0 0 18px 22px;
  color: #c8d3de;
}

li {
  margin-bottom: 8px;
}

strong {
  color: #fff;
}

/* Callout variants */
.callout.warn {
  border-left-color: var(--urgent);
  background: rgba(239,68,68,.07);
}

.callout.gold {
  border-left-color: var(--accent2);
  background: rgba(245,158,11,.08);
}

.callout-title {
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
  font-size: .95rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* Data tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  font-size: .92rem;
}

th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--card-border);
  vertical-align: top;
}

th {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .76rem;
  background: rgba(255,255,255,.02);
}

tr:hover td {
  background: rgba(255,255,255,.02);
}

/* Product/affiliate blocks (unified, readable badges) */
.product .phead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.product .pname { font-size: 1.2rem; font-weight: 700; color: var(--text-main); }
.product .pdesc { margin: 12px 0; color: #c8d3de; }
.product .pfacts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; font-size: .85rem; margin: 14px 0; padding: 0; background: none; border: none; }
.product .pfacts div { background: var(--card2); border-radius: 10px; padding: 10px 12px; }
.product .pfacts b { display: block; color: #fff; font-size: .9rem; margin-bottom: 2px; }
.product .pfacts div strong { color: #fff; }
.product .pfacts span { color: var(--text-muted); }

/* Solid badges: light text for contrast (fixes invisible orange/gray text) */
.pbadge {
  font-size: .72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  color: #06231F;
  background: var(--accent);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.pbadge.gold {
  color: #2A1A02;
  background: linear-gradient(135deg, #FBBF24, #D97706);
}

.pbadge.gray {
  color: #F3F4F6;
  background: #475569;
}

.pbadge.accent {
  color: #06231F;
  background: var(--accent);
}

/* Buy buttons */
.buy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent), #0d9488);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: .92rem;
  padding: 12px 22px;
  border-radius: 10px;
  margin-top: 6px;
  margin-right: 10px;
  transition: var(--transition);
}

.buy:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(45,212,191,.25);
}

.buy.us,
.buy.us-btn {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.buy.us:hover,
.buy.us-btn:hover {
  box-shadow: 0 8px 24px rgba(59,130,246,.25);
}

/* Region toggle */
.region-toggle {
  display: inline-flex;
  gap: 8px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-pill);
  padding: 4px;
  background: var(--card2);
  margin: 14px 0 4px;
}

.region-toggle button {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-weight: 600;
  font-size: .86rem;
  font-family: var(--font-sans);
  transition: var(--transition);
}

.region-toggle button.active {
  background: var(--accent);
  color: #06231F;
}

/* Report CTA */
.cta-report {
  background: linear-gradient(135deg, #1a2b3d, #101a26);
  border: 1px solid var(--accent2);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 40px 0;
  text-align: center;
}

.cta-report h3 {
  color: #ffd98a;
  font-size: 1.3rem;
  margin-top: 0;
}

.cta-report p {
  max-width: 560px;
  margin: 10px auto 20px;
}

.cta-report .buy {
  background: linear-gradient(135deg, var(--accent2), #d97706);
  margin: 0;
}

.cta-report .buy:hover {
  box-shadow: 0 8px 24px rgba(245,158,11,.3);
}

/* Closing blocks */
.bonus {
  background: var(--card-bg);
  border: 1px dashed var(--card-border);
  border-radius: 12px;
  padding: 18px 22px;
  margin: 22px 0;
  color: #c8d3de;
}

.outro {
  border-top: 1px solid var(--card-border);
  margin-top: 50px;
  padding-top: 24px;
  color: var(--text-muted);
  font-size: .9rem;
}

.outro a {
  color: var(--accent);
  text-decoration: none;
}

.outro a:hover {
  color: var(--accent-hover);
}

.disclaimer {
  font-size: .78rem;
  color: #64748b;
  border-top: 1px solid var(--card-border);
  padding-top: 18px;
  margin-top: 30px;
}

/* In-text affiliate links: unified brand teal (was scattered #38bdf8 blue) */
a.intext-link,
p a,
li a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}

a.intext-link:hover,
p a:hover,
li a:hover {
  color: var(--accent-hover);
}

@media (max-width: 600px) {
  .wrap { padding: 24px 16px 60px; }
  .product .pfacts { grid-template-columns: 1fr 1fr; }
  .region-toggle button { padding: 8px 12px; }
}

/* ==========================================================================
   DEEP-DIVE ARTICLE MODULES (The Mathematics of Burglary)
   ========================================================================== */

.breadcrumb { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

.article-header { margin-bottom: 36px; }
.article-header h1 { font-size: clamp(2rem, 4.5vw, 2.9rem); line-height: 1.22; margin-bottom: 18px; font-weight: 800; letter-spacing: -0.02em; }
.subtitle { font-size: 1.18rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 24px; }
.meta-bar { display: flex; align-items: center; gap: 20px; font-size: 0.86rem; color: var(--text-muted); border-top: 1px solid var(--card-border); border-bottom: 1px solid var(--card-border); padding: 14px 0; flex-wrap: wrap; }
.meta-bar span { display: inline-flex; align-items: center; gap: 6px; }

/* Video briefing container */
.video-container {
  background: linear-gradient(135deg, #142436, #0d1722);
  border: 1px solid rgba(45, 212, 191, 0.35);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 36px 0;
  box-shadow: 0 16px 36px rgba(0,0,0,0.35);
}
.video-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(45, 212, 191, 0.15); color: var(--accent);
  padding: 4px 10px; border-radius: 6px; font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 12px;
}
.video-header h3 { font-size: 1.3rem; margin-bottom: 8px; color: #fff; }
.video-header p { font-size: 0.92rem; color: var(--text-muted); margin-bottom: 18px; }
.video-player-wrap {
  position: relative; width: 100%; padding-top: 56.25%;
  background: #060a0f; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--card-border);
  display: flex; align-items: center; justify-content: center;
}
.video-container img.video-poster { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; }

/* Diagram cards */
figure.diagram-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); overflow: hidden; margin: 36px 0;
  box-shadow: 0 14px 32px rgba(0,0,0,0.4);
}
figure.diagram-card img { width: 100%; height: auto; display: block; border-bottom: 1px solid var(--card-border); }
figcaption { padding: 18px 22px; font-size: 0.92rem; color: var(--text-muted); line-height: 1.5; }
figcaption strong { color: var(--accent); }

/* Callout base for this module */
.formula-box {
  background: #060a0f; border: 1px solid var(--card-border); border-radius: 12px;
  padding: 20px; margin: 24px 0; font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 1.05rem; color: var(--accent); text-align: center; overflow-x: auto;
}

/* Audio/video toggle */
.av-toggle { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.av-btn {
  background: var(--card2); color: var(--text-muted); border: 1px solid var(--card-border);
  padding: 10px 20px; border-radius: 10px; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s ease; font-family: var(--font-sans);
}
.av-btn.active { background: linear-gradient(135deg, var(--accent), #0d9488); color: #fff; border-color: transparent; box-shadow: 0 4px 16px rgba(45, 212, 191, 0.3); }
.av-btn:hover { color: #fff; }

/* Affiliate note */
.aff-note { font-size: 0.78rem; color: var(--text-muted); margin-top: 14px; font-style: italic; }

/* CTA box */
.cta-section {
  background: linear-gradient(135deg, #10273f, #09131d); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); padding: 36px; margin: 56px 0 20px; text-align: center;
}
.cta-section h2 { font-size: 1.7rem; color: #fff; margin-bottom: 12px; }
.cta-section p { color: var(--text-muted); max-width: 580px; margin: 0 auto 24px; font-size: 1rem; }
.btn-scanner, .btn-cta {
  display: inline-flex; align-items: center; gap: 8px; background: linear-gradient(135deg, var(--accent), #0d9488);
  color: #fff; text-decoration: none; font-weight: 700; padding: 14px 28px; border-radius: 10px;
  font-size: 1.02rem; transition: transform .15s ease, box-shadow .15s ease; border: 0; cursor: pointer;
  font-family: var(--font-sans);
}
.btn-scanner:hover, .btn-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(45, 212, 191, 0.35); }

/* Guides index cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; margin-top: 30px; }
.card {
  background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-lg);
  padding: 26px; text-decoration: none; color: inherit; display: flex; flex-direction: column;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.card:hover {
  transform: translateY(-3px); border-color: rgba(45,212,191,.4);
  box-shadow: 0 12px 30px rgba(0,0,0,.3);
}
.card .tag { font-size: .75rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.card h3 { font-size: 1.25rem; line-height: 1.3; margin-bottom: 12px; color: #fff; }
.card p { color: var(--text-muted); font-size: .92rem; flex: 1; margin-bottom: 18px; }
.card .cta-link { color: var(--accent); font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; }
.cta-banner {
  background: linear-gradient(135deg, #142231, #0c1622); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); padding: 32px; margin-top: 60px; text-align: center;
}
.cta-banner h2 { font-size: 1.5rem; margin-bottom: 10px; color: #fff; }
.cta-banner p { color: var(--text-muted); max-width: 540px; margin: 0 auto 20px; font-size: .95rem; }

/* Guides hero */
.hero { margin-bottom: 40px; }
.hero p { color: var(--text-muted); font-size: 1.1rem; max-width: 680px; }

/* Video placeholder + article body (deep-dive module) */
.video-placeholder-content {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 20px;
  background: radial-gradient(circle at center, rgba(45,212,191,0.08) 0%, #060a0f 70%);
}
.play-icon-pulse {
  width: 64px; height: 64px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #0d9488);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 26px; margin-bottom: 14px;
  box-shadow: 0 0 24px rgba(45, 212, 191, 0.45);
  cursor: pointer; transition: transform 0.2s ease;
}
.play-icon-pulse:hover { transform: scale(1.08); }

.article-body h2 { font-size: 1.65rem; margin: 44px 0 18px; color: #fff; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.article-body h3 { font-size: 1.25rem; margin: 28px 0 12px; color: #e2e8f0; }
.article-body p { margin-bottom: 20px; font-size: 1.05rem; color: #cbd5e1; }
.article-body ul { margin: 0 0 24px 24px; color: #cbd5e1; }
.article-body li { margin-bottom: 10px; font-size: 1.02rem; }

.pbadge.blue {
  color: #061A33;
  background: linear-gradient(135deg, #60A5FA, #3B82F6);
}
