/* ThaiDrive - guide (landing) page styles. Builds on style.css tokens. */

.guide {
    max-width: 860px;
    margin: 0 auto;
}

.guide section {
    margin-bottom: 3.5rem;
    scroll-margin-top: 1.5rem;
}

.guide h2 {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.guide h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.guide p {
    margin-bottom: 1rem;
}

.guide a {
    color: var(--primary-text);
    text-underline-offset: 3px;
}

.guide a.btn {
    text-decoration: none;
}

.guide a.btn-primary {
    color: var(--on-primary);
}

.guide a.btn-secondary {
    color: var(--text);
}

/* Intro */
.guide-hero {
    padding-top: 0.5rem;
}

.guide-hero h1 {
    font-size: 3rem;
}

.lead {
    font-size: 1.2rem;
    color: var(--muted);
    max-width: 680px;
    margin-bottom: 1.75rem;
}

.lead strong {
    color: var(--text);
}

.fact-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.fact-grid li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.fact-grid strong {
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.fact-grid span {
    font-size: 0.85rem;
    color: var(--muted);
}

/* Tags and callouts */
.tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    vertical-align: 0.1em;
    white-space: nowrap;
}

.tag-official {
    background: var(--success-soft);
    color: var(--success);
}

.tag-varies {
    background: var(--accent-soft);
    color: var(--accent-text);
}

.callout {
    border-radius: var(--radius-lg);
    padding: 1.4rem 1.6rem;
    margin: 1.5rem 0 2rem;
    border: 1px solid var(--border);
    border-left: 5px solid var(--primary);
    background: var(--surface);
}

.callout h2,
.callout h3 {
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

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

.callout-tip {
    border-left-color: var(--accent);
}

.callout .btn {
    margin-top: 0.5rem;
}

/* Table of contents */
.toc {
    padding: 1.4rem 1.6rem;
    margin-bottom: 3rem;
}

.toc h2 {
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.6rem;
}

.toc ol {
    columns: 2;
    column-gap: 2rem;
    padding-left: 1.2rem;
}

.toc li {
    break-inside: avoid;
    margin-bottom: 0.3rem;
}

/* Routes */
.route-grid,
.test-grid,
.tip-grid {
    display: grid;
    gap: 1rem;
    margin: 1.5rem 0;
}

.route-grid,
.tip-grid {
    grid-template-columns: 1fr 1fr;
}

.test-grid {
    grid-template-columns: repeat(3, 1fr);
}

.route,
.test,
.tips,
.province {
    padding: 1.5rem;
}

.route-label {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary-text);
    background: var(--surface-2);
    border-radius: 999px;
    padding: 0.15rem 0.7rem;
    margin-bottom: 0.6rem;
}

.route-retake {
    border-top: 4px solid var(--accent);
}

.route-convert {
    border-top: 4px solid var(--success);
}

.route-what {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
    font-size: 0.95rem;
    color: var(--muted);
}

.check-list,
.cross-list,
.test ul,
.province ul {
    list-style: none;
    display: grid;
    gap: 0.55rem;
}

.check-list li,
.cross-list li {
    position: relative;
    padding-left: 1.6rem;
}

.check-list li::before,
.cross-list li::before {
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 800;
}

.check-list li::before {
    content: '✓';
    color: var(--success);
}

.cross-list li::before {
    content: '✕';
    color: var(--error);
}

/* Route B reasons are conditions, not good news: neutral arrow instead of a tick */
.route-retake .check-list li::before {
    content: '→';
    color: var(--accent-text);
}

.test ul li,
.province ul li {
    position: relative;
    padding-left: 1rem;
    font-size: 0.95rem;
}

.test ul li::before,
.province ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

.test .btn {
    margin-top: 1rem;
}

/* Steps */
.steps {
    list-style: none;
    counter-reset: step;
    display: grid;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.steps > li {
    counter-increment: step;
    position: relative;
    padding: 0 0 0 3.4rem;
}

.steps > li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 50%;
    background: var(--primary);
    color: var(--on-primary);
    font-weight: 800;
    display: grid;
    place-items: center;
}

/* dashed "road line" connecting the steps */
.steps > li:not(:last-child)::after {
    content: '';
    position: absolute;
    left: calc(1.2rem - 1px);
    top: 2.7rem;
    bottom: -1.1rem;
    border-left: 2px dashed var(--border);
}

.steps ul {
    padding-left: 1.2rem;
    margin-bottom: 1rem;
}

.steps li li {
    margin-bottom: 0.35rem;
}

/* Documents and costs */
.doc-list {
    list-style: none;
    padding: 0.5rem 1.4rem;
}

.doc-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.doc-list li:last-child {
    border-bottom: none;
}

.table-wrap {
    overflow-x: auto;
    padding: 0.25rem 1rem;
}

.cost-table {
    width: 100%;
    border-collapse: collapse;
}

.cost-table th,
.cost-table td {
    text-align: left;
    padding: 0.8rem 0.5rem;
    border-bottom: 1px solid var(--border);
}

.cost-table th {
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}

.cost-table tr:last-child td {
    border-bottom: none;
}

.note {
    font-size: 0.88rem;
    color: var(--muted);
}

/* Insurance */
.insurance-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}

