/*
 * site.css: the only stylesheet for levantrestaurant.co.uk (Levant Lebanese).
 *
 * Sections, in order:
 *   1. Tokens        colours, fonts, spacing (custom properties)
 *   2. Fonts         @font-face for self-hosted fonts
 *   3. Base          reset and element defaults
 *   4. Layout        container, split sections
 *   5. Components    one block per component: "=== Component: <name> ==="
 *   6. Pages         rare page-specific rules: "=== Page: <path> ==="
 *   7. Utilities     a handful of helpers
 *
 * Breakpoints (the original's Elementor defaults; media queries can't use custom properties):
 *   mobile  ≤ 767px    tablet 768px–1024px    desktop ≥ 1025px
 *   The burger menu appears only on mobile (≤ 767px), as on the original.
 *
 * Editing: change tokens to restyle the site; add new components as new blocks;
 * add modifier classes (.button--light) instead of changing a component for one page.
 */

/* ============ 1. Tokens ============ */
:root {
  /* Colours (from the original's Elementor CSS) */
  --color-red: #c1272d;          /* headings, buttons */
  --color-red-dark: #c30500;     /* footer bar, "Order Online" panel, mobile menu */
  --color-text: #7a7a7a;         /* body copy */
  --color-bg: #ffffff;
  --color-bg-alt: #f4f4f4;       /* "Our Menu" and "Contact Us" panels, menu dividers */
  --color-white: #ffffff;
  --color-nav-active: rgba(255, 255, 255, 0.71);
  --color-overlay: rgba(0, 0, 0, 0.5);
  --color-backdrop: rgba(0, 0, 0, 0.8);

  /* Typography */
  --font-heading: "Merienda", "Merienda One", cursive, sans-serif;
  --font-nav: "Merienda One", "Merienda", cursive, sans-serif;
  --font-body: "PT Sans", Arial, sans-serif;
  --text-body: 18px;
  --text-h2: 40px;
  --text-hero: 34px;

  /* Spacing and shape */
  --header-height: 110px;
  --panel-padding: 50px;         /* 30px on mobile */
  --widget-gap: 20px;            /* Elementor's space between widgets */
  --container: 1140px;
  --radius: 3px;

  /* Motion (the original's timings) */
  --duration: 300ms;
  --ease: ease;
}

