/* Sito di Assmè e Massimo. Struttura del sito di esempio di websitesforweddings (colonna da telefono,
   schede in basso), con i colori e il carattere della loro partecipazione: carta chiara, ramo ad acquerello,
   EB Garamond. Solo transizioni CSS brevi, niente GSAP. */
:root {
  --bg: #f5f4f2;
  --card: #fbfaf8;
  --paper-deep: #e9e7e2;
  --ink: #48423f;
  --ink-soft: #6f6965;
  --slate: #4c565a;
  --slate-deep: #3a4347;
  --mist: #8e989a;
  --sage: #acac8a;
  --olive: #8a8452;
  --line: #dcd9d3;

  --serif: "EB Garamond", Garamond, Georgia, serif;
  --col: 36rem;
  --tabs-h: 4.25rem;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-weight: 400; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--slate); outline-offset: 3px; border-radius: 4px; }

/* Le etichette in maiuscoletto spaziato, come "DRESS CODE" sulla partecipazione */
.label, .kicker {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* La colonna del sito: su telefono è tutto lo schermo, su computer una colonna al centro */

.app {
  position: relative;
  max-width: var(--col);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  padding-bottom: calc(var(--tabs-h) + 1.5rem + env(safe-area-inset-bottom));
}

/* Barrina con il monogramma, in alto, quando si scorre */
.mini {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, var(--col));
  height: 3.25rem;
  padding: 0 1.25rem;
  background: rgba(245, 244, 242, 0.85);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  transform: translate(-50%, -100%);
  transition: transform 0.35s var(--ease);
}
.mini.is-on { transform: translate(-50%, 0); }
.mini-names { font-size: 1.375rem; letter-spacing: 0.04em; }
.mini-names i { font-style: normal; font-size: 0.9rem; color: var(--mist); }
.mini-date { font-size: 0.875rem; letter-spacing: 0.18em; color: var(--ink-soft); }

