/*
Theme Name: Prospecting Pilot Child
Template: twentytwentyfive
Version: 1.0.0
Description: Professional blog child theme for Prospecting Pilot
*/

/* ===== BASE ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
}
body { font-family: Inter, system-ui, sans-serif; }

a { color: #2563EB; }
a:hover { color: #1e40af; }

/* ===== TYPOGRAPHY — Gutenberg block classes ===== */
.wp-block-post-content p {
  font-size: 1.125rem;
  line-height: 1.85;
  margin-bottom: 1.5rem;
}
.wp-block-post-title {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.2;
}
.wp-block-post-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
  border-left: 4px solid #10B981;
  padding-left: 1rem;
  margin: 2.5rem 0 1rem;
}
.wp-block-post-content h3 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}
.wp-block-post-content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}
.wp-block-post-content li {
  font-size: 1.125rem;
  line-height: 1.85;
  margin-bottom: 0.5rem;
}
.wp-block-post-content ul,
.wp-block-post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

/* ===== IMAGE HANDLING ===== */
.wp-block-post-content .wp-block-image {
  margin: 2rem auto;
  text-align: center;
}
.wp-block-post-content .wp-block-image img {
  max-width: 100%;
  max-height: 380px;
  height: auto;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.wp-block-post-content .wp-block-image.alignleft {
  float: left;
  margin: 0.5rem 2rem 1rem 0;
  max-width: 45%;
}
.wp-block-post-content .wp-block-image.alignright {
  float: right;
  margin: 0.5rem 0 1rem 2rem;
  max-width: 45%;
}
.wp-block-post-content .wp-block-image.aligncenter,
.wp-block-post-content .wp-block-image.alignnone {
  float: none;
  max-width: 60%;
  margin: 2rem auto;
  display: block;
}
.wp-block-post-content .wp-block-image figcaption {
  font-size: 0.875rem;
  color: #6b7280;
  font-style: italic;
  margin-top: 0.5rem;
  text-align: center;
}
.article-hero-image img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 8px;
}

/* ===== FIRST-IMAGE HERO (replaces wp:post-featured-image) ===== */
.wp-block-post-content > .wp-block-image:first-child img,
.wp-block-post-content > figure.wp-block-image:first-child img {
  max-width: 100%;
  max-height: 420px;
  width: 100%;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: none;
  margin-bottom: 2rem;
}

/* ===== TWO-COLUMN LAYOUT ===== */
.blog-layout {
  align-items: flex-start !important;
}
.blog-sidebar {
  position: sticky;
  /* Header is also position:sticky (top: admin-bar-height, ~80–100px tall, z-index 1000).
     Sidebar must stick BELOW the header or it slides underneath when scrolling. */
  top: calc(var(--wp-admin--admin-bar--height, 0px) + 7.5rem);
}
.sidebar-widget {
  background: #f9fafb;
  border: 2px solid #1f2937;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.sidebar-widget h2,
.sidebar-widget h3 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #374151;
  margin: 0 0 1rem;
  border-left: none;
  padding-left: 0;
}

/* ===== SIDEBAR RECENT POSTS ===== */
.blog-sidebar .wp-block-latest-posts {
  list-style: none;
  padding: 0;
  margin: 0;
}
.blog-sidebar .wp-block-latest-posts li {
  padding: 0.75rem 0;
  border-bottom: 1px solid #e5e7eb;
}
.blog-sidebar .wp-block-latest-posts li:last-child {
  border-bottom: none;
}
.blog-sidebar .wp-block-latest-posts__post-title {
  font-weight: 600;
  font-size: 0.925rem;
  display: block;
  color: #2563EB;
  text-decoration: none;
  margin-bottom: 0.25rem;
}
.blog-sidebar .wp-block-latest-posts__post-title:hover {
  color: #1e40af;
}
.blog-sidebar .wp-block-latest-posts time {
  font-size: 0.8rem;
  color: #6b7280;
}

/* ===== SIDEBAR CATEGORIES ===== */
.blog-sidebar .wp-block-categories {
  list-style: none;
  padding: 0;
  margin: 0;
}
.blog-sidebar .wp-block-categories li {
  padding: 0.4rem 0;
  border-bottom: 1px solid #e5e7eb;
}
.blog-sidebar .wp-block-categories li:last-child {
  border-bottom: none;
}
.blog-sidebar .wp-block-categories a {
  font-weight: 500;
  font-size: 0.925rem;
  color: #2563EB;
  text-decoration: none;
}
.blog-sidebar .wp-block-categories a:hover {
  color: #1e40af;
}

/* ===== POST META ROW ===== */
.post-meta {
  display: flex;
  font-size: 0.875rem;
  color: #6b7280;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.post-meta .wp-block-post-terms a {
  display: inline-block;
  background: #10B981;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  text-decoration: none;
}

