/* ==========================================================================
   1. GEMEINSAME BASIS & GLOBALE ELEMENTE (Body, Header, Footer)
   ========================================================================== */

body {
    margin: 0;
    padding: 0;
    background-color: #e0f2fe;
    height: 100vh;
    overflow: hidden;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
    position: relative;
}

main {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 100vh; 
}

header {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(5px);
    padding: 10px 40px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    white-space: nowrap;
}

header h1 {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    color: #334155;
    letter-spacing: 2px;
    text-align: center;
}

header .subtitle {
    margin: 3px 0 0 0; 
    font-size: 13px;   
    color: #64748b;   
    white-space: normal;
    text-align: center; 
}

footer {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(5px);
    padding: 8px 30px;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    white-space: nowrap;
}

footer p {
    margin: 0;
}

footer a {
    color: #334155;
    text-decoration: none;
    font-size: 11px;
    font-weight: bold;
    margin: 0 12px;
    transition: color 0.2s ease;
}

footer a:hover {
    color: #0284c7;
    text-decoration: underline;
}

/* --- MOBILE ANPASSUNG (BASIS) --- */
@media (max-width: 1000px) {
    header {
        left: 0;
        transform: none;
        width: 100%;
        border-radius: 0;
        white-space: normal;
        padding: 12px 15px;
        box-sizing: border-box;
        background: rgba(255, 255, 255, 0.95);
        text-align: center;
    }

    header h1 {
        font-size: 16px;
    }

    footer {
        left: 0;
        transform: none;
        width: 100%;
        bottom: 0;
        border-radius: 0; 
        white-space: normal; 
        padding: 12px 15px;
        box-sizing: border-box;
        background: rgba(255, 255, 255, 0.95);
    }

    footer p {
        display: block;
        text-align: center;
        margin: 0;
        line-height: 1.8;
    }

    footer a {
        display: inline-block;
        font-size: 11px;
        margin: 0 8px;
    }
}


/* ==========================================================================
   2. STARTSEITE: VORDERGRUND POLAROIDS & NAVIGATION
   ========================================================================== */

.polaroid {
    position: absolute;
    background: #ffffff;
    padding: 15px 15px 40px 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    border-radius: 2px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    user-select: none; 
    z-index: 10; 
    opacity: 0;  
}

.polaroid img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    background-color: #eee;
    display: block;
}

.polaroid .caption {
    text-align: center;
    margin-top: 15px;
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.polaroid .polaroid-symbol {
    width: 200px;
    height: 200px;
    background-color: #f1f5f9;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 75px;
    user-select: none;
}

.gallery-container .polaroid:hover {
    transform: scale(1.06) !important;
    box-shadow: 0 0 30px 10px rgba(255, 255, 255, 1), 
                0 15px 30px rgba(0, 0, 0, 0.25);
    z-index: 999;
}

.mobile-nav { 
    display: none; 
}

/* --- DESKTOP ANPASSUNG (STARTSEITE) --- */
@media (min-width: 1000px) {
    .gallery-container .polaroid {
        animation: dropIn 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    }

/* REIHE 1 (Bilder 1 (Über das Projekt) - 4 (Steffi)) */
    .gallery-container .polaroid:nth-child(1) { top: 5%; left: 5%; }
    .gallery-container .polaroid:nth-child(2) { top: 20%; left: 28%; }
    .gallery-container .polaroid:nth-child(3) { top: 7%; left: 52%; }
    .gallery-container .polaroid:nth-child(4) { top: 13%; left: 75%; }
    
    /* REIHE 2 (Bilder 5 (Edgar) - 8 (Deine Story)) */
    .gallery-container .polaroid:nth-child(5) { top: 40%; left: 8%; }
    .gallery-container .polaroid:nth-child(6) { top: 55%; left: 32%; }
    .gallery-container .polaroid:nth-child(7) { top: 45%; left: 55%; }
    .gallery-container .polaroid:nth-child(8) { top: 55%; left: 78%; }

}

/* --- MOBILE ANPASSUNG (STARTSEITE) --- */
@media (max-width: 1000px) {
    .gallery-container {
        width: 100%;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
    }

    .gallery-container .polaroid {
        top: auto !important; left: auto !important;
        position: absolute;
        opacity: 0 !important;
        pointer-events: none;
        transition: transform 0.4s ease, opacity 0.4s ease, z-index 0.4s ease;
        transform: scale(0.9) rotate(0deg);
    }
  
    .gallery-container .polaroid.mobile-pile-1 {
        opacity: 1 !important;
        pointer-events: auto;
        z-index: 30; 
        transform: scale(1) rotate(-3deg) !important;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    }

    .gallery-container .polaroid.mobile-pile-2 {
        opacity: 0.95 !important;
        z-index: 20; 
        transform: scale(0.96) translate(8px, -4px) rotate(4deg) !important;
        pointer-events: none;
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    }

    .gallery-container .polaroid.mobile-pile-3 {
        opacity: 0.85 !important;
        z-index: 10; 
        transform: scale(0.92) translate(-12px, 8px) rotate(-7deg) !important;
        pointer-events: none;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    }

    .gallery-container .polaroid.mobile-pile-1:active {
        box-shadow: 0 0 20px 5px rgba(255, 255, 255, 0.8), 0 10px 25px rgba(0, 0, 0, 0.35);
    }

    .mobile-nav {
        position: absolute;
        bottom: 18%;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        justify-content: center;
        gap: 40px;
        width: auto;
        z-index: 100;
    }

    .mobile-nav button {
        background: #ffffff;
        border: none;
        padding: 10px 20px;
        font-size: 20px;
        font-weight: bold;
        border-radius: 20px;
        color: #0284c7;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
        cursor: pointer;
    }
}


/* ==========================================================================
   3. STARTSEITE: BACKGROUND POLAROID-PILE (Hintergrund-Haufen)
   ========================================================================== */

@keyframes dropIn {
    0% {
        opacity: 0;
        transform: translateY(-120vh) rotate(0deg);
    }
    60% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotate(var(--rand-rot, 0deg));
    }
}

