/* "HOW IT WORKS" TILE GRID — shared by the How page hero and the home page.
   Markup lives in templates/how_grid.html. */

/* ────────────────── SECTION ────────────────── */
.how-grid-section {
    box-sizing: border-box;
    padding: clamp(56px, 7vw, 96px) clamp(16px, 2.5vw, 40px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(28px, 4vw, 48px);
    text-align: center;
}

/* On /how the grid is the start of the page: a full-screen hero. */
.how-hero {
    min-height: 100vh;
    min-height: 100svh;
    padding-top: calc(var(--nav-h) + clamp(32px, 5vw, 64px));
}

.how-grid-intro {
    width: 100%;
    max-width: 1800px;   /* same as .grid-container */
    margin: 0 auto;
}

.how-grid-title {
    margin: 0 0 16px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.4rem, 6vw, 5rem);
    line-height: 1.05;
    letter-spacing: 0.01em;
    color: var(--plum);
}

.how-hero h1.how-grid-title {
    font-size: clamp(2.6rem, 6vw, 5rem);
}

.how-grid-section h2.how-grid-title {
    font-size: clamp(2.2rem, 5vw, 4rem);
}

.how-grid-body {
    margin: 0 auto;
    max-width: 900px;
    font-size: clamp(16px, 1.4vw, 19px);
    line-height: 1.6;
    color: var(--plum-deep);
}

/* ────────────────── GRID ────────────────── */
.grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(12px, 1.4vw, 24px);
    width: 100%;
    max-width: 1800px;
    margin: 0 auto;
}

.how-grid-entry {
    position: relative;
    min-width: 0;
}

.grid-item {
    position: relative;
}

.grid-item a {
    position: relative;
    display: block;
    text-decoration: none;
    border-radius: 4px;
}

/* No shadow or lift: hovering only zooms the picture (see .grid-item img) */
.grid-image-shadow {
    display: block;
}

.grid-image-wrap {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.grid-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.grid-item:hover img,
.grid-item:focus-within img {
    transform: scale(1.06);
}

@media (prefers-reduced-motion: reduce) {
    .grid-item img { transition: none; }
    .grid-item:hover img,
    .grid-item:focus-within img { transform: none; }
}

/* Portrait tablets and phones: a 2 × 2 grid so the tiles stay big.
   The width is also capped by the screen height, so on a tablet the whole
   grid (plus the intro) fits in one screen. Landscape tablets keep 4 in a row. */
@media (max-width: 1100px) and (orientation: portrait) {
    .how-grid-intro { max-width: 880px; }
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
        max-width: min(880px, 62vh);
        max-width: min(880px, 62svh);
    }
}

/* Landscape tablets and phones: one row of 4, capped by the screen height. */
@media (max-width: 1100px) and (orientation: landscape) {
    .grid-container {
        max-width: min(100%, 150vh);
        max-width: min(100%, 150svh);
    }
}

@media (max-width: 600px) {
    .how-grid-section { padding-left: 16px; padding-right: 16px; }
    .grid-container { max-width: none; }
    .how-hero { padding-bottom: 48px; }   /* keeps the full-screen min-height on phones */
    .grid-container { gap: 10px; }
}

/* /how hero: the two ways in, under the title */
.how-hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; }
