﻿/* === Accessibility Styles === */
article a:focus-visible {
    outline-offset: 5px;
    outline: 2px dotted #4f2683;
}

.article-inner a:focus-visible {
    outline: none;
    box-shadow: 3px 3px 3px 3px #4f2683;
}

article .news-title a:focus-visible {
    outline-offset: 8px;
}

article .news-title a:focus {
    color: #EEEEEE !important;
}

/* === News Results Container === */
.news-results {
    margin-top: 50px;
    margin-bottom: 50px;
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columns for desktop */
    gap: 25px;
}

/* Adjust column layout for tablet and phone screens */
@media (max-width: 920px) {
    .news-results {
        grid-template-columns: repeat(3, 1fr); /* 3 columns for tablet */
    }
}

@media (max-width: 800px) {
    .news-results {
        grid-template-columns: repeat(2, 1fr); /* 2 columns */
    }
}

@media (max-width: 500px) {
    .news-results {
        grid-template-columns: 1fr; /* 1 column for mobile */
    }
}

/* Inner wrapper for each article */
.article-inner {
    width: 100%;
}

/* === News Article Card === */
.news-item {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    background: #fff;
    box-shadow: 1px 1px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s, box-shadow 0.1s, background 0.1s;
    border-radius: 16px;
}

    .news-item:hover {
        transform: scale(1.05);
        z-index: 9;
        background-image: none !important;
        background: #4f2683;
        box-shadow: 1px 1px 20px rgba(51, 51, 51, 0.5);
        color: white;
    }

        .news-item:hover .info .title {
            color: #ffffff;
        }

/* === Image Styling === */
.image {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding-top: 66.67%; /* 3:2 aspect ratio to match 900x600 thumbnail source images */
    display: block;
}

.news-item .image > .news-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transform: scale(1);
    transition: transform 0.9s; /* Speed of zoom-in on image upon hover effect */
}

/* Image zoom effect on hover */
.news-item:hover .image > .news-image {
    transform: scale(1.1);
}

/* === Information Section === */
.info {
    border-bottom: 25px solid #4f2683;
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-end;
    position: relative;
    padding: 20px;
    height: 100%;
    transition: background 0.1s;
}

    .info a:hover {
        color: #ffffff;
        text-decoration: underline;
    }

/* Styling for the article title */
.title {
    font-size: 18px;
    line-height: 1.2;
    word-wrap: break-word;
    font-weight: 500;
}

/* Styling for the publication date */
.date {
    font-size: 12px;
}

/* === Pagination Styles === */
.pagination .page-item .page-link {
    color: #4f2683;
}

.pagination .page-item.active .page-link {
    background-color: #4f2683;
    border-color: #4f2683;
    color: #fff;
}

/*===== NEWS FILTER SECTION =====*/
/* Responsive Adjustments */
@media (max-width: 576px) {
    .news-item {
        margin-bottom: 1rem;
    }
}

@media (max-width: 962px) {
    .news-filter-container > div {
        gap: 20px;
    }

    .news-filter-container .year-select-label {
        padding-right: 20px;
    }
}

.news-filter-container {
    background-color: #4f2683;
    padding: 10px;
    max-width: 900px;
    margin: 50px auto;
}
    .news-filter-container label {
        color: #fff;
        font-weight: bold;
    }

#keyword {
    width: 200px;
}

#year {
    width: 120px;
}

/* === Button Styles === */
.btn-primary {
    background-color: #4f2683;
    padding: 5px 10px;
    border-radius: 3px;
    color: #fff;
    font-size: 14px;
    vertical-align: middle;
    border: 1px solid #fff;
}

    .btn-primary:hover,
    .btn-primary:focus-visible {
        background-color: #EEEEEE;
        color: #4f2683;
        border: 1px solid #4f2683;
    }

/* Styling for visited state of clear button */
.clear-btn:visited, .btn-primary:visited {
    color: #EEEEEE;
}

    .clear-btn:visited:hover,
    .clear-btn:visited:focus-visible {
        color: #4f2683;
    }

.form-control:focus, .form-select:focus {
    outline: revert;
    box-shadow: revert;
    background-color: revert;
    color: revert;
}
