/* ================================================================
   Synchro Albums Multi v4.0 — Front-office CSS
   ================================================================ */

/* ── Wrapper ───────────────────────────────────────────────────── */
.sam-front-wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

/* ── Toolbar ───────────────────────────────────────────────────── */
.sam-toolbar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.sam-filter-input,
.sam-photo-search {
    padding: 9px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    min-width: 240px;
    outline: none;
    transition: border-color .2s;
}
.sam-filter-input:focus,
.sam-photo-search:focus { border-color: #1877f2; }

.sam-filter-count {
    font-size: 13px; color: #888; padding: 6px 4px; white-space: nowrap;
}

/* ── Albums grid ───────────────────────────────────────────────── */
.sam-albums-grid {
    display: grid;
    grid-template-columns: repeat(var(--sam-cols, 3), 1fr);
    gap: 20px;
    margin-bottom: 32px;
}
@media (max-width: 900px) { .sam-albums-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .sam-albums-grid { grid-template-columns: 1fr; } }

/* ── Album thumbnail ───────────────────────────────────────────── */
.sam-album-thumb {
    border-radius: 10px;
    overflow: hidden;
    background: #f0f0f0;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    transition: transform .2s, box-shadow .2s;
    position: relative;
}
.sam-album-thumb:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.14); }

.sam-album-link { display: block; position: relative; aspect-ratio: 4/3; overflow: hidden; }
.sam-album-cover-img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}
.sam-album-link:hover .sam-album-cover-img { transform: scale(1.05); }

.sam-album-no-cover {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 48px; background: #e8e8e8;
}

/* Badge photo count */
.sam-album-badge {
    position: absolute; bottom: 8px; right: 8px;
    background: rgba(0,0,0,.65); color: #fff;
    font-size: 12px; font-weight: 600;
    padding: 3px 8px; border-radius: 12px;
    backdrop-filter: blur(4px);
}

