/* ============================================================
   Portfolio Kristian Heitkamp — Hauptstylesheet
   Minimalistisches Design, Bilder stehen im Vordergrund
   ============================================================ */

/* --- Reset & Grundeinstellungen --- */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
    background-color: #ffffff;
    color: #222222;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

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

/* --- Password Overlay --- */

#password-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: end;
    flex-direction: column;
    gap: 2rem;
    height: 85%;
}

#password-overlay.visible {
    display: flex;
}

.overlay-lang {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
}

#password-overlay.hiding {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.password-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: min(360px, 90vw);
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 2rem;
}

.password-box h1 {
    font-size: 1.1rem;
    font-weight: 300;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #222222;
}

#password-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

#password-username,
#password-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 0;
    background: transparent;
    color: #ffffff;
    outline: none;
    text-align: center;
    letter-spacing: 0.1em;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

#password-username::placeholder,
#password-input::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

#password-username:focus,
#password-input:focus {
    border-color: rgba(255, 255, 255, 0.85);
}

.password-button {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    font-family: inherit;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.3);
    color: #222222;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.password-button:hover {
    background-color: rgba(255, 255, 255, 0.75);
}

#password-error {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s;
    min-height: 1.2em;
}

/* Shake animation on wrong password */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-8px); }
    40%       { transform: translateX(8px); }
    60%       { transform: translateX(-5px); }
    80%       { transform: translateX(5px); }
}

.error-shake {
    animation: shake 0.5s ease;
}

/* --- Cookie consent banner --- */

#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    background: rgba(20, 20, 20, 0.95);
    color: rgba(255, 255, 255, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 1rem 2rem;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    line-height: 1.5;
}

#cookie-banner[hidden] {
    display: none;
}

.cookie-text {
    margin: 0;
    max-width: 680px;
}

.cookie-text a {
    color: rgba(255, 255, 255, 0.55);
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    transition: color 0.2s, border-color 0.2s;
}

.cookie-text a:hover {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.6);
}

.cookie-accept {
    flex-shrink: 0;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: rgba(255, 255, 255, 0.75);
    font-family: inherit;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 0.4rem 1rem;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}

.cookie-accept:hover {
    border-color: rgba(255, 255, 255, 0.75);
    color: #ffffff;
}

@media (max-width: 600px) {
    #cookie-banner {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
        padding: 1rem;
    }
}

/* --- Startseite (index.html) --- */

.landing-page {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.hero-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    background-color: #111111;
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0.85;
}

.hero-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 3rem 2rem 5.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 50%);
}

.photographer-name {
    font-size: 1.2rem;
    font-weight: 300;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: #ffffff;
    margin-bottom: 1.5rem;
}

.gallery-link {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.7);
    border-bottom: 1px solid rgba(255,255,255,0.4);
    padding-bottom: 2px;
    transition: color 0.2s, border-color 0.2s;
}

.gallery-link:hover {
    color: #ffffff;
    border-color: rgba(255,255,255,0.8);
}

/* --- Seiten-Header / Navigation (gallery.html) --- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #ffffff;
    border-bottom: 1px solid #e8e8e8;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    min-height: 56px;
}

.header-name {
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}

.header-name a {
    color: #222222;
}

.main-navigation {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
}

.nav-link {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #888888;
    padding: 0.5rem 1rem;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    cursor: pointer;
    white-space: nowrap;
}

.nav-link:hover {
    color: #222222;
}

.nav-link.active {
    color: #222222;
    border-bottom-color: #222222;
}

.header-imprint-link {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #aaaaaa;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color 0.2s;
}

.header-imprint-link:hover {
    color: #555555;
}

.header-logout-btn {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #aaaaaa;
    white-space: nowrap;
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    transition: color 0.2s;
}

.header-logout-btn:hover {
    color: #555555;
}

/* --- Language switch --- */

.lang-switch {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.lang-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #bbbbbb;
    padding: 0;
    line-height: 1;
    transition: color 0.15s;
}

.lang-btn.active {
    color: #333333;
}

.lang-btn:hover:not(.active) {
    color: #555555;
}

.lang-sep {
    color: #cccccc;
    font-size: 0.65rem;
    line-height: 1;
    user-select: none;
}

/* Hero variant: matches the light-on-dark landing page style */
.lang-switch-hero .lang-btn {
    color: rgba(255, 255, 255, 0.45);
}

.lang-switch-hero .lang-btn.active {
    color: rgba(255, 255, 255, 0.9);
}

.lang-switch-hero .lang-sep {
    color: rgba(255, 255, 255, 0.3);
}

/* Version number — shown next to the language switcher */
.app-version {
    font-size: 0.65rem;
    letter-spacing: 0.04em;
    color: rgba(0, 0, 0, 0.2);
    margin-left: 0.6rem;
    vertical-align: middle;
    user-select: none;
}

/* Login overlay has a dark background — keep version light there */
.overlay-lang .app-version {
    color: rgba(255, 255, 255, 0.4);
}


