/* Colours taken from Landingpage_Idee.pdf */
:root {
  --navy: #152843;
  --cream: #ebe6de;
  --gold: #d1a55f;
  --white: #ffffff;

  /* The design uses Dax Compact Pro; Fira Sans Condensed is the free fallback. */
  --font: "Dax Compact Pro", "Fira Sans Condensed", "Arial Narrow", sans-serif;

  /* Height of the diagonal cut at the bottom of every section (29pt of 595pt in the PDF) */
  --slant: 4.9vw;
  --gutter: clamp(1rem, 5vw, 2.5rem);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 500;
  font-size: 1.125rem;
  line-height: 1.4;
  color: var(--navy);
  background: var(--navy);
}

img { display: block; max-width: 100%; height: auto; }

h1, h2, p { margin: 0; }

.container {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Sections with diagonal bottom edge ---------- */

.section {
  position: relative;
  padding: calc(4rem + var(--slant)) 0 calc(4rem + var(--slant));
  margin-bottom: calc(var(--slant) * -1);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--slant)), 0 100%);
}

/* Earlier sections overlap the following ones */
.hero { z-index: 7; }
main .section:nth-child(1) { z-index: 6; }
main .section:nth-child(2) { z-index: 5; }
main .section:nth-child(3) { z-index: 4; }
main .section:nth-child(4) { z-index: 3; }
main .section:nth-child(5) { z-index: 2; }

.section--light { background: var(--cream); color: var(--navy); }
.section--dark  { background: var(--navy);  color: var(--white); }

/* ---------- Hero ---------- */

.hero {
  padding-top: 2.5rem;
  background: var(--navy) url("assets/pattern-tile.webp") 0 0 / 110px auto repeat;
  color: var(--white);
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 2rem;
}

.hero__text {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2.5rem;
  align-self: stretch;
}

.hero__logo { width: clamp(7rem, 20vw, 14rem); }

.hero__title {
  font-weight: 600;
  font-size: clamp(1.75rem, 3.4vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.005em;
}

.hero__title span { display: inline-block; }

@media (min-width: 761px) {
  .hero__title span { white-space: nowrap; }
}

.hero__cards img { width: 100%; max-width: 36rem; margin-left: auto; }

/* ---------- Typography ---------- */

.eyebrow {
  color: var(--gold);
  font-weight: 700;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  text-transform: uppercase;
  line-height: 1.1;
}

h2 {
  font-weight: 700;
  font-size: clamp(1.75rem, 4.2vw, 2.6rem);
  line-height: 1.12;
  text-transform: uppercase;
  margin-top: 0.15em;
}

.lead {
  max-width: 38rem;
  margin-top: 1.5rem;
}

/* ---------- Facts row ---------- */

.facts {
  list-style: none;
  margin: 3rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem 1.5rem;
  text-align: center;
}

.facts strong {
  display: block;
  font-weight: 700;
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  margin-bottom: 0.4rem;
}

.facts span {
  display: block;
  overflow-wrap: break-word;
  hyphens: auto;
  font-size: 0.95rem;
  line-height: 1.35;
  max-width: 14rem;
  margin: 0 auto;
}

/* ---------- Text + image split ---------- */

.split {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 2rem;
}

.split__media img { width: 100%; max-width: 26rem; margin: 0 auto; }

.split--top { align-items: start; }

.museum-text p + p { margin-top: 1rem; }

/* The SVG has a lot of empty space around the wordmark; the wrapper crops it to the
   visible logo (bounding box 31.31 121.32 361.38 183.56 of the 425.2 viewBox). */
.museum-logo {
  position: relative;
  display: block;
  width: 100%;
  max-width: 19rem;
  aspect-ratio: 361.38 / 183.56;
  margin: 0 auto;
  /* Top aligned with the heading: skip the eyebrow line and the heading's top margin */
  margin-top: calc(clamp(1.25rem, 2.4vw, 1.6rem) * 1.1 + clamp(1.75rem, 4.2vw, 2.6rem) * 0.15);
  overflow: hidden;
  transition: transform 0.2s;
}

.museum-logo img {
  position: absolute;
  top: -66.09%;
  left: -8.66%;
  width: 117.66%;
  max-width: none;
}

.museum-logo:hover,
.museum-logo:focus-visible { transform: scale(1.03); }
.museum-logo:focus-visible { outline: 3px solid var(--gold); outline-offset: 6px; overflow: visible; }

/* ---------- Buttons ---------- */

.button {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.8rem 1.75rem;
  border: 2px solid var(--navy);
  color: var(--navy);
  font-size: 1.05rem;
  text-transform: uppercase;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: background-color 0.2s, color 0.2s;
}

.button:hover,
.button:focus-visible { background: var(--navy); color: var(--cream); }

.section--dark .button { border-color: var(--gold); color: var(--cream); }
.section--dark .button:hover,
.section--dark .button:focus-visible { background: var(--gold); color: var(--navy); }

.button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* Filled call-to-action variant */
.section--dark .button--primary { background: var(--gold); border-color: var(--gold); color: var(--navy); font-weight: 600; }
.section--dark .button--primary:hover,
.section--dark .button--primary:focus-visible { background: var(--cream); border-color: var(--cream); color: var(--navy); }

/* ---------- Verkaufsstellen (list + map) ---------- */

.stores {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 1.5rem;
  height: 34rem;
  margin-top: 2.5rem;
  color: var(--navy);
}

/* List and map are two separate cards */
.stores__side,
.stores__map {
  border: 3px solid var(--gold);
  box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.35);
}


