/* ============================================
   BILDGALERIE - CSS STYLES
   ============================================ */

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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background-color: #ffffff;
}

.hidden {
  display: none !important;
}

/* Prevent image dragging */
img {
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  pointer-events: none;
}

/* ============================================
   PASSWORT-OVERLAY / LOGIN
   ============================================ */
.password-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.password-container {
  text-align: left;
  max-width: 650px;
  width: 100%;
  padding: 2rem 50px;
}

/* Login Headline */
.login-headline {
  display: block;
}

.headline-bold {
  display: block;
  font-family: 'League Spartan', Arial, sans-serif;
  font-size: 35pt;
  font-weight: 600;
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  line-height: 1.0;
}

.headline-light {
  display: block;
  font-family: 'League Spartan', Arial, sans-serif;
  font-size: 35pt;
  font-weight: 100;
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  line-height: 1.0;
  margin-top: 0;
}

/* Login Divider */
.password-container .divider {
  width: 100px;
  height: 1px;
  background-color: #1a1a1a;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Login Intro Text */
.login-intro {
  font-family: 'League Spartan', Arial, sans-serif;
  font-size: 15pt;
  font-weight: 400;
  color: #333;
  line-height: 1.5;
  margin-bottom: 2rem;
  text-align: left;
}

/* Password Form */
#password-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 350px;
  margin-top: 1.5rem;
}

#password-form label {
  font-family: 'League Spartan', Arial, sans-serif;
  font-size: 11pt;
  font-weight: 600;
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#password-input {
  padding: 0.75rem 0;
  font-family: 'League Spartan', Arial, sans-serif;
  font-size: 14pt;
  border: none;
  border-bottom: 1px solid #ddd;
  background: transparent;
  text-align: left;
  transition: border-color 0.2s;
}

#password-input:focus {
  outline: none;
  border-bottom-color: #1a1a1a;
}

#password-form button {
  align-self: flex-end;
  padding: 0.6rem 1.5rem;
  font-family: 'League Spartan', Arial, sans-serif;
  font-size: 11pt;
  font-weight: 400;
  background-color: transparent;
  color: #1a1a1a;
  border: 1px solid #1a1a1a;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  margin-top: 0.5rem;
}

#password-form button:hover {
  background-color: #1a1a1a;
  color: #fff;
}

.error-message {
  font-family: 'League Spartan', Arial, sans-serif;
  color: #d32f2f;
  font-size: 0.9rem;
  margin-top: 0.5rem;
  min-height: 1.5em;
}

/* Login Footer */
.login-footer {
  position: fixed;
  bottom: 30px;
  right: 50px;
  font-family: 'League Spartan', Arial, sans-serif;
  font-size: 11pt;
  font-weight: 400;
  color: #1a1a1a;
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* ============================================
   GALERIE-WRAPPER
   ============================================ */
.gallery-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #ffffff;
}

/* ============================================
   NAVIGATION ARROWS
   ============================================ */
.nav-arrow {
  position: fixed;
  top: var(--gallery-margin, 12px);
  width: 50px;
  height: 50px;
  background: #ffffff;
  border: none;
  border-radius: 0;
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  opacity: 0;
  pointer-events: none;
  color: #D9D9D9;
}

.nav-arrow.visible {
  opacity: 1;
  pointer-events: auto;
}

.nav-arrow:hover {
  background: #ffffff;
  color: #747474;
}

.nav-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.nav-arrow svg {
  width: 24px;
  height: 24px;
}

.nav-arrow-left {
  left: var(--gallery-margin, 12px);
}

.nav-arrow-right {
  right: var(--gallery-margin, 12px);
}

/* ============================================
   GALERIE VIEWPORT & TRACK
   ============================================ */
.gallery-viewport {
  position: absolute;
  top: var(--gallery-margin, 12px);
  left: var(--gallery-margin, 12px);
  right: var(--gallery-margin, 12px);
  bottom: var(--gallery-margin, 12px);
  overflow: hidden;
  cursor: grab;
}

.gallery-viewport:active {
  cursor: grabbing;
}

