/* Homepage-only layer, loaded after tokens/components/custom via base.html's
   extra_css block. Classes are prefixed .home- so nothing here collides with
   or leaks onto other pages (the shared .recipe-card etc. in custom.css are
   deliberately left alone). */

/* --- Hero -------------------------------------------------------------
   Full-bleed like .blog-hero: breaks out of main.container, then cancels
   main's top padding so it sits flush under the header. */
.home-hero {
  margin-inline: calc(50% - 50vw);
  margin-block-start: -1.5rem;
  padding-block: clamp(3.5rem, 8vw, 6rem) clamp(4rem, 7vw, 5.5rem);
  background:
    radial-gradient(1100px 480px at 18% -20%, var(--c-crimson-800), transparent 60%),
    var(--c-darkbrown);
  color: #f3ece2;
  position: relative;
  overflow: hidden;
}
.home-hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; pointer-events: none; }
.home-hero-inner { max-inline-size: 1140px; margin-inline: auto; padding-inline: var(--bs-gutter-x, .75rem); position: relative; z-index: 1; }

.home-kicker {
  display: inline-flex; align-items: center; gap: .55rem;
  text-transform: uppercase; letter-spacing: .16em; font-size: .72rem; font-weight: 700;
  color: var(--c-gold); margin-block-end: .9rem;
}
.home-kicker::before { content: ""; inline-size: 22px; block-size: 2px; background: var(--c-gold); }

.home-hero h1 {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: clamp(2.1rem, 4.4vw, 3.6rem);
  line-height: 1.1;
  letter-spacing: -.01em;
  max-inline-size: 17ch;
  color: #fff;
  margin: 0;
}
.home-hero-intro { max-inline-size: 48ch; margin-block-start: 1.1rem; font-size: 1.02rem; color: #dccabd; }

.home-vitals { display: flex; flex-wrap: wrap; gap: .6rem; margin-block-start: 1.75rem; }
.home-vital {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius-pill); padding: .5rem 1rem; font-size: .84rem; font-weight: 600;
}
.home-vital .bi { color: var(--c-gold); }

.home-hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 1.2rem; margin-block-start: 2rem; }
.home-cta-btn {
  display: inline-block;
  background-color: var(--c-gold);
  border: 1px solid var(--c-gold);
  color: var(--c-charcoal);
  font-weight: 700; font-size: .92rem;
  padding: .75rem 1.5rem; border-radius: var(--radius-pill); text-decoration: none;
  box-shadow: 0 .6rem 1.4rem rgba(255, 204, 1, .22);
  transition: transform .25s cubic-bezier(.2, .8, .2, 1), box-shadow .25s ease, background-color .25s ease;
}
.home-cta-btn:hover, .home-cta-btn:focus {
  background-color: var(--c-gold-600); color: var(--c-charcoal);
  transform: translateY(-2px); box-shadow: 0 .9rem 1.8rem rgba(255, 204, 1, .3);
}
.home-rating-line { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; color: #d3c2b6; }
.home-rating-line .bi { color: var(--c-gold); }

.home-scroll-cue {
  position: absolute; inset-block-end: 1.4rem; inset-inline-start: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
  color: #d3c2b6; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  text-decoration: none; animation: home-bob 2.2s ease-in-out infinite;
}
@keyframes home-bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 6px); } }

/* --- Sections ----------------------------------------------------------- */
.home-section { padding-block: clamp(3rem, 6vw, 4.5rem); }

/* Full-bleed tinted band, same breakout trick as .blog-hero/.home-hero: the
   background spans the viewport edge-to-edge while .home-section-inner
   re-centers the content at the normal container width, so headings/tiles
   still line up with every other section instead of sitting flush against
   the tint's own edges. */
.home-section-tinted {
  margin-inline: calc(50% - 50vw);
  background: var(--surface);
}
.home-section-inner {
  max-inline-size: 1140px;
  margin-inline: auto;
  padding-inline: var(--bs-gutter-x, .75rem);
}

