/* ═══════════════════════════════════════════════════════════════
   BLOG POST — Individual Post Styles
   Scoped to post-template.html and all blog post pages
   ═══════════════════════════════════════════════════════════════ */

/* ── Reading progress bar ── */
#bp-progress-wrap {
  position: fixed;
  top: 80px; /* sits just below fixed header */
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(0,0,0,.08);
  z-index: 998;
}
#bp-progress {
  height: 100%;
  width: 0%;
  background: var(--gold);
  transition: width .1s linear;
}

/* ── Post hero ── */
.bp-hero {
  background: var(--black);
  padding: 160px 0 80px;
  position: relative;
  overflow: hidden;
}
.bp-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196,162,101,.25), transparent);
}
.bp-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--g5);
  margin-bottom: 40px;
  transition: color .3s;
}
.bp-back:hover { color: var(--cream); }

/* Breadcrumb */
.bp-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.bp-breadcrumb a {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--g5);
  transition: color .3s;
}
.bp-breadcrumb a:hover { color: var(--cream); }
.bp-breadcrumb span[aria-hidden] {
  font-size: 12px;
  color: rgba(255,255,255,.2);
}
.bp-breadcrumb > span:not([aria-hidden]) {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
}

.bp-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
}
.bp-hero h1 {
  font-family: var(--serif);
  font-size: clamp(34px, 4.5vw, 62px);
  font-weight: 400;
  color: var(--cream);
  line-height: 1.1;
  margin-bottom: 20px;
  max-width: 840px;
}
.bp-hero-sub {
  font-size: 18px;
  font-weight: 300;
  color: rgba(255,255,255,.5);
  line-height: 1.75;
  max-width: 680px;
  margin-bottom: 36px;
}
.bp-meta {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  padding-top: 28px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.bp-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bp-meta-item label {
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--g5);
}
.bp-meta-item span {
  font-size: 14px;
  color: var(--cream);
}
.bp-divider-v {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,.1);
}

/* ── Cover image (full-width, legacy) ── */
.bp-cover {
  width: 100%;
  max-height: 560px;
  object-fit: cover;
  display: block;
}

/* ── Cover image (inline, above article body) ── */
.bp-cover-inline {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
  border-radius: 5px;
  margin-bottom: 40px;
}

/* ── Main layout: article + sidebar ── */
.bp-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 80px;
  align-items: start;
  padding: 96px 0 120px;
}

/* ── Article body typography ── */
.bp-body {
  min-width: 0; /* prevent grid overflow */
}
.bp-body h2 {
  font-family: var(--serif);
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 400;
  color: var(--black);
  margin: 56px 0 16px;
  line-height: 1.2;
  scroll-margin-top: 120px;
}
.bp-body h3 {
  font-family: var(--serif);
  font-size: clamp(18px, 1.8vw, 24px);
  font-weight: 400;
  color: var(--black);
  margin: 40px 0 12px;
  line-height: 1.3;
  scroll-margin-top: 120px;
}
.bp-body p {
  font-size: 17px;
  line-height: 1.9;
  color: var(--g6);
  margin-bottom: 24px;
}
.bp-body ul,
.bp-body ol {
  margin: 0 0 24px 24px;
}
.bp-body li {
  font-size: 17px;
  line-height: 1.85;
  color: var(--g6);
  margin-bottom: 8px;
}
.bp-body strong { color: var(--black); font-weight: 700; }
.bp-body a { color: var(--gold); text-decoration: underline; transition: color .3s; }
.bp-body a:hover { color: var(--black); }

/* Data table */
.bp-table-wrap {
  overflow-x: auto;
  margin: 32px 0;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}
