/* ==========================================================================
   Web Stories Section Styles (VseyalNews Theme Integration)
   ========================================================================== */

.vseyal-web-stories-section {
    width: 100%;
    margin: 15px auto;
    padding: 20px 0;
    box-sizing: border-box;
}

.vseyal-web-stories-section .container {
    max-width: var(--theme-max-width, 1200px) !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    box-sizing: border-box !important;
}

.vseyal-web-stories-section .category-block-header {
    border-bottom: none;
    margin-bottom: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vseyal-web-stories-section .section-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin-top: 0;
    margin-bottom: 0;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2.5px solid #540016;
    padding-bottom: 6px;
    width: fit-content;
}

.web-stories-grid {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbars for cleaner visual if desired, or support slim modern bar */
.web-stories-grid::-webkit-scrollbar {
    height: 6px;
}

.web-stories-grid::-webkit-scrollbar-track {
    background: transparent;
}

.web-stories-grid::-webkit-scrollbar-thumb {
    background-color: rgba(120, 120, 120, 0.3);
    border-radius: 10px;
}

/* Story Card Layout */
.web-story-card {
    flex: 0 0 160px;
    min-width: 150px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.web-story-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: auto;
}

/* Poster Image Container - 16:10 Aspect Ratio */
.web-story-poster-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 14;
    border-radius: 4px;
    overflow: hidden;
    background-color: #f0f0f0;
    box-shadow: none;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.web-story-poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.web-story-poster-placeholder {
    width: 100%;
    height: 100%;
    display: block;
}

/* Vignette overlay bottom of stories */
.web-story-hover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0) 50%);
    opacity: 1;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Typography Title */
.web-story-title {
    font-family: var(--theme-font-heading), sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.35;
    margin: 8px 0 4px 0;
    color: var(--theme-primary, #222);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

/* Interactive Hover States */
.web-story-link:hover .web-story-poster-wrapper {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.web-story-link:hover .web-story-poster-img {
    transform: scale(1.05);
}

.web-story-link:hover .web-story-title {
    color: var(--theme-accent);
}

/* Keyboard accessibility outline highlights */
.web-story-link:focus-visible {
    outline: 2px solid var(--theme-accent);
    outline-offset: 4px;
    border-radius: 4px;
}

/* ==========================================================================
   Responsive Viewports Configurations
   ========================================================================== */

/* Desktop: 4 compact portrait cards side by side */
@media screen and (min-width: 992px) {
    .web-stories-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: center !important;
        gap: 12px !important;
        overflow-x: visible !important;
        align-items: flex-start !important;
        padding-bottom: 0 !important;
    }
    .web-story-card.homepage-story-card {
        flex: 0 0 220px !important;
        width: 220px !important;
        min-width: 0 !important;
        max-width: 220px !important;
        align-self: flex-start !important;
    }
}

/* Tablet (visible 3 items) */
@media screen and (max-width: 991px) and (min-width: 768px) {
    .web-story-card {
        flex: 0 0 140px;
        min-width: 130px;
    }

    .web-stories-grid {
        justify-content: center !important;
        flex-wrap: nowrap;
        overflow-x: auto;
    }
}

/* Mobile (visible 2.3 items to cue swipe) */
@media screen and (max-width: 767px) {
    .web-story-card {
        flex: 0 0 110px;
        min-width: 100px;
    }

    .web-stories-grid {
        justify-content: flex-start !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 10px;
    }
}

/* ==========================================================================
   Homepage Vertical Overlay Web Story Card Styles
   ========================================================================== */

.homepage-story-card {
    flex: 0 0 160px;
    min-width: 150px;
    box-sizing: border-box;
    display: block;
}

.homepage-story-card .web-story-link {
    display: block;
    width: 100%;
    height: auto;
}

/* Desktop poster: aspect ratio 9/14 */
.homepage-story-card .web-story-poster-wrapper {
    aspect-ratio: 9 / 14 !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    overflow: hidden !important;
    position: relative !important;
    background-color: #222 !important;
}

.homepage-story-card .web-story-hover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.3) 25%, transparent 50%) !important;
    opacity: 1 !important;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 10px !important;
    box-sizing: border-box;
    pointer-events: none;
}

.homepage-story-card .web-story-overlay-content {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.homepage-story-card .web-story-title {
    color: #ffffff !important;
    font-family: var(--theme-font-heading), sans-serif;
    font-size: 13px !important;
    font-weight: 750 !important;
    line-height: 1.3 !important;
    margin: 0 0 4px 0 !important;
    height: auto !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

.homepage-story-card .web-story-date {
    color: rgba(255, 255, 255, 0.85) !important;
    font-family: var(--theme-font-body), sans-serif;
    font-size: 10px !important;
    line-height: 1.2 !important;
    font-weight: 500 !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

/* Tablet: 180px card width */
@media screen and (max-width: 991px) and (min-width: 768px) {
    .web-story-card.homepage-story-card {
        flex: 0 0 170px !important;
        width: 170px !important;
        min-width: 170px !important;
        max-width: 170px !important;
    }
}

/* Mobile: 140px card width */
@media screen and (max-width: 767px) {
    .web-story-card.homepage-story-card {
        flex: 0 0 140px !important;
        width: 140px !important;
        min-width: 140px !important;
        max-width: 140px !important;
    }
    .web-stories-grid {
        gap: 10px !important;
    }
}

/* ==========================================================================
   Dark Red & Yellow Solid Color Theme Overrides (No Gradients)
   ========================================================================== */
body.theme-dark-red-yellow .web-story-hover-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 40%) !important;
}

body.theme-dark-red-yellow .homepage-story-card .web-story-hover-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.3) 25%, transparent 50%) !important;
}