/* ==========================================================================
   01. GLOBALS & RESETS
   ========================================================================== */
:root {
  --diagram-line-color: #000;
  --font-size-base: 13px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
  font-weight: normal;
}

html {
  -webkit-text-size-adjust: 100%;
  font-size: var(--font-size-base) !important;
}

body {
  font-family: Verdana, sans-serif;
  letter-spacing: 0.1em;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.3; 
  background-color: #ffffff;
  color: #000000;
  padding: 1rem;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select {
  font: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

/* ==========================================================================
   02. TYPOGRAPHY & LINKS
   ========================================================================== */
h1, h2, h3, h4, h5, h6, .center-circle, .node-label {
  font-size: 1rem !important; 
}

h1, h2, h3, h4, h5, h6, p, figcaption, span, a {
  display: inline-block;
  transform: scaleY(1.3);
  transform-origin: top left;
  margin-bottom: calc(0.5em + var(--stretch-offset, 0px));
}

figcaption, time {
  font-size: 11px;
}

h1 a, h2 a, h3 a, h4 a, h5 a, h6 a, p a,
h1 span, h2 span, h3 span, h4 span, h5 span, h6 span, p span,
.exhibition-text li a, .exhibition-text li span {
  transform: none;
}

.content p a,
.content p span,
.content li a,
.content li span {
  display: inline;
  margin-bottom: 0;
}

.content p a {
  text-decoration: underline;
}

.exhibition-text li {
  transform: scaleY(1.3);
  transform-origin: top left;
  margin-bottom: 0.3em; 
}

.template-about h2 {
  font-size: 2rem !important; 
}

.template-about h2 a {
  margin-bottom: 0;
}

a {
  text-decoration: none;
  color: inherit;
}

nav a {
  margin-bottom: 0.5em;
}

nav a.current-page,
.col-content a,
.downloads a {
  text-decoration: underline;
}

/* ==========================================================================
   03. GLOBAL LAYOUT (GRID)
   ========================================================================== */
.site-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1rem;
  width: 100%;
  align-items: start; 
}

.col-left {
  grid-column: 1 / 4;
  display: flex;
  flex-direction: column;
}

.col-right {
  grid-column: 4 / 7;
  position: relative;
}

.col-current-exhibition-mobile {
  display: none;
}

/* ==========================================================================
   04. LEFT COLUMN (NAV & LISTS)
   ========================================================================== */
.col-nav-links {
  margin-bottom: 2rem;
}

.col-list {
  margin-top: 0;
  width: 100%;
}

.nav-links-stacked { 
  display: flex; 
  flex-direction: column; 
  align-items: flex-start; 
}

.nav-links-stacked a, .nav-contact-infos a { 
  margin-bottom: 0.5em; 
}

.nav-contact-infos a:last-child { 
  margin-bottom: 0; 
}

ul.exhibition-list { 
  list-style: none; 
}

.exhibition-list li { 
  margin-bottom: 2.5rem; 
}

.exhibition-list li.is-active .num-text { 
  text-decoration: underline; 
}

/* NEU: Stretch direkt auf die Vorschau-Karte anwenden (Wrapper gelöscht) */
.exhibition-preview { 
  display: grid; 
  grid-template-columns: 3.5rem 1fr; 
  white-space: nowrap; 
  position: relative; 
  transform: scaleY(1.3); 
  transform-origin: top left; 
}

/* Setzt alle Kinder wieder zurück, damit nur das Grid skaliert wird */
.exhibition-preview * { 
  transform: none !important; 
  margin-bottom: 0 !important; 
}

/* NEU: Der unsichtbare Link, der die ganze Karte anklickbar macht */
.exhibition-main-link {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1; /* Liegt UNTER den PDFs */
}

.num-text { 
  grid-column: 1 / 2; 
}

.title { 
  grid-column: 2 / 3; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  padding-bottom: 1rem;
  text-transform: uppercase;
}

.status-label { 
  grid-column: 2 / 3; 
  color: var(--diagram-line-color); 
}

.meta { 
  grid-column: 2 / 3; 
  display: flex; 
  flex-direction: column; 
}

.downloads { 
  grid-column: 2 / 3; 
  margin-top: 1.5rem; 
  /* NEU: Hebt die PDFs über den unsichtbaren Haupt-Link */
  position: relative;
  z-index: 10;
}

.downloads-title { 
  display: block; 
  margin-bottom: 0.5em; 
  color: var(--diagram-line-color); 
}

.downloads ul { 
  list-style: none; 
}

.downloads li { 
  margin-bottom: 0.3em; 
}
/* ==========================================================================
   05. RIGHT COLUMN (CONTENT & IMAGES)
   ========================================================================== */
.col-content,
article.default-page {
  position: relative; 
  padding-bottom: 2rem;
  width: 100%;
}

.col-content p { 
  margin-bottom: calc(0.75em + var(--stretch-offset, 0px)); 
}

.content { 
  display: grid; 
  grid-template-columns: repeat(3, 1fr); 
  gap: 1.2rem; 
  align-items: start; 
}

.content > * { 
  grid-column: 1 / -1; 
}

.content > figure, 
.content > img, 
.content > .block-image, 
.content > .invitation-wrapper, 
.content > .invitation-link { 
  grid-column: 1 / -1; 
  justify-self: start; 
}

.content figure, 
.content figure figcaption { 
  margin: 0; 
  padding: 0; 
}

.content figure { 
  width: 100% !important; 
}

.content img { 
  width: 100% !important; 
  height: auto !important; 
  object-fit: fill; 
}

/* ==========================================================================
   06. GLOBAL BEHAVIOR (SPLIT-SCROLL ARCHITECTURE)
   ========================================================================== */
/* Der komplette Viewport friert ein - die Seite selbst scrollt nie! */
html, body {
  height: 100dvh;
  overflow: hidden; 
}

/* Das Grid spannt sich als fester Rahmen exakt zwischen deinem Body-Padding auf */
.site-grid {
  height: calc(100dvh - 2rem);
}

/* Beide Spalten werden zu völlig unabhängigen Scroll-Containern */
.col-left,
.col-right {
  height: 100%;
  overflow-y: auto;
  scrollbar-width: none; /* Versteckt Scrollbars (Firefox) für minimales Design */
}

.col-left::-webkit-scrollbar,
.col-right::-webkit-scrollbar {
  display: none; /* Versteckt Scrollbars (Chrome/Safari/Edge) */
}

/* ==========================================================================
   07. MINIMAL LANDING PAGE
   ========================================================================== */
.minimal-landing {
  width: 100vw;
  height: 100dvh; 
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  background-color: #ffffff;
  position: fixed;
  top: 0;
  left: 0;
  overflow: hidden;
  padding: 1rem; 
}

.centerpiece-container {
  display: inline-flex; 
  flex-direction: column;
  align-items: center;
  gap: 1.5rem; 
  max-width: 90vw; 
}

.hover-group-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem; 
  width: 100%;
}

