/* =========================================================
   MOSTRE VIRTUALI – sito portale
   Stile della Biblioteca dell'Accademia di architettura:
   bianco e nero, filetti neri, carattere grottesco.
   ========================================================= */

:root {
  --usi-black: #000;
  --usi-dark: #222;
  --usi-grey: #666;
  --usi-line: #000;
  --usi-font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

body {
  background: #fff;
  color: var(--usi-black);
  font-family: var(--usi-font);
}

nav {
display: none;
}

/* ---------- header ---------- */

#wrap > header {
  border-bottom: 1px solid var(--usi-line);
  padding-bottom: 0;
  margin-bottom: 0;
}

#wrap > header .site-title {
  display: flex;
  align-items: center;
  gap: 24px;
  text-decoration: none;
  color: var(--usi-black);
}

#wrap > header .site-title img {
  height: 64px;
  width: auto;
  max-height: none;
}

#wrap > header .site-title::after {
  content: "Mostre virtuali";
  font-family: var(--usi-font);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--usi-black);
text-transform: none;
  letter-spacing: 0;
}

/* il titolo della pagina sotto l'header non serve più */
.site-page-home #content .blocks > h2:first-of-type,
.site-page-home .block-pageTitle {
  display: none;
}

/* telefono: logo e scritta più piccoli */
@media screen and (max-width: 640px) {
  #wrap > header .site-title {
    gap: 16px;
  }

  #wrap > header .site-title img {
    height: 44px;
  }

  #wrap > header .site-title::after {
    font-size: 24px;
  }
}

/* ricerca: icona nera */
#search-container button,
#search-container input[type=text] {
  border-color: var(--usi-black);
  color: var(--usi-black);
}

/* telefono: la ricerca va sotto il titolo invece di coprirlo */
@media screen and (max-width: 640px) {
  #wrap > header .site-title {
    margin: 24px 0 0;
    font-size: 26px;
    line-height: 1.2;
  }

  #search-container {
    position: static;
    margin-top: 16px;
  }

  #search-container form,
  #search-container input[type=text] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* ---------- elenco dei siti come griglia ---------- */

.list-of-sites .site-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px 32px;
  margin: 48px 0 64px;
}

@media screen and (max-width: 900px) {
  .list-of-sites .site-list { grid-template-columns: repeat(2, 1fr); }
}

@media screen and (max-width: 560px) {
  .list-of-sites .site-list { grid-template-columns: 1fr; gap: 40px; }
}

/* scheda */
.list-of-sites .site {
  position: relative;            /* serve al link che copre la scheda */
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  border: 0;
}

/* immagine: tutte con lo stesso formato */
.list-of-sites .site-thumbnail {
  order: 1;                      /* immagine in alto: tutte allineate */
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #eee;
}

.block-listOfSites .list-of-sites .site-thumbnail-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  object-fit: cover;
  transition: transform 0.6s ease;
}

/* testo: filetto nero sopra il titolo */
.list-of-sites .site-text {
  order: 2;
  margin-top: 16px;
  border-top: 2px solid var(--usi-line);
  padding-top: 6px;
}

.list-of-sites .site-link {
  display: block;
  font-family: var(--usi-font);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--usi-black);
  text-decoration: none;
}

/* tutta la scheda è cliccabile */
.list-of-sites .site-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.list-of-sites .site-summary {
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--usi-line);
  font-family: var(--usi-font);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.45;
  color: var(--usi-dark);
}

/* hover e focus da tastiera */
.list-of-sites .site:hover .site-thumbnail-image,
.list-of-sites .site:focus-within .site-thumbnail-image {
  transform: scale(1.04);
}

.list-of-sites .site:hover .site-link,
.list-of-sites .site:focus-within .site-link {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.list-of-sites .site-link:focus-visible {
  outline: none;
}

.list-of-sites .site:focus-within {
  outline: 2px solid var(--usi-black);
  outline-offset: 6px;
}

/* ---------- piè di pagina ---------- */

footer {
  border-top: 1px solid var(--usi-line);
  padding-top: 16px;
  font-family: var(--usi-font);
  font-size: 13px;
  color: var(--usi-grey);
}

@media (prefers-reduced-motion: reduce) {
  .list-of-sites .site-thumbnail-image { transition: none; }
}

footer {
text-align: center;
}