/* คอนเทนเนอร์หลัก: จัดวางตรงกลางจอ */
.legal-container {
    max-width: 850px; /* กว้างพอดีสายตา */
    margin: 60px auto 100px; /* auto จะช่วยดีดทุกอย่างมาไว้ตรงกลาง */
    padding: 0 25px;
    font-family: 'Prompt', sans-serif;
    line-height: 1.8;
    color: #475569;
}

/* Header: แบบปกติ สกอแล้วเลื่อนหาย ไม่ค้างหน้าจอ */
.legal-header {
    text-align: center;
    margin-bottom: 60px;
    position: static; /* มั่นใจว่าไม่โดนล็อค */
}

.legal-header h1 {
    font-size: 2.6rem;
    color: #1e293b;
    font-weight: 800;
    letter-spacing: -1px;
}

/* เส้นขีดแดงใต้หัวข้อ อยู่กึ่งกลาง */
.toc-line {
    width: 60px;
    height: 4px;
    background: var(--at-red);
    margin: 20px auto;
    border-radius: 2px;
}

/* เนื้อหาแต่ละส่วน: บีบเข้าหาศูนย์กลาง */
.legal-section {
    max-width: 700px; /* บีบให้แคบกว่า container เพื่อให้ดูอยู่กลาง */
    margin: 0 auto 50px; /* จัดกึ่งกลางอัตโนมัติ */
    text-align: left; /* ตัวหนังสือเยื้องซ้ายให้อ่านง่าย แต่ก้อนเนื้อหาอยู่กลางจอ */
}

/* หัวข้อบทความแบบขีดล่าง (Sitemap Style) */
.legal-section h2 {
    font-size: 1.6rem;
    color: #1e293b;
    border-bottom: 2px solid #1e293b; 
    padding-bottom: 12px;
    margin-bottom: 25px;
    font-weight: 700;
}

/* การจัดการ List ให้สมดุล */
.legal-section ul {
    padding-left: 0;
    list-style: none;
}

.legal-section li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 15px;
}

.legal-section li::before {
    content: "•";
    color: var(--at-red);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* การจัดวางกล่องสิทธิ (Grid) */
.rights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.right-item {
    background: #f8fafc;
    padding: 25px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

/* ส่วนติดต่อด้านล่าง จัดวางตรงกลาง */
.contact-box {
    max-width: 600px;
    margin: 60px auto 0;
    text-align: center;
    background: #f8fafc;
    padding: 40px;
    border-radius: 25px;
    border: 2px dashed #cbd5e1;
}

/* Responsive */
@media (max-width: 768px) {
    .legal-container { margin: 40px auto; }
    .legal-header h1 { font-size: 2rem; }
    .legal-section { padding: 0 10px; }
}