/* style.css */

/* General Body & Container */
body {
    font-family: 'Kanit', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #fff; /* Changed background color for a softer look */
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    /*padding: 20px;*/
}

/* Header & Navigation */
header {
    background-color: #2c3e50;
    color: #fff;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

header h1 {
    margin: 0;
    display: inline-block;
}

header h1 a {
    color: #fff;
    text-decoration: none;
    font-size: 28px;
    font-weight: 600;
}

header nav {
    float: right;
    margin-top: 5px;
}

header nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

header nav ul li {
    display: inline-block;
    margin-left: 20px;
}

header nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: 400;
    transition: color 0.3s ease;
}

header nav ul li a:hover {
    color: #3498db;
}

/* --- Article & Post-specific Styles --- */

/* Styles for single article page (article.php) */
.article-content {
    background-color: #ffffff;
    padding: 10px;
    margin-top: 30px;
    /*border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);*/
}

.article-content h2 {
    color: #2c3e50;
    font-size: 36px;
    margin-bottom: 15px;
    text-align: center;
}

.article-meta {
    text-align: center;
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 30px;
}

.article-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto 30px auto;
    border-radius: 5px;
}

.article-content h3 {
    color: #3498db;
    font-size: 24px;
    margin-top: 40px;
    margin-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

.article-content p {
    margin-bottom: 15px;
    text-align: justify;
}

.article-content ul, .article-content ol {
    margin-bottom: 15px;
    padding-left: 25px;
}

.article-content ul li, .article-content ol li {
    margin-bottom: 8px;
}

.article-content strong {
    color: #2c3e50;
}

/* Styles for full articles on index.php */
.full-article {
    background-color: #fff;
    padding: 10px;
    margin-bottom: 20px;
    /*border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);*/
}

.full-article h2 {
    font-size: 28px;
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 10px;
}
.full-article h2 a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}
.full-article h2 a:hover {
    color: #3498db;
}

.full-article .article-meta {
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 20px;
}

.full-article img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* --- Action & Comment Sections --- */

.post-actions {
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin-top: 20px;
}

.post-actions button {
    background: none;
    border: none;
    color: #555;
    font-size: 16px;
    cursor: pointer;
    padding: 10px;
    transition: color 0.2s ease;
}
.post-actions button:hover {
    color: #3498db;
}

.post-actions button.liked {
    color: #3498db;
}

.post-actions button i {
    margin-right: 5px;
}

.comment-section {
    margin-top: 20px;
}
.comment-section h4 {
    color: #2c3e50;
    margin-top: 0;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comment {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;  
    margin-bottom: 5px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 0px;
}

.comment-header strong {
    color: #333;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.comment-form input, .comment-form textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: 'Kanit', sans-serif;
}

.comment-form button {
    padding: 10px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Kanit', sans-serif;
    font-weight: 600;
}

.comment-form button:hover {
    background-color: #2980b9;
}

.view-all-comments-btn {
    border: none;
    color: #466FD8;
    background-color: transparent;
    cursor: pointer;
    padding: 0;
    text-align: left;
}

/* Product Link within content */
.article-content .product-link {
    color: #e67e22;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.article-content .product-link:hover {
    color: #d35400;
    text-decoration: underline;
}

/* Product Promo Box */
.product-promo {
    background-color: #e8f5e9;
    border: 1px dashed #4caf50;
    padding: 20px;
    text-align: center;
    margin: 30px 0;
    border-radius: 5px;
}

.product-promo p {
    font-size: 18px;
    font-weight: 600;
    color: #2e7d32;
    margin-bottom: 15px;
}

.btn-shop-now {
    display: inline-block;
    background-color: #2ecc71;
    color: #fff;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.btn-shop-now:hover {
    background-color: #27ae60;
}

/* Related Products */
.related-products {
    margin-top: 50px;
    border-top: 1px solid #ecf0f1;
    padding-top: 30px;
    text-align: center;
}

.related-products h4 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 30px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    justify-content: center;
}

.product-item {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    text-align: center;
}

.product-item img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
}

.product-item p {
    font-weight: 600;
    margin-bottom: 10px;
    color: #555;
    font-size: 15px;
}

.product-item a {
    display: inline-block;
    background-color: #3498db;
    color: #fff;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.product-item a:hover {
    background-color: #2980b9;
}

/* Footer */
footer {
    background-color: #34495e;
    color: #ecf0f1;
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
}

footer p {
    margin: 0;
    font-size: 14px;
}

/* Clearfix for header */
.container::after {
    content: "";
    display: table;
    clear: both;
}

/* Other General Styles */
hr {
    background-color: #D3D3D3;
    height: 1px;
    border: none;
    margin: 20px 0;
}
.loading {
    text-align: center;
    font-size: 18px;
    color: #7f8c8d;
    padding: 20px;
    display: none;
}
.no-comments {
    font-style: italic;
    color: #7f8c8d;
    text-align: center;
}

/* Basic responsiveness */
@media (max-width: 768px) {
    header h1 {
        text-align: center;
        width: 100%;
        margin-bottom: 10px;
    }

    header nav {
        float: none;
        text-align: center;
        width: 100%;
    }

    header nav ul li {
        margin: 0 10px;
    }

    .article-content, .full-article {
        /*padding: 20px;*/
    }

    .article-content h2 {
        font-size: 28px;
    }

    .article-content h3 {
        font-size: 20px;
    }

    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}