/*
 * style.css – Sammlung MVP
 * ========================
 * Design-Datei für index.php und bild.php.
 * Diese Datei pro Domain anpassen – admin.php hat eigenes CSS.
 *
 * ── Anpassen pro Sammlung ────────────────────────────────────────────────
 * --akzent:       Hauptfarbe (Links, Hover, Akzente)
 * --bg:           Seitenhintergrund
 * --bg2:          Kartenhintergrund, Bildcontainer
 * --text:         Haupttextfarbe
 * --muted:        Nebentextfarbe (Datum, Hinweise)
 * --border:       Rahmenfarbe
 * --schrift-text: Schriftart für Beschreibungstext
 * --schrift-ui:   Schriftart für UI-Elemente (Nav, Datum, Buttons)
 * ─────────────────────────────────────────────────────────────────────────
 */

:root {
  --akzent:      #2d2926;
  --bg:          #faf9f6;
  --bg2:         #f2f0ec;
  --text:        #1a1916;
  --muted:       #6b6860;
  --border:      #e0ddd7;
  --schrift-text: 'Georgia', 'Times New Roman', serif;
  --schrift-ui:   'Segoe UI', system-ui, sans-serif;
  --radius:      4px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--text); line-height: 1.7; font-family: var(--schrift-text); }
a { color: var(--text); text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Header (Übersichtsseite) ── */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 28px 24px 20px;
  max-width: 1200px; margin: 0 auto;
}
.site-header h1 {
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: 1.2;
}
.site-header p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 15px;
  font-family: var(--schrift-ui);
}
.header-meta {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  font-family: var(--schrift-ui);
}

/* ── Wrap ── */
.wrap { max-width: 1200px; margin: 0 auto; padding: 32px 20px; }

/* ── Galerie-Grid ── */
.galerie {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2px;
}
.bild-karte {
  position: relative; overflow: hidden;
  background: var(--bg2); aspect-ratio: 1;
}
.bild-karte img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .35s ease, filter .35s ease;
}
.bild-karte:hover img { transform: scale(1.04); filter: brightness(.88); }
.bild-karte-info {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.72));
  color: #fff; padding: 32px 14px 14px;
  opacity: 0; transform: translateY(6px);
  transition: opacity .25s, transform .25s;
  font-family: var(--schrift-ui);
}
.bild-karte:hover .bild-karte-info { opacity: 1; transform: none; }
.bild-karte-info .ktitel { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Paginierung ── */
.paginierung {
  display: flex; gap: 8px; justify-content: center; align-items: center;
  margin-top: 40px; font-family: var(--schrift-ui); font-size: 14px;
}
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); transition: background .15s;
}
.page-btn:hover { background: var(--bg2); }
.page-btn.aktiv { background: var(--akzent); color: #fff; border-color: var(--akzent); }
.page-btn.disabled { opacity: .35; pointer-events: none; }

/* ── Footer ── */
footer {
  text-align: center; padding: 28px 20px;
  font-size: 13px; color: var(--muted);
  border-top: 1px solid var(--border);
  font-family: var(--schrift-ui);
}
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 4px; justify-content: center; margin-bottom: 10px; }
.footer-nav a { color: var(--muted); }
.footer-nav a:hover { color: var(--text); }
.footer-nav span { color: var(--border); }

/* ── Textblock zwischen Bilderzeilen ── */
.galerie-text {
  padding: 28px 20px;
  max-width: 760px;
  margin: 4px 0;
}
.galerie-text h2 {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 400;
  letter-spacing: -.02em;
  margin-bottom: 12px;
}

