/* =========================================================
   BETWEEN INVENTION AND IMAGINATION – André Corboz
   Versione sobria, da pubblicazione accademica:
   fondo bianco, serif per i titoli, filetti sottili,
   un solo colore d'accento.
   Per il tema Default di Omeka S. Incollare nel CSS Editor
   del sito. L'@import deve restare in cima.
   ========================================================= */

@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,500;1,400&family=IBM+Plex+Serif:ital,wght@0,400;0,500;1,400&display=swap");

html:root {   /* "html" la rende più forte del colore impostato nelle opzioni del tema */
  --cz-bg: #fdfdfc;
  --cz-panel: #f2f2ef;
  --cz-ink: #1a1a1a;
  --cz-muted: #5f6368;
  --cz-line: #d8d8d4;
  --cz-accent: #1f3a5f;       /* blu scuro, unico colore */
  --cz-sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --cz-serif: "IBM Plex Serif", Georgia, serif;

  /* variabili del tema Default */
  --accent: var(--cz-accent);
  --bg: var(--cz-bg);
  --light: var(--cz-line);
}

body {
  background: var(--cz-bg);
  color: var(--cz-ink);
  font-family: var(--cz-sans);
  font-size: 18px;
}

a:link,
a:visited {
  color: var(--cz-accent);
}

/* ---------- header ---------- */

.site-title,
#top-nav,
.site-title::before,
#top-nav::before,
header nav .child-toggle {
  background-color: var(--cz-bg) !important;
}

h1.site-title {
  padding-top: 48px;
  padding-bottom: 20px;
}

h1.site-title a {
  font-family: var(--cz-serif);
  font-size: 38px;
  font-weight: 400;
  line-height: 1.15;
  color: var(--cz-ink);
  text-decoration: none;
}

/* sottotitolo */
h1.site-title a::after {
  content: "André Corboz (1928–2012) e il territorio come palinsesto";
  display: block;
  margin-top: 8px;
  font-family: var(--cz-sans);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--cz-muted);
}

#top-nav {
  border-bottom: 0;
}

#top-nav::after {
  background-color: var(--cz-ink) !important;
}

header nav ul.navigation a:link,
header nav ul.navigation a:visited {
  font-family: var(--cz-sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--cz-ink);
  text-decoration: none;
  padding-bottom: 12px;
  border-bottom: 2px solid transparent;
}

header nav ul.navigation a:hover,
header nav ul.navigation .active > a {
  color: var(--cz-accent);
  border-bottom-color: var(--cz-accent);
}

#search form {
  background: var(--cz-bg);
}

#search input[type="text"] {
  font-family: var(--cz-sans);
  font-size: 14px;
  background: #fff;
  border: 1px solid var(--cz-line);
}

#search button {
  background: var(--cz-panel);
  color: var(--cz-ink);
}

/* ---------- titoli ---------- */

#content h2 {
  font-family: var(--cz-serif);
  font-size: 42px;
  font-weight: 400;
  line-height: 1.15;
  color: var(--cz-ink);
  margin-bottom: 32px;
}

#content h3 {
  font-family: var(--cz-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cz-muted);
}

/* ---------- pagine di testo ---------- */

.block-html {
  max-width: none;
}

.block-html p {
  font-size: 19px;
  line-height: 1.7;
}

/* primo paragrafo come testo introduttivo */
.blocks .block-html:first-child p:first-of-type {
  font-family: var(--cz-serif);
  font-size: 23px;
  line-height: 1.55;
}

.block-html em,
.block-html i {
  font-family: var(--cz-serif);
}

/* ---------- elenchi di immagini ---------- */

ul.resource-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 40px 32px;
  margin: 40px 0;
}

ul.resource-list .resource,
ul.resource-list .resource:first-child,
ul.preview.resource-list li:first-of-type {
  margin: 0;
  padding: 0;
  border: 0;
  overflow: visible;
}

ul.resource-list .resource .resource-link {
  display: block;
  text-decoration: none;
}

ul.resource-list .resource img {
  float: none;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  height: auto;
  margin: 0 0 14px;
  object-fit: cover;
  background: var(--cz-panel);
  transition: opacity 0.3s ease;
}

ul.resource-list .resource img ~ * {
  width: auto;
}

