@import url("../fonts/fonts.css");

/* Colori e font ripresi dal vecchio sito Rascard d'Antan */
:root {
  --testo: #666;
  --scuro: #333;
  --verde: #5a9265;      /* fascia "Regala un soggiorno" */
  --verde-chiaro: #78c98e; /* colore dei link */
  --bianco: #fff;
  --serif: "PT Serif", Georgia, "Times New Roman", serif;
  --sans: "Lato", "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  font: 300 16px/28px var(--serif);
  color: var(--testo);
  background: var(--bianco);
  -webkit-text-size-adjust: 100%;
}

body { margin: 0; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--verde-chiaro); }

/* ---------- Testata ---------- */
.testata {
  position: relative;
  z-index: 10;
  background: var(--bianco);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
}
.testata .contenitore {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 90px;
}
.logo { display: block; width: 220px; }
.logo img { width: 100%; }

.lingue {
  display: flex;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.lingue a {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 400 12px/1 var(--sans);
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--testo);
  padding: 8px 4px;
  opacity: .55;
}
.lingue a[aria-current="page"],
.lingue a:hover,
.lingue a:focus-visible { opacity: 1; }
.lingue img { width: 18px; height: 12px; }

.contenitore {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 30px;
}

/* ---------- Slideshow a tutto schermo ---------- */
.slideshow {
  position: relative;
  height: calc(100vh - 90px);
  height: calc(100svh - 90px);
  min-height: 420px;
  /* Sugli schermi molto larghi la fascia non diventa mai più stretta di 2,5:1,
     altrimenti le foto vengono tagliate troppo in alto e in basso */
  min-height: max(420px, 40vw);
  overflow: hidden;
  background: var(--scuro);
}
.slideshow figure {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  animation: dissolvenza 21s infinite;
}
/* Ritardi spostati di 1s così la prima foto è già visibile all'apertura */
.slideshow figure:nth-child(1) { animation-delay: -1.05s; }
.slideshow figure:nth-child(2) { animation-delay: 5.95s; }
.slideshow figure:nth-child(3) { animation-delay: 12.95s; }
.slideshow img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: zoom 21s infinite;
  animation-delay: inherit;
}
/* Inquadrature tarate sui volti. Lo zoom parte dallo stesso punto,
   così ingrandendo non taglia le teste o il mento. */
.slideshow .balcone img { object-position: 60% 45%; transform-origin: 60% 45%; }
.slideshow .selfie img  { object-position: 50% 72%; transform-origin: 50% 72%; }
.slideshow .insegna img { object-position: 60% 43%; transform-origin: 60% 43%; }

@keyframes dissolvenza {
  0%   { opacity: 0; }
  5%   { opacity: 1; }
  33%  { opacity: 1; }
  38%  { opacity: 0; }
  100% { opacity: 0; }
}
@keyframes zoom {
  0%   { transform: scale(1); }
  38%  { transform: scale(1.06); }
  100% { transform: scale(1.06); }
}

.slideshow::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.05) 40%, rgba(0,0,0,.45) 100%);
  pointer-events: none;
}

.titolo {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 9%;
  text-align: center;
  color: var(--bianco);
  padding: 0 20px;
}
.titolo h1 {
  margin: 0;
  font: 400 72px/1.1 var(--serif);
  letter-spacing: 4px;
  text-transform: uppercase;
  text-shadow: 0 0 12px #000;
}
.titolo p {
  margin: 14px 0 0;
  font: 400 14px/1.6 var(--sans);
  letter-spacing: 4px;
  text-transform: uppercase;
  text-shadow: 0 0 10px #000;
}

/* ---------- Lettera ---------- */
.lettera {
  padding: 100px 0 90px;
}
.lettera .contenitore { max-width: 820px; }
.lettera h2 {
  margin: 0 0 40px;
  text-align: center;
  font: 400 28px/1.4 var(--serif);
  color: var(--testo);
}
.lettera h2::after {
  content: "";
  display: block;
  width: 60px;
  height: 1px;
  margin: 30px auto 0;
  background: #ccc;
}
.lettera p {
  margin: 0 0 24px;
  font-size: 18px;
  line-height: 1.85;
}
.lettera .chiusura { font-style: italic; }

/* ---------- Fascia B&B La Ville ---------- */
.laville {
  background: var(--verde);
  color: var(--bianco);
  text-align: center;
  padding: 80px 0;
}
.laville .occhiello {
  margin: 0 0 10px;
  font: 400 12px/1.6 var(--sans);
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: .9;
}
.laville h2 {
  margin: 0 0 30px;
  font: 300 30px/1.3 var(--serif);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.laville address {
  font-style: normal;
  font-size: 18px;
  line-height: 2;
  margin: 0 0 36px;
}
.laville address a { color: var(--bianco); }
.pulsante {
  display: inline-block;
  padding: 0 22px;
  line-height: 44px;
  border: 1px solid var(--bianco);
  color: var(--bianco);
  font: 400 12px/44px var(--sans);
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color .2s, color .2s;
}
.pulsante:hover,
.pulsante:focus-visible {
  background: var(--bianco);
  color: var(--verde);
}

/* ---------- Piede ---------- */
.piede {
  background: var(--scuro);
  color: var(--bianco);
  text-align: center;
  padding: 70px 0 60px;
  font: 400 12px/2 var(--serif);
  letter-spacing: 2px;
  text-transform: uppercase;
}
.piede h3 {
  margin: 0 0 14px;
  font: 400 16px/1.4 var(--serif);
  letter-spacing: 3px;
}
.piede p { margin: 0; }
.piede a { color: var(--bianco); }
.piede .recapiti { text-transform: none; letter-spacing: 1px; font-size: 14px; }
.piede .credits { margin-top: 40px; opacity: .6; font-size: 11px; }

a:focus-visible,
.pulsante:focus-visible {
  outline: 2px solid var(--verde-chiaro);
  outline-offset: 3px;
}

/* ---------- Schermi piccoli ---------- */
@media (max-width: 767px) {
  .contenitore { padding: 0 16px; }
  .testata .contenitore { min-height: 70px; }
  .logo { width: 160px; }
  /* Su telefono le foto si vedono intere (4:3, come sono state scattate)
     e il titolo va in una fascia scura sotto, così non copre i volti */
  .slideshow { height: auto; min-height: 0; padding-top: 75%; }
  .slideshow figure { inset: 0 0 auto 0; aspect-ratio: 4 / 3; }
  .slideshow::after { display: none; }
  .titolo {
    position: static;
    background: var(--scuro);
    padding: 26px 16px 28px;
  }
  .titolo h1 { font-size: 32px; letter-spacing: 2px; text-shadow: none; }
  .titolo p { font-size: 11px; letter-spacing: 2px; text-shadow: none; }
  .lettera { padding: 60px 0 50px; }
  .lettera h2 { font-size: 23px; }
  .lettera p { font-size: 17px; line-height: 1.8; }
  .laville { padding: 60px 0; }
  .laville h2 { font-size: 23px; }
  .laville address { font-size: 16px; }
  .lingue a span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .slideshow figure { animation: none; }
  .slideshow figure:first-child { opacity: 1; }
  .slideshow img { animation: none; }
}
