/* ===========================================================
   blog.css — Ecom Guide blog (/blog + article pages)
   Editorial / magazine treatment, built on the landing tokens.
   Mobile-first.
   =========================================================== */

/* ---------- shared bits ---------- */
.bl-mono {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--copper);
  line-height: 1;
}

.bl-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}
.bl-meta time { font-weight: 500; color: var(--ink); }
.bl-author { text-transform: none; }
.bl-dot { color: var(--copper); }

.bl-readmore {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--copper);
  padding-bottom: 3px;
  width: max-content;
}
.bl-readmore svg { transition: transform var(--t-fast); }
.bl-readmore:hover { color: var(--copper); }
.bl-readmore:hover svg { transform: translateX(4px); }
.bl-readmore--back:hover svg { transform: translateX(-4px); }

/* a horizontal rule with a centered label */
.bl-section-rule {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: clamp(40px, 6vw, 72px) 0 clamp(28px, 4vw, 44px);
}
.bl-section-rule::before,
.bl-section-rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(17, 17, 17, 0.16);
}
.bl-section-rule span {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* =====================================================
   BLOG INDEX  (/blog)
   ===================================================== */
.blog-hero h1 { text-transform: none; }
.blog-hero .display-italic { color: var(--copper); }

.blog-list-section { background: var(--bg); }

/* ---- featured "cover story" ---- */
.bl-featured {
  display: grid;
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
}
.bl-featured-media {
  display: block;
  position: relative;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  border-radius: 4px;
  background: var(--bg-2);
}
.bl-featured-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
}
.bl-featured:hover .bl-featured-media img { transform: scale(1.04); }

.bl-featured-tag { color: var(--copper); display: inline-block; margin-bottom: 14px; }
.bl-featured-title {
  font-family: var(--serif);
  font-weight: 400;
  text-transform: none;
  line-height: 1.04;
  letter-spacing: -0.005em;
  font-size: clamp(2rem, 1.2rem + 3.6vw, 3.6rem);
  margin: 0 0 16px;
}
.bl-featured-title a { background-image: linear-gradient(var(--copper), var(--copper)); background-size: 0% 1px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size var(--t-mid); }
.bl-featured-title a:hover { background-size: 100% 1px; }
.bl-featured-body .bl-meta { margin-bottom: 16px; }
.bl-featured-excerpt {
  font-family: var(--sans);
  font-size: clamp(1rem, 0.94rem + 0.3vw, 1.12rem);
  color: var(--ink-soft);
  line-height: 1.62;
  max-width: 52ch;
  margin: 0 0 26px;
}

/* ---- card grid ---- */
.bl-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 4vw, 40px);
}

.bl-card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-radius: 6px;
  overflow: hidden;
  transition: transform var(--t-mid), box-shadow var(--t-mid), border-color var(--t-mid);
}
.bl-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 26px 50px -28px rgba(17, 17, 17, 0.4);
  border-color: rgba(186, 145, 107, 0.5);
}
.bl-card-media {
  display: block;
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-2);
}
.bl-card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
}
.bl-card:hover .bl-card-media img { transform: scale(1.05); }

.bl-card-media--empty {
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 120% at 80% 0%, rgba(186,145,107,0.18), transparent 60%),
    var(--bg-2);
}
.bl-card-media--empty .bl-mono { font-size: clamp(2.4rem, 8vw, 3.4rem); }

.bl-card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(20px, 3vw, 28px);
  flex: 1;
}
.bl-card-title {
  font-family: var(--serif);
  font-weight: 400;
  text-transform: none;
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.7rem);
  line-height: 1.16;
  margin: 0;
}
.bl-card-title a:hover { color: var(--copper); }
.bl-card-excerpt {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0;
}
.bl-card .bl-readmore { margin-top: auto; padding-top: 4px; }

/* ---- empty state ---- */
.bl-empty {
  text-align: center;
  max-width: 560px;
  margin-inline: auto;
  padding: clamp(30px, 6vw, 60px) 0;
}
.bl-empty .bl-mono { font-size: clamp(3.4rem, 12vw, 5rem); display: block; margin-bottom: 18px; }
.bl-empty h2 { margin: 0 0 14px; text-transform: none; }
.bl-empty .lead { margin: 0 auto 28px; }

