/* ── SGW — Gallery Slider Widget v3 ────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

.sgw-wrapper {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "title  title"
        "main   thumbs";
    align-items: stretch;
    gap: 12px;
    width: 100%;
}

@media (min-width: 767px) {
    .sgw-wrapper {
        display: grid;
    }
}


/* ── Section title ── */
.sgw-wrapper .sgw-section-title {
    grid-area: title;
    margin: 0 0 16px 0;
}

/* ── main-area / thumb-slider grid placement (both layouts) ── */
.sgw-wrapper .sgw-main-area {
    grid-area: main;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

@media (min-width: 767px) {
    .sgw-wrapper .sgw-main-area {
        padding-right: 30px;
    }

    .sgw-wrapper .sgw-main-image {
        -webkit-box-shadow: 20px 16px 65px -15px rgba(0, 0, 0, 1);
        box-shadow: 20px 16px 65px -15px rgba(0, 0, 0, 1);
    }
}

.sgw-before-after-text {
    text-transform: uppercase;
    letter-spacing: 3px;
    padding: 0 5px;
    color: #000;
}

.sgw-before-after-text.sgw-after-text{
    text-align: right;
}

.sgw-wrapper .sgw-thumb-slider {
    grid-area: thumbs;
}

/* ── Main image ── */
.sgw-wrapper .sgw-main-image {
    position: relative;
    width: 100%;
    flex: 1 1 auto;
    overflow: hidden;
    border-radius: 8px;
    background: #111;
    /* height is auto — adapts to image aspect ratio */
}

.sgw-wrapper .sgw-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.sgw-wrapper .sgw-slide.active {
    opacity: 1;
    pointer-events: auto;
}

/* Image fills width, height is natural — no crop */
.sgw-wrapper .sgw-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Sizer: first image drives the container height */
.sgw-wrapper .sgw-main-sizer {
    display: block;
    width: 100%;
    height: auto;
    visibility: hidden;
    pointer-events: none;
}

.sgw-wrapper .sgw-slide-label {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0,0,0,0.60);
    color: #fff;
    font-size: 13px;
    padding: 4px 10px;
    border-radius: 4px;
    pointer-events: none;
}

/* ── Bullets (pagination dots) ── */
.sgw-wrapper .sgw-bullets {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.sgw-wrapper .sgw-bullets .sgw-bullet {
    width: 10px;
    height: 10px;
    min-height: auto;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #00000063;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.sgw-wrapper .sgw-bullet:hover {
    transform: scale(1.2);
}

.sgw-wrapper .sgw-bullet.active {
    background: #000000;
    transform: scale(1.2);
}

/* ── Nav Prev / Next ── */
.sgw-wrapper .sgw-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    flex-shrink: 0;
}

.sgw-wrapper .sgw-nav button {
    background: none;
    border: 0;
    color: #333;
    font-size: 12px;
    line-height: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    padding: 0;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.sgw-wrapper .sgw-nav button:hover,
.sgw-wrapper .sgw-nav button:hover *{
    background: transparent !important;
    color: #333 !important;
    opacity: 0.7;
}

/* ── Thumbnail slider (right column) ── */
.sgw-wrapper .sgw-thumb-slider {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    gap: 6px;
    align-items: center;
}

@media (max-width: 767px) {
    .sgw-wrapper .sgw-thumb-slider {
        display: none;
    }
}

.sgw-wrapper .sgw-thumb-arrow {
    background: none;
    border: 1px solid #333;
    border-radius: 4px;
    width: 100%;
    cursor: pointer;
    padding: 4px 0;
    font-size: 14px;
    color: #333;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
    line-height: 1;
}

.sgw-wrapper .sgw-thumb-arrow:hover {
    background: #333;
    color: #fff;
    border-color: #333;
}

.sgw-wrapper .sgw-thumb-arrow:disabled {
    opacity: 0.3;
    cursor: default;
}

/* Viewport — clips to show only N thumbs */
.sgw-wrapper .sgw-thumb-viewport {
    overflow: hidden;
    flex: 1 1 auto;
    width: 100%;
}

/* Track slides vertically */
.sgw-wrapper .sgw-thumb-track {
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.3s ease;
    will-change: transform;
}

.sgw-wrapper .sgw-thumb {
    flex: 0 0 auto;
    cursor: pointer;
    overflow: hidden;
    border-radius: 6px;
    opacity: 0.58;
    transition: opacity 0.2s ease, transform 0.15s ease;
}

.sgw-wrapper .sgw-thumb:hover {
    opacity: 0.85;
    transform: scale(1.03);
}

.sgw-wrapper .sgw-thumb.active {
    opacity: 1;
}

.sgw-wrapper .sgw-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border: 3px solid transparent;
    border-radius: 6px;
    transition: border-color 0.2s ease;
}

.sgw-wrapper .sgw-thumb.active img {
    border-color: #C9A87C;
}

/* ── Layout: bottom ── */
.sgw-wrapper .sgw-layout-bottom {
    grid-template-columns: 1fr;
    grid-template-areas:
        "title"
        "main"
        "thumbs";
}

.sgw-wrapper .sgw-layout-bottom .sgw-thumb-slider {
    flex-direction: row;
    width: 100%;
    align-items: center;
}

.sgw-wrapper .sgw-layout-bottom .sgw-thumb-arrow {
    width: auto;
    height: 100%;
    padding: 0 6px;
    font-size: 16px;
}

.sgw-wrapper .sgw-layout-bottom .sgw-thumb-viewport {
    overflow: hidden;
    flex: 1 1 auto;
    height: auto;
}

.sgw-wrapper .sgw-layout-bottom .sgw-thumb-track {
    flex-direction: row;
    transition: transform 0.3s ease;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .sgw-wrapper .sgw-layout-right {
        grid-template-columns: 1fr;
        grid-template-areas:
            "title"
            "main"
            "thumbs";
    }

    .sgw-wrapper .sgw-layout-right .sgw-thumb-slider {
        flex-direction: row;
        width: 100%;
    }

    .sgw-wrapper .sgw-layout-right .sgw-thumb-arrow {
        width: auto;
        height: auto;
        padding: 4px 10px;
        writing-mode: horizontal-tb;
    }

    .sgw-wrapper .sgw-layout-right .sgw-thumb-viewport {
        flex: 1 1 auto;
        height: auto;
    }

    .sgw-wrapper .sgw-layout-right .sgw-thumb-track {
        flex-direction: row;
    }
}