/* Styles for news listing and detail pages */

.main-content {
    padding: 1.5rem 2rem;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
}

.news-link {
    text-decoration: underline;
    color: darkgreen;
    transition: color 0.3s ease-in-out;
}

.news-link:hover {
    cursor: pointer;
    color: #034903;
}

.poster-link {
    text-decoration: underline;
    color: darkgreen;
    transition: color 0.3s ease-in-out;
}

.poster-link:hover {
    cursor: pointer;
    color: #034903;
}

@media (max-width: 800px) {
    .news-grid {
        grid-template-columns: 1fr;
        width: 85%;
    }

    .main-content {
        padding: 1rem 1.25rem;
    }
}

.news-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.news-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.card-image-wrapper {
    position: relative;
    aspect-ratio: 16 / 9;
}

.card-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-text {
    padding: 0.9rem 1rem 1.1rem;
}

.card-title {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    font-weight: bold;
}

.card-date {
    margin: 0;
    font-size: 0.95rem;
    color: #666;
    font-weight: lighter;
}

.card-summary {
    margin: 0.5rem 0 0 0;
    color: #444;
}

@media (max-width: 450px) {
    .card-title {
        font-size: 1rem;
    }

    .card-date {
        font-size: 0.9rem;
    }

    .card-summary {
        font-size: 0.9rem;
    }
}

.button-wrapper {
    display: flex;
    padding: .25rem 1.5rem;
}

.news-detail {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 1.2rem 1.5rem;
    box-shadow: none;
    font-family: "Lato", "Calibri", sans-serif;
}

.news-detail-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 2rem 0 1rem 0;
    padding: 0.25rem 1.5rem;
    box-shadow: none;
}

.news-detail-title {
    margin: 0;
    text-align: center;
    font-weight: 700;
    font-size: clamp(1.4rem, 2.2vw + 1rem, 2.2rem);
    line-height: 1.25;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.news-detail-date {
    color: #666;
    text-align: left;
    margin: 0.35rem 0 0.25rem 0;
    font-size: clamp(0.9rem, 0.5vw + 0.8rem, 1rem);
}

.news-detail-content {
    padding: .5rem 1.5rem 1rem;
}

.news-detail-subtitle {
    font-family: "Poppins", Lato, Calibri, sans-serif;
    font-weight: 400;
    font-size: clamp(1.1rem, 1.2vw + 0.9rem, 1.5rem);
    margin: 0 0 .5rem;
    color: #1c1c1c;
}

.news-detail-content p {
    line-height: 1.65;
    text-align: justify;
    margin: 0 0 1rem;
}

.news-detail-content figure {
    margin: 1.2rem 0;
}

.news-detail-content figure img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 10px;
}

.news-detail-content .side-image-block {
    display: flow-root;
    margin: 0.5rem 0;
    line-height: 1.65;
    text-align: justify;
}

.news-detail-content .side-image-block .image-text {
    overflow: hidden;
}

@supports not (display: flow-root) {
    .news-detail-content .side-image-block::after {
        content: "";
        display: block;
        clear: both;
    }
}

.news-detail-content figure.float-image {
    max-width: 50%;
    min-width: 180px;
}

.news-detail-content figure.float-image.float-left {
    float: left;
    margin: 0.2rem 1rem 0.8rem 0;
}

.news-detail-content figure.float-image.float-right {
    float: right;
    margin: 0.2rem 0 0.8rem 1rem;
}

.news-detail-content figure.float-image img {
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 8px;
}

.news-detail-content figure.float-image figcaption {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    padding-top: 0.5rem;
}

.news-detail-content::after {
    content: "";
    display: block;
    clear: both;
}

.poster-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2.5rem 1.2rem 1.5rem;
    font-family: "Lato", Calibri, sans-serif;
}

.poster-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    align-items: start;
}

.poster-grid img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
}

.back-link {
    margin: 0 0 1rem 0;
}

.news-detail-content figcaption {
    text-align: center;
    color: #666;
    font-size: 0.95rem;
    padding-top: 0.5rem;
}

.news-detail-content .news-list,
.news-detail-content .image-text ul,
.news-detail-content > ul {
    list-style: disc outside;
    padding-left: 1.5rem;
    margin: 0 0 0.5rem 0;
}

.news-detail-content .news-list li,
.news-detail-content .image-text ul li,
.news-detail-content > ul > li {
    margin: 0.4rem 0;
}

.news-detail-content .news-list li::marker,
.news-detail-content .image-text ul li::marker,
.news-detail-content li::marker {
    color: darkgreen;
}

@media (max-width: 1030px) {
    .news-detail-title {
        font-size: 1.8rem;
    }

    .btn-primary {
        font-size: 1.1rem;
        padding: 0.75rem 1.6rem;
    }
}

@media (max-width: 800px) {
    .poster-grid {
        grid-template-columns: 1fr;
    }

    .news-detail-title {
        font-size: 1.7rem;
    }

    .btn-primary {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
}

@media (max-width: 700px) {
    .news-detail-content .side-image-block {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .news-detail-content .side-image-block .image-text {
        overflow: visible;
    }

    .news-detail-content figure.float-image {
        float: none;
        max-width: 100%;
        min-width: 0;
        margin: 0 0 0.75rem 0;
    }

    .news-detail-content figcaption {
        font-size: 0.9rem;
    }

    .btn-primary {
        font-size: 0.9rem;
        padding: 0.7rem 1.2rem;
    }

    .news-detail-title {
        font-size: 1.55rem;
    }
}

@media (max-width: 600px) {
    .news-detail-content {
        padding: 0.25rem 0.75rem 0.75rem;
    }

    .news-detail-title {
        font-size: 1.4rem;
    }

    .news-detail-content p {
        line-height: 1.6;
        margin: 0 0 0.85rem;
        text-align: justify;
    }

    .news-detail-content figure {
        margin: 0.9rem 0;
    }

    .news-detail-content figcaption {
        font-size: 0.85rem;
    }

    .news-detail-date {
        font-size: 0.9rem;
    }

    .news-detail-content .image-text ul,
    .news-detail-content > ul,
    .news-detail-content .news-list {
        padding-left: 1.25rem;
    }

    .btn-primary {
        font-size: 0.85rem;
        padding: 0.65rem 1.15rem;
    }
}

@media (max-width: 420px) {
    .news-detail-content {
        padding: 0.25rem 0.5rem 0.5rem;
    }

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

    .news-detail-content figure {
        margin: 0.75rem 0;
    }

    .btn-primary {
        font-size: 0.8rem;
        padding: 0.6rem 1.1rem;
    }

    .news-detail-date {
        font-size: 0.85rem;
    }

    .news-detail-content figcaption {
        font-size: 0.75rem;
    }

    .news-detail-content .news-list li,
    .news-detail-content .image-text ul li,
    .news-detail-content > ul > li {
        margin: 0.3rem 0;
    }
}
