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

/* FONT DECLARATIONS */
@font-face {
  font-family: "Ot-Brut";
  src: url("fonts/OTBrut-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Ot-Brut";
  src: url("fonts/OTBrut-Italic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Amiamie";
  src: url("fonts/Amiamie-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Amiamie";
  src: url("fonts/Amiamie-Italic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* GENERALE */
:root {
  /* colori */
  --color-white:     #f4f4f2;
  --color-text:      #030303;
  --color-red:       #ff3b30;
  --color-green:       #2beb1a;
  --color-rust:       #f08300;


  /* tipografia */
  --font-base:       "Amiamie", sans-serif;
  --font-titoli:       "Ot-Brut", serif;
  --font-size-body:  1.1rem;
  --font-size-title: 1.5rem;

  /* layout */
  --col-gap:         0.8rem;
  --margin:          40px;
}

/* BASE */
html, body {
  height: 100%;
  font-family: var(--font-base);
  font-size: var(--font-size-body);
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  background-color: var(--color-white); 
  background-image: url("../images/sfondo_orizz.jpg"); 
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  background-attachment: fixed;
  color: var(--color-text);
}

/* GRIGLIA DI LAYOUT CONDIVISA */
.griglia-layout {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: var(--col-gap);
  align-items: start;
}

.griglia-layout .data     { grid-column: 1; }
.griglia-layout .relatore { grid-column: 2; }
.griglia-layout .ora      { grid-column: 3; }
.griglia-layout .aula     { grid-column: 4; }

/* HEADDER */
.intestazione {
  position: relative;
  z-index: 1;
  row-gap: 1rem;
  padding: var(--margin) var(--margin) calc(var(--margin) * 1.5);
  pointer-events: none;
}

.header-titolo {
  grid-column: span 2; /* Copre le prime due colonne */
}

.intestazione .testo {
  pointer-events: auto;
}

.intestazione h1 {
  font-size: var(--font-size-title);
  font-weight: 400;
  line-height: 1.2;
  color: var(--color-text);
  font-family: var(--font-titoli); 
  /*
  -webkit-text-stroke-width: 0.5px;
  -webkit-text-stroke-color: var(--color-text);
  */
}

.intestazione p {
  font-size: var(--font-size-body);
  line-height: 1.45;
}


.titolo-evento,
.titolo-evento h1,
.titolo-evento p {
  font-family: var(--font-titoli); /* applica il font titoli anche ai figli h1/p */
  font-size: 1.5rem; /* stessa dimensione per div, h1 e p dentro .titolo-evento */
}

.italic {
  font-style: italic; 
}

/* Selezione testo */
::selection {
  background-color: var(--color-text); 
  color: var(--color-white);                      
}
::-moz-selection {
  background-color: var(--color-text);
  color: var(--color-white); 
}

/* RIGA OPEN CALL DEDICATA */
.riga-opencall {
  padding: 0 var(--margin) 1.5rem; 
}

/* Animazione e pallino lampeggiante */
@keyframes lampeggia {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

.live-indicator {
  position: relative; 
}

.live-indicator::before {
  content: "";
  position: absolute;
  left: -1.2em; 
  top: 50%;
  transform: translateY(-50%); 
  width: 0.55em;
  height: 0.55em;
  background-color: var(--color-green);
  border-radius: 50%;
  animation: lampeggia 1.2s ease-in-out infinite;
}

/* Correzione del pallino dentro i titoli delle finestre */
.finestra-titolo.live-indicator {
  padding-left: 1.2em; 
}

.finestra-titolo.live-indicator::before {
  left: 0; 
}
/*
.riga-opencall .data {
  font-size: 1.5rem;
} */

.riga-opencall .live-indicator {
  font-size: 1.5rem; 
}

/* PROGRAMMA & EVENTI */
.programma {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 var(--margin) var(--margin);
  gap: 0.2rem;
  position: relative;
  z-index: 1;
}

.evento div {
  line-height: 1.45;
}

.evento.spazio-sotto {
  margin-bottom: 2.5rem; 
}

.relatore {
  pointer-events: auto;
}

.apri-finestra {
  pointer-events: auto;
  cursor: pointer;
}

.apri-finestra:hover {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* FINESTRE */
.livello-finestre {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 500;
}

.finestra {
  position: absolute;
  width: min(500px, 90vw);
  max-height: 70vh;
  background-color: #ffffff;
  color: var(--color-text);
  font-family: var(--font-base);
  filter: drop-shadow(rgba(0, 0, 0, 0.25) 0px 6px 20px);
  border-radius: 0px;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.96);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  border: 1px solid var(--color-text);
}

.finestra.aperta {
  opacity: 1;
  transform: scale(1);
  pointer-events: all;
}

.finestra-barra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6em 0.8em;
  background-color: #f0f0f0;
  border-bottom: 1px solid var(--color-text);
  cursor: grab;
  user-select: none;
}

.finestra-barra:active {
  cursor: grabbing;
}

.finestra-titolo {
  font-size: var(--font-size-body);
  color: var(--color-text);
  font-family: var(--font-titoli); 
}

.finestra-chiudi {
  border: none;
  background: none;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--color-text);
  cursor: pointer;
  padding: 0 0.3em;
}

.finestra-chiudi:hover {
  color: var(--color-red);
}

.finestra-contenuto {
  padding: 1em 1.2em;
  overflow-y: auto;
  max-height: calc(70vh - 3em);
  font-size: var(--font-size-body);
  line-height: 1;
}

#finestra-opencall .finestra-contenuto a {
  color: var(--color-rust);
}