/*
 * Article and Resources pages. Loaded next to landing-components.css, which
 * provides the header, footer, form modal and base typography.
 */

:root {
    --article-blue: #010035;
    --article-red: #d0271d;
    --article-text: #1d1d1f;
    --article-muted: #5f6368;
    --article-border: #e4e4e4;
    --article-width: 860px;
}

.article-page {
    color: var(--article-text);
}

.article-page .container {
    max-width: var(--article-width);
}

/*
 * landing-components.css styles bare h1/h2/h3 for the landing sections
 * (centered, white h1, large top padding). Reset them inside article pages.
 */
.article-page h1,
.article-page h2,
.article-page h3 {
    padding: 0;
    text-align: left;
    font-weight: 600;
}

/* ---------- Header ---------- */

.article__header {
    padding-top: 56px;
    padding-bottom: 24px;
}

.article__category,
.article-card__category {
    margin: 0 0 8px;
    color: var(--article-red);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.article__title {
    margin: 0 0 16px;
    color: var(--article-blue);
    font-size: clamp(2rem, 4vw, 2.75rem);
    line-height: 1.15;
}

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

.article__date,
.article-card__date {
    display: block;
    color: var(--article-muted);
    font-size: 0.9rem;
}

/* ---------- Main image ---------- */

.article__image {
    margin-bottom: 40px;
}

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

/* ---------- Body (CKEditor 5 output) ---------- */

.article__body {
    padding-bottom: 56px;
    font-size: 1.0625rem;
    line-height: 1.7;
}

.article__body::after {
    content: "";
    display: table;
    clear: both;
}

.article__body h1,
.article__body h2,
.article__body h3 {
    margin: 2em 0 0.6em;
    color: var(--article-blue);
    line-height: 1.25;
}

.article__body h1 { font-size: 2rem; }
.article__body h2 { font-size: 1.6rem; }
.article__body h3 { font-size: 1.3rem; }

.article__body p,
.article__body ul,
.article__body ol,
.article__body blockquote {
    margin: 0 0 1.2em;
}

.article__body a {
    color: var(--article-blue);
    text-decoration: underline;
}

.article__body blockquote {
    padding: 0.5em 1.25em;
    border-left: 4px solid var(--article-red);
    color: var(--article-muted);
    font-style: italic;
}

.article__body figure {
    margin: 1.5em 0;
}

.article__body img {
    max-width: 100%;
    height: auto;
}

.article__body figure.image {
    display: table;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.article__body figure.image img {
    display: block;
    margin: 0 auto;
}

.article__body figcaption {
    padding: 0.5em;
    color: var(--article-muted);
    font-size: 0.875rem;
    text-align: center;
}

.article__body .image_resized {
    max-width: 100%;
}

.article__body .image_resized img {
    width: 100%;
}

.article__body .image-style-align-left,
.article__body .image-style-side.image-style-align-left {
    float: left;
    margin: 0.25em 1.5em 1em 0;
}

.article__body .image-style-align-right,
.article__body .image-style-side {
    float: right;
    margin: 0.25em 0 1em 1.5em;
}

.article__body .image-style-block-align-left {
    margin-left: 0;
    margin-right: auto;
}

.article__body .image-style-block-align-right {
    margin-left: auto;
    margin-right: 0;
}

.article__body figure.table {
    display: block;
    overflow-x: auto;
}

.article__body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.article__body th,
.article__body td {
    padding: 0.6em 0.8em;
    border: 1px solid var(--article-border);
    vertical-align: top;
}

.article__body th,
.article__body thead td {
    background: #f8f9fa;
    font-weight: 600;
}

@media (max-width: 767px) {
    .article__body .image-style-align-left,
    .article__body .image-style-align-right,
    .article__body .image-style-side {
        float: none;
        margin: 1.5em auto;
    }
}

/* ---------- Sticky CTA ---------- */

.article-cta {
    position: sticky;
    bottom: 0;
    z-index: 900;
    background: var(--article-blue);
    color: #fff;
    box-shadow: 0 -4px 16px rgba(1, 0, 53, 0.2);
}

.article-cta .container.article-cta__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    max-width: 1140px;
    padding-top: 18px;
    padding-bottom: 18px;
}

.article-cta__text {
    margin: 0;
    font-size: 1.125rem;
    line-height: 1.4;
}

.article-cta__button {
    flex-shrink: 0;
    padding: 10px 28px;
    border: 2px solid #fff;
    border-radius: 0;
    background: #fff;
    color: var(--article-blue);
    font-weight: 600;
}

.article-cta__button:hover,
.article-cta__button:focus {
    background: transparent;
    color: #fff;
}

@media (max-width: 575px) {
    .article-cta .container.article-cta__inner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        text-align: center;
    }

    .article-cta__text {
        font-size: 1rem;
    }
}

/* ---------- Cards (related articles, Resources grid) ---------- */

.article-related {
    padding: 56px 0;
    background: #f8f9fa;
}

