/*************************************************************************************************/
/* WUD BZ 2026 — tema per iA Presenter                                                          */
/* Colori e font da wud-bz.it/2026: blu di pagina, Space Grotesk per i titoli, Google Sans Flex */
/* per il testo. Font variabili nella cartella fonts/ (licenza OFL).                             */
/*************************************************************************************************/

/* FONT */
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('fonts/SpaceGrotesk-Variable.ttf') format('truetype');
}
@font-face {
  font-family: 'Google Sans Flex';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 25% 151%;
  font-display: swap;
  src: url('fonts/GoogleSansFlex-Variable.ttf') format('truetype');
}

:root {
  /* palette WUD (da :root di wud-bz.it) */
  --wud-page: #4166ff;
  --wud-ink: #202280;
  --wud-navy: #2e3192;
  --wud-white: #fcfcfc;
  --wud-paper: #f5f7ff;
  --wud-black: #000000;
  --wud-grey: #cfcfcf;
  --wud-yellow: #ffa600;
  --wud-salmon: #ff668a;
  --wud-teal: #019a85;
  --wud-sky: #a2cbff;
  --wud-sand: #c2b49a;

  /* codice: blocchi chiari e scuri */
  --code-background: #eeeeee;
  --code-border: rgba(0, 0, 0, 0.05);
  --code-text: #202280;
  --dark-code-background: #202280;
  --dark-code-border: rgba(252, 252, 252, 0.12);
  --dark-code-text: #fcfcfc;
}

/* add below your custom Theme CSS */
/*************************************************************************************************/
/* TYPOGRAPHY   */


/* Font Size */
section > :not([class*="layout-"]) h1,
[class*="layout-"] > div h1 {
  line-height: 1;
  font-size: 2.986em;
}
section > :not([class*="layout-"]) h2,
[class*="layout-"] > div h2 {
  line-height: 1.1;
  font-size: 2.488em;
}
section > :not([class*="layout-"]) h3,
[class*="layout-"] > div h3 {
  line-height: 1.2;
  font-size: 1.728em;
}
section > :not([class*="layout-"]) h5,
[class*="layout-"] > div h5 {
  font-weight: 300;
}
section > :not([class*="layout-"]) h6,
[class*="layout-"] > div h6 {
  font-size: 1em;
  line-height: 1.4;
}