/* ============ 2. Fonts ============ */
/* Google Fonts, self-hosted (latin subset). Merienda is a variable font (300–900). */
@font-face { font-family: "Merienda"; src: url("/assets/fonts/merienda-latin-var.woff2") format("woff2"); font-weight: 300 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Merienda One"; src: url("/assets/fonts/merienda-one-latin-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "PT Sans"; src: url("/assets/fonts/pt-sans-latin-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

/* ============ 3. Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font-body); font-size: 16px; line-height: 1.5; color: var(--color-text); background: var(--color-bg); }
img, svg, video, iframe { max-width: 100%; }
img, video { height: auto; display: block; }
h1, h2, h3, h4 { margin: 0; line-height: 1; }
p { margin: 0; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid #4d90fe; outline-offset: 2px; }
/* Anchor targets land below the sticky header (the original let the header cover them). */
[id] { scroll-margin-top: var(--header-height); }

/* ============ 4. Layout ============ */
.container { width: 100%; max-width: var(--container); margin-inline: auto; }

/* === Layout: split (two half-width panels side by side; stacked on mobile) === */
.split { display: flex; flex-wrap: wrap; }
.split > * { flex: 0 0 50%; max-width: 50%; }
.split__panel { padding: var(--panel-padding); }
.split__panel > * + * { margin-top: var(--widget-gap); }
.split__panel--alt { background: var(--color-bg-alt); }
.split__panel--red { background: var(--color-red-dark); color: var(--color-white); }
.split__media { background-position: center center; background-repeat: no-repeat; background-size: cover; }
/* Map + contact: stacked from tablet down. */
@media (max-width: 1024px) {
  .split--stack-tablet > * { flex-basis: 100%; max-width: 100%; }
}
@media (max-width: 767px) {
  :root { --panel-padding: 30px; }
  .split > * { flex-basis: 100%; max-width: 100%; }
  .split__media { display: none; } /* image panels are hidden on phones, as on the original */
}

/* ============ 5. Components ============ */

/* === Component: skip-link === */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; padding: 8px 16px; background: var(--color-bg); color: var(--color-red); }
.skip-link:focus { left: 16px; }

/* === Component: icon (inline SVG symbols, defined in the header partial) === */
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { display: inline-block; width: 1em; height: 1em; fill: currentColor; flex: none; }
.icon--arrow { width: 0.875em; }

/* === Component: site-header (sticky, textured red, logo left, menu right) === */
.site-header { position: sticky; top: 0; z-index: 50; padding: 10px 30px; background: #8b0000 url("/wp-content/uploads/2020/11/header-bg.jpg") top center / cover no-repeat; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; min-height: 90px; }
.site-header__logo { display: block; padding: 10px; flex: none; }
.site-header__logo img { width: 110px; height: 70px; }
.site-header__nav-wrap { padding: 10px; display: flex; justify-content: flex-end; }
.nav-toggle { display: none; position: relative; align-items: center; justify-content: center; width: 33px; height: 33px; padding: 0; border: 0; border-radius: var(--radius); background: var(--color-white); color: var(--color-red-dark); font-size: 22px; cursor: pointer; transition: background-color var(--duration), color var(--duration); }
.nav-toggle::before { content: ""; position: absolute; inset: -6px; } /* 45px tap area around the 33px button */
.nav-toggle:hover, .nav-toggle:focus-visible, .nav-toggle[aria-expanded="true"] { background: var(--color-red-dark); color: var(--color-white); }
.nav-toggle .icon--close { display: none; }
.nav-toggle[aria-expanded="true"] .icon--menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon--close { display: inline-block; }
.site-nav__list { display: flex; list-style: none; margin: 0; padding: 0; }
.site-nav__list li + li { margin-left: 20px; }
.site-nav a { display: block; padding: 13px 20px; font-family: var(--font-nav); font-size: 16px; line-height: 20px; color: var(--color-white); text-decoration: none; transition: color var(--duration), background-color var(--duration); }
.site-nav a:hover, .site-nav a:focus-visible, .site-nav a[aria-current="page"], .site-nav a.is-active { color: var(--color-nav-active); }
@media (max-width: 1024px) {
  .site-header { padding: 10px; }
  .site-nav__list li + li { margin-left: 0; }
}
@media (max-width: 767px) {
  .site-header__logo, .site-header__nav-wrap { flex: 0 0 50%; }
  .nav-toggle { display: inline-flex; }
  /* Dropdown: full width, 10px under the toggle, slides open (grid rows 0fr → 1fr). */
  .site-nav { position: absolute; left: 0; right: 0; top: 82px; display: grid; grid-template-rows: 0fr; align-items: stretch; visibility: hidden; transition: grid-template-rows 0.3s ease, visibility 0s linear 0.3s; }
  .site-nav.is-open { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows 0.3s ease, visibility 0s; }
  .site-nav.is-instant { transition: none; }
  .site-nav__list { display: block; min-height: 0; overflow: hidden; background: var(--color-white); }
  .site-nav__list li:not(:last-child) { border-bottom: 2px solid var(--color-bg-alt); }
  .site-nav a { padding: 20px; color: var(--color-red-dark); }
  .site-nav a:hover, .site-nav a:focus-visible, .site-nav a[aria-current="page"], .site-nav a.is-active { color: var(--color-white); background: var(--color-red-dark); }
}

/* === Component: site-footer (red bar: copyright left, credit right) === */
.site-footer { background: var(--color-red-dark); color: var(--color-white); font-family: var(--font-heading); font-size: 16px; }
.site-footer__bar-inner { display: flex; align-items: center; min-height: 75px; }
.site-footer__bar-inner > p { flex: 0 0 50%; padding: 10px; margin: 0; }
.site-footer__credit { text-align: right; }
.site-footer__credit a { color: var(--color-white); font-weight: 700; text-decoration: none; }
.site-footer__credit a:hover { text-decoration: underline; }
@media (max-width: 767px) {
  .site-footer { font-size: 14px; }
  .site-footer__bar-inner { min-height: 88px; }
  .site-footer__copyright { flex-basis: 55% !important; }
  .site-footer__credit { flex-basis: 45% !important; }
}

/* === Component: button (Elementor button with arrow icon and pulse-grow hover) === */
.button { display: inline-flex; align-items: center; gap: 15px; padding: 12px 24px; border: 2px solid var(--color-red); border-radius: var(--radius); background: var(--color-red); color: var(--color-white); font-family: var(--font-heading); font-size: 18px; font-weight: 500; line-height: 1; letter-spacing: 1px; text-decoration: none; transition: all var(--duration); }
.button:hover, .button:focus-visible { background: var(--color-white); color: var(--color-red); }
.button--light { background: var(--color-white); border-color: var(--color-white); color: var(--color-red); }
.button--light:hover, .button--light:focus-visible { background: var(--color-red); color: var(--color-white); }
.button--pulse:hover, .button--pulse:focus-visible { animation: pulse-grow 0.3s linear infinite alternate; }
@keyframes pulse-grow { to { transform: scale(1.1); } }

/* === Component: section-title (script headings) === */
.section-title { font-family: var(--font-heading); font-size: var(--text-h2); font-weight: 900; line-height: 1; color: var(--color-red); }
.section-title--white { color: var(--color-white); }
.section-title--sm { font-size: 30px; }

/* === Component: rich-text (body copy paragraphs) === */
/* Elementor text widgets start 1em above the first paragraph; padding-top keeps that spacing. */
.rich-text { display: flow-root; padding-top: 1em; font-family: var(--font-body); font-size: var(--text-body); line-height: 1.5; }
.rich-text p { margin-bottom: 18px; }
.rich-text--white { color: var(--color-white); }

/* === Component: hero (photo banner with dark overlay, centred heading and button) === */
.hero { position: relative; display: flex; align-items: center; justify-content: center; min-height: 700px; background-position: center center; background-repeat: no-repeat; background-size: cover; text-align: center; }
.hero::before { content: ""; position: absolute; inset: 0; background: var(--color-overlay); }
.hero--short { min-height: 300px; }
.hero--short .hero__title { padding-bottom: 0; } /* the gallery banner heading had no bottom padding */
.hero__inner { position: relative; width: 100%; max-width: 760px; padding: 10px; }
.hero__title { padding-bottom: 10px; font-family: var(--font-heading); font-size: var(--text-hero); font-weight: 700; line-height: 1; color: var(--color-white); }
.hero__inner > * + * { margin-top: var(--widget-gap); }
@media (max-width: 1024px) {
  .hero, .hero--short { min-height: 430px; }
}
@media (max-width: 767px) {
  .hero, .hero--short { min-height: 332px; padding: 30px 10px; }
  .hero__title { font-size: 26px; line-height: 1.5; }
}

/* === Component: map (keyless Google Maps iframe) === */
.map { display: block; width: 100%; height: 420px; border: 0; }

/* === Component: gallery-grid (Elementor Extras "mixed" masonry rebuilt with CSS grid) ===
 * 3 columns on desktop with items 5, 11, 17… spanning 2×2; 2 columns on tablet with
 * items 3, 7, 11, 15 spanning the full width (2 rows); 1 column on mobile. 48px gaps.
 * Row height matches the original: a 4:3 box around each tile (tile + 48px gutter)
 * minus the gutter: 0.75 × (column + 48px) − 48px. Needs a size container around the
 * grid (.gallery-section__inner); without container-query units tiles fall back to a fixed ratio.
 * Each link opens the full image in GLightbox; give each grid its own data-gallery. */
.gallery-grid { --cols: 3; --col: calc((100cqw - (var(--cols) - 1) * 48px) / var(--cols)); display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 48px; }
.gallery-grid__item { display: block; position: relative; aspect-ratio: 341 / 244; overflow: hidden; }
.gallery-grid__item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@supports (width: 1cqw) {
  .gallery-grid { grid-auto-rows: calc(0.75 * (var(--col) + 48px) - 48px); }
  .gallery-grid > .gallery-grid__item:nth-child(n) { aspect-ratio: auto; }
}
@media (min-width: 1025px) {
  .gallery-grid__item:nth-child(6n + 5) { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
}
@media (min-width: 768px) and (max-width: 1024px) {
  .gallery-grid { --cols: 2; }
  .gallery-grid__item:nth-child(4n + 3) { grid-column: span 2; grid-row: span 2; aspect-ratio: 718 / 527; }
}
@media (max-width: 767px) {
  .gallery-grid { --cols: 1; }
}

/* === Component: lightbox (GLightbox; library CSS in /assets/vendor/glightbox-3.3.1/) === */
.glightbox-container .goverlay { background: rgba(0, 0, 0, 0.9); }

/* === Component: popup (side panel <dialog>, docked left, full height, fades in from the left) === */
.popup { border: 0; padding: 0; margin: 0; }
.popup::backdrop { background: var(--color-backdrop); }
.popup--panel { position: fixed; inset: 0 auto 0 0; width: 400px; max-width: 100%; height: 100vh; max-height: 100vh; overflow-y: auto; background: #333 url("/wp-content/uploads/2023/07/Full_Table_Crops_1-scaled.jpg") top left / cover no-repeat; box-shadow: 2px 8px 23px 3px rgba(0, 0, 0, 0.2); color: var(--color-white); text-align: center; }
.popup--panel[open] { animation: fade-in-left 1.2s; }
@keyframes fade-in-left { from { opacity: 0; transform: translate3d(-100%, 0, 0); } to { opacity: 1; transform: none; } }
.popup__inner { min-height: 100%; padding: 60px 50px; }
.popup__inner > * + * { margin-top: var(--widget-gap); }
.popup__title { font-family: var(--font-heading); font-size: 120px; font-weight: 300; line-height: 1; text-transform: uppercase; color: var(--color-white); }
.popup__text { display: flow-root; padding-top: 1em; font-family: var(--font-body); font-size: 17px; line-height: 1.5; }
.popup__text p { margin-bottom: 17px; }
.popup__close { position: absolute; top: 20px; right: 20px; width: 15px; height: 15px; padding: 0; border: 0; background: none; color: var(--color-white); font-size: 15px; line-height: 1; cursor: pointer; }
.popup__close::before { content: ""; position: absolute; inset: -15px; } /* 45px tap area */
.button--popup { padding: 15px 40px; border: 0; border-radius: 5px; font-weight: 900; letter-spacing: 0; text-transform: uppercase; }
@media (max-width: 1024px) {
  .popup--panel { width: 370px; background-position: -34px -42px; }
  .popup__inner { padding: 90px 40px 40px; }
  .popup__title { font-size: 126px; }
  .popup__text { font-size: 15px; }
  .popup__text p { margin-bottom: 15px; }
  .popup__inner > .popup__actions { padding-top: 20px; }
}
@media (max-width: 767px) {
  .popup--panel { background-position: 0 0; }
  .button--popup { font-size: 16px; }
}

/* ============ 6. Pages ============ */

/* === Page: / (home) === */
/* "Download Our App" panel: the original column had a 20px bottom margin from tablet down. */
@media (max-width: 1024px) {
  .order__app { padding-bottom: calc(var(--panel-padding) + 20px); }
}

/* === Page: /404.html === */
.split > .split__panel--full { flex-basis: 100%; max-width: 100%; text-align: center; }
.button-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; }

/* === Page: /gallery/ === */
.gallery-section { padding: 150px; }
.gallery-section__inner { max-width: var(--container); margin-inline: auto; padding: 10px; container-type: inline-size; }
@media (max-width: 1024px) { .gallery-section { padding: 15px; } }
@media (max-width: 767px) { .gallery-section { padding: 5px; } }

/* ============ 7. Utilities ============ */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.text-center { text-align: center; }

/* ============ Reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
