/* GENM Compare memberships page (custom-compare-membership.hbs). Loaded on that page only.
Three plan columns (four for a signed-out visitor: the Free card, compare-free, comes first, printed by free-card.hbs), each holding its own plan head (compare-card.hbs: name, price, trial line, button, description, benefits) and its chart block (heading, sentence, chart names and blurred previews).
From 900px: one navy panel holding three equal columns, tops aligned, heights free, with a gold 2px divider in each of the two gaps. Below 900px: three full-width cards stacked in the same order, a small gap between them, each with its own navy outline and rounded corners; the panel's fill is dropped so the outlines show.
Colors come only from genm-tokens.css. Sizes are in px because Source sets the root font size to 10px. */

.genm-compare .genm-compare-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

.genm-compare .genm-compare-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
    border: 2px solid var(--genm-navy);
    border-radius: 12px;
    background: var(--genm-cream);
}

.genm-compare .genm-compare-head,
.genm-compare .genm-compare-free-head {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    padding: 20px;
    background: var(--genm-navy-panel);
    color: var(--genm-cream);
}

.genm-compare .genm-compare-head .genm-home-tier-benefits,
.genm-compare .genm-compare-free-head .genm-home-tier-benefits {
    flex-grow: 0;
    margin-bottom: 0;
}

.genm-compare .genm-compare-head .genm-home-button,
.genm-compare .genm-compare-free-head .genm-home-button {
    margin: 4px 0 14px;
}

.genm-compare .genm-compare-block {
    min-width: 0;
    box-sizing: border-box;
    padding: 20px;
}

.genm-compare .genm-compare-block .genm-home-h3 {
    margin-top: 0;
}

.genm-compare .genm-compare-block .genm-home-lede {
    margin: 0 0 12px;
    font-size: 15px;
}

/* inside a column the previews always use one column, whatever the viewport */
.genm-compare .genm-compare-col .genm-pv-names,
.genm-compare .genm-compare-col .genm-pv-grid {
    grid-template-columns: minmax(0, 1fr);
}

.genm-compare .genm-compare-col .genm-pv-lead {
    max-width: none;
    margin: 16px 0 10px;
}

.genm-compare .genm-compare-col .genm-pv-shape {
    max-width: 100%;
}

@media (min-width: 900px) {
    .genm-compare .genm-compare-cols {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: start;
        gap: 32px;
        padding: 16px;
        border-radius: 12px;
        background-color: var(--genm-navy);
        /* two 2px gold dividers, each centered in a 32px gap (15px of space either side), the full height of the tallest column; none before the first column or after the last. 100% in a background position is the content width minus the 2px line. */
        background-image:
            linear-gradient(var(--genm-gold), var(--genm-gold)),
            linear-gradient(var(--genm-gold), var(--genm-gold));
        background-repeat: no-repeat;
        background-origin: content-box;
        background-size: 2px 100%;
        background-position:
            calc((100% - 62px) / 3 + 15px) 0,
            calc((100% - 62px) * 2 / 3 + 47px) 0;
    }

    /* the Free card is present (signed-out visitor, Ghost returned a free tier): four equal columns and three dividers, each centered in a 32px gap. 100% in a background position is the content width minus the 2px line; a column is (100% - 94px) / 4 wide here, since 100% is the width minus 2px and three 32px gaps take 96px, so the dividers sit after one, two and three columns. */
    .genm-compare .genm-compare-cols:has(> .genm-compare-free) {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        background-image:
            linear-gradient(var(--genm-gold), var(--genm-gold)),
            linear-gradient(var(--genm-gold), var(--genm-gold)),
            linear-gradient(var(--genm-gold), var(--genm-gold));
        background-position:
            calc((100% - 94px) / 4 + 15px) 0,
            calc((100% - 94px) * 2 / 4 + 47px) 0,
            calc((100% - 94px) * 3 / 4 + 79px) 0;
    }

    /* four columns leave about 190 to 200px for the price line, so the monthly and yearly prices fit side by side only at some widths and in some cards ($9 before $19); stack them, the yearly price on its own line, so every card looks the same at every width. */
    .genm-compare .genm-compare-cols:has(> .genm-compare-free) .genm-home-tier-price {
        flex-direction: column;
        gap: 4px;
    }
}

/* Opened from the Data page's Save CSV message ("see the plans", /compare-membership/#compare-tier3): the Complete Terminal Access column is highlighted with the gold border, same 2px width, and stops 16px below the top of the window (the header is not sticky). Works in the stacked phone layout and in the three-column panel. */
.genm-compare .genm-compare-col:target {
    border-color: var(--genm-gold);
    scroll-margin-top: 16px;
}
