/* =============================================================
   Le Diplomate Café — Menu page
   Requires base.css.
   ============================================================= */


/* ── Menu page layout ────────────────────────────────────────── */
.menu-page {
  padding-top: var(--nav-height);
}


/* ── Page header — BG 1 (classical statues) ──────────────────── */
.menu-page .page-header {
  position: relative;
  background-color: var(--color-bg-base);
  background-image:
    linear-gradient(
      to bottom,
      rgba(16, 24, 32, 0.55) 0%,
      rgba(16, 24, 32, 0.88) 100%
    ),
    url('../assets/backgrounds/bg-1.png');
  background-size: cover;
  background-position: center 30%;
  border-bottom: 1px solid var(--color-border-subtle);
}


/* ── Scroll progress bar (injected by menu.js) ───────────────── */
.menu-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--color-accent-gold);
  opacity: 0.5;
  z-index: 200;
  pointer-events: none;
  transition: width 0.1s ease-out;
  will-change: width;
}


/* ── In-page sticky sub-navigation ──────────────────────────── */
.menu-subnav {
  position: sticky;
  top: var(--nav-height);
  z-index: 80;
  background: var(--color-bg-base);
  border-bottom: 1px solid var(--color-border-subtle);
  transition: background 0.3s ease;
}

/* Mobile horizontal scroll hint — right-edge fade */
@media (max-width: 900px) {
  .menu-subnav::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 72px;
    background: linear-gradient(
      to right,
      transparent 0%,
      var(--color-bg-base) 75%
    );
    pointer-events: none;
    z-index: 2;
  }
}

.menu-subnav-inner {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.menu-subnav-inner::-webkit-scrollbar { display: none; }

.menu-subnav-link {
  display: block;
  flex-shrink: 0;
  padding: 18px 24px;
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  opacity: 0.82;
  border-bottom: 2px solid transparent;
  transition:
    color   0.2s ease,
    opacity 0.2s ease,
    border-color 0.2s ease;
  white-space: nowrap;
}
.menu-subnav-link:hover {
  color: var(--color-text-primary);
  opacity: 1;
}
.menu-subnav-link.is-active {
  color: var(--color-accent-gold);
  opacity: 1;
  border-bottom-color: var(--color-accent-gold);
  border-bottom-width: 2px;
  background: rgba(254, 203, 139, 0.06);
}


/* ── Menu sections ───────────────────────────────────────────── */
.menu-section {
  padding: 80px 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

.menu-section-image {
  aspect-ratio: 21 / 9;
  overflow: hidden;
  margin: -80px calc(-1 * var(--pad-section-h)) 56px;
}

.menu-section-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  display: block;
  transition: transform 0.8s ease;
}

.menu-section-image:hover img {
  transform: scale(1.02);
}

@media (max-width: 768px) {
  .menu-section-image {
    aspect-ratio: 16 / 9;
    margin: -56px calc(-1 * var(--pad-section-h)) 40px;
  }
}
.menu-section:last-of-type {
  border-bottom: none;
}

.menu-section-header {
  margin-bottom: 48px;
}

.menu-section-note {
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--color-accent-sand);
  opacity: 0.7;
  margin-top: 8px;
}

.menu-section-title {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(38px, 4.8vw, 68px);
  letter-spacing: 0.02em;
  line-height: 1.1;
  color: var(--color-text-primary);
  margin-bottom: 0;
}


/* ── Menu sub-sections ───────────────────────────────────────── */
.menu-subsection {
  margin-bottom: 48px;
}
.menu-subsection:last-child {
  margin-bottom: 0;
}

.menu-subsection-title {
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-accent-sand);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border-subtle);
}

.menu-subsection-group {
  margin-bottom: 32px;
}
.menu-subsection-group:last-child {
  margin-bottom: 0;
}

.menu-group-label {
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  opacity: 0.6;
  margin-bottom: 16px;
  padding-left: 4px;
}


/* ── Menu items ──────────────────────────────────────────────── */
.menu-items {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.menu-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 14px;
  margin: 0 -14px;
  border-bottom: 1px solid var(--color-border-subtle);
  transition:
    background   0.22s ease,
    box-shadow   0.22s ease,
    padding-left 0.22s ease;
}
.menu-item:last-child {
  border-bottom: none;
}
.menu-item:hover {
  background: rgba(28, 42, 53, 0.7);
  box-shadow: inset 3px 0 0 var(--color-accent-gold);
  padding-left: 20px;
}

.menu-item-body {
  flex: 1;
  min-width: 0;
}

.menu-item-name {
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 17px;
  letter-spacing: 0.03em;
  color: var(--color-text-primary);
  display: block;
  margin-bottom: 4px;
}

.menu-item-desc {
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text-muted);
  opacity: 0.88;
  font-style: italic;
}

.menu-item-price {
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 16px;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}

