/* =============================================================
   AMERICAL PATROL, BLOG STYLES
   Appends to global.css
   Targets GHL blog pages: /apblog and /post/* URLs
   Uses broad attribute selectors since GHL blog class names
   are not fully predictable.
   ============================================================= */


/* ── Blog index page (/apblog) ── */
.blog-listing-page,
[class*="blog-listing"],
[class*="blog-index"] {
  background: var(--off-white);
  font-family: var(--font-body);
}


/* ── Blog post cards ── */
[class*="blog-card"],
[class*="post-card"] {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
[class*="blog-card"]:hover,
[class*="post-card"]:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
}


/* ── Blog post page (/post/*) ── */
[class*="blog-post"],
[class*="post-content"],
article.post {
  font-family: var(--font-body);
  color: var(--gray-500);
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}


/* ── Blog headings ── */
[class*="blog-post"] h1,
[class*="post-content"] h1,
article.post h1 {
  font-family: var(--font-display);
  color: var(--navy-950);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
}

[class*="blog-post"] h2,
[class*="post-content"] h2,
article.post h2 {
  font-family: var(--font-display);
  color: var(--navy-800);
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 600;
  margin-top: 40px;
  margin-bottom: 12px;
}

[class*="blog-post"] h3,
[class*="post-content"] h3,
article.post h3 {
  font-family: var(--font-display);
  color: var(--navy-700, #153258);
  font-size: 1.15rem;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 8px;
}


/* ── Blog body text ── */
[class*="blog-post"] p,
[class*="post-content"] p,
article.post p {
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--navy-800);
  margin-bottom: 20px;
}


/* ── Blog lists ── */
[class*="blog-post"] ul,
[class*="post-content"] ul,
article.post ul {
  padding-left: 24px;
  margin-bottom: 20px;
}
[class*="blog-post"] li,
[class*="post-content"] li,
article.post li {
  font-family: var(--font-body);
  line-height: 1.7;
  color: var(--navy-800);
  margin-bottom: 6px;
}


/* ── Blog CTA button (inline CTAs in posts) ── */
[class*="blog-post"] a.btn,
[class*="post-content"] a.btn {
  display: inline-block;
  background: var(--navy-600);
  color: var(--white);
  padding: 12px 24px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}
[class*="blog-post"] a.btn:hover,
[class*="post-content"] a.btn:hover {
  background: var(--navy-400);
}


/* ── Blog page background ── */
body.blog-page,
body[class*="blog"] {
  background: var(--off-white);
}


/* ── Blog post meta (date, author) ── */
[class*="post-meta"],
[class*="blog-meta"] {
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--gray-400, #8892a4);
  margin-bottom: 32px;
}


/* ── Blog category tag ── */
[class*="post-category"],
[class*="blog-category"] {
  display: inline-block;
  background: var(--navy-100, #c8d9f0);
  color: var(--navy-700, #153258);
  padding: 4px 12px;
  border-radius: 20px;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}


/* ── Blog featured image ── */
[class*="post-featured-image"] img,
[class*="blog-featured-image"] img {
  border-radius: 12px;
  width: 100%;
  height: auto;
  margin-bottom: 32px;
}


/* ── Blog index header section ── */
[class*="blog-listing"] .blog-header,
[class*="blog-index"] .blog-header {
  background: linear-gradient(135deg, var(--navy-950) 0%, var(--navy-800) 60%, var(--navy-600) 100%);
  padding: 72px 24px 64px;
  text-align: center;
}
[class*="blog-listing"] .blog-header h1,
[class*="blog-index"] .blog-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
}
[class*="blog-listing"] .blog-header p,
[class*="blog-index"] .blog-header p {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--gray-300);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}


