:root {
  --color-bg: #15171b;
  --color-bg-alt: #20232a;
  --color-fg: #dde2dd;
  --color-fg-muted: #8e9a9a;
  --color-accent: #51625c;
  --color-accent-dim: #3d4a45;
  --color-border: #3a3e3a;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Manrope", -apple-system, Helvetica, Arial, sans-serif;
  --max-width: 1600px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-body);
  line-height: 1.6;
  /* No overflow-x:hidden here -- it silently breaks position:sticky for
     every descendant (the header), because it turns body into a scroll
     container, which becomes the sticky positioning context instead of
     the viewport. Reported live: the mobile header stopped staying put
     on scroll. The full-bleed carousel's 100vw trick is left to rely on
     overlay scrollbars not adding scrollable width, which held up in
     testing; .carousel itself still clips its own content via
     overflow:hidden. */
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-fg);
  line-height: 1.15;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 2px;
  font-weight: 700;
  border: 1px solid var(--color-accent-dim);
}

.btn-accent {
  background: var(--color-accent);
  color: var(--color-bg);
  border-color: var(--color-accent);
}

.btn-outline {
  color: var(--color-accent);
  background: transparent;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.logo-img {
  height: 28px;
  width: 28px;
  border-radius: 50%;
  display: block;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--color-fg);
  letter-spacing: 0.04em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 0.9rem;
}

.site-nav a {
  color: var(--color-fg-muted);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.phone-link {
  color: var(--color-accent);
  font-weight: 700;
  white-space: nowrap;
}

.book-btn {
  background: var(--color-accent);
  color: var(--color-bg);
  border: none;
  border-radius: 2px;
  padding: 10px 18px;
  font-family: var(--font-body);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

/* From a tablet width up, the header becomes a single row. Below that
   (the Review Focus 360px case included) everything stacks, so the logo,
   nav, phone link and CTA button can never overlap or clip. */
@media (min-width: 768px) {
  .site-header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* ---------- Breadcrumbs ---------- */

.breadcrumbs {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 16px 0;
  font-size: 0.85rem;
  color: var(--color-fg-muted);
}

.breadcrumbs-sep {
  margin: 0 6px;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  margin-top: 48px;
}

.site-footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--color-fg-muted);
}

.footer-contact a {
  color: var(--color-accent);
  font-weight: 700;
}

.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.footer-social a {
  color: var(--color-fg-muted);
  text-decoration: underline;
}

.footer-legal {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--color-fg-muted);
  text-decoration: underline;
  cursor: pointer;
  text-align: left;
}

/* ---------- Content sections ---------- */

.page-section, .afisha-teaser,
.about, .privacy, .afisha-list {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 32px 16px;
}

.page-section-with-photo {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .page-section-with-photo {
    grid-template-columns: 1.1fr 0.9fr;
    align-items: center;
  }
}

.page-photo {
  width: 100%;
  height: auto;
  border-radius: 2px;
  object-fit: cover;
}

.delivery-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

/* Used by 404.njk only now -- the home page dropped its hero section
   entirely (Anton: "убери надпись Holmes и хиро"), the carousel opens
   the page instead. */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 16px;
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
}

/* ---------- Home photo carousel ---------- */

.carousel {
  /* Full-bleed: break out of the centered max-width container so the
     carousel runs edge to edge, as Anton asked for explicitly. */
  position: relative;
  width: 100vw;
  left: 50%;
  margin-left: -50vw;
}

/* Manual swipe is plain native scrolling + scroll-snap -- a custom
   touch/mouse drag handler (tried first) read the live finger position
   itself and proved unreliable past the first slide on a real phone.
   Native touch scroll has none of that custom state to get wrong.
   Autoplay animates scrollLeft directly via rAF in carousel.js instead
   of calling scrollTo({behavior:'smooth'}), which is what fought
   scroll-snap on iOS in an earlier version of this carousel. */
.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: start;
}

.carousel-slide img {
  -webkit-user-drag: none;
  width: 100%;
  /* Separate desktop/mobile source files now carry the right crop (see
     <picture> in index.njk); this just matches their real ratio so the
     layout doesn't shift before the image loads. */
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 2px;
  display: block;
}

