/* ==========================================================================
   Plantilla 05 · Turisme i allotjament — «Mas de la Serra» (demostració)
   Arquetip: ESCENES. Pantalles completes de fotografia, una barra de reserva
   enganxada a la portada, una fila d'allotjaments que es desplaça en
   horitzontal i panells d'estacions que s'obren. Sense capçalera: una
   etiqueta de marca, un botó, un raïl de punts i l'avís de demo al lateral.
   ========================================================================== */

:root {
  --pedra: #ece5d6;
  --pedra-2: #e0d7c4;
  --nit: #1f1a14;
  --oliva: #3f4727;
  --terra: #b2552f;
  --terra-fosc: #9a4524;     /* text sobre pedra (5,2:1) */
  --ambre: #f0b46a;
  --gris: #5f574a;
  --linia: #cfc4ad;

  --font-titol: "Libre Caslon Display", "Iowan Old Style", Georgia, serif;
  --font-text: "Karla", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mano: "Caveat", "Segoe Script", cursive;

  --vora: clamp(20px, 5vw, 72px);
  --alt-escena: 100svh;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 18px/1.6 var(--font-text); color: var(--nit); background: var(--pedra); }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ambre); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-titol); font-weight: 400; line-height: .95; margin: 0; letter-spacing: -.01em; }
p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.salta { position: absolute; left: 12px; top: -80px; z-index: 500; background: var(--ambre); color: var(--nit); padding: 10px 16px; font-weight: 700; }
.salta:focus { top: 12px; }
.mano { font-family: var(--font-mano); font-size: 1.6em; line-height: 1; }
.etiqueta { font-size: 13px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--terra-fosc); }