.centerpiece-top {
  width: 100%;
  text-align: center;
}

.centerpiece-image {
  opacity: 0;
  pointer-events: none; 
  transition: opacity 0.3s ease;
}

.hover-group-top:hover .centerpiece-image {
  opacity: 1;
  pointer-events: auto; 
}

.centerpiece-image a {
  display: block;
  transform: none !important;
}

.centerpiece-image img {
  display: block;
  width: auto;
  height: auto;
  max-width: clamp(300px, 65vw, 1000px); 
  max-height: 65dvh; 
  object-fit: contain;
  margin: 0 auto;
}

.centerpiece-bottom {
  display: flex;
  justify-content: space-between; 
  width: 100%;
}

.node-wrapper-left {
  transform: translateX(-50%);
}

.node-wrapper-right {
  transform: translateX(50%);
}

.text-node-link {
  position: relative;
  display: inline-block;
  text-decoration: none !important;
  color: #000;
  white-space: nowrap;
  transform: none !important;
}

.text-node-link .node-label {
  position: relative;
  z-index: 20; 
  display: inline-block;
  transition: opacity 0.2s ease;
  transform: scaleY(1.3); 
  transform-origin: top left;
}

.centerpiece-top .text-node-link {
  cursor: pointer;
}

.centerpiece-top .text-node-link:hover .node-label {
  opacity: 1;
}
.label-71 {
    font-size: max(1rem, clamp(12px, 3.5vw, 22px)) !important;
}

.label-chessclub {
  font-family: Helvetica, Arial, sans-serif;
  font-weight: bold;
  letter-spacing: normal !important;
  transform: none !important;
  font-size: max(1.25rem, clamp(16px, 4.5vw, 28px)) !important;
}

.label-archivbecker {
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 300;
  letter-spacing: 0.3em !important;
  text-transform: uppercase;
  transform: none !important;
    font-size: max(1rem, clamp(12px, 3.5vw, 22px)) !important;
}

/* Hover-Bilder für Archiv Becker & chess club */
.text-node-link .node-image {
  position: absolute;
  bottom: 140%; 
  left: 50%;
  transform: translate(-50%, -15px) !important; 
  width: auto;
  height: auto;
  max-width: 250px;   
  max-height: 160px;  
  object-fit: contain;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
  z-index: 10; 
}

.text-node-link:hover .node-image {
  opacity: 1;
  visibility: visible;
}

.about-diagram-box { 
  position: relative; 
  display: flex; 
  justify-content: center; 
  align-items: center; 
  aspect-ratio: 4 / 3; 
  padding: 0; 
  box-sizing: border-box; 
  z-index: 10; 
  cursor: default; 
  text-decoration: none; 
  -webkit-tap-highlight-color: transparent; 
  overflow: hidden; 
  transform: none !important; 
  container-type: inline-size; 
  width: 75ch; 
  max-width: 300px; 
}

.about-diagram-text-rotated { 
  position: relative; 
  z-index: 20; 
  letter-spacing: 0.1em; 
  white-space: nowrap; 
  font-size: 11cqi; 
}

/* ==========================================================================
   08. RESPONSIVE (TABLET & MOBILE)
   ========================================================================== */
@media (max-width: 1024px) {
  .content {
    grid-template-columns: 1fr;
  }
  .content > * {
    grid-column: 1 / -1 !important; 
    max-width: 100%;
  }
}

