/* Guida ospiti, allineata a Casa Marea */

:root {
  --paper: #f3eee6;
  --paper-deep: #ebe4d9;
  --surface: #fbf8f3;
  --ink: #1b1914;
  --ink-soft: #5c564c;
  --stone: #8a8378;
  --rule: rgba(27, 25, 20, 0.12);
  --rule-strong: rgba(27, 25, 20, 0.28);
  --accent: #b85a3d;
  --olive: #3e4a38;
  --alert: #9e2b1f;
  --header: 84px;

  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Outfit", "Avenir Next", sans-serif;

  --column: 520px;
  --gutter: 24px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.55;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.cv-guest {
  padding-top: var(--header);
}

/* Grana della carta: rompe l'effetto "schermo piatto" senza essere visibile come texture. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  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='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.11 0 0 0 0 0.10 0 0 0 0 0.09 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

html.cv-locked,
html.cv-locked body {
  overflow: hidden;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure,
address {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

strong {
  font-weight: 600;
}

:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 3px;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* I pannelli escono dal flusso e devono stare sopra la testata del sito. */
#cv-guide-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.icon-flip {
  transform: scaleX(-1);
}

.label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stone);
}

.app {
  position: relative;
  z-index: 1;
  width: min(var(--column), 100%);
  margin: 0 auto;
  min-height: calc(100vh - var(--header));
  min-height: calc(100dvh - var(--header));
  display: flex;
  flex-direction: column;
  padding: 0 var(--gutter);
}

/* Testata */

.hero {
  padding-top: calc(20px + env(safe-area-inset-top));
}

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.monogram {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--ink);
}

.eyebrow {
  margin-top: 44px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--accent);
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3.6rem, 17vw, 5.2rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
  margin-top: 6px;
}

.hero h1 em {
  font-style: italic;
}

.lede {
  margin-top: 18px;
  max-width: 34ch;
  font-size: 1rem;
  color: var(--ink-soft);
}

.arch {
  margin-top: 32px;
  aspect-ratio: 4 / 3.4;
  border-radius: 999px 999px 0 0;
  overflow: hidden;
  background: var(--paper-deep);
}

.arch img,
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Home */

.home {
  flex: 1;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--rule);
}

.facts > div {
  padding: 18px 0;
}

.facts > div + div {
  padding-left: 12px;
  border-left: 1px solid var(--rule);
}

.facts dt {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
}

.facts dd {
  margin-top: 4px;
  font-size: 0.92rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.facts .link-button {
  font-size: 0.86rem;
  white-space: nowrap;
}

.link-button {
  padding: 0;
  text-align: left;
  border: 0;
  background: none;
  font-weight: 500;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.index {
  margin-top: 48px;
}

.index .label {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule-strong);
}

.index a {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
}

.index-num {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--stone);
  font-variant-numeric: tabular-nums;
}

.index-text strong {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.65rem;
  line-height: 1.1;
  letter-spacing: -0.005em;
}

.index-text small {
  display: block;
  margin-top: 4px;
  font-size: 0.84rem;
  color: var(--stone);
}

.index-arrow {
  color: var(--ink-soft);
  transition: transform 0.3s var(--ease);
}

.index a:hover .index-arrow,
.index a:focus-visible .index-arrow {
  transform: translateX(4px);
}

.letter {
  margin-top: 56px;
  padding: 32px 28px;
  background: var(--surface);
  border: 1px solid var(--rule);
}

.letter-body {
  margin-top: 14px;
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.35;
}

.signature {
  margin-top: 14px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--accent);
}

.signature::before {
  content: "— ";
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 24px;
  padding: 16px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 0.2s ease, color 0.2s ease;
}

.button:hover {
  background: var(--olive);
  color: var(--paper);
}

.button-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}

.button-outline:hover {
  background: var(--ink);
  color: var(--paper);
}

.footer {
  padding: 48px 0 calc(32px + env(safe-area-inset-bottom));
  font-size: 0.72rem;
  font-style: normal;
  letter-spacing: 0.04em;
  line-height: 1.8;
  color: var(--stone);
  text-align: center;
}