.gallery-track {
  display: flex;
  height: 100%;
  gap: var(--image-gap, 12px);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.gallery-track.dragging {
  transition: none;
}

/* ============================================
   SECTION INTRO (TEXT)
   ============================================ */
.section-intro {
  flex-shrink: 0;
  width: 750px; /* 50px left margin + 650px content + 50px right margin */
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-left: 50px;
  padding-right: 50px;
  padding-top: 100px; /* double nav button height */
  padding-bottom: 20px;
  overflow-y: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.section-intro::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.section-intro .location {
  font-family: 'League Spartan', Arial, sans-serif;
  font-size: 35pt;
  font-weight: 100;
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  line-height: 1.0;
  margin-bottom: 0;
}

.section-intro .headline {
  font-family: 'League Spartan', Arial, sans-serif;
  font-size: 35pt;
  font-weight: 600;
  font-style: normal;
  color: #1a1a1a;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  line-height: 1.0;
  margin-top: 0;
}

.section-intro .divider {
  width: 100px;
  height: 1px;
  background-color: #1a1a1a;
  margin-top: 1.2rem;
  margin-bottom: 1.2rem;
}

.section-intro .info-block {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.section-intro .info-line {
  font-family: 'League Spartan', Arial, sans-serif;
  font-size: 15pt;
  line-height: 1.4;
  letter-spacing: 0;
}

.section-intro .info-label {
  font-weight: 600;
  text-transform: uppercase;
}

.section-intro .info-value {
  font-weight: 400;
}

.section-intro .text {
  font-family: 'League Spartan', Arial, sans-serif;
  font-size: 15pt;
  font-weight: 400;
  color: #333;
  line-height: 1.5;
  margin-top: 1.5rem;
  max-width: 650px;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
  -ms-hyphens: auto;
  word-spacing: -0.05em;
}

.section-intro .text p {
  text-indent: 1em;
  margin-bottom: 0.8em;
}

.section-intro .text p:first-child {
  text-indent: 0;
}

.section-intro .text p:last-child {
  margin-bottom: 0;
}

/* ============================================
   GALLERY ITEMS (BILDER)
   ============================================ */
.gallery-item {
  flex-shrink: 0;
  height: 100%;
  display: flex;
  align-items: center;
}

.gallery-item img {
  height: 100%;
  width: auto;
  object-fit: contain;
  display: block;
}

/* ============================================
   THUMBNAIL NAVIGATION
   ============================================ */
.thumbnail-nav {
  position: fixed;
  bottom: 0;
  left: var(--gallery-margin, 12px);
  right: var(--gallery-margin, 12px);
  height: 80px;
  background: #ffffff;
  border: none;
  padding: 10px 0;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 200;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.thumbnail-nav.visible {
  transform: translateY(0);
}

/* Thumbnail Navigation Arrows */
.thumbnail-nav-arrow {
  flex-shrink: 0;
  width: 30px;
  height: 50px;
  background: #EBE9E9;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.thumbnail-nav-arrow.visible {
  opacity: 1;
  pointer-events: auto;
}

.thumbnail-nav-arrow:hover {
  background: #D9D9D9;
}

.thumbnail-nav-arrow svg {
  width: 16px;
  height: 16px;
}

.thumbnail-nav-arrow-left {
  margin-right: 8px;
}

.thumbnail-nav-arrow-right {
  margin-left: 8px;
}

.thumbnail-track {
  display: flex;
  gap: 6px;
  height: 100%;
  flex: 1;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
}

.thumbnail-track::-webkit-scrollbar {
  display: none;
}

.thumbnail-item {
  flex-shrink: 0;
  height: 50px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s, transform 0.2s;
}

.thumbnail-item:hover {
  opacity: 1;
  transform: scale(1.05);
}

.thumbnail-item.active {
  opacity: 1;
}

.thumbnail-item img {
  height: 100%;
  width: auto;
  display: block;
  pointer-events: auto;
}

/* Thumbnail Intro Icon */
.thumbnail-intro {
  width: 30px;
}

.thumbnail-intro img {
  width: 30px;
  height: 50px;
}

/* Thumbnail Section Divider - hidden, intro icons separate sections */
.thumbnail-divider {
  display: none;
}

/* Position Indicator */
.thumbnail-indicator {
  position: absolute;
  bottom: 5px;
  left: 15px;
  height: 3px;
  background-color: #1a1a1a;
  transition: left 0.3s, width 0.3s;
  border-radius: 2px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
  .section-intro {
    width: 450px;
    padding-top: 70px;
    padding-left: 40px;
    padding-right: 40px;
  }

  .section-intro .location {
    font-size: 28pt;
  }

  .section-intro .headline {
    font-size: 28pt;
  }

  .section-intro .info-line {
    font-size: 13pt;
  }

  .section-intro .text {
    font-size: 13pt;
    line-height: 1.3;
  }

  .nav-arrow {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 768px) {
  :root {
    --gallery-margin: 15px;
  }

  .section-intro {
    width: 380px;
    padding-top: 60px;
    padding-left: 35px;
    padding-right: 35px;
  }

  .section-intro .location {
    font-size: 20pt;
  }

  .section-intro .headline {
    font-size: 20pt;
  }

  .section-intro .info-line {
    font-size: 10pt;
  }

  .section-intro .text {
    font-size: 11pt;
    line-height: 1.2;
  }

  .nav-arrow {
    width: 40px;
    height: 40px;
  }

  .nav-arrow-left {
    left: 10px;
  }

  .nav-arrow-right {
    right: 10px;
  }

  .thumbnail-nav {
    height: 70px;
  }

  .thumbnail-item {
    height: 40px;
  }

  /* Login responsive */
  .headline-bold,
  .headline-light {
    font-size: 28pt;
  }

  .headline-light {
    letter-spacing: 0.12em;
  }

  .password-container {
    padding: 1.5rem 30px;
  }

  .password-container .divider {
    margin-top: 1.2rem;
    margin-bottom: 1.2rem;
  }

  .login-intro {
    font-size: 14pt;
    line-height: 1.4;
    margin-bottom: 1.5rem;
  }

  .login-footer {
    bottom: 15px;
    right: 30px;
    font-size: 10pt;
  }
}

@media (max-width: 480px) {
  :root {
    --gallery-margin: 10px;
  }

  .section-intro {
    width: 320px;
    padding-top: 50px;
    padding-left: 25px;
    padding-right: 25px;
  }

  .section-intro .location {
    font-size: 15pt;
  }

  .section-intro .headline {
    font-size: 15pt;
  }

  .section-intro .info-line {
    font-size: 12pt;
  }

  .section-intro .text {
    font-size: 11pt;
    line-height: 1.1;
  }

  .nav-arrow {
    display: none;
  }

  .thumbnail-nav {
    height: 60px;
    left: 10px;
    right: 10px;
  }

  .thumbnail-item {
    height: 35px;
  }

  .thumbnail-intro {
    width: 21px;
  }

  .thumbnail-intro img {
    width: 21px;
    height: 35px;
  }

  /* Login responsive */
  .headline-bold,
  .headline-light {
    font-size: 16pt;
  }

  .headline-light {
    letter-spacing: 0.08em;
  }

  .password-container {
    padding: 1rem 20px;
  }

  .password-container .divider {
    margin-top: 0.8rem;
    margin-bottom: 0.8rem;
  }

  .login-intro {
    font-size: 11pt;
    line-height: 1.3;
    margin-bottom: 1rem;
  }

  #password-form {
    margin-top: 1rem;
  }

  #password-form label {
    font-size: 9pt;
  }

  #password-input {
    font-size: 12pt;
  }

  .login-footer {
    bottom: 10px;
    right: 20px;
    font-size: 9pt;
  }
}

/* ============================================
   LOADING STATE
   ============================================ */
.gallery-item.loading {
  background: #f0f0f0;
  min-width: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item.loading::after {
  content: '';
  width: 30px;
  height: 30px;
  border: 3px solid #ddd;
  border-top-color: #1a1a1a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   FADE-IN ANIMATION
   ============================================ */

/* Initialer Zustand: unsichtbar, leicht nach rechts versetzt */
.fade-element {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* Sichtbarer Zustand nach Intersection */
.fade-element.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Section-Intro: etwas längere Animation */
.section-intro.fade-element {
  transition: opacity 1.0s ease-out, transform 1.0s ease-out;
}

/* Loading-Spinner nur anzeigen wenn Element sichtbar aber Bild noch lädt */
.gallery-item.fade-element:not(.visible).loading::after {
  display: none;
}
