/* The pages' own rules, on top of relayout.css, pages-base.css and brand.css. Layout is Relayout's classes in the
   markup; what is here is what they don't cover. */

/* <body> is a column (Relayout's rl-column), and the main area takes the height the footer leaves, so on a short page
   the footer sits at the bottom of the window. Not rl-height-fill: with a mouse, pages-base.css makes <body> a scroller
   of fixed height, and rl-height-fill would let <main> shrink below its content there. A column's children don't
   shrink, so <main> only grows; on a long page the footer follows it and the page scrolls. */
body > main {
    flex-grow: 1;
}

/* The header's link to the portal is "Customer portal" down to 24rem wide, and "Portal" below, where the full label
   would meet the name: at 350px they touch, at 360px 10px apart. The header keeps the portal's 2rem inset. */
.nav-link-short {
    display: none;
}

@media (max-width: 23.99rem) {
    .nav-link-long {
        display: none;
    }

    .nav-link-short {
        display: inline;
    }
}

/* Below 350px the page keeps its width and scrolls sideways, in place of squeezing the cards and the footer further */
body > main,
body > footer {
    min-width: 350px;
}

/* The home page is one section: the cards, with no title above them (the header's name is the page's <h1>). More air
   above and below than the base's section padding. */
.home-products {
    padding-block: clamp(4.5rem, 10vw, 8rem);
}

/* In the header, the name is the home page's <h1>: it keeps the look of the other pages' <span>, without the base's
   heading margin */
h1.nav-logo-word {
    margin: 0;
}

/* ── The product cards ──
   .doc-card is the base's card. The mark sits beside the name, without the base's icon box, and the card ends in a link to the product's site. */

/* The cards are narrow and of one width, in a centred row that wraps: as many in a row as fit, and a short last row
   centred under the others. The section's container is widened to hold all five on a desktop (five cards and four
   gaps). */
.home-products > .container {
    --card-width: 14rem;
    max-width: calc(5 * var(--card-width) + 4rem);
}

/* A row's cards stretch to its tallest, but rows don't match each other, so a wrapped row would come out shorter. The
   minimum height is the tallest card's (Conseal's, 289px at the card's width), so every row has the same height. With
   AuthStack and PaySignal live it is PaySignal's, 336px (21rem). */
.product-card {
    box-sizing: border-box;
    flex: 0 1 var(--card-width);
    min-height: 18.125rem;
}

.product-card :is(h2, p) {
    margin: 0;
}

/* The mark and the name share a row, the name centred on the mark's box */
.product-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* The base's icon box (a sunken square with a border) is taken off: the mark stands on the card's own surface */
.product-card .doc-card-icon {
    width: auto;
    height: auto;
    background: none;
    border: 0;
    border-radius: 0;
}

.product-mark {
    display: block;
    width: 32px;
    height: 32px;
}

.product-link {
    align-self: start;
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    font-size: 0.9375rem;
    color: var(--brand-text);
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.product-link:hover {
    text-decoration-thickness: 2px;
}
