/*
 * Shared editorial/catalog summary card used inside modern internal-page heroes.
 * The page shell owns placement; this component owns the card's internal visual.
 */

.editorial-summary-card {
    --editorial-summary-title: #17324a;
    --editorial-summary-text: #6b7f95;
    --editorial-summary-accent: #087b82;
    --editorial-summary-surface: rgb(255 255 255 / 72%);
    --editorial-summary-border: rgb(255 255 255 / 82%);
    --editorial-summary-stat-surface: rgb(244 251 253 / 82%);
    --editorial-summary-stat-border: rgb(255 255 255 / 68%);
    --editorial-summary-divider: rgb(39 91 123 / 13%);
    --editorial-summary-radius: 30px;
    --editorial-summary-icon-radius: 18px;
    --editorial-summary-shadow:
        0 28px 70px -34px rgb(22 68 99 / 34%),
        inset 0 1px 0 rgb(255 255 255 / 74%);

    position: relative;
    box-sizing: border-box;
    container-type: inline-size;
    justify-self: end;
    width: 100%;
    min-width: 0;
    padding: 1.45rem;
    overflow: hidden;
    color: var(--editorial-summary-title);
    background: rgb(255 255 255 / 94%);
    border: 1px solid var(--editorial-summary-border);
    border-radius: var(--editorial-summary-radius);
    box-shadow: var(--editorial-summary-shadow);
}

html:not(.a11y) .editorial-summary-card {
    background: rgb(255 255 255 / 94%);
    border-color: var(--editorial-summary-border);
    box-shadow: var(--editorial-summary-shadow);
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    html:not(.a11y) .editorial-summary-card {
        background: var(--editorial-summary-surface);
        backdrop-filter: blur(18px) saturate(120%);
        -webkit-backdrop-filter: blur(18px) saturate(120%);
    }
}

.editorial-summary-card__header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 0.85rem;
}

.editorial-summary-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: auto;
    aspect-ratio: 1;
    flex-shrink: 0;
    color: var(--editorial-summary-accent);
    background:
        linear-gradient(
            145deg,
            rgb(255 255 255 / 66%),
            rgb(222 245 251 / 46%)
        );
    border: 1px solid rgb(120 194 211 / 30%);
    border-radius: var(--editorial-summary-icon-radius);
    box-shadow:
        inset 0 1px 0 rgb(255 255 255 / 84%),
        0 16px 34px -24px rgb(8 123 130 / 42%);
}

.editorial-summary-card__icon svg,
.editorial-summary-card__divider-icon svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.editorial-summary-card__icon svg {
    width: 48%;
    height: 48%;
}

.editorial-summary-card__title,
.editorial-summary-card__fact-label,
.editorial-summary-card__fact-value {
    margin: 0;
}

.editorial-summary-card__title {
    max-width: 18ch;
    min-width: 0;
    color: var(--editorial-summary-title);
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.18;
    overflow-wrap: break-word;
    text-wrap: balance;
}

.editorial-summary-card__facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 1.15rem 0 0;
    padding: 0;
    overflow: hidden;
    background: var(--editorial-summary-stat-surface);
    border: 1px solid var(--editorial-summary-stat-border);
    border-radius: 18px;
    box-shadow:
        inset 0 1px 0 rgb(255 255 255 / 76%),
        0 20px 45px -34px rgb(22 68 99 / 30%);
    backdrop-filter: blur(14px) saturate(115%);
    -webkit-backdrop-filter: blur(14px) saturate(115%);
}

.editorial-summary-card__fact {
    position: relative;
    min-width: 0;
    padding: 0.72rem 0.55rem;
    text-align: center;
    background: transparent;
    box-shadow: none;
}

.editorial-summary-card__fact + .editorial-summary-card__fact {
    border-left: 1px solid var(--editorial-summary-divider);
}

.editorial-summary-card__fact-label {
    margin-bottom: 0.35rem;
    color: var(--editorial-summary-text);
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.25;
}

.editorial-summary-card__fact-value {
    color: var(--editorial-summary-accent);
    font-size: 1.65rem;
    font-weight: 760;
    line-height: 1.12;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.editorial-summary-card__divider {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.75rem;
    margin: 1.15rem 0;
    color: rgb(78 160 188 / 48%);
}

.editorial-summary-card__divider-line {
    height: 1px;
    background:
        linear-gradient(
            90deg,
            transparent,
            rgb(49 103 136 / 18%)
        );
}

.editorial-summary-card__divider-line:last-child {
    transform: scaleX(-1);
}

.editorial-summary-card__divider-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
}

