/* Jaring – Editorial sectie
 * Mas Girbau responsive composition: desktop story alongside portrait; on narrower
 * viewports full-width copy followed by two staggered photographs side by side.
 * Scoped to this Elementor widget; site typography is inherited.
 */
.jaring-editorial,
.jaring-editorial * { box-sizing: border-box; }

.jaring-editorial {
    --jbw-editorial-image-radius: 15px;
    --jbw-editorial-intro-gap: clamp(32px, 3.8vw, 66px);
    --jbw-editorial-photo-gap: clamp(32px, 4.1vw, 72px);
    --jbw-editorial-collage-start: clamp(38px, 5.8vw, 54px);
    --jbw-editorial-collage-stagger: clamp(72px, 11vw, 106px);
    width: 100%;
    min-width: 0;
    padding: clamp(32px, 3.4vw, 70px) clamp(24px, 4.5vw, 94px) clamp(44px, 4.5vw, 82px);
    color: inherit;
    background: transparent;
}
.jaring-editorial--viewport { min-height: 100vh; min-height: 100svh; }

.jaring-editorial__inner {
    width: 100%;
    max-width: 1640px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.16fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
    column-gap: clamp(28px, 3.1vw, 66px);
    align-items: start;
}
/* Both wrappers are semantic only: grid placement is shared by the children. */
.jaring-editorial__content,
.jaring-editorial__intro { display: contents; }

.jaring-editorial__eyebrow {
    grid-column: 1;
    grid-row: 1;
    margin: 0 0 clamp(18px, 2vw, 38px);
    font-size: clamp(10px, .76vw, 13px);
    font-weight: 600;
    letter-spacing: .24em;
    line-height: 1.35;
    text-transform: uppercase;
}
.jaring-editorial__title {
    display: block;
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 0;
    color: inherit;
    overflow-wrap: break-word;
}
.jaring-editorial__title em,
.jaring-editorial__title i { font-weight: inherit; }
.jaring-editorial__description {
    grid-column: 1;
    grid-row: 3;
    min-width: 0;
    max-width: 57ch;
    margin: var(--jbw-editorial-intro-gap) 0 0;
    color: inherit;
    overflow-wrap: break-word;
}
.jaring-editorial__description > :first-child { margin-top: 0; }
.jaring-editorial__description > :last-child { margin-bottom: 0; }

/* Desktop: the small photo sits at the right edge of the text column. */
.jaring-editorial .jaring-editorial__small {
    grid-column: 1;
    grid-row: 4;
    align-self: start;
    justify-self: end;
    width: min(40%, 300px);
    min-width: 0;
    margin: var(--jbw-editorial-photo-gap) 0 0;
    padding: 0;
}
.jaring-editorial__small-frame {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: var(--jbw-editorial-image-radius, 15px);
    overflow: hidden;
}
.jaring-editorial .jaring-editorial__small-image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    border-radius: inherit;
}
.jaring-editorial__caption {
    margin: clamp(14px, 1.5vw, 25px) 0 0;
    font-family: inherit;
    font-size: clamp(12px, .86vw, 16px);
    line-height: 1.5;
    color: inherit;
    overflow-wrap: anywhere;
}
.jaring-editorial .jaring-editorial__large {
    position: relative;
    display: block;
    grid-column: 2;
    grid-row: 3 / 5;
    align-self: start;
    justify-self: end;
    width: 100%;
    min-width: 0;
    min-height: 0;
    aspect-ratio: 3 / 4;
    margin: var(--jbw-editorial-intro-gap) 0 0;
    padding: 0;
    border-radius: var(--jbw-editorial-image-radius, 15px);
    overflow: hidden;
}
.jaring-editorial .jaring-editorial__large-image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    border-radius: inherit;
}

/* Short desktop viewports still keep both images in their own column. */
@media (min-width: 1025px) and (max-height: 680px) {
    .jaring-editorial__eyebrow { margin-bottom: 14px; }
    .jaring-editorial { --jbw-editorial-intro-gap: 28px; --jbw-editorial-photo-gap: 30px; }
    .jaring-editorial .jaring-editorial__large { width: min(100%, 62svh); }
}

