/* ============================================================
   BLOG-POST.CSS — Modern Storytelling Page
   Clean · Editorial · Adaptive Images · Premium
   ============================================================ */

:root {
  --bp-cream:    #FAF7F2;
  --bp-beige:    #F0E8D8;
  --bp-warm:     #E8D5B7;
  --bp-brown:    #4A2C0A;
  --bp-brown-lt: #7B5135;
  --bp-gold:     #C8963E;
  --bp-gold-lt:  #E6B96A;
  --bp-text:     #2D1E12;
  --bp-muted:    #8B6B52;
  --bp-white:    #FFFFFF;
  --bp-shadow:   0 2px 16px rgba(74,44,10,0.07);
  --bp-shadow-md:0 6px 32px rgba(74,44,10,0.11);
  --bp-shadow-lg:0 16px 56px rgba(74,44,10,0.14);
  --bp-radius:   14px;
  --bp-radius-lg:22px;
  --bp-trans:    0.35s cubic-bezier(0.4,0,0.2,1);
  --bp-max:      720px;   /* prose column max-width */
}

/* ── Reading Progress ───────────────────────────── */
.bp-progress-wrap {
  position: fixed; top: 0; left: 0; right: 0;
  height: 3px; z-index: 9999;
  background: rgba(200,150,62,0.15);
}
#bp-progress {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--bp-gold), var(--bp-gold-lt));
  transition: width 0.1s linear;
}

/* ── Main wrapper ───────────────────────────────── */
.bp-main {
  background: var(--bp-cream);
}

/* ══════════════════════════════════════════════════
   ARTICLE HEADER
══════════════════════════════════════════════════ */
.bp-header {
  padding: 24px 0 0;
  background: var(--bp-white);
}
.bp-header__inner {
  max-width: var(--bp-max);
  margin: 0 auto;
  padding: 0 24px;
}
.bp-header__inner.has-sidebar {
  max-width: 1100px;
}

/* Back link */
.bp-back {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Inter', sans-serif; font-size: 0.8rem;
  font-weight: 600; color: var(--bp-brown);
  border: 1.5px solid rgba(74, 44, 10, 0.15);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(4px);
  padding: 8px 18px; border-radius: 30px;
  text-decoration: none; letter-spacing: 0.3px;
  transition: all var(--bp-trans);
  margin-bottom: 28px;
}
.bp-back svg {
  transition: transform var(--bp-trans);
}
.bp-back:hover {
  color: #fff;
  background: var(--bp-gold);
  border-color: var(--bp-gold);
  box-shadow: 0 4px 12px rgba(200, 150, 62, 0.25);
  transform: translateY(-1px);
}
.bp-back:hover svg {
  transform: translateX(-3px);
}

/* Category pill */
.bp-cat {
  display: inline-flex; align-items: center;
  padding: 5px 14px; border-radius: 50px;
  background: var(--bp-gold); color: #fff;
  font-family: 'Inter', sans-serif; font-size: 0.68rem;
  font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  margin-bottom: 20px;
}

/* Title */
.bp-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  font-weight: 700; color: var(--bp-brown);
  line-height: 1.18; margin-bottom: 20px;
}

/* Lead / excerpt */
.bp-lead {
  font-family: 'Lora', serif; font-size: 1.15rem;
  font-style: italic; line-height: 1.7;
  color: var(--bp-brown-lt); margin-bottom: 32px;
}

/* Meta row */
.bp-meta {
  display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 40px;
}
.bp-meta__author {
  display: flex; align-items: center; gap: 12px;
}
.bp-meta__avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bp-beige); overflow: hidden;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem; font-weight: 700; color: var(--bp-brown);
}
.bp-meta__avatar img { width: 100%; height: 100%; object-fit: cover; }
.bp-meta__name {
  display: block;
  font-family: 'Inter', sans-serif; font-size: 0.88rem;
  font-weight: 700; color: var(--bp-brown);
}
.bp-meta__role {
  font-family: 'Inter', sans-serif; font-size: 0.72rem;
  color: var(--bp-muted);
}
.bp-meta__stats {
  display: flex; align-items: center; gap: 8px;
  font-family: 'Inter', sans-serif; font-size: 0.78rem;
  color: var(--bp-muted);
}
.bp-dot { opacity: 0.4; }

