/* ==========================================================================
   Cards Industries — header + full-bleed strip of angled, overlapping cards.
   ========================================================================== */

.section.cardsindustries {
    padding-top: 64px;
    padding-bottom: 64px;
    border-bottom: 4px solid var(--color-brand-orange);
    overflow: hidden;
}

/* ---- Header ------------------------------------------------------------- */
.cardsindustries-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}
.cardsindustries-intro {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 750px;
}
.cardsindustries-eyebrow {
    font-family: var(--font-heading);
    font-size: var(--text-label-xs);
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-foreground);
}
.cardsindustries-heading { margin: 0; color: var(--color-foreground); }
.cardsindustries-subcopy { margin: 0; color: var(--color-secondary-foreground); }

/* Layout only — colours/padding/hover come from the global .btn .btn-primary */
.cardsindustries-btn { flex-shrink: 0; }

/* ---- Angled card slider ------------------------------------------------- */
/* Each card is a square image masked into a parallelogram via clip-path, with a
   gutter of white space between cards. Slick shows 2 full cards with the
   neighbours peeking each side. */
.cardsindustries {
    --ci-shift: 80px;   /* clip-path slant */
    --ci-gap: 20px;     /* visible white space between the angled cards */
}
.cardsindustries-grid .slick-list { overflow: hidden; }
.cardsindustries-grid .slick-slide { overflow: visible; height: auto; }
.cardsindustries-slide:focus { outline: none; }

/* Pre-init: a clipped flex row so there's no unstyled flash */
.cardsindustries-grid:not(.slick-initialized) {
    display: flex;
    overflow: hidden;
}
.cardsindustries-grid:not(.slick-initialized) .cardsindustries-slide {
    flex: 0 0 33%;
}

.cardsindustries-card {
    display: block;
    position: relative;
    /* Card overflows its slide by (shift - gap); with the clip-path slant this
       leaves exactly --ci-gap of white space between the visible shapes. */
    width: calc(100% + var(--ci-shift) - var(--ci-gap));
    height: 580px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    background: var(--color-neutral-200);
    clip-path: polygon(var(--ci-shift) 0, 100% 0, calc(100% - var(--ci-shift)) 100%, 0 100%);
}
/* Navy panel that covers the image on hover */
.cardsindustries-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: var(--color-navy);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.cardsindustries-card:hover::before,
.cardsindustries-card:focus-within::before { opacity: 1; }
.cardsindustries-card.is-link { cursor: pointer; }
.cardsindustries-card.is-link:focus-visible { outline: 2px solid var(--color-brand-orange); outline-offset: 2px; }
.cardsindustries-card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cardsindustries-card-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.55) 30%, rgba(0, 0, 0, 0) 64%);
}
.cardsindustries-card-body {
    position: absolute;
    z-index: 2;
    left: 56px;
    bottom: 40px;
    width: 250px;
    max-width: calc(100% - 96px);
    color: var(--color-background);
}
.cardsindustries-card-title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: var(--text-heading-sm);
    font-weight: 700;
    line-height: 1.1;
    color: var(--color-background);
    white-space: nowrap;        /* always one line */
}
.cardsindustries-card-desc {
    /* Collapsed by default so the bottom-anchored title sits low and aligned
       across all cards; expands on hover, sliding the title up to reveal it. */
    margin-top: 0;
    max-height: 0;
    overflow: hidden;
    font-family: var(--font-body);
    font-size: var(--text-paragraph-sm);
    font-weight: 300;
    line-height: 1.45;
    letter-spacing: 0.01em;
    color: var(--color-background);
    opacity: 0;
    transition: max-height 0.4s ease, margin-top 0.4s ease, opacity 0.3s ease;
}
.cardsindustries-card:hover .cardsindustries-card-desc,
.cardsindustries-card:focus-within .cardsindustries-card-desc {
    max-height: 180px;
    margin-top: 12px;
    opacity: 1;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1200px) {
    .cardsindustries-card { height: 520px; }
}

@media (max-width: 767px) {
    .cardsindustries {
        --ci-shift: 48px;
    }
    .cardsindustries-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .cardsindustries-card { height: 440px; }
    .cardsindustries-card-body { left: 40px; bottom: 28px; }
    /* No hover on touch — keep the photo as the default state (no navy panel),
       but expand the description over the scrim so the copy is still visible. */
    .cardsindustries-card-desc { max-height: 200px; margin-top: 12px; opacity: 1; }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .cardsindustries-card::before,
    .cardsindustries-card-desc { transition: none; }
}
