/* css/articles.css */
/* Reset พื้นฐาน */
body, h1, h2, p, ul, ol, li, table, tr, th, td {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Container หลัก */
#container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Content กลาง */
#content {
    background: #ffffff;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    line-height: 1.8;
}

/* สไตล์สำหรับบทความ */
article {
    font-family: 'Arial', sans-serif;
    color: #333;
    padding: 1.5rem;
    margin-bottom: 40px;
    border-radius: 2rem;
    background: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
}

article h1,
article h2 {
    margin-bottom: 20px;
}

article h1 {
    font-size: 2.2rem;
    color: #2c3e50;
    border-bottom: 2px solid #e2e2e2;
    padding-bottom: 10px;
}

article h2 {
    font-size: 1.8rem;
    color: #34495e;
}

article p {
    font-size: 1.1rem;
    margin-bottom: 20px;
    text-align: justify;
    text-indent: 3rem;
}

section[name="articles"] article a {
    display: block;
    max-width: 130px;
    color: white;
    padding: 10px 10px;
    text-align: center;
    border-radius: 1rem;
    background: linear-gradient(180deg, #ecd0a0, #d09e4a);
}

/* สไตล์สำหรับลิงก์ */
a {
    color: #2980b9;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #1c5980;
    text-decoration: underline;
}

/* สไตล์สำหรับรายการ (Ordered และ Unordered) */
article ul,
article ol {
    margin: 15px 30px;
    padding-left: 25px;
}

article li {
    margin-bottom: 10px;
}

/* สไตล์สำหรับตาราง */
article table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

article table, article th, article td {
    border: 1px solid #ddd;
}

article th, article td {
    padding: 12px;
    text-align: left;
}

article th {
    background: #f5f5f5;
    font-weight: bold;
}

/* สไตล์เฉพาะสำหรับส่วนเอกสาร */
section[name="documents"] {
    background: #ffffff;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
    padding: 20px;
    border-radius: 2rem;
    margin-bottom: 1rem;
}

section[name="documents"] h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #2c3e50;
}
section[name="documents"] ul[name="documentslist"] {
    width: 80%;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    margin-left: 10%;
    margin-bottom: 2rem;
}

section[name="documents"] ul[name="documentslist"] li {
    width: -webkit-fill-available;
    list-style: auto;
}

section[name="documents"] ul[name="downloads"] {
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

section[name="documents"] ul[name="downloads"] li {
    width: -webkit-fill-available;
    list-style: auto;
    padding: 0.5rem 0.5rem 0.5rem 1rem;
    background: rgb(0 0 0 / 3%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row;
}

/* ปรับแต่งปุ่มดาวน์โหลดในรายการเอกสาร */
section[name="documents"] ul[name="downloads"] li a.btn {
    display: inline-block;
    padding: 5px 10px;
    border-bottom: 2px solid #a5330f;
    background: linear-gradient(180deg, #ecd0a0, #d09e4a);
    transition: 0.3s ease-in-out;
    color: #fff;
    border-radius: 1rem;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
}

section[name="documents"] ul[name="downloads"] li a:link {
    color: white;
    text-decoration: none;
}

section[name="documents"] ul[name="downloads"] li a.btn:hover {
    color: #fff;
}

section[name="documents"] ul[name="downloads"] li:hover {
    color: white;
    background-color: #d29933;
}
section[name="documents"] ul[name="downloads"] li:hover a.btn {
    color: white;
    background-color: white;
}

/* Responsive styling */

/* สำหรับหน้าจอขนาดใหญ่ */
@media (max-width: 992px) {
    #content {
        padding: 25px;
    }
    article h1 {
        font-size: 2rem;
    }
    article h2 {
        font-size: 1.6rem;
    }
    article p {
        font-size: 1rem;
    }
}

/* สำหรับหน้าจอแท็บเล็ต */
@media (max-width: 768px) {
    #container {
        padding: 10px;
    }
    #content {
        padding: 20px;
    }
    article h1 {
        font-size: 1.8rem;
    }
    article h2 {
        font-size: 1.4rem;
    }
    article p {
        font-size: 0.95rem;
    }
    section[name="documents"] {
        padding: 15px;
    }
}

/* สำหรับหน้าจอมือถือ */
@media (max-width: 480px) {
    #content {
        padding: 15px;
    }
    article h1 {
        font-size: 1.6rem;
    }
    article h2 {
        font-size: 1.2rem;
    }
    article p {
        font-size: 0.9rem;
    }
    section[name="documents"] {
        padding: 10px;
    }
}
