/* ==========================================================================
   blog.css — Lapiy Marketing blog-specific styles
   Loaded in addition to style.css on blog pages only.
   Does not modify any existing style.css selectors.
   ========================================================================== */

/* ---------------------------------------------------------------------------
   Post hero (dark green, matches service-hero pattern)
   --------------------------------------------------------------------------- */
.post-hero {
  background: var(--green-deep);
  padding: calc(var(--nav-height) + 3rem) 0 3.5rem;
  position: relative;
  overflow: hidden;
}
.post-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,25,12,0.6) 0%, transparent 60%);
  pointer-events: none;
}
.post-hero .container { position: relative; z-index: 1; }
.post-hero .breadcrumb { margin-bottom: 1.25rem; }
.post-hero .label { margin-bottom: 0.75rem; }
.post-hero h1 {
  color: var(--white);
  font-size: clamp(1.9rem, 4vw, 3rem);
  max-width: 760px;
  margin-bottom: 1.25rem;
}

/* ---------------------------------------------------------------------------
   Post meta (date, author row)
   --------------------------------------------------------------------------- */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
}
.post-meta-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.02em;
}
.post-meta-item svg { flex-shrink: 0; }

/* ---------------------------------------------------------------------------
   Post body layout (single column or TOC + content)
   --------------------------------------------------------------------------- */
.post-body-wrap {
  background: var(--white);
  padding: 4rem 0 2rem;
}
.post-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}
.post-layout--toc {
  grid-template-columns: 240px 1fr;
  gap: 4rem;
  align-items: start;
}

/* ---------------------------------------------------------------------------
   TOC sidebar
   --------------------------------------------------------------------------- */
.post-toc-col {
  position: sticky;
  top: calc(var(--nav-height) + 1.5rem);
}
.toc {
  background: var(--off-white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}
.toc-label {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.75rem;
}
.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  counter-reset: none;
}
.toc-list li a {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--grey-dark);
  line-height: 1.3;
  display: block;
  transition: color var(--transition);
  padding: 0.2rem 0;
}
.toc-list li a:hover { color: var(--green); }
.toc-list li.toc-sub a {
  padding-left: 0.85rem;
  font-weight: 500;
  color: var(--grey-mid);
}
.toc-list li.toc-sub a:hover { color: var(--green); }
.toc-pillar-link {
  padding: 0.75rem 0 0;
  border-top: 1px solid var(--grey-light);
}
.toc-pillar-link .btn-ghost {
  font-size: 0.82rem;
}

/* ---------------------------------------------------------------------------
   Post prose (article body)
   --------------------------------------------------------------------------- */
.post-content {
  max-width: var(--content-max);
  min-width: 0;
}

/* Headings */
.post-content h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  color: var(--green-deep);
  margin: 2.5rem 0 0.85rem;
  padding-top: 0.5rem;
}
.post-content h3 {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  color: var(--green-dark);
  margin: 2rem 0 0.7rem;
}
.post-content h4 {
  font-size: 1rem;
  color: var(--grey-dark);
  margin: 1.5rem 0 0.6rem;
}

/* Body copy */
.post-content p { margin-bottom: 1.25rem; }
.post-content p:last-child { margin-bottom: 0; }

/* Lists */
.post-content ul,
.post-content ol {
  margin: 1rem 0 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li { font-size: 1rem; color: var(--grey-dark); line-height: 1.7; }

/* Blockquote */
.post-content blockquote {
  border-left: 3px solid var(--green);
  background: var(--green-light);
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}
.post-content blockquote p {
  color: var(--green-dark);
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 0;
}

/* Code */
.post-content code {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.88em;
  background: var(--grey-light);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  color: var(--green-dark);
}
.post-content pre {
  background: var(--green-deep);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}
.post-content pre code {
  background: none;
  color: rgba(255,255,255,0.85);
  padding: 0;
  font-size: 0.88rem;
  line-height: 1.65;
}

/* Horizontal rule */
.post-content hr {
  border: none;
  border-top: 1px solid var(--grey-light);
  margin: 2.5rem 0;
}

/* Links in body */
.post-content a {
  color: var(--green-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition);
}
.post-content a:hover { color: var(--green); }

/* Images */
.post-content img {
  border-radius: var(--radius-lg);
  margin: 1.5rem 0;
}

/* ---------------------------------------------------------------------------
   FAQ section (inside post-content)
   --------------------------------------------------------------------------- */
.post-faq {
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--grey-light);
}
.post-faq h2 {
  margin-top: 0;
}
.faq-item {
  border-bottom: 1px solid var(--grey-light);
}
.faq-q {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--green-dark);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  gap: 1rem;
}
.faq-q::after {
  content: '+';
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--green);
  flex-shrink: 0;
  transition: transform var(--transition);
}
.faq-item.open .faq-q::after {
  transform: rotate(45deg);
}
.faq-a {
  display: none;
  padding: 0 0 1rem;
}
.faq-item.open .faq-a { display: block; }
.faq-a p { margin-bottom: 0; }

