/*
 * BorderLines — Gallery page styles.
 * Loaded only on pages using the BorderLines Gallery template.
 */

.blpm-gallery-page { background: var(--blpm-white); }

/* Hero (reuses section-overview hero foundation; this stylesheet is loaded
   in addition to section-overview.css when the template is active). */
.blpm-section-hero-description {
    color: rgba(255,255,255,.82);
    max-width: 640px;
    font-size: 16px;
    line-height: 1.65;
    margin: 0;
}

/* ---------- Filter pills ---------- */
.blpm-gallery {
    background: var(--blpm-concrete);
    padding: 64px 0 96px;
}
.blpm-gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 36px;
}
.blpm-gallery-filter {
    background: var(--blpm-white);
    border: 1px solid var(--blpm-border-dark);
    color: var(--blpm-black);
    font-family: var(--blpm-font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    font-size: 12.5px;
    padding: 10px 18px;
    cursor: pointer;
    transition: color var(--blpm-transition), background var(--blpm-transition), border-color var(--blpm-transition);
}
.blpm-gallery-filter:hover {
    border-color: var(--blpm-yellow);
    color: var(--blpm-yellow-dark);
}
.blpm-gallery-filter.is-active {
    background: var(--blpm-black);
    color: var(--blpm-yellow);
    border-color: var(--blpm-black);
}
.blpm-gallery-filter:focus-visible {
    outline: 2px solid var(--blpm-yellow);
    outline-offset: 2px;
}

/* ---------- Grid ---------- */
.blpm-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
.blpm-gallery-item {
    margin: 0;
    background: var(--blpm-black);
    color: var(--blpm-white);
    border: 1px solid var(--blpm-border-dark);
    overflow: hidden;
    transition: transform var(--blpm-transition), box-shadow var(--blpm-transition), border-color var(--blpm-transition);
}
.blpm-gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 44px rgba(0,0,0,.22);
    border-color: var(--blpm-yellow);
}
.blpm-gallery-media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
}
.blpm-gallery-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.blpm-gallery-item:hover .blpm-gallery-media img {
    transform: scale(1.04);
}
.blpm-gallery-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(10,10,10,.08) 0%, rgba(10,10,10,.45) 100%);
    pointer-events: none;
}

.blpm-gallery-caption {
    padding: 20px 22px 22px;
}
.blpm-gallery-caption strong {
    display: block;
    font-family: var(--blpm-font-heading);
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: 17px;
    color: var(--blpm-white);
    margin-bottom: 4px;
}
.blpm-gallery-caption span {
    display: block;
    color: rgba(255,255,255,.7);
    font-size: 13.5px;
    line-height: 1.55;
}
.blpm-gallery-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
}
.blpm-gallery-tags em {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255,194,14,.1);
    border: 1px solid rgba(255,194,14,.4);
    color: var(--blpm-yellow);
    font-family: var(--blpm-font-heading);
    font-style: normal;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 10.5px;
}

.blpm-gallery-item.is-hidden { display: none; }

.blpm-gallery-empty {
    margin: 40px 0 0;
    text-align: center;
    color: #4a4a4a;
    font-size: 16px;
    padding: 28px;
    background: var(--blpm-white);
    border: 1px dashed var(--blpm-border-dark);
}
.blpm-gallery-empty a {
    color: var(--blpm-yellow-dark);
    font-weight: 700;
    text-decoration: underline;
}

/* ---------- Sets ---------- */
.blpm-gallery-set { margin-bottom: 64px; }
.blpm-gallery-set:last-child { margin-bottom: 0; }
.blpm-gallery-set .blpm-section-title { margin-bottom: 26px; }

/* ---------- Badges (the only per-photo text) ---------- */
.blpm-gallery-badge {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 1;
    padding: 5px 12px;
    background: rgba(13,13,13,.85);
    border: 1px solid rgba(255,194,14,.55);
    color: var(--blpm-yellow);
    font-family: var(--blpm-font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 11px;
}

/* ---------- Clickable tiles ---------- */
button.blpm-gallery-open {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
    text-align: inherit;
    font: inherit;
}
button.blpm-gallery-open:focus-visible {
    outline: 3px solid var(--blpm-yellow);
    outline-offset: 2px;
}

/* ---------- Lightbox ---------- */
.blpm-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.blpm-lightbox[hidden] { display: none; }
html.blpm-lightbox-open,
html.blpm-lightbox-open body { overflow: hidden; }
.blpm-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6,6,6,.93);
    cursor: zoom-out;
}
.blpm-lightbox-stage {
    position: relative;
    margin: 0;
    z-index: 1;
    pointer-events: none;
}
.blpm-lightbox-img {
    display: block;
    max-width: min(1200px, 90vw);
    max-height: 82vh;
    width: auto;
    height: auto;
    border: 1px solid rgba(255,194,14,.4);
    box-shadow: 0 30px 80px rgba(0,0,0,.6);
    background: #111;
}
.blpm-lightbox-badge {
    position: absolute;
    left: 14px;
    bottom: 14px;
    padding: 5px 12px;
    background: rgba(13,13,13,.85);
    border: 1px solid rgba(255,194,14,.55);
    color: var(--blpm-yellow);
    font-family: var(--blpm-font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 11px;
}
.blpm-lightbox-counter {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    margin: 0;
    color: rgba(255,255,255,.85);
    font-family: var(--blpm-font-heading);
    font-weight: 700;
    letter-spacing: .18em;
    font-size: 13px;
}
.blpm-lightbox-btn {
    position: absolute;
    z-index: 2;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13,13,13,.85);
    border: 1px solid rgba(255,194,14,.55);
    color: var(--blpm-yellow);
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    transition: background var(--blpm-transition), color var(--blpm-transition);
}
.blpm-lightbox-btn:hover {
    background: var(--blpm-yellow);
    color: var(--blpm-black);
}
.blpm-lightbox-btn:focus-visible {
    outline: 3px solid var(--blpm-yellow);
    outline-offset: 2px;
}
.blpm-lightbox-prev { left: 22px; top: 50%; transform: translateY(-50%); }
.blpm-lightbox-next { right: 22px; top: 50%; transform: translateY(-50%); }
.blpm-lightbox-close { top: 20px; right: 22px; font-size: 26px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .blpm-gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .blpm-gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .blpm-gallery-grid > *:nth-child(odd):last-child { grid-column: 1 / -1; }
    .blpm-gallery-set { margin-bottom: 48px; }
    .blpm-gallery-badge { left: 8px; bottom: 8px; padding: 4px 9px; font-size: 10px; }
    .blpm-lightbox-img { max-width: 96vw; max-height: 72vh; }
    .blpm-lightbox-btn { width: 44px; height: 44px; font-size: 24px; }
    .blpm-lightbox-prev { left: 10px; }
    .blpm-lightbox-next { right: 10px; }
    .blpm-lightbox-close { top: 12px; right: 10px; }
    .blpm-lightbox-counter { bottom: 14px; }
}
