/* ---------------------------------------------------------------------------
   Bausteine: Galerie, Bildansicht, Ausstellungsliste, Startseite

   Die Bildansicht ("Lightbox") des Vorgaengers lief ueber jQuery + fancybox.
   Hier uebernimmt das :target - ein Klick auf die Vorschau setzt den Anker,
   die zugehoerige Ansicht wird sichtbar. Kein JavaScript noetig.
   --------------------------------------------------------------------------- */

/* --- Einleitung ---------------------------------------------------------- */

.einleitung {
  max-width: 62ch;
  margin: 0 auto 40px;
  text-align: center;
}

.einleitung p {
  font-size: 17px;
  color: var(--color-muted);
}

.abschnitt-kopf {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 8px;
  margin-bottom: 24px;
}

.abschnitt-kopf h2 {
  margin: 0;
}

.hinweis {
  color: var(--color-muted);
  font-size: 15px;
}

/* --- Galerie-Raster ------------------------------------------------------ */

.galerie {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 20px;
  list-style: none;
  margin: 0 0 40px;
  padding: 0;
}

.galerie li {
  margin: 0;
}

.galerie a {
  display: block;
  background: #fff;
  border: 1px solid var(--color-border);
  padding: 8px;
  color: var(--color-text);
  text-decoration: none;
  height: 100%;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.galerie a:hover,
.galerie a:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 2px 12px rgb(0 0 0 / 8%);
  text-decoration: none;
}

/* Die Werke haben sehr unterschiedliche Seitenverhaeltnisse (Hoch- und
   Querformat, von 397x593 bis 3114x2009). Ein festes Kachelmass mit
   object-fit: cover haelt das Raster ruhig, ohne die Bilder zu verzerren -
   der Vorgaenger hatte alle Vorschauen hart auf 263x166 gequetscht. */
.galerie img {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: cover;
  background: var(--color-bg-sanft);
}

.galerie-titel {
  display: block;
  padding-top: 8px;
  font-size: 14px;
  text-align: center;
  color: var(--color-muted);
}

.galerie a:hover .galerie-titel,
.galerie a:focus-visible .galerie-titel {
  color: var(--color-primary);
}

/* --- Bildansicht --------------------------------------------------------- */

.ansicht {
  display: none;
}

.ansicht:target {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 50;
  align-items: center;
  justify-content: center;
  background: rgb(28 25 22 / 94%);
  padding: 48px 16px;
}

.ansicht figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.ansicht img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  width: auto;
  object-fit: contain;
  box-shadow: 0 4px 30px rgb(0 0 0 / 50%);
}

.ansicht figcaption {
  color: #f2ece4;
  font-family: var(--font-titel);
  font-size: 17px;
  text-align: center;
}

/* Die Flaeche hinter dem Bild schliesst ebenfalls - liegt unter der Figur */
.ansicht-flaeche {
  position: absolute;
  inset: 0;
}

.ansicht-knopf {
  position: absolute;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgb(255 255 255 / 12%);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  text-decoration: none;
}

.ansicht-knopf:hover,
.ansicht-knopf:focus-visible {
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
}

.ansicht-schliessen { top: 14px; right: 14px; font-size: 22px; }
.ansicht-zurueck    { top: 50%; left: 14px;  transform: translateY(-50%); }
.ansicht-weiter     { top: 50%; right: 14px; transform: translateY(-50%); }

/* --- Ausstellungen ------------------------------------------------------- */

.jahr {
  margin-bottom: 36px;
}

.jahr > h2 {
  color: var(--color-primary);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 6px;
}

.ausstellung {
  margin-bottom: 24px;
}

.ausstellung h3 {
  margin-bottom: 4px;
}

.ausstellung h4 {
  color: var(--color-muted);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.ausstellung dl {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 2px 12px;
}

.ausstellung dt {
  color: var(--color-muted);
}

.ausstellung dd {
  margin: 0;
}

.belege {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}

.belege li {
  max-width: 240px;
}

.belege img {
  border: 1px solid var(--color-border);
  background: #fff;
  padding: 4px;
}

/* --- Kuenstlerin --------------------------------------------------------- */

.portraet {
  display: grid;
  gap: 32px;
  align-items: start;
}

@media (min-width: 700px) {
  .portraet {
    grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  }
}

.portraet figure {
  margin: 0;
}

.portraet img {
  border: 1px solid var(--color-border);
  background: #fff;
  padding: 6px;
}

.portraet-text p {
  max-width: 62ch;
}

/* --- Verweis-Schaltflaeche ---------------------------------------------- */

.knopf {
  display: inline-block;
  padding: 9px 20px;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  background: transparent;
}

.knopf:hover,
.knopf:focus-visible {
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
}

.knopf-zeile {
  text-align: center;
  margin-bottom: 48px;
}
