/* ── Quarry cards ───────────────────────────────────────────
   Figma: desktop 2425:410 — three cards, the photo over the name
   and a line; mobile 2439:410 — a bar each that opens to its
   photo and line, the first open.
   ─────────────────────────────────────────────────────────── */

.quarry-cards {
    padding: var(--pad-y) var(--pad-x);
}

.quarry-cards__inner {
    display: flex;
    flex-direction: column;
    gap: 40px;
    max-width: var(--site-max-w);
    margin: 0 auto;
}

.quarry-cards__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.quarry-cards__words {
    display: flex;
    flex: 0 1 904px;
    flex-direction: column;
    gap: 8px;
}

.quarry-cards__title {
    font-size: 45px;
    font-weight: 600;
    line-height: 48px;
    text-transform: capitalize;
}

.quarry-cards__text,
.quarry-cards__card-text {
    color: var(--color-text-muted);
    font-family: var(--font-heading);
    font-weight: 500;
    line-height: 20px;
}

.quarry-cards__button {
    flex: none;
    min-width: 155px;
}

.quarry-cards__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px;
}

.quarry-cards__card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
    padding-bottom: 24px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: var(--color-white);
    box-shadow: 0 0 12px rgb(0 0 0 / 0.12);
}

.quarry-cards__card details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 24px;
    interpolate-size: allow-keywords;
}

.quarry-cards__card summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    list-style: none;
    pointer-events: none;
}

.quarry-cards__card summary::-webkit-details-marker {
    display: none;
}

.quarry-cards__card-title {
    color: var(--color-secondary);
    font-size: 20px;
    font-weight: 600;
    line-height: 25px;
}

.quarry-cards__chevron,
.quarry-cards__photo--narrow {
    display: none;
}

.quarry-cards__photo--wide {
    width: 100%;
    height: 229px;
    object-fit: cover;
}

@media (max-width: 1024px) {
    .quarry-cards__title {
        font-size: 32px;
        line-height: 36px;
    }

    .quarry-cards__list {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }
}

/* ── Mobile: a bar each that opens ──────────────────────────── */
@media (max-width: 767px) {
    .quarry-cards__inner {
        gap: 25px;
    }

    .quarry-cards__head {
        flex-direction: column;
        align-items: stretch;
    }

    .quarry-cards__words {
        flex: none;
        gap: 6px;
    }

    .quarry-cards__title {
        font-size: 28px;
        line-height: 36px;
    }

    .quarry-cards__list {
        gap: 25px;
    }

    .quarry-cards__card {
        gap: 0;
        padding: 20px;
        border: 0;
    }

    .quarry-cards__photo--wide {
        display: none;
    }

    /* Closed, the bar is 76px with the name centred; open, it's 20px in */
    .quarry-cards__card:has(details:not([open])) {
        padding-block: 25.5px;
    }

    .quarry-cards__card details {
        gap: 0;
        padding: 0;
    }

    .quarry-cards__card details::details-content {
        block-size: 0;
        overflow: hidden;
        transition: block-size var(--transition), content-visibility var(--transition) allow-discrete;
    }

    .quarry-cards__card details[open]::details-content {
        block-size: auto;
    }

    .quarry-cards__card summary {
        pointer-events: auto;
        cursor: pointer;
    }

    .quarry-cards__card-title {
        color: var(--color-text);
    }

    .quarry-cards__chevron {
        display: block;
        flex: none;
        transition: rotate var(--transition);
    }

    .quarry-cards__card details[open] .quarry-cards__chevron {
        rotate: 180deg;
    }

    .quarry-cards__photo--narrow {
        display: block;
        width: 100%;
        height: 172px;
        margin-top: 14px;
        border-radius: 8px;
        object-fit: cover;
    }

    .quarry-cards__card-text {
        margin-top: 14px;
        color: var(--color-text-muted);
        font-family: var(--font-body);
        font-weight: 400;
        line-height: 20.8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .quarry-cards__card details::details-content {
        transition: none;
    }
}
