/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-brown: #5C4033;
  --color-brown-light: #8B7355;
  --color-orange: #E8790C;
  --color-text: #6B6B6B;
  --color-text-dark: #3D3D3D;
  --color-bg: #ffffff;
  --color-bg-light: #f5f5f5;
  --color-border: #e0e0e0;
  --font-main: 'Jura', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --max-width: 1200px;
  --header-height: 70px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  font-size: 16px;
}

a {
  color: var(--color-text-dark);
  text-decoration: none;
}

a:hover {
  color: var(--color-orange);
}

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

h1, h2, h3 {
  color: var(--color-text-dark);
  font-weight: 300;
  line-height: 1.3;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

p {
  margin-bottom: 0.8rem;
}

/* ===== PAGE TRANSITIONS ===== */
body {
  animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(40px);
  }
  to {
    transform: translateX(0);
  }
}

body.page-leaving {
  animation: slideOut 0.35s ease-in forwards;
}

@keyframes slideOut {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-40px);
  }
}

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  border-bottom-color: var(--color-border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-text-dark);
}

.logo-bar {
  width: 4px;
  height: 42px;
  background: var(--color-orange);
  border-radius: 2px;
  flex-shrink: 0;
}

.logo-text {
  font-size: 1.15rem;
  font-weight: 400;
  line-height: 1.3;
}

.logo-text span {
  display: block;
}

/* Navigation */
.main-nav ul {
  display: flex;
  list-style: none;
  gap: 1.8rem;
}

.main-nav a {
  font-size: 0.95rem;
  color: var(--color-text);
  transition: color 0.2s;
  padding: 0.5rem 0;
  position: relative;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--color-text-dark);
}

.main-nav a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--color-text-dark);
}

/* Hamburger */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text-dark);
  margin: 5px 0;
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== HERO ===== */
.hero {
  width: 100%;
  height: 100vh;
  position: relative;
  overflow: hidden;
  margin-top: calc(-1 * var(--header-height));
}

.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

/* Home page: hero below header, cards overlap */
.page-home .hero {
  height: calc(100vh - var(--header-height));
  margin-top: 0;
}

.page-home .hero img {
  object-position: center 40%;
}

.page-home .categories {
  margin-top: -10rem;
  position: relative;
  z-index: 2;
  padding-bottom: 1rem;
}

/* ===== CONTENT SECTIONS ===== */
.content-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 2rem;
}

.content-section-gray {
  background: var(--color-bg-light);
}

.content-section-gray .content-section {
  padding: 3rem 2rem;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 300;
  color: var(--color-text-dark);
  margin-bottom: 2rem;
  padding-top: 2rem;
}

.page-subtitle {
  font-size: 1.6rem;
  font-weight: 300;
  color: var(--color-text-dark);
  margin-bottom: 1.5rem;
}

/* ===== HOME CATEGORIES ===== */
.categories {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem;
}

.category-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: var(--color-text-dark);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.category-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.category-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.2rem;
}

.category-card-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-text-dark);
  margin: 0;
}

.events-link {
  text-decoration: none;
  color: var(--color-text-dark);
}

.category-card-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  padding: 0 1.2rem;
}

.category-card-images img {
  width: 100%;
  aspect-ratio: 1.36;
  object-fit: cover;
  border-radius: 5px;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.category-card-descriptions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.8rem 1.2rem;
  flex: 1;
}

.category-card-descriptions p {
  font-size: 0.75rem;
  color: var(--color-text);
  line-height: 1.4;
  margin: 0;
}

.category-card-descriptions h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text-dark);
  margin-bottom: 0.2rem;
}

.category-card-full {
  padding: 0 1.2rem;
}

.category-card-full img {
  width: 100%;
  aspect-ratio: 2.8;
  object-fit: cover;
  border-radius: 5px;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.category-card-text {
  padding: 0.8rem 1.2rem;
  font-size: 0.9rem;
  color: var(--color-text);
  line-height: 1.5;
  flex: 1;
}

.category-card-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  padding: 0.5rem 1.2rem 1rem;
}

.card-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom, rgb(70, 70, 70), rgb(40, 40, 40));
  color: #fff !important;
  border-radius: 5px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
  transition: background 0.2s, box-shadow 0.2s;
  border: 1px solid rgba(0,0,0,0.2);
}

.card-button:hover {
  background: linear-gradient(to bottom, rgb(80, 80, 80), rgb(48, 48, 48));
  color: #fff !important;
  box-shadow: 0 3px 8px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.15);
}


/* ===== GALLERY GRID ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 2rem;
}

.gallery-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  cursor: pointer;
  transition: opacity 0.2s;
}

.gallery-grid img:hover {
  opacity: 0.85;
}

/* Gallery with captions (Kunst/Keramik) */
.gallery-captioned {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

.gallery-item {
  text-align: center;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

.gallery-item figcaption {
  font-size: 0.9rem;
  color: var(--color-text);
}

/* ===== LIGHTBOX ===== */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  padding: 1rem;
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

/* ===== EVENTS / PROGRAM ===== */
.program-intro {
  margin-bottom: 1rem;
}

.program-intro h2 {
  margin-top: 1.5rem;
}

.opening-hours {
  font-size: 1.1rem;
  color: var(--color-brown);
  margin-top: 1.5rem;
}

.program-season {
  margin: 1rem 0;
}

.program-dates {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text-dark);
  margin-bottom: 1rem;
}

.program-event {
  margin: 1.5rem 0;
  padding: 1.2rem 1.5rem;
  border-left: 3px solid var(--color-orange);
  background: var(--color-bg-light);
}

.program-event h3 {
  color: var(--color-text-dark);
  margin-bottom: 0.3rem;
}

.program-highlight {
  border-left-color: var(--color-brown);
}

.program-closing {
  text-align: center;
  font-size: 1.05rem;
  color: var(--color-text-dark);
  margin: 2rem 0;
}

.program-contact {
  text-align: center;
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--color-bg-light);
  border-radius: 4px;
}

.program-contact a {
  color: var(--color-brown);
}

.program-contact a:hover {
  color: var(--color-orange);
}

/* ===== DIVIDER ===== */
.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 2rem 0;
}

/* ===== FOOTER ===== */
.site-footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--color-border);
  margin-top: 3rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  list-style: none;
}

.footer-links a {
  font-size: 0.9rem;
  color: var(--color-text);
  text-decoration: underline;
}

.footer-links a:hover {
  color: var(--color-text-dark);
}

/* ===== KONTAKT / IMPRESSUM ===== */
.legal-section {
  background: var(--color-bg-light);
  min-height: calc(100vh - var(--header-height) - 100px);
}

.legal-section .content-section {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .categories {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  .main-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    pointer-events: none;
    z-index: 99;
  }

  .main-nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 1rem 0;
  }

  .main-nav a {
    display: block;
    padding: 0.8rem 2rem;
  }

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

  .gallery-captioned {
    grid-template-columns: 1fr;
  }

  .categories {
    grid-template-columns: 1fr;
  }

  h1, .page-title {
    font-size: 2rem;
  }

  .hero {
    height: 60vh;
  }

  .content-section {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr 1fr;
  }

  h1, .page-title {
    font-size: 1.6rem;
  }

  .logo-text {
    font-size: 1rem;
  }

  .site-header {
    padding: 0 1rem;
  }
}