/* --- Galerie-Bereich --- */

.gallery-area {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 2rem 4rem;
}

/* Two-column grid — both columns start at the same height */
#gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.gallery-item {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.gallery-image {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.3s ease;
}

/* Lazy-Loading: Bilder erscheinen sanft */
.gallery-image.lazy {
    opacity: 0;
    background-color: #f0f0f0;
    min-height: 200px;
}

.gallery-image.loaded {
    opacity: 1;
}

/* Caption-Overlay beim Hover */
.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.6rem 0.75rem;
    background: rgba(0, 0, 0, 0.6);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.gallery-item:hover .gallery-caption {
    opacity: 1;
}

.gallery-item:hover .gallery-image {
    opacity: 0.92;
}

/* ── Editor image controls (visible to editors/admins in the gallery) ── */

.gallery-item-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0.35rem;
    background: rgba(0, 0, 0, 0.52);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
}

.gallery-item:hover .gallery-item-controls {
    opacity: 1;
}

/* Always show on touch devices (no hover state) */
@media (hover: none) {
    .gallery-item-controls { opacity: 1; }
}

.gallery-ctrl-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.88);
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
    padding: 0.2rem 0.45rem;
    border-radius: 2px;
    transition: background 0.15s;
}

.gallery-ctrl-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.18);
}

.gallery-ctrl-btn:disabled {
    opacity: 0.22;
    cursor: default;
}

.gallery-ctrl-delete {
    color: rgba(255, 90, 90, 0.9);
}

.gallery-ctrl-cover {
    color: rgba(255, 255, 255, 0.4);
}

.gallery-ctrl-cover-active {
    color: rgba(255, 210, 50, 0.95);
}

.no-images {
    font-size: 0.85rem;
    color: #aaaaaa;
    padding: 3rem 0;
    letter-spacing: 0.08em;
}

/* --- Sektions-Info --- */

.section-info {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eeeeee;
}

.section-title {
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #222222;
    margin-bottom: 0.4rem;
}

.section-description {
    font-size: 0.8rem;
    color: #888888;
    letter-spacing: 0.04em;
}

/* --- Zurück-Button (Gruppen-Unterseite → Übersicht) --- */

.gallery-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    margin-bottom: 1.75rem;
    padding: 0;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #888888;
    cursor: pointer;
    transition: color 0.2s;
}

.gallery-back-btn:hover {
    color: #222222;
}

/* --- Gruppen-Übersicht: Kacheln mit sichtbarer Caption --- */

/* Gruppen-Kachel: Caption immer sichtbar (nicht nur beim Hover) */
.group-card .gallery-caption {
    opacity: 1;
    background: rgba(0, 0, 0, 0.55);
}

/* Titelzeile in der Gruppen-Caption */
.group-caption-title {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: #ffffff;
    margin-bottom: 0.2em;
}

/* Bildanzahl in der Gruppen-Caption */
.group-caption-count {
    display: block;
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.6);
}

/* Pfeil-Hinweis auf Klickbarkeit */
.group-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid transparent;
    transition: border-color 0.2s;
    pointer-events: none;
}

.group-card:hover::after {
    border-color: rgba(255, 255, 255, 0.25);
}

/* --- Impressum --- */

.imprint-page {
    min-height: 100vh;
}

.imprint-content {
    max-width: 600px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.imprint-content h1 {
    font-size: 0.9rem;
    font-weight: 400;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    margin-bottom: 2.5rem;
    color: #222222;
}

.imprint-content h2 {
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #888888;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.imprint-content p {
    font-size: 0.9rem;
    color: #444444;
    line-height: 1.7;
    margin-bottom: 0.5rem;
}

.imprint-content a {
    color: #444444;
    border-bottom: 1px solid #cccccc;
    transition: border-color 0.2s;
}

.imprint-content a:hover {
    border-color: #444444;
}

.imprint-note {
    font-size: 0.75rem;
    color: #aaaaaa;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eeeeee;
    line-height: 1.6;
}

/* --- Responsive: Tablet --- */

@media (max-width: 900px) {
    .header-inner {
        padding: 0 1.25rem;
        gap: 1rem;
    }

    .nav-link {
        padding: 0.5rem 0.6rem;
        font-size: 0.7rem;
    }

    .gallery-area {
        padding: 1.5rem 1.25rem 3rem;
    }
}

/* --- Responsive: Smartphone --- */

@media (max-width: 600px) {
    .header-inner {
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
        min-height: auto;
    }

    .header-name {
        width: 100%;
    }

    .main-navigation {
        gap: 0;
        width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .main-navigation::-webkit-scrollbar {
        display: none;
    }

    .nav-link {
        padding: 0.4rem 0.5rem;
        flex-shrink: 0;
    }

    .header-imprint-link {
        display: none;
    }

    #gallery-grid {
        grid-template-columns: 1fr;
    }

    .photographer-name {
        font-size: 0.95rem;
        letter-spacing: 0.3em;
    }
}
