/* ==========================================================================
   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; }

/* ---- Overlay nav arrows (reveal on hover) ------------------------------- */
/* Look + behaviour mirror .cardsproductslider-nav: white pill that fades in on
   slider hover, stays visible on touch devices. */
.cardsindustries-slider { position: relative; }
.cardsindustries-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-full);
    background: var(--color-background);   /* white */
    color: var(--color-navy);
    font-size: 16px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;                  /* not clickable until revealed */
    transition: opacity var(--ease-default), background var(--ease-default), transform var(--ease-fast);
}
.cardsindustries-nav.cardsindustries-prev { left: 24px; }
.cardsindustries-nav.cardsindustries-next { right: 24px; }
.cardsindustries-nav:hover { background: var(--color-neutral-100); }
.cardsindustries-nav:active { transform: translateY(-50%) scale(0.94); }
.cardsindustries-nav:focus-visible {
    outline: 2px solid var(--color-navy);
    outline-offset: 2px;
    opacity: 1;
    pointer-events: auto;
}

/* Reveal when hovering anywhere over the slider area */
.cardsindustries-slider:hover .cardsindustries-nav {
    opacity: 1;
    pointer-events: auto;
}

/* Touch devices have no hover — keep the arrows visible so they're usable */
@media (hover: none) {
    .cardsindustries-nav { opacity: 1; pointer-events: auto; }
}

/* ---- 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 mobile — keep the nav arrows visible and on-screen. */
    .cardsindustries-nav { opacity: 1; pointer-events: auto; }
    .cardsindustries-nav.cardsindustries-prev { left: 8px; }
    .cardsindustries-nav.cardsindustries-next { right: 8px; }
    /* 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,
    .cardsindustries-nav { transition: none; }
}