/* Pannelli */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(29, 27, 24, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: 70;
}

.overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: min(var(--column), 100%);
  margin: 0 auto;
  max-height: 94vh;
  max-height: 94dvh;
  overflow-y: auto;
  background: var(--paper);
  border-radius: 28px 28px 0 0;
  padding: 0 var(--gutter) calc(32px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.45s var(--ease), visibility 0.45s;
  z-index: 80;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  box-shadow: 0 -20px 60px rgba(29, 27, 24, 0.12);
}

.sheet.is-open {
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
}

.sheet:focus,
.sheet:focus-visible {
  outline: none;
}

.sheet-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 calc(var(--gutter) * -1);
  padding: 16px var(--gutter);
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.sheet-num {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--stone);
}

.sheet-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background: transparent;
}

.sheet h2 {
  margin-top: 28px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.6rem;
  line-height: 1;
  letter-spacing: -0.015em;
}

.sheet h3 {
  margin: 40px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule-strong);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stone);
}

.sheet-back {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 48px;
  padding: 16px;
  border: 0;
  border-top: 1px solid var(--rule);
  border-radius: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.note {
  margin-top: 20px;
  padding-left: 16px;
  border-left: 1px solid var(--accent);
  font-size: 0.93rem;
  color: var(--ink-soft);
}

.note-label {
  display: block;
  margin-bottom: 2px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.note-important {
  border-left-width: 2px;
  color: var(--ink);
}

.hint {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--stone);
}

.hint-center {
  text-align: center;
}

.plain li,
.checks li {
  position: relative;
  padding: 10px 0 10px 22px;
  border-bottom: 1px solid var(--rule);
  font-size: 0.95rem;
}

.plain li:last-child,
.checks li:last-child {
  border-bottom: 0;
}

.plain li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 1.15em;
  width: 8px;
  height: 1px;
  background: var(--stone);
}

.checks li::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 0.95em;
  width: 9px;
  height: 9px;
  border: 1px solid var(--accent);
  border-radius: 50%;
}

/* Arrivo */

.times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 24px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.times > div {
  padding: 16px 0;
}

.times > div + div {
  padding-left: 18px;
  border-left: 1px solid var(--rule);
}

.times dt,
.rows dt {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
}

.times dd {
  margin-top: 2px;
  font-family: var(--serif);
  font-size: 1.6rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.code {
  padding: 28px 20px 22px;
  background: var(--ink);
  color: var(--paper);
  text-align: center;
}

.code-digits {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.code-digits span {
  display: grid;
  place-items: center;
  width: 56px;
  height: 68px;
  border: 1px solid rgba(243, 238, 230, 0.25);
  font-family: var(--serif);
  font-size: 2.6rem;
  line-height: 1;
}

.code p {
  margin-top: 16px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(243, 238, 230, 0.6);
}

.steps {
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 14px 0 14px 36px;
  border-bottom: 1px solid var(--rule);
  font-size: 0.95rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 14px;
  font-family: var(--serif);
  font-style: normal;
  font-weight: 500;
  font-size: 1.35rem;
  line-height: 1.1;
  color: var(--accent);
}

/* La casa */

.specs {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: 0.82rem;
  color: var(--stone);
}

.specs strong {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.35rem;
  color: var(--ink);
  margin-right: 2px;
}

.gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 12px;
  margin-top: 28px;
}

.gallery-item {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
}

.gallery-item img {
  aspect-ratio: 1;
  height: auto;
  background: var(--paper-deep);
  transition: filter 0.4s ease;
}

.gallery-item:first-child {
  grid-column: span 2;
}

.gallery-item:first-child img {
  aspect-ratio: 3 / 2;
}

.gallery-item:hover img {
  filter: saturate(0.8) sepia(0.06);
}

.gallery-item span {
  display: block;
  margin-top: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.rows > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--rule);
}

.rows > div:last-child {
  border-bottom: 0;
}

.rows dd {
  display: flex;
  align-items: baseline;
  gap: 14px;
  text-align: right;
  font-weight: 500;
}

.rows dd a {
  border-bottom: 1px solid var(--rule-strong);
}