ul.resource-list .resource .resource-name {
  display: block;
  font-family: var(--cz-serif);
  font-size: 18px;
  line-height: 1.35;
  color: var(--cz-ink);
}

ul.resource-list .resource .description {
  margin-top: 6px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--cz-muted);
  max-height: none;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.body-truncate-fade ul.resource-list .resource .description::after {
  display: none;
}

ul.resource-list .resource:hover img,
ul.resource-list .resource:focus-within img {
  opacity: 0.85;
}

ul.resource-list .resource:hover .resource-name,
ul.resource-list .resource:focus-within .resource-name {
  color: var(--cz-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.resource-list.preview + a {
  background: transparent;
  border: 1px solid var(--cz-ink);
  border-radius: 0;
  padding: 10px 22px;
  font-family: var(--cz-sans);
  font-size: 15px;
  color: var(--cz-ink) !important;
  text-decoration: none;
}

.resource-list.preview + a:hover {
  background: var(--cz-ink);
  color: #fff !important;
}

/* ---------- pagina della collezione ---------- */

body.item-set .metadata {
  box-sizing: border-box;
  padding: 8px 32px 0 0;
  border: 0;
  border-top: 1px solid var(--cz-ink);
}

body.item-set .metadata dt,
body.item.show #content dl dt {
  font-family: var(--cz-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cz-muted);
}

body.item-set .metadata .property {
  padding: 14px 0;
  border-bottom: 1px solid var(--cz-line);
}

body.item-set .metadata dd {
  margin: 4px 0 0;
  font-size: 17px;
  line-height: 1.6;
}

.browse-controls select,
.browse-controls input,
.browse-controls button,
.pagination input,
.pagination a,
.pagination button {
  font-family: var(--cz-sans);
  background-color: #fff;
  border-color: var(--cz-line);
}

/* ---------- pagina del singolo item: immagine fissa, metadati che scorrono ---------- */

@media screen and (min-width: 800px) {
  body.item.show #content {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    column-gap: 56px;
    align-items: start;
  }

  body.item.show #content > * {
    grid-column: 2;
  }

  body.item.show #content > .media-embeds {
    grid-column: 1;
    grid-row: 1 / span 50;
    position: sticky;
    top: 24px;
    align-self: start;
    margin: 0;
  }

  body.item.show #content > h2 {
    font-size: 34px;
    margin-top: 0;
  }
}

body.item.show #content > h2 + h3 {
  display: none;
}

body.item.show .media-embeds .media-render {
  background: var(--cz-panel);
  padding: 24px;
  margin-bottom: 24px;
}

body.item.show .media-embeds img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 100px);
  object-fit: contain;
}

body.item.show .media-embeds .openseadragon {
  height: calc(100vh - 100px) !important;
}

body.item.show #content dl .property {
  padding: 14px 0;
  border-bottom: 1px solid var(--cz-line);
}

body.item.show #content dl dd {
  margin: 4px 0 0;
  font-size: 17px;
  line-height: 1.55;
}

/* ---------- piè di pagina ---------- */

footer {
  font-family: var(--cz-sans);
  font-size: 13px;
  color: var(--cz-muted);
  border-top: 1px solid var(--cz-line);
  padding-top: 18px;
}

/* ---------- Mirador non usato in questa mostra ---------- */

.mirador,
.mirador.viewer,
.block-mirador,
[id^="mirador-"],
.MuiDialog-root,
.MuiModal-root,
.MuiPopover-root,
.MuiBackdrop-root {
  display: none !important;
}

body {
  overflow: auto !important;
  padding-right: 0 !important;
}

/* ---------- telefono ---------- */

@media screen and (max-width: 799px) {
  h1.site-title { padding-top: 24px; }
  h1.site-title a { font-size: 28px; }
  h1.site-title a::after { font-size: 13px; }
  #content h2 { font-size: 30px; }
  .block-html p { font-size: 17px; }
  .blocks .block-html:first-child p:first-of-type { font-size: 20px; }

  ul.resource-list {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 28px 16px;
  }

  body.item.show .media-embeds img { max-height: 70vh; }
  body.item.show .media-embeds .openseadragon { height: 60vh !important; }
}

@media (prefers-reduced-motion: reduce) {
  ul.resource-list .resource img { transition: none; }
}