/* --- DESKTOP ONLY HINTERGRUND --- */
@media (min-width: 1000px) {
    .polaroid-pile {
        position: absolute;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: 1;
        pointer-events: none;
        overflow: hidden;
        filter: brightness(0.88); 
    }

    .bg-pile-pic {
        position: absolute;
        background: #ffffff;
        padding: 15px 15px 40px 15px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
        border-radius: 2px;
        opacity: 0;
        animation: dropIn 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
    }

    .bg-pile-pic img {
        width: 200px;
        height: 200px;
        object-fit: cover;
        display: block;
    }

    /* HINTERGRUND-CLUSTER (Immer leicht versetzt zum jeweiligen Hauptbild) */
    /* Reihe 1 */
    .polaroid-pile .bg-pile-pic:nth-child(1)  { top: 2%;  left: 3%; }
    .polaroid-pile .bg-pile-pic:nth-child(2)  { top: 8%;  left: 7%; }
    
    .polaroid-pile .bg-pile-pic:nth-child(3)  { top: 18%; left: 26%; }
    .polaroid-pile .bg-pile-pic:nth-child(4)  { top: 22%; left: 30%; }
    
    .polaroid-pile .bg-pile-pic:nth-child(5)  { top: 4%;  left: 50%; }
    .polaroid-pile .bg-pile-pic:nth-child(6)  { top: 10%; left: 54%; }
    
    .polaroid-pile .bg-pile-pic:nth-child(7)  { top: 20%; left: 73%; }
    .polaroid-pile .bg-pile-pic:nth-child(8)  { top: 12%; left: 77%; }
    
    /* Reihe 2 */
    .polaroid-pile .bg-pile-pic:nth-child(9)  { top: 37%; left: 6%; }
    .polaroid-pile .bg-pile-pic:nth-child(10) { top: 43%; left: 10%; }
    
    .polaroid-pile .bg-pile-pic:nth-child(11) { top: 52%; left: 30%; }
    .polaroid-pile .bg-pile-pic:nth-child(12) { top: 58%; left: 34%; }
    
    .polaroid-pile .bg-pile-pic:nth-child(13) { top: 59%; left: 53%; }
    .polaroid-pile .bg-pile-pic:nth-child(14) { top: 55%; left: 57%; }
    
    .polaroid-pile .bg-pile-pic:nth-child(15) { top: 52%; left: 76%; }
    .polaroid-pile .bg-pile-pic:nth-child(16) { top: 58%; left: 80%; }
}

