:root {
  --home-surface-strong: rgba(2, 6, 23, 0.94);
  --home-accent: #22d3ee;
  --home-text: #f8fafc;
  --home-muted: #cbd5e1;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 10000;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: var(--home-text);
  color: #020617;
  transform: translateY(-180%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

#main-content {
  max-width: 1100px;
  padding: 0 1.5rem 1.5rem;
}

.gallery-section {
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid rgba(30, 64, 175, 0.4) !important;
  border-radius: 1.25rem;
  background: radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), var(--home-surface-strong)) !important;
  scroll-margin-top: 6rem;
}

.gallery-intro {
  max-width: 68ch;
  margin: 0 auto 1.25rem;
  text-align: center;
}

#gallery-heading {
  margin: 0 0 0.5rem;
  background: none;
  color: var(--home-text);
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 750;
  letter-spacing: -0.025em;
  text-transform: none;
  -webkit-text-fill-color: currentColor;
}

#search-container {
  position: relative;
  width: min(100%, 760px);
  margin: 0 auto 0.75rem;
}

#search-input {
  min-height: 3.25rem;
  padding: 0.8rem 3.25rem 0.8rem 1.1rem;
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(2, 6, 23, 0.75);
  font-size: 1rem;
}

#search-reset {
  position: absolute;
  top: 50%;
  right: 0.9rem;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--home-muted);
  font-size: 1.55rem;
  transform: translateY(-50%);
}

.search-suggestions,
#search-suggestions {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  left: 0;
  z-index: 50;
  max-height: 16rem;
  overflow-y: auto;
  padding: 0.35rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 0.9rem;
  background: rgba(2, 6, 23, 0.97);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(14px);
}

.suggestion-item {
  border-radius: 0.65rem;
}

#keyword-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  width: min(100%, 860px);
  min-height: 2rem;
  margin: 0 auto 1rem;
}

#keyword-tags button,
#empty-state-reset {
  padding: 0.38rem 0.75rem !important;
  border: 1px solid rgba(103, 232, 249, 0.25) !important;
  border-radius: 999px !important;
  background: rgba(8, 145, 178, 0.12) !important;
  color: var(--home-muted) !important;
  cursor: pointer;
  font-size: 0.78rem !important;
}

#keyword-tags button:hover,
#keyword-tags button:focus-visible,
#empty-state-reset:hover,
#empty-state-reset:focus-visible {
  border-color: var(--home-accent) !important;
  color: var(--home-text) !important;
}

#gallery-info {
  margin: 0 auto 0.9rem;
  color: var(--home-muted);
}

#sort-options {
  margin-bottom: 1.25rem;
}

#sort-options button {
  min-height: 2.6rem;
  padding: 0.55rem 0.95rem;
  border-color: rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.7);
}

#sort-options button:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

#sort-options button.active,
#sort-options button[aria-pressed="true"] {
  background: var(--home-accent);
  color: #022c3a;
  border-color: var(--home-accent);
}

#thumbnail-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
}

.thumbnail {
  border: 1px solid rgba(226, 232, 240, 0.2);
  border-radius: 0.85rem;
  background: rgba(15, 23, 42, 0.85);
}

.thumbnail img {
  border-radius: inherit;
}

.thumbnail-error {
  display: grid;
  place-items: center;
  min-height: 12rem;
  border-style: dashed;
}

.thumbnail-error::after {
  content: "Bild nicht verfügbar";
  color: var(--home-muted);
}

.thumbnail-error img {
  display: none;
}

.search-empty-state,
#search-empty-state {
  display: flex;
  min-height: 18rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

#search-empty-state svg {
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  color: #64748b;
}

#search-empty-state h3 {
  margin: 0;
  color: #e2e8f0;
}

#search-empty-state p {
  margin: 0.5rem 0 1.25rem;
}

.gallery-loading {
  grid-column: 1 / -1;
  padding: 2rem;
  text-align: center;
}

.no-script-note {
  padding: 1rem;
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 0.8rem;
  background: rgba(120, 53, 15, 0.22);
  color: #fde68a;
  text-align: center;
}

#impressum {
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.76);
}

@media (max-width: 900px) {
  #main-content {
    padding-right: 1rem;
    padding-left: 1rem;
  }
}

@media (max-width: 560px) {
  .gallery-section {
    padding: 1rem 0.4rem;
  }

  #thumbnail-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    padding: 0.55rem;
  }

  #sort-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
