/**
 * Knowledge base — shared parts of the overview, letter archive and article (0.14.0).
 *
 * Replaces Elementor page 5474 (post-5474.css), loop-item 6387 and single 5508 in
 * the design language of the case studies and expertises: sharp edges, the white
 * 60° slice in the hero, gold-rule eyebrows, the crown brand mark, one heading
 * scale. Live the hero is a crème band with the brand mark (no photo); a featured
 * image on the page/article is used when set.
 *
 * Here: page variables, the hero, eyebrow + heading, the article card and grid.
 * Breakpoints: laptop ≤1366, tablet ≤1024, mobile ≤767.
 */

.r4y-template--kb_archive,
.r4y-template--kb_letter,
.r4y-template--kb_single {
    --r4y-gutter: 60px;
    --r4y-kb-space: clamp(64px, 7vw, 104px);
    --r4y-kb-h2: clamp(32px, 3.4vw, 50px);
    --r4y-kb-header: 90px; /* height of the fixed header (header.css) */
    /* 60° cut: x : y = 1 : tan(60°), same values as the expertise pages */
    --r4y-kb-cut-x: 56px;
    --r4y-kb-cut-y: 97px;
    --r4y-kb-cut-tl: polygon(var(--r4y-kb-cut-x) 0, 100% 0, 100% 100%, 0 100%, 0 var(--r4y-kb-cut-y));
}
/* The brand mark and the slice run past the viewport edge on purpose. */
.r4y-template .r4y-kb {
    overflow-x: clip;
}

/* ── Shared type ──────────────────────────────────────────────────────── */
/* Eyebrow: a short gold rule + small caps (as .r4y-case-study__eyebrow). */
.r4y-template .r4y-kb .r4y-kb__eyebrow {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    font-family: var(--r4y-font-body);
    font-size: 13px;
    font-weight: var(--r4y-fw-semibold);
    line-height: 1.3;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--r4y-kit-secondary);
}
.r4y-template .r4y-kb__eyebrow::before {
    content: "";
    flex: 0 0 32px;
    height: 1px;
    background-color: currentColor;
}
.r4y-template .r4y-kb .r4y-kb__heading {
    font-family: var(--r4y-font-heading);
    font-size: var(--r4y-kb-h2);
    font-weight: var(--r4y-fw-light);
    line-height: 1.05;
    letter-spacing: -0.01em;
    color: var(--r4y-kit-primary);
    text-wrap: balance;
}
.r4y-template .r4y-brand-mark { display: block; width: 100%; height: auto; overflow: visible; }

