/* ══════════════════════════════════════════════════════════════
   BLOG.CSS — The Grove Atelier · The Journal
   Warm editorial palette: espresso hero → linen ground → cream cards
   ══════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* grounds */
  --espresso:    #1E1108;
  --linen:       #F0E8DA;
  --sand:        #E4D9C8;
  --cream:       #FFFEF9;

  /* text */
  --ink:         #2C1F14;
  --ink-60:      rgba(44,31,20,0.6);
  --ink-35:      rgba(44,31,20,0.35);

  /* accents */
  --gold:        #C9A84C;
  --terracotta:  #B85C3A;
  --terra-dim:   rgba(184,92,58,0.12);
  --gold-dim:    rgba(201,168,76,0.18);

  /* structure */
  --hairline:    rgba(44,31,20,0.1);
  --card-shadow: 0 2px 12px rgba(44,31,20,0.09), 0 1px 3px rgba(44,31,20,0.06);
  --card-shadow-hover: 0 12px 36px rgba(44,31,20,0.16), 0 3px 8px rgba(44,31,20,0.08);
}

html { scroll-behavior: smooth; }

body {
  background: var(--linen);
  color: var(--ink);
  font-family: 'Josefin Sans', 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── Custom scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--linen); }
::-webkit-scrollbar-thumb { background: rgba(44,31,20,0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--terracotta); }
::selection { background: rgba(184,92,58,0.15); color: var(--ink); }

/* ══ HERO — food photo mosaic background ═════════════════════ */

.blog-hero {
  position: relative;
  background: var(--espresso);
  padding: 9rem 1.5rem 5.5rem;
  text-align: center;
  overflow: hidden;
  /* min height so mosaic has room to breathe */
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── 3×3 photo mosaic (lives behind overlay + content) ─────── */
.blog-hero-mosaic {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 3px;
  /* slow cinematic drift */
  animation: mosaicDrift 22s ease-in-out infinite alternate;
  /* scale up slightly so drift doesn't expose edges */
  transform: scale(1.06);
  transform-origin: center center;
}

@keyframes mosaicDrift {
  0%   { transform: scale(1.06) translate(0px, 0px); }
  33%  { transform: scale(1.07) translate(-6px, -4px); }
  66%  { transform: scale(1.06) translate(4px, -6px); }
  100% { transform: scale(1.07) translate(-3px, 5px); }
}

.blog-hero-mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* desaturate slightly so the overlay reads more editorial */
  filter: saturate(0.8) brightness(0.9);
}

/* ── Overlay: warm dark gradient with a brighter center window ─ */
.blog-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    /* soft bright centre so photos feel present behind text */
    radial-gradient(ellipse 65% 55% at 50% 50%, rgba(30,17,8,0.48) 0%, rgba(30,17,8,0.75) 70%, rgba(30,17,8,0.88) 100%),
    /* golden warmth at top */
    linear-gradient(to bottom, rgba(201,168,76,0.04) 0%, transparent 40%);
  pointer-events: none;
}

/* animated gold seam at very top */
.blog-hero::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 30%, rgba(201,168,76,0.4) 50%, var(--gold) 70%, transparent 100%);
  background-size: 200% 100%;
  animation: runeSlide 5s ease-in-out infinite;
  z-index: 3;
}

@keyframes runeSlide {
  0%, 100% { background-position: 200% 0; opacity: 0.4; }
  50% { background-position: 0% 0; opacity: 1; }
}

/* ── Text content sits above mosaic + overlay ──────────────── */
.blog-hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
}

.blog-hero-eyebrow {
  font-size: 0.56rem;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.4rem;
  opacity: 0;
  animation: fadeUp 0.7s 0.1s ease-out forwards;
}

.blog-hero-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #F5EFE4;
  font-style: italic;
  opacity: 0;
  animation: fadeUp 0.8s 0.25s ease-out forwards;
}

.blog-hero-title em {
  font-style: normal;
  color: var(--gold);
}

.blog-hero-rule {
  width: 44px;
  height: 1px;
  background: rgba(201,168,76,0.6);
  margin: 1.6rem auto;
  opacity: 0;
  animation: scaleIn 0.6s 0.45s ease-out forwards;
}