/* ===== RELATED POSTS ===== */
.related-post-card {
  background: white;
  border: 2px solid #1f2937;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.related-post-card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}
.related-post-card .wp-block-post-featured-image img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}
/* Padding for the text area below the image. The template wraps the
   terms/title/excerpt in an inner wp-block-group with inline padding,
   but block-library CSS sometimes loses that battle on grid templates,
   so we re-apply it with higher specificity. */
.related-post-card > .wp-block-group,
.related-post-card .wp-block-group:not(:first-child) {
  padding: 1.5rem !important;
}
.related-post-card .wp-block-post-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0.5rem 0 0.75rem;
}
.related-post-card .wp-block-post-title a {
  color: #1f2937;
  text-decoration: none;
}
.related-post-card .wp-block-post-title a:hover {
  color: #2563EB;
}
.related-post-card .wp-block-post-excerpt p,
.related-post-card .wp-block-post-excerpt__excerpt {
  font-size: 0.95rem;
  line-height: 1.55;
  color: #4b5563;
  margin: 0 0 0.75rem;
}
.related-post-card .wp-block-post-excerpt__more-link {
  display: inline-block;
  font-weight: 600;
  font-size: 0.875rem;
  color: #2563EB;
  text-decoration: none;
}
.related-post-card .wp-block-post-excerpt__more-link:hover {
  text-decoration: underline;
}
.related-post-card .wp-block-post-terms a {
  display: inline-block;
  background: #10B981;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ===== BLOG ARCHIVE GRID ===== */
.blog-post-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}
.blog-post-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.blog-post-card .wp-block-post-featured-image img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

/* ===== CODE BLOCKS ===== */
.wp-block-post-content code {
  font-family: 'Courier New', monospace;
  background: #f3f4f6;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  font-size: 0.9em;
}
.wp-block-post-content pre code {
  background: none;
  padding: 0;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
  .wp-block-post-title { font-size: 1.65rem; }
  .wp-block-post-content h2 { font-size: 1.35rem; }
  .wp-block-post-content h3 { font-size: 1.15rem; }

  .blog-layout {
    flex-direction: column !important;
  }
  .wp-block-columns.blog-layout > .wp-block-column {
    flex-basis: 100% !important;
    width: 100% !important;
  }
  .blog-sidebar {
    position: static;
    width: 100%;
  }
  .wp-block-post-content .wp-block-image.alignleft,
  .wp-block-post-content .wp-block-image.alignright {
    float: none;
    max-width: 100%;
    margin: 1.5rem auto;
  }
  .article-hero-image img {
    max-height: 260px;
  }
}


/* ===== FULL-WIDTH HEADER & FOOTER ===== */
/* Reset WordPress root padding CSS variables */
:root,
body {
  --wp--style--root--padding-left: 0px;
  --wp--style--root--padding-right: 0px;
}
.wp-site-blocks {
  /* DO NOT use overflow-x: clip here — it breaks position: sticky */
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-top: 0 !important;
  padding-top: 2rem !important; /* breathing room below sticky header */
}
header,
footer,
header.wp-block-template-part,
footer.wp-block-template-part,
.wp-block-template-part {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box !important;
}
/* ===== STICKY HEADER =====
   WordPress FSE wraps every template part in its own block element, so the
   rendered header looks like:
     <header class="wp-block-template-part">     ← WP-generated wrapper
       <header id="site-header" class="sticky top-0 z-50">  ← from parts/header.html
         ...
       </header>
     </header>
   The original design relied on a `.gs-site-header` wrapper that no code path
   actually creates, so the Tailwind sticky on the inner header was the only
   thing keeping it stuck — and it's fragile because the Tailwind Play CDN
   doesn't always inject utilities for template-part content before paint.
   Stick the *outer* wrapper instead — that's always present and always sized
   to the full chrome height. --wp-admin--admin-bar--height is set by
   WordPress: 32px desktop, 46px mobile, 0px when the admin bar isn't shown. */
html body header.wp-block-template-part {
  position: sticky !important;
  top: var(--wp-admin--admin-bar--height, 0px) !important;
  z-index: 1000 !important;
}
/* Cancel inner header's own sticky so we don't double-stick. The inner
   header should flow normally inside the now-sticky wrapper. */
html body header.wp-block-template-part > header,
html body header.wp-block-template-part header#site-header {
  position: static !important;
  top: auto !important;
  z-index: auto !important;
}
/* Legacy .gs-site-header rules kept as belt-and-suspenders for any markup
   that does add the wrapper (none today, but the AI editor might re-introduce
   it). They duplicate the wp-block-template-part rules above. */
.gs-site-header {
  position: sticky;
  top: var(--wp-admin--admin-bar--height, 0px);
  z-index: 1000;
  width: 100%;
}
.gs-site-header > header,
.gs-site-header header {
  position: static !important;
  top: auto !important;
  z-index: auto !important;
}