/*
Theme Name: Rabbit Bricks (Twenty Twenty-Five Child)
Theme URI: https://aitoolsapex.com
Description: Rabbit Bricks Design System applied to Twenty Twenty-Five. Loads tokens.css + components.css and overrides article prose styling for Blog Factory pipeline output.
Author: Rabbit Bricks
Version: 1.0.0
Template: twentytwentyfive
Text Domain: rabbitbricks-child
*/

/* tokens.css and components.css are enqueued separately via functions.php so they cascade in the right order. This file only adds prose + Stage 9 box overrides. */

/* ============================================================
   ARTICLE PROSE — markdown-rendered post content
   Targets the default WP post body so Stage 9's marked.parse output picks up brand styling without adding wrapper classes.
   ============================================================ */
.entry-content,
.wp-block-post-content {
  font-family: var(--bf-font-body);
  font-size: var(--bf-fs-body);
  line-height: var(--bf-lh-loose);
  color: var(--bf-text);
  max-width: var(--bf-container-narrow);
  margin: 0 auto;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.wp-block-post-content h1,
.wp-block-post-content h2,
.wp-block-post-content h3,
.wp-block-post-content h4 {
  font-family: var(--bf-font-display);
  font-weight: var(--bf-fw-semibold);
  letter-spacing: var(--bf-tracking-tight);
  line-height: var(--bf-lh-tight);
  color: var(--bf-gray-900);
}

.entry-content h1 { font-size: var(--bf-fs-h1); margin: var(--bf-space-12) 0 var(--bf-space-6); }
.entry-content h2 { font-size: var(--bf-fs-h2); margin: var(--bf-space-12) 0 var(--bf-space-6); padding-top: var(--bf-space-4); border-top: 1px solid var(--bf-border); }
.entry-content h3 { font-size: var(--bf-fs-h3); letter-spacing: var(--bf-tracking-snug); margin: var(--bf-space-8) 0 var(--bf-space-4); }
.entry-content h4 { font-size: var(--bf-fs-h4); margin: var(--bf-space-6) 0 var(--bf-space-3); }

.entry-content p { margin: 0 0 var(--bf-space-4); }
.entry-content a { color: var(--bf-text-link); text-decoration: underline; text-underline-offset: 3px; }
.entry-content a:hover { color: var(--bf-cyan-600); }

.entry-content ul,
.entry-content ol { margin: 0 0 var(--bf-space-4); padding-left: var(--bf-space-6); }
.entry-content li { margin-bottom: var(--bf-space-2); line-height: var(--bf-lh-loose); }

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--bf-space-6) 0;
  font-size: var(--bf-fs-small);
  border: 1px solid var(--bf-border);
  border-radius: var(--bf-radius-md);
  overflow: hidden;
}
.entry-content th,
.entry-content td { padding: var(--bf-space-3) var(--bf-space-4); text-align: left; border-bottom: 1px solid var(--bf-border); }
.entry-content th { background: var(--bf-blue-50); color: var(--bf-blue-900); font-weight: var(--bf-fw-semibold); font-family: var(--bf-font-display); letter-spacing: var(--bf-tracking-snug); border-bottom: 2px solid var(--bf-blue-100); }
.entry-content tr:last-child td { border-bottom: 0; }
.entry-content tr:nth-child(even) td { background: var(--bf-bg-alt); }

.entry-content blockquote {
  margin: var(--bf-space-6) 0;
  padding: var(--bf-space-4) var(--bf-space-6);
  background: var(--bf-cyan-50);
  border-left: 3px solid var(--bf-cyan-600);
  border-radius: 0 var(--bf-radius-md) var(--bf-radius-md) 0;
  color: var(--bf-blue-900);
  font-size: var(--bf-fs-body);
}
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content blockquote strong { color: var(--bf-blue-900); }

.entry-content code {
  font-family: var(--bf-font-mono);
  font-size: 0.9em;
  background: var(--bf-gray-100);
  color: var(--bf-blue-900);
  padding: 2px 6px;
  border-radius: var(--bf-radius-sm);
}

.entry-content hr {
  border: 0;
  border-top: 1px solid var(--bf-border);
  margin: var(--bf-space-12) 0;
}

/* ============================================================
   STAGE 9 BOX OVERRIDES — replace inline-style hacks
   Stage 9 emits these classes; CSS now lives here instead of inline.
   ============================================================ */

.bf-aeo-tldr {
  background: var(--bf-cyan-50);
  border-left: 3px solid var(--bf-cyan-600);
  padding: var(--bf-space-3) var(--bf-space-4);
  margin: 0 0 var(--bf-space-6);
  border-radius: 0 var(--bf-radius-md) var(--bf-radius-md) 0;
  font-size: var(--bf-fs-body);
  color: var(--bf-blue-900);
}
.bf-aeo-tldr strong { color: var(--bf-blue-900); }