/* Divider */
.bp-header__divider {
  height: 1px;
  background: linear-gradient(90deg, var(--bp-warm), transparent);
  margin: 0 -24px;
}

/* ══════════════════════════════════════════════════
   COVER IMAGE — Fully adaptive, no cropping
══════════════════════════════════════════════════ */
.bp-cover {
  margin-bottom: 24px;
}
.bp-cover__frame {
  max-width: 920px;
  margin: 0 auto;
  border-radius: 0;
  overflow: hidden;
  background: var(--bp-beige);
  box-shadow: var(--bp-shadow-md);
  /* Let height be natural — no forced aspect ratio */
}
.bp-cover__img {
  width: 100%; height: auto;
  display: block;
  object-fit: contain;  /* never crop */
  max-height: 80vh;
  border-radius: 0;
}

/* ══════════════════════════════════════════════════
   ARTICLE BODY
══════════════════════════════════════════════════ */
.bp-body {
  background: var(--bp-white);
  padding: 48px 0 80px;
}
.bp-body__inner {
  max-width: var(--bp-max);
  margin: 0 auto;
  padding: 0 24px;
}
.bp-body__inner.has-sidebar {
  max-width: 1100px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 44px;
  align-items: start;
}
.bp-prose-col {
  min-width: 0;
  max-width: var(--bp-max);
  width: 100%;
  margin: 0 auto;
}
.bp-gallery-col {
  position: static;
  order: -1;
  width: 100%;
  max-width: 920px;
  margin: 0 auto 8px;
}

/* ── Prose typography ───────────────────────────── */
.bp-prose {
  font-family: 'Lora', serif;
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--bp-text);
  margin-bottom: 56px;
}
.bp-prose p { margin-bottom: 1.6em; }
.bp-prose h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.55rem; font-weight: 700;
  color: var(--bp-brown); margin: 2em 0 0.6em;
  line-height: 1.25;
}
.bp-prose h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem; font-weight: 600;
  color: var(--bp-brown); margin: 1.8em 0 0.5em;
}
.bp-prose blockquote {
  margin: 2em 0; padding: 20px 28px;
  border-left: 3px solid var(--bp-gold);
  background: var(--bp-beige);
  border-radius: 0 var(--bp-radius) var(--bp-radius) 0;
  font-style: italic; color: var(--bp-brown-lt);
  font-size: 1.1rem; line-height: 1.7;
}
.bp-prose ul, .bp-prose ol {
  padding-left: 1.4em; margin-bottom: 1.5em;
}
.bp-prose li { margin-bottom: 0.5em; }
.bp-prose a { color: var(--bp-gold); text-decoration: underline; }
.bp-prose a:hover { color: var(--bp-brown); }
.bp-prose img {
  width: 100%; height: auto;
  border-radius: 0;
  margin: 1.5em 0;
  object-fit: contain;
}
.bp-prose strong { color: var(--bp-brown); font-weight: 700; }
.bp-prose hr {
  border: none; border-top: 1px solid var(--bp-warm);
  margin: 2.5em 0;
}

/* ══════════════════════════════════════════════════
   GALLERY — Smart adaptive grid
══════════════════════════════════════════════════ */
.bp-gallery {
  margin: 0 0 56px;
  padding: 36px;
  background: var(--bp-beige);
  border-radius: var(--bp-radius-lg);
}
.bp-gallery__header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.bp-gallery__label {
  font-family: 'Inter', sans-serif; font-size: 0.7rem;
  font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
  color: var(--bp-gold);
}
.bp-gallery__count {
  font-family: 'Inter', sans-serif; font-size: 0.75rem;
  color: var(--bp-muted);
}

/* Grid layouts */
.bp-gallery__grid { display: grid; gap: 12px; }

