/* =========================================================
   File:    assets/style.css
   Author:  Echo
   Purpose: Gallery layout — photo albums, video library,
            and shared lightbox.
   Changelog:
       2026-06-04  Echo  Initial.
       2026-06-04  Echo  Video tiles + play badge + sections.
   ========================================================= */

:root {
    --bg:        #0f1115;
    --surface:   #171a21;
    --surface-2: #1e222b;
    --text:      #e7e9ee;
    --muted:     #8a92a3;
    --accent:    #5aa9ff;
    --border:    #262b36;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .wrap {
    display: flex; align-items: center; justify-content: space-between; height: 56px;
}
.site-header .brand { font-weight: 600; font-size: 16px; color: var(--text); letter-spacing: 0.5px; }
.site-header nav a { margin-left: 18px; color: var(--muted); }
.site-header nav a:hover { color: var(--text); text-decoration: none; }

.site-footer {
    border-top: 1px solid var(--border);
    margin-top: 60px; padding: 18px 0; color: var(--muted);
}

main.wrap { padding-top: 30px; padding-bottom: 60px; }

h1 { font-weight: 600; margin: 0 0 18px; }
.muted, .empty { color: var(--muted); }
.crumbs { color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }

.section + .section { margin-top: 50px; }

/* Album grid (shared by photo + video albums) */
.album-grid {
    list-style: none; margin: 0; padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}
.album-card a {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    color: inherit;
    transition: transform .15s ease, border-color .15s ease;
}
.album-card a:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    text-decoration: none;
}
.album-cover {
    aspect-ratio: 4 / 3;
    background-size: cover;
    background-position: center;
    background-color: var(--surface-2);
    position: relative;
}
.album-meta {
    padding: 10px 12px;
    display: flex; justify-content: space-between; align-items: center;
}
.album-title { font-weight: 600; }
.album-count { color: var(--muted); font-size: 13px; }

/* Video cover (uses real <video> as poster preview) */
.video-cover {
    background: #000;
    overflow: hidden;
    aspect-ratio: 4 / 3;   /* re-assert; some browsers drop it when bg is re-set */
    position: relative;
}
.video-cover video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}
.play-badge {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 56px; height: 56px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 22px;
    display: flex; align-items: center; justify-content: center;
    padding-left: 4px;
    backdrop-filter: blur(2px);
    transition: background .15s ease;
}
.album-card a:hover .play-badge { background: rgba(0,0,0,0.75); }

/* Photo grid */
.photo-grid {
    list-style: none; margin: 18px 0 0; padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}
.photo-tile a {
    display: block;
    background: var(--surface);
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}
.photo-tile img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform .25s ease, opacity .25s ease;
    -webkit-user-drag: none; user-select: none; pointer-events: none;
}
.photo-tile a:hover img { transform: scale(1.04); }

/* Video grid */
.video-grid {
    list-style: none; margin: 18px 0 0; padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.video-tile a {
    display: block;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    position: relative;
}
.video-tile video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}
.video-tile .play-badge { width: 64px; height: 64px; font-size: 24px; }

/* Lightbox */
.lb-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.92);
    display: none;
    align-items: center; justify-content: center;
    z-index: 1000;
    user-select: none;
}
.lb-overlay.open { display: flex; }
.lb-overlay img,
.lb-overlay video {
    max-width: 92vw;
    max-height: 88vh;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
    background: #000;
}
.lb-overlay img {
    -webkit-user-drag: none; user-select: none; pointer-events: none;
}
.lb-btn {
    position: absolute;
    background: rgba(255,255,255,0.08);
    color: #fff; border: 0;
    width: 48px; height: 48px;
    border-radius: 50%;
    font-size: 22px; cursor: pointer;
}
.lb-btn:hover { background: rgba(255,255,255,0.18); }
.lb-prev  { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next  { right: 18px; top: 50%; transform: translateY(-50%); }
.lb-close { right: 18px; top: 18px; }
.lb-counter {
    position: absolute;
    left: 50%; bottom: 18px;
    transform: translateX(-50%);
    color: var(--muted); font-size: 13px;
}

@media (max-width: 600px) {
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .video-grid { grid-template-columns: 1fr; }
    .lb-btn { width: 40px; height: 40px; }
}
