/* Cape Town food: the dish and story cards, shared by the homepage rail, the /food/ hub
   and the dish pages. The rail behaviour is the shared one (static/css/rail.css,
   static/js/rail.js); everything here is the food look.

   Palette (all text pairs checked for WCAG AA):
     terracotta #7a2e14 / deep #3d150a with cream #fdf6ea text (11.9:1 and 15.8:1)
     saffron #f2b544 pill with #3d150a text (9.1:1)
     cream paper #fbf3e6 with ink #2a120a (16.5:1) and muted #6f4c3c (6.4:1) */
.fod-scope {
  --fod-ink: #2a120a;
  --fod-body: #4a2e22;
  --fod-muted: #6f4c3c;
  --fod-terracotta: #7a2e14;
  --fod-deep: #3d150a;
  --fod-saffron: #f2b544;
  --fod-saffron-soft: #fbe3b0;
  --fod-cream: #fdf6ea;
  --fod-paper: #fbf3e6;
  --fod-line: #ecdcc6;
  --fod-olive: #4b5320;
  --fod-radius: 20px;
  --fod-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Noto Serif", serif;
  --fod-shadow: 0 1px 2px rgba(42, 18, 10, .08), 0 18px 36px -18px rgba(42, 18, 10, .55);
}

/* ── The card frame ───────────────────────────────────────────────────── */
.fod-card { position: relative; display: flex; flex-direction: column; min-width: 0; border-radius: var(--fod-radius); overflow: hidden; background: var(--fod-deep); box-shadow: var(--fod-shadow); color: var(--fod-cream); isolation: isolate; }
.fod-card__link { position: relative; display: block; color: inherit; text-decoration: none; }
.fod-card__link:hover, .fod-card__link:focus-visible { color: inherit; }
.fod-card__link:focus-visible { outline: 3px solid var(--fod-saffron); outline-offset: -3px; border-radius: var(--fod-radius); }
.fod-card__media { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; background: #5a2412; }
.fod-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; transform-origin: 50% 60%; }

/* The scrim deepens to 94% terracotta-black where the text sits, so every line keeps AA over any photo. */
.fod-card__scrim { position: absolute; left: 0; right: 0; bottom: 0; padding: 5rem 1.1rem 1.05rem; background: linear-gradient(180deg, rgba(38, 12, 5, 0) 0, rgba(38, 12, 5, .74) 4.5rem, rgba(38, 12, 5, .95) 100%); }
.fod-card__name { margin: .5rem 0 .3rem; font-family: var(--fod-serif); font-size: 1.6rem; font-weight: 700; line-height: 1.08; letter-spacing: -.01em; color: #fff; }
.fod-card__summary { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; font-size: .86rem; line-height: 1.45; color: rgba(253, 246, 234, .9); }
.fod-card__more { display: inline-block; margin-top: .55rem; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--fod-saffron); }
.fod-card__link:hover .fod-card__name, .fod-card__link:focus-visible .fod-card__name { color: var(--fod-saffron-soft); }