.bp-gallery__grid--1 { grid-template-columns: 1fr; }

.bp-gallery__grid--2 { grid-template-columns: 1fr 1fr; }

.bp-gallery__grid--3 { grid-template-columns: 1fr 1fr 1fr; }

.bp-gallery__grid--4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
}

.bp-gallery__grid--masonry {
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: auto;
}

.bp-gallery__grid--video-heavy {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bp-gallery__grid--portrait-stack {
  grid-template-columns: repeat(auto-fit, minmax(240px, 320px));
  justify-content: center;
  gap: 18px;
}

/* Gallery item */
.bp-gallery__item {
  margin: 0; position: relative;
  border-radius: 0;
  overflow: visible;
  cursor: pointer;
}

.bp-gallery__grid--portrait-stack .bp-gallery__item.is-video {
  width: 100%;
}

/* Image wrapper — KEY: no forced height, image shows in full */
.bp-gallery__img-wrap {
  position: relative;
  background: var(--bp-warm);
  border-radius: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bp-gallery__img-wrap--video {
  aspect-ratio: 4 / 5;
  min-height: 300px;
  max-height: 520px;
  background: #111;
}

.bp-gallery__img-wrap--video.is-landscape {
  aspect-ratio: 16 / 9;
  min-height: 220px;
  max-height: 340px;
}

.bp-gallery__img-wrap--video.is-portrait {
  aspect-ratio: 9 / 16;
  min-height: 320px;
  max-height: 520px;
}

.bp-gallery__img-wrap--video.is-square {
  aspect-ratio: 1 / 1;
  min-height: 260px;
  max-height: 420px;
}

/* The actual image — FULL visibility, no crop */
.bp-gallery__img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;    /* show full image always */
  transition: box-shadow var(--bp-trans);
  border-radius: 0;
}

/* Portrait images get a max height so they don't dominate */
.bp-gallery__grid--2 .bp-gallery__img,
.bp-gallery__grid--3 .bp-gallery__img,
.bp-gallery__grid--masonry .bp-gallery__img {
  max-height: 380px;
}

.bp-gallery__img-wrap--video .bp-gallery__img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  background: #111;
}

.bp-gallery__item:hover .bp-gallery__img { box-shadow: var(--bp-shadow-md); }

/* Zoom & Video Play icon overlay */
.bp-gallery__zoom, .bp-gallery__video-play {
  position: absolute; bottom: 10px; right: 10px;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(250,247,242,0.9);
  display: flex; align-items: center; justify-content: center;
  color: var(--bp-brown); opacity: 0;
  transition: opacity var(--bp-trans), background var(--bp-trans);
  box-shadow: var(--bp-shadow);
}
.bp-gallery__video-play {
  top: 50%; left: 50%; bottom: auto; right: auto;
  transform: translate(-50%, -50%);
  width: 50px; height: 50px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  opacity: 1;
}
.bp-gallery__item:hover .bp-gallery__zoom { opacity: 1; }
.bp-gallery__item:hover .bp-gallery__video-play { background: rgba(0,0,0,0.8); }

.bp-gallery__caption {
  font-family: 'Inter', sans-serif; font-size: 0.75rem;
  color: var(--bp-muted); text-align: center;
  padding: 8px 4px 0; line-height: 1.4;
}

/* ══════════════════════════════════════════════════
   TAGS
══════════════════════════════════════════════════ */
.bp-tags {
  display: flex; flex-wrap: wrap; gap: 10px;
  align-items: center; margin-bottom: 44px;
}
.bp-tags__label {
  font-family: 'Inter', sans-serif; font-size: 0.75rem;
  font-weight: 700; color: var(--bp-muted);
  letter-spacing: 1px; text-transform: uppercase;
}
.bp-tag {
  display: inline-flex; padding: 6px 14px;
  border-radius: 50px;
  border: 1.5px solid var(--bp-warm);
  background: var(--bp-beige);
  font-family: 'Inter', sans-serif; font-size: 0.78rem;
  color: var(--bp-brown-lt);
  transition: var(--bp-trans);
}
.bp-tag:hover {
  background: var(--bp-gold); color: #fff;
  border-color: var(--bp-gold);
}

