/* =========================================================
   Sahrapixel Demo Menu — warm editorial Saharan aesthetic
   ========================================================= */

:root {
  /* Palette: cream paper, espresso ink, terracotta, antique gold */
  --paper:        #f7efe1;
  --paper-light:  #fffbf3;
  --paper-warm:   #ebe1cf;
  --ink:          #2c1810;
  --ink-soft:     #5a3f30;
  --ink-mute:     #8b7361;
  --rule:         #d6c5a8;
  --gold:         #c89b3c;
  --gold-deep:    #a07c2a;
  --terracotta:   #b8553a;
  --olive:        #6b7050;

  /* Type */
  --font-ar-display: 'Amiri', 'Markazi Text', 'Times New Roman', serif;
  --font-ar-body:    'Amiri', 'Markazi Text', serif;
  --font-display:    'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --font-body:       'Lora', Georgia, serif;
  --font-num:        'Cormorant Garamond', Georgia, serif;

  /* Spacing rhythm */
  --pad-x: clamp(1.25rem, 5vw, 3rem);
  --pad-y: clamp(1.5rem, 4vw, 3rem);
  --max-w: 720px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ar-body);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.55;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html[dir="ltr"] body {
  font-family: var(--font-body);
}

/* Subtle paper texture via stacked gradients */
body {
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 20% 10%, rgba(200, 155, 60, 0.06), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(184, 85, 58, 0.05), transparent 45%),
    repeating-linear-gradient(
      0deg,
      rgba(44, 24, 16, 0.012) 0px,
      rgba(44, 24, 16, 0.012) 1px,
      transparent 1px,
      transparent 3px
    );
  min-height: 100vh;
}

/* Grain overlay */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.17 0 0 0 0 0.09 0 0 0 0 0.06 0 0 0 0.18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* =========================================================
   Top bar
   ========================================================= */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem var(--pad-x);
  border-bottom: 1px solid var(--rule);
  background: rgba(255, 251, 243, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
}

.topbar__mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
}

.topbar__name {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink);
}

/* Language switcher */
.lang-switch {
  display: flex;
  gap: 0.15rem;
  padding: 3px;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-radius: 999px;
}

.lang-switch__btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease;
}

.lang-switch__btn:hover {
  color: var(--ink);
}

.lang-switch__btn.is-active {
  background: var(--ink);
  color: var(--paper-light);
}

/* When the active button shows Arabic, use Arabic font */
.lang-switch__btn[data-lang="ar"] {
  font-family: var(--font-ar-display);
  font-size: 0.95rem;
}

/* =========================================================
   Banner
   ========================================================= */
.banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.55rem var(--pad-x);
  background: linear-gradient(90deg, transparent, rgba(200, 155, 60, 0.18), transparent);
  border-bottom: 1px solid rgba(200, 155, 60, 0.35);
  font-family: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--gold-deep);
  text-transform: uppercase;
}

html[dir="rtl"] .banner {
  letter-spacing: 0;
  font-size: 0.85rem;
  text-transform: none;
}

.banner__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-deep);
  display: inline-block;
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.7); }
}

/* =========================================================
   Page layout
   ========================================================= */
.page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--pad-y) var(--pad-x) calc(var(--pad-y) * 2);
}

/* =========================================================
   Masthead
   ========================================================= */
.masthead {
  text-align: center;
  padding: clamp(1rem, 4vw, 2.5rem) 0 1.5rem;
  animation: rise 700ms ease-out both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.masthead__overline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--terracotta);
  letter-spacing: 0.06em;
  margin-bottom: 0.4rem;
}

html[dir="rtl"] .masthead__overline {
  font-family: var(--font-ar-display);
  font-style: normal;
  font-size: 1.2rem;
}

.masthead__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.2rem, 7vw, 3.4rem);
  line-height: 1.1;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  letter-spacing: -0.01em;
}

html[dir="rtl"] .masthead__title {
  font-family: var(--font-ar-display);
  font-weight: 700;
}

.masthead__id {
  font-family: var(--font-display);
  font-size: 0.7em;
  font-style: italic;
  font-weight: 400;
  color: var(--gold-deep);
  letter-spacing: 0.05em;
}

html[dir="rtl"] .masthead__id {
  font-style: normal;
  letter-spacing: 0;
}

.masthead__rule {
  margin: 1.2rem auto;
  max-width: 200px;
  color: var(--rule);
}

.masthead__rule svg {
  width: 100%;
  height: 12px;
  display: block;
}

.masthead__table {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}

html[dir="rtl"] .masthead__table {
  font-family: var(--font-ar-body);
  font-style: normal;
  font-size: 1.1rem;
}

.masthead__tablenum {
  font-family: var(--font-num);
  font-style: normal;
  font-weight: 600;
  color: var(--terracotta);
  font-size: 1.4rem;
  margin: 0 0.4rem;
  vertical-align: -2px;
}

/* =========================================================
   Menu sections
   ========================================================= */
.menu {
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 5vw, 3rem);
  margin-top: 2rem;
}

.section {
  animation: rise 700ms ease-out both;
  animation-delay: calc(var(--i, 0) * 80ms);
}

.section__head {
  text-align: center;
  margin-bottom: 1.25rem;
}

