/* ========================================
   Haller Gassenspiele - Main Stylesheet
   ======================================== */

/* --- Design Tokens (CSS Custom Properties) --- */
:root {
  /* Colors */
  --color-background:      #B41F6F;
  --color-text:            #FFFFFF;
  --color-text-muted:      #A1A1A1;
  --color-text-hover:      #EEEEEE;
  --color-link:            #FFFFFF;
  --color-link-hover:      #DDDDDD;

  /* Typography - Mobile-First Scale */
  --font-body:            Arial, sans-serif;
  --font-content:         'Times New Roman', Times, serif;
  --font-size-base:       16px;         /* html root */
  --font-size-xs:         0.75rem;      /* 12px - footer, captions */
  --font-size-sm:         0.875rem;     /* 14px - nav links, metadata */
  --font-size-body:       1rem;         /* 16px - body text */
  --font-size-nav:        0.9375rem;    /* 15px - navigation */
  --font-size-content:    1.25rem;      /* 20px - main content text */
  --font-size-h3:         1.25rem;      /* 20px - section headings */
  --font-size-h2:         1.5rem;       /* 24px - play titles */
  --font-size-h1:         1.75rem;      /* 28px - page titles */
  --line-height-tight:    1.25;         /* headings */
  --line-height-body:     1.5;          /* body text */
  --line-height-content:  1.6;          /* content text */

  /* Layout */
  --container-max:        1140px;
  --container-padding:    1rem;
  --container-padding-lg: 2rem;
  --logo-size:            85px;
}

/* --- Desktop Font Scale Overrides --- */
@media (min-width: 768px) {
  :root {
    --font-size-content:  1.5rem;    /* 24px on tablet+ */
    --font-size-h2:       1.75rem;    /* 28px */
    --font-size-h1:       2rem;       /* 32px */
  }
}

/* --- Reset --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* --- Base --- */
html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
}

body {
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  min-height: 100vh;
}

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

a {
  color: var(--color-link);
  text-decoration: underline;
}

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

/* --- Skip Link (Accessibility) --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: #000;
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 9999;
  text-decoration: none;
  font-size: 0.875rem;
}

.skip-link:focus {
  top: 0;
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

@media (min-width: 1024px) {
  .container {
    padding: 0 var(--container-padding-lg);
  }
}

/* --- Site Header --- */
.site-header {
  position: relative;
  width: 100%;
  padding-top: 1rem;
  background-color: var(--color-background);
}

.site-header__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  position: relative;
}

/* --- Logo --- */
.logo {
  display: inline-block;
  flex-shrink: 0;
}

.logo img {
  width: var(--logo-size);
  height: 84px;
}

/* --- Navbar --- */
.navbar {
  width: 100%;
}

.navbar__list {
  display: flex;
  flex-direction: column;
  align-items: center;
  list-style: none;
  gap: 0.5rem;
  padding: 0;
  margin: 0;
}

.navbar__item {
  display: block;
}

.navbar__link {
  font-family: var(--font-body);
  font-size: var(--font-size-nav);
  color: var(--color-text-muted);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  display: block;
  transition: color 0.2s ease;
}

.navbar__link:hover {
  color: var(--color-text-hover);
}

.navbar__item--active .navbar__link {
  color: var(--color-text);
  font-weight: bold;
}

