/**
 * Betty Beauty — Blog (public listing page)
 * Built from Mockup D (Hybrid) — approved combination of Magazine Grid (A),
 * Editorial Stack (B) and Sidebar+List (C), with 10 mobile/conversion upgrades.
 * 90% of traffic is mobile — every rule below is mobile-first in intent.
 */

/* The global nav (.nav-links a) is styled semi-transparent white because it's
   designed to float over a dark hero image — see the *-page-hero sections on
   Services/About/Contact/Team, which all use background:var(--black). The
   blog pages start with a light/cream header instead, so without this rule
   the nav links are invisible (white-on-cream) until the page is scrolled
   past 20px and `.nav.scrolled` kicks in. Force the same dark bar always on
   these two pages — keeps the nav legible without changing the blog's light,
   airy aesthetic underneath it. */
.nav { background: rgba(10,10,10,.96); backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(201,150,30,.2); }

.blog-hero{ padding:120px 0 50px; text-align:center; background:var(--cream); }

/* ── Search bar ────────────────────────────────────────────────────────────── */
.blog-search{ position:relative; max-width:480px; margin:0 auto 28px; }
.blog-search svg{ position:absolute; left:18px; top:50%; transform:translateY(-50%);
  width:18px; height:18px; color:var(--grey-4); pointer-events:none; }
.blog-search input{ width:100%; padding:13px 18px 13px 48px; border-radius:30px;
  border:1px solid var(--border); background:var(--white); font-size:.92rem;
  font-family:inherit; transition:border-color var(--transition), box-shadow var(--transition); }
.blog-search input:focus{ outline:none; border-color:var(--gold);
  box-shadow:0 0 0 3px rgba(201,150,30,.15); }

/* ── Category filter — horizontal scroll on mobile, no visible scrollbar ─────── */
.blog-filter{ display:flex; gap:10px; justify-content:center; margin-bottom:48px;
  overflow-x:auto; padding-bottom:4px; scrollbar-width:none; }
.blog-filter::-webkit-scrollbar{ display:none; }
.blog-filter .cat-btn{ flex-shrink:0; }
@media (max-width:680px){
  .blog-filter{ justify-content:flex-start; }
}

