/* style.css - gemeinsames Design fuer alle Seiten
   Schrift: Inter (modern, serifenlos, minimal).
   Dunkles, bildzentriertes Design: die Fotos stehen im Vordergrund,
   die Oberflaeche tritt zurueck. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

:root {
  --bg: #0b0b0b;      /* Hintergrund (nahezu schwarz / anthrazit) */
  --bg-soft: #141414; /* leicht abgehobene Flaechen */
  --fg: #ececec;       /* Text hell */
  --muted: #8a8a8a;    /* gedaempftes Grau */
  --line: #222222;     /* feine Trennlinien */
  --max: 1200px;

  /* Weltkarte: neutrales Land + ruhiger Akzent fuer besuchte Laender */
  --land: #26292f;
  --land-line: #0b0b0b;
  --accent: #6f9bc4;
  --accent-bright: #a3c6e4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--bg); }

body {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 400;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* --- Sanfte Einblendungen beim Scrollen ---
   Elemente mit .reveal starten unsichtbar und leicht versetzt,
   .is-visible (per IntersectionObserver gesetzt) blendet sie ein. */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* --- Navigation oben --- */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.nav .brand { font-weight: 600; font-size: 1.1rem; letter-spacing: -0.01em; }
.nav .links a { color: var(--muted); margin-left: 1.5rem; font-size: 0.95rem; transition: color 0.2s; }
.nav .links a:hover { color: var(--fg); }

/* --- Landingpage (Vorstellung) --- */
.hero {
  max-width: 700px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
  text-align: center;
}
.hero h1 {
  font-size: 2.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.hero .lead { font-size: 1.2rem; color: var(--muted); font-weight: 300; }
.hero .bio { margin-top: 2rem; font-size: 1.05rem; text-align: left; }
.hero .bio p { margin-bottom: 1rem; }
.cta {
  display: inline-block;
  margin-top: 2rem;
  padding: 0.75rem 1.75rem;
  border: 1px solid var(--fg);
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s;
}
.cta:hover { background: var(--fg); color: var(--bg); }

/* Instagram-Link (nur Landingpage) */
.social {
  margin-top: 1.75rem;
  display: flex;
  justify-content: center;
}
.social a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  transition: color 0.2s;
}
.social a:hover { color: var(--fg); }
.social svg { width: 18px; height: 18px; display: block; }

/* --- Album-Uebersicht --- */
.page-head { max-width: var(--max); margin: 0 auto; padding: 3rem 1.5rem 1.5rem; }
.page-head h1 { font-size: 2rem; font-weight: 600; letter-spacing: -0.02em; }
.page-head p { color: var(--muted); margin-top: 0.25rem; }

.albums {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem 1.5rem 4rem;
}
.album-card { display: block; }
.album-card .thumb {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bg-soft);
}
.album-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s, filter 0.3s; }
.album-card:hover img { transform: scale(1.03); filter: brightness(1.08); }
.album-card .meta { margin-top: 0.75rem; }
.album-card .meta h3 { font-size: 1.05rem; font-weight: 500; }
.album-card .meta span { color: var(--muted); font-size: 0.9rem; }

/* --- Galerie im Album: dichtes Mosaik / Collage ---
   Masonry ueber CSS-Spalten. Die "organische" Wirkung kommt aus den
   unterschiedlich hohen Kacheln (size-tall / size-square / size-short /
   size-wide), die eng gepackt sind. Die Groesse steht pro Foto in data.json
   (Feld "size"), festgelegt beim Build - das Frontend wuerfelt nie. */
.gallery {
  column-count: 4;
  column-gap: 8px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem 1.5rem 4rem;
}
.gallery-item {
  break-inside: avoid;
  margin-bottom: 8px;
  cursor: pointer;
}
.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  background: var(--bg-soft);
  object-fit: cover;           /* Zuschnitt auf das Seitenverhaeltnis der Kachel */
  aspect-ratio: 1 / 1;         /* Standard: quadratisch (size-square) */
  transition: filter 0.3s, transform 0.3s;
}
.gallery-item.size-tall  img { aspect-ratio: 3 / 4; }
.gallery-item.size-short img { aspect-ratio: 4 / 3; }
.gallery-item.size-wide  img { aspect-ratio: 3 / 2; }
.gallery-item:hover img { filter: brightness(1.08); transform: scale(1.01); }
.gallery-item .cap { margin-top: 0.4rem; font-size: 0.8rem; line-height: 1.4; color: var(--muted); }