/* ---------------------------------------------------------------------------
   Pillar link (bottom of post)
   --------------------------------------------------------------------------- */
.post-pillar-link {
  margin-top: 2.5rem;
  padding: 1rem 1.25rem;
  background: var(--green-light);
  border-radius: var(--radius);
  border-left: 3px solid var(--green);
}
.post-pillar-link p {
  font-size: 0.88rem;
  color: var(--green-dark);
  margin: 0;
}
.post-pillar-link a {
  color: var(--green-dark);
  font-weight: 700;
}
.post-pillar-link a:hover { color: var(--green); }

/* ---------------------------------------------------------------------------
   Blog post CTA section
   --------------------------------------------------------------------------- */
.post-cta-section {
  background: var(--green-dark);
  padding: 5rem 0;
}
.post-cta-inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}
.post-cta-inner .label { margin-bottom: 0.75rem; }
.post-cta-inner h2 {
  color: var(--white);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 1rem;
}
.post-cta-inner p {
  color: rgba(255,255,255,0.7);
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* ---------------------------------------------------------------------------
   Blog card grid (index + category + related posts)
   --------------------------------------------------------------------------- */
.blog-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: all var(--transition);
  text-decoration: none;
}
.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--green);
}
.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}
.blog-card-cat {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--green);
  background: var(--green-light);
  padding: 0.2rem 0.55rem;
  border-radius: 2px;
}
.blog-card-meta time {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--grey-mid);
}
.blog-card h2,
.blog-card h3 {
  font-size: 1.1rem;
  color: var(--green-dark);
  margin-bottom: 0.6rem;
  line-height: 1.25;
  flex-grow: 0;
}
.blog-card p {
  font-size: 0.88rem;
  line-height: 1.6;
  flex-grow: 1;
  margin-bottom: 1.25rem;
}
.blog-card-cta {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--green);
  margin-top: auto;
}
.blog-card-cta .arrow { transition: transform var(--transition); }
.blog-card:hover .blog-card-cta .arrow { transform: translateX(4px); }

/* ---------------------------------------------------------------------------
   Filter strip (category pills)
   --------------------------------------------------------------------------- */
.blog-filter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
  padding-top: 0.25rem;
}
.blog-filter-pill {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.45rem 1rem;
  border-radius: 100px;
  border: 1px solid var(--grey-light);
  background: var(--white);
  color: var(--grey-dark);
  transition: all var(--transition);
  text-decoration: none;
}
.blog-filter-pill:hover,
.blog-filter-pill.active {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}

/* ---------------------------------------------------------------------------
   Post hero image (optional, below meta row)
   --------------------------------------------------------------------------- */
.post-hero-img {
  margin-top: 2rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-height: 420px;
}
.post-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------------------------------------------------------------------------
   Author block (below prose, above FAQ)
   --------------------------------------------------------------------------- */
.post-author {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
  padding: 1.25rem 1.5rem;
  background: var(--off-white);
  border: 1px solid var(--grey-light);
  border-radius: var(--radius-lg);
}
.post-author-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--grey-light);
}
.post-author-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.post-author-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.post-author-name {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--green-dark);
}
.post-author-title {
  font-size: 0.8rem;
  color: var(--grey-mid);
  line-height: 1.4;
}

/* ---------------------------------------------------------------------------
   Category tags (foot of post)
   --------------------------------------------------------------------------- */
.post-category-tags {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--grey-light);
}
.post-category-tags-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grey-mid);
}
.post-category-tag {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green-dark);
  background: var(--green-light);
  padding: 0.25rem 0.65rem;
  border-radius: 2px;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.post-category-tag:hover {
  background: var(--green);
  color: var(--white);
}

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .post-layout--toc {
    grid-template-columns: 200px 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 768px) {
  .post-layout--toc {
    grid-template-columns: 1fr;
  }
  .post-toc-col {
    position: static;
    order: -1;
  }
  .toc {
    margin-bottom: 2rem;
  }
  .blog-card-grid {
    grid-template-columns: 1fr;
  }
  .post-content {
    max-width: 100%;
  }
  .post-meta {
    gap: 0.85rem;
  }
}
