/* ==================================================
   RESPONSIVE ITA NEWS ARTICLE CARDS
   Bootstrap 5.2.2
   ================================================== */

/* Archive article cards */
.archive-card {
    width: 100%;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    transition: box-shadow 0.2s ease;
}

.archive-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.09) !important;
}

/* Image column */
.archive-card-image-link {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 220px;
    overflow: hidden;
}

.archive-card-image {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 220px;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.archive-card-image-link:hover .archive-card-image {
    transform: scale(1.035);
}

.archive-card-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 220px;
    padding: 20px;
    background: #f1f3f5;
    color: #6c757d;
    text-align: center;
}

/* Article content */
.archive-card-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    height: 100%;
    padding: 1.5rem;
}

.archive-card-date {
    color: #6c757d;
    font-size: 0.85rem;
}

.archive-card-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
}

.archive-category-link {
    color: #555;
    font-size: 0.82rem;
    text-decoration: none;
}

.archive-category-link:hover {
    color: #003366;
    text-decoration: underline;
}

.archive-card-title {
    margin: 0 0 0.75rem;
    font-size: 1.35rem;
    line-height: 1.4;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.archive-card-title a {
    color: #212529;
    text-decoration: none;
}

.archive-card-title a:hover {
    color: #003366;
}

.archive-card-description {
    margin-bottom: 1rem;
    color: #555;
    font-size: 0.96rem;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.archive-card-footer {
    margin-top: auto;
    padding-top: 0.25rem;
}

.archive-read-more {
    display: inline-block;
    color: #003366;
    font-weight: 600;
    text-decoration: none;
}

.archive-read-more:hover {
    color: #c8102e;
    text-decoration: underline;
}

/* Smaller desktop and tablet screens */
@media (max-width: 767.98px) {
    .archive-card-image-link,
    .archive-card-image,
    .archive-card-no-image {
        height: 240px;
        min-height: 0;
    }

    .archive-card-body {
        padding: 1.15rem;
    }

    .archive-card-title {
        font-size: 1.2rem;
    }
}

/* Narrow mobile screens */
@media (max-width: 575.98px) {
    .archive-card-image-link,
    .archive-card-image,
    .archive-card-no-image {
        height: 200px;
    }

    .archive-card-body {
        padding: 1rem;
    }
}

.news-article-list {
    width: 100%;
    min-width: 0;
}

/* Individual article card */
.news-article-card {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #e2e6ea;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
}

.news-article-card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.10);
}

/* Ensure Bootstrap columns can shrink */
.news-article-card .row {
    min-width: 0;
}

.news-article-card [class*="col-"] {
    min-width: 0;
}

/* Image link */
.news-article-image-link {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 220px;
    overflow: hidden;
    background: #f0f2f5;
}

/* Article image */
.news-article-image {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 220px;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.news-article-image-link:hover .news-article-image {
    transform: scale(1.035);
}

/* Missing-image placeholder */
.news-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
    color: #6c757d;
    text-align: center;
    text-decoration: none;
}

.news-image-placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
}

.news-image-placeholder-content i {
    font-size: 2rem;
}

/* Text content */
.news-article-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    height: 100%;
    padding: 1.5rem;
    overflow-wrap: anywhere;
}

/* Article title */
.news-article-title {
    width: 100%;
    margin: 0 0 0.75rem;
    font-size: clamp(1.15rem, 1.5vw, 1.55rem);
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.news-article-title a {
    color: #003366;
    text-decoration: none;
}

.news-article-title a:hover {
    color: #c8102e;
    text-decoration: underline;
}

/* Publication date */
.news-article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 0.875rem;
}

/* Categories */
.news-article-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: 100%;
}

.news-article-categories .badge {
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 0.75rem;
    line-height: 1.4;
    padding: 0.4em 0.65em;
}

/* Excerpt */
.news-article-excerpt {
    width: 100%;
    color: #444;
    font-size: 0.95rem;
    line-height: 1.7;
    overflow-wrap: anywhere;

    /* Limit excerpt to three lines */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}

/* Read Article */
.news-article-footer {
    width: 100%;
    margin-top: auto;
    padding-top: 0.5rem;
}

.news-article-footer .btn {
    white-space: normal;
}

/* Keyboard accessibility */
.news-article-title a:focus-visible,
.news-article-image-link:focus-visible,
.news-article-footer .btn:focus-visible,
.news-article-categories a:focus-visible {
    outline: 3px solid #0d6efd;
    outline-offset: 3px;
}

/* ==================================================
   TABLETS AND SMALL LAPTOPS
   ================================================== */