/* ---- pagination ---- */
.bl-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: clamp(44px, 6vw, 72px);
}
.bl-page {
  min-width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  border: 1px solid rgba(17, 17, 17, 0.18);
  border-radius: 999px;
  color: var(--ink);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.bl-page:hover { border-color: var(--ink); }
.bl-page--current {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}
.bl-page--nav { text-transform: uppercase; font-size: 11px; letter-spacing: 0.14em; font-weight: 600; }

/* =====================================================
   ARTICLE  (/blog/{slug})
   ===================================================== */
.article-hero {
  background: var(--dark);
  color: var(--white);
  padding: clamp(130px, 17vw, 200px) 0 clamp(48px, 8vw, 96px);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.article-hero::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -40%;
  width: 80vw; height: 80vw;
  max-width: 900px; max-height: 900px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(186,145,107,0.16), transparent 62%);
  pointer-events: none;
}
.article-hero > * { position: relative; z-index: 1; }

.article-crumbs {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white-soft);
  margin-bottom: 26px;
}
.article-crumbs a:hover { color: var(--copper); }
.article-crumbs span[aria-hidden] { color: rgba(255,255,255,0.34); }
.article-crumbs-current {
  max-width: 24ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--white-soft);
}

.article-kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 18px;
}
.article-title {
  text-transform: none;
  color: var(--white);
  font-size: clamp(2.1rem, 1.2rem + 4.4vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 auto;
  max-width: 20ch;
}
.article-standfirst {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.5rem);
  line-height: 1.5;
  color: var(--white-soft);
  max-width: 44ch;
  margin: 22px auto 0;
}

.article-byline {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  text-align: left;
}
.article-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(150deg, var(--copper), #8f6c4c);
  color: var(--white);
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
}
.article-byline-text { display: flex; flex-direction: column; line-height: 1.3; }
.article-byline-name {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--white);
}
.article-byline-role {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--white-soft);
}

/* ---- cover figure, pulled up over the dark hero ---- */
.article-cover {
  margin: 0;
  background: linear-gradient(var(--dark) 50%, var(--bg) 50%);
}
.article-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 4px;
}

/* ---- reading shell ---- */
.article-shell {
  background: var(--bg);
  padding: clamp(40px, 6vw, 72px) 0 clamp(20px, 4vw, 40px);
}
.blog-article:not(:has(.article-cover)) .article-shell { padding-top: clamp(48px, 7vw, 88px); }

.article-body {
  max-width: 720px;
  margin-inline: auto;
  font-family: var(--sans);
  font-size: clamp(1.04rem, 1rem + 0.25vw, 1.18rem);
  line-height: 1.78;
  color: #1c1c1c;
}
.article-body > *:first-child { margin-top: 0; }
.article-body p { margin: 0 0 1.35em; }
.article-body h2,
.article-body h3,
.article-body h4 {
  font-family: var(--serif);
  font-weight: 400;
  text-transform: none;
  letter-spacing: -0.005em;
  color: var(--ink);
  line-height: 1.18;
}
.article-body h2 { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem); margin: 1.7em 0 0.55em; }
.article-body h3 { font-size: clamp(1.35rem, 1.15rem + 1vw, 1.75rem); margin: 1.5em 0 0.5em; }
.article-body h4 { font-size: 1.2rem; margin: 1.4em 0 0.5em; }
.article-body a {
  color: #8a6240;
  text-decoration: underline;
  text-decoration-color: rgba(186, 145, 107, 0.5);
  text-underline-offset: 3px;
}
.article-body a:hover { color: var(--copper); text-decoration-color: var(--copper); }
.article-body strong { font-weight: 600; color: var(--ink); }
.article-body em { font-style: italic; }
.article-body ul,
.article-body ol { margin: 0 0 1.35em; padding-left: 1.4em; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: 0.5em; padding-left: 0.2em; }
.article-body li::marker { color: var(--copper); }
.article-body img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1.8em 0;
}
.article-body figure { margin: 1.8em 0; }
.article-body figcaption {
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-align: center;
  margin-top: 8px;
}
.article-body blockquote {
  margin: 1.8em 0;
  padding: 6px 0 6px 30px;
  border-left: 3px solid var(--copper);
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.6rem);
  line-height: 1.42;
  color: var(--ink);
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body hr {
  border: 0;
  height: 1px;
  background: rgba(17, 17, 17, 0.14);
  margin: 2.4em 0;
}
.article-body pre {
  background: var(--dark);
  color: #f4f1ec;
  padding: 18px 20px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.9rem;
  margin: 1.6em 0;
}
.article-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--bg-2);
  padding: 2px 6px;
  border-radius: 4px;
}
.article-body pre code { background: none; padding: 0; }

/* ---- inline mid-article CTA (inserted by blog.js) ---- */
.article-inline-cta {
  max-width: 720px;
  margin: 2.4em auto;
  padding: 22px 26px;
  display: flex;
  align-items: center;
  gap: 18px 22px;
  flex-wrap: wrap;
  background: var(--ink);
  color: var(--white);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}
