/* === Variabili CSS principali === */
:root {
  /* Tipografia */
  --font-main: "Georgia", serif;
  --font-sans: "Helvetica Neue", Arial, sans-serif;

  /* Colori base */
  --color-white: #fff;
  --color-bg: #fff;
  --color-text: #222;
  --color-muted: #555;

  /* Brand / Accenti */
  --color-accent: #d4a373;
  --color-accent-dark: #a15c2f;
  --color-anchor-hash: rgba(161, 92, 47, 0.55); /* accent dark ma 55% opaco */

  /* Stati / UI */
  --color-success: #45a049;
  --color-overlay: rgba(0, 0, 0, 0.55);
  --color-border: #ddd;
  --color-divider: #dfbe97; /* tratteggio righe IBAN */
  --color-card: #fafafa; /* sfondo card */
  --color-note: #fff3cc; /* hover copy */

  /* Riquadri & ombre */
  --box-radius: 10px;
  --box-shadow-soft: 0 0 10px rgba(0, 0, 0, 0.07);

  /* Layout & dimensioni */
  --container-max: 820px;
  --gap: 1rem;
  --touch-target: 44px;

  /* Icone */
  --icon-size: 1.15em;
  --icon-size-sm: 1em;

  /* Transizioni */
  --transition-fast: 0.18s;
  --transition-base: 0.3s;
  --fade-duration: 0.6s;
}

/* === Reset e tipografia === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.65;
  min-height: 100vh;
}

/* Numeri allineati dove servono (IBAN, orari) */
.iban-card,
.time,
.address {
  font-variant-numeric: tabular-nums;
}

/* Layout 2-col responsive: indirizzo + bottone */
.location-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--gap); /* spazio tra testo e bottone */
  flex-wrap: wrap; /* su mobile va a capo */
  margin-bottom: 0.8rem; /* stacco coerente dalla mappa sottostante */
}

/* Azzeriamo margini interni ai <p> del wrapper per non gonfiare lo spacing */
.location-actions .location,
.location-actions .actions {
  margin: 0;
}

/* Bottone: allineamento e area di tap accessibile */
.location-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: var(--touch-target); /* target touch-friendly */
  margin-top: 0; /* niente extra spacing sopra */
}

/* (Facoltativo) dimensione icona nel bottone, uniforme */
.location-actions .btn .icon-tabler {
  width: 1.1em;
  height: 1.1em;
}

/* Mobile: bottone a tutta larghezza, centrato */
@media (max-width: 640px) {
  .location-actions .actions {
    width: 100%;
  }
  .location-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* === Hero section === */
.hero {
  background-image: url("../img/madonna-del-carmine-luino-3.webp");
  background-size: cover;
  background-position: center;
  height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  background-color: var(--color-accent) !important; /* test */
}
.hero .overlay {
  background: var(--color-overlay); /* colore semitrasparente */
  backdrop-filter: blur(2px); /* sfocatura dietro al box */
  color: var(--color-white);
  padding: 2rem 1.5rem;
  border-radius: var(--box-radius);
  display: inline-block;
  margin: 0 auto;
}
.hero h1 {
  font-family: var(--font-main);
  font-size: 3rem;
  margin-bottom: 0.5rem;
  letter-spacing: 2px;
}

/* === Bottone === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--color-accent);
  color: var(--color-white);
  text-decoration: none;
  border: none;
  border-radius: 4px;
  font-size: 1.08rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-base);
}
.btn:hover {
  background: var(--color-accent-dark);
}
.btn .icon-tabler {
  color: var(--color-white);
}

/* === Tabler icon stile globale === */
.icon-tabler {
  width: var(--icon-size);
  height: var(--icon-size);
  min-width: var(--icon-size);
  min-height: var(--icon-size);
  color: var(--color-accent-dark);
  stroke-width: 1.5;
  vertical-align: middle;
  display: inline-block;
  stroke: currentColor;
  transition: color 0.2s;
}
.icon-tabler.icon-check {
  color: var(--color-success);
  stroke: var(--color-success);
}

/* Variante per bottoni e icone bianche */
.btn .icon-tabler,
.scroll-down .icon-tabler {
  color: var(--color-white);
  stroke: var(--color-white);
}

/* === Scroll Down === */
.scroll-down {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}
.scroll-down .arrow {
  width: 44px;
  height: 44px;
  stroke: var(--color-white);
  animation: arrow-breathe 2s infinite ease-in-out;
}
@keyframes arrow-breathe {
  0%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(10px);
  }
}

/* === Main/Sections === */
main {
  padding: 2rem 1rem;
  max-width: var(--container-max);
  margin: 0 auto;
}
section {
  margin-bottom: 3.5rem;
}
h2 {
  font-family: var(--font-main);
  margin-bottom: 1.2rem;
  font-size: 1.65rem;
  display: flex;
  align-items: center;
  gap: 0.6em;
}

/* === Mappe embed === */
.map-container {
  border: 1px solid var(--color-border);
  border-radius: var(--box-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow-soft);
  margin: 1.2em 0;
  line-height: 0; /* azzera la riga */
}
.map-container iframe {
  display: block; /* niente baseline */
}

