/* ============================================================
   css/restaurant-home.css — Restaurant Home Page
   Design tokens come from core.css (same shared chrome as Menu).
   Only this page's own components live here: Hero, Content Section
   rows, and their product cards.
   ============================================================ */

/* ── Hero — entirely data-driven from Website Settings ───────── */
.rh-hero {
  position: relative;
  min-height: 42vh;
  display: flex; align-items: flex-end;
  padding: calc(var(--nav-h) + 32px) 0 36px;
  background: linear-gradient(180deg, rgba(5,8,22,0.2) 0%, rgba(5,8,22,0.92) 100%), var(--bg-2);
  background-size: cover; background-position: center;
  overflow: hidden;
}
@media (min-width: 768px) { .rh-hero { min-height: 54vh; padding: calc(var(--nav-h) + 24px) 0 40px; } }

.rh-hero__loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.rh-hero__loading span {
  width: 8px; height: 8px; border-radius: 50%; background: var(--blue); animation: rhPulse 1.2s infinite ease-in-out;
}
.rh-hero__loading span:nth-child(2) { animation-delay: .15s; }
.rh-hero__loading span:nth-child(3) { animation-delay: .3s; }
@keyframes rhPulse { 0%,80%,100% { opacity:.25; transform:scale(.8); } 40% { opacity:1; transform:scale(1.15); } }