@media (max-width: 820px) {

  /* WICHTIG: Auf dem Handy frieren wir den Body wieder auf! */
  html, body { 
    height: auto; 
    overflow: visible; 
  }
  
  .site-grid {
    height: auto;
    /* (hier bleiben deine bestehenden flex-direction etc. drunter stehen) */
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 3rem; 
  }
  
  .col-left, .col-right {
    /* Spalten geben ihre Scroll-Fähigkeit wieder ab */
    height: auto !important; 
    overflow-y: visible !important; 
    display: contents; 
  }
  
  :root { 
    --font-size-base: 13px; 
  }
  
  body { 
    padding: 1rem; 
  }

  .site-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 3rem; 
  }

  .col-left, .col-right {
    display: contents; 
  }

  .col-nav-links, .col-current-exhibition-mobile, .col-list, .col-content, article.default-page {
    position: static !important;
    margin-top: 0 !important;
    height: auto !important;
    max-height: none !important;
    width: 100%;
  }

  /* Exakte Mobile-Reihenfolge von oben nach unten */
  .col-nav-links { order: 1; margin-bottom: 2rem !important; }
  .col-current-exhibition-mobile { order: 2; margin-bottom: 3rem !important; }
  .col-content, article.default-page { order: 3; margin-bottom: 3rem !important; }
  .col-list { order: 4; min-height: auto; }

  /* Single-Exhibition: mobilen Klon anzeigen und den aktiven Listeneintrag unten ausblenden */
  .template-exhibition .col-current-exhibition-mobile { display: block; }
  .template-exhibition .col-list #current-exhibition-item { display: none !important; }

  .col-footer { 
    order: 4; 
    margin-top: 3rem; 
    width: 100%; 
    padding-left: 0; 
    padding-bottom: 0; 
    margin-bottom: 0; 
  }
  
  
  /* Landingpage Mobile Anpassungen */
  .centerpiece-container,
  .hover-group-top {
    gap: 1rem; 
  }

  .centerpiece-image img {
    max-width: 100%;
    max-height: 70dvh;
  }

  .text-node-link .node-label {
    font-size: max(1rem, clamp(11px, 3vw, 14px)) !important;
  }

  .label-archivbecker {
    letter-spacing: 0.1em !important;
  }

  .text-node-link .node-image {
    max-width: 140px;
    max-height: 100px;
  }

  .node-wrapper-left .node-image {
    left: 0; 
    transform: translate(0, -8px) !important; 
  }
  
  .node-wrapper-right .node-image {
    left: auto; 
    right: 0; 
    transform: translate(0, -8px) !important; 
  }
  
  .node-wrapper-left,
  .node-wrapper-right {
    transform: translateX(0) !important;
  }

  .node-wrapper-left {
    text-align: left;
  }
  
  .node-wrapper-right {
    text-align: right;
  }

  /* --- MOBILE TEASER (exhibitions.php) --- */
  /* Versteckt alle Text- und Bildblöcke auf der Übersicht, lässt nur das Bild stehen */
  .template-exhibitions .exhibition-text > *:not(.invitation-link) {
    display: none !important;
  }
  /* Hebt die "Aktiv"-Markierung in der Liste der Übersichtsseite auf */
  .template-exhibitions .exhibition-list li.is-active .num-text {
    text-decoration: none !important;
  }
  
  /* Versteckt die ausklappenden PDFs in der Liste der Übersichtsseite */
  .template-exhibitions .exhibition-list li.is-active .downloads {
    display: none !important;
  }
}

@media (hover: none) {
  .centerpiece-image {
    opacity: 1;
    pointer-events: auto; 
  }
}

/* ==========================================================================
   09. RESPONSIVE: 4K DISPLAYS
   ========================================================================== */
@media (min-width: 2200px) {
  :root { 
    --font-size-base: 16px; 
  }
  
  .centerpiece-image img {
    max-width: clamp(1200px, 50vw, 1500px); 
    max-height: 75dvh; 
  }
  
  .text-node-link .node-label {
    font-size: max(1rem, clamp(28px, 1.5vw, 34px)) !important;
  }
  
  .text-node-link .node-image {
    max-width: 450px;   
    max-height: 300px;
  }
}

/* ==========================================================================
   10. SUBTLE FOOTER (LEGAL & PRIVACY)
   ========================================================================== */
.col-list {
  min-height: 100%; 
}

.col-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-left: 3.5rem; 
  margin-top: 2rem; 
  padding-bottom: 0; 
  margin-bottom: 0;
}

.col-footer a {
  color: inherit; 
  text-decoration: none;
}

.col-footer a:hover {
  text-decoration: underline;
}

.default-text a[href*="maps.app.goo.gl"],
.default-text a[href*="google.com/maps"],
.default-text a[href*="maps.google.com"] {
    text-decoration: none !important;
    border-bottom: none !important; 
}

.default-text a[href*="maps.app.goo.gl"]:hover,
.default-text a[href*="google.com/maps"]:hover,
.default-text a[href*="maps.google.com"]:hover {
    text-decoration: underline !important;
}