/* ===== CMS Page Content — Card System ===== */

/* Section header for CMS page titles */
body.page-cms .section-header {
    padding: var(--s5) 0 var(--s5);
}

.section-header-title {
    font-family: var(--font-display);
    font-size: var(--fs-3xl);
    font-weight: var(--fw-extra);
    color: var(--ink);
    text-align: center;
    line-height: var(--lh-tight);
}

/* Content container — #content qualifier avoids matching body.page-cms */
#content.page-cms {
    background: transparent;
    padding: 0;
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--ink);
}

/* --- Card structure (CSS-only, no JS wrappers) ---
 * h2 opens a card header; everything between two h2s is one visual card.
 * :has(+ h2) closes the card bottom before the next h2 starts.
 */

/* All block elements get card-body styling */
#content.page-cms > p,
#content.page-cms > ul,
#content.page-cms > ol {
    background: var(--surface);
    padding: 0.4rem 2rem;
    margin: 0;
    box-shadow: var(--shadow-sm);
}

/* First element opens the intro card */
#content.page-cms > p:first-child,
#content.page-cms > ul:first-child,
#content.page-cms > ol:first-child {
    border-radius: var(--r-md) var(--r-md) 0 0;
    padding-top: 1.5rem;
}

/* First element is also a standalone card (followed by h2) */
#content.page-cms > p:first-child:has(+ h2),
#content.page-cms > ul:first-child:has(+ h2),
#content.page-cms > ol:first-child:has(+ h2) {
    border-radius: var(--r-md);
    padding-bottom: 1.5rem;
    margin-bottom: 0;
}

/* Section header — card title */
#content.page-cms > h2 {
    background: var(--surface);
    margin: 1.5rem 0 0;
    padding: 1.2rem 2rem 0.8rem;
    border-radius: var(--r-md) var(--r-md) 0 0;
    border-bottom: 2px solid var(--brand-strong);
    box-shadow: var(--shadow-sm);
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: var(--fw-bold);
    color: var(--brand-strong);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.3;
}

/* Element before an h2 closes the current card */
#content.page-cms > *:has(+ h2) {
    border-radius: 0 0 var(--r-md) var(--r-md);
    padding-bottom: 1.5rem;
    margin-bottom: 0;
}

/* Last element closes the last card */
#content.page-cms > *:last-child {
    border-radius: 0 0 var(--r-md) var(--r-md);
    padding-bottom: 1.5rem;
}

/* --- Typography --- */

#content.page-cms p {
    font-family: var(--font-body);
    color: var(--ink);
}

#content.page-cms strong {
    color: var(--ink);
    font-weight: var(--fw-semibold);
}

#content.page-cms em {
    color: var(--ink-soft);
}

/* --- Lists --- */

#content.page-cms ul,
#content.page-cms ol {
    padding-left: 3.5rem;
    list-style: disc;
}

#content.page-cms ol {
    list-style: decimal;
}

#content.page-cms li {
    margin-bottom: 0.4rem;
    font-family: var(--font-body);
    color: var(--ink);
}

#content.page-cms li p {
    margin: 0;
}

/* --- Links --- */

#content.page-cms a {
    color: var(--brand);
    text-decoration: underline;
    transition: color var(--t-base);
}

#content.page-cms a:hover {
    color: var(--brand-strong);
}
