/*
 * Chef Ahmad Website - Public Styles
 * Phone-first, warm appetizing gallery feel.
 * Supports English (LTR) and Arabic (RTL) via logical properties.
 */

/* -------------------------------------------------------------------------- */
/* 1. RESET & BASICS                                                          */
/* -------------------------------------------------------------------------- */

html {
  scroll-behavior: smooth;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

/* Hide elements with hidden attribute */
[hidden] {
  display: none !important;
}

/* Focus visible for accessibility */
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* -------------------------------------------------------------------------- */
/* 2. FONTS                                                                   */
/* -------------------------------------------------------------------------- */

@font-face {
  font-family: "Chef Serif";
  src: url("fonts/NotoSerif-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Chef Sans";
  src: url("fonts/NotoSans-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Chef Sans";
  src: url("fonts/NotoSans-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Chef Kufi";
  src: url("fonts/NotoKufiArabic-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

@font-face {
  font-family: "Chef Arabic";
  src: url("fonts/NotoSansArabic-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

@font-face {
  font-family: "Chef Arabic";
  src: url("fonts/NotoSansArabic-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

/* -------------------------------------------------------------------------- */
/* 3. TOKENS & THEME                                                          */
/* -------------------------------------------------------------------------- */

:root {
  /* Colors */
  --bg: #fff8ee;
  --ink: #2b1d14;
  --muted: #7b6551;
  --accent: #b4381e; /* Chili Red */
  --accent-dark: #7f2412;
  --gold: #e9a23b;
  --card: #ffffff;
  --line: #ecdcc4;
  --wa: #1f9d4d; /* WhatsApp Green */

  /* Spacing & Shape */
  --radius: 16px;
  --shadow: 0 6px 18px rgba(80, 40, 10, 0.10);

  /* Typography */
  --font-head: "Chef Serif", "Chef Kufi", Georgia, serif;
  --font-body: "Chef Sans", "Chef Arabic", system-ui, sans-serif;
}

/* Dark Mode Variant */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b120c;
    --ink: #f6eadb;
    --card: #2a1c13;
    --line: #43301f;
    --muted: #c2a88e;
    /* Accent and Gold remain the same for appetite appeal */
  }
}

/* -------------------------------------------------------------------------- */
/* 4. LANGUAGE TOGGLES                                                        */
/* -------------------------------------------------------------------------- */

/* Hide Arabic when English is active */
html[lang="en"] [data-l="ar"] {
  display: none;
}

/* Hide English when Arabic is active */
html[lang="ar"] [data-l="en"] {
  display: none;
}

/* -------------------------------------------------------------------------- */
/* 5. LAYOUT & BODY                                                           */
/* -------------------------------------------------------------------------- */

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  padding-bottom: 88px; /* Room for floating order button */
}

html[lang="ar"] body {
  line-height: 1.75;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* -------------------------------------------------------------------------- */
/* 6. HERO SECTION                                                            */
/* -------------------------------------------------------------------------- */

.hero {
  text-align: center;
  padding: 36px 20px 30px;
  color: #fff;
  border-bottom-left-radius: 28px;
  border-bottom-right-radius: 28px;
  /* Gradient background with decorative layers */
  background: linear-gradient(160deg, var(--accent) 0%, var(--accent-dark) 100%);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(233, 162, 59, 0.2) 0%, transparent 40%),
    repeating-radial-gradient(circle at 50% 50%, transparent 0, transparent 10px, rgba(0,0,0,0.05) 11px, transparent 12px),
    linear-gradient(160deg, var(--accent) 0%, var(--accent-dark) 100%);
}

.hero-logo {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold);
  margin: 0 auto 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.hero-name {
  font-family: var(--font-head);
  font-size: clamp(1.9rem, 6.5vw, 3rem);
  line-height: 1.15;
  margin: 0 0 6px;
  font-weight: 700;
  letter-spacing: 0;
}

.hero-tagline {
  opacity: 0.92;
  max-width: 36rem;
  margin: 0 auto;
  font-size: 1.05rem;
  font-weight: 400;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

/* -------------------------------------------------------------------------- */
/* 7. BUTTONS                                                                 */
/* -------------------------------------------------------------------------- */

.btn-order {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  background-color: var(--wa);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  font-family: var(--font-body);
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.btn-order:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.25);
}

#lang-toggle {
  min-height: 44px;
  padding: 0 18px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  background: transparent;
  color: #fff;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}

#lang-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Floating Action Button (FAB) */
.order-fab {
  position: fixed;
  bottom: 16px;
  inset-inline-end: 16px;
  z-index: 40;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  width: auto;
  min-width: 0;
  font-size: 1rem;
}

/* Ensure hero button is not fixed */
.hero .btn-order {
  position: static;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* -------------------------------------------------------------------------- */
/* 8. CATEGORY NAVIGATION                                                     */
/* -------------------------------------------------------------------------- */

.cat-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 16px;
  background-color: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  /* Hide scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
  white-space: nowrap;
}

.cat-nav::-webkit-scrollbar {
  display: none;
}

.cat-nav a {
  padding: 8px 16px;
  border-radius: 999px;
  background-color: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  flex: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.cat-nav a:hover {
  border-color: var(--accent);
}

.cat-nav a.active {
  background-color: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* -------------------------------------------------------------------------- */
/* 9. MAIN MENU LAYOUT                                                        */
/* -------------------------------------------------------------------------- */

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 16px 24px;
}

.menu-heading {
  font-family: var(--font-head);
  text-align: center;
  font-size: 1.6rem;
  margin: 28px 0 4px;
  font-weight: 700;
}

.cat {
  padding-top: 8px;
  scroll-margin-top: 70px; /* Offset for sticky nav */
}

.cat-title {
  font-family: var(--font-head);
  font-size: 1.6rem;
  margin: 28px 0 14px;
  font-weight: 700;
  position: relative;
  display: inline-block;
}

/* Gold bar under category title */
.cat-title::after {
  content: "";
  display: block;
  width: 48px;
  height: 4px;
  background-color: var(--gold);
  border-radius: 2px;
  margin-top: 8px;
}

/* -------------------------------------------------------------------------- */
/* 10. GRID & DISH CARDS                                                      */
/* -------------------------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.dish {
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
}

/* Dish Photo Area */
.dish-photo {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  margin: 0;
  background-color: #eadcc8;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  position: relative;
  cursor: zoom-in;
}

.dish-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.dish-photo:hover img {
  transform: scale(1.05);
}

/* No Photo Placeholder */
.no-photo {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #f6d9a8, #f2b66b);
  cursor: default;
  aspect-ratio: 1 / 1;
}

.no-photo span {
  font-family: var(--font-head);
  font-size: 3.2rem;
  color: var(--accent-dark);
  opacity: 0.85;
}

/* Dish Body Content */
.dish-body {
  padding: 10px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.dish-name {
  font-family: var(--font-head);
  font-size: 1.02rem;
  line-height: 1.3;
  margin: 0;
  font-weight: 700;
}

.dish-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dish-price {
  margin: 6px 0 0;
  margin-top: auto;
  font-weight: 700;
  color: var(--accent);
  font-size: 1.05rem;
}

.dish-price .amount {
  font-size: 1.2rem;
  unicode-bidi: isolate;
  margin-inline-end: 0.1em;
}

/* -------------------------------------------------------------------------- */
/* 11. INFO SECTION                                                           */
/* -------------------------------------------------------------------------- */

.info {
  max-width: 1100px;
  margin: 8px auto 0;
  padding: 8px 16px 24px;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.info-block {
  background-color: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}

.info-block h3 {
  font-family: var(--font-head);
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 700;
}

.tel {
  color: var(--ink);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

.hours {
  white-space: pre-line;
  margin: 0;
  color: var(--ink);
}

.social {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.social a {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
  background-color: var(--bg);
  font-size: 0.9rem;
}

.social a:hover {
  background-color: var(--line);
}

/* -------------------------------------------------------------------------- */
/* 12. FOOTER                                                                 */
/* -------------------------------------------------------------------------- */

.foot {
  text-align: center;
  color: var(--muted);
  padding: 18px 16px 30px;
  font-size: 0.9rem;
}

.foot p {
  margin: 0;
}

/* -------------------------------------------------------------------------- */
/* 13. LIGHTBOX                                                               */
/* -------------------------------------------------------------------------- */

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#lightbox[hidden] {
  display: none;
}

.lb-img {
  max-width: 94vw;
  max-height: 76vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.lb-caption {
  color: #fff;
  margin-top: 12px;
  font-weight: 700;
  text-align: center;
  font-size: 1rem;
}

.lb-close {
  position: absolute;
  top: 12px;
  inset-inline-end: 12px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 999px;
  border: 0;
  background-color: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 1.4rem;
  padding: 0 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-prev, .lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 56px;
  border: 0;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-prev {
  inset-inline-start: 8px;
}

.lb-next {
  inset-inline-end: 8px;
}

/* Flip arrow direction for RTL */
html[dir="rtl"] .lb-prev {
  transform: translateY(-50%) scaleX(-1);
}

html[dir="rtl"] .lb-next {
  transform: translateY(-50%) scaleX(-1);
}

/* -------------------------------------------------------------------------- */
/* 14. RESPONSIVE BREAKPOINTS                                                 */
/* -------------------------------------------------------------------------- */

@media (min-width: 720px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
  
  .dish-photo {
    aspect-ratio: 4 / 3;
  }

  .cat-nav {
    padding-inline: max(16px, calc((100% - 1100px) / 2 + 16px));
  }
}

@media (min-width: 900px) {
  .order-fab {
    padding: 0 16px;
    min-height: 44px;
  }
}

@media (min-width: 1020px) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* -------------------------------------------------------------------------- */
/* 15. ACCESSIBILITY & PRINT                                                  */
/* -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  .dish-photo img,
  .btn-order,
  .cat-nav a,
  .social a {
    transition: none;
  }
}

@media print {
  .order-fab,
  .cat-nav,
  #lightbox,
  #lang-toggle,
  .hero-actions {
    display: none !important;
  }
  
  .dish,
  .info-block,
  .hero {
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  body {
    background: #fff;
    color: #000;
    padding-bottom: 0;
  }
}
