/* ──────────────────────────────────────────────────────────────────────────
   KL Stories Landing Page — [kl_stories_page] shortcode
   Tokens are inherited from kl-global.css (child theme).
   Layout: 2-column card grid. Each card: photo on top, content below.
   ────────────────────────────────────────────────────────────────────────── */

/* ── Grid wrapper — 2-column card grid ───────────────────────────────────── */

.kl-stories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
    padding: 0;
    margin: 0;
    align-items: start; /* cards don't stretch to match neighbour — prevents clamp breaking */
}

.kl-stories-empty {
    grid-column: 1 / -1;
    color: var(--text-mid);
    font-style: italic;
    text-align: center;
    padding: 48px 0;
}

/* ── Story card ───────────────────────────────────────────────────────────── */

.kl-story-row {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;

    /* KL gradient border */
    background:
        linear-gradient(var(--white, #fff), var(--white, #fff)) padding-box,
        linear-gradient(135deg, #EE7203 0%, #FCEE21 50%, #89C9B2 100%) border-box;
    border: 2px solid transparent;

    box-shadow: 0 4px 24px rgba(14, 57, 87, 0.08);
    transition: box-shadow 0.2s;
}

.kl-story-row:hover {
    box-shadow: 0 8px 36px rgba(14, 57, 87, 0.14);
}

/* ── Photo / video — full-width top section ───────────────────────────────── */

.kl-story-row__media {
    position: relative;
    overflow: hidden;
    height: 360px;
    flex-shrink: 0;

    /* Stripe fallback when no image */
    background: linear-gradient(
        90deg,
        #FCEE21 0%, #FCEE21 33%,
        #EE7203 33%, #EE7203 66%,
        #89C9B2 66%, #89C9B2 100%
    );
}

.kl-story-row__media--video {
    background: #000;
}

.kl-story-row__media-inner {
    position: absolute;
    inset: 0;
}

.kl-story-row__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.kl-story-row__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Content — fills the card below the photo ────────────────────────────── */

.kl-story-row__content {
    padding: 24px 32px 32px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--white, #fff);
    flex: 1;
}

/* When there's no photo the content still fills the full card */
.kl-story-row__content--full {
    border-radius: calc(var(--radius-lg, 16px) - 2px);
}

/* ── Service tag — orange uppercase label above the name ─────────────────── */
/* Matches the homepage card label style (no background/pill). Keep clickable. */

.kl-story-row__service-tag {
    display: inline-block;
    font-family: var(--font-sans, 'Manrope', sans-serif);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--orange, #EE7203);
    text-decoration: none;
    line-height: 1;
}

a.kl-story-row__service-tag:hover {
    color: #c55f00;
    text-decoration: none;
}

.kl-story-row__service-tag--plain {
    cursor: default;
}

/* ── Name ─────────────────────────────────────────────────────────────────── */

.kl-story-row__name {
    font-family: var(--font-serif, 'DM Serif Text', Georgia, serif);
    font-size: clamp(1.25rem, 1.8vw, 1.55rem);
    color: var(--navy, #0E3957);
    line-height: 1.15;
    margin: 0;
}

/* ── Combined text — short + long desc in one block, clamped to 4 lines ───── */

.kl-story-row__combined-text {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: var(--font-sans, 'Manrope', sans-serif);
    font-size: 0.975rem;
    line-height: 1.7;
    color: var(--text-mid, #5a6a7a);
    flex: 1;
}

.kl-story-row__combined-text.is-expanded {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
}

.kl-story-row__combined-text p       { margin: 0 0 0.9em; }
.kl-story-row__combined-text p:last-child { margin-bottom: 0; }
.kl-story-row__combined-text a       { color: var(--orange, #EE7203); text-decoration: underline; text-underline-offset: 3px; }
.kl-story-row__combined-text a:hover { color: #c55f00; }
.kl-story-row__combined-text strong  { color: var(--navy, #0E3957); }

/* ── Read full story / Close button — orange pill ────────────────────────── */
/* Uses type+class specificity (0-1-1) + !important to override the theme's global button reset:
   button { background-color: transparent; border: 1px solid #c36; color: #c36; } */

button.kl-story-row__toggle {
    display: inline-flex;
    align-items: center;
    background: var(--orange, #EE7203) !important;
    color: var(--white, #fff) !important;
    border: none !important;
    border-radius: 50px !important;
    padding: 10px 24px;
    cursor: pointer;
    font-family: var(--font-sans, 'Manrope', sans-serif);
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
    align-self: flex-start;
    margin-top: 4px;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}

button.kl-story-row__toggle:hover {
    background: #c55f00 !important;
    color: var(--white, #fff) !important;
    transform: translateY(-1px);
}

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

@media (max-width: 900px) {
    .kl-stories-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .kl-story-row__media {
        height: 300px;
    }
}

@media (max-width: 600px) {
    .kl-story-row__media {
        height: 240px;
    }

    .kl-story-row__content {
        padding: 20px 22px 26px;
        gap: 8px;
    }
}