.editorial-summary-card__divider-icon svg {
    width: 1rem;
    height: 1rem;
}

.editorial-summary-card__note {
    max-width: 48ch;
    margin: 0;
    color: var(--editorial-summary-text);
    font-size: 0.84rem;
    font-weight: 400;
    line-height: 1.55;
}

html.a11y .editorial-summary-card {
    --editorial-summary-accent: var(--color-text-primary);
    --editorial-summary-border: var(--color-border);
    --editorial-summary-divider: var(--color-border);
    --editorial-summary-stat-border: var(--color-border);
    --editorial-summary-stat-surface: var(--color-bg-card);
    --editorial-summary-surface: var(--color-bg-card);
    --editorial-summary-text: var(--color-text-body);
    --editorial-summary-title: var(--color-text-primary);
}

html.a11y .editorial-summary-card,
html.a11y .editorial-summary-card__facts {
    background: var(--color-bg-card) !important;
    border-color: var(--color-border) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

html.a11y .editorial-summary-card__header {
    display: block;
}

html.a11y .editorial-summary-card__icon {
    display: none !important;
}

html.a11y :is(
    .editorial-summary-card__title,
    .editorial-summary-card__fact-label,
    .editorial-summary-card__fact-value,
    .editorial-summary-card__note
) {
    color: var(--color-text-primary) !important;
}

html.a11y .editorial-summary-card__facts {
    grid-template-columns: minmax(0, 1fr);
}

html.a11y .editorial-summary-card__fact + .editorial-summary-card__fact {
    border-top: 1px solid var(--color-border);
    border-left: 0;
}

html.a11y .editorial-summary-card__divider {
    color: var(--color-text-primary) !important;
}

html.a11y .editorial-summary-card__divider-line {
    background: var(--color-border) !important;
}

html.a11y .editorial-summary-card__divider-icon {
    background: var(--color-bg-secondary) !important;
    color: var(--color-text-primary) !important;
    border: 2px solid var(--color-border);
    box-shadow: none !important;
}

@media (max-width: 1080px) {
    .editorial-summary-card {
        max-width: 620px;
        justify-self: start;
    }
}

@media (max-width: 720px) {
    .editorial-summary-card {
        justify-self: stretch;
        padding: 1.35rem;
        border-radius: var(--editorial-summary-radius);
    }

    .editorial-summary-card__facts {
        grid-template-columns: 1fr;
    }

    .editorial-summary-card__fact + .editorial-summary-card__fact {
        border-top: 1px solid var(--editorial-summary-divider);
        border-left: 0;
    }

    .editorial-summary-card__fact-value {
        font-size: clamp(1rem, 5.8cqi, 1.24rem);
    }

    .editorial-summary-card--compact-mobile {
        padding: 1rem 1.1rem;
    }

    .editorial-summary-card--compact-mobile .editorial-summary-card__header {
        gap: 0.75rem;
    }

    .editorial-summary-card--compact-mobile .editorial-summary-card__icon {
        width: 2.75rem;
        height: 2.75rem;
        border-radius: 0.9rem;
    }

    .editorial-summary-card--compact-mobile .editorial-summary-card__title {
        font-size: 1.05rem;
    }

    .editorial-summary-card--compact-mobile .editorial-summary-card__facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 0.75rem;
    }

    .editorial-summary-card--compact-mobile .editorial-summary-card__fact {
        padding: 0.55rem 0.45rem;
    }

    .editorial-summary-card--compact-mobile .editorial-summary-card__fact + .editorial-summary-card__fact {
        border-top: 0;
        border-left: 1px solid var(--editorial-summary-divider);
    }

    .editorial-summary-card--compact-mobile .editorial-summary-card__fact-value {
        font-size: 1.12rem;
    }

    .editorial-summary-card--compact-mobile .editorial-summary-card__divider {
        display: none;
    }

    .editorial-summary-card--compact-mobile .editorial-summary-card__note {
        margin-top: 0.7rem;
        font-size: 0.78rem;
        line-height: 1.4;
    }

    html.a11y .editorial-summary-card--compact-mobile .editorial-summary-card__facts {
        grid-template-columns: minmax(0, 1fr);
    }

    html.a11y .editorial-summary-card--compact-mobile .editorial-summary-card__fact + .editorial-summary-card__fact {
        border-top: 1px solid var(--editorial-summary-divider);
        border-left: 0;
    }
}
