/* ===== Platform chrome: every page of the reservation service =====
   1) Arabic typography on every element (controls and placeholders included)
   2) landing-style header (nav | logo | actions) for clients with a "site" section
   3) the "Made by RESTASERV" badge (comet border)
   Colours come from the per-client --brand-* variables (see server.js); the
   Arabic fonts from --brand-font-*-ar (default IBM Plex Sans Arabic). */

button, input, select, textarea, optgroup, option { font-family: inherit; }

/* ---------- Arabic font on EVERYTHING when the page is Arabic ---------- */
html[lang="ar"] *,
html[lang="ar"] *::placeholder,
html[lang="ar"] option,
html[lang="ar"] optgroup {
  font-family: var(--brand-font-body-ar, 'IBM Plex Sans Arabic'), 'IBM Plex Sans Arabic', system-ui, sans-serif !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
html[lang="ar"] :is(h1, h2, h3, h4, h5, h6) {
  font-family: var(--brand-font-heading-ar, 'IBM Plex Sans Arabic'), 'IBM Plex Sans Arabic', system-ui, sans-serif !important;
  line-height: 1.4;
  font-style: normal !important;
}

/* ---------- landing-style header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 60;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  margin: -16px -16px 18px; padding: 14px 40px;
  background: var(--brand-bg, #FAF7F2); color: var(--brand-text, #222);
  border-bottom: 1px solid var(--brand-border, #F4E9DC);
}
.hdr nav { display: flex; gap: 28px; align-items: center; grid-column: 1; grid-row: 1; }
.hdr nav a {
  color: inherit; text-decoration: none; font-size: 0.72rem; font-weight: 600;
  padding-block: 4px; border-bottom: 1px solid transparent;
}
[data-label-style="caps"]:not([dir="rtl"]) .hdr nav a,
[data-label-style="caps"]:not([dir="rtl"]) .hdr .btn-book { text-transform: uppercase; letter-spacing: 0.2em; }
.hdr nav a.on { border-bottom-color: currentColor; }
.hdr .logo-link { grid-column: 2; grid-row: 1; display: flex; align-items: center; justify-content: center; color: inherit; text-decoration: none; }
.hdr .logo { height: 40px; width: auto; max-width: 140px; display: block; object-fit: contain; }
.hdr .logo.lw { display: none; }
.hdr .mk-logo { position: relative; display: block; width: 25px; height: 40px; }
.hdr .mk-logo img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
[data-theme="dark"] .hdr .logo.lb { display: none; }
[data-theme="dark"] .hdr .logo.lw { display: block; }
.hdr .logo-text { font-weight: 700; font-size: 1rem; }
.hdr .rt { grid-column: 3; grid-row: 1; justify-self: end; display: flex; align-items: center; gap: 6px; }
.hdr .ctl {
  width: 34px; height: 34px; display: inline-grid; place-items: center; background: none; border: 0;
  color: inherit; cursor: pointer; padding: 0; text-decoration: none;
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.hdr .ctl:hover { transform: translateY(-3px) rotate(-12deg); }
.hdr .ctl:active { transform: scale(0.92); }
.hdr .sn { display: none; }
[data-theme="dark"] .hdr .sn { display: inline; }
[data-theme="dark"] .hdr .mn { display: none; }
.hdr .btn-book {
  margin-inline-start: 12px; padding: 12px 20px; font-size: 0.72rem; font-weight: 600; white-space: nowrap;
  background: var(--brand-primary, #8B2E2E); color: var(--brand-primary-contrast, #fff);
  text-decoration: none; border-radius: var(--brand-radius, 0);
}
/* Label colour must hold in every link state (:visited/:active/:focus would otherwise show the
   browser's blue/purple/red), and in the child span the i18n swap writes into. */
.hdr .btn-book:link, .hdr .btn-book:visited, .hdr .btn-book:hover, .hdr .btn-book:focus, .hdr .btn-book:active,
.hdr .btn-book *, .hdr .btn-book:visited * {
  color: var(--brand-primary-contrast, #fff) !important;
  -webkit-text-fill-color: var(--brand-primary-contrast, #fff);
}
.hdr .btn-book.on { box-shadow: inset 0 -2px 0 currentColor; }
/* the "current page" underline above would otherwise replace the global focus ring on this link */
.hdr .btn-book:focus-visible, .hdr .btn-book.on:focus-visible {
  outline: none;
  box-shadow: inset 0 -2px 0 currentColor, 0 0 0 3px var(--brand-bg, #FAF7F2), 0 0 0 5px var(--brand-text, #222);
}
.hdr .burger { display: none; grid-column: 1; grid-row: 1; justify-self: start; }
@media (max-width: 900px) {
  .hdr { padding: 10px 16px; }
  .hdr nav { display: none; }
  .hdr .burger { display: inline-grid; }
  .hdr .btn-book { padding: 10px 14px; margin-inline-start: 6px; }
  .hdr.open nav {
    display: flex; position: absolute; top: 100%; inset-inline: 0; flex-direction: column; align-items: flex-start;
    gap: 18px; padding: 22px 24px; background: var(--brand-bg, #FAF7F2); color: var(--brand-text, #222);
    border-bottom: 1px solid var(--brand-border, #F4E9DC);
  }
}

/* ---------- admin logo ---------- */
.admin-logo { height: 28px; width: auto; max-width: 90px; object-fit: contain; flex: none; }

/* ---------- Made by RESTASERV badge ---------- */
.rs-badge {
  --rs-ink: var(--brand-text, #222);
  --rs-line: var(--brand-border, rgba(0, 0, 0, 0.18));
  --rs-muted: var(--brand-muted, color-mix(in srgb, var(--brand-text, #222) 65%, transparent));
  --rs-bg: var(--brand-bg, #fff);
  position: fixed; bottom: calc(18px + var(--rs-badge-offset, 0px)); inset-inline-end: 18px; z-index: 60;
  display: block; border-radius: 17px; padding: 2px; overflow: hidden; text-decoration: none;
  color: var(--rs-ink); background: var(--rs-line);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  animation: rsbin 0.9s 0.6s cubic-bezier(0.2, 0.9, 0.2, 1) backwards;
  transition: transform 0.3s, bottom 0.25s;
}
.rs-badge:hover { transform: translateY(-3px); }
.rs-badge::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 360px; height: 360px; margin: -180px 0 0 -180px;
  background: conic-gradient(from 0deg, transparent 0, transparent 68%, #e2432f 100%);
  animation: rsbspin 3.2s linear infinite;
}
.rs-badge .in {
  position: relative; display: flex; align-items: center; gap: 11px;
  padding-block: 6px; padding-inline: 6px 16px;
  background: var(--rs-bg); border-radius: 15px;
}
.rs-badge .mk { flex: none; position: relative; width: 27px; height: 42px; }
.rs-badge .mk img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
/* The mark follows the surface under it (pill / header background = the page's data-theme): light = black shape +
   red dot (.mk-b), dark = white shape + red dot over a thin black contour (.mk-o behind .mk-f). All three <img> are
   always in the DOM and only opacity changes, so there is never a flash of the wrong mark on load (the saved theme
   is applied by the early inline script before first paint). No transition: the pill and header backgrounds do not
   transition either (the toggle flips data-theme at once), so mark and surface change together. */
.mk .mk-o, .mk .mk-f { opacity: 0; }
[data-theme="dark"] .mk .mk-b { opacity: 0; }
[data-theme="dark"] .mk .mk-o, [data-theme="dark"] .mk .mk-f { opacity: 1; }
.rs-badge .tx { display: flex; flex-direction: column; line-height: 1.15; }
.rs-badge small { font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--rs-muted); }
.rs-badge b { font-size: 13px; letter-spacing: 0.06em; font-weight: 800; }
.rs-badge .ar { flex: none; transition: transform 0.3s; }
.rs-badge:hover .ar { transform: translate(2px, -2px); }
[dir="rtl"] .rs-badge .ar { transform: scaleX(-1); }
[dir="rtl"] .rs-badge:hover .ar { transform: scaleX(-1) translate(2px, -2px); }
html[lang="ar"] .rs-badge b { letter-spacing: 0.06em !important; text-transform: uppercase !important; font-family: system-ui, sans-serif !important; }
html[lang="ar"] .rs-badge small { font-size: 11px; }
/* The last content must never hide behind the fixed badge -- plain flow
   height, not a body:has() selector (unsupported in some embedded/older
   browsers, e.g. an in-app or older WebView browser a guest's confirmation
   link opens in -- a page relying only on :has() there got no reserved
   space at all). --rs-badge-offset is 0 on every page here (no sticky
   bottom bar in this service), kept only so the two services' CSS stay
   the same shape. */
.rs-badge-spacer { height: calc(18px + 70px + var(--rs-badge-offset, 0px)); }
@keyframes rsbin { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes rsbspin { to { transform: rotate(360deg); } }
@media (max-width: 600px) {
  .rs-badge { bottom: calc(12px + var(--rs-badge-offset, 0px)); inset-inline-end: 12px; }
  .rs-badge-spacer { height: calc(12px + 70px + var(--rs-badge-offset, 0px)); }
  .rs-badge small { display: none; }
  .rs-badge .in { padding-inline: 6px 12px; }
  /* Collapses to logo-only once the page has scrolled (public/js/chrome.js
     toggles .collapsed) -- expands again on tap (same script) or hover/focus
     (pure CSS, for the rare touch+pointer hybrid device). */
  .rs-badge.collapsed .tx,
  .rs-badge.collapsed .ar { display: none; }
  .rs-badge.collapsed .in { padding-inline: 6px; }
  .rs-badge.collapsed:hover .tx,
  .rs-badge.collapsed:focus-within .tx { display: flex; }
  .rs-badge.collapsed:hover .ar,
  .rs-badge.collapsed:focus-within .ar { display: inline-block; }
  .rs-badge.collapsed:hover .in,
  .rs-badge.collapsed:focus-within .in { padding-inline: 6px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .rs-badge, .rs-badge::before { animation: none; }
}

/* ---------- cover photo only in the client's own mode ----------
   The photo is a dark cinematic look; when the header theme toggle flips a
   dark client to light (or the reverse) the page falls back to its plain
   surface so text outside the panel stays readable. */
html[data-theme="light"] body.has-cover[data-base-theme="dark"]::before,
html[data-theme="light"] body.has-cover[data-base-theme="dark"]::after,
html[data-theme="dark"] body.has-cover[data-base-theme="light"]::before,
html[data-theme="dark"] body.has-cover[data-base-theme="light"]::after { display: none; }
