/* ═══════════════════════════════════════════
   Single Project Page — Styles
   Works standalone and inside Oxygen Builder
═══════════════════════════════════════════ */

/* ── Reset inside our wrapper ── */
.ap-sp *, .ap-lb * { box-sizing: border-box; }
.ap-sp { font-family: -apple-system, 'Helvetica Neue', sans-serif; color: #1a1a1a; }

/* ════════════════════════════════
   HERO
════════════════════════════════ */
.ap-sp-hero {
    position: relative;
    min-height: 520px;
    background: #111 center/cover no-repeat;
    display: flex;
    align-items: flex-end;
}
.ap-sp-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.35) 55%, rgba(0,0,0,.15) 100%);
}
.ap-sp-hero-content {
    position: relative;
    padding: clamp(24px, 5vw, 60px);
    color: #fff;
    max-width: 900px;
    width: 100%;
}
.ap-sp-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255,255,255,.6);
    margin-bottom: 14px;
    letter-spacing: .03em;
}
.ap-sp-breadcrumb a { color: inherit; text-decoration: none; }
.ap-sp-breadcrumb a:hover { color: #fff; }
.ap-sp-title {
    font-size: clamp(28px, 5vw, 56px);
    font-weight: 800;
    letter-spacing: -.03em;
    margin: 0 0 16px;
    line-height: 1.1;
    text-shadow: 0 2px 20px rgba(0,0,0,.4);
}
.ap-sp-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 14px;
}
.ap-sp-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255,255,255,.75);
}
.ap-sp-desc {
    font-size: 15px;
    color: rgba(255,255,255,.8);
    margin: 0 0 24px;
    max-width: 600px;
    line-height: 1.6;
}
.ap-sp-hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Buttons ── */
.ap-sp-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 22px;
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all .15s;
    white-space: nowrap;
}
.ap-sp-btn--primary {
    background: #fff;
    color: #1a1a1a;
}
.ap-sp-btn--primary:hover { background: #f0f0f0; transform: translateY(-1px); }
.ap-sp-btn--ghost {
    background: rgba(255,255,255,.15);
    color: #fff;
    border: 1px solid rgba(255,255,255,.35);
    backdrop-filter: blur(6px);
}
.ap-sp-btn--ghost:hover { background: rgba(255,255,255,.25); }

/* ════════════════════════════════
   BODY / CONTENT AREA
════════════════════════════════ */
.ap-sp-body {
    max-width: 1400px;
    margin: 0 auto;
    padding: clamp(24px, 4vw, 48px) clamp(16px, 4vw, 48px);
}

/* ── Filter bar ── */
.ap-sp-filterbar {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.ap-sp-pill {
    padding: 7px 18px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    transition: all .15s;
}
.ap-sp-pill:hover { border-color: #1a1a1a; color: #1a1a1a; }
.ap-sp-pill--on   { background: #1a1a1a; border-color: #1a1a1a; color: #fff; }

/* ════════════════════════════════
   PHOTO GRID — masonry-style columns
════════════════════════════════ */
.ap-sp-grid {
    columns: 4;
    column-gap: 10px;
    margin-bottom: 48px;
}
@media (max-width: 1100px) { .ap-sp-grid { columns: 3; } }
@media (max-width: 700px)  { .ap-sp-grid { columns: 2; } }
@media (max-width: 420px)  { .ap-sp-grid { columns: 1; } }

.ap-sp-cell {
    break-inside: avoid;
    margin-bottom: 10px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}
.ap-sp-cell.ap-sp-hidden { display: none; }
.ap-sp-cell-inner { position: relative; display: block; }

.ap-sp-img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform .4s ease;
}
.ap-sp-cell:hover .ap-sp-img { transform: scale(1.03); }

/* Hover overlay */
.ap-sp-cell-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.38);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    transition: opacity .2s;
}
.ap-sp-cell:hover .ap-sp-cell-overlay { opacity: 1; }

.ap-sp-cell-zoom,
.ap-sp-cell-dl {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,.9);
    color: #1a1a1a;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s, background .15s;
}
.ap-sp-cell-zoom:hover,
.ap-sp-cell-dl:hover { transform: scale(1.1); background: #fff; }

/* ════════════════════════════════
   VIDEO GRID
════════════════════════════════ */
.ap-sp-section { margin-bottom: 48px; }
.ap-sp-section.ap-sp-hidden { display: none; }
.ap-sp-section-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.02em;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}
.ap-sp-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.ap-sp-cell-inner--video {
    background: #111;
    border-radius: 8px;
    overflow: hidden;
}
.ap-sp-video {
    display: block;
    width: 100%;
    max-height: 300px;
    background: #000;
}
.ap-sp-video-meta {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: rgba(255,255,255,.7);
    background: #1a1a1a;
}
.ap-sp-dl-link { color: #fff; text-decoration: none; font-weight: 600; }
.ap-sp-dl-link:hover { text-decoration: underline; }

/* ════════════════════════════════
   LIGHTBOX
════════════════════════════════ */
.ap-lb-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.95);
    z-index: 99998;
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
}
.ap-lb-backdrop.open {
    opacity: 1;
    pointer-events: all;
}

