/* ==========================================================================
   THE SULTAN — Digital Menu (table QR page)
   Standalone: shares only fonts, colours and image files with the main
   site. Mobile-first; photos lead, text stays readable.
   ========================================================================== */

/* ---------- fonts & tokens (same faces + fallbacks as css/style.css) ---------- */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("/assets/fonts/cormorant-garamond-var.woff2") format("woff2");
  font-weight: 300 700; font-style: normal;
  font-display: optional; /* never swaps after first paint: no layout shift */
}
@font-face {
  font-family: "Jost";
  src: url("/assets/fonts/jost-var.woff2") format("woff2");
  font-weight: 100 900; font-style: normal;
  font-display: optional;
}
@font-face {
  font-family: "Cormorant Garamond Fallback"; src: local("Georgia");
  size-adjust: 89.4%; ascent-override: 103.36%; descent-override: 32.1%; line-gap-override: 0%;
}
@font-face {
  font-family: "Jost Fallback"; src: local("Arial");
  size-adjust: 93%; ascent-override: 115.05%; descent-override: 40.32%; line-gap-override: 0%;
}

:root {
  --ink: #0e0d0b;
  --ink-2: #161411;
  --ink-3: #1f1c17;
  --gold: #c9a45c;
  --ivory: #f3ead9;
  --ivory-dim: #cfc4ae;
  --line: rgb(201 164 92 / .22);
  --serif: "Cormorant Garamond", "Cormorant Garamond Fallback", Georgia, serif;
  --sans: "Jost", "Jost Fallback", Arial, sans-serif;
  --gutter: 1rem;
  --jump-h: 3.25rem;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-padding-top: calc(var(--jump-h) + .75rem); -webkit-text-size-adjust: 100%; }
html:has(.lb[open]) { overflow: hidden; } /* page stays put behind the large view */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  background: var(--ink); color: var(--ivory);
  font-family: var(--sans); font-weight: 300; font-size: 1rem; line-height: 1.55;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
[hidden] { display: none !important; } /* beats the flex/grid rules below */
img { display: block; max-width: 100%; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
ul { list-style: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- top bar ---------- */

.bar {
  display: flex; align-items: center; justify-content: center; gap: .9rem;
  padding: .7rem var(--gutter) .6rem;
  background: linear-gradient(180deg, rgb(201 164 92 / .07), transparent), var(--ink-2);
}
.bar__home { display: block; border-radius: 4px; }
.bar__logo { width: auto; height: 2.9rem; }
.bar__title {
  padding-left: .9rem; border-left: 1px solid var(--line);
  font-size: .8rem; font-weight: 500; letter-spacing: .32em; text-transform: uppercase;
  color: var(--gold);
}

/* ---------- search (above the sticky section bar; scrolls away with the top bar) ---------- */

.search { max-width: 72rem; margin: 0 auto; padding: .8rem var(--gutter); }
.search__box { position: relative; max-width: 36rem; }
.search__icon {
  position: absolute; left: .9rem; top: 50%; translate: 0 -50%;
  width: 1.2rem; height: 1.2rem; pointer-events: none;
  fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round;
}
.search__input {
  width: 100%; height: 3rem; padding: 0 3.2rem 0 2.9rem;
  font: inherit; font-size: 1rem; /* 16px: iOS doesn't zoom in on focus */
  color: var(--ivory); background: var(--ink-2);
  border: 1px solid var(--line); border-radius: 99px;
  -webkit-appearance: none; appearance: none;
}
.search__input::placeholder { color: var(--ivory-dim); opacity: .75; }
/* one clear ring (text inputs always count as focus-visible) */
.search__input:focus, .search__input:focus-visible {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold);
}
.search__input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search__clear {
  position: absolute; right: .25rem; top: 50%; translate: 0 -50%;
  width: 2.5rem; height: 2.5rem; display: grid; place-items: center;
  background: none; border: 0; border-radius: 50%; cursor: pointer;
  font-size: 1.5rem; line-height: 1; color: var(--ivory-dim);
}
.search__clear:hover { color: var(--gold); }

.empty { max-width: 72rem; margin: 0 auto; padding: 3rem var(--gutter) 1rem; text-align: center; }
.empty__title { font-family: var(--serif); font-size: 1.75rem; color: var(--gold); }
.empty__text { margin-top: .4rem; color: var(--ivory-dim); overflow-wrap: anywhere; }
.empty__btn {
  margin-top: 1.2rem; min-height: 2.75rem; padding: 0 1.4rem; cursor: pointer;
  background: none; border: 1px solid var(--gold); border-radius: 99px;
  font-size: .85rem; letter-spacing: .08em; color: var(--gold);
}
.empty__btn:hover { background: var(--gold); color: var(--ink); }

/* ---------- section jump-nav (sticky, scrolls sideways on its own) ---------- */

.jump {
  position: sticky; top: 0; z-index: 5;
  background: rgb(14 13 11 / .94);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-block: 1px solid var(--line);
}
.jump__list {
  display: flex; gap: .4rem; height: var(--jump-h); align-items: center;
  max-width: 72rem; margin-inline: auto; padding-inline: var(--gutter);
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
}
.jump__list::-webkit-scrollbar { display: none; }
.jump__list a {
  display: block; white-space: nowrap; text-decoration: none;
  padding: .45rem .8rem; border: 1px solid transparent; border-radius: 99px;
  font-size: .8rem; font-weight: 400; letter-spacing: .06em; color: var(--ivory-dim);
}
.jump__list a.is-active { color: var(--ink); background: var(--gold); }

/* ---------- sections + grid ---------- */

.menu { max-width: 72rem; margin-inline: auto; padding: 0 var(--gutter) 1rem; }
.sec { padding-top: 1.9rem; }
.sec__title {
  font-family: var(--serif); font-weight: 500; font-size: 1.75rem; line-height: 1.15;
  color: var(--gold);
}
.sec__note { margin-top: .3rem; font-size: .85rem; color: var(--ivory-dim); max-width: 46rem; }

.grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem; margin-top: 1rem;
}
@media (min-width: 600px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; } }
.grid > li { display: flex; }

