/* =========================================
   1. DESIGN VARIABLEN & GRUNDLAGEN
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Italianno&display=swap');

:root {
    --primary-blue: #0d2c4e;    /* Dein ursprüngliches Dunkelblau */
    --secondary-blue: #1a4a7a;  /* Helleres Blau für Akzente */
    --bg-body: #f0f2f5;         /* Hintergrund der Seite */
    --bg-stage: #fdfbf7;        /* Warmes Papier-Weiß für Bilder */
    --text-dark: #2c3e50;
    --text-muted: #6c757d;
    --white: #ffffff;
    --card-shadow: 0 10px 30px rgba(0,0,0,0.04);
    --card-radius: 16px;        /* Schön abgerundet */
}

* {
    box-sizing: border-box;
}
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

a {
    text-decoration: none;
    transition: all 0.2s;
}

/* =========================================
   2. BOOTSTRAP OVERRIDES
   ========================================= */
.text-primary { color: var(--primary-blue) !important; }
.bg-primary { background-color: var(--primary-blue) !important; }
.border-primary { border-color: var(--primary-blue) !important; }

.btn-primary { 
    background-color: var(--primary-blue) !important; 
    border-color: var(--primary-blue) !important; 
    border-radius: 50px;
    font-weight: 600;
    padding: 10px 25px;
}
.btn-primary:hover { 
    background-color: var(--secondary-blue) !important; 
    border-color: var(--secondary-blue) !important; 
}

.btn-outline-primary { 
    color: var(--primary-blue) !important; 
    border-color: var(--primary-blue) !important; 
    border-radius: 50px;
}
.btn-outline-primary:hover { 
    background-color: var(--primary-blue) !important; 
    color: var(--white) !important; 
}

.spinner-border.text-primary { color: var(--primary-blue) !important; }
.spinner-wrapper {
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    width: 100%;
}

/* =========================================
   3. NAVIGATION & FOOTER
   ========================================= */
.navbar {
    background-color: var(--white) !important;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 1rem 0;
    box-shadow: 0 2px 15px rgba(0,0,0,0.03);
}
.navbar-brand {
    font-weight: 800 !important;
    color: var(--primary-blue) !important;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: .5rem;
}

footer {
    background: var(--white);
    border-top: 1px solid #eee;
    padding: 50px 0;
    margin-top: auto;
}

/* =========================================
   4. INDEX: HERO BEREICH & SUCHE
   ========================================= */
.hero-section {
    background-color: var(--primary-blue);
    background-image: 
        linear-gradient(color-mix(in srgb, var(--primary-blue), transparent 10%), color-mix(in srgb, var(--primary-blue), transparent 8%)),
        url('https://sowasdat.rheiderland.de/assets/data_img/slider/2204.jpg');
    background-size: cover;
    background-position: center;
    padding: 180px 0 200px;
    color: var(--white);
    text-align: center;
    margin-bottom: -40px;
}

.hero-title {
    letter-spacing: -1px;
    text-shadow: 0 4px 15px rgba(0,0,0,0.3);
    font-family: "Italianno", cursive;
  font-weight: 400;
  font-style: normal;
}

