/* SpamGoblin shared vertical-rhythm system.
 * Keeps migrated/native page content visually consistent without requiring
 * every page to use identical markup.
 */
:root {
    --sg-space-page: clamp(50px, 6vw, 76px);
    --sg-space-section: clamp(38px, 4.5vw, 58px);
    --sg-space-block: clamp(24px, 3vw, 34px);
    --sg-space-copy: 18px;
}

/* One page-level rhythm everywhere. */
.entry-content {
    padding-top: var(--sg-space-page);
    padding-bottom: var(--sg-space-page);
}

/* Native top-level sections use the same vertical spacing. */
.entry-content > section:not(.sg-card) {
    margin: 0 auto;
    padding-top: var(--sg-space-section);
    padding-bottom: var(--sg-space-section);
}
.entry-content > section:not(.sg-card):first-child {
    padding-top: 0;
}
.entry-content > section:not(.sg-card):last-child {
    padding-bottom: 0;
}
.entry-content > section:not(.sg-card) + section:not(.sg-card) {
    border-top: 1px solid var(--sg-border);
}

/* Cards are deliberate contained blocks: consistent outer gap + inner pad. */
.entry-content > .sg-card,
.entry-content > section.sg-card {
    margin-top: var(--sg-space-block);
    margin-bottom: var(--sg-space-block);
    padding: clamp(26px, 3.5vw, 36px);
}
.entry-content > .sg-card:first-child,
.entry-content > section.sg-card:first-child {
    margin-top: 0;
}
.entry-content > .sg-card:last-child,
.entry-content > section.sg-card:last-child {
    margin-bottom: 0;
}

/* Pages that are mostly headings + paragraphs get the same section cadence. */
.entry-content > h2 {
    margin-top: var(--sg-space-section);
    margin-bottom: 14px;
}
.entry-content > h2:first-child {
    margin-top: 0;
}
.entry-content > h3 {
    margin-top: var(--sg-space-block);
    margin-bottom: 10px;
}
.entry-content > p,
.entry-content > ul,
.entry-content > ol {
    margin-top: 0;
    margin-bottom: var(--sg-space-copy);
}
.entry-content > ul,
.entry-content > ol {
    padding-left: 1.4em;
}
.entry-content > ul li + li,
.entry-content > ol li + li {
    margin-top: 8px;
}

/* Reset first/last child margins inside sections/cards so padding controls them. */
.entry-content section > :first-child,
.entry-content .sg-card > :first-child {
    margin-top: 0;
}
.entry-content section > :last-child,
.entry-content .sg-card > :last-child {
    margin-bottom: 0;
}

/* Buttons grouped in a paragraph should breathe but not create giant holes. */
.entry-content p:has(> .sg-button) {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 24px;
}
.entry-content p:has(> .sg-button) .sg-button {
    margin: 0;
}

/* Gravity Forms: consistent relationship to surrounding copy. */
.entry-content .gform_wrapper {
    margin-top: var(--sg-space-block);
    margin-bottom: 0;
}
.entry-content .gform_wrapper .gfield {
    margin-bottom: 18px;
}
.entry-content .gform_wrapper .gform_footer {
    margin-top: 24px;
    padding-top: 0;
}

/* Support desk/plugin blocks should visually align with normal cards/forms. */
.entry-content .sg-support-desk,
.entry-content .sg-support-form,
.entry-content .sg-ticket-lookup,
.entry-content .sg-ticket-view {
    margin-top: var(--sg-space-block);
    margin-bottom: var(--sg-space-block);
}

/* Homepage sections use the same rhythm as interior pages. */
.sg-home-section .entry-content {
    padding-top: var(--sg-space-section);
    padding-bottom: var(--sg-space-section);
}
.sg-home-section:first-child .entry-content {
    padding-top: var(--sg-space-section);
}

@media (max-width: 860px) {
    :root {
        --sg-space-page: 46px;
        --sg-space-section: 36px;
        --sg-space-block: 24px;
    }
    .entry-content > .sg-card,
    .entry-content > section.sg-card {
        padding: 24px;
    }
}
