/* 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: 24px;
    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;
}

.byline {
    font-size: 0.95em;
    color: var(--text-gray);
}

.byline a {
    color: var(--primary-color);
    text-decoration: none;
}

.byline a:hover {
    text-decoration: underline;
}

/* Hero image */
.hero-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 24px;
}

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

.intro p {
    text-align: left;
}

.intro p:last-child {
    margin-bottom: 0;
}

/* =====================
   STICKY CATEGORY NAV
   ===================== */
.cat-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--background-white);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
    margin-bottom: 28px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
}

.cat-nav a {
    display: inline-block;
    padding: 8px 16px;
    margin-right: 8px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-gray);
    background: var(--background-light);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.cat-nav a:hover,
.cat-nav a.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    text-decoration: none;
}

/* =====================
   QUICK REFERENCE TABLE
   ===================== */
.quick-ref-section {
    margin-bottom: 36px;
    padding-top: 16px;
}

.quick-ref-section h2 {
    color: var(--text-dark);
    font-size: 1.6em;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
    margin-bottom: 12px;
}

.quick-ref-section > p {
    color: var(--text-gray);
    margin-bottom: 16px;
}

.quick-ref {
    margin: 20px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.quick-ref table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.quick-ref thead {
    background-color: var(--primary-color);
    color: white;
}

.quick-ref th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.quick-ref td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.quick-ref tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.04);
}

.quick-ref tbody tr:nth-child(even) {
    background-color: var(--background-light);
}

.quick-ref tbody tr:nth-child(even):hover {
    background-color: rgba(37, 99, 235, 0.07);
}

.quick-ref td:first-child {
    font-weight: 600;
    color: var(--text-gray);
    text-align: center;
    width: 36px;
}

.quick-ref .thai-col {
    font-family: 'Noto Sans Thai', 'Arial Unicode MS', sans-serif;
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.05em;
}

.quick-ref td a {
    font-weight: 500;
    white-space: nowrap;
}

/* Clickable Thai audio spans */
.thai-audio {
    font-family: 'Noto Sans Thai', 'Arial Unicode MS', sans-serif;
    font-weight: bold;
    color: var(--primary-color);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background 0.2s;
}

.thai-audio:hover {
    background: rgba(37, 99, 235, 0.1);
}

.thai-audio::after {
    content: " 🔊";
    font-size: 0.7em;
    opacity: 0.5;
}

/* =====================
   CATEGORY SECTIONS
   ===================== */
.category {
    margin-bottom: 36px;
    padding-top: 16px;
}

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

.category > p {
    color: var(--text-gray);
    margin-bottom: 16px;
}

/* =====================
   FEATURED CARD
   (1 standout guide per section)
   ===================== */
.featured-card {
    display: block;
    padding: 18px 20px;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 0 8px 8px 0;
    margin-bottom: 12px;
    text-decoration: none;
    color: var(--text-dark);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.featured-card:hover {
    border-left-color: var(--orange-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: var(--text-dark);
}

.featured-card .phrase-title {
    font-size: 1.15em;
    font-weight: 700;
    margin-bottom: 2px;
}

.featured-card .phrase-thai {
    font-family: 'Noto Sans Thai', 'Arial Unicode MS', sans-serif;
    font-size: 1.1em;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.featured-card .phrase-desc {
    font-size: 0.92em;
    color: var(--text-gray);
    line-height: 1.5;
}

.featured-card .read-more {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.88em;
    font-weight: 600;
    color: var(--primary-color);
}

.featured-card:hover .read-more {
    color: var(--orange-color);
}

/* =====================
   COMPACT PHRASE ROWS
   ===================== */
.phrase-list {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.phrase-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-dark);
    transition: background 0.15s;
}

.phrase-row:hover {
    background: var(--background-light);
    text-decoration: none;
    color: var(--text-dark);
}

.phrase-row:last-child {
    border-bottom: none;
}

.phrase-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.phrase-row .phrase-title {
    font-weight: 600;
    font-size: 1.05em;
}

.phrase-row .phrase-thai {
    font-family: 'Noto Sans Thai', 'Arial Unicode MS', sans-serif;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.05em;
}

.phrase-arrow {
    color: var(--text-gray);
    font-size: 1.2em;
    padding-left: 12px;
    transition: color 0.2s, transform 0.2s;
}

.phrase-row:hover .phrase-arrow {
    color: var(--orange-color);
    transform: translateX(3px);
}

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

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

.cta-box p {
    font-size: 1.05em;
    color: var(--text-gray);
    margin-bottom: 20px;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.cta-button {
    display: inline-block;
    background-color: var(--orange-color);
    color: var(--text-light);
    font-size: 1.15em;
    font-weight: bold;
    padding: 14px 28px;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.2s;
    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;
}

/* Social proof / testimonial */
.social-proof {
    font-style: italic;
    color: var(--text-gray);
    margin-bottom: 16px;
    font-size: 0.95em;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
}

/* Optin form */
.optin-form {
    max-width: 440px;
    margin: 0 auto 20px auto;
}

.optin-form input[type="email"] {
    width: 100%;
    padding: 14px 16px;
    font-size: 1em;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 12px;
    outline: none;
    transition: border-color 0.2s ease;
}

.optin-form input[type="email"]:focus {
    border-color: var(--primary-color);
}

.optin-form input[type="submit"] {
    width: 100%;
    padding: 14px 20px;
    font-size: 1.1em;
    font-weight: bold;
    background-color: var(--orange-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.optin-form input[type="submit"]:hover {
    background-color: var(--orange-dark);
}

/* hCaptcha container */
.optin-form .h-captcha {
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
}

/* Checkmarks below form */
.checkmarks {
    max-width: 400px;
    margin: 0 auto;
    text-align: left;
}

.checkmarks p {
    margin-bottom: 6px;
    font-size: 0.95em;
    color: var(--text-gray);
    text-align: left;
}

.check {
    color: var(--success-color);
    font-weight: bold;
    margin-right: 6px;
}

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

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

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

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

/* =====================
   RESPONSIVE DESIGN
   ===================== */
@media (max-width: 768px) {
    .content-wrapper {
        padding: 15px;
        margin: 10px;
    }

    .article-header h1 {
        font-size: 2em;
    }

    .cat-nav a {
        padding: 7px 13px;
        font-size: 0.85em;
    }

    .featured-card {
        padding: 16px 18px;
    }

    .quick-ref {
        margin: 15px -15px;
        border-radius: 0;
    }

    .quick-ref th,
    .quick-ref td {
        padding: 9px 10px;
        font-size: 0.88em;
    }

    .cta-box {
        padding: 20px 15px;
    }

    .cta-box h3 {
        font-size: 1.3em;
    }
}

@media (max-width: 480px) {
    .content-wrapper {
        margin: 5px;
        padding: 10px;
    }

    .article-header h1 {
        font-size: 1.8em;
    }

    .intro {
        padding: 15px;
    }

    .cat-nav a {
        padding: 6px 12px;
        font-size: 0.82em;
    }

    .phrase-row {
        padding: 12px 14px;
    }

    .featured-card:hover {
        box-shadow: none;
    }

    .quick-ref th:first-child,
    .quick-ref td:first-child {
        display: none;
    }

    .cta-button {
        padding: 12px 20px;
        font-size: 1.05em;
    }
}
