:root {
  --space: clamp(1.5rem, 4vw, 4rem);
  --max-w: 1280px;
}

body {
  margin: 0;
  background: #e1dcd2;
  color: #1f1a15;
  font-family: "Raleway", sans-serif;
}

.top-nav {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--space) calc(var(--space) * 1.5) 0;
}

.top-nav-logo {
  display: none;
  font-family: "Playfair Display", serif;
  letter-spacing: 0.14em;
  font-size: 1.05rem;
  color: #2f271f;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.top-nav-logo:hover {
  border-color: #9c8468;
}

.top-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  min-width: 44px;
  min-height: 44px;
  margin: -8px -8px -8px 0;
  padding: 8px;
  cursor: pointer;
  font: inherit;
  border: 0;
  background: none;
  color: inherit;
}

.top-nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #1f1a15;
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.top-nav .top-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.top-nav a {
  text-decoration: none;
  color: #2f271f;
  border-bottom: 1px solid transparent;
}

.top-nav .top-nav-list a[aria-current="page"] {
  border-bottom: 2px solid #9c8468;
  padding-bottom: 2px;
}

.top-nav .top-nav-list a:hover {
  border-color: #9c8468;
}

.sub-header {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 36px calc(var(--space) * 1.5) 20px;
}

.sub-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-family: "Playfair Display", serif;
  letter-spacing: 0.03em;
}

.sub-text {
  margin: 8px 0 0;
  color: #4b4339;
}

.art-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 10px calc(var(--space) * 1.5) 40px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  grid-auto-flow: dense;
}

.art-item {
  display: flex;
  flex-direction: column;
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(30, 26, 20, 0.12);
  background: #d3cbbf;
}

/* Bildfläche: Seitenverhältnis nur hier, kein Text darüber */
.art-item-visual {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  width: 100%;
}

.art-item-visual picture {
  display: block;
  width: 100%;
  height: 100%;
}

.art-grid .art-item-visual img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.35s ease;
  cursor: zoom-in;
}

.art-item:hover .art-item-visual img {
  transform: scale(1.04);
}

.span-3x4 { grid-column: span 3; }
.span-4x3 { grid-column: span 4; }
.span-6x4 { grid-column: span 6; }
.span-5x7 { grid-column: span 5; }
.span-7x5 { grid-column: span 7; }

.art-item.span-3x4 .art-item-visual { aspect-ratio: 3/4; }
.art-item.span-4x3 .art-item-visual { aspect-ratio: 4/3; }
.art-item.span-6x4 .art-item-visual { aspect-ratio: 6/4; }
.art-item.span-5x7 .art-item-visual { aspect-ratio: 5/7; }
.art-item.span-7x5 .art-item-visual { aspect-ratio: 7/5; }

/* Titel unter dem Bild (nicht auf dem Foto) */
.art-caption-below {
  position: static;
  flex-shrink: 0;
  margin: 0;
  padding: 0.5rem 0.4rem 0.35rem;
  pointer-events: none;
  background: transparent;
}

.art-caption-below .art-title {
  margin: 0;
  font-family: "Playfair Display", "Georgia", serif;
  font-weight: 600;
  font-size: clamp(0.8rem, 1.65vw, 0.92rem);
  line-height: 1.35;
  letter-spacing: 0.04em;
  color: #2a221a;
  text-align: center;
  text-shadow: none;
}

.art-caption-below .art-caption-placeholder {
  font-weight: 500;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #5b5145;
}

/* Beschreibung nur für Lightbox */
.art-caption-below .art-desc {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.art-caption--metadata-only {
  padding: 0 !important;
  margin: 0 !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  position: absolute !important;
}

.art-item.is-placeholder .art-item-visual img {
  cursor: default;
  object-fit: cover;
  opacity: 0.92;
}

.art-item.is-placeholder:hover .art-item-visual img {
  transform: none;
}

.sub-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px 16px;
  box-sizing: border-box;
}

.sub-lightbox.open {
  display: flex;
}

.sub-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  background: rgba(20, 17, 14, 0.9);
  cursor: zoom-out;
}