.home-section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-block-end: 1.75rem; }
.home-eyebrow {
  display: block; text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; font-weight: 700;
  color: var(--c-crimson); margin-block-end: .45rem;
}
.home-section-head h2 { font-family: "Playfair Display", serif; font-weight: 700; font-size: clamp(1.5rem, 2.2vw, 2rem); margin: 0; color: var(--c-charcoal); }
.home-section-link { font-size: .88rem; font-weight: 700; text-decoration: none; color: var(--c-n-700); white-space: nowrap; }
.home-section-link:hover { color: var(--c-charcoal); }

.home-reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s cubic-bezier(.2, .7, .2, 1), transform .6s cubic-bezier(.2, .7, .2, 1); }
.home-reveal.in-view { opacity: 1; transform: translateY(0); }
.home-reveal-stagger.in-view > * { transition-delay: calc(var(--i, 0) * 80ms); }

/* --- Shelf (horizontal scroll-snap) ------------------------------------- */
/* overflow-x: auto with overflow-y left unset computes overflow-y to auto too
   (CSS Overflow spec), which clips the cards' hover lift/shadow at the top and
   bottom edges of the scroll box. Block padding buys back that room instead of
   fighting the spec by setting overflow-y: visible (which would also disable
   the scrollbar on that axis). */
.home-shelf {
  display: flex; gap: 1.25rem; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-block: 1.25rem 2rem; margin-block: -1.25rem -2rem;
  scrollbar-width: none;
}
.home-shelf::-webkit-scrollbar { display: none; }
.home-shelf > * { scroll-snap-align: start; flex: 0 0 min(300px, 80vw); }

.home-card {
  background: var(--c-n-0); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; text-decoration: none; color: var(--text); display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease, border-color .3s ease;
}
.home-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--c-n-400); }
.home-card-art {
  height: 160px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-soft), var(--c-n-0));
  color: var(--c-gold-600); position: relative;
}
.home-card-art img { width: 100%; height: 100%; object-fit: cover; }
.home-card-art .bi { font-size: 2.75rem; opacity: .85; }
.home-card-cat {
  position: absolute; inset-block-start: .65rem; inset-inline-start: .65rem;
  background: var(--c-charcoal); color: #fff; font-size: .66rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; padding: .28rem .6rem; border-radius: var(--radius-pill);
}
.home-card-body { padding: 1.05rem 1.15rem 1.25rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.home-card h3 { font-family: "Playfair Display", serif; font-size: 1.02rem; line-height: 1.3; margin: 0; color: var(--c-charcoal); }
.home-card p { margin: 0; font-size: .84rem; color: var(--c-n-500); flex: 1; }
.home-card-meta {
  display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  font-size: .76rem; color: var(--c-n-700); font-weight: 600;
  margin-block-start: .35rem; padding-block-start: .65rem; border-block-start: 1px dashed var(--border);
}
.home-card-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.home-card-meta .bi-star-fill { color: var(--c-gold-600); }

.home-ghost {
  border: 1.5px dashed var(--c-n-300); border-radius: var(--radius-lg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  gap: .55rem; padding: 2rem 1.4rem; color: var(--c-n-500); min-height: 100%;
}
.home-ghost .bi { font-size: 1.9rem; color: var(--c-crimson); opacity: .7; }
.home-ghost strong { color: var(--c-n-700); font-size: .9rem; }
.home-ghost span { font-size: .8rem; }

.home-shelf-nav { display: flex; gap: .5rem; justify-content: flex-end; margin-block-start: .75rem; }
.home-shelf-btn {
  inline-size: 2.15rem; block-size: 2.15rem; border-radius: 50%; border: 1px solid var(--border);
  background: var(--c-n-0); display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: var(--c-n-700); transition: background .2s ease, color .2s ease;
}
.home-shelf-btn:hover { background: var(--c-charcoal); color: #fff; }
/* Mirror the chevron glyphs in RTL rather than swapping icon classes, so
   "back"/"forward" still point the visually correct way. */
[dir="rtl"] .home-shelf-btn .bi { display: inline-block; transform: scaleX(-1); }

/* --- Category tiles ------------------------------------------------------ */
.home-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.1rem; }
.home-tile {
  position: relative; padding: 1.5rem 1.4rem; border-radius: var(--radius);
  background: var(--c-n-0); border: 1px solid var(--border); text-decoration: none; color: var(--text);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease;
}
.home-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-sm); }
.home-tile .bi { font-size: 1.8rem; margin-block-end: .75rem; display: block; }
.home-tile h3 { font-size: 1rem; font-weight: 800; margin: 0; color: var(--c-charcoal); }
.home-tile p { margin: .3rem 0 0; font-size: .82rem; color: var(--c-n-500); }