.layout-title > :not([class*="layout-"]) > h1 + h2,
.layout-cover > :not([class*="layout-"]) > h1 + h2,
.layout-caption > :not([class*="layout-"]) > h1 + h2,
.layout-title-image > :not([class*="layout-"]) > h1 + h2,
.layout-section > :not([class*="layout-"]) > h1 + h2:nth-child(2):last-child,
.layout-default > :not([class*="layout-"]) > h1 + h2:nth-child(2):last-child,
.layout-title > :not([class*="layout-"]) > h2 + h3,
.layout-cover > :not([class*="layout-"]) > h2 + h3,
.layout-caption > :not([class*="layout-"]) > h2 + h3,
.layout-title-image > :not([class*="layout-"]) > h2 + h3,
.layout-section > :not([class*="layout-"]) > h2 + h3:nth-child(2):last-child,
.layout-default > :not([class*="layout-"]) > h2 + h3:nth-child(2):last-child,
.layout-title > :not([class*="layout-"]) > h3 + h4,
.layout-cover > :not([class*="layout-"]) > h3 + h4,
.layout-caption > :not([class*="layout-"]) > h3 + h4,
.layout-title-image > :not([class*="layout-"]) > h3 + h4,
.layout-section > :not([class*="layout-"]) > h3 + h4:nth-child(2):last-child,
.layout-default > :not([class*="layout-"]) > h3 + h4:nth-child(2):last-child,
.layout-title > :not([class*="layout-"]) > h3 + h5,
.layout-cover > :not([class*="layout-"]) > h3 + h5,
.layout-caption > :not([class*="layout-"]) > h3 + h5,
.layout-title-image > :not([class*="layout-"]) > h3 + h5,
.layout-section > :not([class*="layout-"]) > h3 + h5:nth-child(2):last-child,
.layout-default > :not([class*="layout-"]) > h3 + h5:nth-child(2):last-child,
.layout-title > :not([class*="layout-"]) > h4 + h6,
.layout-cover > :not([class*="layout-"]) > h4 + h6,
.layout-caption > :not([class*="layout-"]) > h4 + h6,
.layout-title-image > :not([class*="layout-"]) > h4 + h6,
.layout-section > :not([class*="layout-"]) > h4 + h6:nth-child(2):last-child,
.layout-default > :not([class*="layout-"]) > h4 + h6:nth-child(2):last-child,
.layout-title > :not([class*="layout-"]) > h5 + h6,
.layout-cover > :not([class*="layout-"]) > h5 + h6,
.layout-caption > :not([class*="layout-"]) > h5 + h6,
.layout-title-image > :not([class*="layout-"]) > h5 + h6,
.layout-section > :not([class*="layout-"]) > h5 + h6:nth-child(2):last-child,
.layout-default > :not([class*="layout-"]) > h5 + h6:nth-child(2):last-child,
.layout-title > :not([class*="layout-"]) > h3 + p,
.layout-cover > :not([class*="layout-"]) > h3 + p,
.layout-caption > :not([class*="layout-"]) > h3 + p,
.layout-title-image > :not([class*="layout-"]) > h3 + p,
.layout-section > :not([class*="layout-"]) > h3 + p:nth-child(2):last-child,
.layout-default > :not([class*="layout-"]) > h3 + p:nth-child(2):last-child {
  margin-top: 0.1em;
}
.layout-title > :not([class*="layout-"]) > h1 + h3,
.layout-cover > :not([class*="layout-"]) > h1 + h3,
.layout-caption > :not([class*="layout-"]) > h1 + h3,
.layout-title-image > :not([class*="layout-"]) > h1 + h3,
.layout-section > :not([class*="layout-"]) > h1 + h3:nth-child(2):last-child,
.layout-default > :not([class*="layout-"]) > h1 + h3:nth-child(2):last-child,
.layout-title > :not([class*="layout-"]) > h2 + h4,
.layout-cover > :not([class*="layout-"]) > h2 + h4,
.layout-caption > :not([class*="layout-"]) > h2 + h4,
.layout-title-image > :not([class*="layout-"]) > h2 + h4,
.layout-section > :not([class*="layout-"]) > h2 + h4:nth-child(2):last-child,
.layout-default > :not([class*="layout-"]) > h2 + h4:nth-child(2):last-child,
.layout-title > :not([class*="layout-"]) > h2 + h5,
.layout-cover > :not([class*="layout-"]) > h2 + h5,
.layout-caption > :not([class*="layout-"]) > h2 + h5,
.layout-title-image > :not([class*="layout-"]) > h2 + h5,
.layout-section > :not([class*="layout-"]) > h2 + h5:nth-child(2):last-child,
.layout-default > :not([class*="layout-"]) > h2 + h5:nth-child(2):last-child,
.layout-title > :not([class*="layout-"]) > h3 + h6,
.layout-cover > :not([class*="layout-"]) > h3 + h6,
.layout-caption > :not([class*="layout-"]) > h3 + h6,
.layout-title-image > :not([class*="layout-"]) > h3 + h6,
.layout-section > :not([class*="layout-"]) > h3 + h6:nth-child(2):last-child,
.layout-default > :not([class*="layout-"]) > h3 + h6:nth-child(2):last-child,
.layout-title > :not([class*="layout-"]) > h2 + p,
.layout-cover > :not([class*="layout-"]) > h2 + p,
.layout-caption > :not([class*="layout-"]) > h2 + p,
.layout-title-image > :not([class*="layout-"]) > h2 + p,
.layout-section > :not([class*="layout-"]) > h2 + p:nth-child(2):last-child,
.layout-default > :not([class*="layout-"]) > h2 + p:nth-child(2):last-child {
  margin-top: 0.2em;
}
.layout-title > :not([class*="layout-"]) > h1 + h4,
.layout-cover > :not([class*="layout-"]) > h1 + h4,
.layout-caption > :not([class*="layout-"]) > h1 + h4,
.layout-title-image > :not([class*="layout-"]) > h1 + h4,
.layout-section > :not([class*="layout-"]) > h1 + h5:nth-child(2):last-child,
.layout-default > :not([class*="layout-"]) > h1 + h5:nth-child(2):last-child,
.layout-title > :not([class*="layout-"]) > h1 + h5,
.layout-cover > :not([class*="layout-"]) > h1 + h5,
.layout-caption > :not([class*="layout-"]) > h1 + h5,
.layout-title-image > :not([class*="layout-"]) > h1 + h5,
.layout-section > :not([class*="layout-"]) > h1 + h5:nth-child(2):last-child,
.layout-default > :not([class*="layout-"]) > h1 + h5:nth-child(2):last-child,
.layout-title > :not([class*="layout-"]) > h2 + h6,
.layout-cover > :not([class*="layout-"]) > h2 + h6,
.layout-caption > :not([class*="layout-"]) > h2 + h6,
.layout-title-image > :not([class*="layout-"]) > h2 + h6,
.layout-section > :not([class*="layout-"]) > h2 + h6:nth-child(2):last-child,
.layout-default > :not([class*="layout-"]) > h2 + h6:nth-child(2):last-child,
.layout-title > :not([class*="layout-"]) > h1 + p,
.layout-cover > :not([class*="layout-"]) > h1 + p,
.layout-caption > :not([class*="layout-"]) > h1 + p,
.layout-title-image > :not([class*="layout-"]) > h1 + p,
.layout-section > :not([class*="layout-"]) > h1 + p:nth-child(2):last-child,
.layout-default > :not([class*="layout-"]) > h1 + p:nth-child(2):last-child {
  margin-top: 0.3em;
}
.layout-title > :not([class*="layout-"]) > h1 + h6,
.layout-cover > :not([class*="layout-"]) > h1 + h6,
.layout-caption > :not([class*="layout-"]) > h1 + h6,
.layout-title-image > :not([class*="layout-"]) > h1 + h6,
.layout-section > :not([class*="layout-"]) > h1 + h6:nth-child(2):last-child,
.layout-default > :not([class*="layout-"]) > h1 + h6:nth-child(2):last-child {
  margin-top: 0.4em;
}

