/* ========================================================================
   triptych.css
   Three portrait-card section — Kanan Labs surfaces triptych.
   TradeWatch · India AI Tracker · SectorWatch
   ======================================================================== */

/* ---------- Section ---------- */
.kl-triptych {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    z-index: 1;
    padding: clamp(80px, 9vw, 130px) clamp(16px, 4vw, 40px);
}

.kl-triptych__row {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(24px, 3.2vw, 52px);
    align-items: start;
}

/* ---------- Card (entire surface is the link) ---------- */
.kl-triptych__card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    /* entrance animation starting state — JS drives to opacity:1, y:0 */
    opacity: 0;
    transform: translateY(40px);
}

/* ---------- Image frame ---------- */
.kl-triptych__img-wrap {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 2px;
    /* Museum-mat hairline: thin warm-cream rule */
    box-shadow:
        0 0 0 1px rgba(238, 235, 227, 0.16),
        0 28px 70px -18px rgba(0, 0, 0, 0.65),
        0  6px 20px  -8px rgba(0, 0, 0, 0.30);
}

.kl-triptych__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 700ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
                filter  600ms ease;
    transform-origin: center center;
    will-change: transform, filter;
}

/* Dark vignette — top (for numeral) and bottom edge lift */
.kl-triptych__img-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        rgba(6, 31, 56, 0.36) 0%,
        transparent 28%,
        transparent 68%,
        rgba(6, 31, 56, 0.20) 100%
    );
    pointer-events: none;
    z-index: 1;
    transition: opacity 600ms ease;
}

.kl-triptych__card:hover .kl-triptych__img-wrap::after {
    opacity: 0.6;
}

/* ---------- Roman numeral (gallery plate) ---------- */
.kl-triptych__numeral {
    position: absolute;
    top: 1rem;
    left: 1.1rem;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.36em;
    text-transform: uppercase;
    color: rgba(238, 235, 227, 0.30);
    z-index: 2;
    transition: color 500ms ease;
    line-height: 1;
}

.kl-triptych__card:hover .kl-triptych__numeral {
    color: rgba(238, 235, 227, 0.70);
}

/* ---------- Label area below image ---------- */
.kl-triptych__label {
    margin-top: 1.15rem;
    display: flex;
    flex-direction: column;
}

/* Product name */
.kl-triptych__name {
    display: block;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(1.5rem, 2.1vw, 1.85rem);
    color: rgba(238, 235, 227, 0.82);
    line-height: 1.15;
    letter-spacing: -0.01em;
    transition: color 500ms ease, transform 500ms ease;
}

.kl-triptych__card:hover .kl-triptych__name {
    color: rgba(238, 235, 227, 1);
    transform: translateY(-3px);
}

/* Red rule — slides out from left on hover */
.kl-triptych__name-rule {
    display: block;
    width: 0;
    height: 1px;
    background: var(--kl-red, #db4a2b);
    margin-top: 0.6rem;
    transition: width 520ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.kl-triptych__card:hover .kl-triptych__name-rule {
    width: 36px;
}

/* ---------- Hover overlay (dark navy fade + description + CTA) ---------- */
.kl-triptych__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;                /* above the vignette ::after, below the numeral */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: clamp(1.5rem, 2.5vw, 2.2rem);
    background: linear-gradient(
        180deg,
        rgba(6, 31, 56, 0.55) 0%,
        rgba(6, 31, 56, 0.85) 55%,
        rgba(6, 31, 56, 0.95) 100%
    );
    opacity: 0;
    transition: opacity 520ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;       /* card link still handles clicks */
}

.kl-triptych__card:hover .kl-triptych__overlay { opacity: 1; }

.kl-triptych__overlay-desc {
    margin: 0 0 1rem 0;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-size: clamp(0.95rem, 1.15vw, 1.1rem);
    line-height: 1.45;
    color: rgba(244, 235, 208, 0.95);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 480ms ease 120ms, transform 480ms ease 120ms;
}

.kl-triptych__overlay-cta {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--kl-red, #db4a2b);   /* Kanan orange */
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 480ms ease 180ms, transform 480ms ease 180ms;
}

.kl-triptych__card:hover .kl-triptych__overlay-desc,
.kl-triptych__card:hover .kl-triptych__overlay-cta {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Mobile-only inline description (≤860px shows it) ---------- */
.kl-triptych__desc-mobile {
    display: none;          /* hidden on desktop — overlay handles it */
    margin: 0.75rem 0 0 0;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.85rem;
    line-height: 1.5;
    color: rgba(244, 235, 208, 0.6);
}

/* ---------- Hover: image micro-zoom (overlay handles dimming) ---------- */
.kl-triptych__card:hover .kl-triptych__img {
    filter: none;
    transform: scale(1.02);
}

/* ---------- Card lift on hover ---------- */
.kl-triptych__card {
    transition: filter 400ms ease;
}

.kl-triptych__img-wrap {
    transition: box-shadow 500ms ease, transform 500ms ease;
}

.kl-triptych__card:hover .kl-triptych__img-wrap {
    transform: translateY(-6px);
    box-shadow:
        0 0 0 1px rgba(238, 235, 227, 0.22),
        0 38px 90px -18px rgba(0, 0, 0, 0.75),
        0 10px 28px  -8px rgba(0, 0, 0, 0.38);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .kl-triptych { padding-top: 4rem; }
}

/* Tablet portrait — iPad Air/Pro 11" and similar (768–1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .kl-triptych__row {
        grid-template-columns: repeat(2, 1fr);
        max-width: 800px;
        margin: 0 auto;
    }

    .kl-triptych__img-wrap {
        aspect-ratio: 4 / 3;
    }

    .kl-triptych__desc-mobile { display: block; }
    .kl-triptych__overlay     { display: none; }

    /* Card III alone in row 2 — centre it to match one column's width */
    .kl-triptych__card:nth-child(3) {
        grid-column: 1 / -1;
        max-width: calc(50% - clamp(12px, 1.6vw, 26px));
        margin-left: auto;
        margin-right: auto;
    }
}

/* Phone — single column */
@media (max-width: 767px) {
    .kl-triptych__row {
        grid-template-columns: 1fr;
        max-width: 480px;
        margin: 0 auto;
    }

    .kl-triptych__img-wrap {
        aspect-ratio: 4 / 3;
    }

    .kl-triptych__desc-mobile { display: block; }
    .kl-triptych__overlay     { display: none; }  /* no hover on touch — overlay disabled */
}

/* ---------- Section eyebrow ---------- */
.kl-triptych__header {
    max-width: 1280px;
    margin: 0 auto clamp(32px, 4.5vw, 56px);
    text-align: center;
}

.kl-triptych__eyebrow {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(238, 235, 227, 0.38);
}

/* ---------- Per-card status label ---------- */
.kl-triptych__status {
    display: block;
    margin-top: 0.4rem;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 0.575rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(238, 235, 227, 0.35);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .kl-triptych__img,
    .kl-triptych__img-wrap,
    .kl-triptych__name,
    .kl-triptych__name-rule,
    .kl-triptych__overlay,
    .kl-triptych__overlay-desc,
    .kl-triptych__overlay-cta,
    .kl-triptych__numeral {
        transition: none !important;
        transform: none !important;
    }

    .kl-triptych__card:hover .kl-triptych__img {
        filter: brightness(0.87);
        transform: none !important;
    }

    .kl-triptych__card:hover .kl-triptych__img-wrap {
        transform: none !important;
    }

    .kl-triptych__card:hover .kl-triptych__name {
        transform: none !important;
    }

    .kl-triptych__card {
        opacity: 1 !important;
        transform: none !important;
    }
}