.rh-hero__inner { position: relative; z-index: 1; width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }
@media (min-width: 768px) { .rh-hero__inner { padding: 0 32px; } }
.rh-hero__logo { height: 48px; width: auto; margin-bottom: 14px; border-radius: 12px; background: rgba(255,255,255,0.06); padding: 6px; }
@media (min-width: 768px) { .rh-hero__logo { height: 56px; margin-bottom: 16px; } }
.rh-hero__name {
  font-family: var(--type-font-heading);
  font-size: var(--type-h1-size, clamp(1.6rem, 6vw, 2.8rem));
  font-weight: var(--type-h1-weight, 700);
  letter-spacing: var(--type-h1-spacing, -0.01em);
  line-height: var(--type-h1-line, 1.15);
  text-transform: var(--type-h1-transform, none);
  margin: 0 0 10px;
}
.rh-hero__meta { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; font-size: 12.5px; color: var(--text-dim); }
@media (min-width: 600px) { .rh-hero__meta { flex-direction: row; flex-wrap: wrap; gap: 16px; font-size: 13px; } }
.rh-hero__meta span { display: flex; align-items: center; gap: 6px; }
.rh-hero__meta svg { width: 14px; height: 14px; flex-shrink: 0; }
.rh-hero__actions { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 480px) { .rh-hero__actions { flex-direction: row; flex-wrap: wrap; } }
.rh-hero__btn {
  font-family: var(--type-font-button);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 24px;
  border-radius: 999px; font-size: 14px; font-weight: 700; text-decoration: none; cursor: pointer; border: none;
}
.rh-hero__btn--primary { background: var(--grad); color: #fff; }
.rh-hero__btn--secondary { background: #25D366; color: #06210f; }

/* ── Dynamic Content Sections ─────────────────────────────── */
.rh-main { padding: 36px 0 64px; }
@media (min-width: 768px) { .rh-main { padding: 48px 0 80px; } }
.rh-sections__loading, .rh-empty { text-align: center; padding: 32px 20px; color: var(--text-muted); }
.rh-sections__loading span {
  display: inline-block; width: 8px; height: 8px; margin: 0 3px; border-radius: 50%;
  background: var(--blue); animation: rhPulse 1.2s infinite ease-in-out;
}

.rh-section {
  margin-bottom: var(--xn-sec-margin, 36px);
  border-radius: var(--xn-sec-radius, 0);
  box-shadow: var(--xn-sec-shadow, none);
  border-width: var(--xn-sec-border-w, 0); border-style: solid; border-color: var(--border);
  padding: var(--xn-sec-padding, 0);
  max-width: var(--xn-sec-width, none); margin-left: auto; margin-right: auto;
}
@media (min-width: 768px) { .rh-section { margin-bottom: var(--xn-sec-margin, 48px); } }
.rh-section.xn-glass { backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); background: rgba(255,255,255,.04); }
.rh-section__hero {
  width: 100%; aspect-ratio: 21/8; object-fit: cover; border-radius: var(--radius);
  margin-bottom: 16px; background: #0d1226; display: block;
}
@media (max-width: 480px) { .rh-section__hero { aspect-ratio: 16/9; } }
.rh-section__head { margin-bottom: 14px; }
.rh-section__title {
  font-family: var(--type-font-heading);
  font-size: var(--type-h2-size, 1.2rem);
  font-weight: var(--type-h2-weight, 700);
  letter-spacing: var(--type-h2-spacing, normal);
  line-height: var(--type-h2-line, normal);
  text-transform: var(--type-h2-transform, none);
  margin: 0 0 4px;
}
@media (min-width: 768px) { .rh-section__title { font-size: var(--type-h2-size, 1.4rem); } }
.rh-section__desc {
  font-family: var(--type-font-body);
  font-size: var(--type-p-size, 13px);
  font-weight: var(--type-p-weight, 400);
  letter-spacing: var(--type-p-spacing, normal);
  line-height: var(--type-p-line, 1.5);
  text-transform: var(--type-p-transform, none);
  color: var(--text-dim); margin: 0; max-width: 640px;
}

.rh-row {
  display: flex; gap: 12px; overflow-x: auto; padding: 2px 20px 8px;
  margin: 0 -20px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
@media (min-width: 768px) { .rh-row { gap: 14px; padding: 2px 32px 8px; margin: 0 -32px; } }
.rh-row::-webkit-scrollbar { height: 6px; }
.rh-row::-webkit-scrollbar-thumb { background: var(--border-m); border-radius: 999px; }

.rh-card {
  flex: 0 0 auto; width: 150px; scroll-snap-align: start;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: inherit; display: block;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18); transition: transform .15s ease, border-color .15s ease;
}
.rh-card:active { transform: scale(0.97); }
.rh-card:hover { border-color: rgba(201,60,255,0.4); transform: translateY(-2px); }
@media (min-width: 600px) { .rh-card { width: 220px; } }
@media (min-width: 1024px) { .rh-card { width: calc((100% - 4 * 14px) / 5); } }

.rh-card__image { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; background: #0d1226; }
.rh-card__body { padding: 10px 12px 12px; }
.rh-card__name { font-size: 13px; font-weight: 600; margin-bottom: 4px; line-height: 1.3; }
.rh-card__price { font-size: 12.5px; color: var(--blue); font-weight: 600; }

/* ══════════════════════════════════════════════════
   STUDIO (Home Page Builder — "Studio Section v1")
   Deliberately its own component, not a variant of .rh-section —
   same "separate, not merged" boundary as the backend (see
   studio-repository.js's header). Reuses the same design tokens
   (--bg-card, --border, --radius, --grad, --text-dim) as every
   other component on this page rather than inventing new ones.
══════════════════════════════════════════════════ */
.rh-studio {
  margin-bottom: 40px; padding: 28px 20px; border-radius: var(--radius, 16px);
  background: var(--bg-card); border: 1px solid var(--border);
  position: relative; overflow: hidden;
}
@media (min-width: 768px) { .rh-studio { margin-bottom: var(--xn-sec-margin, 48px); padding: 36px 32px; } }

.rh-studio__inner {
  position: relative; z-index: 1; display: flex; flex-direction: column; gap: 24px; align-items: center;
}
@media (min-width: 768px) { .rh-studio__inner { flex-direction: row; gap: 40px; } }
/* Hero Layout: Left/Center/Right controls where the product image sits
   relative to the info panel — Center stacks image above info. */
.rh-studio__inner.rh-studio--left { flex-direction: column; }
@media (min-width: 768px) { .rh-studio__inner.rh-studio--left { flex-direction: row; } }
.rh-studio__inner.rh-studio--right { flex-direction: column; }
@media (min-width: 768px) { .rh-studio__inner.rh-studio--right { flex-direction: row-reverse; } }
.rh-studio__inner.rh-studio--center { flex-direction: column; text-align: center; align-items: center; }

.rh-studio__media { flex: 1 1 320px; max-width: 420px; width: 100%; }
.rh-studio__image {
  width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 12px;
  background: #0d1226; display: block;
}
.rh-studio__info { flex: 1 1 320px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.rh-studio__badge {
  display: inline-block; align-self: flex-start; padding: 4px 10px; border-radius: 999px;
  background: rgba(46,214,255,0.12); color: var(--blue); font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
}
.rh-studio--center .rh-studio__badge { align-self: center; }
.rh-studio__name { font-size: 1.4rem; font-weight: 700; margin: 0; line-height: 1.25; }
.rh-studio__desc { font-size: 13.5px; color: var(--text-dim); margin: 0; }
.rh-studio__price { font-size: 1.05rem; font-weight: 700; color: var(--blue); }
.rh-studio__ctas { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.rh-studio--center .rh-studio__ctas { justify-content: center; }
.rh-studio__cta {
  display: inline-flex; align-items: center; padding: 10px 20px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; text-decoration: none; transition: transform .15s ease;
}
.rh-studio__cta:active { transform: scale(0.97); }
.rh-studio__cta--primary { background: var(--grad); color: #fff; }
.rh-studio__cta--secondary { background: rgba(255,255,255,0.06); color: var(--text); border: 1px solid var(--border-m); }

/* Animation types — one CSS class per Animation Type value, applied/
   removed around each rotation swap by the renderer. 'none' has no
   class at all (no transition). */
.rh-studio__media, .rh-studio__info { transition: opacity .4s ease, transform .4s ease; }
.rh-studio--anim-out.rh-anim-fade .rh-studio__media,
.rh-studio--anim-out.rh-anim-fade .rh-studio__info { opacity: 0; }
.rh-studio--anim-out.rh-anim-slide .rh-studio__media,
.rh-studio--anim-out.rh-anim-slide .rh-studio__info { opacity: 0; transform: translateX(16px); }
.rh-studio--anim-out.rh-anim-zoom .rh-studio__media,
.rh-studio--anim-out.rh-anim-zoom .rh-studio__info { opacity: 0; transform: scale(1.06); }
.rh-studio--anim-out.rh-anim-scale .rh-studio__media,
.rh-studio--anim-out.rh-anim-scale .rh-studio__info { opacity: 0; transform: scale(0.94); }

.rh-studio__gallery { margin-top: 22px; }