.bf-author-byline {
  border-top: 1px solid var(--bf-border);
  padding-top: var(--bf-space-6);
  margin-top: var(--bf-space-12);
  font-family: var(--bf-font-body);
  font-size: var(--bf-fs-small);
  color: var(--bf-gray-600);
}
.bf-author-byline p { margin: 0 0 var(--bf-space-2); }
.bf-author-byline em { font-size: var(--bf-fs-caption); color: var(--bf-gray-500); }
.bf-author-byline strong { color: var(--bf-gray-800); }

/* ============================================================
   POST META + LAYOUT POLISH
   ============================================================ */
.wp-block-post-title {
  font-family: var(--bf-font-display);
  font-size: var(--bf-fs-display);
  letter-spacing: -0.03em;
  line-height: var(--bf-lh-tight);
  color: var(--bf-gray-900);
  max-width: var(--bf-container-narrow);
  margin: 0 auto var(--bf-space-6);
}

.wp-block-post-date,
.wp-block-post-author {
  font-size: var(--bf-fs-small);
  color: var(--bf-text-muted);
}

/* ============================================================
   SITE BRAND — logo / nav
   ============================================================ */
.wp-block-site-title a {
  font-family: var(--bf-font-display);
  font-weight: var(--bf-fw-bold);
  letter-spacing: var(--bf-tracking-tight);
  color: var(--bf-blue);
  text-decoration: none;
}

/* Make it feel less default-WP and more like a media site */
body { background: var(--bf-bg); }
.wp-block-group.has-background { background-color: var(--bf-bg-alt) !important; }

/* ============================================================
   PLAN B-LIGHT: TOC / META-BAR / VERDICT-BOX / QUICK-ANSWER
   ============================================================ */

/* ---------- TOC (collapsible) ---------- */
.bf-article-toc {
  background: var(--bf-bg-alt);
  border: 1px solid var(--bf-border);
  border-radius: var(--bf-radius-lg);
  padding: var(--bf-space-4) var(--bf-space-6);
  margin: var(--bf-space-6) 0 var(--bf-space-8);
  font-size: var(--bf-fs-small);
}
.bf-article-toc summary {
  font-family: var(--bf-font-display);
  font-weight: var(--bf-fw-semibold);
  font-size: var(--bf-fs-h6);
  text-transform: uppercase;
  letter-spacing: var(--bf-tracking-caps);
  color: var(--bf-blue);
  cursor: pointer;
  padding: var(--bf-space-2) 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--bf-space-2);
}
.bf-article-toc summary::-webkit-details-marker { display: none; }
.bf-article-toc summary::before {
  content: "▸";
  font-size: 12px;
  color: var(--bf-cyan-600);
  transition: transform var(--bf-duration) var(--bf-ease);
}
.bf-article-toc[open] summary::before { transform: rotate(90deg); }
.bf-article-toc ul {
  list-style: none;
  padding: 0;
  margin: var(--bf-space-3) 0 0;
  display: flex;
  flex-direction: column;
  gap: var(--bf-space-1);
  border-top: 1px solid var(--bf-border);
  padding-top: var(--bf-space-3);
}
.bf-article-toc li { margin: 0; }
.bf-article-toc li.toc-l3 { padding-left: var(--bf-space-6); font-size: var(--bf-fs-caption); color: var(--bf-text-muted); }
.bf-article-toc a {
  color: var(--bf-text);
  text-decoration: none;
  padding: 4px 0;
  display: inline-block;
  line-height: var(--bf-lh-snug);
  transition: color var(--bf-duration) var(--bf-ease);
}
.bf-article-toc a:hover { color: var(--bf-cyan-600); }

/* ---------- META BAR (freshness signal) ---------- */
.bf-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bf-space-4);
  align-items: center;
  padding: var(--bf-space-3) 0;
  margin: var(--bf-space-6) 0 var(--bf-space-4);
  border-top: 1px solid var(--bf-border);
  border-bottom: 1px solid var(--bf-border);
  font-family: var(--bf-font-mono);
  font-size: var(--bf-fs-caption);
  letter-spacing: var(--bf-tracking-wide);
  text-transform: uppercase;
  color: var(--bf-text-muted);
}
.bf-meta-bar .bf-meta-item { display: inline-flex; align-items: center; gap: 6px; }
.bf-meta-bar .bf-meta-item strong { color: var(--bf-gray-900); font-family: var(--bf-font-body); font-weight: var(--bf-fw-semibold); }
.bf-meta-bar .bf-meta-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--bf-success); }