.search-box {
    max-width: 700px;
    margin: 40px auto 0;
    background: var(--white);
    padding: 8px;
    border-radius: 60px;
    display: flex;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.search-box input {
    border: none;
    padding: 15px 30px;
    background-color: var(--white);
    border-radius: 50px;
    flex-grow: 1;
    outline: none;
    font-size: 1.1rem;
    color: var(--text-dark);
}
.search-box button {
    background: var(--primary-blue);
    color: var(--white);
    border: none;
    padding: 0 45px;
    border-radius: 50px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: background 0.2s;
}
.search-box button:hover { background: var(--secondary-blue); }

@media (max-width: 768px) {
    .feature-cards { order: 4; }
    .hero-section { margin-bottom: 0px; }
}

/* =========================================
   5. CARDS (FEATURES, KATEGORIEN, FOTOS)
   ========================================= */

/* Feature Card (Startseite) */
.feature-card {
    border: none;
    border-radius: var(--card-radius);
    background: var(--white);
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease;
    height: 100%;
    text-align: center;
    padding: 2.5rem 1.5rem;
    position: relative;
    z-index: 10;
}
.feature-card:hover { transform: translateY(-8px); }
.feature-icon-circle {
    width: 70px;
    height: 70px;
    background: rgba(13, 44, 78, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--primary-blue);
    font-size: 1.8rem;
}

/* Kategorie Card */
.cat-card {
    border: none;
    border-radius: var(--card-radius);
    overflow: hidden;
    background: var(--white);
    transition: all 0.3s ease;
    text-decoration: none !important;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: var(--card-shadow);
}
.cat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}
.cat-img-wrapper {
    height: 220px;
    overflow: hidden;
    background-color: #eee;
    position: relative;
}
.cat-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.cat-card:hover .cat-img { transform: scale(1.1); }
.cat-body { padding: 1.2rem; text-align: center; }
.cat-name {
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 4px;
    font-size: 1rem;
}
.cat-count {
    font-size: 0.8rem;
    color: #888;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Photo Card (Verwendet auf Startseite & Galerie) */
.photo-card {
    border: 1px solid transparent;
    border-radius: var(--card-radius);
    overflow: hidden;
    background: var(--white);
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.photo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
}
.photo-img-wrapper {
    height: 220px; 
    overflow: hidden; 
    position: relative;
}
.photo-img {
    height: 220px;
    width: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.photo-card:hover .photo-img { transform: scale(1.1); }
.photo-body {
    padding: 1.2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.photo-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text-dark);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.photo-meta {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Section Header (Startseite) */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding-bottom: 1rem;
}
.section-title {
    font-weight: 800;
    color: var(--primary-blue);
    font-size: 1.5rem;
    margin: 0;
}
.section-link {
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--secondary-blue);
    display: flex;
    align-items: center;
    gap: 5px;
}
.section-link:hover { opacity: 0.8; }

/* =========================================
   6. FOTOGRAFEN LISTE (INDEX)
   ========================================= */
.photographer-index ul {
    column-count: 1;
    column-gap: 40px;
    margin: 0;
    padding: 0;
}
@media (min-width: 768px) { .photographer-index ul { column-count: 2; } }
@media (min-width: 992px) { .photographer-index ul { column-count: 3; } }

.photographer-link {
    display: flex;
    align-items: center;
    padding: 8px;
    color: var(--text-dark);
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    break-inside: avoid;
    transition: all 0.2s;
}
.photographer-link:hover {
    color: var(--primary-blue);
    padding-left: 5px;
    background-color: #fcfcfc;
}
.pg-icon {
    color: var(--secondary-blue);
    font-size: 0.9rem;
    margin-right: 10px;
    opacity: 0.6;
}
.pg-count {
    margin-left: auto;
    background: #e9ecef;
    color: var(--text-dark);
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* =========================================
   7. GALERIE PAGE SPECIFICS
   ========================================= */
.page-header {
    background-color: var(--primary-blue);
    padding: 2.5rem 0;
    color: var(--white);
    border-bottom: 1px solid #eee;
    margin-bottom: 2rem;
}
.search-input-group {
    max-width: 600px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    border-radius: 50px;
    padding: 5px;
    background: white;
    border: 1px solid #eee;
}
.search-input-group input {
    border: none;
    padding-left: 20px;
    background: transparent;
}
.search-input-group input:focus { box-shadow: none; }
.search-input-group button {
    border-radius: 50px !important;
    padding: 8px 30px;
    font-weight: 600;
    z-index: 100;
    position: relative;
    margin-left: 2px !important;
}

.pagination .page-item { margin: 0 2px; }
.pagination .page-item .page-link {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-blue);
    border: 1px solid #eee;
    font-weight: 600;
}
.pagination .page-item.active .page-link {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
}
.pagination .page-item.disabled .page-link {
    color: #ccc;
    background: transparent;
}

.filter-info {
    background: rgba(13, 44, 78, 0.05);
    padding: 8px 20px;
    border-radius: 50px;
    color: var(--primary-blue);
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* =========================================
   8. DETAILS PAGE SPECIFICS
   ========================================= */
.detail-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin-top: 2rem;
    margin-bottom: 3rem;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.context-bar {
    background: var(--white);
    padding: 12px 25px;
    border-bottom: 1px solid #f0f0f0;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.context-bar i {
    color: var(--secondary-blue);
    font-size: 1rem;
    margin-right: 8px;
}

.img-stage {
    background-color: var(--bg-stage);
    position: relative;
    display: flex;
    overflow: hidden;
    justify-content: center;
    align-items: center;
    min-height: auto;
    max-height: 85vh;
  width: 100%;
  height: 100%;
}

.img-stage .blur {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-size: cover;
  background-position: center;
}

.img-stage .img-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  padding: 2rem;
  text-align: center;
  object-fit: contain;
  object-position: center;
  /* blurring */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.main-photo {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    z-index: 1;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease;
}

/* =========================================
   FULLSCREEN / LIGHTBOX STYLES
   ========================================= */

/* Das Overlay (standardmäßig unsichtbar) */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8); /* Fast ganz schwarz */
    z-index: 9999; /* Ganz oben über allem */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(5px);
}

