/* Shared layout for the four demo sites (fictional cafés and restaurants).
   Each page sets a theme class on <body>; the theme only changes variables and a few details. */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  --d-bg: #fff; --d-surface: #fff; --d-ink: #222; --d-muted: #555; --d-line: #ddd;
  --d-brand: #222; --d-on-brand: #fff; --d-accent: #f90; --d-on-accent: #111;
  --d-display: Georgia, serif; --d-body: Arial, sans-serif;
  --d-radius: 6px; --d-btn-radius: 6px;
  margin: 0;
  background: var(--d-bg);
  color: var(--d-ink);
  font-family: var(--d-body);
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
  padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 820px) { body { padding-bottom: 0; } }

h1, h2, h3, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
a:focus-visible { outline: 3px solid var(--d-accent); outline-offset: 3px; }
[id] { scroll-margin-top: 76px; }

.d-wrap { width: 100%; max-width: 1080px; margin-inline: auto; padding-inline: 20px; }

/* ---- Berrad strip (always the same) ---- */
.demo-bar { background: #0F4C3A; color: #F5F2EA; font-family: 'Outfit', 'Segoe UI', Arial, sans-serif; font-size: 14px; }
.demo-bar__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; min-height: 44px; padding-block: 6px; }
.demo-bar a { color: #F5F2EA; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.demo-bar a:hover { text-decoration: underline; }
.demo-bar span { opacity: 0.92; }

/* ---- Header ---- */
.d-header { position: sticky; top: 0; z-index: 20; background: var(--d-bg); border-bottom: 1px solid var(--d-line); }
.d-header__in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.d-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.d-logo__mark {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--d-brand); color: var(--d-accent);
  font-family: var(--d-display); font-weight: 700; font-size: 15px;
}
.d-logo__name { font-family: var(--d-display); font-weight: 700; font-size: 21px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-nav { display: none; gap: 26px; font-weight: 500; }
.d-nav a { text-decoration: none; padding: 10px 2px; }
.d-nav a:hover { text-decoration: underline; text-underline-offset: 5px; }
@media (min-width: 820px) { .d-nav { display: flex; } }

.d-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 12px 24px;
  border: 2px solid transparent; border-radius: var(--d-btn-radius);
  font: inherit; font-weight: 700; font-size: 16px; line-height: 1.2; text-decoration: none;
  transition: filter .15s ease, background-color .15s ease, color .15s ease;
}
.d-btn--accent { background: var(--d-accent); color: var(--d-on-accent); }
.d-btn--accent:hover { filter: brightness(1.08); }
.d-btn--ghost { border-color: currentColor; }
.d-btn--ghost:hover { background: rgba(127, 127, 127, 0.18); }
.d-btn--small { min-height: 44px; padding: 8px 16px; font-size: 15px; }

/* ---- Hero ---- */
.d-hero { background: var(--d-brand); color: var(--d-on-brand); position: relative; overflow: hidden; }
.d-hero__in { display: grid; gap: 32px; padding-block: clamp(44px, 9vw, 92px); align-items: center; }
.d-hero__text { display: grid; gap: 18px; justify-items: start; min-width: 0; }
.d-hero__kicker { font-size: 13px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--d-accent); }
.d-hero h1 { font-family: var(--d-display); font-weight: 700; font-size: clamp(38px, 8vw, 78px); line-height: 1.02; text-wrap: balance; }
.d-hero__sub { font-size: clamp(17px, 2.2vw, 20px); max-width: 520px; opacity: 0.92; }
.d-hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.d-hero__art { justify-self: center; width: min(100%, 340px); }
.d-hero__art svg { display: block; width: 100%; height: auto; }
.d-hero__photo { justify-self: center; width: 100%; max-width: 480px; }
.d-hero__photo img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--d-radius); }
.d-hero__emblem { width: 84px; }
.d-hero__emblem svg { display: block; width: 100%; height: auto; }
.d-gallery-sec { padding-top: clamp(28px, 5vw, 56px); }
.d-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.d-gallery img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--d-radius); }
@media (min-width: 820px) { .d-gallery { gap: 20px; } .d-gallery img { aspect-ratio: 16 / 9; } }
.d-hero--center .d-hero__text { justify-items: center; text-align: center; margin-inline: auto; }
.d-hero--center .d-hero__cta { justify-content: center; }
@media (min-width: 820px) {
  .d-hero--split .d-hero__in { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 48px; }
}
@media (max-width: 480px) { .d-hero__cta .d-btn { flex: 1 1 100%; } }

/* ---- Facts strip ---- */
.d-facts { background: var(--d-surface); border-bottom: 1px solid var(--d-line); }
.d-facts__in { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 4px 24px; padding-block: 18px; }
.d-fact { display: grid; gap: 2px; padding-block: 8px; }
.d-fact b { font-family: var(--d-display); font-size: 19px; font-weight: 700; }
.d-fact span { color: var(--d-muted); font-size: 15px; }