/* ── Latest Stories — editorial rows (top 3, from Mockup B) ──────────────────── */
.blog-latest{ max-width:980px; margin:0 auto 64px; }
.ed-row{ display:grid; grid-template-columns:1fr 1fr; gap:48px; align-items:center; margin-bottom:64px; cursor:pointer; }
.ed-row:last-child{ margin-bottom:0; }
.ed-row.reverse .ed-visual{ order:2; }
.ed-visual{ aspect-ratio:5/4; border-radius:var(--radius-lg); overflow:hidden;
  background:linear-gradient(160deg,#1A1209 0%, #0A0A0A 100%);
  display:flex; align-items:center; justify-content:center; color:var(--gold); opacity:.4; font-size:2.6rem; position:relative; }
.ed-visual img{ width:100%; height:100%; object-fit:cover; opacity:1; }
.ed-tag{ display:inline-block; font-size:.7rem; letter-spacing:.14em; text-transform:uppercase; color:var(--gold); margin-bottom:14px; }
.ed-title{ font-family:var(--font-display); font-size:clamp(1.5rem,3.2vw,2.1rem); font-weight:600; line-height:1.25; margin-bottom:14px; }
.ed-excerpt{ color:var(--grey-4); line-height:1.7; margin-bottom:18px; font-size:.95rem;
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.ed-meta{ display:flex; align-items:center; gap:12px; }
.ed-avatar{ width:36px; height:36px; border-radius:50%; background:var(--gold); color:var(--black);
  display:flex; align-items:center; justify-content:center; font-family:var(--font-display); font-weight:600; flex-shrink:0; }
.ed-meta-text{ font-size:.8rem; color:var(--grey-4); line-height:1.4; }
.ed-meta-text strong{ color:var(--dark); display:block; font-weight:600; }

@media (max-width:880px){
  .ed-row{ display:block; }
  .ed-row.reverse .ed-visual{ order:0; }
  .ed-visual{ margin-bottom:20px; aspect-ratio:16/10; }
}

/* ── Popular this month — horizontal strip widget (adapted from Mockup C sidebar) ── */
.popular-section{ max-width:980px; margin:0 auto 64px; }
.popular-title{ font-family:var(--font-display); font-size:1.3rem; font-weight:600; margin-bottom:20px;
  display:flex; align-items:center; gap:10px; }
.popular-title::before{ content:''; width:20px; height:2px; background:var(--gold); display:inline-block; }
.popular-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
.popular-card{ display:flex; gap:14px; align-items:center; background:var(--white); border-radius:var(--radius);
  box-shadow:var(--shadow-sm); padding:14px; cursor:pointer; transition:all var(--transition); }
.popular-card:hover{ box-shadow:var(--shadow-md); transform:translateY(-3px); }
.popular-thumb{ width:56px; height:56px; border-radius:8px; flex-shrink:0; overflow:hidden;
  background:linear-gradient(160deg,#1A1209 0%, #0A0A0A 100%);
  display:flex; align-items:center; justify-content:center; color:var(--gold); opacity:.5; font-size:1.3rem; }
.popular-thumb img{ width:100%; height:100%; object-fit:cover; opacity:1; }
.popular-text{ font-size:.84rem; line-height:1.4; min-width:0; }
.popular-text strong{ font-weight:600; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; margin-bottom:4px; }
.popular-text span{ font-size:.74rem; color:var(--grey-4); }

@media (max-width:880px){
  .popular-grid{ grid-template-columns:1fr; }
}

/* ── Card grid (from Mockup A) ────────────────────────────────────────────────── */
.blog-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:32px; max-width:1180px; margin:0 auto; }
.blog-card-link{ display:block; color:inherit; text-decoration:none; -webkit-tap-highlight-color:transparent; }
.blog-card-link:focus-visible .blog-card{ outline:2px solid var(--gold); outline-offset:3px; }
.blog-card{ background:var(--white); border-radius:var(--radius); overflow:hidden;
  box-shadow:var(--shadow-sm); transition:all var(--transition); cursor:pointer; }
.blog-card:hover{ transform:translateY(-6px); box-shadow:var(--shadow-lg); }
.blog-card-img{ aspect-ratio:16/10; background:linear-gradient(160deg,#1A1209 0%, #0A0A0A 100%);
  display:flex; align-items:center; justify-content:center; color:var(--gold); opacity:.4; font-size:2.2rem; overflow:hidden; }
.blog-card-img img{ width:100%; height:100%; object-fit:cover; opacity:1; }
.blog-card-body{ padding:22px 22px 26px; }
.blog-tag{ display:inline-block; font-size:.68rem; letter-spacing:.12em; text-transform:uppercase;
  color:var(--gold); background:rgba(201,150,30,.12); padding:5px 13px; border-radius:20px; margin-bottom:14px; }
.blog-card-title{ font-family:var(--font-display); font-size:1.25rem; font-weight:600; margin:0 0 8px; line-height:1.28; }
.blog-card-excerpt{ font-size:.86rem; color:var(--grey-4); line-height:1.6; margin-bottom:14px;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.blog-meta{ font-size:.78rem; color:var(--grey-4); display:flex; gap:14px; align-items:center; }
.blog-meta .dot{ width:4px; height:4px; border-radius:50%; background:var(--grey-4); display:inline-block; }

.blog-empty-msg{ text-align:center; color:var(--grey-4); padding:60px 0; max-width:1180px; margin:0 auto; }

/* IMPROVEMENT — compact mobile images: shorter aspect ratio saves vertical scroll
   for the 90% of visitors browsing on a phone */
@media (max-width:600px){
  .ed-visual{ aspect-ratio:16/10; }
  .blog-grid{ grid-template-columns:1fr; gap:56px; }
  /* Generous breathing room between stacked articles on mobile.
     The articles are wrapped in <a class="ed-row-link"> so the margin must
     live on the WRAPPER, not on .ed-row — otherwise a parent display:block
     anchor swallows the gap and the rows look glued together. */
  .ed-row-link,
  .ed-row{ display:block; }
  .ed-row-link{
    margin-bottom:64px;
    padding-bottom:40px;
    border-bottom:1px solid rgba(201,150,30,0.22);
  }
  .ed-row-link:last-child{ margin-bottom:0; padding-bottom:0; border-bottom:none; }
  .ed-row{ margin-bottom:0; padding-bottom:0; border-bottom:none; }
  .popular-card-link{ display:block; margin-bottom:18px; }
  .popular-card-link:last-child{ margin-bottom:0; }
}
@media (max-width:980px) and (min-width:601px){
  .blog-grid{ grid-template-columns:repeat(2,1fr); }
}

/* ── Newsletter strip (from Mockup A) ─────────────────────────────────────────── */
.blog-newsletter{ margin:80px auto 0; max-width:1180px; background:var(--dark); border-radius:var(--radius-lg);
  padding:52px 36px; text-align:center; color:var(--white); }
.blog-newsletter h3{ font-family:var(--font-display); font-size:1.9rem; margin-bottom:10px; }
.blog-newsletter p{ color:rgba(255,255,255,.6); margin-bottom:24px; }
.blog-newsletter-form{ display:flex; gap:12px; justify-content:center; max-width:420px; margin:0 auto; flex-wrap:wrap; }
.blog-newsletter-form input{ flex:1; min-width:180px; padding:12px 18px; border-radius:var(--radius);
  border:1px solid rgba(255,255,255,.2); background:rgba(255,255,255,.05); color:var(--white); font-size:.9rem; }
.blog-newsletter-status{ margin:18px auto 0; max-width:420px; padding:10px 16px; border-radius:var(--radius);
  font-size:.9rem; line-height:1.5; }
.blog-newsletter-status.ok{ background:rgba(34,197,94,.12); color:#86efac; border:1px solid rgba(34,197,94,.3); }
.blog-newsletter-status.error{ background:rgba(239,68,68,.12); color:#fca5a5; border:1px solid rgba(239,68,68,.3); }

/* ── Floating "Book Now" button — appears once hero scrolls out (mobile conversion) ── */
.blog-float-book{ position:fixed; bottom:24px; left:50%; transform:translate(-50%, 100px);
  background:var(--gold); color:var(--black); font-weight:600; font-size:.85rem;
  padding:14px 28px; border-radius:30px; box-shadow:0 12px 32px rgba(0,0,0,.25);
  display:flex; align-items:center; gap:8px; z-index:500; opacity:0;
  transition:transform .3s ease, opacity .3s ease; text-decoration:none; }
.blog-float-book.is-visible{ transform:translate(-50%, 0); opacity:1; }
@media (min-width:980px){
  /* Desktop is only ~10% of traffic — keep the floating CTA mobile-only so it
     doesn't overlap the wider layout's footer/sidebar areas */
  .blog-float-book{ display:none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SINGLE ARTICLE PAGE (mockup-d-post.html)
   ═══════════════════════════════════════════════════════════════════════════ */

.read-progress{ position:fixed; top:0; left:0; height:3px; width:0%; background:var(--gold);
  z-index:1001; transition:width .1s linear; }

.post-hero{ padding:120px 0 0; text-align:center; }
.post-tag{ display:inline-block; font-size:.7rem; letter-spacing:.14em; text-transform:uppercase; color:var(--gold); margin-bottom:18px; }
.post-title{ font-family:var(--font-display); font-size:clamp(2rem,5.5vw,3.4rem); font-weight:600; line-height:1.15;
  max-width:780px; margin:0 auto 24px; }
.post-meta-row{ display:flex; align-items:center; justify-content:center; gap:14px; margin-bottom:40px; }
.post-avatar{ width:44px; height:44px; border-radius:50%; background:var(--gold); color:var(--black);
  display:flex; align-items:center; justify-content:center; font-family:var(--font-display); font-weight:600; overflow:hidden; }
.post-avatar img{ width:100%; height:100%; object-fit:cover; }
.post-meta-text{ font-size:.85rem; color:var(--grey-4); text-align:left; line-height:1.4; }
.post-meta-text strong{ color:var(--dark); display:block; font-weight:600; }

/* Cover container adapts to the image's natural aspect ratio — no forced
   16:9 crop. Hard ceiling of 80vh so an unusually tall image can't push
   the body offscreen. The dark gradient + sparkle ✦ only show when there
   is no image (fallback). */
.post-cover{ max-width:920px; margin:0 auto 56px; border-radius:var(--radius-lg);
  overflow:hidden; }
.post-cover:not(:has(img)){
  aspect-ratio:16/9;
  background:linear-gradient(160deg,#1A1209 0%, #0A0A0A 100%);
  display:flex; align-items:center; justify-content:center; color:var(--gold); opacity:.4; font-size:3.5rem;
}
.post-cover img{
  display:block;
  width:100%;
  height:auto;          /* let the image keep its natural ratio */
  max-height:80vh;      /* but never taller than the viewport */
  object-fit:contain;   /* if max-height kicks in, scale down — never crop */
  margin:0 auto;
  opacity:1;
}

.post-body{ max-width:680px; margin:0 auto; font-size:1.05rem; line-height:1.85; color:#3a3633; }
.post-body p{ margin-bottom:26px; }
.post-body h2{ font-family:var(--font-display); font-size:1.7rem; font-weight:600; margin:48px 0 18px; color:var(--dark); }
.post-body strong{ color:var(--dark); }

.post-cta-block{ background:var(--cream); border:1px solid rgba(201,150,30,.25); border-radius:var(--radius);
  padding:28px 28px; margin:36px 0; display:flex; align-items:center; gap:20px; justify-content:space-between; flex-wrap:wrap; }
.post-cta-text strong{ font-family:var(--font-display); font-size:1.2rem; font-weight:600; display:block; margin-bottom:4px; color:var(--dark); }
.post-cta-text span{ font-size:.85rem; color:var(--grey-4); }
.post-cta-block .btn{ flex-shrink:0; }

.post-share{ max-width:680px; margin:48px auto 0; padding-top:28px; border-top:1px solid var(--border);
  display:flex; align-items:center; gap:16px; }
.post-share-label{ font-size:.78rem; letter-spacing:.1em; text-transform:uppercase; color:var(--grey-4); }
.share-btn{ width:40px; height:40px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  background:var(--cream); color:var(--dark); transition:all var(--transition); }
.share-btn:hover{ background:var(--gold); color:var(--black); transform:translateY(-2px); }
.share-btn.wa{ background:#25D366; color:#fff; }
.share-btn.wa:hover{ background:#1ebe5a; }
.share-btn svg{ width:18px; height:18px; }

.post-author-box{ max-width:680px; margin:40px auto 0; background:var(--white); border-radius:var(--radius);
  box-shadow:var(--shadow-sm); padding:28px; display:flex; gap:20px; align-items:center; }
/* `display:flex` above ties in specificity with the UA stylesheet's
   `[hidden]{display:none}` rule — author rules win on source order, so the
   `hidden` attribute set by blog-post.js (when an article has no author) was
   being silently overridden, leaving a card with just an empty avatar circle.
   This selector is more specific (class + attribute) and restores the hide. */
.post-author-box[hidden]{ display:none; }
.author-avatar-lg{ width:64px; height:64px; border-radius:50%; background:var(--gold); color:var(--black);
  display:flex; align-items:center; justify-content:center; font-family:var(--font-display); font-size:1.4rem; font-weight:600; flex-shrink:0; overflow:hidden; }
.author-avatar-lg img{ width:100%; height:100%; object-fit:cover; }
.post-author-box strong{ font-family:var(--font-display); font-size:1.15rem; font-weight:600; display:block; margin-bottom:4px; }
.post-author-box p{ font-size:.85rem; color:var(--grey-4); line-height:1.5; margin:0; }

.related-section{ max-width:1040px; margin:80px auto 0; }
.related-title{ text-align:center; margin-bottom:32px; }
.related-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:28px; }
.related-card{ background:var(--white); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow-sm);
  cursor:pointer; transition:all var(--transition); }
.related-card:hover{ transform:translateY(-5px); box-shadow:var(--shadow-md); }
.related-img{ aspect-ratio:16/10; overflow:hidden; background:linear-gradient(160deg,#E8C988 0%, #C9961E 100%);
  display:flex; align-items:center; justify-content:center; color:rgba(0,0,0,.25); font-size:1.8rem; }
.related-img img{ width:100%; height:100%; object-fit:cover; opacity:1; }
.related-body{ padding:18px 20px 22px; }
.related-tag{ font-size:.66rem; letter-spacing:.1em; text-transform:uppercase; color:var(--gold); }
.related-card h4{ font-family:var(--font-display); font-size:1.1rem; font-weight:600; margin:6px 0 0; line-height:1.3; }

@media (max-width:760px){
  .related-grid{ grid-template-columns:1fr 1fr; }
  .post-cta-block{ flex-direction:column; align-items:flex-start; text-align:left; }
  .post-cta-block .btn{ width:100%; text-align:center; }
  .post-body{ font-size:1rem; line-height:1.8; }
}
@media (max-width:560px){ .related-grid{ grid-template-columns:1fr; } }

/* ── End-of-article dynamic CTA (desktop + tablet) ───────────────────────────
   Appended by blog-post.js after the body. Hidden on mobile (≤640px) where
   the floating Book button already covers conversion. */
.post-end-cta {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 680px;
  margin: 56px auto 0;
  padding: 28px 32px;
  background: linear-gradient(135deg, #FDF6E3 0%, #F4ECD8 100%);
  border: 1.5px solid rgba(201, 150, 30, 0.28);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(201, 150, 30, 0.08);
  position: relative;
  overflow: hidden;
}
.post-end-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(201, 150, 30, 0.12) 0%, transparent 60%);
  pointer-events: none;
}
.post-end-cta-emoji {
  font-size: 2.4rem;
  line-height: 1;
  flex-shrink: 0;
  z-index: 1;
}
.post-end-cta-text {
  flex: 1;
  min-width: 0;
  z-index: 1;
}
.post-end-cta-h {
  font-family: var(--font-display, 'Cormorant Garamond', Georgia, serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: #0A0A0A;
  margin: 0 0 4px;
  line-height: 1.25;
}
.post-end-cta-s {
  font-size: 0.95rem;
  color: #555;
  margin: 0;
  line-height: 1.5;
}
.post-end-cta-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  background: #0A0A0A;
  color: #fff !important;
  text-decoration: none;
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  z-index: 1;
}
.post-end-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(201, 150, 30, 0.28);
  background: #C9961E;
}

@media (max-width: 720px) {
  .post-end-cta {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 16px;
    padding: 24px 22px;
    margin-top: 40px;
  }
  .post-end-cta-btn { width: 100%; justify-content: center; }
}

/* Mobile (≤640px) already has the floating book button — hide this so we
   don't double up on the same conversion ask. */
@media (max-width: 640px) {
  .post-end-cta { display: none; }
}
