/* Root Variables - Matching main site */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --text-dark: #1e293b;
    --text-gray: #64748b;
    --text-light: #f8fafc;
    --border-color: #e2e8f0;
    --background-light: #f8fafc;
    --background-white: #ffffff;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --orange-color: #ea580c;
    --orange-dark: #c2410c;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--background-white);
}

/* Main content wrapper */
.content-wrapper {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--background-white);
}

/* Article header */
.article-header {
    margin-bottom: 30px;
    text-align: center;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 20px;
}

.article-header h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    color: var(--text-dark);
    margin-bottom: 10px;
    line-height: 1.3;
}

/* Introduction section */
.intro {
    font-size: 1.1em;
    margin-bottom: 30px;
    padding: 20px;
    background-color: var(--background-light);
    border-left: 4px solid var(--primary-color);
    border-radius: 0 8px 8px 0;
}

/* Table of Contents */
.table-of-contents {
    background-color: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.table-of-contents h3 {
    color: var(--text-dark);
    margin-bottom: 15px;
    font-size: 1.3em;
}

.table-of-contents ul {
    list-style: none;
}

.table-of-contents li {
    margin-bottom: 8px;
}

.table-of-contents a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.table-of-contents a:hover {
    color: var(--primary-dark);
    background-color: rgba(37, 99, 235, 0.1);
}

/* Section styling */
section {
    margin-bottom: 40px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

section:last-child {
    border-bottom: none;
}

h2 {
    color: var(--text-dark);
    font-size: 1.8em;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

h3 {
    color: var(--text-dark);
    font-size: 1.4em;
    margin: 20px 0 15px 0;
}

/* Thai text styling */
.thai-text {
    font-family: 'Noto Sans Thai', 'Arial Unicode MS', sans-serif;
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.1em;
    cursor: pointer;
    transition: color 0.2s ease;
    text-decoration: none;
    border-radius: 3px;
    padding: 2px 4px;
    margin: 0 2px;
}

.thai-text:hover {
    color: var(--primary-dark);
    background-color: rgba(37, 99, 235, 0.1);
}

/* Lists */
ul, ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

li {
    margin-bottom: 8px;
}

/* Nested lists */
ul ul {
    margin-top: 8px;
    margin-bottom: 8px;
}

/* Dialogue section */
.dialogue {
    background-color: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.dialogue-line {
    margin-bottom: 15px;
    padding: 15px;
    border-left: 4px solid var(--primary-color);
    background-color: var(--background-white);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dialogue-line:last-child {
    margin-bottom: 0;
}

.dialogue-line strong {
    color: var(--text-dark);
    font-weight: 600;
}

.dialogue-line em {
    color: var(--text-gray);
    font-style: italic;
    display: block;
    margin-top: 8px;
    font-size: 0.95em;
}

/* Vocabulary section */
.vocabulary-section {
    background-color: var(--background-light);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--success-color);
}

/* Pain types two-column layout */
.pain-types {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-top: 20px;
}

.pain-category {
    background-color: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.pain-category h4 {
    color: var(--text-dark);
    margin-bottom: 15px;
    font-size: 1.2em;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
}

.pain-category ul {
    margin-left: 0;
    list-style: none;
}

.pain-category li {
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.pain-category li:last-child {
    border-bottom: none;
}

@media (max-width: 768px) {
    .pain-types {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Formula card */
.formula-card {
    background: var(--background-light);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.formula-content h3 {
    color: var(--text-dark);
    margin-bottom: 20px;
    font-size: 1.4em;
    text-align: center;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.formula-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    font-size: 1.3em;
    font-weight: 600;
    flex-wrap: wrap;
}

.formula-display .thai-text {
    background: var(--primary-color);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 1.4em;
}

.formula-display .thai-text:hover {
    background: var(--primary-dark);
    color: white;
}

.formula-transliteration {
    text-align: center;
    margin-top: -10px;
    margin-bottom: 15px;
}

.transliteration-text {
    font-size: 0.9em;
    color: var(--text-gray);
    font-style: italic;
    font-weight: 500;
}

.formula-plus, .formula-equals {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.5em;
}

.formula-bodypart {
    background: var(--background-white);
    border: 2px solid var(--border-color);
    padding: 8px 12px;
    border-radius: 8px;
    font-style: italic;
    color: var(--text-gray);
}

.formula-result {
    background: var(--background-white);
    border: 2px solid var(--success-color);
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text-dark);
}

.formula-example {
    text-align: center;
    font-size: 1.1em;
    margin: 20px 0 0 0;
    color: var(--text-dark);
}

.formula-example .thai-text {
    background: var(--primary-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
}

.formula-example .thai-text:hover {
    background: var(--primary-dark);
    color: white;
}

/* Body parts section */
.body-parts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 20px;
}

.body-part-category {
    background-color: var(--background-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.body-part-category h3 {
    color: var(--text-dark);
    margin-bottom: 15px;
    font-size: 1.3em;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
}

.body-part-category ul {
    margin-left: 0;
    list-style: none;
}

.body-part-category li {
    margin-bottom: 12px;
    padding: 8px 12px;
    background-color: var(--background-white);
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
    transition: background-color 0.2s ease;
}

.body-part-category li:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

.body-part-category .english-term {
    color: var(--text-dark);
    font-weight: 500;
}

.body-part-category .thai-text {
    margin: 0 8px;
}

.body-part-category .pronunciation {
    color: var(--text-gray);
    font-size: 0.9em;
}

/* Figure and image styling */
.massage-sign {
    text-align: center;
    margin: 30px 0;
}

.massage-sign img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.massage-sign figcaption {
    margin-top: 10px;
    font-style: italic;
    color: var(--text-gray);
}

/* Tip boxes */
.tip-box {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    border-left: 4px solid #17a2b8;
}

.tip-box strong {
    color: var(--text-dark);
}

.tip-box p {
    margin: 0;
}

/* Paragraphs */
p {
    margin-bottom: 15px;
    text-align: justify;
}

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Strong text */
strong {
    font-weight: 600;
    color: var(--text-dark);
}

/* =====================
   CALL TO ACTION BOX
   ===================== */
.cta-box {
    background-color: var(--background-light);
    border: 2px solid var(--orange-color);
    border-radius: 12px;
    padding: 25px;
    margin: 40px 0;
    text-align: center;
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.1);
}

.cta-box h3 {
    font-size: 1.6em;
    color: var(--text-dark);
    margin-top: 0;
    margin-bottom: 15px;
}

.cta-box p {
    font-size: 1.1em;
    color: var(--text-gray);
    margin-bottom: 25px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-button {
    display: inline-block;
    background-color: var(--orange-color);
    color: var(--text-light);
    font-size: 1.2em;
    font-weight: bold;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.cta-button:hover {
    background-color: var(--orange-dark);
    color: var(--text-light);
    transform: translateY(-2px);
    text-decoration: none;
}

/* Responsive design */
@media (max-width: 768px) {
    .content-wrapper {
        padding: 15px;
        margin: 10px;
    }
    
    .article-header h1 {
        font-size: 2em;
    }
    
    h2 {
        font-size: 1.5em;
    }
    
    .body-parts {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .body-part-category {
        padding: 15px;
    }
    
    .massage-sign img {
        width: 100%;
        max-width: 400px;
    }
}

@media (max-width: 480px) {
    .content-wrapper {
        margin: 5px;
        padding: 10px;
    }
    
    .article-header h1 {
        font-size: 1.8em;
    }
    
    .intro {
        padding: 15px;
    }
    
    .table-of-contents {
        padding: 15px;
    }
}