.article-related .container {
    max-width: 1140px;
}

.article-related__title {
    margin: 0 0 32px;
    color: var(--article-blue);
    font-size: 1.75rem;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
}

@media (max-width: 991px) {
    .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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

.article-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.article-card__image {
    display: block;
    aspect-ratio: 16 / 9;
    background: var(--article-border);
}

.article-card__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 20px 24px 24px;
}

.article-card__title {
    margin: 0 0 8px;
    font-size: 1.2rem;
    line-height: 1.35;
}

.article-card__title a {
    color: var(--article-blue);
    text-decoration: none;
}

.article-card__title a:hover {
    text-decoration: underline;
}

.article-card__link {
    margin-top: auto;
    padding-top: 16px;
    color: var(--article-red);
    font-weight: 600;
    text-decoration: none;
}

.article-card__link:hover {
    text-decoration: underline;
}

/* ---------- Header: current page link ---------- */

/* Bootstrap darkens .nav-link.active, which disappears on the navy header. */
header .navbar a.nav-link.active {
    color: #ffffff;
    text-decoration: underline;
    text-decoration-color: var(--article-red);
    text-decoration-thickness: 2px;
    text-underline-offset: 6px;
}

/* ---------- Resources index ---------- */

.resources-page .container {
    max-width: 1140px;
}

.article__back {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--article-blue);
    font-size: 0.9rem;
    text-decoration: none;
}

.article__back:hover {
    text-decoration: underline;
}

.resources-header {
    padding: 56px 0 32px;
    border-bottom: 1px solid var(--article-border);
}

.resources-header .container.resources-header__inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
}

.resources-header__title {
    margin: 0 0 8px;
    color: var(--article-blue);
    font-size: clamp(2rem, 4vw, 2.75rem);
    line-height: 1.15;
}

.resources-header__subtitle {
    margin: 0;
    color: var(--article-muted);
    font-size: 1.15rem;
}

.resources-search {
    display: flex;
    flex-shrink: 0;
    width: 100%;
    max-width: 340px;
}

.resources-search__input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid #c9c9d1;
    border-right: 0;
    border-radius: 0;
    font-size: 1rem;
}

.resources-search__input:focus {
    outline: 2px solid var(--article-blue);
    outline-offset: -2px;
}

.resources-search__button {
    padding: 0 16px;
    border: 1px solid var(--article-blue);
    border-radius: 0;
    background: var(--article-blue);
    color: #fff;
}

@media (max-width: 767px) {
    .resources-header .container.resources-header__inner {
        flex-direction: column;
        align-items: stretch;
    }

    .resources-search {
        max-width: none;
    }
}

.resources-results {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding-top: 32px;
}

.resources-results__summary {
    margin: 0;
    font-size: 1.1rem;
}

.resources-results__clear {
    color: var(--article-red);
    font-size: 0.9rem;
}

/* Featured article: 65% image, 35% text. */
.resources-featured {
    padding: 48px 0 0;
}

.featured-article {
    display: grid;
    grid-template-columns: 65fr 35fr;
    gap: 40px;
    align-items: center;
}

.featured-article__image {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 4px;
    background: var(--article-border);
}

.featured-article__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-article__body {
    display: flex;
    flex-direction: column;
}

.resources-page .featured-article__title {
    margin: 0 0 12px;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    line-height: 1.2;
}

.featured-article__title a {
    color: var(--article-blue);
    text-decoration: none;
}

.featured-article__title a:hover {
    text-decoration: underline;
}

.featured-article__subtitle {
    margin: 0 0 12px;
    color: var(--article-muted);
    font-size: 1.05rem;
    line-height: 1.5;
}

@media (max-width: 991px) {
    .featured-article {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.resources-list {
    padding: 48px 0 64px;
}

.resources-empty {
    color: var(--article-muted);
    font-size: 1.1rem;
}

.resources-pagination {
    margin-top: 48px;
}

.resources-pagination__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.resources-page .resources-pagination__list li {
    padding: 0;
    list-style: none;
}

.resources-pagination__link,
.resources-pagination__gap {
    display: inline-block;
    min-width: 42px;
    padding: 8px 12px;
    border: 1px solid var(--article-border);
    color: var(--article-blue);
    text-align: center;
    text-decoration: none;
}

.resources-pagination__gap {
    border-color: transparent;
}

a.resources-pagination__link:hover {
    border-color: var(--article-blue);
}

.resources-pagination__link.is-current {
    border-color: var(--article-blue);
    background: var(--article-blue);
    color: #fff;
}

.resources-pagination__link.is-disabled {
    color: #b0b0b8;
}

/* ---------- Admin preview ---------- */

.article-preview-bar {
    position: relative;
    z-index: 1100;
    padding: 8px 16px;
    background: #fff3cd;
    border-bottom: 1px solid #ffe69c;
    color: #664d03;
    font-size: 0.875rem;
    text-align: center;
}
