html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
    font-family: sans-serif;
}

#album-wrapper {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: -webkit-fill-available;
}

.actions-fab {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 50;
    border: 0;
    border-radius: 999px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: #dc3545;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.actions-fab:hover {
    background: #bb2d3b;
}

.dots-icon {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 -8px 0 #fff, 0 8px 0 #fff;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.actions-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(3, 8, 20, 0.6);
    padding: 16px;
}

.actions-modal.is-open {
    display: flex;
}

.actions-modal-panel {
    width: min(560px, 100%);
    max-height: 88vh;
    overflow: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    padding: 20px;
    position: relative;
}

.actions-modal-panel h2 {
    margin: 0 0 14px;
    font-size: 1.25rem;
}

.actions-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    border: 0;
    border-radius: 6px;
    width: 30px;
    height: 30px;
    background: #e8ecf2;
    color: #223;
    font-weight: 700;
    cursor: pointer;
}

.actions-option {
    display: block;
    text-decoration: none;
    color: #1f2933;
    border: 1px solid #d8dee6;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    font-weight: 600;
}

.actions-option:hover {
    background: #f5f8fc;
}

.actions-option-primary {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.actions-option-primary:hover {
    background: #0b5ed7;
}

.actions-archives-title {
    margin: 14px 0 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #425466;
}

.actions-archives-empty {
    margin: 0;
    color: #6b7280;
}

@media (max-width: 640px) {
    .actions-fab {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 0.88rem;
    }

    .actions-modal-panel {
        padding: 16px;
    }
}

.slide {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(100%); 
}

.slide.active { transform: translateY(0); z-index: 10; }
.slide.prev { transform: translateY(-100%); z-index: 5; }

.photo-bg {
    flex: 1 1 auto;
    min-height: 0;
    background-size: cover;
    background-position: center;
}

/* BANDEAU BLANC */
.caption-bar {
    min-height: 110px;
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 24px calc(12px + env(safe-area-inset-bottom));
    z-index: 20;
    box-sizing: border-box;
}

.caption-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1 1 auto;
}

.publisher-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    max-width: 38px;
    max-height: 38px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #eef1f4;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    line-height: 0;
}

.publisher-avatar-img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    display: block;
}

.publisher-avatar-fallback {
    font-size: 0.72rem;
    font-weight: 700;
    color: #5b6470;
}

.caption-content {
    min-width: 0;
}

.caption-content p {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.35;
    color: #1f2933;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.caption-content .caption-empty {
    min-height: 1.35em;
}

.nav-controls button {
    padding: 10px 16px;
    margin-left: 8px;
    cursor: pointer;
    border: 1px solid #ccc;
    background: rgba(255, 255, 255, 0.9);
    font-weight: bold;
    border-radius: 5px;
}

.nav-controls button:hover { background: #f0f0f0; }

@media (max-width: 992px) {
    .caption-bar {
        min-height: 120px;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        gap: 10px;
    }

    .caption-content p {
        font-size: 1.1rem;
        -webkit-line-clamp: 3;
    }

    .publisher-avatar {
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
        max-width: 34px;
        max-height: 34px;
        flex-basis: 34px;
    }

    .nav-controls button {
        padding: 9px 12px;
        margin-left: 6px;
        font-size: 0.92rem;
    }
}

@media (max-width: 640px) {
    .caption-bar {
        flex-direction: column;
        align-items: stretch;
        justify-content: center;
        min-height: 152px;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    }

    .caption-left {
        align-items: center;
        gap: 10px;
    }

    .caption-content p {
        font-size: 1.02rem;
        -webkit-line-clamp: 3;
    }

    .nav-controls {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .nav-controls button {
        margin-left: 0;
        width: 100%;
    }
}

@supports (-webkit-touch-callout: none) {
    html, body {
        min-height: -webkit-fill-available;
    }

    #album-wrapper {
        min-height: -webkit-fill-available;
    }
}

/* Écran Login */
.login-screen { height: 100vh; background: #1a1a1a; display: flex; justify-content: center; align-items: center; color: white; }
.login-box { background: #333; padding: 30px; border-radius: 10px; text-align: center; }