.dish {
  display: flex; flex-direction: column; width: 100%; text-align: left;
  background: var(--ink-2); border: 1px solid var(--ink-3); border-radius: 6px;
  overflow: hidden; cursor: pointer;
  transition: border-color .25s;
}
.dish:hover { border-color: var(--line); }
.dish__img {
  width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover;
  background: var(--ink-3); /* space is reserved before the photo arrives */
}
.dish__img--none {
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 2.5rem; color: rgb(201 164 92 / .35);
}
.dish__text { display: flex; flex-direction: column; flex: 1; gap: .3rem; padding: .7rem .75rem .8rem; }
.dish__name { font-family: var(--serif); font-weight: 600; font-size: 1.2rem; line-height: 1.15; }
.dish__desc {
  font-size: .8rem; line-height: 1.45; color: var(--ivory-dim);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  overflow: hidden;
}
.dish__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem;
  margin-top: auto; padding-top: .2rem;
}
.dish__price { font-weight: 500; font-size: .95rem; color: var(--gold); }

/* dietary tags — boxed letters, same look as the main site's menu */
.tags { display: inline-flex; gap: .25rem; }
.tags abbr {
  text-decoration: none; font-size: .64rem; font-weight: 500; letter-spacing: .06em;
  padding: .05rem .3rem; border: 1px solid rgb(201 164 92 / .55); border-radius: 2px;
  color: var(--gold); line-height: 1.5;
}

/* ---------- footer: key, allergy, halal ---------- */

.foot {
  max-width: 72rem; margin: 2rem auto 0; padding: 1.5rem var(--gutter) 2.5rem;
  border-top: 1px solid var(--line); text-align: center;
  font-size: .85rem; color: var(--ivory-dim);
}
.foot__legend { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1rem; }
.foot__legend b {
  font-weight: 500; font-size: .7rem; color: var(--gold);
  border: 1px solid rgb(201 164 92 / .55); border-radius: 2px; padding: 0 .3rem; margin-right: .2rem;
}
.foot__allergy { margin: 1rem auto 0; max-width: 34rem; }
.foot__halal { margin-top: .6rem; color: var(--gold); letter-spacing: .08em; }

/* ---------- large view ---------- */

.lb {
  /* phone: the whole screen */
  width: 100%; max-width: none; height: 100%; max-height: none;
  margin: 0; border: 0; padding: 0;
  background: var(--ink); color: var(--ivory);
}
.lb[open] { display: flex; flex-direction: column; }
.lb::backdrop { background: rgb(6 5 4 / .85); }
@media (min-width: 900px) {
  .lb {
    width: min(56rem, 92vw); height: auto; max-height: 94vh; margin: auto;
    border: 1px solid var(--line); border-radius: 8px;
  }
}

.lb__top {
  display: flex; align-items: center; justify-content: space-between;
  padding: .5rem .5rem .5rem var(--gutter); flex: none;
}
.lb__count { font-size: .8rem; letter-spacing: .12em; color: var(--ivory-dim); }
.lb__close, .lb__arrow {
  width: 2.75rem; height: 2.75rem; display: grid; place-items: center;
  background: transparent; border: 1px solid var(--line); border-radius: 50%;
  font-size: 1.5rem; line-height: 1; color: var(--ivory); cursor: pointer;
}
.lb__close:hover, .lb__arrow:hover { border-color: var(--gold); color: var(--gold); }

.lb__frame {
  flex: none; aspect-ratio: 16 / 9; width: 100%;
  background: var(--ink-3) center / cover no-repeat; /* cached small photo while the large one loads */
}
@media (min-width: 900px) {
  /* photo capped by screen height, so text + arrows fit a short laptop */
  .lb__frame { width: min(100%, calc(52vh * 16 / 9)); margin-inline: auto; }
}
.lb__img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s; }
.lb__img.is-loaded { opacity: 1; }

.lb__body { flex: 1; min-height: 0; overflow-y: auto; padding: 1.1rem var(--gutter) .5rem; }
.lb__name { font-family: var(--serif); font-weight: 600; font-size: 2rem; line-height: 1.1; }
.lb__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem; margin-top: .5rem; }
.lb__price { font-weight: 500; font-size: 1.15rem; color: var(--gold); }
.lb__meta .tags abbr { font-size: .72rem; }
.lb__desc { margin-top: .8rem; font-size: 1rem; line-height: 1.6; color: var(--ivory-dim); max-width: 40rem; }

.lb__nav {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex: none;
  padding: .75rem var(--gutter) max(.9rem, env(safe-area-inset-bottom));
  border-top: 1px solid var(--ink-3);
}
.lb__hint { font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ivory-dim); }
@media (hover: hover) and (pointer: fine) { .lb__hint { visibility: hidden; } }

@media (prefers-reduced-motion: reduce) {
  .lb__img { transition: none; }
}