.bp-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  font-family: var(--sans);
}
.bp-table-wrap thead tr {
  background: var(--black);
  color: #fff;
}
.bp-table-wrap thead th {
  padding: 14px 20px;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.bp-table-wrap thead th:first-child { text-align: left; }
.bp-table-wrap tbody tr:nth-child(even) { background: var(--cream-light); }
.bp-table-wrap tbody tr:nth-child(odd) { background: #fff; }
.bp-table-wrap tbody tr:hover { background: #f0ece4; }
.bp-table-wrap tbody td {
  padding: 12px 20px;
  text-align: center;
  border-bottom: 1px solid #e8e3d8;
  color: var(--black);
}
.bp-table-wrap tbody td:first-child {
  text-align: left;
  font-weight: 700;
}

/* Pullquote */
.bp-quote {
  border-left: 3px solid var(--gold);
  padding: 20px 32px;
  margin: 40px 0;
  background: var(--cream-light);
}
.bp-quote p {
  font-family: var(--serif);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.6;
  color: var(--black);
  font-style: italic;
  margin: 0;
}

/* Inline image caption */
.bp-fig {
  margin: 40px 0;
}
.bp-fig img {
  width: 100%;
  display: block;
}
.bp-fig figcaption {
  font-size: 13px;
  color: var(--g4);
  margin-top: 10px;
  text-align: center;
}

/* Key takeaways box */
.bp-takeaways {
  background: var(--black);
  padding: 40px 44px;
  margin: 48px 0;
}
.bp-takeaways h4 {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
  font-weight: 700;
}
.bp-takeaways ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.bp-takeaways li {
  font-size: 16px;
  color: rgba(255,255,255,.75);
  line-height: 1.7;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding-left: 20px;
  position: relative;
}
.bp-takeaways li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}
.bp-takeaways li:last-child { border-bottom: none; }

/* Tags row */
.bp-tags {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid rgba(0,0,0,.07);
}
.bp-tag-pill {
  display: inline-block;
  padding: 6px 16px;
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--g6);
  transition: all .3s;
}
.bp-tag-pill:hover {
  background: var(--black);
  color: var(--cream);
  border-color: var(--black);
}

/* ── Sidebar ── */
.bp-sidebar {
  position: sticky;
  top: 108px; /* header (80px) + progress bar (3px) + breathing room */
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* Table of contents */
.bp-toc {
  padding: 28px 32px;
  background: var(--white);
  border: 1px solid rgba(0,0,0,.07);
}
.bp-toc-title {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--g4);
  margin-bottom: 18px;
  font-weight: 700;
}
.bp-toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.bp-toc li { margin-bottom: 10px; }
.bp-toc a {
  font-size: 14px;
  color: var(--g5);
  line-height: 1.4;
  transition: color .3s;
  display: block;
  padding-left: 12px;
  border-left: 2px solid transparent;
}
.bp-toc a:hover,
.bp-toc a.active {
  color: var(--black);
  border-left-color: var(--gold);
}

/* Share box */
.bp-share {
  padding: 28px 32px;
  background: var(--cream);
  border: 1px solid var(--cream-dark);
}
.bp-share-title {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--g4);
  margin-bottom: 18px;
  font-weight: 700;
}
.bp-share-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bp-share-links a {
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--g6);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color .3s;
  cursor: pointer;
}
.bp-share-links a:hover { color: var(--gold); }

/* ── Related posts ── */
.bp-related {
  padding: 96px 0;
  background: var(--black);
}
.bp-related-title {
  font-size: 10px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--g4);
  margin-bottom: 40px;
  font-weight: 700;
}
.bp-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.bp-rel-card {
  background: var(--g9);
  border: 1px solid rgba(255,255,255,.05);
  overflow: hidden;
  transition: all .4s var(--ease);
  display: flex;
  flex-direction: column;
}
.bp-rel-card:hover {
  border-color: rgba(196,162,101,.2);
  transform: translateY(-3px);
}
.bp-rel-card img {
  width: 100%;
  aspect-ratio: 16/9;
  
  filter: grayscale(40%);
  transition: filter .5s;
}
.bp-rel-card:hover img { filter: grayscale(0); }
.bp-rel-body {
  padding: 24px 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.bp-rel-tag {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
  font-weight: 700;
}
.bp-rel-body h4 {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 400;
  color: var(--cream);
  line-height: 1.4;
  margin-bottom: 10px;
  flex: 1;
}
.bp-rel-body span {
  font-size: 12px;
  color: var(--g4);
}

/* ── Back to top button ── */
#bp-top {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 44px;
  height: 44px;
  background: var(--black);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--cream);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .3s, transform .3s, background .3s;
  z-index: 500;
  text-decoration: none;
}

.bp-rel-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: contain !important;
    filter: grayscale(40%);
    transition: filter .5s;
}
#bp-top.visible { opacity: 1; transform: translateY(0); }
#bp-top:hover { background: var(--gold); border-color: var(--gold); color: var(--black); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .bp-layout {
    grid-template-columns: 1fr 240px;
    gap: 48px;
  }
}
@media (max-width: 860px) {
  .bp-layout {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 64px 0 80px;
  }
  .bp-sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    border-top: 1px solid rgba(0,0,0,.07);
    padding-top: 48px;
    margin-top: 48px;
    /* sidebar flows AFTER the article on mobile/tablet */
  }
  .bp-toc { display: none; } /* hidden on mobile/tablet */
  .bp-share { width: 100%; }
  .bp-related-grid { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 600px) {
  .bp-hero { padding: 140px 0 60px; }
  .bp-meta { gap: 20px; }
  .bp-divider-v { display: none; }
  .bp-quote { padding: 16px 20px; }
  .bp-takeaways { padding: 28px 24px; }
  #bp-top { bottom: 24px; right: 24px; }
}
