/* Recent Work — front-end [recent_work] section */

.rw-recent-work,
.rw-recent-work * {
    box-sizing: border-box;
}

/* Outer container: fixed section heading above the carousel row */
.rw-recent-work {
    width: 100%;
    margin: 0;
}

/* Section heading — stays in place, never scrolls with the cards */
.rw-section-title {
    margin: 0 0 16px;
}

/* Carousel row: [arrow] [viewport] [arrow] */
.rw-carousel {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.rw-viewport {
    flex: 1 1 auto;
    min-width: 0;          /* allow flex child to shrink */
    overflow: hidden;
}

.rw-track {
    display: flex;
    transition: transform 0.35s ease;
    will-change: transform;
}

/* One card per view */
.rw-card {
    flex: 0 0 100%;
    width: 100%;
}

.rw-card-inner {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    height: 100%;
    padding: 22px 24px;
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.rw-card-text {
    flex: 1 1 auto;
    min-width: 0;
}

.rw-card-title {
    margin: 0 0 12px;
    font-size: 1.4em;
    line-height: 1.25;
}

.rw-card-details {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rw-card-details li {
    margin: 0 0 6px;
    line-height: 1.45;
}

.rw-card-details .rw-label {
    font-weight: 700;
}

/* Photos (right) — laid out horizontally, wrapping as space allows */
.rw-card-photos {
    flex: 0 1 auto;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-content: flex-start;
    gap: 10px;
    max-width: 50%;
}

.rw-thumb {
    display: block;
    line-height: 0;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #e2e4e7;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.rw-thumb:hover,
.rw-thumb:focus {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
    outline: none;
}

.rw-thumb-img,
.rw-card-photos img {
    display: block;
    width: 132px;
    height: 100px;
    object-fit: cover;
    margin: 0;
    max-width: 100%;
}

/* Navigation arrows */
.rw-arrow {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    font-size: 26px;
    line-height: 1;
    color: #1d2327;
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

/* Explicit override: our display:flex otherwise beats the [hidden] attribute,
   so a single-job section (or max-jobs="1") would still show the arrows. */
.rw-arrow[hidden] {
    display: none;
}

.rw-arrow:hover:not(:disabled),
.rw-arrow:focus:not(:disabled) {
    background: #2271b1;
    color: #fff;
    outline: none;
}

.rw-arrow:disabled {
    opacity: 0.35;
    cursor: default;
}

.rw-arrow span {
    margin-top: -3px; /* optical centering of the chevron glyph */
}

/* ============================================================ */
/* Lightbox                                                     */
/* ============================================================ */
.rw-lightbox {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
    z-index: 100000;
}

.rw-lightbox[hidden] {
    display: none;
}

body.rw-lb-open {
    overflow: hidden;
}

.rw-lb-figure {
    margin: 0;
    max-width: 92vw;
    max-height: 90vh;
    text-align: center;
}

.rw-lb-img {
    display: block;
    max-width: 92vw;
    max-height: 82vh;
    width: auto;
    height: auto;
    margin: 0 auto;
    border-radius: 4px;
    box-shadow: 0 6px 40px rgba(0, 0, 0, 0.5);
}

.rw-lb-caption {
    margin-top: 12px;
    color: #f0f0f1;
    font-size: 15px;
    line-height: 1.4;
}

.rw-lb-close,
.rw-lb-nav {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s ease;
}

.rw-lb-close:hover,
.rw-lb-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.rw-lb-close {
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    font-size: 30px;
    line-height: 1;
}

.rw-lb-nav {
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    font-size: 34px;
    line-height: 1;
}

.rw-lb-prev { left: 18px; }
.rw-lb-next { right: 18px; }

.rw-lb-nav span,
.rw-lb-close span {
    margin-top: -4px;
}

.rw-lightbox.rw-lb-single .rw-lb-nav {
    display: none;
}

/* ============================================================ */
/* Responsive                                                   */
/* ============================================================ */
@media (max-width: 640px) {
    .rw-carousel {
        gap: 4px;
    }

    .rw-card-inner {
        flex-direction: column;
        padding: 18px;
        gap: 16px;
    }

    .rw-card-photos {
        max-width: 100%;
        width: 100%;
        justify-content: flex-start;
    }

    .rw-thumb-img,
    .rw-card-photos img {
        width: 90px;
        height: 70px;
    }

    .rw-arrow {
        width: 34px;
        height: 34px;
        font-size: 20px;
    }

    .rw-card-title {
        font-size: 1.2em;
    }

    .rw-lb-nav {
        width: 42px;
        height: 42px;
        font-size: 26px;
    }

    .rw-lb-prev { left: 6px; }
    .rw-lb-next { right: 6px; }
}