/* --- MOBILE ONLY HINTERGRUND (AUSBLENDEN) --- */
@media (max-width: 1000px) {
    .polaroid-pile { 
        display: none; 
    }
}


/* ==========================================================================
   4. UNTERSEITE / DETAILANSICHT
   ========================================================================== */

.detail-body {
    overflow-y: auto !important;
    overflow-x: hidden;
    height: auto;
    min-height: 100vh;
    padding: 40px 15px;
    box-sizing: border-box;
}

.detail-container {
    max-width: 600px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.5);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: block;
    text-align: center;
}

.back-btn {
    display: inline-block;
    text-decoration: none;
    color: #0284c7;
    font-weight: bold;
    margin-bottom: 20px;
    transition: color 0.2s;
}

.back-btn:hover { 
    color: #0369a1; 
}

#detail-title {
    margin-top: 0;
    clear: both;
    color: #0f172a;
    font-size: 28px;
    border-bottom: 2px solid #bae6fd;
    padding-bottom: 10px;
    text-align: center;
}

.media-layout {
    display: block;
    margin: 0px 0;
    text-align: center;
}

.detail-polaroid {
    position: relative !important;
    display: inline-block;
    transform: rotate(-2deg) !important;
    margin: 0 auto 45px auto;
    cursor: default !important;
    opacity: 1 !important;
}

.video-wrapper, 
.video-wrapper-schweden {
    display: block;
    margin: 0 auto 45px auto;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    width: 100%;
}

.video-wrapper {
    width: 240px; 
    aspect-ratio: 240 / 426;
}

.video-wrapper-schweden {
    max-width: 426px; 
    aspect-ratio: 426 / 240;
}

.video-wrapper video,
.video-wrapper-schweden video {
    display: block;
    width: 100% !important;
    max-height: 100% !important; 
    height: auto !important;
    object-fit: contain;
}

.detail-text {
    font-size: 16px;
    line-height: 1.6;
    color: #334155;
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
    text-align: left;
    margin-top: 20px;
}

.detail-text .text-heading {
    font-size: inherit;    
    font-weight: bold;     
    margin: 0;             
    display: inline;       
}

/* --- MOBILE ANPASSUNG (DETAILANSICHT) --- */
@media (max-width: 1000px) {
    body .detail-polaroid,
    html .detail-polaroid,
    .detail-polaroid {
        display: inline-block !important;
        opacity: 1 !important;
        visibility: visible !important;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: rotate(-2deg) !important;
        pointer-events: auto !important;
        margin: 0 auto 45px auto !important;
    }
}


/* ==========================================================================
   5. GÄSTEBUCH / KOMMENTAR-SYSTEM
   ========================================================================== */

.comments-list {
    max-width: 600px;
    margin: 0 auto;
    padding: 10px;
}

.comment-card {
    background: #ffffff;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    border-left: 5px solid #0284c7;
    text-align: left;
    font-family: 'Courier New', Courier, monospace;
    transition: transform 0.2s ease;
}

.comment-card:hover {
    transform: translateY(-2px);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    margin-bottom: 12px;
    border-bottom: 1px dashed #bae6fd;
    padding-bottom: 6px;
}

.comment-author {
    font-weight: bold;
    color: #0f172a;
    text-transform: uppercase;
}

.comment-date {
    color: #64748b;
    font-size: 11px;
}

.comment-content {
    font-size: 15px;
    line-height: 1.6;
    color: #334155;
    white-space: pre-wrap;
    word-break: break-word;
}

.comment-submit-btn {
    display: inline-block;
    background: #ffffff;
    color: #0284c7;
    border: 2px solid #0284c7;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: bold;
    font-family: 'Courier New', Courier, monospace;
    text-decoration: none;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.comment-submit-btn:hover {
    background: #0284c7;
    color: #ffffff;
    box-shadow: 0 6px 15px rgba(2, 132, 199, 0.25);
    transform: translateY(-1px);
}

.datenschutz-disclaimer {
    max-width: 500px;
    margin: 15px auto 0 auto;
    font-size: 12px;
    line-height: 1.6;
    color: #64748b;
    font-family: 'Courier New', Courier, monospace;
}