/* ── Blog post inline blockquote ── */
[class*="blog-post"] blockquote,
[class*="post-content"] blockquote,
article.post blockquote {
  border-left: 4px solid var(--navy-400);
  background: var(--gray-100);
  margin: 28px 0;
  padding: 20px 24px;
  border-radius: 0 8px 8px 0;
}
[class*="blog-post"] blockquote p,
[class*="post-content"] blockquote p,
article.post blockquote p {
  font-style: italic;
  color: var(--navy-700, #153258);
  margin-bottom: 0;
  font-size: 1rem;
}


/* ── Blog post inline CTA box ── */
[class*="blog-post"] .cta-box,
[class*="post-content"] .cta-box {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-600));
  border-radius: 12px;
  padding: 32px 28px;
  margin: 36px 0;
  text-align: center;
}
[class*="blog-post"] .cta-box h3,
[class*="post-content"] .cta-box h3 {
  font-family: var(--font-display);
  color: var(--white);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
}
[class*="blog-post"] .cta-box p,
[class*="post-content"] .cta-box p {
  color: var(--gray-300);
  font-size: 0.95rem;
  margin-bottom: 20px;
}


/* ── Blog post reading progress indicator ── */
.blog-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--navy-400);
  z-index: 9999;
  transition: width 0.1s linear;
  pointer-events: none;
}


/* ── Blog post table ── */
[class*="blog-post"] table,
[class*="post-content"] table,
article.post table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-family: var(--font-body);
  font-size: 0.9rem;
}
[class*="blog-post"] th,
[class*="post-content"] th,
article.post th {
  background: var(--navy-800);
  color: var(--white);
  padding: 10px 16px;
  text-align: left;
  font-family: var(--font-display);
  font-weight: 600;
}
[class*="blog-post"] td,
[class*="post-content"] td,
article.post td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-500);
}
[class*="blog-post"] tr:nth-child(even) td,
[class*="post-content"] tr:nth-child(even) td,
article.post tr:nth-child(even) td {
  background: var(--gray-100);
}


/* ── Responsive: blog post ── */
@media (max-width: 768px) {
  [class*="blog-post"],
  [class*="post-content"],
  article.post {
    padding: 0 16px;
  }
  [class*="blog-post"] h1,
  [class*="post-content"] h1,
  article.post h1 {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }
  [class*="blog-post"] h2,
  [class*="post-content"] h2,
  article.post h2 {
    font-size: clamp(1.15rem, 5vw, 1.5rem);
  }
  [class*="blog-post"] .cta-box,
  [class*="post-content"] .cta-box {
    padding: 24px 20px;
  }
}


/* ── Post page chrome (appended by build_blog.py) ────────────────── */
/* Reset off-white background applied to body.blog-page so post pages
   sit on white like the rest of the AP site. */
body:has(.ap-blog-post) { background: var(--white); }

.ap-blog-post {
  font-family: var(--font-body);
  color: var(--gray-500);
}

/* ── Post header (editorial style) ────────────────────────────────
   White background, dark text, left-aligned, narrow column.
   Hero image sits BELOW the title block (magazine longform pattern). */
.ap-blog-post .post-header {
  background: var(--white);
  color: var(--navy-950);
  padding: 56px 0 32px;
}
.ap-blog-post .post-header > .container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

.ap-blog-post .post-header .breadcrumbs {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--gray-400);
  letter-spacing: 0.01em;
  margin-bottom: 24px;
}
.ap-blog-post .post-header .breadcrumbs a {
  color: var(--gray-500);
  text-decoration: none;
  transition: color 0.18s;
}
.ap-blog-post .post-header .breadcrumbs a:hover { color: var(--navy-700); }
.ap-blog-post .post-header .breadcrumbs .sep {
  margin: 0 6px;
  color: var(--gray-300);
}

.ap-blog-post .post-header .post-category {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy-700);
  background: rgba(28, 66, 112, 0.05);
  border: 1px solid rgba(28, 66, 112, 0.14);
  border-radius: 20px;
  padding: 5px 14px;
  margin-bottom: 20px;
}

.ap-blog-post .post-header h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.85rem, 4vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--navy-950);
  margin: 0 0 16px;
}