/* Tablet / narrow laptop: intro spans full width. Two photographs stay side by
 * side; the smaller one starts lower, as in the Mas Girbau reference. */
@media (max-width: 1024px) {
    .jaring-editorial {
        --jbw-editorial-intro-gap: clamp(22px, 3.4vw, 36px);
        padding: clamp(30px, 5vw, 56px) clamp(22px, 5vw, 52px) clamp(48px, 6vw, 75px);
    }
    .jaring-editorial--viewport { min-height: 0; }
    .jaring-editorial__inner {
        grid-template-columns: minmax(0, .74fr) minmax(0, 1fr);
        grid-template-rows: auto auto auto auto;
        column-gap: clamp(20px, 2.7vw, 26px);
    }
    .jaring-editorial__eyebrow {
        grid-column: 1 / -1;
        grid-row: 1;
        margin-bottom: 20px;
    }
    .jaring-editorial__title {
        grid-column: 1 / -1;
        grid-row: 2;
        max-width: 24ch;
    }
    .jaring-editorial__description {
        grid-column: 1 / -1;
        grid-row: 3;
        max-width: 76ch;
    }
    .jaring-editorial .jaring-editorial__small {
        grid-column: 1;
        grid-row: 4;
        justify-self: start;
        width: min(67%, 280px);
        margin: calc(var(--jbw-editorial-collage-start) + var(--jbw-editorial-collage-stagger)) 0 0;
    }
    .jaring-editorial .jaring-editorial__large {
        grid-column: 2;
        grid-row: 4;
        justify-self: stretch;
        width: 100%;
        margin: var(--jbw-editorial-collage-start) 0 0;
    }
}

/* Phone: still TWO staggered photographs in the same row, not a stacked
 * column. Proportions vary with the viewport without creating overflow. */
@media (max-width: 767px) {
    .jaring-editorial {
        --jbw-editorial-intro-gap: clamp(26px, 6.5vw, 34px);
        --jbw-editorial-collage-start: clamp(32px, 9.5vw, 48px);
        --jbw-editorial-collage-stagger: clamp(56px, 20vw, 100px);
        padding: clamp(22px, 5.5vw, 35px) clamp(16px, 4vw, 24px) 48px;
    }
    .jaring-editorial__inner {
        display: grid;
        grid-template-columns: minmax(0, .93fr) minmax(0, 1fr);
        column-gap: clamp(12px, 4.8vw, 24px);
        align-items: start;
    }
    .jaring-editorial__eyebrow { margin-bottom: clamp(16px, 4vw, 22px); letter-spacing: .18em; }
    .jaring-editorial__title { max-width: none; }
    .jaring-editorial__description { max-width: none; }
    .jaring-editorial .jaring-editorial__small {
        grid-column: 1;
        grid-row: 4;
        justify-self: stretch;
        width: 100%;
        margin: calc(var(--jbw-editorial-collage-start) + var(--jbw-editorial-collage-stagger)) 0 0;
    }
    .jaring-editorial .jaring-editorial__large {
        grid-column: 2;
        grid-row: 4;
        justify-self: stretch;
        width: 100%;
        /* The reference keeps the dominant photo tall as the viewport narrows,
         * rather than shortening it in lockstep with its width. */
        height: clamp(470px, 67svh, 680px);
        margin: var(--jbw-editorial-collage-start) 0 0;
    }
    .jaring-editorial__caption { margin-top: 12px; font-size: clamp(12px, 3.1vw, 14px); }
}

/* If one image is intentionally hidden on phones, use a full-width image
 * row instead of leaving half the grid empty. Desktop and tablet unchanged. */
@media (max-width: 767px) {
    .jaring-editorial--mobile-large .jaring-editorial__small { display: none; }
    .jaring-editorial--mobile-small .jaring-editorial__large { display: none; }
    .jaring-editorial--mobile-large .jaring-editorial__large,
    .jaring-editorial--mobile-small .jaring-editorial__small {
        grid-column: 1 / -1;
        grid-row: 4;
        justify-self: center;
        width: min(100%, 520px);
        margin-top: var(--jbw-editorial-collage-start);
    }
}