@keyframes scaleIn {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}

.blog-hero-sub {
  font-size: 0.82rem;
  line-height: 1.8;
  color: rgba(245,239,228,0.58);
  max-width: 44ch;
  margin-inline: auto;
  letter-spacing: 0.03em;
  opacity: 0;
  animation: fadeUp 0.7s 0.55s ease-out forwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* wave transition from espresso to linen */
.blog-hero-wave {
  display: block;
  width: 100%;
  height: 48px;
  background: var(--linen);
  /* clip the top edge with a gentle arc */
  clip-path: ellipse(55% 100% at 50% 100%);
  margin-top: -1px;
}

/* ══ CATEGORY FILTER ═════════════════════════════════════════ */

.blog-cats-wrap {
  background: var(--linen);
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--hairline);
}

.blog-cats {
  display: flex;
  gap: 0;
  flex-wrap: nowrap;
  justify-content: center;
  max-width: 960px;
  margin-inline: auto;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.blog-cats::-webkit-scrollbar { display: none; }

.blog-cat-btn {
  position: relative;
  background: none;
  border: none;
  color: var(--ink-35);
  cursor: pointer;
  font-family: 'Josefin Sans', 'Inter', sans-serif;
  font-size: 0.56rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  padding: 0.9rem 1.1rem 1rem;
  white-space: nowrap;
  transition: color 0.25s ease;
  flex-shrink: 0;
}

.blog-cat-btn::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%; right: 50%;
  height: 2px;
  background: var(--terracotta);
  border-radius: 1px 1px 0 0;
  transition: left 0.3s ease, right 0.3s ease;
}

.blog-cat-btn:hover { color: var(--ink-60); }
.blog-cat-btn.active { color: var(--terracotta); }
.blog-cat-btn.active::after { left: 12%; right: 12%; }

/* ══ POST GRID ═══════════════════════════════════════════════ */

.blog-grid-wrap {
  max-width: 1100px;
  margin-inline: auto;
  padding: 3rem 1.5rem 6rem;
}

/* Pinterest-style masonry columns */
.blog-grid {
  columns: 3 280px;
  column-gap: 1.5rem;
}

/* ── Card ─────────────────────────────────────────────────── */

.blog-card {
  break-inside: avoid;
  position: relative;
  display: block;
  background: var(--cream);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  margin-bottom: 1.5rem;
  box-shadow: var(--card-shadow);
  /* entrance */
  opacity: 0;
  transform: translateY(20px);
  transition:
    box-shadow 0.35s ease,
    transform 0.35s cubic-bezier(0.22,1,0.36,1),
    opacity 0.35s ease;
}

.blog-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.blog-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-4px);
}

/* ── Card image ───────────────────────────────────────────── */

.blog-card-img-wrap {
  position: relative;
  overflow: hidden;
}

.blog-card-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  background: var(--sand);
  transform: scale(1);
  transition: transform 0.55s cubic-bezier(0.22,1,0.36,1);
}
.blog-card:hover .blog-card-img { transform: scale(1.06); }

/* warm gradient vignette at image bottom */
.blog-card-img-wrap::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 40%;
  background: linear-gradient(to top, rgba(255,254,249,0.5) 0%, transparent 100%);
  pointer-events: none;
}

.blog-card-img-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sand);
  font-size: 2rem;
  color: rgba(44,31,20,0.18);
  transition: color 0.35s;
}
.blog-card:hover .blog-card-img-placeholder { color: rgba(184,92,58,0.35); }

/* ── Category chip on card ────────────────────────────────── */

.blog-card-cat-chip {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: var(--cream);
  color: var(--terracotta);
  font-family: 'Josefin Sans', 'Inter', sans-serif;
  font-size: 0.5rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(44,31,20,0.12);
  z-index: 2;
}

/* ── Card body ────────────────────────────────────────────── */

.blog-card-body { padding: 1.15rem 1.25rem 1.5rem; }

.blog-card-cat {
  display: none; /* replaced by chip overlay on image */
}

.blog-card-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.22rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 0.55rem;
  transition: color 0.2s;
}
.blog-card:hover .blog-card-title { color: var(--terracotta); }

