/**
 * Gastronomía showcase — Smart Catering Child
 *
 * Extends the shared .sc-service-gallery grid for the page-gastronomia.php
 * template. Adds:
 *  - figcaption hover/focus overlay (dish name reveal at bottom of each photo)
 *  - .scc-gastro-dishes  — menu list rendered below each category grid
 *  - .scc-gastro-service-links — contextual links to division pages in intro
 *
 * Scoped to body.scc-fase0.scc-gastronomia-page so rules never leak.
 * Zero color literals — exclusively design tokens.
 *
 * @package SmartCateringChild
 * @since   0.6.0
 */

/* ── 1. Figcaption hover overlay ────────────────────────────────────────── */

/* Need position:relative on the figure so the absolute figcaption anchors to it.
 * (service-gallery.css leaves position unset → static by default.) */
body.scc-fase0.scc-gastronomia-page .sc-service-gallery__item {
  position: relative;
}

body.scc-fase0.scc-gastronomia-page .scc-gastro-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem 0.875rem 0.75rem;
  background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.68) 100%);
  color: #fff;
  font-size: 0.8125rem;
  font-family: var(--font-sans, sans-serif);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.01em;
  /* Hidden by default — translate below the frame (clipped by overflow:hidden). */
  transform: translateY(100%);
  opacity: 0;
  transition:
    transform 300ms cubic-bezier(0.25, 1, 0.5, 1),
    opacity   250ms ease;
}

/* Reveal on hover or keyboard focus anywhere inside the figure. */
body.scc-fase0.scc-gastronomia-page .sc-service-gallery__item:hover .scc-gastro-caption,
body.scc-fase0.scc-gastronomia-page .sc-service-gallery__item:focus-within .scc-gastro-caption {
  transform: translateY(0);
  opacity: 1;
}

/* Make each img focusable for keyboard users (tabindex set inline in PHP). */
body.scc-fase0.scc-gastronomia-page .sc-service-gallery__item img:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: -2px;
}

/* Reduced motion: skip translate; still show on hover via opacity only. */
@media (prefers-reduced-motion: reduce) {
  body.scc-fase0.scc-gastronomia-page .scc-gastro-caption {
    transform: none;
    transition: opacity 200ms ease;
  }
  body.scc-fase0.scc-gastronomia-page .sc-service-gallery__item:hover .scc-gastro-caption,
  body.scc-fase0.scc-gastronomia-page .sc-service-gallery__item:focus-within .scc-gastro-caption {
    transform: none;
  }
}

/* ── 2. Dish list block ─────────────────────────────────────────────────── */

body.scc-fase0.scc-gastronomia-page .scc-gastro-dishes {
  margin-top: clamp(2rem, 5vw, 3rem);
  padding-top: clamp(1.5rem, 3vw, 2rem);
  border-top: 1px solid var(--color-gold);
}

body.scc-fase0.scc-gastronomia-page .scc-gastro-dishes__heading {
  font-family: var(--font-sans, sans-serif);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-gold-ink);
  margin: 0 0 1.25rem;
}

/* Flat two-column dish list (ensaladas, finger foods, postres, desayunos). */
body.scc-fase0.scc-gastronomia-page .scc-gastro-dishes__list {
  list-style: none;
  padding: 0;
  margin: 0;
  columns: 2;
  column-gap: clamp(1.5rem, 4vw, 3rem);
}

body.scc-fase0.scc-gastronomia-page .scc-gastro-dishes__list li {
  break-inside: avoid;
  padding: 0.375rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--color-body, rgba(0, 0, 0, 0.78));
}

body.scc-fase0.scc-gastronomia-page .sc-section--cream .scc-gastro-dishes__list li {
  border-bottom-color: rgba(0, 0, 0, 0.09);
}

/* Grouped layout for categories with sub-sections (Platos Calientes). */
body.scc-fase0.scc-gastronomia-page .scc-gastro-dishes__groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 2.5rem);
}

body.scc-fase0.scc-gastronomia-page .scc-gastro-dishes__group-label {
  font-family: var(--font-sans, sans-serif);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-gold-ink);
  margin: 0 0 0.75rem;
}

/* Inside a group, single-column list (no CSS columns — each group is already a col). */
body.scc-fase0.scc-gastronomia-page .scc-gastro-dishes__group .scc-gastro-dishes__list {
  columns: 1;
}

/* Menu note — small italic note below each dish list. */
body.scc-fase0.scc-gastronomia-page .scc-gastro-dishes__note {
  margin: 1.25rem 0 0;
  font-size: 0.8125rem;
  font-style: italic;
  color: var(--color-body, rgba(0, 0, 0, 0.55));
  opacity: 0.7;
}

/* ── 3. Service links paragraph ─────────────────────────────────────────── */

body.scc-fase0.scc-gastronomia-page .scc-gastro-service-links {
  margin-top: 1.75rem;
  font-size: 1rem;
  line-height: 1.65;
  color: rgba(0, 0, 0, 0.78);
}

body.scc-fase0.scc-gastronomia-page .scc-gastro-link {
  color: var(--color-gold-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  font-weight: 500;
  transition: color 200ms ease;
}

body.scc-fase0.scc-gastronomia-page .scc-gastro-link:hover,
body.scc-fase0.scc-gastronomia-page .scc-gastro-link:focus-visible {
  color: var(--color-gold);
}

/* Per-category funnel link — discreet next-step under each gallery category. */
body.scc-fase0.scc-gastronomia-page .scc-gastro-cat-link {
  margin: 1.75rem 0 0;
  font-size: 0.9375rem;
}

body.scc-fase0.scc-gastronomia-page .scc-gastro-cat-link .scc-gastro-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

body.scc-fase0.scc-gastronomia-page .scc-gastro-cat-link svg {
  flex-shrink: 0;
}

/* ── 4. Responsive ──────────────────────────────────────────────────────── */

/* Grouped dishes: 3 cols → 1 col on narrow viewports. */
@media (max-width: 768px) {
  body.scc-fase0.scc-gastronomia-page .scc-gastro-dishes__groups {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }
}

/* Flat dish list: 2 cols → 1 col on very small screens. */
@media (max-width: 500px) {
  body.scc-fase0.scc-gastronomia-page .scc-gastro-dishes__list {
    columns: 1;
  }
}
