/* @author 🐈‍⬛ Siam Thanat Hack Co., Ltd. (STH) */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Sarabun', 'Tahoma', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 0;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav a:hover {
    opacity: 0.8;
}

/* Main content */
.main {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.page-title {
    text-align: center;
    color: #28a745;
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

/* News grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.news-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    border-left: 4px solid #28a745;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.news-title {
    color: #28a745;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    font-weight: bold;
}

.news-title a {
    color: inherit;
    text-decoration: none;
}

.news-title a:hover {
    text-decoration: underline;
}

.news-preview {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #888;
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

.author-link {
    color: #28a745;
    text-decoration: none;
    font-weight: 500;
}

.author-link:hover {
    text-decoration: underline;
}

/* Single news page */
.news-article {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.article-header {
    margin-bottom: 2rem;
}

.article-title {
    color: #28a745;
    font-size: 2rem;
    margin-bottom: 1rem;
    border-bottom: 3px solid #28a745;
    padding-bottom: 0.5rem;
}

.article-meta {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
}

.article-meta a {
    color: #28a745;
    text-decoration: none;
    font-weight: 500;
}

.article-meta a:hover {
    text-decoration: underline;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 2rem;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-footer {
    border-top: 2px solid #f8f9fa;
    padding-top: 2rem;
    margin-top: 2rem;
}

.author-info h3 {
    color: #28a745;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.author-card {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.author-details h4 {
    margin-bottom: 0.5rem;
}

.author-details h4 a {
    color: #28a745;
    text-decoration: none;
}

.author-details h4 a:hover {
    text-decoration: underline;
}

.author-email {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.author-bio {
    color: #555;
    line-height: 1.6;
}

.article-navigation {
    text-align: center;
    margin-top: 2rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.error-message {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.error-message h2 {
    color: #dc3545;
    margin-bottom: 1rem;
}

.error-message p {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.error-message .btn {
    background: #28a745;
    color: white;
}

.error-message .btn:hover {
    background: #218838;
}

/* Author profile */
.author-profile {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
}

.author-name {
    color: #28a745;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.author-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
}

.author-info p {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.author-bio {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #555;
    text-align: left;
}

/* Back button */
.back-button {
    display: inline-block;
    background: #28a745;
    color: white;
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    border-radius: 5px;
    margin-bottom: 2rem;
    transition: background 0.3s;
}

.back-button:hover {
    background: #218838;
}

/* Error page */
.error-page {
    text-align: center;
    padding: 3rem 0;
}

.error-title {
    color: #dc3545;
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-message {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

/* Footer */
.footer {
    background: #343a40;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: auto;
}

.footer p {
    margin-bottom: 0.5rem;
}

.author-credit {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Responsive design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        gap: 1rem;
    }

    .page-title {
        font-size: 2rem;
    }

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

    .article-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .author-profile {
        padding: 1.5rem;
    }
}