/* ==========================================================================
   Arròs — editorial Mediterranean design system
   Saffron · terracotta · sea · squid ink, on rice-paper grain.
   ========================================================================== */
:root {
  --paper: #fbf5ea;
  --paper-2: #f4ead7;
  --paper-3: #ecdfc6;
  --card: #fffaf1;
  --ink: #241c14;
  --ink-soft: #66574a;
  --ink-faint: #9a8a78;
  --line: #e4d6bd;
  --saffron: #e3a21a;
  --saffron-2: #f2c14e;
  --saffron-deep: #a8700a;
  --terracotta: #c0532f;
  --terracotta-2: #e07a50;
  --sea: #1f6f7d;
  --sea-2: #3f98a6;
  --tint-seco: #f7dd9c;
  --tint-meloso: #f4d6b6;
  --tint-caldoso: #f2c2a6;
  --radius: 22px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgb(60 35 10 / 0.06), 0 8px 24px -12px rgb(60 35 10 / 0.25);
  --shadow-lg: 0 2px 4px rgb(60 35 10 / 0.06), 0 30px 60px -24px rgb(60 35 10 / 0.45);
  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, "Noto Serif Thai", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans Thai", "Leelawadee UI", "Thonburi", sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --header-h: 68px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #16120e;
    --paper-2: #1f1913;
    --paper-3: #2a2219;
    --card: #1d1712;
    --ink: #f5ecdd;
    --ink-soft: #c4b49f;
    --ink-faint: #8d7d6a;
    --line: #382d22;
    --saffron: #f2b53a;
    --saffron-2: #f7cd6b;
    --saffron-deep: #f2b53a;
    --terracotta: #ec8160;
    --terracotta-2: #f19a7a;
    --sea: #6cc0cc;
    --sea-2: #8fd3dc;
    --tint-seco: #3a2c12;
    --tint-meloso: #3a2618;
    --tint-caldoso: #3b2017;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px -14px rgb(0 0 0 / 0.7);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / 0.3), 0 30px 60px -20px rgb(0 0 0 / 0.8);
  }
}

@view-transition { navigation: auto; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink);
  font: 17px/1.7 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
/* rice-paper grain */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45  0 0 0 0 .32  0 0 0 0 .18  0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.08; letter-spacing: -0.02em; font-variation-settings: "SOFT" 50, "WONK" 0; text-wrap: balance; }
p { text-wrap: pretty; }
a { color: var(--terracotta); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--saffron-deep); }
svg { display: block; }
::selection { background: var(--saffron-2); color: #241c14; }
:focus-visible { outline: 2.5px solid var(--saffron); outline-offset: 3px; border-radius: 6px; }
.skip { position: absolute; inset-inline-start: -999px; }
.skip:focus { inset-inline-start: 12px; top: 12px; z-index: 100; background: var(--ink); color: var(--paper); padding: 0.5rem 0.8rem; border-radius: 8px; }

.kicker { margin: 0; font: 700 0.76rem/1.2 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--terracotta); }
.kicker a { color: inherit; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.22rem); color: var(--ink-soft); max-width: 40rem; line-height: 1.65; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 clamp(1.1rem, 4vw, 3rem); }
.section-title { font-size: clamp(1.7rem, 3.4vw, 2.6rem); margin: 0.4rem 0 1.6rem; }
.section-title.big { font-size: clamp(2.2rem, 5.2vw, 4.2rem); font-variation-settings: "SOFT" 100, "WONK" 1; max-width: 18ch; }

/* ---------- Reading progress ---------- */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--saffron), var(--terracotta)); }
@supports (animation-timeline: scroll()) {
  .progress { animation: grow linear both; animation-timeline: scroll(root); }
  @keyframes grow { to { transform: scaleX(1); } }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 1rem;
  height: var(--header-h); padding: 0 clamp(1rem, 4vw, 2.5rem);
  transition: background 0.3s, box-shadow 0.3s, height 0.3s var(--ease-out);
  view-transition-name: site-header;
}
.site-header.scrolled {
  height: 58px; background: color-mix(in srgb, var(--paper) 78%, transparent);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); box-shadow: 0 1px 0 var(--line);
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); font: 650 1.45rem/1 var(--display); letter-spacing: -0.02em; font-variation-settings: "SOFT" 100, "WONK" 1; }
.brand:hover { color: var(--ink); }
.brand-pan {
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #fff6 0 10%, transparent 11%), radial-gradient(circle, var(--saffron-2) 0 50%, var(--saffron) 51% 60%, #8f4f17 61% 66%, #52575e 67% 100%);
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.25); transition: transform 0.6s var(--spring);
}
.brand:hover .brand-pan { transform: rotate(140deg) scale(1.08); }
.main-nav { margin-inline-start: auto; display: flex; gap: 0.15rem; padding: 4px; border-radius: 999px; background: color-mix(in srgb, var(--paper-2) 70%, transparent); border: 1px solid var(--line); }
.main-nav a { color: var(--ink-soft); text-decoration: none; padding: 0.42rem 0.95rem; border-radius: 999px; font-size: 0.92rem; font-weight: 550; transition: color 0.2s, background 0.2s; }
.main-nav a:hover { color: var(--ink); background: var(--paper-3); }
.main-nav a[aria-current="page"] { color: var(--paper); background: var(--ink); }
.lang { position: relative; }
.lang summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; font-weight: 550;
  color: var(--ink-soft); padding: 0.45rem 0.85rem; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; transition: border-color 0.2s, color 0.2s;
}
.lang summary svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover, .lang[open] summary { color: var(--ink); border-color: var(--saffron); }
.lang-menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 200px; z-index: 20; display: flex; flex-direction: column; padding: 0.4rem;
  border-radius: 16px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-lg); transform-origin: top right; animation: pop 0.25s var(--ease-out);
}
@keyframes pop { from { opacity: 0; transform: scale(0.94) translateY(-4px); } }
.lang-menu a { padding: 0.55rem 0.8rem; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; }
.lang-menu a:hover { background: var(--paper-2); }
.lang-menu a[aria-current="true"] { background: var(--paper-2); font-weight: 700; }
.lang-menu a[aria-current="true"]::after { content: "✓"; float: inline-end; color: var(--saffron-deep); }

