/* Responsive spacing for Sovereignty Stories content block */
@media (max-width: 991px) {
    #block-dempo-custom-content > article > div > div:nth-child(3) > div {
        display: block !important;
        clear: both !important;
        position: relative;
    }
}

/* Custom class for stories block spacing */
.stories-block-wrapper {
    clear: both !important;
    padding-top: 60px !important;
    margin-top: 30px !important;
    position: relative !important;
    z-index: 1 !important;
    display: block !important;
    width: 100% !important;
    float: none !important;
    overflow: hidden !important;
}

.stories-block-wrapper::before {
    content: '';
    display: block;
    clear: both;
}

/* Adjust donate block position */
#block-dempo-custom-content > article > div > div.donate-block._none {
    position: relative;
    z-index: 10;
}

/* Ensure proper spacing before stories block */
.view-id-article_category_blocks.view-display-id-block_1 {
    clear: both !important;
    padding-top: 60px !important;
    margin-top: 30px !important;
    position: relative !important;
    z-index: 1 !important;
    display: block !important;
    width: 100% !important;
    float: none !important;
}

/* Force a new block formatting context for the stories section */
.view-id-article_category_blocks.view-display-id-block_1::before {
    content: '';
    display: table;
    clear: both;
}

/* Make sure content above stories has proper spacing */
.region-content > .block-views:first-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    position: relative;
    z-index: 5;
    overflow: hidden;
}

/* Ensure the content wrapper has proper spacing */
.main-container .main-content .region-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 40px !important;
}

/* Force the stories block to be below other content */
.view-id-article_category_blocks {
    order: 100;
}

.view-article.article-worth-knowing .views-field-body{
    display: none;
}

.view-article.article-worth-knowing .col-1{
    margin-bottom: 20px;
}

.block-field-blocknodearticlefield-media .field--name-field-media{
    background: #f3f2ed;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 20px;
}
.block-field-blocknodearticlefield-image{
    margin-bottom: 20px;
}

.slideshow-news .carousel-inner .carousel-item .field--name-field-media-oembed-video,
.slideshow-news .carousel-inner .carousel-item .field--name-field-media-video-file{
    position: relative;
    z-index: 9;
}

.slideshow-news .carousel-inner .carousel-item .field--name-field-media-oembed-video iframe,
.slideshow-news .carousel-inner .carousel-item .field--name-field-media-video-file video{
    width: 100%;
    max-height: 480px;
    height: 480px;
}

#views-bootstrap-slideshow-block-1 img{
    object-fit: cover;
}

@media (max-width: 991px) {
    .view-article.article-worth-knowing .views-field-body{
        display: block;
    }
    .view-article.article-worth-knowing .field--name-field-media-image,
    .view-article.article-worth-knowing .field--name-field-media-oembed-video{
        display: none;
    }
}

@media (max-width: 767px) {
    .slideshow-news .carousel-inner .carousel-item .field--name-field-media-oembed-video iframe {
        height: auto;
        min-height: 350px;
    }
    
    /* Improve Sovereignty Stories visibility on mobile */
    body.path-frontpage .view-id-article_category_blocks .views-row,
    body.path-frontpage .view-id-article_category_blocks .views-row .views-field-title,
    body.path-frontpage .view-id-article_category_blocks .views-row .post-title,
    body.path-frontpage .view-id-article_category_blocks .views-row .post-title a,
    body.path-frontpage .view-id-article_category_blocks .views-row .views-field-body,
    body.path-frontpage .view-id-article_category_blocks .views-row .story-block-body,
    body.path-frontpage .view-id-article_category_blocks .views-row .field-content {
        all: revert !important;
        display: block !important;
        max-width: 100% !important;
        width: 100% !important;
        float: none !important;
        clear: both !important;
        margin: 0 0 15px 0 !important;
        padding: 0 !important;
        font-size: 16px !important;
        line-height: 1.5 !important;
        color: #333 !important;
        background: none !important;
        border: none !important;
        box-shadow: none !important;
    }
    
    /* Reset any conflicting styles */
    body.path-frontpage .view-id-article_category_blocks .views-row {
        margin-bottom: 30px !important;
        padding: 15px 0 !important;
        border-bottom: 1px solid #eee !important;
    }
    
    body.path-frontpage .view-id-article_category_blocks .views-row:last-child {
        border-bottom: none !important;
    }
    
    /* Make sure the title is prominent */
    body.path-frontpage .view-id-article_category_blocks .post-title,
    body.path-frontpage .view-id-article_category_blocks .post-title a {
        font-size: 1.2rem !important;
        font-weight: 700 !important;
        color: #000 !important;
        margin-bottom: 8px !important;
        display: block !important;
    }
    
    /* Ensure body text is visible */
    body.path-frontpage .view-id-article_category_blocks .views-field-body,
    body.path-frontpage .view-id-article_category_blocks .story-block-body,
    body.path-frontpage .view-id-article_category_blocks .field-content {
        font-size: 15px !important;
        line-height: 1.6 !important;
        color: #333 !important;
        margin-top: 5px !important;
        margin-bottom: 10px !important;
    }
}
