/* Custom layer on top of Tailwind — design language: clean bands,
   photo-forward cards, bold type, pill buttons. */
:root {
  --ink: #14140f;
  --sand: #f4f5f1;
  --leaf: #3f6212;
  --amber: #d97706;

  /* Corner radius — change --radius once; Tailwind rounded-xl…4xl scale from it. */
  --radius: 1.2rem; /* main cards / panels (rounded-4xl) */
  --radius-sm: calc(var(--radius) * 0.375); /* rounded-xl  → 0.75rem at default */
  --radius-md: calc(var(--radius) * 0.5); /* rounded-2xl → 1rem */
  --radius-lg: calc(var(--radius) * 0.75); /* rounded-3xl → 1.5rem */
  --radius-xl: var(--radius); /* rounded-4xl */
  --radius-pill: 999px;
}

html {
  scroll-behavior: smooth;
}

/* Tailwind's display utilities outrank the hidden attribute */
[hidden] {
  display: none !important;
}

body {
  font-feature-settings: "ss01" on, "cv11" on;
}

/* ── Buttons ────────────────────────────────────────────── */

.btn-dark,
.btn-light,
.btn-ghost,
.btn-outline-light {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: var(--radius-pill);
  padding: 0.7rem 1.35rem;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease,
    border-color 0.15s ease, transform 0.15s ease;
}

.btn-dark {
  background: var(--ink);
  color: #fff;
}

.btn-dark:hover {
  background: #2c2c22;
}

.btn-ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid #e9ebe3;
}

.btn-ghost:hover {
  background: var(--sand);
}

.btn-light {
  background: #fff;
  color: var(--ink);
}

.btn-light:hover {
  background: #f0f1ec;
}

.btn-outline-light {
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-dark:active,
.btn-light:active,
.btn-ghost:active,
.btn-outline-light:active {
  transform: translateY(1px);
}

/* ── Section furniture ──────────────────────────────────── */

.section-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #67675a;
}

.section-eyebrow .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
}

/* ── Hero ───────────────────────────────────────────────── */

.hero-blob {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  background: #fff;
  box-shadow: 0 18px 40px -22px rgba(20, 20, 15, 0.35);
  font-size: 1.75rem;
  user-select: none;
  pointer-events: none;
}

.hero-blob--a {
  top: 12%;
  left: 6%;
  width: 68px;
  height: 68px;
}

.hero-blob--b {
  top: 34%;
  left: 13%;
  width: 52px;
  height: 52px;
  font-size: 1.35rem;
}

.hero-blob--c {
  top: 15%;
  right: 7%;
  width: 62px;
  height: 62px;
}

.hero-blob--d {
  top: 38%;
  right: 14%;
  width: 48px;
  height: 48px;
  font-size: 1.25rem;
}

@media (max-width: 1023px) {
  .hero-blob {
    display: none;
  }
}

/* ── How it works ───────────────────────────────────────── */

.step-item {
  position: relative;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.75);
  padding: 1.5rem 1.25rem;
  text-align: center;
}

@media (min-width: 640px) {
  .step-item {
    background: transparent;
    padding: 0 1.5rem;
  }
}

.step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-pill);
  background: #fff;
  border: 1px solid #e9ebe3;
  font-size: 1.4rem;
  margin-bottom: 0.9rem;
}

.step-title {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.95rem;
}

.step-text {
  margin-top: 0.3rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #67675a;
}

/* Dashed connector between steps, like the reference layout */
.step-arrow {
  display: none;
}

@media (min-width: 640px) {
  .step-arrow {
    display: block;
    position: absolute;
    top: 26px;
    left: -22%;
    width: 44%;
    height: 14px;
    border-top: 2px dashed #d3d7c8;
    border-radius: 50%;
  }
}

/* ── Search ─────────────────────────────────────────────── */

.search-shell:focus-within {
  background: #fff;
  border-color: var(--ink);
  box-shadow: 0 0 0 4px rgba(20, 20, 15, 0.06);
}

.search-item {
  transition: background-color 0.12s ease;
  cursor: pointer;
}

.search-item.is-active,
.search-item:hover {
  background-color: var(--sand);
}

/* ── Open Graph preview cards ───────────────────────────── */