/* ---------- Buttons, chips, tags ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem; cursor: pointer; font: 600 0.95rem/1 var(--sans); color: var(--ink); text-decoration: none;
  padding: 0.85rem 1.25rem; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  transition: transform 0.25s var(--spring), box-shadow 0.25s, background 0.2s, border-color 0.2s;
}
.btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); border-color: var(--saffron); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary:hover { color: var(--paper); background: color-mix(in srgb, var(--ink) 88%, var(--terracotta)); }
.btn[aria-pressed="true"] { background: var(--saffron); border-color: var(--saffron); color: #241c14; }
.chip { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.02em; padding: 0.26rem 0.7rem 0.26rem 0.55rem; border-radius: 999px; background: var(--paper-2); color: var(--ink); }
.chip i { width: 8px; height: 8px; border-radius: 50%; }
.chip-seco i, .dot-seco { background: var(--saffron); }
.chip-meloso i, .dot-meloso { background: var(--terracotta); }
.chip-caldoso i, .dot-caldoso { background: var(--sea); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-inline-end: 0.45rem; vertical-align: 1px; }
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.4rem 0 0; }
.tags .chip { font-size: 0.82rem; padding: 0.4rem 0.85rem 0.4rem 0.7rem; }
.tag { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; font-weight: 600; padding: 0.4rem 0.85rem; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; background: var(--card); }
a.tag:hover { border-color: var(--saffron); color: var(--ink); }
.tag-k { color: var(--ink-faint); font-weight: 500; }
.pin { width: 7px; height: 7px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--terracotta); display: inline-block; flex: none; }
.note, .i18n-note { padding: 0.75rem 1rem; border-radius: var(--radius-sm); font-size: 0.92rem; color: var(--ink-soft); background: color-mix(in srgb, var(--saffron) 13%, transparent); border: 1px solid color-mix(in srgb, var(--saffron) 35%, transparent); }
.i18n-note { margin: 1.2rem 0 0; max-width: 40rem; }

/* ---------- Pan illustrations ---------- */
.pan { width: 100%; height: auto; overflow: visible; }
.pan-spin, .pan-food { transform-box: view-box; transform-origin: 50% 50%; }
.pan-steam path { fill: none; stroke: #fff; stroke-width: 7; stroke-linecap: round; opacity: 0; filter: blur(3px); transform-box: fill-box; transform-origin: 50% 100%; }
.hero-pan .pan-steam path, .tex-tile .pan-steam path { animation: steam 4.2s ease-in-out infinite; animation-delay: calc(var(--d) * 1.3s); }
@keyframes steam { 0% { opacity: 0; transform: translateY(14px) scaleY(0.7); } 30% { opacity: 0.42; } 100% { opacity: 0; transform: translateY(-34px) scaleY(1.2); } }
.hero-pan .pan-spin { animation: spin 160s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Home hero ---------- */
.home .hero { position: relative; overflow: clip; margin-top: calc(var(--header-h) * -1); padding: calc(var(--header-h) + clamp(2rem, 6vw, 5rem)) 0 clamp(3rem, 7vw, 6rem); }
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-bg span { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.55; animation: drift 22s ease-in-out infinite alternate; }
.hero-bg span:nth-child(1) { width: 46vw; height: 46vw; inset-inline-end: -8vw; top: -12vw; background: var(--saffron-2); }
.hero-bg span:nth-child(2) { width: 30vw; height: 30vw; inset-inline-start: -10vw; bottom: -10vw; background: var(--terracotta-2); opacity: 0.32; animation-duration: 28s; }
.hero-bg span:nth-child(3) { width: 20vw; height: 20vw; inset-inline-start: 40vw; top: 30%; background: var(--sea-2); opacity: 0.16; animation-duration: 34s; }
@media (prefers-color-scheme: dark) { .hero-bg span { opacity: 0.18; } .hero-bg span:nth-child(3) { opacity: 0.1; } }
@keyframes drift { to { transform: translate(-4vw, 3vw) scale(1.12); } }
.hero-inner { max-width: 1240px; margin: 0 auto; padding: 0 clamp(1.1rem, 4vw, 3rem); display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; }
.hero-title { font-size: clamp(2.9rem, 7.6vw, 6.6rem); line-height: 0.96; margin: 0.9rem 0 1.4rem; letter-spacing: -0.035em; font-weight: 600; font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144; }
.hero-title .line { display: block; overflow: clip; padding-bottom: 0.08em; }
.hero-title .line:nth-child(2) { font-style: italic; color: var(--terracotta); font-weight: 500; }
.hero-title .word { display: inline-block; }
.js .hero-title .word { transform: translateY(105%); animation: rise 1s var(--ease-out) forwards; animation-delay: calc(0.15s + var(--w) * 0.06s); }
.js .hero-title .line:nth-child(2) .word { animation-delay: calc(0.4s + var(--w) * 0.06s); }
@keyframes rise { to { transform: none; } }
.js .hero-kicker, .js .hero-lede, .js .hero-cta { opacity: 0; animation: fadeUp 0.9s var(--ease-out) forwards; }
.js .hero-lede { animation-delay: 0.65s; }
.js .hero-cta { animation-delay: 0.8s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.hero-cta { margin-top: 0.6rem; }
.hero-visual { position: relative; aspect-ratio: 1; }
.hero-pan-wrap { position: absolute; inset: 0; }
.js .hero-pan-wrap { animation: panIn 1.4s var(--ease-out) 0.2s both; }
@keyframes panIn { from { opacity: 0; transform: rotate(-35deg) scale(0.85); } }
.hero-pan { filter: drop-shadow(0 30px 40px rgb(80 40 0 / 0.35)); }
.hero-stat {
  position: absolute; inset-inline-start: -2%; bottom: 10%; display: flex; flex-direction: column; align-items: flex-start; padding: 0.8rem 1.1rem; border-radius: 18px;
  background: color-mix(in srgb, var(--card) 80%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line); box-shadow: var(--shadow); animation: float 6s ease-in-out infinite;
}
.hero-stat-2 { inset-inline-start: auto; inset-inline-end: -2%; top: 8%; bottom: auto; animation-delay: -3s; }
.hero-stat strong { font: 650 2rem/1 var(--display); color: var(--saffron-deep); }
.hero-stat span { font-size: 0.78rem; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.1em; }
@keyframes float { 50% { transform: translateY(-10px); } }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; background: var(--ink); color: var(--paper); padding: 0.95rem 0; transform: rotate(-1.2deg) scale(1.02); margin: 1rem 0 3rem; }
.marquee-track { display: flex; gap: 2rem; width: max-content; animation: marquee 120s linear infinite; font: italic 500 1.35rem/1 var(--display); white-space: nowrap; }
.marquee-track i { font-style: normal; color: var(--saffron); }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Texture tiles ---------- */
.textures-sec { padding-top: 2rem; padding-bottom: 3rem; }
.textures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.tex-tile {
  position: relative; display: grid; grid-template-columns: 112px 1fr; align-items: center; gap: 1rem; padding: 1.2rem 1.4rem 1.2rem 1.1rem;
  border-radius: var(--radius); text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); overflow: hidden; isolation: isolate;
  transition: transform 0.4s var(--spring), box-shadow 0.3s, border-color 0.3s;
}
.tex-tile::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.55; background: radial-gradient(circle at 15% 50%, var(--tint), transparent 65%); transition: opacity 0.3s; }
.tex-seco { --tint: var(--tint-seco); }
.tex-meloso { --tint: var(--tint-meloso); }
.tex-caldoso { --tint: var(--tint-caldoso); }
.tex-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; color: var(--ink); }
.tex-tile:hover::before { opacity: 1; }
.tex-pan { transition: transform 1.2s var(--ease-out); }
.tex-tile:hover .tex-pan { transform: rotate(60deg) scale(1.06); }
.tex-tile strong { display: block; font: 600 1.5rem/1.1 var(--display); }
.tex-tile span { display: block; color: var(--ink-soft); font-size: 0.93rem; line-height: 1.45; margin-top: 0.25rem; }
.tex-tile em { position: absolute; top: 0.9rem; inset-inline-end: 1.1rem; font: 600 1.15rem var(--display); font-style: normal; color: var(--ink-faint); }