@media (min-width: 768px) {
  .carousel-slide img {
    /* Matches the real ratio of Anton's updated desktop crops (~2.14:1)
       so the full-bleed carousel fits within view height at typical
       desktop widths instead of running tall past the fold. */
    aspect-ratio: 2.14 / 1;
  }
}

/* ---------- Lunch page photo row ---------- */

.lunch-photos {
  /* Grid, not flex: Anton asked for these side by side at all screen
     sizes, including phones -- a 2-column grid can't collapse to a
     stack the way a flex row does at narrow widths. */
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 24px;
}

.lunch-photos .page-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.home-info {
  text-align: center;
  color: var(--color-fg-muted);
}

.home-info .contacts-phone {
  display: block;
  margin-top: 8px;
}

/* ---------- Menu page (image tiles + button label) ---------- */

.menu-tiles {
  display: grid;
  /* auto-fit (not auto-fill): with fewer tiles than fit in the row,
     auto-fill reserves empty trailing tracks and leaves dead space on
     the right at the wider --max-width; auto-fit collapses those empty
     tracks so the real tiles stretch to fill the row instead. */
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.menu-tile {
  display: block;
  color: var(--color-fg);
}

.menu-tile img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 2px;
  display: block;
}

.menu-tile-label {
  display: block;
  margin-top: 10px;
  text-align: center;
  background: var(--color-accent);
  color: var(--color-bg);
  padding: 10px;
  font-weight: 700;
}

/* ---------- Gallery page ---------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 2px;
  display: block;
}

/* ---------- Contacts ---------- */

.contacts-section {
  text-align: center;
}

.contacts-card {
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.contacts-address {
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.contacts-hours {
  color: var(--color-fg-muted);
}

.contacts-phone {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--color-accent);
  font-weight: 700;
}

/* ---------- Afisha cards (kept for pages built from this variant's codebase) ---------- */

.afisha-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.afisha-card {
  display: block;
  border: 1px solid var(--color-border);
  padding: 16px;
  color: var(--color-fg);
}

.afisha-card-date {
  color: var(--color-accent);
  font-size: 0.85rem;
}

.event-gallery-pending {
  color: var(--color-fg-muted);
  margin-top: 16px;
}

/* ---------- Modals (booking, consent) ---------- */

.booking-overlay, .consent-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.booking-overlay.open, .consent-overlay.open {
  display: flex;
}

.booking-panel, .consent-modal {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
}

.booking-panel.success .success-panel { display: block; }
.booking-panel.success form { display: none; }
.success-panel { display: none; }

/* ---------- Promo banner (Anton updates the image regularly) ---------- */

.promo-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.promo-overlay.open {
  display: flex;
}

.promo-modal {
  /* Fixed caps per breakpoint (not vh-relative) so the banner reads as
     a small popup, never close to covering the screen -- Anton asked
     for at most ~50% of the screen area, or a fixed size per device. */
  position: relative;
  width: 100%;
  max-width: 260px;
  max-height: 50vh;
}

.promo-modal img {
  display: block;
  width: 100%;
  max-height: 50vh;
  object-fit: contain;
  border-radius: 2px;
}

@media (min-width: 768px) {
  .promo-modal {
    max-width: 320px;
    max-height: 480px;
  }

  .promo-modal img {
    max-height: 480px;
  }
}

.promo-close {
  position: absolute;
  top: -16px;
  right: -16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  color: var(--color-fg);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

#bookingForm label {
  display: block;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--color-fg-muted);
}

#bookingForm input, #bookingForm textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-fg);
  font-family: var(--font-body);
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.submit-btn {
  background: var(--color-accent);
  color: var(--color-bg);
  border: none;
  padding: 12px 20px;
  font-weight: 700;
  cursor: pointer;
}

.form-status {
  margin-top: 10px;
  color: #e5a0a0;
  font-size: 0.85rem;
}

/* ---------- Cookie banner ---------- */

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  z-index: 90;
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner-actions {
  display: flex;
  gap: 10px;
}

.cookie-banner-actions button {
  padding: 8px 16px;
  border: 1px solid var(--color-accent-dim);
  background: transparent;
  color: var(--color-fg);
  cursor: pointer;
}

#cookieAccept {
  background: var(--color-accent);
  color: var(--color-bg);
  border-color: var(--color-accent);
  font-weight: 700;
}
