/* Leader Tuotenostosivujen Nosto block
   Three cards in a row. Side cards (landscape) are nudged down so all
   image centres share one horizontal axis with the middle portrait card. */

.leader-tns {
    background: #000;
    color: #fff;
    padding: 4rem 1.5rem;
}

/* ── Heading ──────────────────────────────────────────── */

.leader-tns__heading {
    text-align: center;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.05;
    margin: 0 0 3rem;
    color: #fff;
}

.leader-tns__heading--placeholder {
    opacity: 0.35;
    font-style: italic;
}

/* ── Grid ─────────────────────────────────────────────── */

.leader-tns__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 1.5rem;
    align-items: start;
    max-width: 1280px;
    margin: 0 auto;
}

/* ── Cards ────────────────────────────────────────────── */

.leader-tns__item {
    display: flex;
    flex-direction: column;
}

/*
 * Shift side cards down so their image centres align with the middle portrait.
 *
 * Column width  = (grid_width − 2 × 1.5rem) / 3
 * Square h      = col_w × 1    (ratio 1/1)
 * Landscape h   = col_w × 3/4
 * Offset needed = (square_h − landscape_h) / 2
 *               = col_w × (1 − 3/4) / 2
 *               = col_w × 1/8
 *               = (grid_width − 3rem) / 3 × 1/8
 *               = (grid_width − 3rem) / 24  ← exact centre
 * ×2 to push side images visually lower:
 *               = (grid_width − 3rem) / 12
 *
 * padding-top % is relative to the containing block's inline size (grid_width),
 * so: padding-top: calc((100% − 3rem) / 12)
 */
.leader-tns__item--1,
.leader-tns__item--3 {
    padding-top: calc((100% - 3rem) / 12);
}

/* ── Image ────────────────────────────────────────────── */

.leader-tns__image-link {
    display: block;
    text-decoration: none;
}

.leader-tns__image-link:hover .leader-tns__image {
    transform: scale(1.04);
}

.leader-tns__image-wrap {
    overflow: hidden;
}

/* Side cards: landscape */
.leader-tns__item--1 .leader-tns__image-wrap,
.leader-tns__item--3 .leader-tns__image-wrap {
    aspect-ratio: 4 / 3;
}

/* Middle card: square — landscape source cropped from both sides */
.leader-tns__item--2 .leader-tns__image-wrap {
    aspect-ratio: 1 / 1;
}

.leader-tns__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    transition: transform 0.45s ease;
}

.leader-tns__image--placeholder {
    background: #333;
}

/* ── Text content ─────────────────────────────────────── */

.leader-tns__content {
    padding-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.leader-tns__title {
    margin: 0;
    font-size: clamp(1.8rem, 2.5vw, 2.6rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.1;
    color: #fff;
}

.leader-tns__title--placeholder {
    opacity: 0.35;
    font-style: italic;
}

.leader-tns__desc {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #ccc;
}

.leader-tns__desc--placeholder {
    opacity: 0.35;
    font-style: italic;
}

.leader-tns__cta {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    color: #fff;
}

.leader-tns__cta:hover {
    text-decoration: underline;
}

/* ── Editor notice ────────────────────────────────────── */

.leader-tns__empty-notice {
    text-align: center;
    opacity: 0.4;
    font-style: italic;
}

/* ── Responsive ───────────────────────────────────────── */

@media (max-width: 900px) {
    .leader-tns__grid {
        column-gap: 1rem;
    }

    /* Recalculate offset for smaller gap (1rem × 2 gaps = 2rem) */
    .leader-tns__item--1,
    .leader-tns__item--3 {
        padding-top: calc((100% - 2rem) / 12);
    }

    .leader-tns {
        padding: 3rem 1rem;
    }
}

@media (max-width: 600px) {
    .leader-tns__grid {
        grid-template-columns: 1fr;
        row-gap: 2.5rem;
    }

    /* No offset needed in single-column layout */
    .leader-tns__item--1,
    .leader-tns__item--3 {
        padding-top: 0;
    }

    /* Middle image stays square on mobile — already compact */
    .leader-tns__item--2 .leader-tns__image-wrap {
        aspect-ratio: 1 / 1;
    }

    .leader-tns {
        padding: 2.5rem 1.25rem;
    }
}
