/* ==========================================
   SAT Forge — Articles V1
========================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.articles-main,
.article-main {
    width: min(1160px, 92%);
    margin: 42px auto 80px;
}

.articles-hero.glass-panel,
.article-hero.glass-panel {
    border: 1px solid rgba(147, 197, 253, 0.5);
    background:
        radial-gradient(circle at 87% 14%, rgba(96, 165, 250, 0.22), transparent 18rem),
        radial-gradient(circle at 5% 105%, rgba(244, 114, 182, 0.12), transparent 20rem),
        linear-gradient(135deg, rgba(239, 246, 255, 0.78), rgba(255, 255, 255, 0.46));
}

html[data-theme="dark"] .articles-hero.glass-panel,
html[data-theme="dark"] .article-hero.glass-panel {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.5), rgba(15, 23, 42, 0.7));
}

.articles-hero {
    padding: clamp(28px, 5vw, 50px);
    border-radius: 30px;
}

.articles-kicker,
.article-meta span:first-child {
    color: #2563eb;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.articles-hero h1 {
    margin: 10px 0 0;
    max-width: 820px;
    font-size: clamp(2.35rem, 5vw, 4rem);
    line-height: 0.99;
    letter-spacing: -0.055em;
}

.articles-hero p,
.article-hero > p {
    max-width: 760px;
    margin: 0;
    color: var(--muted-text);
    font-size: 1.04rem;
    line-height: 1.75;
}

.articles-controls {
    margin-top: 22px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 20px;
}

.articles-search {
    min-width: 230px;
    flex: 1;
    min-height: 46px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--glass-border, var(--border-color));
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.52);
}

html[data-theme="dark"] .articles-search {
    background: rgba(30, 41, 59, 0.56);
}

.articles-search svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: var(--muted-text);
    stroke-width: 2;
}

.articles-search input {
    width: 100%;
    border: 0;
    outline: 0;
    color: var(--text-color);
    background: transparent;
    font: inherit;
}

.articles-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.articles-categories button {
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--muted-text);
    background: transparent;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.articles-categories button.is-active {
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.2);
}

.articles-status {
    margin: 22px 2px 0;
    color: var(--muted-text);
}

.articles-grid {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.article-card {
    min-height: 0;
    padding: 24px 28px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "title arrow"
        "meta arrow";
    align-items: center;
    gap: 10px 24px;
    border-radius: 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    content-visibility: auto;
    contain-intrinsic-size: auto 126px;
}

.article-card::after {
    content: "→";
    grid-area: arrow;
    color: #2563eb;
    font-size: 1.75rem;
    font-weight: 700;
    transition: transform 0.2s ease;
}

.article-card:hover {
    transform: translateY(-4px);
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: 0 24px 60px rgba(40, 63, 103, 0.15), var(--glass-inner);
}

.article-card:hover::after {
    transform: translateX(6px);
}

.article-card.is-featured {
    grid-column: auto;
    background:
        linear-gradient(90deg, rgba(219, 234, 254, 0.3), transparent 55%),
        var(--glass-surface);
}

.article-card.has-image {
    grid-template-columns: minmax(0, 1fr) 164px auto;
    grid-template-areas:
        "title image arrow"
        "meta image arrow";
}

.article-card-image {
    grid-area: image;
    width: 164px;
    height: 96px;
    object-fit: cover;
    border: 1px solid var(--glass-border, var(--border-color));
    border-radius: 13px;
}

.article-card-top,
.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    color: var(--muted-text);
    font-size: 0.78rem;
    font-weight: 750;
}

.article-card-top {
    grid-area: meta;
}

.article-card-category {
    padding: 5px 9px;
    border-radius: 999px;
    color: #1d4ed8;
    background: rgba(219, 234, 254, 0.75);
}

.article-card h2 {
    grid-area: title;
    margin: 0;
    padding: 0;
    font-size: clamp(1.25rem, 2.6vw, 1.65rem);
    line-height: 1.15;
    letter-spacing: -0.035em;
}

.article-main {
    max-width: 1080px;
}

.article-hero {
    padding: clamp(30px, 7vw, 68px);
    border-radius: 30px;
}

.article-back {
    display: inline-block;
    margin-bottom: 34px;
    color: #2563eb;
    text-decoration: none;
    font-weight: 800;
}

.article-hero h1 {
    margin: 16px 0 18px;
    max-width: 900px;
    font-size: clamp(2.4rem, 7vw, 5rem);
    line-height: 0.99;
    letter-spacing: -0.055em;
}

.article-hero-image {
    margin: 28px 0 0;
    overflow: hidden;
    background: var(--page-background);
    border: 1px solid var(--glass-border, var(--border-color));
    border-radius: 20px;
}

.article-hero-image img {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: cover;
}

.article-layout {
    margin-top: 22px;
    display: block;
}

.article-body,
.article-next {
    border-radius: 24px;
}

.article-body {
    padding: clamp(26px, 6vw, 58px);
}

.article-section + .article-section {
    margin-top: 46px;
    padding-top: 42px;
    border-top: 1px solid var(--glass-border, var(--border-color));
}

.article-section h2 {
    margin: 0 0 18px;
    font-size: clamp(1.65rem, 4vw, 2.4rem);
    line-height: 1.15;
    letter-spacing: -0.035em;
}

.article-section p,
.article-section li {
    color: var(--text-color);
    font-size: 1.02rem;
    line-height: 1.85;
}

.article-section p + p {
    margin-top: 18px;
}

.article-section ul {
    margin: 18px 0 0;
    padding-left: 22px;
    display: grid;
    gap: 10px;
}

.article-section .article-callout {
    margin-top: 22px;
    padding: 18px 20px;
    border: 1px solid rgba(96, 165, 250, 0.35);
    border-radius: 16px;
    color: #1e3a8a;
    background: rgba(219, 234, 254, 0.46);
    font-weight: 750;
}

html[data-theme="dark"] .article-section .article-callout {
    color: #bfdbfe;
    background: rgba(30, 58, 138, 0.32);
}

.article-next {
    margin-top: 22px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.article-next span {
    color: var(--muted-text);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.article-next a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 850;
}

@media (max-width: 880px) {
    .articles-controls {
        align-items: stretch;
        flex-direction: column;
    }

}

@media (max-width: 620px) {
    .articles-main,
    .article-main {
        margin-top: 24px;
    }

    .article-card {
        padding: 19px 20px;
        gap: 9px 15px;
    }

    .article-card::after {
        font-size: 1.45rem;
    }

    .article-card.has-image {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "image image"
            "title arrow"
            "meta arrow";
    }

    .article-card-image {
        width: 100%;
        height: min(42vw, 210px);
        margin-bottom: 5px;
    }

    .article-next {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ==========================================
   Article sorting
========================================== */

.articles-sort {
    min-height: 46px;
    padding: 0 10px 0 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    border: 1px solid var(--glass-border, var(--border-color));
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.52);
    color: var(--muted-text);
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

html[data-theme="dark"] .articles-sort {
    background: rgba(30, 41, 59, 0.56);
}

.articles-sort select {
    min-width: 126px;
    border: 0;
    outline: 0;
    color: var(--text-color);
    background: transparent;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 850;
    cursor: pointer;
}

.articles-sort select:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.38);
    outline-offset: 4px;
    border-radius: 6px;
}

html[data-theme="dark"] .articles-sort select option {
    color: #f8fafc;
    background: #0f172a;
}

@media (max-width: 880px) {
    .articles-sort {
        width: 100%;
        justify-content: space-between;
    }

    .articles-sort select {
        min-width: 150px;
        text-align: right;
    }
}
