/**
 * Summer/Winter School Widget Styles
 * Version: 1.0.0
 */

/* =================================
   Widget Container
================================= */
.sws-widget {
    position: relative;
    width: 100%;
}

/* =================================
   Header Section (Title + Content)
================================= */
.sws-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 30px;
}

/* Title Wrapper (Left) */
.sws-title-wrapper {
    flex: 0 0 auto;
    max-width: 40%;
}

.sws-title {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    color: #1a1a1a;
    margin: 0;
}

/* Content Wrapper (Right) */
.sws-content-wrapper {
    flex: 1;
    display: flex;
    align-items: flex-start;
}

.sws-content {
    font-size: 16px;
    line-height: 1.6;
    color: #666666;
    margin: 0;
}

/* =================================
   Gallery Section
================================= */
.sws-gallery {
    display: grid;
    gap: 15px;
    width: 100%;
}

/* Grid Columns - Desktop */
.sws-gallery[data-columns="1"] {
    grid-template-columns: repeat(1, 1fr);
}

.sws-gallery[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.sws-gallery[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.sws-gallery[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.sws-gallery[data-columns="5"] {
    grid-template-columns: repeat(5, 1fr);
}

.sws-gallery[data-columns="6"] {
    grid-template-columns: repeat(6, 1fr);
}

/* Gallery Item */
.sws-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.sws-gallery-item a {
    display: block;
    position: relative;
    overflow: hidden;
}

.sws-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 1/1;
    display: block;
    transition: transform 0.4s ease, filter 0.4s ease;
}

/* =================================
   Hover Animations
================================= */

/* Zoom In */
.sws-hover-zoom .sws-gallery-item:hover img {
    transform: scale(1.1);
}

/* Zoom Out */
.sws-hover-zoom-out .sws-gallery-item img {
    transform: scale(1.1);
}

.sws-hover-zoom-out .sws-gallery-item:hover img {
    transform: scale(1);
}

/* Lift */
.sws-hover-lift .sws-gallery-item {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sws-hover-lift .sws-gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* None */
.sws-hover-none .sws-gallery-item img {
    transition: none;
}

/* Overlay Effect on Hover */
.sws-gallery-item a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    pointer-events: none;
}

.sws-gallery-item a:hover::after {
    background: rgba(0, 0, 0, 0.1);
}

/* =================================
   Responsive Design
================================= */

/* Tablet (991px and below) */
@media (max-width: 991px) {
    .sws-header {
        gap: 15px;
        margin-bottom: 25px;
    }

    .sws-title {
        font-size: 30px;
    }

    .sws-content {
        font-size: 15px;
    }

    .sws-title-wrapper {
        max-width: 45%;
    }

    /* Grid Columns - Tablet */
    .sws-gallery[data-columns-tablet="1"] {
        grid-template-columns: repeat(1, 1fr);
    }

    .sws-gallery[data-columns-tablet="2"] {
        grid-template-columns: repeat(2, 1fr);
    }

    .sws-gallery[data-columns-tablet="3"] {
        grid-template-columns: repeat(3, 1fr);
    }

    .sws-gallery[data-columns-tablet="4"] {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Mobile (767px and below) */
@media (max-width: 767px) {
    .sws-header {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 20px;
    }

    .sws-title-wrapper {
        max-width: 100%;
    }

    .sws-title {
        font-size: 24px;
    }

    .sws-content {
        font-size: 14px;
    }

    .sws-gallery {
        gap: 12px;
    }

    /* Grid Columns - Mobile */
    .sws-gallery[data-columns-mobile="1"] {
        grid-template-columns: repeat(1, 1fr);
    }

    .sws-gallery[data-columns-mobile="2"] {
        grid-template-columns: repeat(2, 1fr);
    }

    .sws-gallery[data-columns-mobile="3"] {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Extra Small Mobile (480px and below) */
@media (max-width: 480px) {
    .sws-title {
        font-size: 20px;
    }

    .sws-content {
        font-size: 13px;
    }

    .sws-gallery {
        gap: 10px;
    }
}

/* =================================
   Accessibility
================================= */
.sws-gallery-item a:focus {
    outline: 2px solid #4a7cff;
    outline-offset: 2px;
}

.sws-gallery-item img {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* =================================
   Loading State
================================= */
.sws-widget.loading {
    opacity: 0.5;
    pointer-events: none;
}

.sws-widget.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #4a7cff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: sws-spin 0.8s linear infinite;
}

@keyframes sws-spin {
    to {
        transform: rotate(360deg);
    }
}

/* =================================
   Print Styles
================================= */
@media print {
    .sws-gallery-item a::after {
        display: none;
    }

    .sws-hover-zoom .sws-gallery-item img,
    .sws-hover-zoom-out .sws-gallery-item img,
    .sws-hover-lift .sws-gallery-item {
        transform: none !important;
    }
}