/* ══════════════════════════════════════════════════
   SHARE BAR
══════════════════════════════════════════════════ */
.bp-share {
  padding: 28px 0;
  border-top: 1px solid var(--bp-beige);
  border-bottom: 1px solid var(--bp-beige);
  margin-bottom: 44px;
}
.bp-share__label {
  display: block;
  font-family: 'Inter', sans-serif; font-size: 0.72rem;
  font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--bp-muted); margin-bottom: 14px;
}
.bp-share__btns {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.bp-share__btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 18px; border-radius: 50px;
  font-family: 'Inter', sans-serif; font-size: 0.8rem;
  font-weight: 600; cursor: pointer;
  border: none; transition: var(--bp-trans);
  text-decoration: none;
}
.bp-share__btn--x   { background: #000; color: #fff; }
.bp-share__btn--fb  { background: #1877F2; color: #fff; }
.bp-share__btn--wa  { background: #25D366; color: #fff; }
.bp-share__btn--copy{
  background: var(--bp-beige); color: var(--bp-brown);
  border: 1.5px solid var(--bp-warm);
}
.bp-share__btn:hover { opacity: 0.86; transform: translateY(-2px); }

/* ══════════════════════════════════════════════════
   AUTHOR CARD
══════════════════════════════════════════════════ */
.bp-author {
  display: flex; gap: 24px; align-items: flex-start;
  padding: 32px; border-radius: var(--bp-radius-lg);
  background: var(--bp-beige); box-shadow: var(--bp-shadow);
}
.bp-author__avatar {
  width: 70px; height: 70px; border-radius: 50%;
  background: var(--bp-warm); overflow: hidden;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem; font-weight: 700; color: var(--bp-brown);
}
.bp-author__avatar img { width: 100%; height: 100%; object-fit: cover; }
.bp-author__label {
  font-family: 'Inter', sans-serif; font-size: 0.68rem;
  font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--bp-gold); margin-bottom: 6px;
}
.bp-author__name {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem; font-weight: 700;
  color: var(--bp-brown); margin-bottom: 8px;
}
.bp-author__bio {
  font-family: 'Lora', serif; font-size: 0.9rem;
  color: var(--bp-muted); line-height: 1.65;
  margin-bottom: 12px;
}
.bp-author__link {
  font-family: 'Inter', sans-serif; font-size: 0.8rem;
  font-weight: 600; color: var(--bp-gold);
  transition: var(--bp-trans);
}
.bp-author__link:hover { color: var(--bp-brown); }

/* ══════════════════════════════════════════════════
   RELATED POSTS
══════════════════════════════════════════════════ */
.bp-related {
  background: var(--bp-beige);
  padding: 80px 0;
}
.bp-related__inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
}
.bp-related__header { text-align: center; margin-bottom: 48px; }
.bp-related__title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem; font-weight: 700;
  color: var(--bp-brown); margin-top: 12px;
}
.bp-related__grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.bp-related__card {
  background: var(--bp-white); border-radius: var(--bp-radius-lg);
  overflow: hidden; box-shadow: var(--bp-shadow);
  transition: transform var(--bp-trans), box-shadow var(--bp-trans);
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
}
.bp-related__card:hover {
  transform: translateY(-6px); box-shadow: var(--bp-shadow-lg);
}
.bp-related__img-wrap {
  position: relative; height: 200px;
  background: var(--bp-beige); overflow: hidden;
}
.bp-related__img-wrap img {
  width: 100%; height: 100%;
  object-fit: contain; transition: opacity 0.3s ease;
}
.bp-related__card:hover .bp-related__img-wrap img { opacity: 0.9; }
.bp-related__img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
}
.bp-related__cat {
  position: absolute; top: 12px; left: 12px;
  background: var(--bp-gold); color: #fff;
  font-family: 'Inter', sans-serif; font-size: 0.62rem;
  font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  padding: 4px 10px; border-radius: 50px;
}
.bp-related__body { padding: 22px; flex: 1; }
.bp-related__body h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem; font-weight: 700;
  color: var(--bp-brown); line-height: 1.35;
  margin-bottom: 12px;
}
.bp-related__cta {
  font-family: 'Inter', sans-serif; font-size: 0.78rem;
  font-weight: 600; color: var(--bp-gold);
}