@media (max-width: 639px) {
  section > :not([class*="layout-"]) h1,
  [class*="layout-"] > div h1 {
    line-height: 1;
    font-size: 2.074em;
  }
  section > :not([class*="layout-"]) h2,
  [class*="layout-"] > div h2 {
    line-height: 1.1;
    font-size: 1.728em;
  }
  section > :not([class*="layout-"]) h3,
  [class*="layout-"] > div h3 {
    line-height: 1.2;
    font-size: 1.44em;
  }
  section > :not([class*="layout-"]) h5,
  [class*="layout-"] > div h5 {
    font-weight: normal;
  }
  section > :not([class*="layout-"]) h6,
  [class*="layout-"] > div h6 {
    font-size: 1em;
    line-height: 1.4;
  }
}


/*************************************************************************************************/
/* WUD: REGOLE DEL TEMA                                                                          */
/* Logica colori: tutte le slide nascono blu (preset scuro). I layout di testo passano su carta  */
/* chiara via CSS, tranne quando contengono un h1 (copertina) o un'immagine di sfondo.           */
/*************************************************************************************************/

/* Variabili di ruolo: valori per le slide blu */
section {
  --wud-text: var(--wud-white);
  --wud-title: var(--wud-white);
  --wud-lead: var(--wud-white);
  --wud-label: var(--wud-yellow);
  --wud-marker: var(--wud-yellow);
  --wud-underline: var(--wud-sky);
  --wud-rule: rgba(252, 252, 252, 0.35);
  --graph-data-0: #ffa600;
  --graph-data-1: #ff668a;
  --graph-data-2: #019a85;
  --graph-data-3: #a2cbff;
  --graph-data-4: #c2b49a;
  --graph-data-5: #fcfcfc;
  --graph-data-6: #2e3192;
  --graph-data-7: #cfcfcf;
}

