/* Shared article elements */

.article-category,
.card .article-category,
.section-kicker {
    display: block;
    margin: 0 0 14px;
    padding: 0;
    background: transparent;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}


/* Article list */

.article-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    margin-top: 24px;
}

.article-search input {
    width: 100%;
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-strong);
    color: var(--text);
    font: inherit;
    font-size: 15px;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.article-search input:focus {
    outline: none;
    border-color: rgba(31, 95, 74, 0.45);
    box-shadow: 0 0 0 4px rgba(31, 95, 74, 0.10);
}

.article-search button {
    padding: 12px 20px;
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: #ffffff;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(31, 95, 74, 0.18);
    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

.article-search button:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.article-grid .article-card {
    width: 100%;
    max-width: 560px;
}

.article-card h2 {
    text-wrap: balance;
}

.article-card > p:not(.article-category) {
    max-width: 620px;
}


/* Article detail */

.article-detail {
    width: 100%;
    max-width: none;
    margin: 0;
}

.article-header {
    width: 100%;
    max-width: none;
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.article-header .back-link {
    margin-bottom: 28px;
}

.article-header h1 {
    width: 100%;
    max-width: none;
    margin: 0;
    font-size: clamp(25px, 4vw, 39px);
    line-height: 1.08;
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.article-lead {
    width: 100%;
    max-width: none;
    margin: 20px 0 0;
    color: var(--muted);
    font-size: clamp(17px, 1.7vw, 19px);
    line-height: 1.65;
}

.article-meta {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}


/* Markdown content */

.article-body {
    width: 100%;
    max-width: none;
    color: var(--text);
    font-size: 16px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.article-body h2 {
    margin: 42px 0 16px;
    font-size: clamp(25px, 2.8vw, 31px);
    line-height: 1.2;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

.article-body h2:first-child {
    margin-top: 0;
}

.article-body h3 {
    margin: 28px 0 12px;
    font-size: 21px;
    line-height: 1.3;
    letter-spacing: -0.015em;
}

.article-body p {
    margin: 0 0 16px;
}

.article-body ul,
.article-body ol {
    margin: 0 0 22px;
    padding-left: 26px;
}

.article-body li {
    margin-bottom: 8px;
    padding-left: 3px;
}

.article-body a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.article-body a:hover {
    color: var(--accent-hover);
}

.article-body strong {
    color: var(--text);
    font-weight: 700;
}

.article-body blockquote {
    margin: 26px 0;
    padding: 20px 22px;
    border-radius: var(--radius-md);
    background: rgba(31, 95, 74, 0.07);
    color: var(--muted);
}

.article-body blockquote p:last-child {
    margin-bottom: 0;
}

.article-body table {
    width: 100%;
    margin: 26px 0;
    border-collapse: collapse;
    font-size: 15px;
}

.article-body th,
.article-body td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.article-body th {
    color: var(--text);
    background: rgba(31, 95, 74, 0.06);
    font-weight: 700;
}

.article-body img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 28px 0;
    border-radius: var(--radius-md);
}

.article-body hr {
    margin: 36px 0;
    border: 0;
    border-top: 1px solid var(--border);
}

.article-body code {
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(23, 33, 28, 0.07);
    font-size: 0.9em;
}

.article-body pre {
    overflow-x: auto;
    margin: 26px 0;
    padding: 20px;
    border-radius: var(--radius-md);
    background: #17211c;
    color: #f4f7f5;
}

.article-body pre code {
    padding: 0;
    background: transparent;
    color: inherit;
}


/* YouTube videos */

.article-video-section,
.article-faq {
    width: 100%;
    max-width: none;
    margin-top: 54px;
}

.article-video-section h2,
.article-faq h2 {
    width: 100%;
    max-width: none;
    margin: 0 0 22px;
    font-size: clamp(25px, 2.8vw, 32px);
    line-height: 1.2;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

.video-card {
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #17211c;
    aspect-ratio: 16 / 9;
    box-shadow: var(--shadow-soft);
}

.video-card iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}


/* FAQ */

.faq-list {
    width: 100%;
}

.faq-item {
    border-top: 1px solid var(--border);
}

.faq-item:last-child {
    border-bottom: 1px solid var(--border);
}

.faq-item summary {
    position: relative;
    padding: 22px 50px 22px 0;
    color: var(--text);
    font-size: clamp(17px, 1.8vw, 19px);
    font-weight: 600;
    line-height: 1.45;
    cursor: pointer;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "+";
    position: absolute;
    top: 18px;
    right: 6px;
    color: var(--accent);
    font-size: 28px;
    font-weight: 400;
    line-height: 1;
}

.faq-item[open] summary::after {
    content: "−";
}

.faq-answer {
    width: 100%;
    max-width: none;
    padding: 0 50px 22px 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.65;
}

.faq-answer p {
    margin: 0 0 16px;
}

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


/* Mobile */

@media (max-width: 760px) {
    .article-search {
        grid-template-columns: 1fr;
    }

    .article-search button {
        width: 100%;
    }

    .article-grid .article-card {
        max-width: none;
    }

    .article-header {
        margin-bottom: 30px;
        padding-bottom: 26px;
    }

    .article-header .back-link {
        margin-bottom: 24px;
    }

    .article-header h1 {
    font-size: clamp(23px, 10vw, 33px);
    }

    .article-lead {
        font-size: 17px;
    }

    .article-body {
        font-size: 16px;
    }

    .article-body h2 {
        margin-top: 36px;
        font-size: 25px;
    }

    .article-body h3 {
        font-size: 20px;
    }

    .article-body table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .article-video-section,
    .article-faq {
        margin-top: 44px;
    }

    .video-card {
        border-radius: var(--radius-md);
    }

    .faq-item summary {
        padding: 20px 40px 20px 0;
        font-size: 17px;
    }

    .faq-item summary::after {
        top: 17px;
        right: 3px;
        font-size: 26px;
    }

    .faq-answer {
        padding: 0 0 21px;
    }
}