/* Albergo Cedrina — demo multipagina, tre temi, tre lingue */
@font-face { font-family: "Italiana"; font-weight: 400; src: url("../../fonts/italiana-400-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; font-weight: 300 700; src: url("../../fonts/hanken-grotesk-300-700-normal.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; font-style: italic; font-weight: 300 700; src: url("../../fonts/hanken-grotesk-300-700-italic.woff2") format("woff2"); font-display: swap; }

@view-transition { navigation: auto; }

/* Giorno: foschia del lago, acqua verde-azzurra, cedro */
:root {
  color-scheme: light;
  --bg: #edf2f1;
  --surface: #fbfdfc;
  --ink: #12343c;
  --muted: #4b656a;
  --line: #c6d4d2;
  --link: #17666b;
  --fill: #e2c63a;
  --fill-ink: #12343c;
  --sky-top: #9fcbd6;
  --sky-low: #edf3e6;
  --sun: #fff4b8;
  --m-far: #94b3ba;
  --m-mid: #628a92;
  --water: #4d8e98;
  --water-deep: #3c7a85;
  --glint: #eaf7f4;
  --pillar: #dcd3c1;
  --pillar-shade: #b9ae96;
  --beam: #7b5b3b;
  --leaf: #4c7838;
  --lemon: #efd236;
  --garden: #8fae6a;
  --stars: 0;
  --lights: 0;
  --display: "Italiana", "Didot", Georgia, serif;
  --sans: "Hanken Grotesk", "Helvetica Neue", Arial, sans-serif;
}
/* Sera: crepuscolo sul Baldo, luci dei paesi, lampade */
:root[data-theme="sera"] {
  color-scheme: dark;
  --bg: #161b30; --surface: #1e2540; --ink: #efe9da; --muted: #aeb0c8; --line: #353d5e;
  --link: #f3c36d; --fill: #f3c36d; --fill-ink: #161b30;
  --sky-top: #121831; --sky-low: #6e4f70; --sun: #f4e6c4; --m-far: #3d4064; --m-mid: #282b4b;
  --water: #222a4a; --water-deep: #1a2140; --glint: #f3c36d; --pillar: #5b5772; --pillar-shade: #45415b;
  --beam: #3b2f3d; --leaf: #2f4a3a; --lemon: #e2bf4c; --garden: #34503f; --stars: 1; --lights: 1;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #161b30; --surface: #1e2540; --ink: #efe9da; --muted: #aeb0c8; --line: #353d5e;
    --link: #f3c36d; --fill: #f3c36d; --fill-ink: #161b30;
    --sky-top: #121831; --sky-low: #6e4f70; --sun: #f4e6c4; --m-far: #3d4064; --m-mid: #282b4b;
    --water: #222a4a; --water-deep: #1a2140; --glint: #f3c36d; --pillar: #5b5772; --pillar-shade: #45415b;
    --beam: #3b2f3d; --leaf: #2f4a3a; --lemon: #e2bf4c; --garden: #34503f; --stars: 1; --lights: 1;
  }
}
/* Contrasto alto: nero, bianco, giallo; niente sfumature */
:root[data-theme="contrasto"] {
  color-scheme: dark;
  --bg: #000; --surface: #000; --ink: #fff; --muted: #fff; --line: #fff;
  --link: #ffe94a; --fill: #ffe94a; --fill-ink: #000;
  --sky-top: #000; --sky-low: #000; --sun: #ffe94a; --m-far: #333; --m-mid: #5c5c5c;
  --water: #141414; --water-deep: #141414; --glint: #fff; --pillar: #262626; --pillar-shade: #1a1a1a;
  --beam: #444; --leaf: #8a8a8a; --lemon: #ffe94a; --garden: #5c5c5c; --stars: 0; --lights: 0;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1.0625rem/1.6 var(--sans); transition: background-color .4s, color .4s; }
a { color: var(--link); text-underline-offset: .2em; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 2px; }
[data-theme="contrasto"] a { text-decoration-thickness: 2px; }
img, svg { display: block; max-width: 100%; }
h1, h2 { font-family: var(--display); font-weight: 400; line-height: 1.08; margin: 0 0 .4em; letter-spacing: .01em; }
h1 { font-size: clamp(2.5rem, 5.6vw, 4.6rem); }
h2 { font-size: clamp(2rem, 3.6vw, 2.9rem); }
h3 { font-size: 1.15rem; font-weight: 600; margin: 0 0 .3em; }
p { margin: 0 0 1em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.lead { font-size: 1.2rem; max-width: 36em; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* barra demo */
.demo-bar { background: var(--ink); color: var(--bg); font-size: .9rem; padding: 8px 16px; text-align: center; }
.demo-bar a { color: var(--bg); font-weight: 700; }

/* testata */
.head { view-transition-name: testata; background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; transition: background-color .4s; }
.head__in { display: flex; align-items: center; gap: 28px; min-height: 68px; }
.brand { font-family: var(--display); font-size: 2rem; line-height: 1; color: var(--ink); text-decoration: none; display: flex; align-items: baseline; gap: 10px; }
.brand small { font-family: var(--sans); font-size: .8rem; color: var(--muted); letter-spacing: .02em; }
.nav { display: flex; gap: 22px; }
.nav a { color: var(--ink); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--line); }
.nav a[aria-current="page"] { border-bottom-color: var(--fill); font-weight: 600; }
.tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.langs { display: flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.langs button, .theme__btn { font: 600 .82rem var(--sans); color: var(--ink); background: none; border: 0; border-radius: 999px; padding: 6px 10px; cursor: pointer; }
.langs button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.theme { position: relative; }
.theme__btn { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); padding: 7px 12px; }
.theme__btn svg { width: 16px; height: 16px; }
.theme__menu { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px; min-width: 200px; box-shadow: 0 12px 30px rgb(0 0 0 / .18); }
.theme__menu button { display: flex; align-items: center; gap: 10px; width: 100%; font: 400 .95rem var(--sans); color: var(--ink); background: none; border: 0; border-radius: 8px; padding: 9px 10px; cursor: pointer; text-align: left; }
.theme__menu button:hover { background: var(--bg); }
.theme__menu button[aria-checked="true"] { font-weight: 700; }
.theme__menu button[aria-checked="true"]::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--link); }
.swatch { width: 22px; height: 22px; border-radius: 50%; flex: none; border: 1px solid var(--line); }
.swatch--auto { background: linear-gradient(135deg, #edf2f1 50%, #161b30 50%); }
.swatch--giorno { background: radial-gradient(circle at 35% 35%, #e2c63a 30%, #9fcbd6 32%); }
.swatch--sera { background: radial-gradient(circle at 65% 35%, #f4e6c4 25%, #1e2540 27%); }
.swatch--contrasto { background: linear-gradient(135deg, #000 50%, #ffe94a 50%); }

/* pulsanti */
.btn { display: inline-flex; align-items: center; gap: 8px; font: 600 1rem var(--sans); text-decoration: none; border-radius: 999px; padding: 12px 22px; border: 2px solid var(--fill); background: var(--fill); color: var(--fill-ink); cursor: pointer; transition: transform .15s, background-color .4s; }
.btn:hover { transform: translateY(-1px); }
.btn--line { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- panorama (casa) ---------- */
.hero { position: relative; overflow: hidden; height: min(78vh, 720px); min-height: 520px; }
.pano { position: absolute; inset: 0; width: 100%; height: 100%; }
.pano .layer { will-change: transform; }
.pano path, .pano rect, .pano circle, .pano ellipse { transition: fill .6s; }
.stars { opacity: var(--stars); transition: opacity .6s; }
.lights { opacity: var(--lights); transition: opacity .6s; }
.boat { animation: sail 70s linear infinite; }
@keyframes sail { from { transform: translateX(-160px); } to { transform: translateX(1400px); } }
.glint { stroke: var(--glint); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 26 60; animation: glint 6s linear infinite; }
.glint:nth-of-type(2n) { animation-duration: 8s; animation-direction: reverse; }
@keyframes glint { to { stroke-dashoffset: -172; } }
.hero__text { position: relative; z-index: 2; padding-top: clamp(132px, 20vh, 170px); }
.hero__text h1 { max-width: 11em; view-transition-name: titolo; }
.hero__text .lead { max-width: 30em; }

.now { border-bottom: 1px solid var(--line); }
.now p { margin: 0; padding: 22px 0; font-size: 1.15rem; max-width: 52em; }
.now strong { font-weight: 600; }

.section { padding: clamp(56px, 8vw, 104px) 0; }
.section + .section { border-top: 1px solid var(--line); }
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(32px, 6vw, 88px); align-items: start; }
.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; border-top: 1px solid var(--line); }
.facts dt, .facts dd { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { font-weight: 600; padding-right: 24px; }
.facts dd { color: var(--muted); }
.paths { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 2px solid var(--ink); margin-top: 28px; }
.paths a { display: block; padding: 22px 24px 26px 0; color: var(--ink); text-decoration: none; }
.paths a + a { padding-left: 24px; border-left: 1px solid var(--line); }
.paths strong { display: block; font-family: var(--display); font-size: 1.8rem; font-weight: 400; margin-bottom: 4px; }
.paths span { color: var(--muted); }
.paths a:hover strong { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .15em; }

/* intestazione delle pagine interne */
.page-head { padding: clamp(40px, 7vw, 88px) 0 28px; }
.page-head h1 { view-transition-name: titolo; max-width: 14em; }

/* ---------- camere ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 36px; }
.chip { font: 500 .95rem var(--sans); color: var(--ink); background: transparent; border: 1px solid var(--ink); border-radius: 999px; padding: 8px 16px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.rooms { display: grid; grid-template-columns: repeat(2, 1fr); gap: 56px 40px; padding-bottom: 96px; }
.room[hidden] { display: none; }
.room__view { aspect-ratio: 3 / 2; border-radius: 48% 48% 4px 4px / 34% 34% 4px 4px; overflow: hidden; border: 10px solid var(--pillar); background: var(--sky-low); transition: border-color .6s; }
.room__view svg { width: 100%; height: 100%; }
.room h2 { font-size: 2.1rem; margin: 18px 0 2px; }
.room__meta { color: var(--muted); margin-bottom: 10px; }
.room__foot { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 14px; }
.price { font-size: 1.1rem; }
.price b { font-size: 1.4rem; }
.season-note { border-top: 1px solid var(--line); padding: 28px 0 0; color: var(--muted); max-width: 46em; }

/* ---------- dintorni ---------- */
.explore { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; padding-bottom: 96px; }
.map { position: sticky; top: 92px; }
.map svg { width: 100%; height: auto; max-height: calc(100vh - 120px); }
.map .land { fill: var(--garden); opacity: .35; }
.map .lake { fill: var(--water); stroke: var(--ink); stroke-width: 1.2; stroke-linejoin: round; }
.map .route { fill: none; stroke: var(--fill); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 1 8; }
.map .route-mask { fill: none; stroke: #fff; stroke-width: 12; stroke-dasharray: 1; stroke-dashoffset: 1; }
.map .route-mask.draw { animation: draw 1.1s ease-in-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.pin { cursor: pointer; }
.pin circle { fill: var(--surface); stroke: var(--ink); stroke-width: 2; transition: r .2s, fill .2s; }
.pin text { font: 600 13px var(--sans); fill: var(--ink); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
.pin[aria-pressed="true"] circle { fill: var(--fill); r: 9; }
.pin:focus-visible { outline: none; }
.pin:focus-visible circle { stroke-width: 4; }
.home-pin path { fill: var(--fill); stroke: var(--ink); stroke-width: 1.5; }
.home-pin text { font: 400 20px var(--display); fill: var(--ink); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; }
.places { list-style: none; margin: 0 0 32px; padding: 0; border-top: 1px solid var(--line); }
.places button { display: flex; justify-content: space-between; gap: 16px; width: 100%; font: 400 1.05rem var(--sans); color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--line); padding: 14px 4px; cursor: pointer; text-align: left; }
.places button span:last-child { color: var(--muted); white-space: nowrap; }
.places button[aria-pressed="true"] { font-weight: 700; background: var(--surface); }
.place { background: var(--surface); border-left: 4px solid var(--fill); padding: 24px 26px; min-height: 180px; }
.place h2 { font-size: 2.2rem; }
.place .how { font-weight: 600; }
.place.enter { animation: enter .45s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }

/* ---------- prenota ---------- */
.book { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; padding-bottom: 96px; }
.steps { list-style: none; margin: 0 0 32px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); counter-reset: s; }
.steps li { counter-increment: s; border-top: 3px solid var(--line); padding-top: 10px; color: var(--muted); font-size: .95rem; transition: border-color .3s, color .3s; }
.steps li::before { content: counter(s) " "; font-weight: 700; }
.steps li.done { border-top-color: var(--ink); color: var(--ink); }
.steps li[aria-current="step"] { border-top-color: var(--fill); color: var(--ink); font-weight: 600; }
.panel[hidden] { display: none; }
.panel.in-fwd { animation: in-fwd .35s ease-out; }
.panel.in-back { animation: in-back .35s ease-out; }
@keyframes in-fwd { from { opacity: 0; transform: translateX(28px); } }
@keyframes in-back { from { opacity: 0; transform: translateX(-28px); } }
.panel h2 { font-size: 2.2rem; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; margin-bottom: 24px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--wide { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .95rem; }
.field input, .field select, .field textarea { font: 400 1rem var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--muted); border-radius: 8px; padding: 11px 12px; }
.field textarea { min-height: 96px; resize: vertical; }
.field input[aria-invalid="true"] { border-color: #c0392b; border-width: 2px; }
[data-theme="sera"] .field input[aria-invalid="true"] { border-color: #ff8f80; }
.err { color: #b0301f; font-size: .92rem; min-height: 1.4em; margin: 0; }
[data-theme="sera"] .err, [data-theme="contrasto"] .err { color: #ff9d8f; }
.pick { display: grid; gap: 12px; margin-bottom: 24px; }
.pick label { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: baseline; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; cursor: pointer; }
.pick label:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.pick input { accent-color: var(--link); }
.pick .nm { font-family: var(--display); font-size: 1.5rem; }
.pick .tot { font-weight: 700; }
.pick .sub { grid-column: 2 / -1; color: var(--muted); font-size: .92rem; }
.pick-empty { color: var(--muted); }
.summary { position: sticky; top: 92px; background: var(--surface); border-top: 4px solid var(--fill); padding: 24px; }
.summary h2 { font-size: 1.9rem; }
.summary dl { margin: 0 0 16px; display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; text-align: right; }
.summary .total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 14px; font-weight: 700; }
.summary .total output { font-size: 1.8rem; font-variant-numeric: tabular-nums; }
.recap { margin: 0 0 24px; display: grid; grid-template-columns: auto 1fr; gap: 10px 24px; border-top: 1px solid var(--line); padding-top: 16px; }
.recap dt { font-weight: 600; }
.recap dd { margin: 0; }

/* piè di pagina */
.foot { border-top: 1px solid var(--line); padding: 48px 0 64px; color: var(--muted); }
.foot__in { display: grid; grid-template-columns: 1fr auto; gap: 20px 40px; align-items: start; }
.foot .brand { margin-bottom: 8px; }
.foot p { margin: 0 0 6px; }
.foot .actions { justify-content: flex-end; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center; z-index: 40; }
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* cambio tema: il nuovo tema si apre a cerchio dal pulsante */
html.vt-theme *, html.vt-theme *::before { transition: none !important; }
html.vt-theme::view-transition-old(root) { animation: none; }
html.vt-theme::view-transition-new(root) { animation: reveal .7s cubic-bezier(.6, 0, .3, 1); }
@keyframes reveal { from { clip-path: circle(0 at var(--vx, 90%) var(--vy, 0)); } to { clip-path: circle(150vmax at var(--vx, 90%) var(--vy, 0)); } }
::view-transition-group(*) { animation-duration: .4s; }

@media (max-width: 900px) {
  .head__in { flex-wrap: wrap; gap: 4px 16px; padding-top: 10px; }
  .nav { order: 3; width: 100%; gap: 18px; overflow-x: auto; }
  .brand small { display: none; }
  .split, .explore, .book { grid-template-columns: 1fr; }
  .map, .summary { position: static; }
  .map svg { max-height: 70vh; }
  .rooms { grid-template-columns: 1fr; gap: 48px; }
  .paths { grid-template-columns: 1fr; }
  .paths a + a { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .foot__in { grid-template-columns: 1fr; }
  .foot .actions { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .theme__btn [data-t] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .fields { grid-template-columns: 1fr; }
  .steps li { font-size: .82rem; }
  .hero { min-height: 560px; }
  .lead { font-size: 1.08rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .map .route-mask { stroke-dashoffset: 0; }
  @view-transition { navigation: none; }
}