/* Copertina: il ramo ad acquerello sopra ai nomi */
.top {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: min(92vh, 46rem);
  padding: 2.5rem 1.25rem 3.5rem;
  text-align: center;
  overflow: hidden;
}
.branch {
  width: auto;
  height: clamp(13rem, 42vh, 21rem);
  margin-bottom: 1.5rem;
  animation: grow 1.2s var(--ease) both;
  transform-origin: 50% 100%;
}
.top-text { animation: rise 0.9s var(--ease) 0.35s both; }
.kicker { letter-spacing: 0.32em; }
.names {
  margin-top: 0.6rem;
  font-size: clamp(3.1rem, 14vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.005em;
}
.names .amp { display: block; margin: 0.15em 0; font-style: italic; font-size: 0.5em; color: var(--mist); }
.date { margin-top: 1.25rem; font-size: 1.0625rem; letter-spacing: 0.22em; text-transform: uppercase; }
.place { margin-top: 0.15rem; font-style: italic; color: var(--ink-soft); }
.countdown {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.3rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 1rem;
  font-style: italic;
}
@keyframes grow { from { opacity: 0; transform: translateY(12px) scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Sezioni */

.panels { padding: 2.25rem 1.25rem 1rem; }
.panel h2 {
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}
.panel h2.later { margin-top: 2.75rem; }
.panel:not([hidden]) { animation: rise 0.4s var(--ease) both; }

.lead { font-size: 1.375rem; line-height: 1.45; margin-bottom: 2.25rem; }
.panel h2 + .lead { margin-top: -0.25rem; }
.note { color: var(--ink-soft); margin-top: 0.75rem; line-height: 1.5; }
.small { font-size: 0.9375rem; }
.center { text-align: center; }

/* Programma: una linea del tempo */
.schedule { list-style: none; margin: 0; padding: 0; position: relative; }
.schedule::before { content: ""; position: absolute; left: 0.45rem; top: 1.1rem; bottom: 1.1rem; width: 1px; background: var(--line); }
.schedule li {
  position: relative;
  display: grid;
  grid-template-columns: 5.25rem 1fr;
  align-items: baseline;
  margin-left: 1.75rem;
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
  background: var(--card);
  box-shadow: 0 1px 0 var(--line);
}
.schedule li + li { margin-top: 0.6rem; }
.schedule li::before {
  content: "";
  position: absolute;
  left: -1.6rem;
  top: 1.3rem;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--slate);
}
.schedule time { font-weight: 600; color: var(--slate); font-variant-numeric: lining-nums tabular-nums; }
.schedule time:not([datetime]) { font-weight: 400; font-style: italic; font-size: 1rem; }
.schedule span { font-size: 1.25rem; }
.schedule small { display: block; color: var(--ink-soft); font-size: 1rem; }

/* Link alle mappe: due pillole con lo spillo */
.maps-hint { margin-top: 1.1rem; font-size: 0.9375rem; color: var(--ink-soft); }
.maps { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.map {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--slate);
  background: var(--slate);
  color: #fff;
  font-size: 1rem;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s var(--ease);
}
.map::before {
  content: "";
  width: 1rem;
  height: 1rem;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 21s-7-6.2-7-11.5A7 7 0 0 1 19 9.5C19 14.8 12 21 12 21Z'/%3E%3Ccircle cx='12' cy='9.5' r='2.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 21s-7-6.2-7-11.5A7 7 0 0 1 19 9.5C19 14.8 12 21 12 21Z'/%3E%3Ccircle cx='12' cy='9.5' r='2.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.map:hover { background: var(--slate-deep); }
.map-ghost { background: transparent; color: var(--slate); }
.map-ghost:hover { background: var(--paper-deep); }
.map:active { transform: scale(0.97); }

/* Dress code: un riquadro con il finale in corsivo */
.card { padding: 1.25rem 1.25rem 1.35rem; border-radius: 1rem; background: var(--card); box-shadow: 0 1px 0 var(--line); font-size: 1.25rem; }
.card-accent { margin-top: 0.25rem; font-style: italic; color: var(--olive); }

/* Rimando al dono, in fondo alle info */
.teaser {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem 1rem;
  align-items: center;
  margin-top: 2.75rem;
  padding: 1.25rem;
  border-radius: 1rem;
  background: var(--slate);
  color: #fff;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s var(--ease);
}
.teaser .label { color: rgba(255, 255, 255, 0.75); grid-column: 1; }
.teaser-text { grid-column: 1; font-size: 1.25rem; line-height: 1.35; }
.teaser-arrow { grid-column: 2; grid-row: 1 / span 2; font-size: 1.5rem; transition: transform 0.2s var(--ease); }
.teaser:hover { background: var(--slate-deep); }
.teaser:hover .teaser-arrow { transform: translateX(4px); }

/* Dono: la fondazione, il pulsante grande e il QR */

.foundation {
  padding: 1.4rem 1.25rem;
  border-radius: 1rem;
  background: var(--card);
  box-shadow: 0 1px 0 var(--line);
}
.foundation h3 { margin: 0.35rem 0 0.6rem; font-size: 1.75rem; line-height: 1.15; }
.foundation p + p { margin-top: 0.75rem; }
.stat { display: flex; align-items: baseline; gap: 0.75rem; padding-top: 0.9rem; border-top: 1px solid var(--line); }
.stat strong { font-size: 2.5rem; font-weight: 400; line-height: 1; color: var(--slate); font-variant-numeric: lining-nums; }
.stat span { color: var(--ink-soft); font-size: 1rem; line-height: 1.35; }
.more { display: inline-block; margin-top: 1rem; color: var(--slate); text-underline-offset: 0.2em; }

.give { margin-top: 0; }
.dono-about { margin-top: 2.25rem; }
.give .btn-ghost { margin-top: 1rem; }

.qr {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1rem;
  align-items: center;
  margin: 1.5rem 0 0;
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 1rem;
}
.qr img { display: block; width: 100%; height: auto; border-radius: 0.5rem; }
.qr figcaption { color: var(--ink-soft); font-size: 1rem; line-height: 1.4; }
.qr .label { margin-bottom: 0.2rem; }

/* Pulsanti */

.btn {
  display: inline-block;
  font: inherit;
  font-size: 1.125rem;
  text-align: center;
  padding: 0.85rem 1.3rem;
  border-radius: 999px;
  border: 1px solid var(--slate);
  background: var(--slate);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s var(--ease);
}
.btn:hover { background: var(--slate-deep); }
.btn:active { transform: scale(0.97); }
.btn-ghost { background: transparent; color: var(--slate); }
.btn-ghost:hover { background: var(--paper-deep); }
.btn-wide { display: block; width: 100%; }

.confirm { margin-top: 0.75rem; font-style: italic; color: var(--slate); text-align: center; animation: rise 0.3s var(--ease) both; }
.confirm:empty { display: none; }

/* Carica foto: un riquadro tratteggiato dove "lasciare" gli scatti */
.upload {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  padding: 2.25rem 1rem;
  border: 1.5px dashed var(--slate);
  border-radius: 1.25rem;
  background: var(--card);
  color: var(--slate);
  font-size: 1.25rem;
  cursor: pointer;
}
.upload::before {
  content: "";
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: var(--slate) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M12 16V5m0 0L7.5 9.5M12 5l4.5 4.5'/%3E%3C/svg%3E") center / 1.4rem no-repeat;
}
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload:focus-within { outline: 2px solid var(--slate); outline-offset: 3px; }
.upload.is-off { opacity: 0.55; cursor: default; }
.upload.is-off input { cursor: default; }

/* Chiusura */
.foot { padding: 2.5rem 1.25rem 1rem; text-align: center; color: var(--ink-soft); }
.foot-mono { font-size: 1.75rem; color: var(--ink); letter-spacing: 0.04em; }
.foot-mono i { font-style: normal; font-size: 1rem; color: var(--mist); }
.foot .small { margin-top: 0.25rem; }

/* Schede in basso: una barra che galleggia, con un indicatore che scivola sotto la scheda aperta */

.tabs {
  --i: 0;
  --n: 3;
  position: fixed;
  left: 50%;
  bottom: calc(0.75rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
  width: min(calc(100% - 1.5rem), 22rem);
  height: var(--tabs-h);
  padding: 0.35rem;
  background: rgba(58, 67, 71, 0.92);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-radius: 999px;
  box-shadow: 0 18px 40px -18px rgba(39, 47, 57, 0.7);
}
.tab-dot {
  position: absolute;
  top: 0.35rem;
  bottom: 0.35rem;
  left: 0.35rem;
  width: calc((100% - 0.7rem) / var(--n));
  border-radius: 999px;
  background: var(--card);
  transform: translateX(calc(var(--i) * 100%));
  transition: transform 0.4s var(--ease);
}
.tabs button {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 0.1rem;
  font: inherit;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
  border: 0;
  border-radius: 999px;
  background: none;
  color: rgba(245, 244, 242, 0.75);
  cursor: pointer;
  touch-action: manipulation;
  transition: color 0.3s;
}
.tab-ico { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tabs button:hover { color: #fff; }
.tabs button[aria-selected="true"] { color: var(--slate); }
.tabs button:focus-visible { outline-color: var(--card); outline-offset: -3px; }

/* Da computer: il sito largo, le schede in alto sotto la copertina, i contenuti affiancati */
@media (min-width: 64rem) {
  .app { max-width: 68rem; padding-bottom: 2rem; }
  .mini { display: none; }
  .top { grid-template-columns: auto auto; column-gap: 4rem; justify-content: center; min-height: min(80vh, 44rem); text-align: left; }
  .branch { height: clamp(20rem, 58vh, 30rem); margin: 0; }
  .names { font-size: clamp(4.5rem, 7vw, 6rem); }
  .names .amp { margin: 0.1em 0 0.05em 0.1em; }
  .tabs { position: sticky; top: 1rem; bottom: auto; left: auto; transform: none; margin: 0 auto; }
  .panels { padding: 3.5rem clamp(2rem, 5vw, 4rem) 2rem; }
  .lead { max-width: 44rem; font-size: 1.5rem; }
  .cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
  .cols > div > h2.later:first-child { margin-top: 0; }
  .cols-dono { align-items: stretch; }
  .dono-give { order: 2; }
  .dono-about { margin-top: 0; }
  .qr { grid-template-columns: 8.5rem 1fr; }
  #foto > * { max-width: 40rem; margin-left: auto; margin-right: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
