/* =========================================================
   Restaurante La Confianza — Alma desde 1867
   Paleta y tipografía tomadas de hoteles-mba.com y del logotipo
   ========================================================= */

:root {
  --crema: #FFF8F1;
  --arena: #F0D0AC;
  --bronce: #B07F4A;
  --oro: #9E7738;
  --carbon: #2D2D2D;
  --aceituna: #2F291B;
  --aceituna-2: #3A3324;
  --oliva: #5C5C44;
  --linea: rgba(158, 119, 56, .35);
  --linea-clara: rgba(240, 208, 172, .28);

  --serif: "Libre Baskerville", Baskerville, Georgia, serif;
  --sans: "Jost", "Avenir Next", Avenir, "Segoe UI", sans-serif;

  --step--1: clamp(.82rem, .8rem + .1vw, .9rem);
  --step-0: clamp(1rem, .97rem + .15vw, 1.08rem);
  --step-1: clamp(1.15rem, 1.08rem + .35vw, 1.4rem);
  --step-2: clamp(1.45rem, 1.25rem + .9vw, 2rem);
  --step-3: clamp(1.9rem, 1.45rem + 1.9vw, 3rem);
  --step-4: clamp(3rem, 1.6rem + 6vw, 8rem);

  --wrap: 1240px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section: clamp(4.5rem, 9vw, 8.5rem);
  --ease: cubic-bezier(.22, .8, .2, 1);
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
body {
  margin: 0; background: var(--crema); color: var(--carbon);
  font-family: var(--sans); font-weight: 300; font-size: var(--step-0); line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, video, iframe, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 1.1em; }
h1, h2, h3 { margin: 0; font-weight: 400; }
:focus-visible { outline: 2px solid var(--bronce); outline-offset: 4px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--carbon); color: var(--crema); padding: .6rem 1rem; }
.skip:focus { top: 1rem; }
.logo-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.h-section { font-family: var(--serif); font-size: var(--step-3); line-height: 1.15; letter-spacing: -.01em; margin-bottom: 1.4rem; text-wrap: balance; }
.kicker { font-family: var(--serif); font-style: italic; color: var(--oro); margin-bottom: .4rem; }

/* ---------- Botones y enlaces ---------- */
.btn {
  --bg: var(--bronce); --fg: #fff; --hover: var(--carbon); --hover-fg: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: .75rem 1.6rem;
  background: var(--bg); color: var(--fg); border: 1px solid var(--bg);
  font-family: var(--sans); font-weight: 400; font-size: .95rem; letter-spacing: .03em;
  text-decoration: none; position: relative; overflow: hidden; isolation: isolate; cursor: pointer;
  transition: color .4s var(--ease), border-color .4s var(--ease);
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--hover);
  transform: scaleY(0); transform-origin: bottom; transition: transform .45s var(--ease);
}
.btn:hover::before, .btn:focus-visible::before { transform: scaleY(1); }
.btn:hover, .btn:focus-visible { color: var(--hover-fg); border-color: var(--hover); }
.btn--ghost { --bg: transparent; --fg: var(--crema); --hover: var(--crema); --hover-fg: var(--aceituna); border-color: rgba(255, 248, 241, .6); }
.btn--light { --bg: var(--arena); --fg: var(--aceituna); --hover: var(--crema); --hover-fg: var(--aceituna); }
.btn--small { min-height: 40px; padding: .45rem 1.1rem; font-size: .88rem; }

.link {
  display: inline-block; color: var(--oro); text-decoration: none; font-weight: 400; padding-bottom: 3px;
  background: linear-gradient(currentColor, currentColor) left bottom / 100% 1px no-repeat;
  transition: background-size .45s var(--ease);
}
.link:hover, .link:focus-visible { background-size: 0 1px; background-position: right bottom; }
.link--light { color: var(--arena); }

/* ---------- Arco (frontón del logotipo) ---------- */
.arch { position: relative; overflow: hidden; border-radius: 999px 999px 0 0; background: var(--aceituna-2); }
.arch__media { width: 100%; height: 100%; object-fit: cover; border: 0; }
.arch::after {
  content: ""; position: absolute; inset: 10px 10px 0; pointer-events: none;
  border: 1px solid rgba(240, 208, 172, .55); border-bottom: 0; border-radius: 999px 999px 0 0;
}