/* === Alpaca IMG sez regalo === */
.gift-image-container {
  border: 1px solid var(--color-border);
  border-radius: var(--box-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow-soft);
  margin: 1.2em 0;
  line-height: 0; /* azzera la riga */
}
.gift-image {
  max-width: 100%;
  height: auto;
  border-radius: var(--box-radius);
  box-shadow: var(--box-shadow-soft);
}

/* === IBAN box e copy === */
.iban-card {
  background: var(--color-card);
  border-radius: var(--box-radius);
  border-left: 4px solid var(--color-accent);
  padding: 1.6em 1.4em;
  margin: 1.2em 0;
  overflow: hidden;
  box-shadow: var(--box-shadow-soft);
  width: 100%;
}
.iban-row {
  display: flex;
  align-items: center;
  gap: 0.6em;
  padding-top: 0.3em;
  padding-bottom: 0.05em;
}
.iban-row-iban {
  border-bottom: 1px dashed var(--color-divider);
}
.iban-row-intest {
  border-bottom: 1px dashed var(--color-divider);
  margin-bottom: 0;
}
.iban-label {
  font-weight: bold;
  color: var(--color-text);
  min-width: 82px;
  margin-right: 0.2em;
}
.copyable {
  background: none;
  padding: 0.13em 0.3em;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.22s;
  display: inline-flex;
  align-items: center;
}
.copyable:hover {
  background: var(--color-note);
}
.icon-tabler {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
  color: var(--color-accent-dark);
  vertical-align: middle;
}
.icon-tabler-chevrons-down {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
  font-size: 4em; /* cambia questo valore per ridimensionare l’icona */
}
.icon-check {
  color: var(--color-success);
}
.dotted-link {
  color: var(--color-accent-dark);
  background: none;
  border: none;
  border-radius: 2px;
  padding: 0 0.1em;
  text-decoration: underline dotted var(--color-accent);
  font-family: var(--font-sans);
  font-weight: 500;
  transition: color 0.2s;
  cursor: pointer;
}
.dotted-link:hover,
.dotted-link:focus {
  color: var(--color-accent);
  text-decoration: underline solid var(--color-accent);
}

/* Hint icona copy/check */
.copy-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.12em;
  margin-left: 0.2em;
}
.copyable .icon-copy,
.copyable .icon-check {
  pointer-events: none;
  opacity: 0.7;
}
.copyable:hover .icon-copy {
  opacity: 1;
}
.copyable .icon-check {
  color: var(--color-success);
  opacity: 1 !important;
}

/* Utils */
.hidden {
  display: none !important;
}

/* === Fade per conferma copia e altri overlay === */
.fade {
  opacity: 0;
  transition: opacity var(--fade-duration);
}
.fade.visible {
  opacity: 1;
}

/* === Conferma Copiato (resta solo per fallback) === */
.copy-confirm {
  font-size: 0.97em;
  color: var(--color-success);
  margin-left: 0.5em;
  font-weight: 500;
  vertical-align: middle;
}
.copy-confirm .icon-tabler {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
}

/* === Footer e copia mail === */
footer {
  text-align: center;
  font-size: 1rem;
  padding: 1.2rem;
  background: var(
    --color-footer-bg,
    #f7f7f7
  ); /* fallback nel caso la var non esista */
  color: var(--color-muted);
  margin-top: 2rem;
  letter-spacing: 0.01em;
}
.mail-link {
  color: var(--color-accent-dark);
  background: none;
  border: none;
  border-radius: 2px;
  padding: 0 0.1em;
  margin-right: 0.18em;
  text-decoration: underline dotted;
  font-family: var(--font-sans);
  font-weight: 500;
  transition: color 0.2s;
}
.mail-link:hover,
.mail-link:focus {
  color: var(--color-accent);
  text-decoration: underline solid;
}
.copy-mail-btn {
  background: none;
  border: none;
  cursor: pointer;
  vertical-align: middle;
  padding: 0 0.1em;
  outline: none;
}
.copy-mail-btn .icon-tabler {
  width: var(--icon-size-sm);
  height: var(--icon-size-sm);
  vertical-align: middle;
  transition: opacity var(--transition-fast);
}
.copy-mail-btn .icon-check {
  color: var(--color-success);
}

/* === Responsive === */
@media (max-width: 600px) {
  .hero h1 {
    font-size: 2.1rem;
  }
  main {
    padding: 1.3rem 0.3rem;
  }
  h2 {
    font-size: 1.1rem;
  }
  .map-container {
    height: 220px;
  }
}

/* === Fade in sezioni === */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s cubic-bezier(0.65, 0, 0.35, 1),
    transform 1s cubic-bezier(0.65, 0, 0.35, 1);
  will-change: opacity, transform;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* === Section ID # per H2 (anchor visibile al passaggio) === */
section[id] h2 {
  position: relative; /* per posizionare il # assoluto */
}
.anchor-hash {
  position: absolute;
  left: -1.2em; /* distanza dal testo */
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9em;
  color: var(--color-anchor-hash);
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  cursor: pointer;
}
section[id] h2:hover .anchor-hash {
  opacity: 1;
}
.hash-feedback {
  opacity: 1;
  transition: opacity var(--fade-duration) ease;
}
.hash-feedback.fade-out {
  opacity: 0;
}