.sam-album-info { padding: 10px 12px 12px; }
.sam-album-name { display: block; font-weight: 600; font-size: 14px; margin-bottom: 2px; color: #222; }
.sam-album-date { display: block; font-size: 12px; color: #888; }
.sam-album-views { display: block; font-size: 11px; color: #aaa; margin-top: 2px; }

/* ── Pagination ────────────────────────────────────────────────── */
.sam-pagination { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin: 24px 0; }
.sam-page-btn {
    display: inline-block; padding: 7px 13px;
    border: 1px solid #ddd; border-radius: 5px;
    text-decoration: none; color: #333; font-size: 14px;
    transition: background .15s;
}
.sam-page-btn:hover { background: #f0f0f0; }
.sam-page-current { background: #1877f2; color: #fff; border-color: #1877f2; }

/* ── Album detail header ───────────────────────────────────────── */
.sam-album-detail-header {
    display: flex; align-items: center; gap: 16px;
    flex-wrap: wrap; margin-bottom: 20px;
    padding-bottom: 16px; border-bottom: 1px solid #eee;
}
.sam-back-btn {
    text-decoration: none; color: #1877f2; font-size: 14px;
    font-weight: 600; white-space: nowrap;
    padding: 6px 14px; border: 1px solid #1877f2; border-radius: 5px;
    transition: background .15s, color .15s;
}
.sam-back-btn:hover { background: #1877f2; color: #fff; }
.sam-album-detail-title { margin: 0; font-size: 22px; flex: 1; }
.sam-album-detail-count { font-size: 13px; color: #888; }

/* ── Breadcrumb ────────────────────────────────────────────────── */
.sam-breadcrumb {
    font-size: 13px; color: #888;
    margin-bottom: 12px; display: flex; align-items: center; gap: 6px;
}
.sam-breadcrumb a { color: #1877f2; text-decoration: none; }
.sam-breadcrumb a:hover { text-decoration: underline; }
.sam-breadcrumb-sep { color: #ccc; }

/* ── Photos grid ───────────────────────────────────────────────── */
.sam-grid {
    display: grid;
    grid-template-columns: repeat(var(--sam-cols, 3), 1fr);
    gap: 10px;
    margin-bottom: 32px;
}
@media (max-width: 768px) { .sam-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .sam-grid { grid-template-columns: 1fr 1fr; } }

/* ── Masonry ───────────────────────────────────────────────────── */
.sam-masonry {
    columns: var(--sam-cols, 3);
    column-gap: 10px;
    margin-bottom: 32px;
}
.sam-masonry .sam-photo-wrap {
    break-inside: avoid;
    margin-bottom: 10px;
}
@media (max-width: 768px) { .sam-masonry { columns: 2; } }
@media (max-width: 480px) { .sam-masonry { columns: 1; } }

/* ── Photo item ────────────────────────────────────────────────── */
.sam-photo-wrap { position: relative; overflow: hidden; border-radius: 6px; }
.sam-grid .sam-photo-wrap { aspect-ratio: 1/1; }

.sam-photo-link { display: block; }
.sam-grid .sam-photo-link { width: 100%; height: 100%; }

.sam-lazy-wrap { width: 100%; height: 100%; overflow: hidden; }
.sam-grid .sam-lazy-wrap { height: 100%; }

.sam-photo-img {
    width: 100%; display: block;
    object-fit: cover;
    transition: transform .25s, opacity .3s;
    background: #eee;
}
.sam-grid .sam-photo-img { height: 100%; }

.sam-photo-wrap:hover .sam-photo-img { transform: scale(1.04); }

/* Shimmer placeholder */
.sam-photo-img:not([src]),
.sam-photo-img[src=""] {
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
    background-size: 200% 100%;
    animation: sam-shimmer 1.4s infinite;
}
@keyframes sam-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.sam-photo-caption {
    display: block; position: absolute; bottom: 0; left: 0; right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,.65));
    color: #fff; font-size: 11px; padding: 16px 8px 6px;
    opacity: 0; transition: opacity .2s;
}
.sam-photo-wrap:hover .sam-photo-caption { opacity: 1; }

/* ── Social share ──────────────────────────────────────────────── */
.sam-social-share {
    display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
    margin-top: 24px; padding-top: 16px; border-top: 1px solid #eee;
    font-size: 14px; color: #666;
}
.sam-share-fb, .sam-share-copy {
    padding: 6px 14px; border-radius: 5px; text-decoration: none;
    font-size: 13px; font-weight: 600; cursor: pointer;
}
.sam-share-fb { background: #1877f2; color: #fff; }
.sam-share-copy { background: #eee; color: #333; border: none; }
.sam-share-fb:hover { background: #0d65d8; }
.sam-share-copy:hover { background: #ddd; }

/* ── Password form ─────────────────────────────────────────────── */
.sam-password-form {
    max-width: 360px; margin: 40px auto; padding: 28px;
    border: 1px solid #ddd; border-radius: 10px; text-align: center;
}
.sam-password-form input {
    width: 100%; padding: 9px 12px; margin: 12px 0;
    border: 1px solid #ddd; border-radius: 5px; font-size: 14px; box-sizing: border-box;
}
.sam-password-form button {
    padding: 9px 24px; background: #1877f2; color: #fff;
    border: none; border-radius: 5px; cursor: pointer; font-size: 14px; font-weight: 600;
}

/* ── Notice ────────────────────────────────────────────────────── */
.sam-notice { padding: 12px 16px; background: #fff3cd; border-radius: 6px; font-size: 14px; }

/* ── Lightbox ──────────────────────────────────────────────────── */
.sam-lb-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.92); z-index: 99998;
}
.sam-lb-overlay.sam-lb-open { display: block; }

.sam-lightbox {
    display: none; position: fixed; inset: 0; z-index: 99999;
    align-items: center; justify-content: center; flex-direction: column;
}
.sam-lightbox.sam-lb-open { display: flex; }

.sam-lb-content {
    position: relative; max-width: 92vw; max-height: 88vh;
    display: flex; flex-direction: column; align-items: center;
}

.sam-lb-img {
    max-width: 90vw; max-height: 80vh;
    object-fit: contain; display: block;
    border-radius: 4px; transition: opacity .25s;
    box-shadow: 0 8px 40px rgba(0,0,0,.5);
}

.sam-lb-loader {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px; display: none;
}

.sam-lb-caption {
    color: rgba(255,255,255,.85); font-size: 14px;
    text-align: center; margin-top: 10px; max-width: 80vw;
    text-shadow: 0 1px 3px rgba(0,0,0,.8);
}

.sam-lb-counter {
    color: rgba(255,255,255,.5); font-size: 12px; margin-top: 4px;
}

.sam-lb-close {
    position: fixed; top: 18px; right: 22px;
    background: rgba(255,255,255,.15); color: #fff;
    border: none; font-size: 22px; cursor: pointer;
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s; z-index: 100000;
}
.sam-lb-close:hover { background: rgba(255,255,255,.3); }

.sam-lb-prev, .sam-lb-next {
    position: fixed; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,.12); color: #fff;
    border: none; font-size: 36px; cursor: pointer;
    width: 52px; height: 52px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s; z-index: 100000; line-height: 1;
}
.sam-lb-prev { left: 14px; }
.sam-lb-next { right: 14px; }
.sam-lb-prev:hover, .sam-lb-next:hover { background: rgba(255,255,255,.25); }

@media (max-width: 600px) {
    .sam-lb-prev { left: 4px; }
    .sam-lb-next { right: 4px; }
    .sam-lb-img { max-height: 72vh; }
}

/* ── Widget ────────────────────────────────────────────────────── */
.sam-widget-list { list-style: none; margin: 0; padding: 0; }
.sam-widget-item { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sam-widget-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 5px; flex-shrink: 0; }
.sam-widget-name { font-size: 13px; font-weight: 600; color: #222; text-decoration: none; display: block; }
.sam-widget-count { font-size: 11px; color: #888; }

/* ── Vidéos — vignette avec overlay ▶ ──────────────────────────── */
.sam-video-wrap .sam-lazy-wrap { position: relative; }

.sam-video-play-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.35);
    transition: background .2s;
}
.sam-video-wrap:hover .sam-video-play-overlay { background: rgba(0,0,0,.55); }

.sam-video-play-btn {
    width: 52px; height: 52px; border-radius: 50%;
    background: rgba(255,255,255,.9);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: #111;
    box-shadow: 0 2px 12px rgba(0,0,0,.4);
    transition: transform .15s;
    padding-left: 4px; /* optique */
}
.sam-video-wrap:hover .sam-video-play-btn { transform: scale(1.1); }

/* ── Lightbox — zone vidéo ─────────────────────────────────────── */
.sam-lb-video-wrap {
    position: relative;
    width: min(880px, 90vw);
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Player FB SDK */
.sam-lb-fb-player {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
}
.sam-lb-fb-player .fb-video,
.sam-lb-fb-player .fb-video span,
.sam-lb-fb-player .fb-video iframe {
    width: 100% !important;
    height: 100% !important;
}

/* Fallback lien Facebook */
.sam-lb-video-fallback {
    display: block;
    margin-top: 10px;
    color: #fff;
    font-size: 14px;
    text-align: center;
    background: rgba(24,119,242,0.85);
    padding: 8px 18px;
    border-radius: 20px;
    text-decoration: none;
    transition: background .2s;
    position: absolute;
    bottom: 48px;
    z-index: 10;
}
.sam-lb-video-fallback:hover { background: #1877f2; }

.sam-lb-fullscreen {
    position: absolute; bottom: 10px; right: 10px;
    background: rgba(0,0,0,.6); color: #fff;
    border: none; border-radius: 4px;
    font-size: 18px; cursor: pointer;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s; z-index: 10;
}
.sam-lb-fullscreen:hover { background: rgba(0,0,0,.9); }

/* ── Filtres catégories & tags ──────────────────────────────────── */
.sam-tax-filters {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 6px; margin-top: 10px;
}
.sam-tax-label { font-size: 16px; margin-right: 2px; }

.sam-tax-btn {
    padding: 5px 12px; border-radius: 20px; font-size: 13px;
    border: 1.5px solid #d0d5dd; background: #fff; cursor: pointer;
    transition: all .15s; color: #344054;
}
.sam-tax-btn:hover { border-color: #1877f2; color: #1877f2; }
.sam-tax-btn.active {
    background: #1877f2; border-color: #1877f2;
    color: #fff; font-weight: 600;
}
.sam-tag-btn.active { background: #6941c6; border-color: #6941c6; }

/* ── Titres sections filtres ────────────────────────────────────── */
.sam-tax-filters { margin-top: 12px; }
.sam-tax-section-title {
    display: block; font-size: 12px; font-weight: 600;
    color: #667085; text-transform: uppercase; letter-spacing: .05em;
    margin-bottom: 6px;
}
.sam-tax-btns { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── Album virtuel Vidéos ───────────────────────────────────────── */
.sam-album-video-virtual .sam-album-link::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(24,119,242,0.15) 0%, rgba(80,0,120,0.2) 100%);
    pointer-events: none;
    z-index: 1;
}
.sam-album-video-badge {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 100%);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 22px 10px 8px;
    text-align: center;
    letter-spacing: 0.03em;
    z-index: 2;
}