/* Pills: saffron for "In season", a quiet glass pill for the category, cream for "Read". */
.fod-pill { display: inline-flex; align-items: center; gap: .35rem; max-width: 100%; padding: .24rem .65rem; border-radius: 999px; font-size: .66rem; font-weight: 800; letter-spacing: .09em; line-height: 1.35; text-transform: uppercase; background: rgba(255, 255, 255, .16); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.fod-pill--season { background: var(--fod-saffron); color: var(--fod-deep); -webkit-backdrop-filter: none; backdrop-filter: none; }
.fod-pill--season::before { content: ""; width: .42rem; height: .42rem; border-radius: 50%; background: var(--fod-olive); box-shadow: 0 0 0 2px rgba(75, 83, 32, .25); }
.fod-pill--read { background: var(--fod-terracotta); color: var(--fod-cream); -webkit-backdrop-filter: none; backdrop-filter: none; }

/* The photo credit sits under the photo, small, on the card's own ground. */
.fod-credit { margin: 0 0 .65rem; padding: .5rem 1.1rem 0; font-size: .68rem; line-height: 1.35; color: rgba(253, 246, 234, .74); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.fod-card .fod-credit a { color: rgba(253, 246, 234, .9); text-decoration: underline; text-decoration-color: rgba(253, 246, 234, .35); text-underline-offset: 2px; }
.fod-card .fod-credit a:hover { color: var(--fod-saffron); }

/* ── No free photo: a typographic card on a patterned ground, never an empty box ── */
.fod-card--plain { --fod-plain: #7a2e14; --fod-plain-2: #4a1a0c; background: var(--fod-plain-2); }
.fod-cat--seafood { --fod-plain: #1f5560; --fod-plain-2: #0f2f36; }
.fod-cat--street_food { --fod-plain: #9a2a17; --fod-plain-2: #5a150a; }
.fod-cat--braai { --fod-plain: #4a3a30; --fod-plain-2: #231a15; }
.fod-cat--breads_snacks { --fod-plain: #8a5a12; --fod-plain-2: #4f320a; }
.fod-cat--sweets { --fod-plain: #7d2a4a; --fod-plain-2: #45142a; }
.fod-cat--drinks { --fod-plain: #4b5320; --fod-plain-2: #272c10; }
.fod-plain { position: relative; display: flex; flex-direction: column; justify-content: flex-end; aspect-ratio: 4 / 5; padding: 1.1rem 1.1rem 1.05rem; overflow: hidden;
  background:
    radial-gradient(circle at 1.5px 1.5px, rgba(253, 246, 234, .16) 1.2px, transparent 1.6px) 0 0 / 14px 14px,
    radial-gradient(120% 80% at 85% 0%, var(--fod-plain) 0%, var(--fod-plain-2) 72%); }
/* A plate, drawn in CSS: two rings and a rim of saffron, top right. */
.fod-plain::before, .fod-plain::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.fod-plain::before { width: 68%; aspect-ratio: 1; top: -8%; right: -14%; border: 2px solid rgba(242, 181, 68, .55); box-shadow: inset 0 0 0 14px rgba(253, 246, 234, .06), inset 0 0 0 15px rgba(253, 246, 234, .18); }
.fod-plain::after { width: 36%; aspect-ratio: 1; top: 8%; right: 2%; border: 1px dashed rgba(253, 246, 234, .3); }
.fod-plain__kicker { position: relative; font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--fod-saffron); }
.fod-plain__name { position: relative; margin: .3rem 0 .45rem; font-family: var(--fod-serif); font-size: 2.15rem; font-weight: 700; font-style: italic; line-height: 1; letter-spacing: -.015em; color: #fff; overflow-wrap: anywhere; }
.fod-plain .fod-card__summary { position: relative; -webkit-line-clamp: 3; }
.fod-plain .fod-pill { position: absolute; top: 1rem; left: 1.1rem; }

/* ── Story cards: our own articles, cream paper with a wide photo, so they read as a different kind of card ── */
.fod-card--article { background: var(--fod-paper); color: var(--fod-ink); }
.fod-card--article .fod-card__link { display: flex; flex-direction: column; flex: 1 1 auto; }
.fod-card--article .fod-card__media { aspect-ratio: 16 / 11; background: #e9d8bf; }
.fod-article__body { display: flex; flex: 1 1 auto; flex-direction: column; align-items: flex-start; gap: .45rem; padding: .95rem 1.1rem 1.1rem; border-top: 3px solid var(--fod-saffron); }
.fod-article__title { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; margin: 0; font-family: var(--fod-serif); font-size: 1.22rem; font-weight: 700; line-height: 1.2; color: var(--fod-ink); }
.fod-article__note { margin-top: auto; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--fod-terracotta); }
.fod-card--article .fod-card__link:hover .fod-article__title, .fod-card--article .fod-card__link:focus-visible .fod-article__title { color: var(--fod-terracotta); }
.fod-card--article .fod-card__link:focus-visible { outline-color: var(--fod-terracotta); }

/* ── Motion: a small lift and a slow zoom, only for pointers that hover and readers who allow motion ── */
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .fod-card { transition: transform .25s ease, box-shadow .25s ease; }
  .fod-card:hover { transform: translateY(-4px); box-shadow: 0 2px 4px rgba(42, 18, 10, .1), 0 26px 44px -18px rgba(42, 18, 10, .65); }
  .fod-card__media img { transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
  .fod-card:hover .fod-card__media img { transform: scale(1.06); }
}