.article-inline-cta::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--accent);
}
.article-inline-cta-text { flex: 1 1 240px; }
.article-inline-cta-text strong {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.25rem;
  display: block;
  margin-bottom: 3px;
}
.article-inline-cta-text span {
  font-family: var(--sans);
  font-size: 0.86rem;
  color: var(--white-soft);
}
.article-inline-cta .btn { flex: 0 0 auto; }

/* ---- article foot ---- */
.article-foot {
  max-width: 720px;
  margin: clamp(30px, 5vw, 52px) auto 0;
  padding-top: 22px;
  border-top: 1px solid rgba(17, 17, 17, 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.article-updated {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.blog-related { background: var(--bg); }
.blog-related .bl-section-rule { margin-top: 0; }

/* =====================================================
   COURSE CTA  (partials/blog-cta.php)
   ===================================================== */
.blog-course-cta {
  background: var(--bg);
  padding: clamp(20px, 5vw, 56px) 0;
}
.bcc-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(28px, 4vw, 56px);
  background: var(--dark);
  color: var(--white);
  border-radius: 12px;
  padding: clamp(34px, 6vw, 72px) clamp(24px, 5vw, 76px);
}
.bcc-glow {
  position: absolute;
  top: -30%; right: -10%;
  width: 60vw; max-width: 620px;
  aspect-ratio: 1;
  background: radial-gradient(circle, rgba(253, 226, 114, 0.16), transparent 65%);
  pointer-events: none;
}
.bcc-body { position: relative; z-index: 1; flex: 1 1 auto; min-width: 0; max-width: 640px; }
.bcc-eyebrow { color: var(--accent); display: inline-block; margin-bottom: 18px; }
.bcc-title {
  text-transform: none;
  color: var(--white);
  font-size: clamp(1.8rem, 1.2rem + 2.6vw, 3.2rem);
  line-height: 1.08;
  margin: 0 0 18px;
}
.bcc-title .display-italic { color: var(--accent); }
.bcc-text {
  font-family: var(--sans);
  font-size: clamp(0.98rem, 0.93rem + 0.25vw, 1.1rem);
  line-height: 1.62;
  color: var(--white-soft);
  margin: 0 0 24px;
}
.bcc-text strong { color: var(--white); font-weight: 600; }
.bcc-points {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin: 0 0 30px;
}
.bcc-points li {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white-soft);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.bcc-points span {
  font-family: var(--serif);
  font-size: 2rem;
  letter-spacing: 0;
  color: var(--accent);
  line-height: 1;
}
.bcc-actions {
  display: flex;
  align-items: center;
  gap: 18px 24px;
  flex-wrap: wrap;
}
.bcc-btn { gap: 12px; }
.bcc-price {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--white-soft);
}
.bcc-price s { opacity: 0.6; }
.bcc-price strong { color: var(--accent); font-size: 1.05rem; }

/* Founder photo — full-height panel filling the right side of the card. */
.bcc-figure {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  align-self: stretch;
  width: clamp(260px, 30vw, 400px);
  min-height: 320px;
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 28px 64px -28px rgba(0, 0, 0, 0.75);
}
.bcc-figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 80% center;
}

/* Mobile: stack the card, photo centered above the text. */
@media (max-width: 860px) {
  .bcc-card {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }
  .bcc-body { max-width: none; }
  .bcc-figure {
    order: -1;
    align-self: center;
    width: clamp(200px, 60vw, 300px);
    min-height: 0;
  }
  .bcc-figure img {
    height: auto;
    aspect-ratio: 1 / 1;
    object-position: center;
  }
}

/* The `.reveal` load animation is defined globally in style.css — reused as-is. */

/* ---- reading progress bar (article pages, added by blog.js) ---- */
.reading-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 200;
  pointer-events: none;
  background: transparent;
}
.reading-progress span {
  display: block;
  height: 100%;
  background: var(--copper);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.12s linear;
}

/* =====================================================
   RESPONSIVE — tablet & up
   ===================================================== */
@media (min-width: 640px) {
  .bl-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
  .article-byline { gap: 14px; }
}
@media (min-width: 900px) {
  .bl-featured {
    grid-template-columns: 1.05fr 0.95fr;
  }
  .bl-featured-media { aspect-ratio: 4 / 3; }
  .article-inline-cta { flex-wrap: nowrap; }
}
@media (min-width: 1040px) {
  .bl-grid { grid-template-columns: repeat(3, 1fr); }
}

/* =====================================================
   reduced motion
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
  .bl-card:hover { transform: none; }
  .bl-card:hover .bl-card-media img,
  .bl-featured:hover .bl-featured-media img { transform: none; }
}