/* ---------- Toolbar & filters ---------- */
#recipes { padding-top: 1rem; padding-bottom: 5rem; }
.toolbar { position: sticky; top: 58px; z-index: 30; display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center; padding: 0.7rem; margin: 0 -0.7rem 0.5rem; border-radius: 22px; transition: background 0.3s, box-shadow 0.3s; }
.toolbar.stuck { background: color-mix(in srgb, var(--paper) 85%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow); }
.search { position: relative; flex: 1 1 260px; max-width: 420px; }
.search svg { position: absolute; inset-inline-start: 1rem; top: 50%; translate: 0 -50%; width: 18px; height: 18px; fill: none; stroke: var(--ink-faint); stroke-width: 2; stroke-linecap: round; }
.search input { width: 100%; padding: 0.78rem 1rem 0.78rem 2.7rem; font: inherit; font-size: 0.95rem; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 999px; transition: border-color 0.2s, box-shadow 0.2s; }
.search input:focus { outline: none; border-color: var(--saffron); box-shadow: 0 0 0 4px color-mix(in srgb, var(--saffron) 22%, transparent); }
.filters { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.filters button { font: 600 0.86rem/1 var(--sans); cursor: pointer; color: var(--ink-soft); padding: 0.62rem 0.95rem; border-radius: 999px; border: 1px solid var(--line); background: var(--card); transition: all 0.25s var(--ease-out); }
.filters button:hover { color: var(--ink); border-color: var(--ink-faint); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.regions-filter { flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; mask-image: linear-gradient(90deg, #000 92%, transparent); }
.regions-filter::-webkit-scrollbar { display: none; }
.regions-filter button { white-space: nowrap; }
.filter-selects { display: none; }
@media (max-width: 640px) {
  /* Phones: search on its own row, then two compact dropdowns instead of two rows of chips */
  .toolbar { gap: 0.5rem; }
  .toolbar .search { flex-basis: 100%; max-width: none; }
  .toolbar .filters { display: none; }
  .filter-selects { display: flex; gap: 0.5rem; flex-basis: 100%; }
  .filter-selects select {
    flex: 1 1 0; min-width: 0; appearance: none; -webkit-appearance: none; cursor: pointer;
    font: 600 0.9rem/1.2 var(--sans); color: var(--ink); text-overflow: ellipsis;
    padding: 0.7rem 2.1rem 0.7rem 1rem; border: 1px solid var(--line); border-radius: 999px;
    background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23887' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") right 0.9rem center / 11px no-repeat;
  }
  .filter-selects select:focus { outline: none; border-color: var(--saffron); box-shadow: 0 0 0 4px color-mix(in srgb, var(--saffron) 22%, transparent); }
  .filter-selects select.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
}
.count { color: var(--ink-faint); font-size: 0.88rem; font-weight: 600; margin: 0.4rem 0 1.2rem; }
.empty { color: var(--ink-soft); font: italic 1.2rem var(--display); text-align: center; padding: 3rem 0; }

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 1.4rem; }
.card {
  --tint: var(--tint-seco);
  position: relative; display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; isolation: isolate;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift, 0px));
  transition: transform 0.5s var(--ease-out), box-shadow 0.4s, border-color 0.3s, opacity 0.8s var(--ease-out);
}
.card.base-meloso, .card.base-leche { --tint: var(--tint-meloso); }
.card.base-caldoso, .card.base-caldoso-negro { --tint: var(--tint-caldoso); }
.card.base-negro { --tint: #d7d1d3; }
@media (prefers-color-scheme: dark) { .card.base-negro { --tint: #2b2729; } }
.card:hover { --lift: -6px; box-shadow: var(--shadow-lg); border-color: transparent; color: inherit; }
.card[hidden] { display: none; }
.card-visual { position: relative; aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 55%, var(--tint) 0 38%, color-mix(in srgb, var(--tint) 45%, var(--card)) 70%); }
.card-visual::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at var(--mx, 50%) var(--my, 30%), rgb(255 255 255 / 0.35), transparent 45%); opacity: 0; transition: opacity 0.3s; }
.card:hover .card-visual::after { opacity: 1; }
.card-visual .pan { width: 78%; margin-top: 8%; filter: drop-shadow(0 14px 16px rgb(70 35 5 / 0.3)); transition: transform 1.1s var(--ease-out); }
.card:hover .card-visual .pan { transform: scale(1.06) translateY(-3%); }
.card-visual .pan-spin { transition: transform 1.6s var(--ease-out); }
.card:hover .card-visual .pan-spin { transform: rotate(50deg); }
.card:hover .pan-steam path { animation: steam 3.2s ease-in-out infinite; animation-delay: calc(var(--d) * 0.9s); }
.card-body { padding: 1.1rem 1.3rem 1.25rem; display: flex; flex-direction: column; flex: 1; }
.card-meta { display: flex; align-items: center; gap: 0.5rem; }
.vessel { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
.card h3 { margin: 0.7rem 0 0.15rem; font-size: 1.5rem; }
.card .alt { margin: 0; color: var(--ink-soft); font: italic 400 1.02rem/1.35 var(--display); }
/* Plain-language description in the reader's language, under the authentic dish name */
.gloss { margin: 0.15rem 0 0.35rem; color: var(--ink); font: 600 0.98rem/1.4 var(--sans); opacity: 0.86; }
.recipe .gloss { font-size: clamp(1.05rem, 1.8vw, 1.25rem); margin: 0.35rem 0 0.4rem; }
.history-entry .gloss { margin: 0.2rem 0 0; }
.card .summary { margin: 0.7rem 0 0; font-size: 0.92rem; line-height: 1.55; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ft-hit { margin: 0.6rem 0 0; padding: 0.5rem 0.7rem; font-size: 0.84rem; line-height: 1.45; color: var(--ink-soft); background: color-mix(in srgb, var(--saffron) 10%, transparent); border-radius: 10px; }
.ft-hit mark { background: var(--saffron-2); color: #241c14; border-radius: 3px; padding: 0 0.15em; }
.card-foot { margin: auto 0 0; padding-top: 1rem; display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); }
.arrow { margin-inline-start: auto; font-size: 1.1rem; color: var(--ink); transition: transform 0.35s var(--spring); }
.card:hover .arrow, .region:hover .arrow { transform: translateX(5px); color: var(--terracotta); }

/* ---------- Scroll reveal ---------- */
.js [data-reveal]:not(.card) { opacity: 0; transform: translateY(28px); transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); transition-delay: calc(var(--i, 0) * 55ms); }
.js [data-reveal].in:not(.card) { opacity: 1; transform: none; }
.js .card[data-reveal]:not(.in) { opacity: 0; --lift: 28px; transition-delay: calc(var(--i, 0) * 55ms); }

/* ---------- Page hero (regions, history, about) ---------- */
.page-hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(1.5rem, 3vw, 2.5rem); position: relative; }
.page-hero h1 { font-size: clamp(2.6rem, 6.5vw, 5.2rem); margin: 0.6rem 0 0.4rem; font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144; }
.page-hero .alt-title { font: italic 400 1.35rem var(--display); color: var(--ink-soft); margin: 0; }
.mini-pans { display: flex; margin-top: 1.6rem; }
.mini-pans .pan { width: 92px; margin-inline-end: -22px; filter: drop-shadow(0 8px 10px rgb(70 35 5 / 0.25)); transition: transform 0.5s var(--spring); }
.mini-pans .pan:hover { transform: translateY(-8px) rotate(25deg); }

/* ---------- Recipe page ---------- */
.recipe-hero { max-width: 1240px; margin: 0 auto; padding: clamp(1.5rem, 4vw, 3rem) clamp(1.1rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2rem); display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; }
.rh-title { font-size: clamp(2.6rem, 6.4vw, 5.4rem); margin: 0.7rem 0 0.3rem; letter-spacing: -0.035em; font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144; }
.recipe .alt-title { font: italic 400 clamp(1.15rem, 2vw, 1.5rem)/1.3 var(--display); color: var(--ink-soft); margin: 0; }
.rh-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.6rem; }
.cook-hint { margin: 0.9rem 0 0; font-size: 0.88rem; color: var(--saffron-deep); font-weight: 600; }
.rh-visual { position: relative; }
.rh-visual::before { content: ""; position: absolute; inset: 6%; border-radius: 50%; z-index: -1; filter: blur(40px); opacity: 0.7; background: var(--tint-seco); }
.recipe.base-meloso .rh-visual::before, .recipe.base-leche .rh-visual::before { background: var(--tint-meloso); }
.recipe.base-caldoso .rh-visual::before { background: var(--tint-caldoso); }
.recipe.base-negro .rh-visual::before { background: #8a8486; opacity: 0.35; }
.js .recipe .rh-text > * { animation: fadeUp 0.8s var(--ease-out) both; }
.js .recipe .rh-text > :nth-child(2) { animation-delay: 0.06s; }
.js .recipe .rh-text > :nth-child(3) { animation-delay: 0.12s; }
.js .recipe .rh-text > :nth-child(n+4) { animation-delay: 0.18s; }

.page { max-width: 1240px; margin: 0 auto; padding: 1rem clamp(1.1rem, 4vw, 3rem) 4rem; }
.page.with-toc { display: grid; grid-template-columns: 240px minmax(0, 1fr); column-gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.toc { align-self: stretch; }
.toc nav { position: sticky; top: calc(var(--header-h) + 1.5rem); font-size: 0.9rem; }
.toc-title { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.7rem; font-weight: 700; color: var(--ink-faint); margin: 0 0 0.7rem; }
.toc ol { list-style: none; margin: 0; padding: 0; position: relative; }
.toc ol::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 2px; background: var(--line); border-radius: 2px; }
.toc li a { position: relative; display: block; padding: 0.38rem 0 0.38rem 1rem; color: var(--ink-soft); text-decoration: none; line-height: 1.35; transition: color 0.2s; }
.toc li a::before { content: ""; position: absolute; inset-inline-start: 0; top: 0.3rem; bottom: 0.3rem; width: 2px; border-radius: 2px; background: var(--saffron); transform: scaleY(0); transition: transform 0.35s var(--ease-out); }
.toc li a:hover, .toc li a.active { color: var(--ink); }
.toc li a.active { font-weight: 600; }
.toc li a.active::before { transform: none; }

/* ---------- Prose ---------- */
.prose { max-width: 46rem; min-width: 0; }
.prose.wide { max-width: 58rem; margin: 0 auto; }
.prose .sec { margin-bottom: 1rem; }
.prose h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin: 2.8rem 0 1rem; }
.prose h2 .anchor { display: flex; align-items: baseline; gap: 0.75rem; }
.prose .sec:first-child h2 { margin-top: 0.5rem; }
.h-num { font: 600 0.85rem/1 var(--sans); letter-spacing: 0.08em; color: var(--saffron-deep); padding: 0.35rem 0.55rem; border-radius: 8px; background: color-mix(in srgb, var(--saffron) 16%, transparent); flex: none; translate: 0 -0.25em; }
.prose h3 { font-size: 1.32rem; margin: 2.2rem 0 0.8rem; color: var(--terracotta); font-variation-settings: "SOFT" 100; }
.prose .anchor { color: inherit; text-decoration: none; }
.prose .anchor:hover { color: inherit; }
.prose ul { padding-inline-start: 1.2rem; }
.prose li { margin: 0.45rem 0; padding-inline-start: 0.2rem; }
.prose ul > li::marker { content: "◆  "; color: var(--saffron); font-size: 0.7em; }
.prose em { font-family: var(--display); font-style: italic; font-size: 1.04em; }
.prose strong { color: var(--ink); font-weight: 650; }
.prose blockquote { margin: 1.6rem 0; padding: 1rem 1.3rem; border-inline-start: 4px solid var(--saffron); background: var(--paper-2); border-radius: 0; border-start-end-radius: var(--radius-sm); border-end-end-radius: var(--radius-sm); }
.prose blockquote p { margin: 0.3rem 0; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2.5rem 0; }
.prose code { background: var(--paper-2); padding: 0.1em 0.35em; border-radius: 5px; font-size: 0.9em; }
.prose a { overflow-wrap: anywhere; }
.missing-link { border-bottom: 1px dotted var(--ink-faint); cursor: help; }
/* Ordered lists → numbered timeline */
.prose ol { list-style: none; counter-reset: step; padding: 0; margin: 1.2rem 0; }
.prose ol > li { counter-increment: step; position: relative; padding: 0.1rem 0 1rem 3.2rem; margin: 0; }
.prose ol > li::before { content: counter(step); position: absolute; inset-inline-start: 0; top: 0; width: 2.1rem; height: 2.1rem; border-radius: 50%; display: grid; place-items: center; font: 700 0.9rem/1 var(--sans); color: var(--paper); background: var(--ink); }
.prose ol > li:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: calc(1.05rem - 1px); top: 2.4rem; bottom: 0.2rem; width: 2px; background: var(--line); }
/* Tables */
.table-wrap { overflow-x: auto; margin: 1.3rem 0 1.8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.prose th, .prose td { padding: 0.7rem 0.95rem; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { background: var(--paper-2); font-weight: 700; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr { transition: background 0.2s; }
.prose tbody tr:hover { background: color-mix(in srgb, var(--saffron) 7%, transparent); }
:lang(th) .kicker, :lang(th) .toc-title, :lang(th) .prose th, :lang(th) .vessel, :lang(th) .hero-stat span { letter-spacing: 0; text-transform: none; }
html:lang(th) body { line-height: 1.85; }

/* Recipe section: checklist rows and timers */
.sec-recipe tbody tr { cursor: pointer; }
.sec-recipe tbody td:first-child { position: relative; padding-inline-start: 2.6rem; }
.sec-recipe tbody td:first-child::before { content: ""; position: absolute; inset-inline-start: 0.95rem; top: 0.85rem; width: 1.05rem; height: 1.05rem; border-radius: 6px; border: 1.6px solid var(--ink-faint); transition: all 0.25s var(--spring); }
.sec-recipe tbody tr.done td { color: var(--ink-faint); text-decoration: line-through; text-decoration-color: var(--saffron); }
.sec-recipe tbody tr.done td:first-child::before { background: var(--saffron) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23241c14' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/80% no-repeat; border-color: var(--saffron); transform: scale(1.1); }
.timer-btn { display: inline-flex; align-items: center; gap: 0.25rem; font: inherit; font-weight: 650; cursor: pointer; padding: 0.05rem 0.5rem 0.05rem 0.35rem; margin: 0 0.1rem; border-radius: 999px; color: var(--sea); background: color-mix(in srgb, var(--sea) 12%, transparent); border: 1px solid color-mix(in srgb, var(--sea) 30%, transparent); transition: all 0.2s; }
.timer-btn::before { content: "⏱"; font-size: 0.85em; }
.timer-btn:hover { background: var(--sea); color: var(--paper); }
.timers { position: fixed; inset-inline-end: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); z-index: 70; display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-end; }
.timer { display: flex; align-items: center; gap: 0.8rem; padding: 0.6rem 0.7rem 0.6rem 0.8rem; border-radius: 999px; background: var(--ink); color: var(--paper); box-shadow: var(--shadow-lg); animation: pop 0.35s var(--spring); font-variant-numeric: tabular-nums; }
.timer .ring { width: 34px; height: 34px; }
.timer .ring circle { fill: none; stroke-width: 4; }
.timer .ring .bg { stroke: rgb(255 255 255 / 0.15); }
.timer .ring .fg { stroke: var(--saffron); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset 1s linear; }
.timer strong { font: 650 1.2rem/1 var(--display); min-width: 3.4rem; }
.timer small { opacity: 0.7; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer button { all: unset; cursor: pointer; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: rgb(255 255 255 / 0.12); }
.timer button:hover { background: rgb(255 255 255 / 0.25); }
.timer.done { background: var(--terracotta); animation: shake 0.5s 3; }
@keyframes shake { 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }
/* Cooking mode: bigger text, other sections dimmed, screen stays on */
body.cooking .prose { font-size: 1.12rem; }
body.cooking .sec:not(.sec-recipe) { opacity: 0.35; transition: opacity 0.3s; }
body.cooking .sec:not(.sec-recipe):hover { opacity: 1; }

/* ---------- Regions ---------- */
.regions { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 1.2rem; padding-bottom: 5rem; }
.region { position: relative; display: flex; align-items: center; gap: 1.2rem; padding: 1.2rem 1.4rem; border-radius: var(--radius); text-decoration: none; color: inherit; background: var(--card); border: 1px solid var(--line); transition: transform 0.4s var(--spring), box-shadow 0.3s, border-color 0.3s, opacity 0.8s var(--ease-out); }
.region:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; color: inherit; }
.region-pans { display: flex; flex: none; }
.region-pans .pan { width: 64px; margin-inline-end: -26px; filter: drop-shadow(0 6px 8px rgb(70 35 5 / 0.25)); transition: transform 0.6s var(--spring); }
.region-pans .pan:last-child { margin-inline-end: 0; }
.region:hover .region-pans .pan:nth-child(1) { transform: translateX(-6px) rotate(-20deg); }
.region:hover .region-pans .pan:nth-child(3) { transform: translateX(6px) rotate(20deg); }
.region-text { min-width: 0; margin-inline-start: 0.6rem; }
.region h3 { margin: 0; font-size: 1.45rem; }
.region p { margin: 0.15rem 0 0; color: var(--ink-soft); font-size: 0.9rem; font-weight: 600; }
.dishes { padding-bottom: 5rem; }

/* ---------- History fallback ---------- */
.history-entry { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 1.8rem; padding: 2rem 0; border-bottom: 1px solid var(--line); }
.he-pan .pan { width: 120px; position: sticky; top: 100px; transition: transform 0.8s var(--ease-out); }
.he-pan:hover .pan { transform: rotate(40deg); }
.history-entry h2 { margin: 0; font-size: 1.9rem; }
.history-entry h2 a { color: inherit; text-decoration: none; }
.history-entry h2 a:hover { color: var(--terracotta); }
.history-entry .alt { margin: 0.2rem 0 0.8rem; font: italic 1.1rem var(--display); color: var(--ink-soft); }

/* ---------- Footer ---------- */
.site-footer { position: relative; overflow: hidden; text-align: center; padding: 5rem clamp(1rem, 4vw, 3rem) 3rem; background: var(--ink); color: var(--paper); }
.site-footer .small { color: color-mix(in srgb, var(--paper) 60%, transparent); font-size: 0.86rem; margin: 0.4rem auto; max-width: 40rem; }
.site-footer a { color: var(--saffron-2); }
.footer-big { font: italic 500 clamp(1.5rem, 3.5vw, 2.4rem)/1.2 var(--display); max-width: 26ch; margin: 0 auto 1.4rem; text-wrap: balance; }
.footer-pan { width: 64px; height: 64px; margin: 0 auto 1.6rem; border-radius: 50%; background: radial-gradient(circle, var(--saffron-2) 0 50%, var(--saffron) 51% 60%, #8f4f17 61% 66%, #8a9097 67% 100%); }

/* ---------- Ad slots (fixed sizes → no layout shift) ---------- */
.ad { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; margin: 2.2rem auto; }
.ad-label { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }
.ad-slot { display: grid; place-items: center; overflow: hidden; width: 100%; }
.ad-banner .ad-slot { max-width: 728px; min-height: 90px; }
.ad-inArticle .ad-slot { max-width: 336px; min-height: 280px; }
.ad-sidebar { margin: 2rem 0 0; }
.ad-sidebar .ad-slot { width: 240px; min-height: 600px; }
.ad-inFeed { margin: 0; justify-content: center; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); padding: 1rem; }
.ad-inFeed .ad-slot { max-width: 300px; min-height: 250px; }
.ad.is-placeholder .ad-slot { border: 1.5px dashed var(--line); border-radius: var(--radius-sm); background: repeating-linear-gradient(-45deg, transparent 0 10px, color-mix(in srgb, var(--paper-3) 50%, transparent) 10px 20px); }
.ad-ph { font: 600 0.8rem var(--sans); color: var(--ink-faint); }
body.cooking .ad { display: none; }
.ad-inFeed[hidden] { display: none; }
@media (max-width: 980px) { .ad-sidebar { display: none; } }
@media (max-width: 760px) { .ad-banner .ad-slot { max-width: 320px; min-height: 100px; } }

/* ---------- View transitions ---------- */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.35s; }
::view-transition-group(*) { animation-duration: 0.55s; animation-timing-function: var(--ease-out); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-inner, .recipe-hero { grid-template-columns: 1fr; }
  .hero-visual { max-width: 460px; width: 88%; margin: 0 auto; order: -1; }
  .rh-visual { max-width: 380px; width: 78%; margin: 0 auto; order: -1; }
  .textures { grid-template-columns: 1fr; }
  .page.with-toc { display: block; }
  .toc { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .site-header { flex-wrap: wrap; height: auto; padding-top: 0.6rem; padding-bottom: 0.6rem; gap: 0.6rem; position: relative; }
  .site-header.scrolled { height: auto; }
  .main-nav { order: 3; width: 100%; margin-inline-start: 0; justify-content: space-between; }
  .main-nav a { padding: 0.42rem 0.7rem; font-size: 0.86rem; }
  .lang { margin-inline-start: auto; }
  .home .hero { margin-top: 0; padding-top: 1.5rem; }
  .toolbar { top: 0; }
  .hero-stat { padding: 0.55rem 0.8rem; }
  .hero-stat strong { font-size: 1.5rem; }
  .history-entry { grid-template-columns: 1fr; }
  .he-pan .pan { width: 90px; position: static; }
  .timer small { display: none; }
}

/* ---------- Motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .js [data-reveal]:not(.card), .js .card[data-reveal]:not(.in) { opacity: 1; transform: none; --lift: 0px; }
  .js .hero-title .word { transform: none; }
  *, *::before, *::after { animation-delay: 0s !important; }
  .js .hero-kicker, .js .hero-lede, .js .hero-cta { opacity: 1; }
}
@media print {
  .site-header, .site-footer, .toc, .rh-actions, .progress, .timers, .lang, .marquee, .cook-hint, .ad { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  body::before { display: none; }
  .recipe-hero { grid-template-columns: 1fr 160px; padding: 0; }
  .rh-title { font-size: 28pt; }
  .page { padding: 0; display: block !important; }
  .prose { max-width: none; }
  .prose a { color: #000; }
  .prose h2 { break-after: avoid; }
  .table-wrap { border: 0; overflow: visible; }
  .prose tr { break-inside: avoid; }
  .js [data-reveal], .js .card[data-reveal] { opacity: 1 !important; transform: none !important; }
  .pan-steam { display: none; }
}

/* ==========================================================================
   Right-to-left (Arabic). Layout mirrors via logical properties above; these are the details.
   ========================================================================== */
[dir="rtl"] .arrow { display: inline-block; rotate: 180deg; }
[dir="rtl"] .card:hover .arrow, [dir="rtl"] .region:hover .arrow, [dir="rtl"] .area-tile:hover .arrow { transform: translateX(-5px); }
[dir="rtl"] .region:hover .region-pans .pan:nth-child(1) { transform: translateX(6px) rotate(20deg); }
[dir="rtl"] .region:hover .region-pans .pan:nth-child(3) { transform: translateX(-6px) rotate(-20deg); }
[dir="rtl"] .marquee { transform: rotate(1.2deg) scale(1.02); }
[dir="rtl"] .marquee-track { animation-name: marquee-rtl; }
@keyframes marquee-rtl { to { transform: translateX(50%); } }
[dir="rtl"] .lang-menu { transform-origin: top left; }
/* Arabic script: never letter-space (it breaks the joins), no synthetic italics, roomier lines */
:lang(ar) { letter-spacing: 0 !important; }
:lang(ar) .kicker, :lang(ar) .toc-title, :lang(ar) .prose th, :lang(ar) .vessel, :lang(ar) .hero-stat span, :lang(ar) .ad-label { text-transform: none; letter-spacing: 0; }
:lang(ar) em, :lang(ar) .alt, :lang(ar) .alt-title, :lang(ar) .hero-title .line:nth-child(2), :lang(ar) .footer-big, :lang(ar) .marquee-track, :lang(ar) .gloss { font-style: normal; }
html:lang(ar) body { line-height: 1.95; }
html:lang(ar) { --sans: "IBM Plex Sans Arabic", ui-sans-serif, system-ui, "Segoe UI", Tahoma, sans-serif; --display: "Amiri", "Fraunces", Georgia, serif; }
html:lang(ar) h1, html:lang(ar) h2, html:lang(ar) h3 { font-weight: 700; letter-spacing: 0; line-height: 1.3; }
html:lang(ar) .hero-title { line-height: 1.25; }
html:lang(ar) .hero-title .line { padding-bottom: 0.18em; }

/* ==========================================================================
   Breadcrumbs · area tiles · per-area groups
   ========================================================================== */
.crumbs { padding-top: 1rem; font-size: 0.85rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0; padding: 0; color: var(--ink-faint); }
.crumbs li:not(:last-child)::after { content: "›"; margin-inline-start: 0.35rem; }
[dir="rtl"] .crumbs li:not(:last-child)::after { content: "‹"; }
.crumbs a { color: var(--ink-soft); text-decoration: none; font-weight: 600; }
.crumbs a:hover { color: var(--terracotta); }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; }

.areas-sec { padding-top: 1rem; padding-bottom: 2rem; }
.area-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 1.2rem; }
.area-tile {
  position: relative; display: flex; align-items: center; gap: 1.4rem; padding: 1.5rem 1.6rem; overflow: hidden; isolation: isolate;
  border-radius: var(--radius); text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line);
  transition: transform 0.4s var(--spring), box-shadow 0.3s, border-color 0.3s;
}
.area-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; color: var(--ink); }
.area-tile h3 { margin: 0; font-size: clamp(1.5rem, 2.6vw, 2rem); }
.area-tile p { margin: 0.25rem 0 0; color: var(--ink-soft); font-size: 0.92rem; font-weight: 600; }
.area-pans { display: flex; flex: none; min-width: 64px; min-height: 64px; }
.area-pans .pan { width: 72px; margin-inline-end: -28px; filter: drop-shadow(0 6px 8px rgb(70 35 5 / 0.25)); }
.area-pans .pan:last-child { margin-inline-end: 0; }
.area-pans:empty { width: 72px; height: 72px; border-radius: 50%; border: 2px dashed var(--line); }
.area-text { min-width: 0; }
.area-tile:hover .arrow { transform: translateX(5px); color: var(--terracotta); }

