/* =========================================================
   CATEGORY VIEW
   ========================================================= */

/* Layout */
.el-content {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 54px;
    padding: 20px 0 60px;
}

.rsview .el-content {
    grid-template-columns: minmax(0, 1fr) 300px;
}


/* =========================================================
   CATEGORY SIDEBAR
   ========================================================= */

.el-side-left {
    position: sticky;
    top: var(--el-side-left-sticky-top, 110px);
    align-self: start;
    height: max-content;
}

.el-side-box {
    padding: 0;
    background: transparent;
    border: 0;
}

/*
 * Desktop:
 * The same configurable module title is shown as the sidebar heading.
 * On mobile this becomes the category toggle.
 */
.el-side-title {
    display: block;
    width: 100%;
    margin: 0 0 8px;
    padding: 0 0 10px;
    border: 0;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: .08em;
    text-align: left;
    text-transform: uppercase;
}

.el-side-links {
    display: block;
}

.el-side-left a {
    display: block;
    position: relative;
    padding: 10px 14px;
    color: var(--muted-color);
    font: 16px var(--font-heading);
    transition:
        background-color 0.18s ease,
        color 0.18s ease,
        padding-left 0.18s ease;
}

.el-side-left a:hover,
.el-side-left a:focus {
    padding-left: 18px;
    background: color-mix(
        in srgb,
        var(--theme-color) 5%,
        var(--surface-color)
    );
    color: var(--theme-color);
}

.el-side-left a.el-active {
    position: relative;
    margin-left: 0;
    padding: 10px 14px 10px 11px;
    background: color-mix(
        in srgb,
        var(--theme-color) 9%,
        var(--surface-color)
    );
    border-left: 3px solid var(--theme-color);
    color: var(--theme-color);
    font-weight: 700;
}

.el-side-left a.el-active::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -12px;
    width: 0;
    height: 0;
    transform: translateY(-50%);
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 12px solid color-mix(
        in srgb,
        var(--theme-color) 9%,
        var(--surface-color)
    );
}

/* =========================================================
   CATEGORY HEADING
   ========================================================= */

.el-featured {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.el-featured h1 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: var(--h1-size);
    font-weight: var(--h1-weight);
}


/* =========================================================
   ARTICLE GRID — compact editorial listing
   ========================================================= */

.el-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 34px;
}


/* =========================================================
   ARTICLE CARD
   One semantic link wraps the complete card.
   ========================================================= */

.el-grid .card {
    min-width: 0;
    overflow: hidden;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 7px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .04);
}

.el-grid .el-card-link {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    align-items: center;
    min-height: 118px;
    color: inherit;
    text-decoration: none;
}

.el-grid .card:hover,
.el-grid .card:focus-within {
    border-color: color-mix(
        in srgb,
        var(--theme-color) 22%,
        var(--border-color)
    );
    box-shadow: 0 6px 18px rgba(0, 0, 0, .07);
}


.el-grid .el-card-img {
    display: block;
    width: 120px;
    aspect-ratio: 4 / 3;
    margin-left: 14px;
    overflow: hidden;
    border-radius: 4px;
    background: color-mix(
        in srgb,
        var(--border-color) 35%,
        var(--surface-color)
    );
}

.el-grid .el-card-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.el-grid .el-card-body {
    min-width: 0;
    padding: 14px 16px 14px 30px;
}

.el-grid .card h3 {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.32;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.el-grid .el-card-link:hover h3,
.el-grid .el-card-link:focus-visible h3 {
    color: var(--theme-color);
}

.el-grid .el-card-link:focus-visible {
    outline: 2px solid color-mix(
        in srgb,
        var(--theme-color) 42%,
        transparent
    );
    outline-offset: -2px;
}

.el-grid .card p {
    margin: 8px 0 0;
    color: var(--muted-color);
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1.45;
}

.el-grid .card .el-read {
    color: var(--theme-color);
    font-weight: 600;
    white-space: nowrap;
}


/* =========================================================
   DIVIDER BANNER
   Full grid row after every four rendered articles.
   ========================================================= */

.el-grid .el-divider {
    grid-column: 1 / -1;
    width: 70%;
    max-width: 70%;
    margin: 18px auto 8px;
    padding: 4px;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .16);
}

.el-grid .el-divider img,
.el-grid .el-divider video,
.el-grid .el-divider iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}


/* =========================================================
   LOAD MORE
   ========================================================= */

.el-content .el-load {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.el-content #el-load-more {
    min-width: 150px;
}

.el-content #el-load-more .el-spin {
    align-items: center;
    gap: 8px;
}


/* =========================================================
   TABLET / MOBILE
   ========================================================= */

@media (max-width: 800px) {

    .el-content,
    .rsview .el-content {
        grid-template-columns: minmax(0, 1fr);
        gap: 25px;
    }

    .el-side-left {
        position: static;
        top: auto;
        height: auto;
    }

    .el-side-box {
        padding: 17px;
        background: var(--surface-color);
        border: 1px solid var(--border-color);
    }

    /* Mobile category toggle */
    .el-side-title {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        margin: 0;
        padding: 0;
        border: 0;
        background: transparent;
        color: var(--muted-color);
        font-family: var(--font-body);
        font-size: 10px;
        font-weight: 700;
        line-height: 1.4;
        letter-spacing: .14em;
        text-align: left;
        text-transform: uppercase;
        cursor: pointer;
    }

    .el-side-title::after {
        content: "＋";
        flex: 0 0 auto;
        margin-left: 16px;
        font-size: 16px;
        font-weight: 400;
        line-height: 1;
    }

    .el-side-title:focus-visible {
        outline: 3px solid color-mix(
            in srgb,
            var(--theme-color) 32%,
            transparent
        );
        outline-offset: 4px;
    }

    .el-side-links {
        display: none;
        padding-top: 16px;
    }

    .el-side-box.el-open .el-side-links {
        display: block;
    }

    .el-side-box.el-open .el-side-title::after {
        content: "−";
    }

    .el-side-left a.el-active::after {
        display: none;
    }

    .el-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px;
    }

    .el-grid .el-card-link {
        grid-template-columns: 105px minmax(0, 1fr);
        min-height: 104px;
    }

    .el-grid .el-card-img {
        width: 105px;
        margin-left: 12px;
    }

    .el-grid .el-card-body {
        padding: 12px 12px 12px 14px;
    }

    .el-grid .card h3 {
        font-size: 15px;
    }

    .el-grid .el-divider {
        width: 82%;
        max-width: 82%;
    }
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 620px) {

    .el-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }


    .el-grid .el-divider {
        width: 100%;
        max-width: 100%;
        margin-top: 10px;
        margin-bottom: 2px;
    }

    /* Keep the compact horizontal news-card treatment on phones. */
    .el-grid .el-card-link {
        grid-template-columns: 104px minmax(0, 1fr);
        min-height: 102px;
    }

    .el-grid .el-card-img {
        width: 104px;
        height: auto;
        aspect-ratio: 4 / 3;
        margin-left: 11px;
    }

    .el-grid .el-card-body {
        padding: 11px 12px 11px 13px;
    }

    .el-grid .card h3 {
        font-size: 14px;
        line-height: 1.3;
    }

    .el-grid .card p {
        font-size: 12px;
    }

    .el-content .el-load {
        display: flex;
        justify-content: center;
        margin-top: 30px;
    }

    .el-content #el-load-more {
        min-width: 150px;
    }
}