.ap-blog-post .post-header .post-dek {
  font-family: var(--font-body);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.55;
  color: var(--gray-600);
  margin: 0 0 28px;
  max-width: 640px;
  font-weight: 400;
}

.ap-blog-post .post-header .post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--gray-400);
}
.ap-blog-post .post-header .post-author {
  color: var(--navy-800);
  font-weight: 600;
}
.ap-blog-post .post-header .post-meta-sep { color: var(--gray-300); }

/* ── Hero image (below the header, magazine-style) ─────────────── */
.ap-blog-post .post-hero-img {
  max-width: 1100px;
  margin: 8px auto 0;
  padding: 0 24px;
}
.ap-blog-post .post-hero-img img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: 8px;
}

/* ── Body wrapper — typography itself comes from blog-styles.css ─ */
.ap-blog-post > .container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}
.ap-blog-post .post-body {
  padding: 40px 0 24px;
}
/* Thin divider between hero img and body, like Medium */
.ap-blog-post .post-hero-img + .container .post-body {
  border-top: 1px solid var(--gray-200);
  padding-top: 40px;
  margin-top: 40px;
}

/* ── Inline CTA box ───────────────────────────────────────────── */
.ap-blog-post .cta-box.inline {
  background: linear-gradient(135deg, var(--off-white) 0%, var(--gray-100) 100%);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 36px;
  margin: 16px 0 72px;
  text-align: center;
}
.ap-blog-post .cta-box.inline h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.25;
  color: var(--navy-900);
  margin: 0 0 8px;
}
.ap-blog-post .cta-box.inline p {
  font-family: var(--font-body);
  color: var(--gray-500);
  margin: 0 0 22px;
}
.ap-blog-post .cta-box.inline .btn-group {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ap-blog-post .cta-box.inline .btn-primary,
.ap-blog-post .cta-box.inline .btn-outline {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 13px 24px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.18s;
}
.ap-blog-post .cta-box.inline .btn-primary {
  background: var(--navy-800);
  color: var(--white);
}
.ap-blog-post .cta-box.inline .btn-primary:hover {
  background: var(--navy-600);
  transform: translateY(-1px);
}
.ap-blog-post .cta-box.inline .btn-outline {
  background: transparent;
  border: 1px solid var(--navy-800);
  color: var(--navy-800);
}
.ap-blog-post .cta-box.inline .btn-outline:hover {
  background: var(--navy-800);
  color: var(--white);
  transform: translateY(-1px);
}

/* ── Related posts grid ────────────────────────────────────────── */
.related-posts {
  background: var(--off-white);
  padding: 72px 0;
  border-top: 1px solid var(--gray-200);
}
.related-posts > .container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}
.related-posts h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  color: var(--navy-900);
  margin: 0 0 28px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.related-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s, box-shadow 0.18s;
}
.related-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(5, 14, 26, 0.08);
}
.related-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}
.related-card-body { padding: 16px 18px 20px; }
.related-card-category {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--navy-400);
  margin-bottom: 8px;
}
.related-card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.35;
  color: var(--navy-900);
  margin-bottom: 6px;
}
.related-card-date {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--gray-400);
}

/* Placeholder blocks for posts without a per-post hero photo */
.related-card-img-placeholder,
.card-img-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 70%, var(--navy-500) 100%);
  background-image:
    radial-gradient(circle at 18% 22%, rgba(90, 154, 216, 0.18) 0, transparent 38%),
    linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 70%, var(--navy-500) 100%);
  display: block;
}
.blog-card .card-img-placeholder { aspect-ratio: 16 / 10; }

@media (max-width: 640px) {
  .ap-blog-post .post-header { padding: 40px 0 24px; }
  .ap-blog-post .post-header h1 { font-size: 1.65rem; }
  .ap-blog-post .post-header .post-dek { font-size: 1rem; margin-bottom: 22px; }
  .ap-blog-post .post-body { padding: 32px 0 20px; }
  .ap-blog-post .cta-box.inline { padding: 28px 22px; }
  .related-posts { padding: 56px 0; }
}
