/* ============================================================
   Gallery Pro – Frontend Styles
   ============================================================ */

:root {
    --gp-bg:          #0d0d0d;
    --gp-surface:     #1a1a1a;
    --gp-accent:      #c8a96e;
    --gp-accent-2:    #e8d5b0;
    --gp-text:        #f5f5f5;
    --gp-muted:       #888;
    --gp-radius:      4px;
    --gp-gap:         6px;
    --gp-transition:  0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --gp-shadow:      0 24px 80px rgba(0,0,0,.85);
}

/* ── Album selector ──────────────────────────────────────── */

.gp-album-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}

.gp-album-card {
    position: relative;
    width: 200px;
    aspect-ratio: 4/3;
    border-radius: var(--gp-radius);
    overflow: hidden;
    cursor: pointer;
    background: var(--gp-surface);
    border: 2px solid transparent;
    transition: border-color var(--gp-transition), transform var(--gp-transition);
    font-family: 'Georgia', serif;
}

.gp-album-card:hover {
    border-color: var(--gp-accent);
    transform: translateY(-3px);
}

.gp-album-card.active {
    border-color: var(--gp-accent);
    box-shadow: 0 0 0 4px rgba(200,169,110,.25);
}

.gp-album-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.gp-album-card:hover img {
    transform: scale(1.06);
}

.gp-album-label {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 22px 10px 8px;
    background: linear-gradient(transparent, rgba(0,0,0,.82));
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .03em;
}

.gp-album-count {
    font-size: 11px;
    opacity: .7;
    margin-top: 2px;
    font-weight: 400;
}

/* ── Grid container ──────────────────────────────────────── */

.gp-grid-container {
    display: grid;
    gap: var(--gp-gap);
}

.gp-grid-container.columns-2 { grid-template-columns: repeat(2, 1fr); }
.gp-grid-container.columns-3 { grid-template-columns: repeat(3, 1fr); }
.gp-grid-container.columns-4 { grid-template-columns: repeat(4, 1fr); }

/* Masonry style */
.gp-grid-container.style-masonry {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    grid-template-rows:    masonry;
    align-items: start;
}

/* Filmstrip style */
.gp-grid-container.style-filmstrip {
    display: flex;
    gap: var(--gp-gap);
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--gp-accent) transparent;
}

.gp-grid-container.style-filmstrip .gp-thumb {
    flex: 0 0 240px;
    height: 180px;
    scroll-snap-align: start;
}

/* ── Thumbnail ───────────────────────────────────────────── */

.gp-thumb {
    position: relative;
    overflow: hidden;
    border-radius: var(--gp-radius);
    background: var(--gp-surface);
    cursor: pointer;
    aspect-ratio: 1 / 1;
    display: block;
}

.gp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                filter 0.35s ease;
    will-change: transform;
}

.gp-thumb:hover img {
    transform: scale(1.07);
    filter: brightness(1.08);
}

.gp-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(200,169,110,0);
    transition: background var(--gp-transition);
}

.gp-thumb:hover::after {
    background: rgba(200,169,110,.12);
}

/* Skeleton loading */
.gp-thumb.skeleton {
    background: linear-gradient(90deg, #1e1e1e 25%, #2a2a2a 50%, #1e1e1e 75%);
    background-size: 200% 100%;
    animation: gp-shimmer 1.4s infinite;
    cursor: default;
}

@keyframes gp-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Loading text */
.gp-loading {
    color: var(--gp-muted);
    font-family: 'Georgia', serif;
    font-style: italic;
    font-size: 14px;
    padding: 20px 0;
}

/* ── Lightbox ────────────────────────────────────────────── */

.gp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.gp-lightbox.active {
    opacity: 1;
    pointer-events: all;
}

.gp-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5,5,5,.95);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.gp-lightbox-inner {
    position: relative;
    z-index: 1;
    max-width: min(92vw, 1200px);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gp-lightbox-img-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 80vh;
}

.gp-lightbox-img-wrap img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--gp-radius);
    box-shadow: var(--gp-shadow);
    display: block;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.gp-lightbox-img-wrap img.transitioning {
    opacity: 0;
    transform: scale(0.97);
}

/* Navigation arrows */
.gp-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    background: rgba(200,169,110,.12);
    border: 1.5px solid rgba(200,169,110,.35);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--gp-transition), border-color var(--gp-transition), transform var(--gp-transition);
    color: var(--gp-accent);
    flex-shrink: 0;
    z-index: 2;
}

.gp-arrow:hover {
    background: rgba(200,169,110,.25);
    border-color: var(--gp-accent);
    transform: translateY(-50%) scale(1.08);
}

.gp-arrow svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gp-arrow-prev { left: -70px; }
.gp-arrow-next { right: -70px; }

/* Close button */
.gp-close {
    position: fixed;
    top: 24px;
    right: 28px;
    width: 44px;
    height: 44px;
    background: rgba(200,169,110,.1);
    border: 1.5px solid rgba(200,169,110,.3);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gp-accent);
    transition: background var(--gp-transition), transform var(--gp-transition);
    z-index: 3;
}

.gp-close:hover {
    background: rgba(200,169,110,.25);
    transform: rotate(90deg) scale(1.1);
}

.gp-close svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
}

/* Caption & counter */
.gp-lightbox-meta {
    margin-top: 18px;
    text-align: center;
    font-family: 'Georgia', serif;
    width: 100%;
    max-width: 700px;
}

.gp-lightbox-caption {
    font-size: 14px;
    color: var(--gp-accent-2);
    line-height: 1.6;
    font-style: italic;
    min-height: 1.6em;
    transition: opacity 0.2s;
}

.gp-lightbox-counter {
    font-size: 11px;
    color: var(--gp-muted);
    margin-top: 8px;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
}

/* Decorative gold line */
.gp-lightbox-meta::before {
    content: '';
    display: block;
    width: 40px;
    height: 1px;
    background: var(--gp-accent);
    margin: 0 auto 14px;
    opacity: 0.6;
}

/* Touch swipe hint */
.gp-swipe-hint {
    display: none;
    font-size: 11px;
    color: var(--gp-muted);
    margin-top: 10px;
    letter-spacing: .1em;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 900px) {
    .gp-arrow-prev { left: 8px; }
    .gp-arrow-next { right: 8px; }
    .gp-arrow { width: 42px; height: 42px; }
    .gp-swipe-hint { display: block; }
}

@media (max-width: 640px) {
    .gp-grid-container.columns-3,
    .gp-grid-container.columns-4 { grid-template-columns: repeat(2, 1fr); }
    .gp-album-card { width: 150px; }
    .gp-arrow { opacity: 0.8; }
}

@media (max-width: 400px) {
    .gp-grid-container.columns-2 { grid-template-columns: 1fr; }
}