/* Slide di testo: carta chiara, inchiostro, accenti blu */
section:is(.default-container, .caption-container, .v-split-container, .grid-container, .columns-container, .title-and-columns-container, .title-image-container, .full-image-container):not(:has(h1)),
section.has-background-image {
  --wud-text: var(--wud-ink);
  --wud-title: var(--wud-ink);
  --wud-lead: var(--wud-page);
  --wud-label: var(--wud-page);
  --wud-marker: var(--wud-page);
  --wud-underline: var(--wud-page);
  --wud-rule: rgba(32, 34, 128, 0.25);
  --graph-data-5: #202280;
  --graph-data-7: #637378;
}
section:is(.default-container, .caption-container, .v-split-container, .grid-container, .columns-container, .title-and-columns-container, .title-image-container, .full-image-container):not(:has(h1)):not(.has-background-image) {
  background-color: var(--wud-paper);
}

/* Colore del testo e dei titoli secondo il ruolo */
section:is(.dark, .light) [class*='layout-'] > div,
section:is(.dark, .light) [class*='layout-'] > div :is(p, li, td, th, caption, blockquote, figcaption, strong, em, b, i, code),
section:is(.dark, .light) .footnotes,
section:is(.dark, .light) .footnotes :is(li, p, a),
section:is(.dark, .light) :is(.header, .footer),
section:is(.dark, .light) :is(.header, .footer) > div {
  color: var(--wud-text);
}
section:is(.dark, .light) [class*='layout-'] > div :is(h1, h2, h3, h4, h5, h6) {
  color: var(--wud-title);
}
section:not(.has-background-image):is(.dark, .light) :is(.header, .footer) {
  background: transparent;
}

/* Titolo h1: nero su blu, come il logo WUD */
section:has(h1):not(.has-background-image) [class*='layout-'] > div h1 {
  color: var(--wud-black);
}

/* Immagine di sfondo: il colore intorno all'immagine (size: contain) è la carta chiara, non il blu.
   Reveal copia le classi della slide sul div di sfondo, quindi has-background-image è disponibile anche lì. */
.backgrounds .slide-background.has-background-image {
  background-color: var(--wud-paper);
}

/* Con un'immagine di sfondo, intestazione e piè di pagina sono nascosti */
section.has-background-image .header,
section.has-background-image .footer {
  display: none;
}

/* Il primo elemento di un blocco non ha margine sopra: l'engine aggiunge due righe sopra un h2,
   e con un titolo su due righe la riga sotto finisce fuori dall'area visibile */
section .slide-contents > .element-group > :first-child,
section .slide-contents > .element-group > hgroup > :first-child {
  margin-top: 0 !important;
}

/* Titoli: Space Grotesk, pesante, interlinea stretta, spaziatura leggermente negativa */
[class*='layout-'] > div h1,
[class*='layout-'] > div h2,
[class*='layout-'] > div h3 {
  font-weight: 700;
  letter-spacing: -0.02em;
}
[class*='layout-'] > div h1 {
  letter-spacing: -0.03em;
}

/* Sottotitoli h4–h6 in Google Sans Flex */
[class*='layout-'] > div h4,
[class*='layout-'] > div h5,
[class*='layout-'] > div h6 {
  font-family: var(--bodyfont, 'Google Sans Flex'), 'Google Sans Flex', sans-serif;
  letter-spacing: normal;
}

/* h4 come etichetta in maiuscoletto */
[class*='layout-'] > div h4 {
  font-size: 0.85em;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--wud-label);
}

/* Testo: peso 500 come il corpo del sito; blocchi sempre a piena larghezza */
.element-group p,
.element-group li,
.element-group td,
.element-group th,
.element-group caption {
  font-weight: 500;
  letter-spacing: 0.01em;
}
section .slide-contents:is(.layout-default, .layout-caption, .layout-title-image) > .element-group {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
}
section .slide-contents:is(.layout-default, .layout-caption, .layout-title-image) > .element-group > :is(p, ul, ol, blockquote, table, pre) {
  width: 100%;
  max-width: none;
}