.menu-item-price::before {
  content: '';
}

/* ── Item image preview ──────────────────────────────────── */
.menu-item[data-img] {
  cursor: pointer;
}

.menu-item.is-preview-active {
  background: rgba(28, 42, 53, 0.85);
  box-shadow: inset 3px 0 0 var(--color-accent-gold);
  padding-left: 20px;
}

/* Mobile inline accordion */
.menu-item-preview {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-item-preview.is-open {
  max-height: 280px;
}

.menu-item-preview-img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin: 6px 0 16px;
}

@media (min-width: 1025px) {
  /* Desktop uses left panel — hide inline preview */
  .menu-item-preview { display: none; }
}


/* ── Image-preview indicator dot ────────────────────────────── */
/*
  A subtle golden dot after the dish name signals that clicking
  will reveal a photo. Disappears on desktop when panel is active.
*/
.menu-item[data-img] .menu-item-name::after {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-accent-gold);
  opacity: 0.45;
  margin-left: 8px;
  vertical-align: middle;
  position: relative;
  top: -1px;
  transition: opacity 0.2s ease;
}

.menu-item[data-img]:hover .menu-item-name::after,
.menu-item.is-preview-active .menu-item-name::after {
  opacity: 0.9;
}


/* MP = marché / market price */
.menu-item-price--mp {
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.12em;
}


/* ── Back to top ─────────────────────────────────────────────── */
.back-to-top {
  position: fixed;
  bottom: 36px;
  right: 36px;
  z-index: 50;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity    0.4s ease,
    transform  0.4s var(--ease-out),
    background 0.25s ease;
}
.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--color-bg-night);
}

.back-to-top-icon {
  width: 12px;
  height: 12px;
  border-top: 1px solid var(--color-accent-gold);
  border-right: 1px solid var(--color-accent-gold);
  transform: rotate(-45deg) translate(1px, 1px);
}


/* ── Split layout — editorial sticky panel ───────────────────── */
.menu-split {
  display: grid;
  grid-template-columns: 44fr 56fr;
  align-items: start;
}

.menu-scroll {
  border-left: 1px solid var(--color-border-subtle);
}

/* Real breathing room between panel and content columns */
.menu-scroll .menu-section.container {
  padding-left: 72px;
  padding-right: 72px;
}

.menu-panel {
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  overflow: hidden;
  background: var(--color-bg-base);
}

.menu-panel-img-wrap {
  position: absolute;
  inset: 0;
}

.menu-panel-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
  transition: opacity 0.7s ease;
}

/* Front layer — on top, starts visible */
#menu-panel-img-a {
  z-index: 2;
  opacity: 1;
}

/* Back layer — behind, starts hidden */
.menu-panel-img-back {
  z-index: 1;
  opacity: 1;
}

.menu-panel-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(16, 24, 32, 0.88) 0%,
    rgba(16, 24, 32, 0.28) 48%,
    transparent 100%
  );
}

.menu-panel-info {
  position: absolute;
  bottom: 52px;
  left: 52px;
  right: 52px;
}

.menu-panel-dish {
  display: block;
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent-sand);
  margin-top: 10px;
  opacity: 0;
  transform: translateY(5px);
  transition:
    opacity   0.35s ease,
    transform 0.35s ease;
  pointer-events: none;
}

.menu-panel:hover .menu-panel-dish {
  opacity: 0.85;
  transform: translateY(0);
}

/* Align subnav links to section content indent */
.menu-scroll .menu-subnav-inner {
  padding: 0 var(--pad-section-h) 0 72px;
}

/* Subnav fade hint always active in scroll column */
.menu-scroll .menu-subnav::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 52px;
  background: linear-gradient(to right, transparent, var(--color-bg-base));
  pointer-events: none;
  z-index: 2;
}

/* Inline section images replaced by panel on desktop */
.menu-split .menu-section-image {
  display: none;
}


/* ── Collapse split below 1024px ─────────────────────────────── */
@media (max-width: 1024px) {
  .menu-split {
    display: block;
  }
  .menu-panel {
    display: none;
  }
  .menu-split .menu-section-image {
    display: block;
  }
  /* Reset split-only overrides when panel is hidden */
  .menu-scroll {
    border-left: none;
  }
  .menu-scroll .menu-section.container {
    padding-left: var(--pad-section-h);
    padding-right: var(--pad-section-h);
  }
  .menu-scroll .menu-subnav-inner {
    padding: 0 var(--pad-section-h);
  }
}


/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .menu-subnav-link {
    padding: 16px 18px;
    font-size: 11px;
  }

  .menu-section {
    padding: 56px 0;
  }

  .menu-item {
    flex-wrap: wrap;
    gap: 6px;
  }

  .menu-item-price {
    width: 100%;
    opacity: 0.7;
  }

  .back-to-top {
    bottom: 24px;
    right: 24px;
  }
}