/* ---------- VERDICT BOX (per-tool summary) ---------- */
.bf-verdict-box {
  background: var(--bf-blue-50);
  border: 1px solid var(--bf-blue-100);
  border-left: 4px solid var(--bf-blue);
  border-radius: var(--bf-radius-md);
  padding: var(--bf-space-4) var(--bf-space-6);
  margin: var(--bf-space-6) 0;
  font-size: var(--bf-fs-small);
}
.bf-verdict-box p { margin: 0 0 var(--bf-space-2); }
.bf-verdict-box p:last-child { margin-bottom: 0; }
.bf-verdict-box p strong:first-child { color: var(--bf-blue-900); font-family: var(--bf-font-display); font-size: var(--bf-fs-body); display: block; margin-bottom: var(--bf-space-2); padding-bottom: var(--bf-space-2); border-bottom: 1px solid var(--bf-blue-100); }
.bf-verdict-box ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr; gap: var(--bf-space-2); }
.bf-verdict-box ul li {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: var(--bf-space-3);
  align-items: baseline;
  padding: 4px 0;
  font-size: var(--bf-fs-small);
}
.bf-verdict-box ul li strong {
  color: var(--bf-blue-700);
  font-family: var(--bf-font-mono);
  font-size: var(--bf-fs-caption);
  letter-spacing: var(--bf-tracking-wide);
  text-transform: uppercase;
  font-weight: var(--bf-fw-semibold);
}
@media (max-width: 600px) {
  .bf-verdict-box ul li { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- QUICK ANSWER (top-of-article overview) ---------- */
.bf-quick-answer {
  background: linear-gradient(180deg, var(--bf-blue-50) 0%, var(--bf-bg) 100%);
  border: 1px solid var(--bf-blue-100);
  border-radius: var(--bf-radius-lg);
  padding: var(--bf-space-6);
  margin: var(--bf-space-6) 0;
  box-shadow: var(--bf-shadow-sm);
}
.bf-quick-answer p:first-child strong {
  font-family: var(--bf-font-display);
  font-size: var(--bf-fs-h5);
  color: var(--bf-blue-900);
  display: block;
  margin-bottom: var(--bf-space-3);
}
.bf-quick-answer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--bf-space-3); }
.bf-quick-answer ul li {
  padding: var(--bf-space-3) var(--bf-space-4);
  background: var(--bf-bg);
  border: 1px solid var(--bf-border);
  border-radius: var(--bf-radius-md);
  font-size: var(--bf-fs-small);
  line-height: var(--bf-lh-snug);
}
.bf-quick-answer ul li strong { color: var(--bf-blue); display: inline; margin-right: var(--bf-space-2); }

/* Comparison table at top — give it a card feel */
.entry-content > p + table:first-of-type,
.entry-content table {
  box-shadow: var(--bf-shadow-sm);
}

/* ============================================================
   HOMEPAGE — hero / featured / grid / toolkit / trust strip
   ============================================================ */

.page-template-default .entry-content,
.home .entry-content,
.home .wp-block-post-content {
  max-width: var(--bf-container);
  padding: 0 var(--bf-space-4);
}

.bf-home-hero {
  position: relative;
  background: linear-gradient(180deg, var(--bf-blue-50) 0%, var(--bf-bg) 100%);
  padding: var(--bf-space-24) var(--bf-space-8) var(--bf-space-16);
  margin: var(--bf-space-6) 0 var(--bf-space-12);
  border-radius: var(--bf-radius-2xl);
  border: 1px solid var(--bf-border);
  text-align: center;
  overflow: hidden;
}
.bf-home-hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--bf-blue-100) 1px, transparent 1px),
    linear-gradient(90deg, var(--bf-blue-100) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: .35;
  mask-image: radial-gradient(ellipse at top, #000 0%, transparent 70%);
  pointer-events: none;
}
.bf-home-hero > * { position: relative; z-index: 1; }
.bf-home-hero .bf-eyebrow { display: inline-block; margin-bottom: var(--bf-space-4); }
.bf-home-hero__title {
  font-family: var(--bf-font-display);
  font-size: var(--bf-fs-display);
  font-weight: var(--bf-fw-bold);
  letter-spacing: -0.03em;
  line-height: var(--bf-lh-tight);
  color: var(--bf-gray-900);
  max-width: 18ch;
  margin: 0 auto var(--bf-space-6);
}
.bf-home-hero__title em {
  font-style: normal;
  color: var(--bf-blue);
  position: relative;
}
.bf-home-hero__title em::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 4px; height: 8px;
  background: var(--bf-cyan); opacity: .35;
  z-index: -1; border-radius: 4px;
}
.bf-home-hero__sub {
  max-width: 60ch;
  margin: 0 auto var(--bf-space-8);
  font-size: var(--bf-fs-lead);
  color: var(--bf-text-muted);
  line-height: var(--bf-lh-loose);
}
.bf-home-hero__actions {
  display: flex; gap: var(--bf-space-3);
  justify-content: center; flex-wrap: wrap;
  margin-bottom: var(--bf-space-8);
}
.bf-home-hero__meta {
  display: flex; gap: var(--bf-space-8);
  justify-content: center; flex-wrap: wrap;
  font-size: var(--bf-fs-small); color: var(--bf-text-muted);
  border-top: 1px solid var(--bf-border);
  padding-top: var(--bf-space-6);
}
.bf-home-hero__meta strong {
  color: var(--bf-gray-900);
  font-family: var(--bf-font-display);
  font-size: var(--bf-fs-h5);
  margin-right: 4px;
}