/* --- Podcast feature ------------------------------------------------------ */
.home-pod {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.25rem;
  background: var(--c-n-0); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 1.3rem 1.5rem; box-shadow: var(--shadow-sm); text-decoration: none; color: var(--text);
}
.home-pod-play {
  inline-size: 3.1rem; block-size: 3.1rem; border-radius: 50%; background: var(--c-charcoal); color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
.home-pod:hover .home-pod-play { transform: scale(1.08); background: var(--c-gold); color: var(--c-charcoal); }
.home-pod-title { font-family: "Playfair Display", serif; font-size: 1.1rem; margin: 0 0 .25rem; color: var(--c-charcoal); }
.home-pod-meta { font-size: .82rem; color: var(--c-n-500); margin: 0; }
.home-pod-wave { display: flex; align-items: flex-end; gap: 3px; block-size: 1.9rem; }
.home-pod-wave span { inline-size: 3px; background: var(--c-blue); border-radius: 2px; opacity: .55; animation: home-wave 1.4s ease-in-out infinite; }
@keyframes home-wave { 0%, 100% { height: 30%; } 50% { height: 100%; } }
@media (max-width: 640px) { .home-pod { grid-template-columns: auto 1fr; } .home-pod-wave { display: none; } }

/* --- Subscribe panel ------------------------------------------------------ */
.home-subscribe {
  background: linear-gradient(135deg, var(--c-darkbrown), var(--c-crimson-800));
  color: #f3ece2; border-radius: var(--radius-lg); padding: clamp(2rem, 5vw, 3.25rem); text-align: center;
}
.home-subscribe .bi { font-size: 2.2rem; color: var(--c-gold); }
.home-subscribe h2 { font-family: "Playfair Display", serif; color: #fff; font-size: clamp(1.4rem, 2.4vw, 1.85rem); margin: .75rem 0 0; }
.home-subscribe p { max-inline-size: 46ch; margin: .75rem auto 0; color: #dccabd; font-size: .95rem; }
.home-subscribe .js-subscribe-form { max-inline-size: 420px; margin: 1.5rem auto 0; text-align: start; }
.home-subscribe .form-control {
  background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .28); color: #fff;
}
.home-subscribe .form-control::placeholder { color: #cbb9ac; }
.home-subscribe .subscribe-feedback { color: #dccabd; }

/* --- Scroll-progress crumb rail -------------------------------------------- */
.home-crumb-rail {
  position: fixed; inset-block-start: 50%; inset-inline-end: 1.4rem; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: .9rem; z-index: 40;
}
.home-crumb-rail button {
  inline-size: .55rem; block-size: .55rem; border-radius: 50%; border: none; background: var(--c-n-300);
  cursor: pointer; padding: 0; position: relative; transition: background .25s ease, transform .25s ease;
}
.home-crumb-rail button.active { background: var(--c-crimson); transform: scale(1.5); }
.home-crumb-rail button .home-crumb-label {
  position: absolute; inset-inline-end: 1.1rem; inset-block-start: 50%; transform: translateY(-50%);
  font-size: .7rem; white-space: nowrap; background: var(--c-charcoal); color: #fff;
  padding: .25rem .55rem; border-radius: var(--radius-pill); opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
[dir="rtl"] .home-crumb-rail button .home-crumb-label { inset-inline-end: auto; inset-inline-start: 1.1rem; }
.home-crumb-rail button:hover .home-crumb-label { opacity: 1; }
@media (max-width: 1100px) { .home-crumb-rail { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .home-reveal { opacity: 1; transform: none; transition: none; }
  .home-scroll-cue, .home-pod-wave span { animation: none; }
  .home-hero-canvas { display: none; }
}