/* ---------- Cabecera ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50; height: var(--header-h); color: var(--crema);
  transition: background-color .5s var(--ease), color .5s var(--ease), box-shadow .5s var(--ease), transform .5s var(--ease);
}
.site-header__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.site-header.is-solid {
  background: rgba(255, 248, 241, .95); color: var(--carbon); box-shadow: 0 1px 0 var(--linea);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.site-header.is-hidden { transform: translateY(-100%); }

.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; }
.brand__mark { width: 2.9rem; height: auto; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-family: var(--serif); font-size: 1.15rem; }
.brand__sub { font-size: .72rem; letter-spacing: .1em; color: var(--arena); margin-top: .2rem; transition: color .5s; }
.site-header.is-solid .brand__sub { color: var(--oro); }

.nav { display: flex; align-items: center; gap: clamp(.9rem, 2vw, 2rem); scroll-target-group: auto; }
.nav a:not(.btn) { text-decoration: none; font-size: .93rem; font-weight: 400; position: relative; padding: .4rem 0; white-space: nowrap; }
.nav a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease);
}
.nav a:not(.btn):hover::after { transform: scaleX(1); transform-origin: left; }
/* Sección activa: :target-current nativo (Chrome 140+) o clase de respaldo */
.nav a:not(.btn):is(:target-current, .target-current)::after { transform: scaleX(1); transform-origin: left; height: 2px; }
.nav-toggle { display: none; }

/* ---------- 1 · Portada ---------- */
.hero {
  position: relative; min-height: max(100svh, 37.5rem);
  display: grid; place-items: center; overflow: hidden;
  background: var(--aceituna); color: var(--crema); isolation: isolate;
}
.hero__slides { position: absolute; inset: 0; z-index: -2; }
.hero__slides img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.12);
  transition: opacity 1.8s ease, transform 9s linear;
}
.hero__slides img.is-active { opacity: 1; transform: scale(1); }
.hero__shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 55% 65% at 50% 48%, rgba(47, 41, 27, .55), rgba(47, 41, 27, .2) 70%),
    linear-gradient(180deg, rgba(47, 41, 27, .75) 0%, rgba(47, 41, 27, .15) 22%, rgba(47, 41, 27, .2) 60%, rgba(47, 41, 27, .92) 100%);
}

.hero__content {
  position: relative; text-align: center;
  display: flex; flex-direction: column; align-items: center;
  width: clamp(20rem, 34vw, 40rem);
  padding: clamp(3.5rem, 9vh, 6rem) clamp(1.5rem, 4vw, 3rem) clamp(1.5rem, 4vh, 3rem);
  margin-top: calc(var(--header-h) * .6);
  margin-bottom: 4.5rem; /* deja sitio a la barra inferior */
}
.hero__frame {
  position: absolute; inset: 0; width: 100%; height: 100%; color: var(--arena); opacity: .7; pointer-events: none;
}
.hero__logo { width: auto; margin: 0 0 clamp(1rem, 2.5vh, 1.8rem); color: var(--crema); }
.hero__logo svg { height: clamp(150px, 36vh, 420px); width: auto; filter: drop-shadow(0 2px 14px rgba(0, 0, 0, .35)); }
.hero__lead { font-size: var(--step-1); line-height: 1.5; max-width: 28rem; margin-bottom: clamp(1.2rem, 3vh, 2rem); text-shadow: 0 1px 10px rgba(0, 0, 0, .45); }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; }

.hero__bar { position: absolute; left: 0; right: 0; bottom: 0; border-top: 1px solid var(--linea-clara); }
.hero__bar-inner { display: grid; grid-template-columns: repeat(3, auto) 1fr; align-items: center; gap: 0 clamp(1.5rem, 4vw, 3.5rem); min-height: 4.5rem; }
.hero__bar a { display: flex; flex-direction: column; text-decoration: none; font-size: .92rem; line-height: 1.35; padding: .7rem 0; }
.hero__bar a:hover span:last-child { color: var(--arena); }
.hero__bar-k { font-family: var(--serif); font-style: italic; font-size: .8rem; color: var(--arena); }
.hero__dots { justify-self: end; display: flex; gap: .5rem; }
.hero__dots button {
  width: 28px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; position: relative;
}
.hero__dots button::before {
  content: ""; position: absolute; left: 4px; right: 4px; top: 50%; height: 1px; background: rgba(255, 248, 241, .4);
  transition: background-color .3s, height .3s;
}
.hero__dots button[aria-pressed="true"]::before { background: var(--arena); height: 2px; }