@media (min-width: 768px) and (max-width: 991.98px) {

    .news-article-image-link,
    .news-article-image,
    .news-image-placeholder {
        min-height: 240px;
    }

    .news-article-body {
        padding: 1.1rem;
    }

    .news-article-title {
        font-size: 1.15rem;
    }

}

/* ==================================================
   MOBILE PHONES
   Bootstrap stacks the image above the text
   ================================================== */

@media (max-width: 767.98px) {

    .news-article-card {
        border-radius: 8px;
    }

    .news-article-image-link {
        height: auto;
        min-height: 0;
        aspect-ratio: 16 / 9;
    }

    .news-article-image {
        width: 100%;
        height: 100%;
        min-height: 0;
        aspect-ratio: 16 / 9;
    }

    .news-image-placeholder {
        min-height: 0;
        aspect-ratio: 16 / 9;
    }

    .news-article-body {
        height: auto;
        padding: 1rem;
    }

    .news-article-title {
        font-size: 1.2rem;
        line-height: 1.4;
    }

    .news-article-excerpt {
        font-size: 0.9rem;
        line-height: 1.65;
    }

}

/* ==================================================
   VERY SMALL PHONES
   ================================================== */

@media (max-width: 359.98px) {

    .news-article-body {
        padding: 0.8rem;
    }

    .news-article-title {
        font-size: 1.05rem;
    }

    .news-article-footer .btn {
        max-width: 100%;
    }

}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {

    .news-article-card,
    .news-article-image {
        transition: none;
    }

    .news-article-image-link:hover .news-article-image {
        transform: none;
    }

}


/* Sidebar widgets */
.sidebar .widget {
    margin-bottom: 1.5rem;
    padding: 1.15rem;
    background: #fff;
    border: 1px solid #e9ecef;
}

.sidebar .widget-header {
    margin-bottom: 1rem;
}

.sidebar .widget-title {
    margin-bottom: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

/* Recommended article */
.recommended-image {
    display: block;
    width: 100%;
    max-height: 260px;
    object-fit: cover;
}

.recommended-title {
    margin: 0.6rem 0;
    font-size: 1.15rem;
    line-height: 1.45;
}

.recommended-title a {
    color: #212529;
    text-decoration: none;
}

.recommended-title a:hover {
    color: #003366;
}

.sidebar-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.65rem;
}

.sidebar-categories a {
    color: #333;
    font-size: 0.82rem;
    text-decoration: none;
}

.sidebar-categories a:hover {
    color: #003366;
    text-decoration: underline;
}

/* Latest posts */
.sidebar .post-list-sm {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.sidebar .post-list-sm:last-child {
    margin-bottom: 0;
}

.sidebar .post-list-sm .thumb {
    flex: 0 0 90px;
}

.sidebar .post-list-sm .inner img {
    display: block;
    width: 90px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
}

.sidebar .post-list-sm .details {
    min-width: 0;
    overflow-wrap: anywhere;
}

.sidebar .post-list-sm .read-more-btn {
    color: #212529;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.sidebar .post-list-sm .read-more-btn:hover {
    color: #003366;
}

/* Archive list */
.sidebar .list a {
    color: #333;
    text-decoration: none;
}

.sidebar .list a:hover {
    color: #003366;
    text-decoration: underline;
}

@media (max-width: 991.98px) {
    .sidebar {
        margin-top: 1.5rem;
    }
}

/* News article layout */
.article-view {
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border-radius: 0.75rem;
    background: #fff;
}

.article-figure {
    width: 100%;
    background: #f4f5f7;
}

.article-featured-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 650px;
    object-fit: contain;
    margin-inline: auto;
}

.article-caption {
    padding: 0.75rem 1.25rem;
    color: #6c757d;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    font-size: 0.9rem;
    line-height: 1.6;
    text-align: center;
}

.article-body {
    padding: clamp(1rem, 3vw, 2rem);
}

.article-meta {
    color: #6c757d;
    font-size: 0.9rem;
}

.article-title {
    color: #212529;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.article-content {
    color: #343a40;
    font-size: 1.05rem;
    line-height: 1.85;
    overflow-wrap: anywhere;
}

.article-footer {
    border-top: 1px solid #dee2e6;
}

.article-tags-label {
    color: #495057;
    font-weight: 600;
}

.article-category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.article-category-badge {
    padding: 0.5rem 0.75rem;
    color: #003366 !important;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    white-space: normal;
    overflow-wrap: anywhere;
}

.article-category-badge:hover,
.article-category-badge:focus {
    color: #fff !important;
    background-color: #003366 !important;
    border-color: #003366 !important;
}

@media (max-width: 575.98px) {
    .article-body {
        padding: 1rem;
    }

    .article-content {
        font-size: 1rem;
        line-height: 1.75;
    }

    .article-caption {
        padding: 0.65rem 0.85rem;
    }
}