/* ---- Menu ---- */
.d-section { padding-block: clamp(48px, 8vw, 84px); }
.d-head { display: grid; gap: 8px; margin-bottom: 24px; }
.d-head h2 { font-family: var(--d-display); font-weight: 700; font-size: clamp(30px, 5vw, 48px); line-height: 1.08; }
.d-head p { color: var(--d-muted); max-width: 560px; }
.d-cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 24px; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.d-cats a {
  flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px;
  border: 1px solid var(--d-line); border-radius: var(--d-btn-radius);
  background: var(--d-surface); font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap;
}
.d-cats a:hover { border-color: var(--d-ink); }

.d-menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 36px 48px; }
.d-cat h3 {
  font-family: var(--d-display); font-weight: 700; font-size: 26px; line-height: 1.2;
  padding-bottom: 10px; margin-bottom: 6px; border-bottom: 2px solid var(--d-ink);
}
.items { display: grid; }
.item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; align-items: baseline; padding-block: 12px; border-bottom: 1px solid var(--d-line); }
.item__name { font-weight: 600; font-size: 17px; }
.item__ar { font-family: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif; font-weight: 500; font-size: 15px; color: var(--d-muted); display: inline-block; margin-left: 10px; unicode-bidi: isolate; }
.item__price { font-weight: 700; font-size: 17px; white-space: nowrap; }
.item__price small { font-size: 12px; font-weight: 600; opacity: 0.8; }
.item__desc { grid-column: 1 / -1; color: var(--d-muted); font-size: 15px; }

/* cards variant */
.d-menu--cards { grid-template-columns: minmax(0, 1fr); gap: 40px; }
.d-menu--cards .d-cat h3 { border: 0; padding: 0; margin-bottom: 14px; }
.d-menu--cards .items { grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: 12px; }
.d-menu--cards .item {
  background: var(--d-surface); border: 1px solid var(--d-line); border-radius: var(--d-radius);
  padding: 16px 18px; align-content: start;
}

/* ---- Info ---- */
.d-info { background: var(--d-surface); border-top: 1px solid var(--d-line); }
.d-info__in { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 32px 48px; }
.d-info h3 { font-family: var(--d-display); font-weight: 700; font-size: 24px; margin-bottom: 10px; }
.d-hours { display: grid; gap: 0; }
.d-hours div { display: flex; justify-content: space-between; gap: 16px; padding-block: 9px; border-bottom: 1px solid var(--d-line); }
.d-hours dt { font-weight: 600; }
.d-hours dd { color: var(--d-muted); text-align: end; }
.d-block { display: grid; gap: 12px; align-content: start; justify-items: start; }
.d-block p { color: var(--d-muted); }

