/* --- Helpful Articles (/articles/*.html) --- */
/* Article pages are plain HTML: they load root.css and style.css for the site look, and this file for article layout. */

.article-page header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 20px max(20px, calc(50vw - 400px));
}

.article-page .article-logo img {
    display: block;
    max-width: 180px;
    width: 100%;
}

.article-page .article-back {
    color: var(--text-muted);
    font-weight: 500;
}

.article-page .article-back:hover {
    color: #fff;
}

.article-page main {
    align-items: center;
}

.article-page article {
    width: 100%;
    max-width: 800px;
    padding: 60px 20px 80px 20px;
}

.article-page .article-label {
    display: inline-block;
    padding: 6px 16px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
}

.article-page h1 {
    font-size: 2.75rem;
}

.article-page h2 {
    font-size: 1.6rem;
    line-height: 1.3;
    margin: 2.5rem 0 1rem 0;
    color: var(--accent-color-highlight);
}

.article-page p,
.article-page li {
    font-size: 1.05rem;
}

.article-page article a:not(.button) {
    color: var(--accent-color-highlight);
    text-decoration: underline;
}

.article-page .article-lead {
    font-size: 1.3rem;
    color: #fff;
}

.article-page aside {
    margin: 40px 0;
    padding: 30px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-left: 4px solid var(--accent-color);
    border-radius: 12px;
}

.article-page aside h2 {
    margin-top: 0;
    color: #fff;
}

.article-page aside p {
    margin-bottom: 0;
    font-weight: 600;
}

.article-page figure {
    margin: 30px 0;
}

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

.article-page figcaption {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.article-page .article-disclaimer {
    margin-top: 50px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.article-page .article-disclaimer h2 {
    font-size: 1.1rem;
    color: #fff;
}

.article-page .article-disclaimer p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.article-page .article-disclaimer ol {
    margin: 0 0 1rem 1.25rem;
}

.article-page .article-disclaimer li {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    overflow-wrap: anywhere;
}

.article-page .article-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 30px;
}

.article-page footer {
    padding: 30px 20px;
    text-align: center;
}

.article-page footer p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* --- Helpful Articles list on the home page --- */
/* Cards wrap and center whatever the count; past 3, the rest open with the show more checkbox (CSS only) */
.articles-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
}

.article-card {
    display: flex;
    flex-direction: column;
    flex: 0 1 calc((100% - 60px) / 3);
}

.article-card .article-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.article-card .article-more {
    margin-top: auto;
    font-weight: 600;
    color: var(--accent-color-highlight);
}

.articles-toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.articles-extra {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 600ms ease;
}

.articles-extra-inner {
    overflow: hidden;
    visibility: hidden;
    transition: visibility 0s linear 600ms;
}

/* room for the cards' hover lift inside the clipped area */
.articles-extra .articles-list {
    padding-top: 40px;
}

.articles-toggle:checked ~ .articles-extra {
    grid-template-rows: 1fr;
}

.articles-toggle:checked ~ .articles-extra .articles-extra-inner {
    visibility: visible;
    transition-delay: 0s;
}

.articles-extra .article-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 500ms ease 150ms, transform 500ms ease 150ms, background 0.3s ease;
}

.articles-toggle:checked ~ .articles-extra .article-card {
    opacity: 1;
    transform: none;
}

.articles-toggle:checked ~ .articles-extra .article-card:hover {
    transform: translateY(-5px);
}

.articles-toggle-row {
    margin-top: 40px;
    text-align: center;
}

.articles-toggle-row label {
    cursor: pointer;
    user-select: none;
}

.articles-toggle:focus-visible ~ .articles-toggle-row label {
    outline: 2px solid var(--accent-color-highlight);
    outline-offset: 3px;
}

.articles-hide,
.articles-toggle:checked ~ .articles-toggle-row .articles-show {
    display: none;
}

.articles-toggle:checked ~ .articles-toggle-row .articles-hide {
    display: inline;
}

@media (max-width: 1000px) {
    .article-card {
        flex-basis: calc((100% - 30px) / 2);
    }
}

@media (max-width: 640px) {
    .article-card {
        flex-basis: 100%;
    }
}

@media (max-width: 768px) {
    .article-page h1 {
        font-size: 2rem;
    }

    .article-page h2 {
        font-size: 1.35rem;
    }

    .article-page article {
        padding-top: 30px;
    }
}