/* Riga di apertura in grassetto nelle slide di testo: titolo della slide, in Space Grotesk */
section:is(.dark, .light) .element-group > p > strong:first-child {
  display: block;
  width: 100%;
  font-family: var(--titlefont, 'Space Grotesk'), 'Space Grotesk', sans-serif;
  font-size: 1.5em;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 0.3em;
  color: var(--wud-lead);
}
section .element-group > p > strong:first-child + br {
  display: none;
}

/* Riga sotto il titolo o la sezione: pillola salmone con testo nero (dal manifesto WUD) */
section:is(.dark, .light):has(h1, h2):not(:has(h3)) .slide-contents[class*='layout-'] > div hgroup p.kicker,
section:is(.dark, .light):has(h1, h2):not(:has(h3)) .slide-contents[class*='layout-'] > div > :is(h1, h2) + p,
section:is(.dark, .light):has(h1, h2):not(:has(h3)) .slide-contents[class*='layout-'] > div > hgroup + p {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  margin-top: 0.6em;
  padding: 0.25em 0.9em 0.3em;
  border-radius: 999px;
  background: var(--wud-salmon);
  color: var(--wud-black);
  font-size: 0.8em;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.01em;
}
section:is(.dark, .light):has(h1, h2):not(:has(h3)) .slide-contents[class*='layout-'] > div hgroup p.kicker a,
section:is(.dark, .light):has(h1, h2):not(:has(h3)) .slide-contents[class*='layout-'] > div > :is(h1, h2) + p a {
  color: inherit;
  text-decoration-color: rgba(0, 0, 0, 0.5);
}

/* Titolo o sezione centrati: anche la riga sotto va al centro (l'engine la forza a sinistra) */
section.title-container .slide-contents.layout-title .element-group p,
section.section-container .slide-contents.layout-section .element-group p {
  text-align: inherit !important;
  margin-left: auto;
  margin-right: auto;
}

/* Testo più immagine (Caption e Caption-Top): il blocco di testo è centrato */
section .slide-contents:is(.layout-caption, .layout-title-image) > .element-group {
  align-items: center;
  text-align: center;
}
section .slide-contents:is(.layout-caption, .layout-title-image) > .element-group :is(h1, h2, h3, h4, h5, h6, p, li) {
  text-align: center !important;
}
section .slide-contents:is(.layout-caption, .layout-title-image) > .element-group > p > strong:first-child {
  text-align: center;
}

/* Sezioni (h2): interlinea stretta; la misura resta quella standard, così anche un titolo lungo
   lascia spazio alla riga sotto */
.layout-section > div h2 {
  line-height: 1;
}

/* Elenchi */
.element-group li::marker {
  color: var(--wud-marker);
  font-weight: 700;
}

/* Link */
section:is(.dark, .light) .element-group a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--wud-underline);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.14em;
}

/* Barrato (~~AI~~), evidenziato, citazioni, linee */
.element-group del {
  text-decoration-color: var(--wud-salmon);
  text-decoration-thickness: 0.1em;
  opacity: 0.8;
}
.element-group mark {
  background-color: var(--wud-yellow);
  color: var(--wud-black);
  padding: 0 0.15em;
}
.element-group blockquote {
  border-left: 0.12em solid var(--wud-salmon);
  padding-left: 0.7em;
}
.element-group hr {
  border: 0;
  border-top: 1px solid var(--wud-rule);
}
.element-group td,
.element-group th {
  border-color: var(--wud-rule);
}

/* Note a piè di slide [^ ...] */
section .footnotes {
  font-weight: 500;
  opacity: 0.75;
}
section .footnotes .reversefootnote {
  display: none;
}

/* Intestazione e piè di pagina: maiuscoletto spaziato */
section .header,
section .footer {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.8;
}

/* Codice inline */
.element-group :not(pre) > code {
  border-radius: 0.3em;
  padding: 0.05em 0.3em;
}

@media (max-width: 639px) {
  section .element-group > p > strong:first-child {
    font-size: 1.3em;
  }
}