/* --- Filter-Hinweis auf der Album-Uebersicht (?country=XX) --- */
.filter-note {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.filter-note a { color: var(--accent); }
.filter-note a:hover { color: var(--accent-bright); }

/* --- Weltkarte --- */
.world-map {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem 1.5rem 2rem;
}
.world-map svg { width: 100%; height: auto; display: block; }
/* neutrales Land */
.world-map path { fill: var(--land); stroke: var(--land-line); stroke-width: 0.3; }
/* besuchte Laender (Pfad direkt oder als Gruppe mit mehreren Pfaden) */
.world-map .visited,
.world-map .visited path { fill: var(--accent); cursor: pointer; transition: fill 0.25s ease; }
.world-map .visited:hover,
.world-map .visited:hover path { fill: var(--accent-bright); }
.world-map .visited:focus-visible,
.world-map .visited:focus-visible path { outline: none; fill: var(--accent-bright); }

.map-legend {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
  display: flex;
  gap: 1.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.map-legend span { display: inline-flex; align-items: center; gap: 0.45rem; }
.map-legend i {
  width: 11px; height: 11px; border-radius: 3px; display: inline-block;
}
.map-legend .sw-visited { background: var(--accent); }
.map-legend .sw-plain { background: var(--land); }

/* --- Lightbox --- */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.95);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 2rem; z-index: 100;
}
.lightbox.hidden { display: none; }
.lightbox img { max-width: 100%; max-height: 85vh; object-fit: contain; border-radius: 4px; }
.lightbox .caption { color: #ccc; margin-top: 1rem; font-size: 0.95rem; text-align: center; }
.lightbox-close {
  position: absolute; top: 1rem; right: 1.5rem;
  background: none; border: none; color: #fff;
  font-size: 2.5rem; cursor: pointer; line-height: 1;
}

/* --- Login-Seite (login.html) ---
   Das Passwort wird serverseitig geprueft (POST /login), siehe server.js.
   Diese Klassen stylen nur die Login-Seite. */
.gate {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}
.gate-box {
  width: 100%;
  max-width: 320px;
  text-align: center;
}
.gate-label { color: var(--muted); font-size: 0.95rem; margin-bottom: 1rem; }
.gate-box input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--fg);
  font: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.gate-box input:focus { border-color: var(--muted); }
.gate-box button {
  margin-top: 0.6rem;
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--fg);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  font: inherit;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
}
.gate-error { color: #d98b8b; font-size: 0.85rem; margin-top: 0.75rem; }

/* --- Fusszeile (minimal, unaufdringlich) --- */
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.5rem 2.5rem;
  border-top: 1px solid var(--line);
  text-align: center;
}
.site-footer a {
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  transition: color 0.2s;
}
.site-footer a:hover { color: var(--fg); }
/* kleiner Logout-Link in der Fusszeile der geschuetzten Seiten */
.site-footer .logout { display: inline; margin-left: 1.25rem; }
.site-footer .logout button {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s;
}
.site-footer .logout button:hover { color: var(--fg); }

/* --- Impressum --- */
.legal {
  max-width: 640px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}
.legal h1 { font-size: 2rem; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 1.5rem; }
.legal h2 { font-size: 1rem; font-weight: 600; margin: 1.75rem 0 0.35rem; }
.legal p { color: var(--fg); }
.legal .placeholder { color: var(--muted); }

@media (max-width: 1000px) {
  .gallery { column-count: 3; }
}
@media (max-width: 680px) {
  .gallery { column-count: 2; }
}
@media (max-width: 600px) {
  .hero { padding: 3rem 1.25rem; }
  .hero h1 { font-size: 2rem; }
}

/* Bewegung/Einblendungen fuer Nutzer mit reduzierter Bewegung abschalten */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.is-visible {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .album-card img,
  .gallery-item img,
  .cta,
  .nav .links a,
  .social a,
  .site-footer a,
  .world-map .visited,
  .world-map .visited path { transition: none; }
  .album-card:hover img,
  .gallery-item:hover img { transform: none; }
}
