/* WP Social Feed Plugin Styles */

.wsf-container {
    max-width: 100%;
    margin: 0 auto;
}

/* Grid Layout */
.wsf-grid {
    display: grid;
    gap: 15px;
}

.wsf-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.wsf-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.wsf-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.wsf-item {
    position: relative;
    overflow: hidden;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    /* Smoother shadow */
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    container-type: inline-size;
}

.wsf-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    /* Lift effect */
}

.wsf-media-wrapper {
    position: relative;
    padding-bottom: 150%;
    /* 2:3 Aspect Ratio (Height is 1.5x Width) */
    height: 0;
    overflow: hidden;
    flex-shrink: 0;
}

.wsf-media-wrapper img,
.wsf-media-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.wsf-item:hover .wsf-media-wrapper img {
    transform: scale(1.05);
}

.wsf-item:hover .wsf-media-wrapper .wsf-inner-carousel-slide img {
    transform: none;
}

/* Caption Styles */
.wsf-caption {
    margin: 15px;
    font-size: 0.85em;
    /* Fallback for older browsers */
    font-size: clamp(13px, 5cqw, 16px);
    line-height: 22px;
    color: #444;
    background: #fff;
    flex-grow: 1;
    min-height: 60px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: break-word;
    /* Handle long unbroken text */
}

/* Footer Styles */
.wsf-footer {
    padding: 10px 15px 15px 15px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    margin-top: auto;
}

.wsf-instagram-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #E1306C;
    /* Instagram Color */
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
    transition: color 0.2s ease;
}

.wsf-instagram-link:hover {
    color: #C13584;
    text-decoration: underline;
}

.wsf-instagram-link svg {
    flex-shrink: 0;
}

/* Carousel Layout (Enhanced) */
.wsf-carousel-wrapper {
    position: relative;
    max-width: 100%;
    /* margin: 0 40px;  Space for arrows */
}

.wsf-carousel-track-container {
    overflow: hidden;
    width: 100%;
}

.wsf-carousel-track {
    display: flex;
    padding: 0;
    margin: 0;
    list-style: none;
    transition: transform 0.4s ease-in-out;
}

.wsf-carousel-slide {
    flex-shrink: 0;
    /* Width is calculated via JS */
    padding: 0 5px;
    /* Gap between slides */
    box-sizing: border-box;
    list-style: none !important;
}

/* Inner post carousel (for CAROUSEL_ALBUM within grid/carousel) */
.wsf-inner-carousel-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.wsf-inner-carousel-viewport {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    /* IE/Edge */
    scrollbar-width: none;
    /* Firefox */
    height: 100%;
}

.wsf-inner-carousel-viewport::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.wsf-inner-carousel-viewport .wsf-inner-carousel-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    position: relative;
    padding: 0;
}

.wsf-inner-carousel-viewport .wsf-inner-carousel-slide img,
.wsf-inner-carousel-viewport .wsf-inner-carousel-slide video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Inner Carousel Buttons */
.wsf-inner-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    width: 26px;
    height: 26px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wsf-inner-carousel-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.wsf-inner-carousel-prev {
    left: 5px;
}

.wsf-inner-carousel-next {
    right: 5px;
}

/* Inner Carousel Dots */
.wsf-inner-carousel-dots {
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 6px;
    z-index: 10;
}

.wsf-inner-dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    border: none;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: background 0.2s ease;
}

.wsf-inner-dot.active {
    background: #fff;
    transform: scale(1.1);
}


/* Buttons */
.wsf-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    width: 30px;
    height: 30px;
    line-height: 28px;
    text-align: center;
    border-radius: 50%;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.wsf-carousel-prev {
    left: -15px;
}

.wsf-carousel-next {
    right: -15px;
}

.wsf-carousel-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Custom Video Player UI */
.wsf-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.wsf-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    /* Let container handle clicks */
}

.wsf-video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
    z-index: 5;
    cursor: pointer;
}

.wsf-video-play-btn {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
    padding: 0;
}

.wsf-video-play-overlay:hover .wsf-video-play-btn {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.8);
}

.wsf-video-pause-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, background 0.2s ease;
    z-index: 6;
    padding: 0;
}

.wsf-video-pause-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Playing States */
.wsf-video-container.is-playing .wsf-video-play-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.wsf-video-container.is-playing:hover .wsf-video-pause-btn {
    opacity: 1;
    visibility: visible;
}

/* Dots */
.wsf-carousel-dots {
    display: flex;
    justify-content: center;
    padding: 10px 0;
    gap: 8px;
}

.wsf-dot {
    width: 10px;
    height: 10px;
    background: #ccc;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    padding: 0;
}

.wsf-dot.active {
    background: #333;
}

/* Responsive Grid */
@media (max-width: 768px) {
    .wsf-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    .wsf-grid {
        grid-template-columns: 1fr !important;
    }
    .wsf-footer {
        text-align: center;
    }
}