/* Entrada orquestada: el arco se dibuja, el logo aparece */
.js .hero__frame { clip-path: inset(0 0 100% 0); }
.js .hero__logo, .js .hero__lead, .js .hero__actions, .js .hero__bar { opacity: 0; transform: translateY(16px); }
.is-loaded .hero__frame { clip-path: inset(0 0 0 0); transition: clip-path 2s var(--ease) .2s; }
.is-loaded .hero__logo, .is-loaded .hero__lead, .is-loaded .hero__actions, .is-loaded .hero__bar {
  opacity: 1; transform: none; transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}
.is-loaded .hero__logo { transition-delay: .6s; }
.is-loaded .hero__lead { transition-delay: 1s; }
.is-loaded .hero__actions { transition-delay: 1.15s; }
.is-loaded .hero__bar { transition-delay: 1.4s; }

/* ---------- 2 · La casa ---------- */
.casa { padding: var(--section) 0; overflow: hidden; }
.casa__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2.5rem, 6vw, 6rem); align-items: center; }
.casa__text { max-width: 34rem; }
.casa__text p { line-height: 1.8; }
.casa__first::first-letter { font-family: var(--serif); float: left; font-size: 3.5em; line-height: .82; padding: .08em .1em 0 0; color: var(--oro); }

.casa__collage { position: relative; padding: 0 0 3rem 3rem; }
.arch--tall { aspect-ratio: 3 / 4; width: min(100%, 28rem); margin-left: auto; }
.casa__small {
  position: absolute; left: 0; bottom: 0; width: 42%; margin: 0;
  border: 8px solid var(--crema); box-shadow: 0 20px 40px -20px rgba(47, 41, 27, .45);
}
.casa__small img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.sello {
  position: absolute; right: -1rem; top: 8%; width: clamp(120px, 12vw, 160px); aspect-ratio: 1;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--aceituna); color: var(--arena);
  box-shadow: 0 0 0 6px var(--crema);
}
.sello__ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.sello__ring text { font-family: var(--sans); font-size: 13.2px; /* unidades del viewBox del SVG */ letter-spacing: .16em; fill: currentColor; }
.sello__year { font-family: var(--serif); font-size: clamp(1.4rem, 1.6vw, 1.8rem); color: var(--crema); }

