/* main.css - Single Source CSS */

/* Global Styles */
body {
    font-family: 'Sarabun', 'Prompt', Arial, sans-serif;
    background-color: #f8f9fa;
}

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

/* Product Card */
.product-card {
    transition: transform 0.2s;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.product-card img {
    height: 200px;
    object-fit: cover;
}

/* Article Card */
.article-card {
    transition: transform 0.2s;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.article-card img {
    height: 250px;
    object-fit: cover;
}

/* Buttons */
.btn-primary {
    background-color: #e74c3c;
    border-color: #e74c3c;
}

.btn-primary:hover {
    background-color: #c0392b;
    border-color: #c0392b;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 20px 0;
    margin-top: 50px;
}

/* ========================================
   Markdown rendered content
   ใช้กับ .article-content และ .product-description
   ======================================== */

.article-content,
.product-description {
    line-height: 1.8;
    font-size: 1.05rem;
    color: #333;
}

.article-content p,
.product-description p {
    margin: 0 0 1.2rem 0;
}

.article-content h2,
.product-description h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e74c3c;
    color: #2c3e50;
}

.article-content h3,
.product-description h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 1.5rem 0 0.8rem 0;
    color: #2c3e50;
}

.article-content h4,
.product-description h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 1.2rem 0 0.6rem 0;
}

.article-content ul,
.article-content ol,
.product-description ul,
.product-description ol {
    margin: 0 0 1.2rem 0;
    padding-left: 1.8rem;
}

.article-content li,
.product-description li {
    margin-bottom: 0.4rem;
}

.article-content blockquote,
.product-description blockquote {
    border-left: 4px solid #e74c3c;
    background: #f8f9fa;
    padding: 1rem 1.2rem;
    margin: 1.2rem 0;
    border-radius: 0 6px 6px 0;
    color: #555;
    font-style: italic;
}

.article-content code,
.product-description code {
    background: #f1f3f4;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
    color: #c7254e;
    font-family: 'Consolas', 'Monaco', monospace;
}

.article-content pre,
.product-description pre {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 1rem 1.2rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1.2rem 0;
    font-size: 0.9rem;
}

.article-content pre code,
.product-description pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.article-content a,
.product-description a {
    color: #e74c3c;
    text-decoration: underline;
}

.article-content a:hover,
.product-description a:hover {
    color: #c0392b;
}

.article-content hr,
.product-description hr {
    border: 0;
    border-top: 2px solid #ecf0f1;
    margin: 2rem 0;
}

/* รูปภาพในเนื้อหา (Markdown image) */
.article-content .md-img,
.product-description .md-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    margin: 1.2rem auto;
    display: block;
}

/* Table (ถ้ามีในอนาคต) */
.article-content table,
.product-description table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2rem 0;
}

.article-content th,
.article-content td,
.product-description th,
.product-description td {
    border: 1px solid #ddd;
    padding: 0.6rem 1rem;
    text-align: left;
}

.article-content th,
.product-description th {
    background: #f8f9fa;
    font-weight: 600;
}

/* ========================================
   Markdown editor cheatsheet (ใน admin form)
   ======================================== */
.md-cheatsheet {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
    color: #555;
}
.md-cheatsheet code {
    background: #fff;
    border: 1px solid #ddd;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85em;
}