/**
 * Zamseed Legacy Split Widget Styles
 *
 * "Our Legacy Today": a half-width image panel with a bottom-anchored caption,
 * beside a list of legacy points. About page, position 8.
 *
 * @package Zamseed
 * @since 1.0.0
 */

.zs-legacy-split {
    --zs-legacy-panel-order: 0;
    --zs-legacy-panel-radius: 28px;
    --zs-legacy-focal-x: 50%;
    --zs-legacy-focal-y: 50%;
    --zs-legacy-overlay-start: rgba(0, 0, 0, 0.08);
    --zs-legacy-overlay-end: rgba(0, 0, 0, 0.68);
    display: grid;
    /* Driven by the column_ratio control through the variable, never by a
       grid-template-columns rule of its own. The mobile stack below declares
       the property directly, so it still wins over whatever ratio the panel
       sets for desktop and the single column survives. */
    grid-template-columns: var(--zs-legacy-columns, 1fr 1fr);
    align-items: stretch;
    width: 100%;
    background: linear-gradient(180deg, var(--zs-warm, #fdfcf9) 0%, #f1ede5 100%);
}

/* ==========================================================================
   Image panel
   ========================================================================== */

.zs-legacy-split__panel {
    position: relative;
    order: var(--zs-legacy-panel-order);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 530px;
    padding: 72px;
    overflow: hidden;
    isolation: isolate;
    /* Only the inner corners are rounded: the panel runs to the section edge on
       its outer side, which is what makes it read as a panel rather than a card. */
    border-radius: 0 var(--zs-legacy-panel-radius) var(--zs-legacy-panel-radius) 0;
    background-color: var(--zs-dark-green, #0f2418);
}

.zs-legacy-split[style*="--zs-legacy-panel-order: 2"] .zs-legacy-split__panel,
.zs-legacy-split__panel--right {
    border-radius: var(--zs-legacy-panel-radius) 0 0 var(--zs-legacy-panel-radius);
}

/* Qualified with the panel class and the element.
   Elementor ships `.elementor img { height: auto; max-width: 100% }` at (0,1,1);
   a single-class rule here is (0,1,0) and loses, which leaves the photograph at
   its intrinsic ratio and exposes the panel background beneath it. */
.zs-legacy-split__panel img.zs-legacy-split__image {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--zs-legacy-focal-x) var(--zs-legacy-focal-y);
}

.zs-legacy-split__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        var(--zs-legacy-overlay-start) 0%,
        var(--zs-legacy-overlay-end) 100%
    );
}

.zs-legacy-split__badge {
    position: absolute;
    top: 28px;
    left: 28px;
    z-index: 3;
    padding: 8px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    font-family: var(--zs-font-sans, 'Inter', sans-serif);
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--zs-primary, #2d5a27);
}

.zs-legacy-split__panel--badge-top-right .zs-legacy-split__badge {
    left: auto;
    right: 28px;
}

.zs-legacy-split__panel-content {
    position: relative;
    z-index: 2;
    color: #ffffff;
}

.zs-legacy-split__eyebrow {
    display: inline-block;
    margin-bottom: 14px;
    font-family: var(--zs-font-sans, 'Inter', sans-serif);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--zs-gold, #f3c98a);
}

.zs-legacy-split__heading {
    margin: 0 0 16px;
    font-family: var(--zs-font-serif, 'Cormorant Garamond', serif);
    font-size: clamp(2.25rem, 4.4vw, 4rem);
    font-weight: 700;
    line-height: 1;
    color: inherit;
}

.zs-legacy-split__description {
    max-width: 46ch;
    margin: 0;
    font-family: var(--zs-font-sans, 'Inter', sans-serif);
    font-size: 1.125rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.86);
}

/* ==========================================================================
   Legacy points
   ========================================================================== */

.zs-legacy-split__list {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    max-width: 560px;
    margin: 0;
    padding: 60px 120px 60px 60px;
    list-style: none;
}

.zs-legacy-split__item {
    margin: 0;
    padding: 25px;
    border: 1px solid rgba(45, 90, 39, 0.10);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.68);
    box-shadow: 0 14px 34px rgba(15, 36, 24, 0.06);
}

.zs-legacy-split__item-inner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    text-decoration: none;
    color: inherit;
}

a.zs-legacy-split__item-inner:focus-visible {
    outline: 3px solid var(--zs-accent, #c48c33);
    outline-offset: 4px;
}

.zs-legacy-split__item-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    color: var(--zs-primary, #2d5a27);
}

.zs-legacy-split__item-icon svg,
.zs-legacy-split__item-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    fill: currentColor;
}

.zs-legacy-split__item-text {
    /* Wraps naturally. white-space: nowrap here would clip every point that is
       longer than its card, which is most of them at tablet width. */
    font-family: var(--zs-font-sans, 'Inter', sans-serif);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--zs-text, #1c1c1c);
}

.zs-legacy-split__list--empty {
    justify-content: center;
    text-align: center;
}

.zs-legacy-split__empty-message {
    margin: 0;
    font-family: var(--zs-font-sans, 'Inter', sans-serif);
    font-size: 1.0625rem;
    color: var(--zs-text, #1c1c1c);
}

.zs-legacy-split__empty-hint {
    margin: 16px 0 0;
    padding-top: 16px;
    border-top: 1px dashed var(--zs-accent, #c48c33);
    font-family: var(--zs-font-sans, 'Inter', sans-serif);
    font-size: 0.8125rem;
    color: var(--zs-accent-text, #9a6c1f);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1023px) {
    .zs-legacy-split__panel {
        min-height: 460px;
        padding: 48px;
    }

    .zs-legacy-split__list {
        padding: 48px 40px 48px 40px;
    }

    .zs-legacy-split__item {
        padding: 20px;
    }
}

@media (max-width: 767px) {
    .zs-legacy-split {
        grid-template-columns: 1fr;
    }

    /* Panel first, list second, whichever side it takes on desktop. */
    .zs-legacy-split__panel {
        order: 0;
        min-height: 440px;
        padding: 32px 20px;
        /* Full-bleed on mobile has no outer edge to run to, so every corner
           rounds. */
        border-radius: var(--zs-legacy-panel-radius);
        margin: 20px;
    }

    .zs-legacy-split__list {
        order: 1;
        max-width: none;
        padding: 24px;
    }

    .zs-legacy-split__badge {
        top: 20px;
        left: 20px;
    }

    .zs-legacy-split__panel--badge-top-right .zs-legacy-split__badge {
        right: 20px;
    }
}
