/* Blog Archive Styles */

.post-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom:5%;
}

.featured-post {
    margin-bottom: 35px;
}
.featured-post .single-article article {
    height:560px;
}
.featured-post article .content {
    max-width: 60%;
    padding-bottom: 10px;
}
.featured-post article .content .excerpt p {
    font-weight:900;
    line-height:135%;
}
.featured-post .single-article article:before {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0) 80%);
}

#filtered-posts {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

#filtered-posts.loading {
    opacity: 0; /* Hide content during loading */
}

form#post-filter-form {
    display: flex;
    justify-content: center;
    padding: 15px 10px;
    margin-bottom: 35px;
}

select#category-select {
    background: #F8F7FF !important;
    padding: 18px 30px;
    border-radius: 50px;
    color: var(--primary-color);
    font-weight: 600;
    moz-appearance: none;
    -webkit-appearance: none;
    appearance: none;
    text-align: center;
    line-height: 135%;
    width: auto;
}

/* -- */

.single-article {
    position: relative; /* Positioning context for the overlay */
    overflow: hidden; /* Prevent the background image from overflowing */
    border-radius: 7px; /* Ensure the container has rounded corners */
}


.single-article article {
    position: relative; /* Positioning context for the overlay and background image */
    background-size: cover; /* Make the background image cover the entire area */
    background-position: center; /* Centre the background image */
    height: 460px;
    color: #fff;
    display: flex;
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-radius: 7px;
}


.single-article article:before {
    content: ''; /* Required for :before to work */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0) 60%);
    z-index: 1; /* Ensure it sits above the background but below the content */
    pointer-events: none; /* Allow clicks to pass through to the content */
    border-radius: 7px;
    transition: backdrop-filter 0.2s;
    backdrop-filter: blur(6px) opacity(0);
}

.single-article a:hover article:before {
    backdrop-filter: blur(6px) opacity(1);
}

/* Hide the overlay when there’s no background image */
.post-link article[style*="background-color"]::before {
    display: none;
}

.single-article article .content {
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}


.content .title {
    font-size:1.6em;
    line-height:135%;
}
.content .category {
    background: #fff;
    color: var(--primary-color);
    padding: 6px 9px;
    border-radius: 44px;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 0.8em;
    margin-bottom: 10px;
    display: inline-flex;
    width: fit-content;
}


/********** SINGLE POST PAGE ****/
.single-post .blog-container {
    max-width: 760px;
    width:100%;
    margin:0 auto;
}

.post-thumbnail {
    position: relative; /* To position the background image properly */
    width: 100vw; /* Full width of the viewport */
    height: 400px; /* Adjust height as needed */
    margin-left: calc(-50vw + 50%); /* Center-align the 100vw element within the container */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #000; /* Fallback color */
    z-index: 1; /* Ensure it is above other elements if necessary */
}

/* Use the `attr()` function (experimental in some browsers) */
.post-thumbnail[data-background] {
    background-image: url(attr(data-background));
}

.the-post {
    padding:10% 15px;
}

.post-meta {
    color: var(--primary-color);
    margin: 35px 0;
}

/* Related Posts */
.related-posts h2.related-posts-title {
    text-align: center;
    margin-bottom:35px;
}