.stores__side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--white);
}

.stores__count {
  padding: 1.1rem 1.5rem;
  background: var(--navy);
  color: var(--gold);
  font-weight: 700;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stores__list {
  position: relative;
  flex: 1;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.stores__item {
  position: relative;
  border-bottom: 1px solid rgba(21, 40, 67, 0.12);
  transition: background-color 0.2s;
}

.stores__item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--gold);
  opacity: 0;
  transition: opacity 0.2s;
}

.stores__item:hover { background: rgba(235, 230, 222, 0.5); }
.stores__item.is-active { background: rgba(209, 165, 95, 0.16); }
.stores__item.is-active::before { opacity: 1; }

.stores__entry {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  width: 100%;
  padding: 1.1rem 1.5rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 1rem;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.stores__entry:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }

.stores__num,
.stores__pin span {
  display: grid;
  place-items: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--navy);
  color: var(--cream);
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1;
  transition: background-color 0.2s, color 0.2s, transform 0.2s;
}

.stores__item.is-active .stores__num { background: var(--gold); color: var(--navy); }

.stores__text span { display: block; }

.stores__name {
  display: block;
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 0.15rem;
}

.stores__empty { padding: 1.5rem; }

.stores__map {
  min-height: 0;
  height: 100%;
  background: #e6e2da;
}

.stores__map--error {
  display: grid;
  place-items: center;
  padding: 1.5rem;
  text-align: center;
}

/* Map pins share the look of the list numbers */
.stores__pin { cursor: pointer; }