/* --- Hamburger Button --- */
.navbar__hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.navbar__hamburger-line {
  display: block;
  width: 28px;
  height: 3px;
  background-color: var(--color-text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hamburger animation when open */
.navbar__hamburger[aria-expanded="true"] .navbar__hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.navbar__hamburger[aria-expanded="true"] .navbar__hamburger-line:nth-child(2) {
  opacity: 0;
}

.navbar__hamburger[aria-expanded="true"] .navbar__hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile: hidden nav list by default */
@media (max-width: 1023px) {
  .navbar__list {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 1rem 0 2rem;
    gap: 0.5rem;
  }

  .navbar__list--open {
    display: flex;
  }

  .site-header__inner {
    position: relative;
  }
}

/* Desktop: horizontal nav */
@media (min-width: 1024px) {
  .site-header__inner {
    flex-direction: row;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 0;
  }

  .logo {
    margin-top: 1.5rem;
  }

  .navbar {
    margin-left: auto;
    margin-top: 2rem;
  }

  .navbar__list {
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
  }

  .navbar__item {
    display: inline-block;
    padding: 0 10px;
  }

  .navbar__hamburger {
    display: none;
  }
}

/* --- Main Content --- */
.main-content {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

/* --- Headings --- */
h1 {
  font-size: var(--font-size-h1);
  line-height: var(--line-height-tight);
  margin-bottom: 1rem;
}

h2 {
  font-size: var(--font-size-h2);
  line-height: var(--line-height-tight);
  margin-bottom: 0.75rem;
}

/* --- Content Typography --- */
.content-text {
  font-family: var(--font-content);
  font-size: var(--font-size-content);
  line-height: var(--line-height-content);
  color: var(--color-text);
  max-width: 800px;
  margin: 0 auto;
}

.content-text p {
  margin-bottom: 1rem;
}

.content-text a {
  color: var(--color-link);
  text-decoration: underline;
}

.content-text a:hover {
  color: var(--color-link-hover);
}

/* --- Home Page --- */
.home-banner {
  position: relative;
  text-align: center;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .home-banner {
    margin-bottom: 0;
  }
}

.home-banner img {
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.home-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.home-grid__cta {
  text-align: center;
}

.home-grid__cta a {
  display: inline-block;
}

.home-grid__cta img {
  width: 246px;
  height: auto;
}

.home-grid__info {
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  max-width: 520px;
  text-align: left;
}

.home-grid__info p {
  margin-bottom: 0.25rem;
}

@media (min-width: 768px) {
  .home-grid {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 2rem;
    position: relative;
    margin-top: 2rem;
  }

  .home-grid__cta {
    position: relative;
    z-index: 10;
    margin-top: -160px;
  }
}

/* --- Tickets Page --- */
.tickets-content {
  max-width: 800px;
  margin: 0 auto;
}

.tickets-content .content-text {
  text-align: left;
}

.ticketleo-btn {
  display: block;
  margin: 1.5rem auto;
  text-align: center;
}

.ticketleo-btn img {
  width: 188px;
  height: auto;
}

/* --- Sponsoren Page --- */
.sponsoren-banner {
  text-align: center;
  margin-top: 2rem;
}

.sponsoren-banner img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* --- Press Quotes Cards --- */
.press-quotes {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.press-quote {
  background: rgba(255, 255, 255, 0.1);
  border-left: 3px solid rgba(255, 255, 255, 0.6);
  border-radius: 0 6px 6px 0;
  padding: 1rem 1.25rem;
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-height: 200px;
}

.press-quote__text {
  font-family: var(--font-content);
  font-size: var(--font-size-h3);
  line-height: var(--line-height-content);
  font-style: italic;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.press-quote__source {
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-body);
  color: var(--color-text);
  font-style: normal;
  display: block;
}

@media (min-width: 768px) {
  .press-quotes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

/* --- Kontakt Page --- */
.kontakt-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}

.kontakt-grid__info {
  max-width: 480px;
}

.kontakt-grid__map {
  max-width: 533px;
}

.kontakt-grid__map img {
  width: 100%;
  height: auto;
}

@media (min-width: 768px) {
  .kontakt-grid {
    flex-direction: row;
    justify-content: center;
  }
}

/* --- Gallery Index --- */
.gallery-intro {
  text-align: center;
  margin-bottom: 2rem;
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  max-width: 850px;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.gallery-thumb {
  position: relative;
  display: block;
}

.gallery-thumb__image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 254 / 197;
    object-fit: cover;
  }

.gallery-thumb__label {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  font-family: var(--font-content);
  font-size: clamp(1.125rem, 3vw, 1.5rem);
  font-weight: bold;
  color: var(--color-white, #ffffff);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

/* --- Gallery Year Pages --- */
.gallery-year {
  max-width: 1024px;
  margin: 0 auto;
}

/* Back link */
.gallery-year__back {
  display: inline-block;
  margin-bottom: 1rem;
  font-family: var(--font-body);
  font-size: var(--font-size-sm);
  color: var(--color-link);
  text-decoration: none;
}

.gallery-year__back:hover {
  color: var(--color-link-hover);
}

.gallery-year__title {
  font-family: var(--font-content);
  font-size: var(--font-size-h1);
  line-height: var(--line-height-tight);
  margin-bottom: 0.5rem;
}

.gallery-year__play {
  font-family: var(--font-content);
  font-size: var(--font-size-h2);
  line-height: var(--line-height-tight);
  margin-bottom: 0.25rem;
}

.gallery-year__author {
  font-family: var(--font-content);
  font-size: var(--font-size-content);
  line-height: var(--line-height-body);
  display: block;
  margin-bottom: 0;
}

/* === Unified Gallery Year Layout === */

.gallery-year__header {
  text-align: center;
  padding: 1rem 0 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  margin-bottom: 2rem;
}

.gallery-year__header .gallery-year__back {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: var(--font-size-sm);
}

/* Photo grid: CSS Multi-Column Masonry — gap-free tile layout */
.gallery-year__photos {
  column-count: 1;
  column-gap: 1rem;
}

.gallery-year__photos > picture {
  display: block;
  width: 100%;
  margin-bottom: 1rem;
  break-inside: avoid;
}

.gallery-year__photos > picture > img {
  display: block;
  width: 100%;
  height: auto;
}

.gallery-year__photos > picture:last-child {
  margin-bottom: 0;
}

/* Credits */
.gallery-year__credits {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.2);
  font-family: var(--font-body);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.gallery-year__credits p {
  margin-bottom: 0.5rem;
}

.gallery-year__credits .gallery-year__back {
  display: inline-block;
  margin-top: 1rem;
}

/* Tablet: 2 columns */
@media (min-width: 640px) {
  .gallery-year__photos {
    column-count: 2;
  }
}

/* Desktop: 3 columns */
@media (min-width: 1024px) {
  .gallery-year__photos {
    column-count: 3;
  }
}
/* --- Footer --- */
.site-footer {
  text-align: center;
  padding: 2rem 0;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

/* --- Utility --- */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ========================================
   Small Phone Breakpoint (< 480px)
   ======================================== */
@media (max-width: 479px) {
  /* Reduce padding */
  .container {
    padding: 0 0.75rem;
  }

  /* Tighter spacing */
  .main-content {
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .gallery-year__header {
    padding: 0.75rem 0 1.5rem;
    margin-bottom: 1.5rem;
  }

  /* Ensure touch targets are large enough */
  .navbar__link {
    padding: 0.5rem 0.75rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .navbar__item {
    padding: 0;
  }

  /* Gallery photos: ensure proper spacing */
  .gallery-year__photos > picture {
    margin-bottom: 0.75rem;
  }

  /* Home grid info text */
  .home-grid__info {
    font-size: var(--font-size-body);
    line-height: var(--line-height-body);
  }
}

/* ========================================
   Tablet Breakpoint (480px - 767px)
   ======================================== */
@media (min-width: 480px) and (max-width: 767px) {
  .gallery-year__photos {
    column-count: 2;
  }
}