/* ---- Berrad credit ---- */
.d-credit { background: #0F4C3A; color: #F5F2EA; font-family: 'Outfit', 'Segoe UI', Arial, sans-serif; }
.d-credit__in { padding-block: 36px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px; }
.d-credit p { font-size: 18px; max-width: 560px; }
.d-credit b { font-weight: 700; }
.d-credit a.d-btn { background: #B8492A; color: #fff; border-radius: 4px; }
.d-credit a.d-btn:hover { background: #9C3B20; filter: none; }

.d-footer { padding-block: 22px; font-size: 14px; color: var(--d-muted); text-align: center; }

/* ---- Mobile action bar ---- */
.d-mbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  background: var(--d-bg); border-top: 1px solid var(--d-line);
}
.d-mbar .d-btn { min-height: 48px; padding: 8px 10px; font-size: 15px; }
.d-mbar .d-btn--ghost { color: var(--d-ink); }
@media (min-width: 820px) { .d-mbar { display: none; } }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

/* ================= THEMES ================= */

/* Café Noss-Noss — neighbourhood café, warm and traditional */
.theme-noss {
  --d-bg: #F6EFE2; --d-surface: #FFFAF1; --d-ink: #2B1A10; --d-muted: #6B5546; --d-line: #DDCDB4;
  --d-brand: #4A2E1F; --d-on-brand: #F6EFE2; --d-accent: #D9A441; --d-on-accent: #2B1A10;
  --d-display: 'DM Serif Display', Georgia, serif; --d-body: 'DM Sans', 'Segoe UI', Arial, sans-serif;
  --d-radius: 2px; --d-btn-radius: 2px;
}
.theme-noss .d-hero { border-bottom: 6px double var(--d-accent); }
.theme-noss .d-hero__photo img { border: 6px double var(--d-accent); object-position: 50% 80%; }
.theme-noss .d-hero h1, .theme-noss .d-head h2, .theme-noss .d-cat h3, .theme-noss .d-logo__name { font-weight: 400; }
.theme-noss .d-fact b, .theme-noss .d-info h3 { font-weight: 400; }
.theme-noss .d-cat h3 { border-bottom-style: double; border-bottom-width: 4px; border-color: var(--d-brand); }

/* Maison Lwiza — modern coffee shop, light and rounded */
.theme-lwiza {
  --d-bg: #FFF6F2; --d-surface: #FFFFFF; --d-ink: #1F3D36; --d-muted: #51655F; --d-line: #EBD9D0;
  --d-brand: #1F3D36; --d-on-brand: #FFF6F2; --d-accent: #FF8A70; --d-on-accent: #1F3D36;
  --d-display: 'Bricolage Grotesque', 'Segoe UI', Arial, sans-serif; --d-body: 'Inter', 'Segoe UI', Arial, sans-serif;
  --d-radius: 18px; --d-btn-radius: 999px;
}
.theme-lwiza .d-hero h1 { letter-spacing: -0.03em; }
.theme-lwiza .d-hero__photo img { border-radius: 32px; }
.theme-lwiza .d-menu--cards .item { border: 0; box-shadow: 0 1px 0 var(--d-line), 0 8px 24px rgba(31, 61, 54, 0.06); }
.theme-lwiza .item__price { background: #FFE3DA; padding: 2px 10px; border-radius: 999px; }

/* Dar Zaafran — Moroccan restaurant, elegant */
.theme-zaafran {
  --d-bg: #FBF4E6; --d-surface: #FFFBF2; --d-ink: #3A0A12; --d-muted: #6B5A4A; --d-line: #E2D2B4;
  --d-brand: #6E1423; --d-on-brand: #FBF4E6; --d-accent: #E0A526; --d-on-accent: #3A0A12;
  --d-display: 'Cormorant Garamond', Georgia, serif; --d-body: 'Mulish', 'Segoe UI', Arial, sans-serif;
  --d-radius: 0; --d-btn-radius: 0;
}
.theme-zaafran .d-hero h1 { font-size: clamp(42px, 9vw, 92px); letter-spacing: 0.01em; }
.theme-zaafran .d-hero__photo { max-width: 360px; }
.theme-zaafran .d-hero__photo img { aspect-ratio: 3 / 4; border-radius: 999px 999px 0 0; border: 3px solid var(--d-accent); }
.theme-zaafran .d-head { justify-items: center; text-align: center; }
.theme-zaafran .d-head h2::after { content: "◆"; display: block; font-size: 14px; color: var(--d-brand); margin-top: 8px; }
.theme-zaafran .d-cats { justify-content: safe center; }
.theme-zaafran .d-cat h3 { border-bottom: 1px solid var(--d-brand); color: var(--d-brand); font-size: 30px; }
.theme-zaafran .item { border-bottom-style: dotted; border-bottom-width: 2px; }
.theme-zaafran .item__name { font-family: var(--d-display); font-size: 22px; font-weight: 700; }
.theme-zaafran .item__price { font-family: var(--d-display); font-size: 22px; color: var(--d-brand); }

/* Chwa House — grill, dark and loud */
.theme-chwa {
  --d-bg: #141414; --d-surface: #1E1E1E; --d-ink: #F4EDE4; --d-muted: #B5ADA3; --d-line: #343434;
  --d-brand: #141414; --d-on-brand: #F4EDE4; --d-accent: #FF5A1F; --d-on-accent: #141414;
  --d-display: 'Anton', Impact, 'Arial Narrow', sans-serif; --d-body: 'Barlow', 'Segoe UI', Arial, sans-serif;
  --d-radius: 4px; --d-btn-radius: 4px;
}
.theme-chwa .d-hero h1, .theme-chwa .d-head h2, .theme-chwa .d-cat h3 { font-weight: 400; text-transform: uppercase; letter-spacing: 0.01em; }
.theme-chwa .d-hero h1 { font-size: clamp(46px, 11vw, 116px); line-height: 0.95; }
.theme-chwa .d-hero h1 em { font-style: normal; color: var(--d-accent); }
.theme-chwa .d-logo__name { font-weight: 400; letter-spacing: 0.03em; text-transform: uppercase; }
.theme-chwa .d-logo__mark { background: var(--d-accent); color: #141414; }
.theme-chwa .d-hero { border-bottom: 6px solid var(--d-accent); }
.theme-chwa .d-hero__photo img { border-bottom: 6px solid var(--d-accent); }
.theme-chwa .item__price { color: var(--d-accent); }
.theme-chwa .d-cat h3 { font-size: 30px; }
.theme-chwa .d-fact b, .theme-chwa .d-info h3 { font-weight: 400; text-transform: uppercase; letter-spacing: 0.02em; }
