@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@400;600;700;800&display=swap');

:root {
    --color-blue: #003F80;
    --color-blue-light: #009EFB;
    --color-gray: #EAE7E7;
    --color-gray-light: #F9F9F9;
    --color-gold: #c59b45;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Kanit", sans-serif;
}

main {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center; /* จัดกลางในแนวนอน */
    margin: 0 auto; /* ลบการตั้งค่ามาร์จินเริ่มต้น */
    padding-top: 130px;
}

.container {
    width: 100%;
    max-width: 1140px;
    margin-top: 20px;
    padding: 0px;
    display: flex;
    justify-content: center;
    flex-direction: column;
}

.head-article-highlight , .head-article-newsUpdate{
    max-width: 1140px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 0 auto;
    background-color: var(--color-blue);
    border-radius: 10px;

    h2 {
        font-size: 26px;
        padding: 15px;
        color: var(--color-gray-light);
    }

}

/*highlight*/

#carousel-container {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.news-update-con-highlight {
    display: grid;
    grid-template-columns: repeat(auto-fit,340px);
    justify-content: center;
    justify-items: center;
    transition: transform 0.5s ease-in-out;
    max-width: 1140px;
    margin: 0 auto;

    background-color: #dbdbdb;
    border-radius: 10px;
    padding: 20px;
    margin-top: 10px;
    margin-bottom: 30px;
}

.news-update-card-highlight {
    position: relative;
    flex: 0 0 auto;
    width: 250px;
    margin: 30px;
    overflow: hidden;
    box-shadow: 0 0 5px #888;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: 0.3s;
    background-color: #fff;
    border-radius: 10px;
}

.news-update-card-highlight .img-container-nwu {
    width: 100%;
    height: auto;
    min-height: 200px;
    position: relative;
    object-fit: cover;
}

.news-update-card-highlight img {
    width: 100%;
    height: auto;
    min-height: 200px;
    object-fit: cover;
    float: inline-start;
}

.news-update-card-highlight h3 {
    height: 3.3em;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 3px 10px;
    background-color: var(--color-blue);
    color: var(--color-gray-light);
    box-shadow: 0 0 5px #888888;
}

.news-update-card-highlight p {
    height: 7.5em;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 3px 10px;
}

.btn-readmore {
    position: absolute;
    width: 100%;
    z-index: 10;
    padding: 10px 20px 50px 20px;
    bottom: -130px;
    left: 50%;
    transform: translateX(-50%);
    transition: transform 0.3s ease;
    background-color: var(--color-blue);
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px 10px 0 0;
}

.news-update-card-highlight:hover .btn-readmore {
    transform: translate(-50%, -50px);
}

.btn-readmore a {
    color: var(--color-gray-light);
    padding: 10px 20px 50px 20px;
    text-decoration: none;
    font-size: 16px;
    display: block;
}

.btn-readmore:hover {
    background-color: var(--color-gold);
}

.pagination-buttons {
    display: flex;
    justify-content: center;
    margin: 20px;

    .page-btn {
        padding: 3px 10px;
        font-size: 16px;
        background-color: var(--color-blue);
        color: var(--color-gray-light);
        border: none;
        border-radius: 10px;
        transition: 0.3s;

        &:hover {
            background-color: var(--color-blue-light);
        }
    }
}

/*full highlight*/

.full-screen-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.full-screen-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    color: var(--color-gray-light);
    font-size: 24px;
    font-weight: bold;
    padding: 10px;
    cursor: pointer;
    z-index: 1100;
    text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5);

    &:hover {
        color: var(--color-gold);
    }
}

/*highlight , news update end*/

/* news-end*/

@media only screen and (max-width: 800px) {

    main {
        padding-top: 90px;
        width: 100%;
        padding: 90px 10px;
    }

}