.blog-card-date {
  font-size: 0.56rem;
  color: var(--ink-35);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.7rem;
}

.blog-card-excerpt {
  font-size: 0.79rem;
  line-height: 1.72;
  color: var(--ink-60);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-read {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.9rem;
  font-size: 0.54rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--terracotta);
  opacity: 0.75;
  transition: opacity 0.22s, gap 0.3s ease;
}
.blog-card-read::after {
  content: '→';
  transition: transform 0.3s ease;
}
.blog-card:hover .blog-card-read { opacity: 1; gap: 0.65rem; }
.blog-card:hover .blog-card-read::after { transform: translateX(3px); }

/* ── Featured card ────────────────────────────────────────── */

.blog-card.blog-card-featured .blog-card-img { aspect-ratio: 16/9; }
.blog-card.blog-card-featured .blog-card-title { font-size: 1.55rem; }

/* ── Empty state ──────────────────────────────────────────── */

.blog-empty {
  column-span: all;
  text-align: center;
  padding: 5rem 1rem;
  color: var(--ink-35);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

/* ══ POST LIGHTBOX ═══════════════════════════════════════════ */

.blog-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(30,17,8,0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.blog-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.blog-modal {
  background: var(--cream);
  border-radius: 14px 14px 0 0;
  width: 100%;
  max-width: 700px;
  max-height: 92vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.42s cubic-bezier(0.22,1,0.36,1);
  position: relative;
  box-shadow: 0 -8px 48px rgba(30,17,8,0.2);
  scrollbar-width: thin;
  scrollbar-color: rgba(44,31,20,0.18) transparent;
}
.blog-modal-overlay.open .blog-modal { transform: translateY(0); }

.blog-modal-handle {
  width: 40px;
  height: 3px;
  border-radius: 2px;
  background: rgba(44,31,20,0.16);
  margin: 1rem auto 0;
}

.blog-modal-img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  display: block;
  margin-top: 0.75rem;
}

.blog-modal-body {
  padding: 1.8rem 2rem 2.8rem;
}

.blog-modal-cat {
  font-size: 0.52rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--terracotta);
  margin-bottom: 0.7rem;
}

.blog-modal-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.75rem, 5vw, 2.4rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.15;
  color: var(--ink);
  margin-bottom: 0.6rem;
}

.blog-modal-date {
  font-size: 0.58rem;
  color: var(--ink-35);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 1.6rem;
  padding-bottom: 1.3rem;
  border-bottom: 1px solid var(--hairline);
}

.blog-modal-text {
  font-size: 0.95rem;
  line-height: 1.9;
  color: var(--ink-60);
  white-space: pre-line;
}

.blog-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--linen);
  border: 1px solid var(--hairline);
  color: var(--ink-60);
  font-size: 0.95rem;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
  z-index: 10;
}
.blog-modal-close:hover {
  color: var(--ink);
  background: var(--sand);
}
.blog-modal-close:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
}

/* ══ FOOTER ═════════════════════════════════════════════════ */

.blog-footer {
  border-top: 1px solid var(--hairline);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-35);
  background: var(--linen);
}

/* ══ RESPONSIVE ═════════════════════════════════════════════ */

@media (max-width: 860px) {
  .blog-grid { columns: 2 240px; }
}

@media (max-width: 540px) {
  .blog-hero { padding: 6.5rem 1.2rem 3.5rem; }
  .blog-hero-title { font-size: clamp(2.6rem, 11vw, 3.8rem); }
  .blog-grid { columns: 1; }
  .blog-grid-wrap { padding: 2rem 1rem 4rem; }
  .blog-cats { justify-content: flex-start; }
  .blog-modal-body { padding: 1.3rem 1.3rem 2rem; }
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .blog-hero-eyebrow, .blog-hero-title, .blog-hero-rule, .blog-hero-sub {
    animation: none; opacity: 1;
  }
  .blog-hero::after { animation: none; }
  .blog-card { transition: none; opacity: 1; transform: none; }
  .blog-modal, .blog-modal-overlay { transition: opacity 0.15s; }
  .blog-modal { transform: none; }
}