.insurance {
    padding: 1.5rem;
}

.insurance h4 {
    font-size: 0.95rem;
    margin: 1rem 0 0.4rem;
}

.insurance ul {
    list-style: none;
    display: grid;
    gap: 0.55rem;
}

.insurance li {
    position: relative;
    padding-left: 1rem;
    font-size: 0.95rem;
}

.insurance li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

.class-table {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: 0.75rem 0 1rem;
    font-size: 0.88rem;
}

.class-row {
    display: grid;
    grid-template-columns: 3.2rem 4.5rem 1fr 4.6rem;
    gap: 0.5rem;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

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

.class-head {
    background: var(--surface-2);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Provinces */
.province-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.province-office {
    font-size: 0.92rem;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.map-link {
    display: inline-block;
    margin-top: 0.9rem;
    font-size: 0.88rem;
    font-weight: 700;
}

/* FAQ */
.faq {
    display: grid;
    gap: 0.6rem;
}

.faq details {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0 1.25rem;
}

.faq summary {
    cursor: pointer;
    font-weight: 700;
    padding: 1rem 0;
    list-style-position: outside;
}

.faq summary:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.faq details[open] summary {
    border-bottom: 1px dashed var(--border);
    margin-bottom: 0.75rem;
}

.faq details p {
    color: var(--muted);
}

/* CTA, sources, partners */
.cta-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 2rem;
    background: var(--primary);
    border-color: var(--primary);
    color: var(--on-primary);
}

.cta-band h2 {
    margin-bottom: 0.4rem;
}

.cta-band p {
    margin: 0;
    opacity: 0.88;
}

.cta-band .btn-primary {
    background: var(--accent);
    color: #1c1b2e;
    flex-shrink: 0;
}

.guide .cta-band a.btn-primary {
    color: #1c1b2e;
}

.sources ul {
    padding-left: 1.2rem;
    margin-bottom: 1rem;
}

.sources li {
    margin-bottom: 0.4rem;
    font-size: 0.92rem;
}

.partner-slot:empty {
    display: none;
}

.partner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.1rem 1.4rem;
    margin: 1.25rem 0;
    border-style: dashed;
}

.partner h4 {
    font-size: 1rem;
}

.partner p {
    margin: 0.2rem 0 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.partner-label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Responsive */
@media (max-width: 760px) {
    .guide-hero h1 {
        font-size: 2.2rem;
    }

    .lead {
        font-size: 1.05rem;
    }

    .fact-grid {
        grid-template-columns: 1fr 1fr;
    }

    .toc ol {
        columns: 1;
    }

    .route-grid,
    .tip-grid,
    .test-grid,
    .province-grid,
    .insurance-grid {
        grid-template-columns: 1fr;
    }

    .class-row {
        grid-template-columns: 2.4rem 3.4rem 1fr 3.4rem;
        font-size: 0.8rem;
        padding: 0.5rem;
    }

    .cta-band,
    .partner {
        flex-direction: column;
        align-items: stretch;
        text-align: left;
    }

    .doc-list li {
        flex-direction: column;
        gap: 0.3rem;
    }
}


/* Guide articles (generated pages) */
.breadcrumb {
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 1.25rem;
}

.breadcrumb a {
    color: var(--muted);
}

.article-head {
    margin-bottom: 1.5rem;
}

.article-head h1 {
    font-size: 2.6rem;
}

.takeaways {
    padding: 1.4rem 1.6rem;
    margin-bottom: 1.5rem;
    border-left: 5px solid var(--accent);
}

.takeaways h2 {
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.6rem;
}

.takeaways ul {
    display: grid;
    gap: 0.5rem;
    padding-left: 1.1rem;
}

.guide article section {
    margin-bottom: 2.75rem;
}

.guide ul,
.guide ol {
    margin-bottom: 1rem;
}

.guide li {
    margin-bottom: 0.35rem;
}

/* Sign library */
.sign-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin: 1.25rem 0;
}

.sign-tile {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.8rem;
}

.sign-tile-img {
    flex-shrink: 0;
    width: 96px;
    height: 96px;
    background: var(--sign-tile);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px;
    display: grid;
    place-items: center;
}

.sign-tile-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.sign-tile-text strong {
    display: block;
    font-size: 0.95rem;
    line-height: 1.3;
}

.sign-tile-code,
.sign-tile-name {
    display: block;
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 0.2rem;
}

.sign-tile-name {
    font-weight: 600;
    color: var(--primary-text);
    font-size: 0.82rem;
}

.sign-tile-text p {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0;
}

/* Sample questions */
.sample-q {
    padding: 1.25rem 1.4rem;
    margin-bottom: 1rem;
}

.sample-q-text {
    font-weight: 700;
    margin-bottom: 0.6rem;
}

.sample-q-options {
    padding-left: 1.4rem;
}

.answer-reveal {
    border-top: 1px dashed var(--border);
    padding-top: 0.6rem;
    margin-top: 0.4rem;
}

.answer-reveal summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--primary-text);
}

