/* Article detail page */

.csm-article {
    --csm-article-content-width: 42rem;
    --csm-article-hero-width: 52rem;
    padding: 1.5rem 0 3rem;
}

.csm-article--loading,
.csm-article--empty {
    padding: 2rem 0 3rem;
}

.csm-article__empty-msg {
    margin-top: 1.5rem;
    color: #fff;
    font-size: 1.125rem;
}

.csm-article__back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    color: #c8d400;
    letter-spacing: 0.02em;
    transition: color 0.2s;
}

.csm-article__back:hover {
    color: #fff;
}

/* Hero — wider than body, but still inset from full page width */
.csm-article__hero {
    position: relative;
    overflow: hidden;
    border-radius: 0.25rem;
    min-height: clamp(14rem, 42vw, 26rem);
    width: 100%;
    max-width: var(--csm-article-hero-width);
    margin: 0 auto;
}

.csm-article__hero-media {
    position: absolute;
    inset: 0;
}

.csm-article__hero-media [cw-b-img],
.csm-article__hero-media picture {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    line-height: 0;
}

.csm-article__hero-media img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
}

.csm-article__hero-overlay {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: clamp(14rem, 42vw, 26rem);
    padding: 1.5rem 1.75rem 2rem;
    background: linear-gradient(
        180deg,
        rgba(26, 23, 27, 0.15) 0%,
        rgba(26, 23, 27, 0.55) 45%,
        rgba(26, 23, 27, 0.92) 100%
    );
}

.csm-article__hero-overlay time {
    display: inline-block;
    width: fit-content;
    margin-bottom: 0.75rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1a171b;
    background-color: #c8d400;
    border-radius: 0.125rem;
}

.csm-article__title,
.csm-article__title.h1,
.csm-article__title.h2,
.csm-article__title.h3,
.csm-article__title.h4 {
    margin: 0;
    max-width: 40rem;
    color: #fff;
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    word-break: break-word;
}

/* Body — open layout on page background */
.csm-article__main {
    max-width: var(--csm-article-content-width);
    margin: 2rem auto 0;
    padding: 0;
}

.csm-article__prose {
    padding: 0;
}

.csm-article__prose,
.csm-article__prose p,
.csm-article__prose li {
    color: #fff;
    font-size: 1.0625rem;
    line-height: 1.75;
}

.csm-article__prose p:not(:last-child) {
    margin-bottom: 1.15em;
}

.csm-article__prose a {
    color: #c8d400;
    text-decoration: underline;
}

.csm-article__prose a:hover {
    color: #fff;
}

.csm-article__prose h2,
.csm-article__prose h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: #c8d400;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.csm-article__prose img {
    max-width: 100%;
    height: auto;
    margin: 1.25em 0;
    border-radius: 0.125rem;
}

/* Optional CMS blocks below article */
.csm-article__extra {
    max-width: var(--csm-article-content-width);
    margin: 2.5rem auto 0;
    padding: 0;
}

.csm-article__extra-area {
    min-height: 0;
}

/* Hide when empty; keep visible in admin (add-first-block button) */
.csm-article__extra:not(:has([cw-b-heading], [cw-b-text], [cw-b-img], [cw-b-p], [cw-b-link], [cw-b-table], button)) {
    margin-top: 0;
    padding: 0;
    display: none;
}

@media screen and (max-width: 768px) {
    .csm-article__hero-overlay {
        padding: 1.25rem 1.25rem 1.5rem;
    }

    .csm-article__main {
        margin-top: 1.5rem;
    }
}
