:root {
    --primary-color: #60256c;
    --primary-hover: #e2b60d;
    --text-color: #333;
    --text-muted: #666;
    --bg-light: #f5f5f5;
    --border-color: #ddd;
}

body {
        font-family: "Kanit", sans-serif;
}

.container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0px !important;
    padding-right: 0px !important;
    width: 100%;
}

h1.page-title {
    color: var(--primary-color);
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    display: inline-block;
}

.search-container {
    background-color: var(--bg-light);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-row {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.search-container input {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 16px;
    height: 44px;
}

.date-row input {
    flex: 1;
    width: 100%;
}

.keyword-row {
    flex-wrap: wrap;
}

#searchInput {
    flex: 1;
    min-width: 200px;
}

.btn-group {
    display: flex;
    gap: 10px;
}

.btn-search {
    padding: 0 20px;
    height: 44px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border-radius: 1.5em;
}

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

.btn-clear {
    background-color: #767676;
    color: white;
    border-radius: 1.5em;

}

.btn-clear:hover {
    background-color: #5f5f5f;
}

.meta-info {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 10px;
    margin-bottom: 5px;
    align-items: center;
    font-weight: bold;
}

.hero-news {
    display: flex;
    background: #fff;
    overflow: hidden;
    margin-bottom: 30px;
    transition: transform 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.hero-news:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.hero-image {
    width: 50%;
    height: auto;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.hero-image:hover {
    transform: scale(1.02);
    z-index: 2;
}

.hero-content {
    width: 50%;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.title-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-news-link {
    display: flex;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.hero-content h2 {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
    line-height: normal;
}

.hero-content h2:hover {
    color: var(--primary-color);
}

.hero-content p {
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.grid-news {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.news-card {
    display: flex;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.news-card p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.news-card-content {
    flex: 1;
    padding: 5px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.news-card-content h3 {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    line-height: 1.4;
    color: #333;
}

.news-card-content h3:hover {
    color: var(--primary-color);

}

.news-card-content p {
    font-size: 14px;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-image {
    width: 200px;
    min-height: 100%;
    object-fit: contain;
    background: #fff;
    transition: transform 0.4s ease;
    max-width: 100%;
    max-height: 100%;
    display: block;
    margin: 0 auto;
}

.news-card-image:hover {
    transform: scale(1.05);
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 40px;
}

.page-item {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    background: white;
    cursor: pointer;
    border-radius: 1.5em;
    color: var(--text-color);
}

.page-item.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-item:hover:not(.active) {
    background: var(--bg-light);
}

.empty-state {
    text-align: center;
    padding: 50px;
    color: var(--text-muted);
    font-size: 18px;
    width: 100%;
}

#newsCountMessage {
    margin-top: 10px;
}

@media (max-width: 992px) {
    .hero-news {
        flex-direction: column;
    }

    .hero-image,
    .hero-content {
        width: 100%;
        height: auto;
    }


    .grid-news {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .news-card {
        flex-direction: column-reverse;
    }

    .news-card-image {
        width: 100%;
        min-height: 200px;
        height: 100%;
        object-fit: contain;
        background: #fff;
        border-left: none;
        display: block;
        margin: 0 auto;
    }

    .date-row {
        gap: 5px;
    }

    .date-row input {
        flex: 1;
        width: 100%;
        min-width: 0;
        padding: 10px 5px;
        font-size: 14px;
    }

    .keyword-row {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-group {
        width: 100%;
    }

    .btn-group button {
        flex: 1;
    }
}