/* Wenn aktiv, dann sichtbar machen */
.fullscreen-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Das Bild im Fullscreen */
.fs-img-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Für Zoom wichtig */
}

.fs-image {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    transition: transform 0.2s ease; /* Weicher Zoom */
    cursor: zoom-in;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
}

#fs-image {
    /* Wichtig: transform-origin muss standardmäßig mittig sein */
    transform-origin: center center;
    /* Hardware-Beschleunigung für flüssiges Bewegen */
    will-change: transform;
    /* Verhindert, dass das Bild auf Mobile markiert wird beim Drücken */
    user-select: none; 
    -webkit-user-select: none;
    /* Optional: Eine leichte Transition nur für den Zoom, nicht für Drag */
    transition: transform 0.1s linear; transform-origin: center center;
    will-change: transform; /* Performance Boost */
    transition: none; /* Wichtig: Transition aus, damit es direkt am Mauszeiger klebt */
}

.fs-image.zoomed {
    cursor: zoom-out;
    transform: scale(2.0); /* Zoom-Faktor */
}

/* Buttons (Schließen & Toolbar) */
.fs-toolbar {
    position: absolute;
    top: 20px;
    right: 30px;
    z-index: 10000;
    display: flex;
    gap: 15px;
}

.btn-fs-close {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: var(--primary-blue);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-fs-close:hover {
    background: rgba(255, 255, 255, 1);
    transform: rotate(90deg); /* Kleiner Dreheffekt */
}

/* Button im normalen Layout (der Auslöser) */
.btn-trigger-fullscreen {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 10px 15px;
    border-radius: 50px;
    font-weight: 600;
    color: var(--primary-blue);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 10;
    cursor: pointer;
    transition: transform 0.2s;
}
.btn-trigger-fullscreen:hover {
    transform: scale(1.05);
    background: white;
}

/* Overlay Beschreibung */
.desc-overlay {
    position: relative;
    width: 100%;
    background: var(--white);
    z-index: 20;
    padding: 2.5rem;
    display: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.desc-overlay.show { display:block }

.btn-toggle-desc {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 50px;
    padding: 8px 18px;
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    color: var(--primary-blue);
    display: none;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-toggle-desc:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    background: var(--white);
}
.btn-close {
    display: none;
}
.description-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-dark);
}

.info-section {
    background: var(--white);
    padding: 2.5rem 2rem;
    border-bottom: 1px solid #f0f0f0;
}
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 30px;  
    margin: 0 auto;
}
.info-item { text-align: center; position: relative; }
.info-icon { font-size: 1.5rem; color: #e2e6ea; margin-bottom: 5px; display: block; }
.info-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 600;
}
.info-value {
    font-weight: 700;
    color: var(--primary-blue);
    font-size: 1.05rem;
    line-height: 1.4;
}

/* Details Navigation */
.nav-strip {
    background: #fafbfc;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 90px;
}
.nav-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-dark);
    padding: 10px 20px;
    border-radius: 12px;
    transition: all 0.2s ease;
    background: transparent;
    border: 1px solid transparent;
}
.nav-btn:hover {
    background: var(--white);
    color: var(--primary-blue);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-color: #eee;
}
.nav-thumb-img {
    width: 70px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.nav-text { display: flex; flex-direction: column; }
.nav-label { font-size: 0.7rem; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.nav-direction { font-weight: 700; font-size: 0.95rem; }

/* Markierung Suche */
mark.highlight {
    background: linear-gradient(to bottom, transparent 60%, #ffeeba 60%);
    background-color: transparent;
    color: inherit;
    padding: 0 2px;
    border-radius: 0;
    font-weight: inherit;
    border-bottom: none;
}

/* Toast */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(200px);
    background-color: var(--primary-blue);
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(13, 44, 78, 0.3);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 1050;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 12px;
}
.toast-notification.active { transform: translateX(-50%) translateY(0); }