.pilares {
  list-style: none; margin-top: clamp(3.5rem, 7vw, 6rem); margin-bottom: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
}
.pilares li { padding: 1.6rem 2rem 0 0; border-top: 1px solid var(--linea); }
.pilares li + li { padding-left: 2rem; border-left: 1px solid var(--linea); }
.pilares__name { display: block; font-family: var(--serif); font-size: var(--step-1); margin-bottom: .4rem; }
.pilares__text { display: block; color: #5b5650; max-width: 28ch; }

/* ---------- 3 · Xanxullo ---------- */
.xanxullo { --fader-ms: 7000ms; display: grid; grid-template-columns: 1fr 1fr; background: var(--arena); min-height: min(90vh, 760px); }
.xanxullo__media { position: relative; overflow: hidden; background: #1d1a14; }
.xanxullo__media img {
  position: absolute; inset: -6% 0; width: 100%; height: 112%; object-fit: cover;
  opacity: 0; scale: 1.08;
  transition: opacity 1.4s cubic-bezier(.4, 0, .2, 1), scale 1.4s ease;
}
.xanxullo__media img.is-active {
  opacity: 1; scale: 1;
  /* fundido + acercamiento lento mientras el plato está en pantalla */
  transition: opacity 1.4s cubic-bezier(.4, 0, .2, 1), scale calc(var(--fader-ms) + 1.4s) cubic-bezier(.25, .1, .25, 1);
}
.xanxullo__text {
  align-self: center; padding: var(--section) clamp(1.5rem, 6vw, 6rem);
  max-width: calc(var(--wrap) / 2 + var(--gutter));
  container-type: inline-size;
}
/* Todos los platos ocupan la misma celda: el bloque mide lo que el más largo y no salta */
.xanxullo__slides { display: grid; }
.xanxullo__slide { grid-area: 1 / 1; visibility: hidden; }
.xanxullo__slide.is-active { visibility: visible; }
.xanxullo__slide > * { opacity: 0; translate: 0 -10px; transition: opacity .45s ease, translate .45s ease; }
.xanxullo__slide.is-active > * { opacity: 1; translate: 0 0; transition: opacity .9s var(--ease), translate .9s var(--ease); }
.xanxullo__slide.is-active > :nth-child(1) { transition-delay: .3s; }
.xanxullo__slide.is-active > :nth-child(2) { transition-delay: .35s; }
.xanxullo__slide.is-active > :nth-child(3) { transition-delay: .6s; }
.xanxullo__slide.is-active > :nth-child(4) { transition-delay: .7s; }
.xanxullo__slide.is-active > :nth-child(5) { transition-delay: .8s; }
/* El nombre del plato se descubre de izquierda a derecha */
.xanxullo__slide .xanxullo__title { clip-path: inset(0 100% 0 0); translate: -.3em 0; }
.xanxullo__slide.is-active .xanxullo__title {
  clip-path: inset(-.2em -.2em -.2em -.2em); translate: 0 0;
  transition: clip-path 1.1s cubic-bezier(.65, 0, .35, 1) .35s, translate 1.1s var(--ease) .35s, opacity .6s ease .35s;
}
.xanxullo__title {
  font-family: var(--serif); font-style: italic; font-weight: 400; line-height: 1;
  /* Cabe en su columna; los nombres largos saltan de línea por palabras, nunca dentro de una palabra */
  font-size: min(var(--step-4), 17cqi);
  letter-spacing: -.03em; color: var(--aceituna); margin: 0 0 1.6rem -.04em;
  text-wrap: balance; overflow-wrap: normal; hyphens: manual;
}
.xanxullo__desc { font-size: var(--step-1); line-height: 1.55; max-width: 30rem; }
.ingredientes { list-style: none; margin: 1.4rem 0 1.8rem; padding: 0; display: flex; flex-wrap: wrap; gap: .55rem; }
.ingredientes li {
  font-family: var(--serif); font-size: .98rem; padding: .5rem 1.05rem;
  border: 1px solid rgba(47, 41, 27, .35); border-radius: 999px; background: rgba(255, 248, 241, .5);
  transition: background-color .3s, color .3s, border-color .3s;
}
.ingredientes li:hover { background: var(--aceituna); color: var(--arena); border-color: var(--aceituna); }
.xanxullo__note { color: #5b4a33; margin: 0; }

/* Indicador: una barra por plato que se llena mientras se muestra */
.fader__ui { display: flex; align-items: center; gap: 1rem; margin-top: 2.4rem; }
.fader__pause {
  flex: none; width: 2.2rem; height: 2.2rem; display: grid; place-items: center; cursor: pointer;
  border: 1px solid rgba(47, 41, 27, .45); border-radius: 50%; background: none; color: var(--aceituna);
  transition: background-color .3s, color .3s;
}
.fader__pause:hover { background: var(--aceituna); color: var(--arena); }
.fader__pause svg { width: .95rem; height: .95rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.fader__pause .i-play { display: none; fill: currentColor; stroke: none; }
.fader__pause[aria-pressed="true"] .i-play { display: block; }
.fader__pause[aria-pressed="true"] .i-pause { display: none; }
.fader__steps { list-style: none; margin: 0; padding: 0; display: flex; gap: .35rem; flex: 1; max-width: 18rem; }
.fader__steps li { flex: 1; }
.fader__steps button { width: 100%; height: 1.5rem; padding: 0; border: 0; background: none; cursor: pointer; display: grid; align-items: center; }
.fader__bar { display: block; height: 2px; background: rgba(47, 41, 27, .22); position: relative; overflow: hidden; transition: height .3s; }
.fader__steps button[aria-current="true"] .fader__bar { height: 4px; }
.fader__bar::after { content: ""; position: absolute; inset: 0; background: var(--aceituna); transform: scaleX(0); transform-origin: left; }
.fader__steps button.is-done .fader__bar::after { transform: scaleX(1); }
.fader__steps button[aria-current="true"] .fader__bar::after { animation: fader-progreso var(--fader-ms) linear forwards; }
.xanxullo:is(.is-paused, .is-offscreen, .is-tab-hidden, :hover, :focus-within) .fader__steps button[aria-current="true"] .fader__bar::after { animation-play-state: paused; }
@keyframes fader-progreso { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- 4 · La carta ---------- */
.carta { background: var(--aceituna); color: var(--crema); padding: var(--section) 0; position: relative; overflow: hidden; }
.carta::before, .momentos::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .14; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.carta__grid { position: relative; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(2.5rem, 6vw, 6rem); align-items: start; }
.carta__head p { color: rgba(255, 248, 241, .78); max-width: 26rem; margin-bottom: 2rem; }
/* Las dos columnas comparten alto: la foto rellena hasta el final del cuadro */
.carta__grid { align-items: stretch; }
.carta__head { display: flex; flex-direction: column; }
.carta__head .h-section { margin-top: -.12em; } /* alinea la altura de la letra con el borde del cuadro */

.carta__panel {
  border: 1px solid var(--linea-clara); outline: 1px solid rgba(240, 208, 172, .14); outline-offset: 8px;
  padding: clamp(1.5rem, 3.5vw, 2.75rem);
  margin: 8px; /* el filete exterior queda alineado con la columna izquierda */
  display: flex; flex-direction: column;
}
/* Selector de categorías: cuatro "tiempos" de la comida como tarjetas de carta (2 × 2) */
.tabs {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--linea-clara); margin-bottom: 1.8rem;
}
.tabs button {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .9rem; align-items: baseline;
  text-align: left; cursor: pointer; padding: 1rem 1.15rem; min-height: 4.6rem;
  background: none; border: 0; color: rgba(255, 248, 241, .72);
  position: relative; transition: background-color .35s, color .35s;
}
/* Rejilla de filetes finos entre tarjetas */
.tabs button:nth-child(odd) { border-right: 1px solid var(--linea-clara); }
.tabs button:nth-child(-n + 2) { border-bottom: 1px solid var(--linea-clara); }
.tab__num {
  grid-row: 1 / span 2; align-self: center;
  font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--arena); opacity: .75;
  min-width: 1.6em; text-align: center; transition: color .35s, opacity .35s;
}
.tab__name { font-family: var(--serif); font-size: clamp(1rem, .95rem + .25vw, 1.12rem); line-height: 1.3; color: var(--crema); text-wrap: balance; }
.tab__count { font-size: .8rem; letter-spacing: .04em; color: rgba(255, 248, 241, .55); transition: color .35s; }
.tabs button:hover { background: rgba(255, 248, 241, .05); }
.tabs button[aria-selected="true"] { background: var(--arena); color: var(--aceituna); }
.tabs button[aria-selected="true"] .tab__name { color: var(--aceituna); }
.tabs button[aria-selected="true"] .tab__num { color: var(--oro); opacity: 1; }
.tabs button[aria-selected="true"] .tab__count { color: rgba(47, 41, 27, .7); }
.tabs button:focus-visible { outline-offset: -4px; outline-color: var(--crema); }
.tabs button[aria-selected="true"]:focus-visible { outline-color: var(--aceituna); }
.tabs-lineal .tabs { display: none; }
.tabpanel__titulo { display: none; font-family: var(--serif); font-size: var(--step-1); color: var(--arena); margin: 1.4rem 0 .2rem; }
.tabs-lineal .tabpanel__titulo { display: block; }

.tabpanel:not([hidden]) { animation: panelIn .6s var(--ease); }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.platos { list-style: none; margin: 0; padding: 0; }
.platos li { border-bottom: 1px dashed rgba(240, 208, 172, .22); }
.platos li:last-child { border-bottom: 0; }
.plato {
  width: 100%; display: grid; gap: .25rem; text-align: left; cursor: pointer;
  background: none; border: 0; color: inherit; font: inherit; padding: 1.05rem 2.2rem 1.05rem 0; position: relative;
  transition: padding-left .45s var(--ease);
}
.plato::before {
  content: ""; position: absolute; left: 0; top: 1.6rem; width: 0; height: 1px; background: var(--arena);
  transition: width .45s var(--ease);
}
.plato:hover, .plato:focus-visible, .plato.is-current { padding-left: 1.6rem; }
.plato:hover::before, .plato:focus-visible::before, .plato.is-current::before { width: 1rem; }
.platos__n { font-family: var(--serif); font-size: var(--step-1); transition: color .3s; hyphens: manual; overflow-wrap: normal; }
.plato.is-current .platos__n { color: var(--arena); }
.platos__d { color: rgba(255, 248, 241, .68); font-size: .95rem; line-height: 1.55; max-width: 36rem; }
.carta__cta { margin-top: auto; align-self: flex-start; }
.carta__panel .tabpanel:not([hidden]) { margin-bottom: 1.8rem; }

.carta__foto { margin: 0; width: min(100%, 26rem); flex: 1 1 auto; min-height: 22rem; }
.carta__foto img { position: absolute; inset: 0; opacity: 0; transform: scale(1.06); transition: opacity .7s ease, transform 1.4s var(--ease); }
.carta__foto img.is-active { opacity: 1; transform: none; }
.carta__sinfoto {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 18%;
  background: radial-gradient(circle at 50% 40%, #4a4230, var(--aceituna-2) 70%); color: var(--crema);
  opacity: 0; transition: opacity .7s ease;
}
.carta__foto.no-photo .carta__sinfoto { opacity: 1; }
.carta__sinfoto svg { width: 100%; height: auto; }

/* ---------- 5 · Desayuno, comida y cena ---------- */
.momentos { background: var(--aceituna-2); color: var(--crema); padding: var(--section) 0; position: relative; }
.momentos .wrap { position: relative; }
.momentos__intro { color: rgba(255, 248, 241, .75); max-width: 34rem; margin-bottom: 2.5rem; }
.paneles { display: flex; gap: .8rem; height: clamp(420px, 62vh, 600px); }
.panel {
  position: relative; flex: 1; min-width: 0; overflow: hidden; cursor: pointer; outline-offset: 4px;
  border-radius: 12rem 12rem 0 0;
  transition: flex-grow .8s var(--ease);
}
.panel.is-open { flex-grow: 2.4; }
.panel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), filter .8s; filter: saturate(.75) brightness(.7); }
.panel.is-open img { transform: scale(1.04); filter: saturate(1) brightness(.85); }
.panel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(29, 26, 20, .92)); }
.panel__body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: clamp(1.2rem, 2.5vw, 2rem); }
.panel h3 { font-family: var(--serif); font-size: var(--step-2); margin-bottom: .6rem; }
.panel__price { display: flex; align-items: baseline; gap: .6rem; margin: 0 0 .4rem; max-width: 22rem; }
.panel__price span:first-child { font-size: .88rem; color: rgba(255, 248, 241, .75); }
.panel__price strong { font-family: var(--serif); font-weight: 400; font-size: var(--step-1); color: var(--arena); }
.panel__dots {
  flex: 1; height: 2px; align-self: center; transform: translateY(.3em);
  background-image: radial-gradient(circle, rgba(240, 208, 172, .7) 1px, transparent 1.4px); background-size: 7px 2px;
}
.panel__text { margin: 0; color: rgba(255, 248, 241, .8); max-width: 22rem; opacity: 0; transform: translateY(8px); transition: opacity .5s, transform .5s; }
.panel:not(.is-open) .panel__text { max-height: 0; overflow: hidden; }
.panel.is-open .panel__text { opacity: 1; transform: none; transition-delay: .3s; }
.momentos__foot { margin-top: 2rem; }
.momentos__foot .link { color: var(--arena); }