.rows-stacked > div {
  display: block;
}

.rows-stacked dd {
  display: block;
  margin-top: 3px;
  text-align: left;
  font-weight: 400;
  color: var(--ink-soft);
}

.howto {
  border-bottom: 1px solid var(--rule);
}

.howto summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.2;
  cursor: pointer;
  list-style: none;
}

.howto summary::-webkit-details-marker {
  display: none;
}

.howto summary::after {
  content: "";
  width: 11px;
  height: 11px;
  background:
    linear-gradient(var(--ink-soft), var(--ink-soft)) center / 100% 1px no-repeat,
    linear-gradient(var(--ink-soft), var(--ink-soft)) center / 1px 100% no-repeat;
  transition: transform 0.3s var(--ease);
}

.howto[open] summary::after {
  transform: rotate(45deg);
}

.howto p {
  padding: 0 0 18px;
  max-width: 44ch;
  font-size: 0.93rem;
  color: var(--ink-soft);
}

/* Dintorni */

.place {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}

.places .place:last-child {
  border-bottom: 0;
}

.place-name {
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.2;
}

.place-time {
  align-self: center;
  grid-row: span 2;
  font-size: 0.8rem;
  color: var(--stone);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.place-note {
  margin-top: 2px;
  font-size: 0.86rem;
  color: var(--stone);
}

.place:hover .place-name {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

/* Contatti */

.host {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

.host-initial {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.7rem;
  color: var(--accent);
}

.host strong {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.45rem;
  line-height: 1.1;
}

.host small {
  font-size: 0.84rem;
  color: var(--stone);
}

.host + .button {
  margin-top: 24px;
}

.hint + .rows {
  margin-top: 20px;
  border-top: 1px solid var(--rule);
}

.emergency-row {
  display: grid;
  grid-template-columns: 104px 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}

.emergency-row:last-child {
  border-bottom: 0;
}

.emergency-num {
  font-family: var(--serif);
  font-size: 1.7rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.emergency-text {
  font-size: 1.05rem;
  font-style: italic;
  color: var(--ink-soft);
}

.emergency-row strong {
  display: block;
  font-size: 0.95rem;
}

.emergency-row small {
  display: block;
  font-size: 0.82rem;
  color: var(--stone);
}

.emergency-primary .emergency-num {
  color: var(--alert);
  font-size: 2.1rem;
}

/* Lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  background: rgba(20, 19, 17, 0.97);
  color: var(--paper);
  z-index: 90;
}

.lightbox.is-open {
  display: flex;
}

.lightbox img {
  max-width: 100%;
  max-height: 74vh;
}

.lightbox p {
  font-family: var(--serif);
  font-size: 1.2rem;
}

.lightbox .lightbox-count {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: rgba(243, 238, 230, 0.55);
}

.lightbox-nav,
.lightbox-close {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(243, 238, 230, 0.3);
  border-radius: 50%;
  background: transparent;
  color: var(--paper);
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 12px;
}

.lightbox-next {
  right: 12px;
}

.lightbox-close {
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
}

@media (prefers-reduced-motion: reduce) {
  .overlay,
  .sheet,
  .index-arrow,
  .howto summary::after {
    transition: none;
  }
}

.cv-gate {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100% - 40px));
  margin: 56px auto 88px;
}

.cv-gate h1 {
  margin-top: 8px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.8rem, 8vw, 4.4rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.cv-gate h1 em {
  font-style: italic;
}

.cv-gate form {
  display: grid;
  gap: 12px;
  margin-top: 28px;
  padding: 28px;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--rule);
}

.cv-gate label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
}

.cv-gate input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid var(--rule-strong);
  background: transparent;
  font: inherit;
  letter-spacing: 0.18em;
}

.cv-gate .button {
  margin-top: 6px;
}

.cv-gate__error {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f8e8e4;
  color: var(--alert);
}

.cv-gate__hint {
  margin-top: 16px;
  color: var(--stone);
  font-size: 0.92rem;
}

.masthead-side {
  display: flex;
  align-items: center;
  gap: 14px;
}

.guest-leave {
  margin: 0;
}

.guest-leave button {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
