/*
Theme Name: Archeo & Arte
Description: Tema su misura per Archeo & Arte Vignola APS. Richiede il plugin "Archeo & Arte – Eventi".
Version: 1.1.0
Requires at least: 6.5
Requires PHP: 8.1
Author: Filippo Garagnani
Text Domain: archeoarte
*/

/* Cormorant Garamond (SIL Open Font License), ospitato in locale: niente richieste a Google Fonts (GDPR). */
@font-face {
  font-family: "Cormorant Garamond";
  src: url("fonts/cormorant-garamond-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("fonts/cormorant-garamond-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  --rosa-chiaro: #fbeaee;
  --rosa: #f2c0cc;
  --rosa-medio: #e3b7c4;
  --rosa-scuro: #9e5f73;
  --prugna: #5b2a3c;
  --testo: #4a2b36;
  --sfondo: #fff7f8;
  --titoli: "Cormorant Garamond", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

body {
  position: relative;   /* riferimento per lo strato dei petali, alto quanto tutta la pagina */
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--testo);
  background: var(--sfondo);
  line-height: 1.6;
}

a { color: var(--rosa-scuro); }

h1, h2, h3 {
  font-family: var(--titoli);
  font-weight: 600;
  line-height: 1.2;
}

/* ---------- Petali (ritagliati dal logo) ---------- */
/* Strato "absolute" su tutta la pagina, non "fixed" sullo schermo: i petali stanno nella pagina
   e scorrono via con il contenuto, invece di restare incollati al vetro mentre si scorre. */
.petali {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.petalo {
  position: absolute;
  top: -40px;
  opacity: .9;
  animation-name: cade;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes cade {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  8%   { opacity: .9; }
  50%  { transform: translate(calc(var(--deriva) * .5), 55vh) rotate(calc(var(--giro) * .5)); }
  92%  { opacity: .9; }
  100% { transform: translate(var(--deriva), 110vh) rotate(var(--giro)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .petali { display: none; } }

/* ---------- Menu ---------- */
.testata { position: relative; z-index: 5; }

.menu { padding: 1rem; }
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu > ul {
  display: flex;
  justify-content: center;
  gap: .5rem 2rem;
  flex-wrap: wrap;
}
.menu a {
  display: block;
  padding: .5rem .25rem;
  color: var(--prugna);
  text-decoration: none;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-size: .85rem;
}
.menu a:hover, .menu a:focus-visible, .menu a[aria-current] {
  color: var(--rosa-scuro);
  text-decoration: underline;
  text-underline-offset: 6px;
}
.ha-sottomenu { position: relative; display: flex; align-items: center; }
.sotto-toggle {
  border: 0;
  background: none;
  color: var(--prugna);
  font: inherit;
  font-size: .8rem;
  padding: .5rem .3rem;
  cursor: pointer;
}
.sotto-toggle span { display: inline-block; transition: transform .2s; }
.sotto-toggle[aria-expanded="true"] span { transform: rotate(180deg); }
.sottomenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  min-width: 9rem;
  background: rgba(255, 247, 248, .96);
  border-radius: .5rem;
  box-shadow: 0 4px 16px rgba(91, 42, 60, .15);
  padding: .25rem .5rem;
  text-align: center;
}
/* Mouse: si apre al passaggio. Tocco e tastiera: si apre con la freccia (sito.js). */
@media (hover: hover) { .ha-sottomenu:hover .sottomenu { display: block; } }
.ha-sottomenu.aperto .sottomenu { display: block; }
.menu-toggle, .hamburger { display: none; }

/* ---------- HOME: una sola schermata ---------- */
body.home {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background:
    /* velo rosa morbido solo al centro, dietro logo e titolo: il dipinto resta vivo ai bordi */
    radial-gradient(ellipse 34rem 26rem at 50% 46%, rgba(255, 244, 247, .78) 0%, rgba(255, 244, 247, .45) 55%, rgba(255, 244, 247, 0) 100%),
    linear-gradient(180deg, rgba(255, 240, 244, .45) 0%, rgba(245, 200, 213, .25) 55%, rgba(255, 247, 248, .75) 100%),
    url("img/morisot-hero.webp") 35% center / cover no-repeat fixed;
}

.hero-contenuto {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
}
.logo { width: min(40vw, 230px); height: auto; margin: 0 auto .8rem; display: block; }
.hero-contenuto h1 {
  margin: 0;
  font-size: clamp(2.3rem, 6vw, 4rem);
  letter-spacing: .03em;
  color: var(--prugna);
}
.sottotitolo {
  margin: .4rem 0 1.4rem;
  color: var(--prugna);
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .85rem;
}
.bottone {
  display: inline-block;
  padding: .8rem 2rem;
  background: var(--prugna);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  letter-spacing: .08em;
}
.bottone:hover, .bottone:focus-visible { background: var(--rosa-scuro); }
.bottone-chiaro {
  background: transparent;
  color: var(--prugna);
  border: 1px solid var(--prugna);
}
.bottone-chiaro:hover, .bottone-chiaro:focus-visible { background: var(--prugna); color: #fff; }

.fascia {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  width: min(60rem, 100% - 2rem);
  margin: 0 auto 1rem;
}
.pannello {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: 1rem 1.2rem;
  background: rgba(255, 247, 248, .78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: .75rem;
  color: var(--testo);
  text-decoration: none;
}
a.pannello:hover, a.pannello:focus-visible { background: rgba(255, 247, 248, .92); }
.etichetta {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .72rem;
  color: var(--rosa-scuro);
}
.quando { font-size: .9rem; }
.cf {
  font-size: 1.15rem;
  letter-spacing: .1em;
  user-select: all;
}

.piede {
  position: relative;
  z-index: 2;
  padding: .6rem 1rem 1rem;
  text-align: center;
  font-size: .8rem;
  color: var(--prugna);
}
.piede p { margin: .1rem 0; }
.piede a { color: inherit; }
.credito { font-size: .7rem; opacity: .8; }

/* ---------- PAGINE INTERNE ---------- */
/* Stesso banner su tutte le pagine: lo stesso dipinto della Home (già in cache), sempre la stessa inquadratura. */
.banner {
  position: relative;
  /* Sopra .contenuto (z-index 2): il menu a tutto schermo vive dentro il banner
     e, se il banner stesse allo stesso livello, il contenuto lo coprirebbe. */
  z-index: 5;
  min-height: 34vh;
  min-height: max(260px, 34svh);
  display: flex;
  flex-direction: column;
  background:
    /* velo dietro il titolo, come in Home */
    radial-gradient(ellipse 26rem 7rem at 50% 58%, rgba(255, 244, 247, .8) 0%, rgba(255, 244, 247, 0) 100%),
    linear-gradient(180deg, rgba(255, 240, 244, .55) 0%, rgba(245, 200, 213, .35) 60%, rgba(255, 247, 248, 1) 100%),
    url("img/morisot-hero.webp") center 6% / cover no-repeat;
}
.banner h1 {
  margin: auto;
  padding: 1rem 1rem 2.5rem;
  text-align: center;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  letter-spacing: .04em;
  color: var(--prugna);
  text-shadow: 0 0 24px rgba(255, 244, 247, .9);
}

.contenuto {
  position: relative;
  z-index: 2;
  max-width: 52rem;
  margin: 0 auto;
  padding: 2.5rem 1rem 3.5rem;
}
.contenuto h2 { color: var(--prugna); letter-spacing: .02em; font-size: 1.9rem; margin: 2rem 0 .5rem; }
.contenuto h2:first-child { margin-top: 0; }

.elenco-eventi { display: grid; gap: 1.25rem; margin: 0 0 2rem; }
.evento {
  display: grid;
  grid-template-columns: 13rem 1fr;
  gap: 1.4rem;
  /* semitrasparente: i petali (dietro al contenuto) si vedono passare sotto le schede.
     Niente backdrop-filter: con molte schede e i petali animati rallenterebbe i telefoni economici. */
  background: linear-gradient(160deg, rgba(255, 255, 255, .62), rgba(251, 234, 238, .5));
  border: 1px solid rgba(227, 183, 196, .8);
  border-radius: .75rem;
  padding: 1.2rem;
  box-shadow: 0 2px 14px rgba(91, 42, 60, .05);
}
.evento-img {
  margin: 0;
  aspect-ratio: 4 / 3;
  border-radius: .5rem;
  overflow: hidden;
  background: linear-gradient(135deg, var(--rosa-chiaro), var(--rosa));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rosa-scuro);
  font-size: .85rem;
}
.evento-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.evento .etichetta { margin: 0; }
.contenuto .evento h2 { margin: .15rem 0 .2rem; font-size: 1.6rem; }
.evento p { margin: .2rem 0; }
.luogo { font-style: italic; }
.nota { font-size: .9rem; opacity: .85; }
.centro { text-align: center; }
.vuoto {
  padding: 2.5rem 1.5rem;
  text-align: center;
  border: 1px dashed var(--rosa-medio);
  border-radius: .75rem;
}

.piede-scuro {
  position: relative;
  z-index: 2;
  padding: 2rem 1rem;
  text-align: center;
  background: var(--prugna);
  color: #f7dfe5;
  font-size: .9rem;
}
.piede-scuro p { margin: .3rem 0; }
.piede-scuro a { color: #f7dfe5; }
.piede-scuro .credito { color: #f7dfe5; }

.riquadro-5x1000 {
  margin-top: 2.5rem;
  padding: 1.5rem;
  text-align: center;
  background: linear-gradient(135deg, var(--rosa-chiaro), var(--rosa));
  border-radius: .75rem;
}
.contenuto .riquadro-5x1000 h2 { margin-top: 0; }

/* ---------- Icone informazioni ---------- */
.info-contatti { list-style: none; margin: 1rem 0 1.5rem; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.info-contatti li, .elenco-icone li { display: flex; align-items: center; gap: .9rem; }
.icona {
  flex: none;
  width: 2.8rem; height: 2.8rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--rosa-chiaro), var(--rosa));
  color: var(--prugna);
}
.icona svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.elenco-icone { list-style: none; padding: 0; display: grid; gap: 1rem; }
/* Iscriviti: modi di pagamento (l'icona resta in alto quando il testo va su più righe) */
.pagamenti li { align-items: flex-start; }
.consigliato {
  margin-left: .4rem; padding: .1rem .6rem; border-radius: 999px; vertical-align: .1em;
  font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  background: var(--prugna); color: #fff;
}
.iban {
  display: block; width: fit-content; margin: .5rem 0; padding: .5rem .9rem;
  border: 1px solid var(--rosa-medio); border-radius: .6rem; background: rgba(255, 255, 255, .7);
}
.iban .etichetta { display: block; }
.iban .cf { font-variant-numeric: tabular-nums; font-size: clamp(.95rem, 3.6vw, 1.15rem); letter-spacing: .06em; }
.segnaposto-inline { font-style: italic; opacity: .7; }
.mappa { border-radius: .75rem; overflow: hidden; }
.mappa:not(.caricata) { padding: 1.5rem; text-align: center; background: var(--rosa-chiaro); border: 1px dashed var(--rosa-medio); }
.mappa p { margin: .4rem 0; }
.mappa button { font: inherit; cursor: pointer; margin-right: 1rem; }
.mappa iframe { display: block; width: 100%; height: 22rem; border: 0; }

/* ---------- Informativa prima del download ---------- */
#informativa {
  max-width: min(38rem, 100% - 2rem);
  max-height: 90vh;
  padding: 1.5rem;
  border: 1px solid var(--rosa-medio);
  border-radius: .75rem;
  background: var(--sfondo);
  color: var(--testo);
}
#informativa::backdrop { background: rgba(91, 42, 60, .45); }
#informativa h2 { margin: 0 0 .5rem; font-size: 1.6rem; color: var(--prugna); }
#informativa .bottone { margin: .25rem; font: inherit; cursor: pointer; }

.segnaposto {
  padding: 1.5rem;
  text-align: center;
  background: var(--rosa-chiaro);
  border: 1px dashed var(--rosa-medio);
  border-radius: .75rem;
}

/* ---------- Schede: link alla pagina dell'evento ---------- */
.evento h2 a { color: inherit; text-decoration: none; }
.evento h2 a:hover, .evento h2 a:focus-visible { text-decoration: underline; text-underline-offset: 4px; }
.evento-img a { display: block; width: 100%; height: 100%; }
.evento-img img.predefinita { object-fit: contain; padding: 1.2rem; }
.leggi { font-size: .9rem; letter-spacing: .04em; }

/* ---------- Pagina di un evento ---------- */
.banner h1.h1-lungo { font-size: clamp(1.8rem, 4.4vw, 2.9rem); max-width: 48rem; }
.evento-pagina > .etichetta { margin: 0 0 .2rem; }
.evento-pagina > .etichetta a { color: inherit; }
.evento-pagina > .luogo { margin: 0 0 1.5rem; font-size: 1.1rem; }
.copertina { margin: 0 0 2rem; }
.copertina img { display: block; width: 100%; max-height: 32rem; object-fit: cover; border-radius: .75rem; }
.copertina.intera img { width: auto; max-width: 100%; height: auto; max-height: none; margin: 0 auto; cursor: zoom-in; }
.testo-evento { font-size: 1.05rem; }
.testo-evento p { margin: 0 0 1rem; }
.contenuto .testo-evento h2 { font-size: 1.7rem; margin: 2rem 0 .75rem; }
.contenuto .testo-evento h3 { font-size: 1.35rem; color: var(--prugna); margin: 1.5rem 0 .5rem; }
.testo-evento .occhiello { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; color: var(--rosa-scuro); }
.testo-evento figure { margin: 1.5rem 0; }
.testo-evento figure img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: .5rem; }
.testo-evento figcaption { margin-top: .4rem; text-align: center; font-size: .9rem; font-style: italic; opacity: .85; }

.condividi {
  margin: 2.5rem 0 2rem; padding: 1.4rem 1.2rem; text-align: center;
  background: rgba(251, 234, 238, .6); border: 1px solid rgba(227, 183, 196, .8); border-radius: .75rem;
}
.contenuto .condividi h2 { margin: 0 0 .8rem; font-size: 1.5rem; }
.condividi p { margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }
.condividi button.bottone { font: inherit; cursor: pointer; }
.condividi [hidden] { display: none; }
.condividi-link { display: inline-flex; align-items: center; gap: .5rem; }
.condividi-link svg {
  width: 1.15em; height: 1.15em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.condividi-link svg .pieno { fill: currentColor; stroke: none; }


/* ---------- Mobile ---------- */
@media (max-width: 700px) {
  .fascia { grid-template-columns: 1fr; gap: .6rem; }
  .pannello { padding: .75rem 1rem; }

  /* iOS gestisce male lo sfondo fisso: sulla Home lo teniamo scorrevole */
  body.home { background-attachment: scroll; }

  .info-contatti { grid-template-columns: 1fr; }
  .evento { grid-template-columns: 1fr; gap: .9rem; padding: 1rem; }
  .evento-img { aspect-ratio: 16 / 9; }

  .hamburger {
    display: block;
    position: absolute;
    top: .75rem; right: .75rem;
    z-index: 7;
    width: 48px; height: 48px;
    cursor: pointer;
    background: rgba(255, 247, 248, .85);
    border-radius: 50%;
  }
  .hamburger span, .hamburger span::before, .hamburger span::after {
    content: "";
    position: absolute;
    left: 14px;
    width: 20px; height: 2px;
    background: var(--prugna);
  }
  .hamburger span { top: 23px; }
  .hamburger span::before { left: 0; top: -7px; }
  .hamburger span::after  { left: 0; top: 7px; }

  .menu-toggle {
    display: block;
    position: absolute;
    top: .75rem; right: .75rem;
    z-index: 8;
    width: 48px; height: 48px;
    opacity: 0;
    cursor: pointer;
  }
  .menu {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255, 240, 244, .97);
    padding: 5rem 1.5rem 2rem;
    z-index: 6;
  }
  .menu-toggle:checked ~ .menu { display: block; }
  .menu > ul { flex-direction: column; align-items: center; gap: .5rem; }
  .menu a { font-size: 1.1rem; padding: .7rem; }

  /* Nel menu a tutto schermo la sotto-voce Iscriviti è sempre visibile */
  .ha-sottomenu { flex-direction: column; }
  .sotto-toggle { display: none; }
  .sottomenu {
    display: block;
    position: static;
    transform: none;
    box-shadow: none;
    background: none;
    padding: 0;
  }
  .sottomenu a { font-size: .95rem; text-transform: none; letter-spacing: .04em; }
}