/* ---------- 6 · Galería ---------- */
.galeria { padding: clamp(1rem, 2vw, 1.5rem) 0; background: var(--crema); overflow: hidden; }
.galeria__track { display: flex; gap: clamp(.6rem, 1.2vw, 1rem); width: max-content; animation: marquee 60s linear infinite; }
.galeria:hover .galeria__track { animation-play-state: paused; }
.galeria__track img { height: clamp(180px, 26vw, 320px); width: auto; object-fit: cover; flex: none; }
.galeria__track img:nth-child(odd) { border-radius: 999px 999px 0 0; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- 7 · Novelda ---------- */
.novelda { background: var(--carbon); color: var(--crema); padding: var(--section) 0; }
.novelda__grid { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: clamp(2.5rem, 5vw, 5rem); align-items: start; }
.novelda__head p { color: rgba(255, 248, 241, .75); max-width: 26rem; }
.visitas { list-style: none; margin: 0; padding: 0; border-top: 1px solid rgba(255, 248, 241, .18); counter-reset: v; }
.visitas li { border-bottom: 1px solid rgba(255, 248, 241, .18); }
.visitas a {
  display: grid; grid-template-columns: 1fr; gap: .3rem; padding: 1.5rem 3.25rem 1.5rem 0; text-decoration: none; position: relative;
  transition: background-color .5s;
}
.visitas a::after {
  content: ""; position: absolute; right: .5rem; top: 50%; width: 14px; height: 14px;
  border-top: 1px solid var(--arena); border-right: 1px solid var(--arena); transform: translateY(-50%) rotate(45deg);
  transition: right .4s var(--ease);
}
/* El desplazamiento se hace con translate: no cambia el ancho del texto ni lo parte en dos líneas */
.visitas a > span { transition: translate .5s var(--ease); }
.visitas a:hover, .visitas a:focus-visible { background: rgba(255, 248, 241, .04); }
.visitas a:hover > span, .visitas a:focus-visible > span { translate: .75rem 0; }
.visitas a:hover::after { right: 0; }
.visitas__n { font-family: var(--serif); font-size: clamp(1.4rem, 1.2rem + .75vw, 1.85rem); text-wrap: balance; }
.visitas__d { color: rgba(255, 248, 241, .7); max-width: 40rem; }

/* ---------- 8 · Reserva ---------- */
.reservar { padding: var(--section) 0; }
.reservar__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2.5rem, 6vw, 6rem); align-items: center; }
.telefono {
  display: inline-block; font-family: var(--serif); font-size: clamp(2.3rem, 1.4rem + 3.6vw, 4.6rem); line-height: 1.05;
  letter-spacing: -.02em; text-decoration: none; color: var(--oro); margin-bottom: 2rem; transition: color .3s;
}
.telefono:hover { color: var(--carbon); }
.contacto { list-style: none; margin: 0 0 2rem; padding: 0; max-width: 30rem; border-top: 1px solid var(--linea); }
.contacto li { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--linea); }
.contacto span { color: #6d665e; }
.contacto a { text-decoration: none; font-weight: 400; }
.contacto a:hover { color: var(--oro); }
address { font-style: normal; line-height: 1.7; margin-bottom: 1rem; }
.reservar__map { width: min(100%, 30rem); justify-self: end; }
.arch--map { aspect-ratio: 4 / 5; }
.arch--map iframe { filter: sepia(.45) saturate(.75) contrast(.95); }

/* ---------- Pie ---------- */
.site-footer { background: var(--aceituna); color: rgba(255, 248, 241, .8); padding: clamp(3.5rem, 6vw, 5rem) 0 2rem; font-size: var(--step--1); }
.site-footer__inner { display: grid; grid-template-columns: auto 1fr; gap: 2rem clamp(2rem, 6vw, 6rem); align-items: center; }
.site-footer__logo { width: 170px; color: var(--crema); }
.site-footer__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
.site-footer p { margin: 0; line-height: 1.9; }
.site-footer a { text-decoration: none; color: var(--arena); }
.site-footer a:hover { text-decoration: underline; text-underline-offset: 3px; }
.site-footer__copy { grid-column: 1 / -1; border-top: 1px solid var(--linea-clara); padding-top: 1.5rem; color: rgba(255, 248, 241, .5); }

.reserva-movil { display: none; }

/* ---------- Pantallas bajas (portátiles 768px) ---------- */
@media (max-height: 47.5em) and (min-width: 60.0625em) {
  .hero__logo svg { height: clamp(140px, 30vh, 260px); }
  .hero__content { padding-top: 3rem; }
}

/* ---------- Tablet y móvil ---------- */
@media (max-width: 67.5em) {
  .nav a[href="#novelda"] { display: none; }
}
@media (max-width: 60em) {
  :root { --header-h: 64px; }
  .nav-toggle {
    display: grid; gap: 7px; place-content: center; width: 44px; height: 44px; padding: 0;
    background: none; border: 0; color: inherit; cursor: pointer; position: relative; z-index: 2;
  }
  .nav-toggle__bar { display: block; width: 26px; height: 1px; background: currentColor; transition: transform .4s var(--ease); }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:first-child { transform: translateY(4px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }
  .nav {
    position: fixed; inset: 0; z-index: 1; flex-direction: column; justify-content: center; gap: 1.4rem;
    background: var(--aceituna); color: var(--crema);
    clip-path: circle(0 at calc(100% - 40px) 32px); visibility: hidden; transition: clip-path .7s var(--ease), visibility 0s .7s;
  }
  .nav.is-open { clip-path: circle(150% at calc(100% - 40px) 32px); visibility: visible; transition: clip-path .7s var(--ease); }
  .nav a:not(.btn) { font-family: var(--serif); font-size: 1.6rem; }
  .nav a[href="#novelda"] { display: inline; }
  .site-header.menu-open { color: var(--crema); background: transparent; box-shadow: none; }
  .site-header.menu-open .brand { position: relative; z-index: 2; }

  .hero__bar-inner { grid-template-columns: 1fr 1fr; }
  .hero__bar a:first-child { display: none; }
  .hero__dots { display: none; }

  .casa__grid, .carta__grid, .novelda__grid, .reservar__grid { grid-template-columns: 1fr; }
  .carta__foto { width: min(100%, 20rem); aspect-ratio: 1; flex: none; min-height: 0; }
  .carta__panel { margin: 8px 0; }
  .casa__collage { max-width: 30rem; margin-inline: auto; width: 100%; }
  .pilares { grid-template-columns: 1fr; }
  .pilares li, .pilares li + li { padding: 1.3rem 0; border-left: 0; }
  .xanxullo { grid-template-columns: 1fr; min-height: 0; }
  .xanxullo__media { aspect-ratio: 4 / 3; }
  .xanxullo__text { padding-block: 2.5rem 3rem; max-width: none; }
  .paneles { flex-direction: column; height: auto; }
  .panel { min-height: 120px; border-radius: 0; flex: none; height: 130px; transition: height .7s var(--ease); }
  .panel.is-open { height: 340px; }
  .reservar__map { justify-self: stretch; width: 100%; }
  .arch--map { aspect-ratio: 1 / 1; }
  .site-footer__inner, .site-footer__cols { grid-template-columns: 1fr; }

  .reserva-movil {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 1rem; text-align: center; text-decoration: none;
    background: var(--bronce); color: #fff; font-weight: 400; letter-spacing: .03em;
    transform: translateY(100%); transition: transform .5s var(--ease);
  }
  .reserva-movil.is-visible { transform: none; }
  .site-footer { padding-bottom: 5rem; }
}
@media (max-width: 32.5em) {
  /* Tarjetas de categoría en móvil: número arriba, nombre y recuento debajo */
  .tabs button { grid-template-columns: 1fr; grid-template-rows: auto; row-gap: .15rem; padding: .85rem .9rem; min-height: 0; align-content: start; }
  .tab__num { grid-row: auto; text-align: left; font-size: .9rem; }
  .tab__name { text-wrap: pretty; }

  .hero__actions .btn { flex: 1 1 100%; }
  .hero__content { width: 100%; padding-inline: 1.5rem; }
  .hero__lead { font-size: 1.1rem; }
  .sello { right: 0; }
}

/* ---------- Animaciones ligadas al scroll (CSS nativo) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    @keyframes paralaje {
      from { translate: 0 var(--shift, 2rem); }
      to { translate: 0 calc(var(--shift, 2rem) * -1); }
    }
    @media (min-width: 60.0625em) {
      [data-parallax] {
        animation: paralaje linear both;
        animation-timeline: view();
      }
    }
    @keyframes giro { to { rotate: 1turn; } }
    .sello__ring {
      animation: giro linear both;
      animation-timeline: scroll(root);
    }
  }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js .hero__logo, .js .hero__lead, .js .hero__actions, .js .hero__bar { opacity: 1 !important; transform: none !important; }
  .js .hero__frame { clip-path: none !important; }
  .hero__slides img { transform: none !important; }
  .galeria__track { overflow-x: auto; width: auto; }
}