/* ── Ähnliche Bilder ── */
.aehnliche-section {
  border-top: 1px solid var(--border);
  padding: 32px 20px 48px;
  max-width: 860px;
  margin: 0 auto;
}
.aehnliche-wrap { }
.aehnliche-ueberschrift {
  font-size: 16px; font-weight: 400;
  letter-spacing: -.01em;
  margin-bottom: 16px;
  font-family: var(--schrift-ui);
}
.aehnliche-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
}
.aehnliche-karte {
  display: block;
  position: relative;
  overflow: hidden;
  background: var(--bg);
  cursor: pointer;
  /* Quadrat ohne aspect-ratio: padding-top-Trick funktioniert in allen Browsern */
  padding-top: 100%;
}
.aehnliche-karte img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s, filter .3s;
  pointer-events: none;
}
.aehnliche-karte:hover img { transform: scale(1.05); filter: brightness(.85); }
.aehnliche-titel-text {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  color: #fff;
  padding: 24px 10px 10px;
  font-size: 12px;
  font-family: var(--schrift-ui);
  opacity: 0;
  transition: opacity .25s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.aehnliche-karte:hover .aehnliche-titel-text { opacity: 1; }

@media (max-width: 600px) {
  .aehnliche-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Seiten-Inhalt ── */
.seiten-inhalt { font-size: 16px; line-height: 1.8; }
.seiten-inhalt h2 { font-size: 22px; font-weight: 400; margin: 24px 0 10px; }
.seiten-inhalt h3 { font-size: 18px; font-weight: 600; margin: 20px 0 8px; }
.seiten-inhalt p  { margin-bottom: 14px; }
.seiten-inhalt a  { color: var(--akzent); text-decoration: underline; text-underline-offset: 3px; }
.seiten-inhalt a:hover { opacity: .8; }
.seiten-inhalt ul, .seiten-inhalt ol { margin: 10px 0 14px 22px; }
.seiten-inhalt li { margin-bottom: 6px; }

/* ── Breadcrumb (Einzelseite) ── */
.breadcrumb {
  max-width: 860px; margin: 0 auto;
  padding: 18px 20px 0;
  font-size: 13px; color: var(--muted);
  font-family: var(--schrift-ui);
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb span { margin: 0 6px; }

/* ── Artikel (Einzelseite) ── */
article { max-width: 860px; margin: 0 auto; padding: 28px 20px 48px; }

.bild-container {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  margin-bottom: 28px; text-align: center;
}
.bild-container img { max-height: 600px; width: auto; margin: 0 auto; }

h1 {
  font-size: clamp(20px, 3.5vw, 30px);
  font-weight: 400; letter-spacing: -.02em;
  line-height: 1.25; margin-bottom: 16px;
}

/* ── Beschreibung – HTML-Formatierung ── */
.beschreibung { font-size: 17px; margin-bottom: 20px; }
.beschreibung h2 { font-size: 20px; font-weight: 400; margin: 20px 0 8px; letter-spacing: -.01em; }
.beschreibung h3 { font-size: 17px; font-weight: 600; margin: 16px 0 6px; }
.beschreibung p  { margin-bottom: 12px; }
.beschreibung ul, .beschreibung ol { margin: 10px 0 12px 20px; }
.beschreibung li { margin-bottom: 4px; }
.beschreibung b, .beschreibung strong { font-weight: 600; }
.beschreibung em, .beschreibung i { font-style: italic; }

/* ── Meta-Info ── */
.meta {
  font-size: 13px; color: var(--muted);
  font-family: var(--schrift-ui);
  border-top: 1px solid var(--border);
  padding-top: 14px; margin-top: 14px;
}
.meta strong { color: var(--text); }

/* ── Prev/Next-Navigation ── */
.nav-bilder {
  display: flex; gap: 16px; margin-top: 40px;
  font-family: var(--schrift-ui); font-size: 14px;
}
.nav-bilder a {
  flex: 1; display: flex; gap: 10px; align-items: center;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; color: var(--text);
  transition: background .15s;
}
.nav-bilder a:hover { background: var(--border); }
.nav-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 3px; flex-shrink: 0; }
.nav-txt small { color: var(--muted); display: block; font-size: 12px; }
.nav-next { justify-content: flex-end; text-align: right; }
.nav-next .nav-txt { order: -1; }

.zurueck {
  display: inline-block; margin-bottom: 20px;
  font-size: 14px; color: var(--muted);
  font-family: var(--schrift-ui);
}
.zurueck:hover { color: var(--text); }

/* ── Responsive ── */
@media (max-width: 480px) {
  .galerie { grid-template-columns: repeat(2, 1fr); }
  .site-header { padding: 20px 16px 14px; }
  .wrap { padding: 20px 16px; }
  .nav-bilder { flex-direction: column; }
}