.section__title {
  font-family: var(--font-display);
  font-weight: 500;
  font-style: italic;
  font-size: 1.7rem;
  color: var(--ink);
  letter-spacing: 0.02em;
}

html[dir="rtl"] .section__title {
  font-family: var(--font-ar-display);
  font-style: normal;
  font-weight: 700;
  font-size: 1.9rem;
}

.section__ornament {
  display: block;
  margin: 0.5rem auto;
  width: 60px;
  height: 12px;
  color: var(--gold);
}

.section__ornament svg { width: 100%; height: 100%; display: block; }

/* Item list */
.items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.4rem 1rem;
  align-items: baseline;
  position: relative;
}

.item__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.18rem;
  color: var(--ink);
  letter-spacing: 0.01em;
  line-height: 1.3;
}

html[dir="rtl"] .item__name {
  font-family: var(--font-ar-display);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.4;
}

/* Dotted leader between name and price */
.item__leader {
  flex: 1;
  border-bottom: 1px dotted var(--rule);
  margin: 0 0.5rem;
  transform: translateY(-4px);
  min-width: 1.5rem;
  align-self: end;
  margin-bottom: 0.45rem;
}

.item__price {
  font-family: var(--font-num);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--terracotta);
  font-feature-settings: "lnum";
  white-space: nowrap;
}

.item__price-currency {
  font-size: 0.75em;
  color: var(--ink-mute);
  font-weight: 500;
  margin: 0 0.25em;
  letter-spacing: 0.05em;
}

.item__desc {
  grid-column: 1 / -1;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-style: italic;
  color: var(--ink-mute);
  line-height: 1.55;
  max-width: 90%;
}

html[dir="rtl"] .item__desc {
  font-family: var(--font-ar-body);
  font-style: normal;
  font-size: 1rem;
}

/* Refined item layout: name + leader + price on one row */
.item__row {
  display: flex;
  align-items: baseline;
  gap: 0;
  width: 100%;
}

/* Tag pill (e.g. signature, vegetarian) */
.item__tag {
  display: inline-block;
  margin-inline-start: 0.5rem;
  padding: 0.05rem 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.7rem;
  color: var(--olive);
  letter-spacing: 0.04em;
  vertical-align: 2px;
  font-weight: 500;
}

html[dir="rtl"] .item__tag {
  font-family: var(--font-ar-body);
  font-style: normal;
  font-size: 0.78rem;
}

/* =========================================================
   Footer
   ========================================================= */
.foot {
  margin-top: 4rem;
  text-align: center;
  color: var(--ink-mute);
}

.foot__rule {
  width: 60px;
  height: 1px;
  background: var(--rule);
  margin: 0 auto 1.2rem;
}

.foot__copy {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

html[dir="rtl"] .foot__copy {
  font-family: var(--font-ar-body);
  font-style: normal;
  font-size: 1rem;
}

.foot__tag {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--ink-mute);
}

html[dir="rtl"] .foot__tag {
  font-family: var(--font-ar-body);
  letter-spacing: 0;
  font-size: 0.85rem;
}

.foot__tag code {
  font-family: 'Courier New', monospace;
  font-size: 0.95em;
  background: var(--paper-warm);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
}

/* =========================================================
   Section navigation
   ========================================================= */
.section-nav {
  position: sticky;
  top: 57px;
  z-index: 40;
  display: flex;
  gap: 0.4rem;
  padding: 0.55rem var(--pad-x);
  background: rgba(247, 239, 225, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  overflow-x: auto;
  scrollbar-width: none;
}
.section-nav::-webkit-scrollbar { display: none; }
.section-nav:empty { display: none; }

.section-nav__btn {
  flex-shrink: 0;
  appearance: none;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-soft);
  padding: 0.3rem 1rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}
.section-nav__btn:hover {
  border-color: var(--ink-soft);
  color: var(--ink);
}
.section-nav__btn.is-active {
  background: var(--ink);
  color: var(--paper-light);
  border-color: var(--ink);
}
html[dir="rtl"] .section-nav__btn {
  font-family: var(--font-ar-body);
  font-size: 0.9rem;
  letter-spacing: 0;
}

/* =========================================================
   Item hover + divider
   ========================================================= */
.item {
  padding: 0.55rem 0.6rem;
  margin: 0 -0.6rem;
  border-radius: 8px;
  transition: background 180ms ease;
}
.item:hover {
  background: rgba(200, 155, 60, 0.07);
}
.items { gap: 0; }
.items li + li {
  border-top: 1px solid rgba(214, 197, 168, 0.45);
}

/* =========================================================
   Colored tag pills
   ========================================================= */
.item__tag--signature  { border-color: var(--gold);        color: var(--gold-deep);  background: rgba(200,155,60,0.08);  }
.item__tag--vegetarian { border-color: #6a9e5f;            color: #3d7234;           background: rgba(106,158,95,0.08);  }
.item__tag--spicy      { border-color: var(--terracotta);  color: var(--terracotta); background: rgba(184,85,58,0.08);   }
.item__tag--cold       { border-color: #4a7fa8;            color: #2d6282;           background: rgba(74,127,168,0.08);  }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 480px) {
  html, body { font-size: 16px; }
  .topbar__name { display: none; }
  .item__name { font-size: 1.08rem; }
  html[dir="rtl"] .item__name { font-size: 1.22rem; }
  .item__price { font-size: 1.05rem; }
}