.answer-reveal summary:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.answer-reveal p {
    margin: 0.5rem 0 0;
}

/* Related guides and footer */
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
}

.related-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.1rem 1.2rem;
    text-decoration: none;
    color: var(--text);
    transition: box-shadow 0.2s, transform 0.2s;
}

.related-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.related-card span {
    font-size: 0.88rem;
    color: var(--muted);
}

.guide a.related-card {
    color: var(--text);
}

.site-footer {
    max-width: 860px;
    margin: 4rem auto 0;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.site-footer-cols {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.site-footer h2 {
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.6rem;
}

.site-footer ul {
    list-style: none;
    display: grid;
    gap: 0.4rem;
}

.site-footer a {
    color: var(--primary-text);
    text-underline-offset: 3px;
}

.site-footer .note {
    font-size: 0.82rem;
}

@media (max-width: 760px) {
    .article-head h1 {
        font-size: 1.9rem;
    }

    .sign-list {
        grid-template-columns: 1fr;
    }

    .site-footer-cols {
        grid-template-columns: 1fr;
    }
}


/* "Sources disagree" blocks: every figure with who says it */
.disagree {
    background: var(--surface);
    border: 1px dashed var(--accent);
    border-left: 5px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.2rem;
    margin: 1.1rem 0;
}

.disagree-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.disagree ul {
    list-style: none;
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
}

.disagree li {
    position: relative;
    padding-left: 1rem;
    font-size: 0.92rem;
    margin: 0;
}

.disagree li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

.disagree .src {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    background: var(--surface-2);
    border-radius: 999px;
    padding: 0.05rem 0.6rem;
    margin-left: 0.25rem;
}

.tag-disagree {
    background: var(--accent-soft);
    color: var(--accent-text);
}

.tag-verified {
    background: var(--surface-2);
    color: var(--primary-text);
    border: 1px solid var(--primary-text);
}

/* banner illustration under the article header */
.hero-img {
    margin: 0 0 1.5rem;
}

.hero-img img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 16px;
    border: 1px solid var(--border, rgba(43, 45, 110, .15));
}

/* explanatory figures inside the guides */
.figure {
    margin: 1.25rem 0 1.5rem;
}

.figure img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 16px;
}

.figure figcaption {
    margin-top: .5rem;
    font-size: .85rem;
    color: var(--text-muted, #5a5d86);
    text-align: center;
}

/* guide thumbnail at the top of a card, bleeding to the card edges */
.related-thumb {
    display: block;
    width: calc(100% + 2.4rem);
    max-width: none;
    height: auto;
    aspect-ratio: 3 / 1;
    object-fit: cover;
    margin: -1.1rem -1.2rem 0.5rem;
}