/* ---------- Elements fixos ---------- */
.marca { position: fixed; z-index: 300; left: 0; top: 24px; display: block; background: var(--pedra); color: var(--nit); text-decoration: none; padding: 12px 22px 12px var(--vora); line-height: 1; }
.marca b { font-family: var(--font-titol); font-weight: 400; font-size: 28px; display: block; letter-spacing: 0; }
.marca small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; color: var(--terra-fosc); margin-top: 5px; }
.reserva-fix { position: fixed; z-index: 300; right: var(--vora); top: 24px; }
.boto { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 28px; border: 0; background: var(--terra); color: #fff; font: 700 14px/1 var(--font-text); letter-spacing: .14em; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: background-color .2s, transform .2s; }
.boto:hover { background: var(--terra-fosc); transform: translateY(-2px); }
.boto--clar { background: var(--pedra); color: var(--nit); }
.boto--clar:hover { background: #fff; }
.boto--ambre { background: var(--ambre); color: var(--nit); }
.boto--ambre:hover { background: #f5c98f; }
.boto--buit { background: transparent; box-shadow: inset 0 0 0 2px currentColor; color: inherit; }
.boto--buit:hover { background: var(--nit); color: var(--pedra); }

.rail { position: fixed; z-index: 300; right: 22px; top: 50%; transform: translateY(-50%); display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.rail a { position: relative; display: block; width: 14px; height: 14px; border-radius: 50%; background: var(--pedra); box-shadow: 0 0 0 2px var(--nit); }
.rail a.actiu { background: var(--terra); box-shadow: 0 0 0 2px var(--nit), 0 0 0 5px var(--pedra); }
.rail a span { position: absolute; right: 26px; top: 50%; transform: translateY(-50%); white-space: nowrap; background: var(--nit); color: var(--pedra); padding: 5px 10px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: 0; pointer-events: none; transition: opacity .2s; }
.rail a:hover span, .rail a:focus-visible span { opacity: 1; }

.demo-lateral { position: fixed; z-index: 290; left: 0; top: 50%; transform: translateY(-50%) rotate(180deg); writing-mode: vertical-rl; white-space: nowrap; background: var(--nit); color: var(--pedra); padding: 14px 7px; font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; text-decoration: none; }
.demo-lateral:hover { background: var(--terra); }

/* ---------- Escena 1 · Portada ---------- */
.portada { position: relative; min-height: max(680px, var(--alt-escena)); display: flex; flex-direction: column; justify-content: flex-end; color: #fff; isolation: isolate; overflow: hidden; }
.portada__foto { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; animation: acosta 26s ease-out forwards; }
@keyframes acosta { from { transform: scale(1.12); } to { transform: scale(1); } }
.portada::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(31, 26, 20, .5) 0%, rgba(31, 26, 20, 0) 24%, rgba(31, 26, 20, .38) 52%, rgba(31, 26, 20, .82) 100%); }
.portada__interior { padding: 0 var(--vora) clamp(28px, 5vw, 64px); max-width: 1500px; position: relative; }
.portada .etiqueta { color: var(--ambre); }
.portada h1 { font-size: clamp(54px, 9.2vw, 148px); line-height: .9; letter-spacing: -.025em; margin: 18px 0 24px; max-width: 12ch; }
.portada h1 em { font-style: italic; color: var(--ambre); }
.portada__text { max-width: 46ch; font-size: clamp(17px, 1.5vw, 20px); color: #f2ebdc; }
.portada .mano { position: absolute; right: calc(var(--vora) + 40px); bottom: clamp(40px, 7vw, 90px); color: var(--ambre); transform: rotate(-6deg); font-size: clamp(26px, 3vw, 40px); text-align: center; }
.disponibilitat { background: var(--pedra); color: var(--nit); border-top: 4px solid var(--terra); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; align-items: end; gap: 0; }
.disponibilitat label { display: grid; gap: 4px; padding: 16px 22px 12px; border-right: 1px solid var(--linia); font-size: 11.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--gris); }
.disponibilitat input, .disponibilitat select { font: 500 18px var(--font-text); letter-spacing: 0; text-transform: none; color: var(--nit); background: transparent; border: 0; border-bottom: 2px solid var(--nit); padding: 6px 0; min-height: 40px; width: 100%; border-radius: 0; }
.disponibilitat .boto { height: 100%; min-height: 86px; padding-inline: 40px; }

/* ---------- Escenes comunes ---------- */
.escena { position: relative; }
.cap-escena { padding: clamp(72px, 10vw, 140px) var(--vora) clamp(28px, 4vw, 48px); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 64px; align-items: end; }
.cap-escena .etiqueta { display: block; margin-bottom: 18px; }
.titol { font-size: clamp(48px, 7.2vw, 116px); line-height: .92; letter-spacing: -.02em; }
.titol em { font-style: italic; color: var(--terra-fosc); }
.entradeta { max-width: 40ch; font-size: 19px; color: var(--gris); }

/* ---------- Escena 2 · Allotjaments (fila horitzontal) ---------- */
.controls { display: flex; align-items: center; gap: 12px; }
.controls__fletxa { width: 56px; height: 56px; border: 2px solid var(--nit); background: transparent; color: var(--nit); cursor: pointer; display: grid; place-items: center; transition: background-color .2s, color .2s; }
.controls__fletxa:hover { background: var(--nit); color: var(--pedra); }
.controls__fletxa:disabled { opacity: .35; cursor: default; background: transparent; color: var(--nit); }
.controls__fletxa svg { width: 22px; height: 22px; }
.controls__num { font-size: 14px; font-weight: 700; letter-spacing: .14em; min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; }
html:not(.js) .controls { display: none; }
.fila { display: flex; gap: clamp(16px, 2vw, 28px); overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px var(--vora) 20px; scroll-padding-inline: var(--vora); scrollbar-width: thin; scrollbar-color: var(--nit) transparent; }
.casa { flex: 0 0 min(84vw, 560px); scroll-snap-align: start; display: grid; gap: 18px; align-content: start; }
.casa__foto { position: relative; overflow: hidden; background: var(--pedra-2); }
.casa__foto img { width: 100%; height: min(62vh, 640px); min-height: 380px; object-fit: cover; transition: transform 1.2s cubic-bezier(.2, .7, .2, 1); }
.casa:hover .casa__foto img { transform: scale(1.04); }
.casa__num { position: absolute; left: 18px; top: 10px; font-family: var(--font-titol); font-size: 64px; line-height: 1; color: #fff; text-shadow: 0 2px 24px rgba(0, 0, 0, .45); }
.casa__etiqueta { position: absolute; right: 0; bottom: 0; background: var(--pedra); padding: 9px 16px; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.casa h3 { font-size: clamp(40px, 4.4vw, 60px); }
.casa__dades { display: flex; flex-wrap: wrap; gap: 6px 22px; list-style: none; margin: 0; padding: 0; font-size: 15px; color: var(--gris); }
.casa__dades li::before { content: "—"; margin-right: 8px; color: var(--terra); }
.casa p { max-width: 44ch; color: var(--gris); }
.casa__peu { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding-top: 14px; border-top: 2px solid var(--nit); }
.casa__preu { font-family: var(--font-titol); font-size: 30px; line-height: 1; }
.casa__preu small { font: 500 14px var(--font-text); color: var(--gris); margin-left: 4px; }
.casa__peu a { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--terra-fosc); text-underline-offset: 5px; }
.avis { padding: 8px var(--vora) clamp(56px, 8vw, 100px); font-size: 14px; color: var(--gris); }

/* ---------- Escena 3 · Qui som (foto fixa + text que llisca) ---------- */
.qui { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); background: var(--oliva); color: var(--pedra); }
.qui__foto { position: sticky; top: 0; height: 100svh; }
.qui__foto img { width: 100%; height: 100%; object-fit: cover; }
.qui__text { padding: clamp(72px, 10vw, 150px) var(--vora) clamp(72px, 10vw, 150px) clamp(32px, 6vw, 96px); display: grid; gap: clamp(36px, 5vw, 64px); }
.qui .etiqueta { color: var(--ambre); }
.qui h2 { font-size: clamp(48px, 6.4vw, 104px); }
.qui h2 em { font-style: italic; color: var(--ambre); }
.qui p { color: #ddd6c1; max-width: 50ch; }
.qui .entrada { font-family: var(--font-titol); font-size: clamp(26px, 3vw, 40px); line-height: 1.15; color: #fff; max-width: 24ch; }
.qui__dues { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.qui__dues img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.qui__dues img:nth-child(2) { margin-top: 48px; }
.pilars { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: p; }
.pilars li { counter-increment: p; display: grid; grid-template-columns: 56px 1fr; gap: 4px 12px; padding: 20px 0; border-top: 1px solid rgba(236, 229, 214, .28); }
.pilars li::before { content: "0" counter(p); font-family: var(--font-titol); font-size: 28px; color: var(--ambre); grid-row: span 2; }
.pilars b { font-size: 20px; color: #fff; }
.pilars span { color: #ddd6c1; font-size: 16px; }
.signatura { color: var(--ambre); font-size: 40px; }

/* ---------- Escena 4 · Estacions (panells que s'obren) ---------- */
.estacions { display: flex; height: min(80vh, 760px); min-height: 520px; background: var(--nit); }
.estacio { position: relative; flex: 1 1 0; min-width: 0; overflow: hidden; border-right: 1px solid var(--nit); color: #fff; transition: flex-grow .7s cubic-bezier(.2, .7, .2, 1); isolation: isolate; }
.estacio:last-child { border-right: 0; }
.estacio.oberta { flex-grow: 4.2; }
.estacio > img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.estacio::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(31, 26, 20, .25), rgba(31, 26, 20, .78)); transition: opacity .5s; }
.estacio__boto { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; z-index: 2; }
.estacio__vertical { position: absolute; left: 50%; bottom: 28px; transform: translateX(-50%) rotate(180deg); writing-mode: vertical-rl; font-family: var(--font-titol); font-size: clamp(32px, 3.2vw, 48px); white-space: nowrap; letter-spacing: .01em; transition: opacity .3s; }
.estacio.oberta .estacio__vertical { opacity: 0; }
.estacio__cos { position: absolute; left: clamp(20px, 3vw, 40px); right: clamp(20px, 3vw, 40px); bottom: clamp(24px, 3vw, 40px); opacity: 0; transform: translateY(16px); transition: opacity .5s .1s, transform .5s .1s; pointer-events: none; }
.estacio.oberta .estacio__cos { opacity: 1; transform: none; }
.estacio__cos .etiqueta { color: var(--ambre); }
.estacio__cos h3 { font-size: clamp(44px, 5vw, 80px); margin: 10px 0 14px; }
.estacio__cos ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 17px; max-width: 34ch; }
.estacio__cos li::before { content: "→"; margin-right: 10px; color: var(--ambre); }
.nota-estacions { padding: 14px var(--vora) 0; font-size: 14px; color: var(--gris); }
html:not(.js) .estacions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); height: auto; }
html:not(.js) .estacio { min-height: 440px; }
html:not(.js) .estacio__cos { opacity: 1; transform: none; }
html:not(.js) .estacio__vertical, html:not(.js) .estacio__boto { display: none; }

/* ---------- Escena 5 · Reserva ---------- */
.reserva { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); min-height: 100svh; background: var(--pedra); }
.reserva__lateral { position: relative; color: #fff; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; padding: clamp(28px, 4vw, 56px) var(--vora); padding-right: clamp(28px, 4vw, 56px); gap: 24px; }
.reserva__lateral > img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.reserva__lateral::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(31, 26, 20, .15), rgba(31, 26, 20, .85)); }
.reserva__lateral h3 { font-size: 40px; }
.arribar { list-style: none; margin: 0; padding: 0; display: grid; font-size: 17px; }
.arribar li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, .3); }
.arribar b { font-weight: 700; white-space: nowrap; }
.dades-contacte { display: grid; gap: 4px; font-size: 17px; }
.dades-contacte a { text-underline-offset: 4px; }
.reserva__formulari { padding: clamp(96px, 11vw, 150px) var(--vora) clamp(48px, 6vw, 80px) clamp(28px, 5vw, 80px); display: grid; gap: 28px; align-content: start; }
.reserva__formulari h2 { font-size: clamp(48px, 6.4vw, 100px); }
.reserva__formulari h2 em { font-style: italic; color: var(--terra-fosc); }
.reserva__formulari > p { max-width: 46ch; color: var(--gris); }
.camps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.camp { display: grid; gap: 6px; }
.camp--ample { grid-column: 1 / -1; }
.camp label { font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--gris); }
.camp input, .camp select, .camp textarea { width: 100%; min-height: 52px; padding: 12px 0; border: 0; border-bottom: 2px solid var(--nit); border-radius: 0; background: transparent; font: 500 19px var(--font-text); color: var(--nit); }
.camp textarea { min-height: 96px; resize: vertical; border: 2px solid var(--nit); padding: 12px; }
.camp input:focus, .camp select:focus, .camp textarea:focus { outline: none; border-color: var(--terra); box-shadow: 0 3px 0 0 var(--terra); }
.consentiment { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: var(--gris); }
.consentiment input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--terra); flex-shrink: 0; }
.consentiment a { color: var(--nit); }
.reserva__formulari .boto { justify-self: start; }
.missatge-ok { background: #f6e3c6; border-left: 5px solid var(--terra); padding: 12px 16px; font-size: 15px; }
.nota-pagament { font-size: 14px; color: var(--gris); }
[hidden] { display: none !important; }

.peu { background: var(--nit); color: #bfb7a4; padding: 22px var(--vora); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; font-size: 14px; }
.peu ul { display: flex; flex-wrap: wrap; gap: 4px 24px; list-style: none; margin: 0; padding: 0; }
.peu a { color: var(--pedra); display: inline-block; padding-block: 4px; }

/* ---------- Pàgines legals ---------- */
.legal-cap { background: var(--oliva); color: var(--pedra); padding: clamp(120px, 14vw, 200px) var(--vora) clamp(48px, 6vw, 80px); }
.legal-cap .etiqueta { color: var(--ambre); }
.legal-cap h1 { font-size: clamp(56px, 9vw, 140px); margin-top: 16px; }
.legal { padding: clamp(40px, 6vw, 80px) var(--vora) clamp(56px, 8vw, 110px); }
.legal__interior { max-width: 760px; }
.legal h2 { font-size: 40px; margin: 44px 0 12px; }
.legal p, .legal li { margin-bottom: 12px; }
.legal ul { padding-left: 22px; }
.legal a { color: var(--terra-fosc); }
.avis-plantilla { background: #f6e3c6; border-left: 5px solid var(--terra); padding: 14px 16px; font-size: 16px; }
.legal table { width: 100%; border-collapse: collapse; font-size: 16px; margin-bottom: 12px; }
.legal th, .legal td { text-align: left; padding: 10px 12px; border: 1px solid var(--linia); vertical-align: top; }
.legal th { background: var(--pedra-2); }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .rail { display: none; }
  .disponibilitat { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .disponibilitat label:nth-child(2n) { border-right: 0; }
  .disponibilitat label { border-bottom: 1px solid var(--linia); }
  .disponibilitat .boto { grid-column: 1 / -1; min-height: 60px; }
  .portada .mano { display: none; }
  .qui { grid-template-columns: 1fr; }
  .qui__foto { position: relative; height: 56vh; }
  .reserva { grid-template-columns: 1fr; }
  .reserva__lateral { min-height: 60vh; order: 2; }
  .reserva__formulari { padding-top: 72px; }
}
@media (max-width: 760px) {
  body { font-size: 17px; }
  .marca b { font-size: 22px; }
  .marca { top: 14px; padding: 9px 16px 9px var(--vora); }
  .reserva-fix { top: 14px; }
  .reserva-fix .boto { min-height: 46px; padding: 0 16px; font-size: 12px; }
  .demo-lateral { writing-mode: horizontal-tb; transform: none; top: auto; bottom: 0; left: 0; right: 0; text-align: center; padding: 7px 12px; font-size: 10.5px; letter-spacing: .08em; white-space: normal; line-height: 1.35; }
  body { padding-bottom: 42px; }
  .cap-escena { grid-template-columns: 1fr; }
  .controls { display: none; }
  .estacions { flex-direction: column; height: auto; min-height: 0; }
  .estacio { flex: none; height: 96px; border-right: 0; border-bottom: 1px solid var(--nit); transition: height .6s cubic-bezier(.2, .7, .2, 1); }
  .estacio.oberta { height: 440px; flex-grow: 0; }
  .estacio__vertical { writing-mode: horizontal-tb; transform: none; left: 20px; bottom: auto; top: 50%; translate: 0 -50%; }
  html:not(.js) .estacions { grid-template-columns: 1fr; }
  html:not(.js) .estacio { height: 380px; }
  .camps { grid-template-columns: 1fr; }
  .qui__dues img:nth-child(2) { margin-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .portada__foto { animation: none; }
  .estacio, .estacio__cos, .casa__foto img, .boto { transition: none; }
}
