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

/* 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(--color-text-dark);
}

/* --- 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(--color-white);
    padding: 0.4rem 2rem;
    margin: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

/* 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: 12px 12px 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: 12px;
    padding-bottom: 1.5rem;
    margin-bottom: 0;
}

/* Section header — card title */
#content.page-cms > h2 {
    background: var(--color-white);
    margin: 1.5rem 0 0;
    padding: 1.2rem 2rem 0.8rem;
    border-radius: 12px 12px 0 0;
    border-bottom: 2px solid var(--color-dark-pink);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    font-family: var(--font-brand);
    font-size: 1.15rem;
    font-weight: normal;
    color: var(--color-dark-pink);
    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 12px 12px;
    padding-bottom: 1.5rem;
    margin-bottom: 0;
}

/* Last element closes the last card */
#content.page-cms > *:last-child {
    border-radius: 0 0 12px 12px;
    padding-bottom: 1.5rem;
}

/* --- Typography --- */

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

#content.page-cms strong {
    color: var(--color-text-heading);
    font-weight: 600;
}

#content.page-cms em {
    color: var(--color-gray-dark);
}

/* --- 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(--color-text-dark);
}

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

/* --- Links --- */

#content.page-cms a {
    color: var(--color-pink);
    text-decoration: underline;
    transition: color var(--transition-fast);
}

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

/* --- Footer links block (unrelated to CMS content cards) --- */

.block-footer-links {
    margin-bottom: 1.563rem;
}
