/* ================================================================
   FriendsByChance — components/epa-viewer.css
   Editable Photo Album — viewer component (normal / expanded / single-photo)
   ================================================================ */

/* ── Normal mode: outer wrap ────────────────────────────────────── */
.epa-viewer-wrap {
    display:     flex;
    gap:         8px;
    align-items: flex-start;
}

/* ── Normal mode: body ──────────────────────────────────────────── */
.epa-viewer-body {
    flex:       1;
    min-width:  0;
    cursor:     pointer;  /* always clickable → expands */
}
.epa-viewer-body:hover { opacity: 0.92; }

/* ── Normal mode: album title ───────────────────────────────────── */
.epa-viewer-title {
    font-weight:   600;
    font-size:     0.92em;
    margin-bottom: 6px;
    color:         var(--color-text);
}

/* ── Normal mode: photo grid (xs thumbnails, max 2 rows) ────────── */
.epa-viewer-grid {
    display:    flex;
    flex-wrap:  wrap;
    gap:        4px;
    overflow:   hidden;
    /* Max-height = 2 rows of xs thumbnails (128px) + gap */
    max-height: 264px;
}

.epa-viewer-thumb {
    width:       auto;
    height:      128px;
    object-fit:  cover;
    border-radius: 4px;
    display:     block;
    flex-shrink: 0;
}

/* ── Normal mode: description ───────────────────────────────────── */
.epa-viewer-desc {
    font-size:   0.88em;
    color:       var(--color-text-muted);
    margin-top:  6px;
    line-height: 1.5;
}

/* ── Normal mode: side column ───────────────────────────────────── */
.epa-viewer-side-col {
    display:        flex;
    flex-direction: column;
    gap:            6px;
    flex-shrink:    0;
    padding-top:    2px;
}
.epa-viewer-side-col:empty { display: none; }

/* ── Shared fullscreen overlay backdrop ─────────────────────────── */
.epa-fs-overlay {
    position:        fixed;
    inset:           0;
    z-index:         700;
    background:      rgba(0, 0, 0, 0.88);
    display:         flex;
    flex-direction:  column;
    overflow:        hidden;
}

/* ── Expanded / single-photo: top bar ───────────────────────────── */
.epa-fs-topbar {
    flex-shrink:     0;
    display:         flex;
    align-items:     flex-start;
    gap:             12px;
    padding:         12px 16px;
    background:      rgba(0, 0, 0, 0.6);
    border-bottom:   1px solid rgba(255, 255, 255, 0.1);
}

.epa-fs-topbar-info {
    flex:       1;
    min-width:  0;
}

.epa-fs-topbar-name {
    font-weight:   600;
    font-size:     1em;
    color:         #fff;
    white-space:   nowrap;
    overflow:      hidden;
    text-overflow: ellipsis;
}

.epa-fs-topbar-desc {
    font-size:   0.82em;
    color:       rgba(255, 255, 255, 0.7);
    margin-top:  3px;
    line-height: 1.4;
    /* cap at 2 lines */
    display:            -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow:           hidden;
}

.epa-fs-back-btn {
    flex-shrink: 0;
    width:       32px;
    height:      32px;
    background:  rgba(255, 255, 255, 0.12);
    border:      1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    color:       #fff;
    cursor:      pointer;
    display:     flex;
    align-items: center;
    justify-content: center;
    padding:     0;
    transition:  background 0.12s;
}
.epa-fs-back-btn:hover { background: rgba(255, 255, 255, 0.22); }
.epa-fs-back-btn svg   { width: 16px; height: 16px; }

/* ── Expanded mode: wall of photos ─────────────────────────────── */
.epa-wall-body {
    flex:       1;
    overflow-y: auto;
    padding:    12px;
    display:    flex;
    flex-wrap:  wrap;
    gap:        8px;
    align-content: flex-start;
}

.epa-wall-img {
    max-height:    384px;  /* half the s-format height; same file, smaller display */
    max-width:     100%;
    width:         auto;
    height:        auto;
    object-fit:    contain;
    border-radius: 6px;
    cursor:        pointer;
    display:       block;
    flex-shrink:   0;
}
.epa-wall-img:hover { opacity: 0.88; }

/* ── Single-photo mode ──────────────────────────────────────────── */
.epa-single-body {
    flex:            1;
    display:         flex;
    align-items:     center;
    justify-content: center;
    position:        relative;
    overflow:        hidden;
    touch-action:    pan-y;
}

.epa-single-img {
    max-width:  100%;
    max-height: 100%;
    object-fit: contain;
    display:    block;
    user-select: none;
}

/* Prev / next navigation buttons */
.epa-nav-btn {
    position:        absolute;
    top:             50%;
    transform:       translateY(-50%);
    width:           44px;
    height:          44px;
    background:      rgba(0, 0, 0, 0.45);
    border:          1px solid rgba(255, 255, 255, 0.2);
    border-radius:   50%;
    color:           #fff;
    cursor:          pointer;
    display:         flex;
    align-items:     center;
    justify-content: center;
    padding:         0;
    transition:      background 0.12s, opacity 0.12s;
    z-index:         1;
}
.epa-nav-btn:hover          { background: rgba(0, 0, 0, 0.7); }
.epa-nav-btn svg            { width: 18px; height: 18px; }
.epa-nav-btn[disabled]      { opacity: 0.2; pointer-events: none; }
.epa-nav-btn--prev          { left:  12px; }
.epa-nav-btn--next          { right: 12px; }