.area-group { margin-top: 2.6rem; }
.area-group:first-of-type { margin-top: 0.5rem; }
.area-group[hidden] { display: none; }
.area-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 0 0 1.2rem; padding-bottom: 0.8rem; border-bottom: 1px solid var(--line); }
.area-group-head h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.3rem); }
.area-group-head a { font-weight: 650; font-size: 0.92rem; text-decoration: none; display: inline-flex; gap: 0.4rem; align-items: center; }
.area-regions { padding-bottom: 3rem; }
.area-regions .regions { padding-bottom: 0; }
.area-filter button { font-weight: 700; }

/* ==========================================================================
   Shami theme (Bilad al-Sham): limestone, indigo ink, brass, pomegranate, za'atar green;
   Amiri display type and an eight-pointed-star (khatam) ornament. Scoped by [data-theme="sham"]
   so it can wrap a whole page (on <body>) or a single card/tile/section on the home page.
   ========================================================================== */
[data-theme="sham"] {
  --paper: #f6efe1;
  --paper-2: #ece2cb;
  --paper-3: #e2d5b8;
  --card: #fbf7ec;
  --ink: #1e1b2e;
  --ink-soft: #57506a;
  --ink-faint: #8f8799;
  --line: #ddcfb2;
  --saffron: #b8892b;      /* brass */
  --saffron-2: #d6ad55;
  --saffron-deep: #8a6418;
  --terracotta: #9b2335;   /* pomegranate */
  --terracotta-2: #c64a5c;
  --sea: #4f6b3a;          /* za'atar / olive */
  --sea-2: #7d9a5c;
  --tint-seco: #efe0b7;
  --tint-meloso: #ecd6cf;
  --tint-caldoso: #dfe4c8;
  --display: "Amiri", "Fraunces", Georgia, serif;
  --ornament: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23b8892b' stroke-width='1.1'%3E%3Crect x='17' y='17' width='22' height='22'/%3E%3Crect x='17' y='17' width='22' height='22' transform='rotate(45 28 28)'/%3E%3Ccircle cx='28' cy='28' r='4.5'/%3E%3Cpath d='M0 0l8 8M56 0l-8 8M0 56l8-8M56 56l-8-8'/%3E%3C/g%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  [data-theme="sham"] {
    --paper: #15131f; --paper-2: #1d1a2a; --paper-3: #272337; --card: #1b1827;
    --ink: #f3ead6; --ink-soft: #c5bccf; --ink-faint: #8b8399; --line: #34304a;
    --saffron: #d9ad4f; --saffron-2: #e8c674; --saffron-deep: #e2b85c;
    --terracotta: #e0677a; --terracotta-2: #ec8b9a; --sea: #a9bf7a; --sea-2: #c3d69a;
    --tint-seco: #3a2f17; --tint-meloso: #3a2229; --tint-caldoso: #26301c;
  }
}
body[data-theme="sham"] { background: var(--paper); }
body[data-theme="sham"]::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.07; background-image: var(--ornament); background-size: 56px; }
[data-theme="sham"] h1, [data-theme="sham"] h2, [data-theme="sham"] h3 { font-weight: 700; letter-spacing: -0.005em; font-variation-settings: normal; }
[data-theme="sham"] .hero-title { line-height: 1.08; letter-spacing: -0.01em; }
[data-theme="sham"] .hero-title .line:nth-child(2) { font-style: normal; color: var(--terracotta); }
[data-theme="sham"] .hero-bg span:nth-child(1) { background: var(--saffron-2); opacity: 0.35; }
[data-theme="sham"] .hero-bg span:nth-child(2) { background: var(--terracotta-2); opacity: 0.2; }
[data-theme="sham"] .hero-bg span:nth-child(3) { background: var(--sea-2); opacity: 0.22; }
.hero-ornament {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; background-image: var(--ornament); background-size: 56px; opacity: 0.22;
  mask-image: radial-gradient(ellipse 60% 70% at 78% 45%, #000 0 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 78% 45%, #000 0 30%, transparent 75%);
}
[dir="rtl"] .hero-ornament { mask-image: radial-gradient(ellipse 60% 70% at 22% 45%, #000 0 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse 60% 70% at 22% 45%, #000 0 30%, transparent 75%); }
[data-theme="sham"] .marquee { background: var(--ink); border-block: 3px solid var(--saffron); }
[data-theme="sham"] .marquee-track i { color: var(--saffron-2); }
/* Cards / tiles / group headings carrying the theme on an otherwise Spanish page */
.card[data-theme="sham"] .card-visual { background: var(--ornament) center / 44px, radial-gradient(circle at 50% 55%, var(--tint) 0 38%, color-mix(in srgb, var(--tint) 45%, var(--card)) 70%); background-blend-mode: soft-light, normal; }
.card[data-theme="sham"] h3, .area-tile[data-theme="sham"] h3, .area-group[data-theme="sham"] h2, .area-regions[data-theme="sham"] h2 { font-family: var(--display); }
.area-tile[data-theme="sham"] { background: linear-gradient(var(--card), var(--card)) padding-box, var(--card); }
.area-tile[data-theme="sham"]::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: var(--ornament); background-size: 48px; opacity: 0.16; mask-image: linear-gradient(90deg, transparent 30%, #000); -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000); }
[dir="rtl"] .area-tile[data-theme="sham"]::before { mask-image: linear-gradient(-90deg, transparent 30%, #000); -webkit-mask-image: linear-gradient(-90deg, transparent 30%, #000); }
.area-group[data-theme="sham"] .area-group-head, .area-regions[data-theme="sham"] .area-group-head { border-bottom: 0; padding-bottom: 1rem; background: linear-gradient(90deg, var(--saffron), transparent) bottom / 100% 2px no-repeat; }
[data-theme="sham"] .chip-seco i, [data-theme="sham"] .dot-seco { background: var(--saffron); }
[data-theme="sham"] .prose h3 { color: var(--terracotta); }
[data-theme="sham"] .prose ul > li::marker { content: "✦  "; color: var(--saffron); }
[data-theme="sham"] .site-footer { background: var(--ink); border-top: 3px solid var(--saffron); }

/* Card/list illustrations are <img src="/pans/x.svg"> (cached once, site-wide). */
img.pan { display: block; height: auto; }
.card-visual img.pan { transition: transform 1.4s var(--ease-out); }
.card:hover .card-visual img.pan { transform: scale(1.06) translateY(-3%) rotate(40deg); }
.card { content-visibility: auto; contain-intrinsic-size: auto 470px; }
/* Related dishes (families.json) */
.related { padding-top: 1rem; padding-bottom: 4rem; }
.family { margin-bottom: 2rem; }
.family h3 { font-size: 1.35rem; margin: 0 0 0.3rem; color: var(--terracotta); }
.family-desc { margin: 0 0 0.9rem; color: var(--ink-soft); max-width: 46rem; }
.family-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 0.7rem; }
.family-list a { display: flex; gap: 0.8rem; align-items: center; padding: 0.7rem 0.9rem; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: border-color 0.2s, transform 0.3s var(--spring); }
.family-list a:hover { border-color: var(--saffron); transform: translateY(-2px); color: var(--ink); }
.family-list img { width: 56px; height: 56px; flex: none; }
.family-list span { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.family-list strong { font-family: var(--display); font-size: 1.05rem; }
.family-list small { color: var(--ink-soft); font-size: 0.82rem; }
.family-list em { font-style: normal; color: var(--ink-faint); font-size: 0.75rem; font-weight: 600; margin-top: 0.15rem; }

/* Recipe photo hero (Wikimedia Commons) with the pan illustration as a badge */
.rh-photo { margin: 0; position: relative; }
.rh-photo .photo { display: block; width: 100%; height: auto; aspect-ratio: auto; border-radius: var(--radius); box-shadow: var(--shadow-lg); object-fit: cover; max-height: 560px; }
.rh-pan-badge { position: absolute; inset-inline-start: -6%; bottom: 12%; width: 28%; filter: drop-shadow(0 10px 18px rgb(40 20 0 / 0.35)); }
.rh-photo figcaption, .photo-credit { font-size: 0.78rem; color: var(--ink-faint); margin-top: 0.6rem; line-height: 1.4; }
.rh-photo figcaption a, .photo-credit a { color: var(--ink-soft); }
.recipe.has-photo .rh-visual::before { display: none; }
.tag-sources { border-color: color-mix(in srgb, var(--sea) 40%, var(--line)); color: var(--sea); }
.tag-sources:hover { color: var(--sea); }