/* ── Hero: crème band, brand mark right, the slice bottom right ───────── */
.r4y-template .r4y-kb-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 600px;
    padding: 200px var(--r4y-gutter) 120px; /* Elementor #6abdd67 */
    overflow: hidden; /* clips the slice and the mark */
    isolation: isolate;
    background-color: var(--r4y-kit-accent);
}
.r4y-template .r4y-kb-hero--article {
    min-height: 520px;
    padding-top: 170px;
    padding-bottom: 96px;
}
/* Optional photo (<img>, LCP), with the crème gradient from the left over it. */
.r4y-template .r4y-kb-hero__image {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.r4y-template .r4y-kb-hero--image::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: linear-gradient(90deg, #FFFAF7 30%, #FFFAF7CC 50%, #FBF8F600 85%);
}
/* The crown brand mark (live: Beeldmerk.svg, #7d781b5), large and gold on the right. */
.r4y-template .r4y-kb-hero__mark {
    position: absolute;
    top: 50%;
    right: max(var(--r4y-gutter), calc((100% - var(--r4y-container)) / 2));
    width: clamp(280px, 30vw, 460px);
    translate: 0 -46%;
    color: var(--r4y-kit-secondary);
    opacity: 0.6;
    pointer-events: none;
}
.r4y-template .r4y-kb-hero--image .r4y-kb-hero__mark { display: none; }
.r4y-template .r4y-kb-hero__inner {
    position: relative;
}
.r4y-template .r4y-kb-hero__inner > :not(.r4y-kb-hero__slice) {
    position: relative;
    z-index: 1;
}
.r4y-template .r4y-kb .r4y-kb-hero__title {
    max-width: 18ch;
    font-family: var(--r4y-font-heading);
    font-size: clamp(48px, 5.6vw, 80px);
    font-weight: var(--r4y-fw-light);
    line-height: 1;
    letter-spacing: -0.015em;
    color: var(--r4y-kit-primary);
    text-wrap: balance;
}
.r4y-template .r4y-kb .r4y-kb-hero--article .r4y-kb-hero__title {
    max-width: 22ch;
    font-size: clamp(36px, 4.4vw, 64px);
    line-height: 1.05;
}
.r4y-template .r4y-kb .r4y-kb-hero__lead {
    max-width: 60ch;
    margin-top: 28px;
    font-size: var(--r4y-fs-md);
    font-weight: var(--r4y-fw-light);
    line-height: 1.65;
    color: var(--r4y-kit-primary);
}
.r4y-template .r4y-kb .r4y-kb-hero__lead :is(strong, b) { font-weight: var(--r4y-fw-semibold); }
.r4y-template .r4y-kb .r4y-kb-hero__lead > * + * { margin-top: 1em; }

/* Back link: small caps, gold (as .r4y-case-study__back). */
.r4y-template .r4y-kb .r4y-kb-hero__back {
    margin-bottom: 18px;
    font-family: var(--r4y-font-body);
    font-size: 13px;
    font-weight: var(--r4y-fw-semibold);
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.r4y-template .r4y-kb-hero__back a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin-block: -14px;
    color: var(--r4y-kit-secondary);
    text-decoration: none;
    transition: color var(--r4y-transition);
}
.r4y-template .r4y-kb-hero__back a:hover,
.r4y-template .r4y-kb-hero__back a:focus-visible { color: var(--r4y-kit-primary); }
.r4y-template .r4y-kb-hero__back .r4y-icon {
    width: 1.1em;
    height: 1.1em;
    transition: transform var(--r4y-transition) var(--r4y-ease-out);
}
.r4y-template .r4y-kb-hero__back a:hover .r4y-icon { transform: translateX(-3px); }

/* Date · reading time (article hero and cards). */
.r4y-template .r4y-kb .r4y-kb-hero__meta,
.r4y-template .r4y-kb .r4y-kb-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    font-family: var(--r4y-font-body);
    font-size: 12px;
    font-weight: var(--r4y-fw-semibold);
    line-height: 1.3;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--r4y-color-muted);
}
.r4y-template .r4y-kb .r4y-kb-hero__meta {
    margin-top: 28px;
    font-size: 13px;
}
.r4y-template .r4y-kb-card__dot {
    width: 4px;
    height: 4px;
    background-color: var(--r4y-kit-secondary);
}

/* The slice: a 1000×500 white block in a wrapper rotated −60°, clipped by the hero. */
.r4y-template .r4y-kb-hero__slice {
    rotate: -60deg;
    pointer-events: none;
}
.r4y-template .r4y-kb-hero__slice > div {
    position: absolute;
    top: 33vw;
    right: -20vw;
    width: 1000px;
    height: 500px;
    background: var(--r4y-kit-white);
}