.ap-lb {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.ap-lb[hidden] { display: none; }

.ap-lb-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 60px 80px 0;
    position: relative;
}
@media (max-width: 600px) { .ap-lb-stage { padding: 56px 12px 0; } }

.ap-lb-img {
    max-width: 100%;
    max-height: calc(100vh - 140px);
    object-fit: contain;
    border-radius: 4px;
    display: block;
    opacity: 0;
    transition: opacity .25s;
}
.ap-lb-img.loaded { opacity: 1; }

.ap-lb-spinner {
    position: absolute;
    width: 36px; height: 36px;
    border: 3px solid rgba(255,255,255,.15);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ap-spin .7s linear infinite;
    display: none;
}
.ap-lb-spinner.active { display: block; }
@keyframes ap-spin { to { transform: rotate(360deg); } }

/* Nav buttons */
.ap-lb-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    width: 52px; height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s, transform .15s;
    z-index: 100000;
}
.ap-lb-nav:hover { background: rgba(255,255,255,.25); transform: translateY(-50%) scale(1.05); }
.ap-lb-prev { left: 16px; }
.ap-lb-next { right: 16px; }
@media (max-width: 600px) {
    .ap-lb-prev { left: 4px; }
    .ap-lb-next { right: 4px; }
    .ap-lb-nav  { width: 40px; height: 40px; }
}

/* Close button */
.ap-lb-close {
    position: fixed;
    top: 16px; right: 16px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    color: #fff;
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100001;
    transition: background .15s;
}
.ap-lb-close:hover { background: rgba(255,255,255,.25); }

/* Footer */
.ap-lb-footer {
    width: 100%;
    padding: 12px 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: rgba(255,255,255,.8);
    font-size: 13px;
}
@media (max-width: 600px) { .ap-lb-footer { padding: 10px 16px; } }
.ap-lb-caption { font-weight: 500; flex: 1; }
.ap-lb-footer-right { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.ap-lb-counter { color: rgba(255,255,255,.5); font-size: 12px; }
.ap-lb-dl {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    padding: 6px 14px;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 100px;
    font-size: 12px;
    transition: background .15s;
}
.ap-lb-dl:hover { background: rgba(255,255,255,.15); }

/* ── Error states ── */
.ap-sp-error {
    text-align: center;
    padding: 80px 24px;
    color: #6b7280;
    font-size: 16px;
}
.ap-sp-locked svg { color: #d1d5db; display: block; margin: 0 auto 16px; }

/* ── Dark mode ── */
@media (prefers-color-scheme: dark) {
    .ap-sp { color: #f3f4f6; }
    .ap-sp-pill { background: #1f2937; border-color: #374151; color: #9ca3af; }
    .ap-sp-pill--on { background: #f3f4f6; color: #111; border-color: #f3f4f6; }
    .ap-sp-section-title { border-color: #1f2937; }
}