/* The whole card is the link, so the title carries the affordance. */
.og-card:hover .og-title,
.og-card:focus-visible .og-title {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.og-card:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ── Sidenav ────────────────────────────────────────────── */

/* Search results only, since the recipe sidenav was removed. */
.nav-tile {
  background: #fff;
  border: 1px solid #e9ebe3;
}


/* ── Product / affiliate cards ──────────────────────────── */

/* Gradient plate behind each product emoji — stands in for photography
   until real product shots are dropped into assets/images. */
.product-tile {
  background: linear-gradient(150deg, #fdf3d7 0%, #eef5dd 100%);
  border: 1px solid rgba(20, 20, 15, 0.06);
}

.product-tile--plate {
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.9) 0%, transparent 42%),
    linear-gradient(150deg, #fdf3d7 0%, #eef5dd 100%);
}

.affiliate-card {
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    transform 0.15s ease;
}

.affiliate-card:hover {
  transform: translateY(-2px);
}

/* Decorative glow behind the dark shop header */
.shop-hero-glow {
  position: absolute;
  inset: -45% -15% auto auto;
  width: 280px;
  height: 280px;
  border-radius: var(--radius-pill);
  background: radial-gradient(
    circle,
    rgba(245, 158, 11, 0.35) 0%,
    transparent 65%
  );
  pointer-events: none;
}

/* Flash a product when reached from the search bar */
@keyframes pulse-highlight {
  0% {
    box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.5);
  }
  100% {
    box-shadow: 0 0 0 14px rgba(217, 119, 6, 0);
  }
}

.pulse-highlight {
  animation: pulse-highlight 1.1s ease-out 2;
  border-color: rgba(217, 119, 6, 0.6) !important;
}

/* ── Subscribe outcome dialog ───────────────────────────── */

/* The dialog element fills the viewport so a click outside the panel lands on
   it — that is what closeDialog() keys on for backdrop clicks. */
.subscribe-dialog {
  width: 100%;
  max-width: none;
  max-height: none;
  height: 100%;
  border: 0;
  padding: 1rem;
  background: transparent;
  overflow: auto;
}

.subscribe-dialog::backdrop {
  background: rgba(20, 20, 15, 0.55);
  backdrop-filter: blur(2px);
}

.subscribe-dialog[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.subscribe-dialog__panel {
  width: 100%;
  max-width: 26rem;
  border-radius: var(--radius);
  background: #fff;
  padding: 2rem 1.75rem;
  text-align: center;
  box-shadow: 0 30px 70px -30px rgba(20, 20, 15, 0.5);
  animation: subscribe-dialog-in 0.18s ease-out;
}

.subscribe-dialog__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  margin-bottom: 1rem;
  border-radius: var(--radius-pill);
  background: var(--sand);
  font-size: 1.9rem;
  line-height: 1;
}

.subscribe-dialog[data-tone="error"] .subscribe-dialog__icon {
  background: #fdf0e2;
}

@keyframes subscribe-dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

/* ── Newsletter promo ───────────────────────────────────── */

.promo-blob {
  position: absolute;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.promo-blob--a {
  top: -40px;
  right: 8%;
  width: 190px;
  height: 190px;
  font-size: 3.5rem;
}

.promo-blob--b {
  bottom: -60px;
  right: 24%;
  width: 150px;
  height: 150px;
  font-size: 2.75rem;
}

@media (max-width: 767px) {
  .promo-blob {
    display: none;
  }
}

/* ── Scrollbars ─────────────────────────────────────────── */

.slim-scroll::-webkit-scrollbar {
  width: 6px;
}

.slim-scroll::-webkit-scrollbar-thumb {
  background: #dcded4;
  border-radius: var(--radius-pill);
}

.slim-scroll::-webkit-scrollbar-track {
  background: transparent;
}

/* Placeholder dish illustration when a recipe has no photo */
.dish-placeholder {
  background:
    radial-gradient(circle at 28% 30%, #fde9a9 0%, transparent 45%),
    radial-gradient(circle at 72% 62%, #d5ecc0 0%, transparent 42%),
    linear-gradient(150deg, #fdf3d7, #eef5dd);
}

/* ── Mobile sticky CTA ──────────────────────────────────── */

.cta-hidden {
  transform: translateY(120%);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .search-item,
  .affiliate-card,
  .pulse-highlight,
  .subscribe-dialog__panel,
  #mobile-cta {
    transition: none;
    animation: none;
  }
}

/* A prerendered recipe page leads with the recipe. The hero is a homepage
   pitch, and on a shared link it buried the dish the visitor came for under
   roughly two viewport heights of scrolling. */
body.is-recipe #hero {
  display: none;
}