.sub-lightbox-inner {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 1100px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  overflow: auto;
  pointer-events: none;
}

.sub-lightbox-inner img,
.sub-lightbox-inner .sub-lightbox-caption {
  pointer-events: auto;
}

.sub-lightbox img {
  max-width: 100%;
  max-height: min(78vh, 860px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  cursor: zoom-out;
}

.sub-lightbox-caption {
  margin: 0;
  max-width: 52rem;
  color: #ece8e2;
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-line;
  text-align: center;
}

.sub-close {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 2;
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  background: none;
  border: none;
  padding: 8px;
  pointer-events: auto;
}

.sub-close:hover {
  opacity: 0.85;
}

.site-intern-footer {
  width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
  padding: 0.65rem max(calc(var(--space) * 1.5), env(safe-area-inset-right, 0px)) max(0.65rem, env(safe-area-inset-bottom, 0px)) max(calc(var(--space) * 1.5), env(safe-area-inset-left, 0px));
  border-top: 1px solid rgba(45, 39, 31, 0.12);
  background: #d9d0c3;
}

.site-footer-inner {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  max-width: 100%;
}

.site-footer-left {
  margin: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex: 1 1 auto;
  font-size: 0.82rem;
  color: #5b5147;
}

.site-footer-copyright {
  flex-shrink: 0;
  white-space: nowrap;
}

.site-footer-sep {
  flex-shrink: 0;
  opacity: 0.45;
  user-select: none;
}

.site-footer-email {
  flex: 1 1 auto;
  min-width: 0;
  color: #2f271f;
  text-decoration: none;
  border-bottom: 1px solid #9c8468;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-footer-email:hover {
  color: #9c8468;
}

.intern-link {
  flex: 0 0 auto;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6a655c;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  opacity: 0.88;
}

.intern-link:hover {
  opacity: 1;
  color: #4b4339;
  border-bottom-color: #9c8468;
}

@media (max-width: 900px) and (min-width: 769px) {
  .top-nav {
    position: relative;
    z-index: 20;
  }
}

@media (max-width: 900px) {
  .art-grid { grid-template-columns: repeat(6, 1fr); }
  .span-6x4, .span-7x5 { grid-column: span 6; }
  .span-5x7, .span-4x3 { grid-column: span 3; }
  .span-3x4 { grid-column: span 3; }
}

/* Mobil: nur Logo + Burger, Menü als Overlay */
@media (max-width: 768px) {
  .top-nav {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    z-index: 200;
    pointer-events: none;
    position: relative;
  }

  .top-nav .top-nav-logo,
  .top-nav .top-nav-toggle {
    pointer-events: auto;
    position: relative;
    z-index: 220;
  }

  .top-nav-logo {
    display: block;
    grid-column: 1;
    justify-self: start;
  }

  .top-nav-toggle {
    display: flex;
    grid-column: 2;
    justify-self: end;
  }

  .top-nav .top-nav-list {
    display: none;
    position: fixed;
    top: max(14px, calc(env(safe-area-inset-top, 0px) + 10px));
    right: max(14px, env(safe-area-inset-right, 0px));
    bottom: max(14px, env(safe-area-inset-bottom, 0px));
    left: max(14px, env(safe-area-inset-left, 0px));
    z-index: 210;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    padding: max(var(--space), 1.25rem) var(--space);
    background: linear-gradient(165deg, #e3dad0 0%, #d9cdbf 55%, #cfc2b4 100%);
    border: 2px solid #9c8468;
    border-radius: 14px;
    box-shadow:
      0 14px 36px rgba(45, 42, 38, 0.14),
      0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    pointer-events: auto;
  }

  .top-nav.is-open .top-nav-list {
    display: flex;
  }

  .top-nav.is-open .top-nav-list a {
    font-size: 1.125rem;
    padding: 0.35rem 0;
  }

  .top-nav.is-open .top-nav-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .top-nav.is-open .top-nav-toggle span:nth-child(2) {
    opacity: 0;
  }

  .top-nav.is-open .top-nav-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}