.stores__pin span {
  width: 34px;
  height: 34px;
  border: 3px solid var(--white);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.stores__pin:hover span { transform: scale(1.1); }
.stores__pin.is-active span { background: var(--gold); color: var(--navy); transform: scale(1.15); }

.stores .maplibregl-map { font-family: var(--font); }

.stores .maplibregl-popup-content {
  padding: 0.9rem 2rem 0.9rem 1.1rem;
  border-radius: 0;
  border-top: 4px solid var(--gold);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  color: var(--navy);
  font-size: 0.95rem;
  line-height: 1.35;
}

.stores .maplibregl-popup-close-button { font-size: 1.3rem; padding: 0 0.4rem; color: var(--navy); }

.stores .maplibregl-ctrl-group { border-radius: 0; }

.stores__popup strong,
.stores__popup span { display: block; }
.stores__popup strong { font-size: 1.05rem; margin-bottom: 0.15rem; }

/* ---------- Künstler (flip cards) ---------- */

.artists { margin-top: 2.5rem; }
.artists[hidden] { display: none; }

.artists__hint { font-size: 0.95rem; opacity: 0.75; }

.artists__grid {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
}

.artist { perspective: 1000px; }

.artist__card {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 7;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.artist__card:focus-visible { outline: 3px solid var(--gold); outline-offset: 4px; }

.artist__inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.artist__card[aria-pressed="true"] .artist__inner { transform: rotateY(180deg); }

/* Mouse hover is handled in artists.js (is-hovered), so the previous card can turn back first */
.artist__card.is-hovered .artist__inner { transform: rotateY(180deg); }

.artist__face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.25rem 1rem;
  border: 3px solid var(--gold);
  box-shadow: 0 0.75rem 1.5rem rgba(21, 40, 67, 0.25);
  text-align: center;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.artist__face--front {
  background: var(--navy) url("assets/pattern-tile.webp") 0 0 / 80px auto repeat;
  color: var(--white);
}

/* Initials always sit at the same height; the name hangs below, however many lines it has */
.artist__face.artist__face--front {
  display: grid;
  grid-template-rows: minmax(0, 0.8fr) auto minmax(0, 1.4fr);
  justify-items: center;
  gap: 0;
}

.artist__face--front > .artist__initials,
.artist__face--front > .artist__image { grid-row: 2; }

.artist__face--front > .artist__name {
  grid-row: 3;
  align-self: start;
  margin-top: 1rem;
}

@media (min-width: 761px) and (max-width: 1100px) {
  .artist__face--front > .artist__name { font-size: 0.95rem; }
}

.artist__face--back {
  transform: rotateY(180deg);
  background: var(--gold);
  color: var(--navy);
}

.artist__initials,
.artist__image {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  border: 3px solid var(--gold);
}

.artist__initials {
  display: grid;
  place-items: center;
  background: var(--navy);
  color: var(--gold);
  font-weight: 700;
  font-size: 1.9rem;
  letter-spacing: 0.02em;
}

.artist__image { object-fit: cover; }

.artist__name {
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.2;
  text-transform: uppercase;
  -webkit-hyphens: auto;
  hyphens: auto;
  overflow-wrap: break-word;
  max-width: 100%;
}

.artist__label {
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.75;
}

.artist__category {
  margin-top: -0.6rem;
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.15;
  text-transform: uppercase;
  -webkit-hyphens: auto;
  hyphens: auto;
  overflow-wrap: break-word;
  max-width: 100%;
}

.artist__back-name {
  padding-top: 0.75rem;
  border-top: 2px solid var(--navy);
  font-size: 0.95rem;
  line-height: 1.25;
}

.artists__empty { grid-column: 1 / -1; }

/* ---------- Subpages (Impressum etc.) ---------- */

.page-header {
  z-index: 7;
  padding-top: 1.5rem;
  padding-bottom: calc(1.5rem + var(--slant));
  background: var(--navy) url("assets/pattern-tile.webp") 0 0 / 110px auto repeat;
  color: var(--white);
}

.page-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.page-header__logo img { width: clamp(4.5rem, 10vw, 6.5rem); }

.page-header__back {
  color: var(--cream);
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-bottom: 2px solid var(--gold);
}

.page-header__back:hover,
.page-header__back:focus-visible { color: var(--gold); }

.legal h1 {
  font-weight: 700;
  font-size: clamp(1.75rem, 4.2vw, 2.6rem);
  line-height: 1.12;
  text-transform: uppercase;
  margin: 0.15em 0 0;
}

.legal h2 {
  max-width: 42rem;
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--gold);
  font-size: 1.2rem;
  letter-spacing: 0.03em;
}

.legal p {
  max-width: 42rem;
  margin-top: 0.75rem;
  font-size: 1.05rem;
  line-height: 1.5;
}

.legal a {
  color: inherit;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.legal a:hover,
.legal a:focus-visible { color: #8a6a35; }

/* ---------- Footer ---------- */

.footer {
  z-index: 1;
  margin-bottom: 0;
  clip-path: none;
  padding-bottom: 3rem;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  background: var(--navy);
  color: var(--white);
  text-align: center;
  font-size: 1rem;
}

.footer span { margin: 0 0.6rem; }
.footer a { color: inherit; text-decoration: none; }
.footer a:hover,
.footer a:focus-visible { color: var(--gold); text-decoration: underline; }

/* ---------- Mobile ---------- */

@media (max-width: 760px) {
  :root { --slant: 8vw; }

  .section { padding-top: calc(3rem + var(--slant)); padding-bottom: calc(3rem + var(--slant)); }
  .hero { padding-top: 1.5rem; }

  .hero__inner,
  .split { grid-template-columns: 1fr; }

  .hero__text { display: contents; }
  .hero__logo { order: 1; }
  .hero__cards { order: 2; }
  .hero__title { order: 3; }
  .hero__cards img { margin: 0 auto; }

  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .split__media img { max-width: 20rem; }
  .museum-logo { max-width: 12rem; margin-top: 1rem; }

  /* Footer: copyright on its own line, links below */
  .footer span:first-of-type { display: block; height: 0.5rem; visibility: hidden; }

  .stores { grid-template-columns: 1fr; gap: 1rem; height: auto; }
  .stores__map { order: -1; height: 20rem; }
  .stores__list { max-height: 28rem; }
  .stores__entry { padding-left: 1rem; padding-right: 1rem; }

  .artists__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }
  .artist__face { padding: 1rem 0.6rem; gap: 0.75rem; }
  .artist__face--front > .artist__name { margin-top: 0.75rem; }
  .artist__initials,
  .artist__image { width: 4.25rem; height: 4.25rem; }
  .artist__initials { font-size: 1.5rem; }
  .artist__face--front > .artist__name { font-size: 0.95rem; }
  .artist__category { font-size: 1.05rem; }
}

@media (prefers-reduced-motion: reduce) {
  .button,
  .museum-logo,
  .stores__item,
  .stores__num,
  .stores__pin span,
  .artist__inner { transition: none; }
}
