/* ============================================================
   Before & After Projects — Front-end styles
   ============================================================ */

.bap-wrap {
    --bap-accent:        #0ea5b7;
    --bap-accent-dark:   #0a8a99;
    --bap-navy:          #0f2540;
    --bap-text:          #1a2b3c;
    --bap-muted:         #6b7785;
    --bap-line:          #e6eaef;
    --bap-card-bg:       #ffffff;
    --bap-radius:        14px;

    max-width: 1200px;
    margin: 40px auto;
    padding: 0 16px;
    color: var(--bap-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---------- Grid ---------- */
.bap-grid {
    display: grid;
    grid-template-columns: repeat(var(--bap-cols, 3), minmax(0, 1fr));
    gap: 26px;
}

/* ---------- Card ---------- */
.bap-card {
    background: var(--bap-card-bg);
    border: 1px solid var(--bap-line);
    border-radius: var(--bap-radius);
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(15,37,64,.06);
    transition: transform .25s ease, box-shadow .25s ease;
    display: flex;
    flex-direction: column;
}
.bap-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(15,37,64,.12);
}

/* ---------- Before/After Slider ---------- */
.bap-slider {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    cursor: ew-resize;
    user-select: none;
    background: #1a1a1a;
    outline: none;
}
.bap-slider:focus-visible {
    box-shadow: inset 0 0 0 3px var(--bap-accent);
}
.bap-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}
.bap-img-before {
    /* Initial reveal: left half */
    clip-path: inset(0 50% 0 0);
    -webkit-clip-path: inset(0 50% 0 0);
    z-index: 2;
}
.bap-img-after { z-index: 1; }

/* Labels */
.bap-tag {
    position: absolute;
    top: 12px;
    background: rgba(0,0,0,.65);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    padding: 5px 10px;
    border-radius: 4px;
    z-index: 4;
    pointer-events: none;
}
.bap-tag-before { left: 12px; }
.bap-tag-after  {
    right: 12px;
    background: var(--bap-accent);
}

/* Handle (vertical divider with knob) */
.bap-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    background: #fff;
    transform: translateX(-50%);
    z-index: 3;
    box-shadow: 0 0 12px rgba(0,0,0,.4);
    pointer-events: none;
}
.bap-handle-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #fff;
    color: var(--bap-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(0,0,0,.35);
    pointer-events: auto;
}
.bap-handle-knob .bap-arrow-l,
.bap-handle-knob .bap-arrow-r {
    line-height: 1;
}

/* ---------- Card body ---------- */
.bap-card-body {
    padding: 20px 22px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.bap-card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--bap-navy);
    margin: 0;
    line-height: 1.35;
}
.bap-card-desc {
    margin: 0;
    color: var(--bap-muted);
    font-size: 14.5px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- View More button ---------- */
.bap-more-wrap {
    text-align: center;
    margin-top: 40px;
}
.bap-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--bap-accent);
    color: #fff !important;
    text-decoration: none !important;
    padding: 14px 30px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 15px;
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
    box-shadow: 0 6px 18px rgba(14,165,183,.3);
}
.bap-more-btn:hover {
    background: var(--bap-accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(14,165,183,.4);
    color: #fff !important;
}
.bap-more-arrow { transition: transform .2s; }
.bap-more-btn:hover .bap-more-arrow { transform: translateX(4px); }

/* ---------- Empty state ---------- */
.bap-empty {
    text-align: center;
    color: var(--bap-muted);
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: var(--bap-radius);
}

/* ---------- Archive page wrapper ---------- */
.bap-archive {
    max-width: 1240px;
    margin: 50px auto;
    padding: 0 20px;
}
.bap-archive-header {
    text-align: center;
    margin-bottom: 50px;
}
.bap-archive-header h1 {
    font-size: 42px;
    color: var(--bap-navy);
    margin: 0 0 12px;
    font-weight: 800;
}
.bap-archive-header p {
    color: var(--bap-muted);
    font-size: 17px;
    max-width: 600px;
    margin: 0 auto;
}
.bap-pagination {
    text-align: center;
    margin-top: 40px;
}
.bap-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 4px;
    border: 1px solid var(--bap-line);
    border-radius: 6px;
    color: var(--bap-text);
    text-decoration: none;
    font-size: 14px;
}
.bap-pagination .page-numbers.current,
.bap-pagination .page-numbers:hover {
    background: var(--bap-accent);
    color: #fff;
    border-color: var(--bap-accent);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .bap-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .bap-grid { grid-template-columns: 1fr; }
    .bap-archive-header h1 { font-size: 30px; }
}
