/* ═══════════════════════════════════════════════════════════════════════════
   IndiePhoto — Public Gallery Styles
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Layout wrapper ───────────────────────────────────────────────────────── */
.indp-gallery-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px;
    font-family: inherit;
}

/* ── Filter bar ───────────────────────────────────────────────────────────── */
.indp-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    align-items: center;
}

.indp-filters label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.indp-filters select,
.indp-filters input[type="text"] {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 14px;
    background: #fff;
    min-width: 160px;
}

.indp-filters button {
    align-self: flex-end;
    padding: 7px 18px;
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background .2s;
}

.indp-filters button:hover {
    background: #e94560;
}

.indp-result-count {
    align-self: flex-end;
    font-size: 13px;
    color: #888;
    margin-left: auto;
}

/* ── Map ──────────────────────────────────────────────────────────────────── */
#indp-map {
    width: 100%;
    height: 380px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* Leaflet popup styles */
.indp-map-popup {
    text-align: center;
    min-width: 140px;
}

.indp-map-popup img {
    width: 130px;
    height: 90px;
    object-fit: cover;
    display: block;
    margin: 0 auto 6px;
    border-radius: 3px;
}

.indp-map-popup p {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.indp-map-popup a {
    font-size: 12px;
    color: #2271b1;
    text-decoration: none;
}

/* ── Photo grid ───────────────────────────────────────────────────────────── */
.indp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
}

.indp-photo-card {
    position: relative;
    background: #111;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}

.indp-photo-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,.25);
}

.indp-photo-card img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    transition: opacity .2s;
}

.indp-photo-card:hover img {
    opacity: .88;
}

/* Selection mode: card selected state */
.indp-photo-card.selected {
    outline: 3px solid #e94560;
    outline-offset: -3px;
}

.indp-photo-card.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    background: #e94560;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 26px;
    text-align: center;
    border-radius: 50%;
}

/* Card info bar */
.indp-card-meta {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,.72));
    color: #fff;
    padding: 28px 10px 8px;
    font-size: 12px;
    line-height: 1.4;
}

.indp-card-meta .indp-card-riders {
    font-weight: 600;
    font-size: 13px;
}

.indp-card-meta .indp-card-date {
    opacity: .75;
}

/* ── Buy buttons on hover ─────────────────────────────────────────────────── */
.indp-buy-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
}

.indp-photo-card:hover .indp-buy-overlay {
    opacity: 1;
    pointer-events: auto;
}

.indp-buy-btn {
    display: inline-block;
    padding: 7px 18px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    min-width: 160px;
    transition: background .15s;
    cursor: pointer;
    border: none;
}

.indp-buy-btn.single {
    background: #e94560;
    color: #fff;
}

.indp-buy-btn.single:hover {
    background: #c73050;
}

.indp-buy-btn.pack {
    background: #fff;
    color: #1a1a2e;
}

.indp-buy-btn.pack:hover {
    background: #f0f0f0;
}

/* ── Lightbox ─────────────────────────────────────────────────────────────── */
#indp-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.9);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#indp-lightbox.active {
    display: flex;
}

#indp-lightbox img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 60px rgba(0,0,0,.5);
}

#indp-lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    background: none;
    border: none;
    opacity: .7;
    transition: opacity .15s;
}

#indp-lightbox-close:hover { opacity: 1; }

#indp-lightbox-nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
}

#indp-lightbox-nav button {
    background: rgba(255,255,255,.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,.3);
    padding: 6px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background .15s;
}

#indp-lightbox-nav button:hover {
    background: rgba(255,255,255,.3);
}

/* ── Pagination ───────────────────────────────────────────────────────────── */
.indp-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.indp-pagination a,
.indp-pagination span {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    color: #333;
    background: #fff;
    transition: background .15s, color .15s;
}

.indp-pagination a:hover,
.indp-pagination span.current {
    background: #1a1a2e;
    color: #fff;
    border-color: #1a1a2e;
}

/* ── Selection page extras ────────────────────────────────────────────────── */
.indp-selection-header {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.indp-selection-header h2 {
    margin: 0;
    font-size: 20px;
}

.indp-selection-counter {
    font-size: 15px;
    font-weight: 600;
    color: #e94560;
}

.indp-confirm-bar {
    position: sticky;
    bottom: 0;
    background: #1a1a2e;
    color: #fff;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    border-radius: 6px 6px 0 0;
    z-index: 100;
}

.indp-confirm-btn {
    background: #e94560;
    color: #fff;
    border: none;
    padding: 10px 28px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    transition: background .15s;
}

.indp-confirm-btn:hover { background: #c73050; }
.indp-confirm-btn:disabled { background: #888; cursor: default; }

/* ── Error box ────────────────────────────────────────────────────────────── */
.indp-error {
    background: #fff0f0;
    border-left: 4px solid #c00;
    padding: 14px 18px;
    border-radius: 4px;
    color: #800;
    margin: 20px 0;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 680px) {
    .indp-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 8px;
    }
    #indp-map {
        height: 260px;
    }
    .indp-filters {
        flex-direction: column;
        align-items: stretch;
    }
    .indp-filters select {
        min-width: unset;
        width: 100%;
    }
}