/* ══════════════════════════════════════════════════
   LIGHTBOX
══════════════════════════════════════════════════ */
#bp-lightbox {
  display: none;
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(15,8,2,0.96);
  backdrop-filter: blur(8px);
  align-items: center; justify-content: center;
  flex-direction: column;
}
#bp-lightbox.open { display: flex; }

#lb-img-wrap {
  display: flex; align-items: center; justify-content: center;
  max-width: 92vw; max-height: 82vh;
  padding: 0 60px;
}
#lb-img {
  max-width: 100%; max-height: 82vh;
  object-fit: contain; border-radius: 8px;
  display: block;
}
#lb-close {
  position: absolute; top: 20px; right: 24px;
  background: rgba(255,255,255,0.1); border: none;
  color: #fff; width: 42px; height: 42px;
  border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
#lb-close:hover { background: rgba(255,255,255,0.2); }
#lb-prev, #lb-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.08); border: none;
  color: #fff; width: 50px; height: 50px;
  border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
#lb-prev { left: 20px; }
#lb-next { right: 20px; }
#lb-prev:hover, #lb-next:hover { background: rgba(255,255,255,0.18); }
#lb-footer {
  position: absolute; bottom: 24px; left: 0; right: 0;
  text-align: center;
}
#lb-caption {
  font-family: 'Lora', serif; font-style: italic;
  color: rgba(255,255,255,0.75); font-size: 0.9rem; margin-bottom: 6px;
}
#lb-counter {
  font-family: 'Inter', sans-serif; font-size: 0.72rem;
  color: rgba(255,255,255,0.4); letter-spacing: 2px;
}

/* ══════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════ */
@media (max-width: 992px) {
  .bp-body__inner.has-sidebar,
  .bp-header__inner.has-sidebar {
    grid-template-columns: 1fr;
    max-width: var(--bp-max);
    gap: 40px;
  }
  .bp-gallery-col {
    position: static;
  }
}

@media (max-width: 768px) {
  .bp-header { padding: 40px 0 0; }
  .bp-header__inner, .bp-body__inner { padding: 0 20px; }
  .bp-title { font-size: 1.6rem; }
  .bp-meta { flex-direction: column; align-items: flex-start; }

  .bp-gallery { padding: 24px 20px; }
  .bp-gallery__grid--2,
  .bp-gallery__grid--3,
  .bp-gallery__grid--4,
  .bp-gallery__grid--masonry,
  .bp-gallery__grid--video-heavy,
  .bp-gallery__grid--portrait-stack {
    grid-template-columns: 1fr;
  }
  .bp-gallery__grid--2 .bp-gallery__img,
  .bp-gallery__grid--3 .bp-gallery__img,
  .bp-gallery__grid--masonry .bp-gallery__img {
    max-height: none;
  }
  .bp-gallery__img-wrap--video {
    min-height: 260px;
    max-height: 460px;
  }
  .bp-gallery__img-wrap--video.is-landscape,
  .bp-gallery__img-wrap--video.is-portrait,
  .bp-gallery__img-wrap--video.is-square {
    aspect-ratio: auto;
  }

  .bp-author { flex-direction: column; gap: 16px; padding: 24px; }
  .bp-related__grid { grid-template-columns: 1fr; }
  .bp-cover { padding: 24px 20px 0; }

  #lb-prev { left: 8px; }
  #lb-next { right: 8px; }
  #lb-img-wrap { padding: 0 44px; }
}

@media (max-width: 500px) {
  .bp-share__btns { flex-direction: column; }
  .bp-share__btn { justify-content: center; }
}