.bf-home-section {
  margin: var(--bf-space-16) 0;
}
.bf-home-section__head {
  text-align: center;
  margin-bottom: var(--bf-space-8);
}
.bf-home-section__head .bf-eyebrow { display: inline-block; margin-bottom: var(--bf-space-2); }
.bf-home-section__head h2 {
  font-family: var(--bf-font-display);
  font-size: var(--bf-fs-h2);
  font-weight: var(--bf-fw-semibold);
  letter-spacing: var(--bf-tracking-tight);
  color: var(--bf-gray-900);
  margin: 0;
  border-top: 0;
  padding-top: 0;
}

.bf-home-clusters {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--bf-space-6);
}
.bf-home-clusters .bf-card { padding: var(--bf-space-8); }
.bf-home-clusters .bf-card .bf-eyebrow { display: block; margin-bottom: var(--bf-space-3); }
.bf-home-clusters .bf-card h3 {
  font-size: var(--bf-fs-h3);
  margin-bottom: var(--bf-space-3);
  color: var(--bf-gray-900);
}
.bf-home-clusters .bf-card p {
  color: var(--bf-text-muted);
  margin-bottom: var(--bf-space-6);
  line-height: var(--bf-lh-loose);
}
@media (max-width: 720px) {
  .bf-home-clusters { grid-template-columns: 1fr; }
}

.bf-home-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--bf-space-6);
}
.bf-home-card {
  background: var(--bf-bg);
  border: 1px solid var(--bf-border);
  border-radius: var(--bf-radius-lg);
  padding: var(--bf-space-6);
  transition: box-shadow var(--bf-duration) var(--bf-ease), transform var(--bf-duration) var(--bf-ease);
  display: flex; flex-direction: column;
}
.bf-home-card:hover {
  box-shadow: var(--bf-shadow-md);
  transform: translateY(-2px);
  border-color: var(--bf-blue-100);
}
.bf-home-card .bf-eyebrow {
  display: block; margin-bottom: var(--bf-space-3);
}
.bf-home-card h3 {
  font-family: var(--bf-font-display);
  font-size: var(--bf-fs-h5);
  line-height: var(--bf-lh-snug);
  margin-bottom: var(--bf-space-3);
}
.bf-home-card h3 a {
  color: var(--bf-gray-900);
  text-decoration: none;
}
.bf-home-card h3 a:hover { color: var(--bf-blue); }
.bf-home-card p {
  flex: 1;
  font-size: var(--bf-fs-small);
  color: var(--bf-text-muted);
  line-height: var(--bf-lh-loose);
  margin-bottom: var(--bf-space-4);
}
.bf-home-card__link {
  font-family: var(--bf-font-mono);
  font-size: var(--bf-fs-caption);
  letter-spacing: var(--bf-tracking-wide);
  text-transform: uppercase;
  color: var(--bf-cyan-600);
  text-decoration: none;
}
.bf-home-card__link:hover { color: var(--bf-blue); }
@media (max-width: 900px) {
  .bf-home-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .bf-home-grid { grid-template-columns: 1fr; }
}

.bf-home-trust {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--bf-space-6);
}
.bf-trust-item {
  background: var(--bf-bg-alt);
  border: 1px solid var(--bf-border);
  border-radius: var(--bf-radius-lg);
  padding: var(--bf-space-6);
  border-left: 3px solid var(--bf-cyan-600);
}
.bf-trust-item h4 {
  font-family: var(--bf-font-display);
  font-size: var(--bf-fs-h5);
  color: var(--bf-blue-900);
  margin-bottom: var(--bf-space-3);
  letter-spacing: var(--bf-tracking-snug);
}
.bf-trust-item p {
  color: var(--bf-text-muted);
  font-size: var(--bf-fs-small);
  line-height: var(--bf-lh-loose);
  margin: 0;
}
.bf-trust-item p a {
  color: var(--bf-cyan-600);
  text-decoration: none;
  font-weight: var(--bf-fw-semibold);
}
.bf-trust-item p a:hover { color: var(--bf-blue); }
@media (max-width: 720px) {
  .bf-home-trust { grid-template-columns: 1fr; }
}

/* Hide WP "Posts" archive H1 on home if static page is set — prevents duplicate hero */
.home .wp-block-query-title { display: none; }