/* ── Card (loop-item 6387): crème, gold top rule, stretched title link ── */
.r4y-template .r4y-kb-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}
.r4y-template .r4y-kb-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 30px 30px 28px;
    border-top: 2px solid var(--r4y-kit-secondary);
    background-color: var(--r4y-kit-accent);
    transition: transform 0.4s var(--r4y-ease-out), box-shadow 0.4s var(--r4y-ease-out);
}
.r4y-template .r4y-kb-card:hover,
.r4y-template .r4y-kb-card:focus-within {
    box-shadow: 0 30px 60px -40px rgba(0, 37, 25, 0.5);
    transform: translateY(-4px);
}
.r4y-template .r4y-kb .r4y-kb-card__title {
    margin: 16px 0 12px;
    font-family: var(--r4y-font-heading);
    font-size: var(--r4y-fs-xl);
    font-weight: var(--r4y-fw-regular);
    line-height: 1.2;
    color: var(--r4y-kit-primary);
    text-wrap: balance;
}
.r4y-template a.r4y-kb-card__link {
    color: inherit;
    text-decoration: none;
    outline: none;
}
/* The whole card is clickable; the focus ring goes around the card. */
.r4y-template a.r4y-kb-card__link::after {
    content: "";
    position: absolute;
    inset: 0;
}
.r4y-template a.r4y-kb-card__link:focus-visible::after {
    outline: 2px solid var(--r4y-kit-secondary);
    outline-offset: 3px;
}
.r4y-template .r4y-kb .r4y-kb-card__excerpt {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    font-size: 15px;
    font-weight: var(--r4y-fw-light);
    line-height: 1.6;
    color: var(--r4y-color-text);
}
.r4y-template .r4y-kb .r4y-kb-card__more {
    margin-top: auto;
    padding-top: 24px;
    font-size: var(--r4y-fs-sm);
    font-weight: var(--r4y-fw-medium);
    color: var(--r4y-kit-primary);
}
.r4y-template .r4y-kb-card__more::after {
    content: " →" / "";
    display: inline-block;
    color: var(--r4y-kit-secondary);
    transition: transform var(--r4y-transition) var(--r4y-ease-out);
}
.r4y-template .r4y-kb-card:hover .r4y-kb-card__more::after { transform: translateX(4px); }

/* ── Widescreen ≥2400 ─────────────────────────────────────────────────── */
@media (min-width: 2400px) {
    .r4y-template .r4y-kb-hero__slice > div { top: 24vw; }
}

/* ── Laptop ≤1366 ─────────────────────────────────────────────────────── */
@media (max-width: 1366px) {
    .r4y-template .r4y-kb-hero {
        min-height: 480px;
        padding: 150px var(--r4y-gutter) 90px;
    }
    .r4y-template .r4y-kb-hero--article {
        min-height: 420px;
        padding-bottom: 72px;
    }
}

/* ── Tablet ≤1024 ─────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .r4y-template--kb_archive,
    .r4y-template--kb_letter,
    .r4y-template--kb_single { --r4y-gutter: 30px; }
    .r4y-template .r4y-kb-hero__mark { width: 260px; opacity: 0.35; }
    .r4y-template .r4y-kb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Mobile ≤767: the cut replaces the slice ──────────────────────────── */
@media (max-width: 767px) {
    .r4y-template--kb_archive,
    .r4y-template--kb_letter,
    .r4y-template--kb_single {
        --r4y-gutter: 15px;
        --r4y-kb-space: 56px;
        --r4y-kb-header: 84px; /* header.css: 84px row on mobile */
    }
    .r4y-template .r4y-kb-hero,
    .r4y-template .r4y-kb-hero--article {
        min-height: 0;
        padding: 120px var(--r4y-gutter) 72px; /* live: 120 / 60 */
        /* Same angle as the slice, as on the other overviews. */
        clip-path: polygon(0 0, 100% 0, 100% calc(100% - 104px), calc(100% - 60px) 100%, 0 100%);
    }
    .r4y-template .r4y-kb-hero__slice,
    .r4y-template .r4y-kb-hero__mark { display: none; }
    .r4y-template .r4y-kb .r4y-kb-hero__title { font-size: 44px; }
    .r4y-template .r4y-kb .r4y-kb-hero--article .r4y-kb-hero__title { font-size: 34px; }
    .r4y-template .r4y-kb .r4y-kb-hero__lead { font-size: var(--r4y-fs-base); }
    .r4y-template .r4y-kb-grid { grid-template-columns: minmax(0, 1fr); }
    .r4y-template .r4y-kb-card { padding: 26px 22px 24px; }
}

@media (prefers-reduced-motion: reduce) {
    .r4y-template .r4y-kb-card,
    .r4y-template .r4y-kb-card__more::after { transition: none; }
    .r4y-template .r4y-kb-card:hover,
    .r4y-template .r4y-kb-card:focus-within { transform: none; }
}
