/* 
 * MAIN CONTAINER & BLOCK STYLES 
 */
.remaining-section {
    width: 100%;
    margin: 40px 0;
}

.rem-category-block {
    padding-top: 20px;
    margin-bottom: 20px;
}

/* 
 * SECTION HEADERS (Title & "View All")
 */
.rem-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid #242424;
    padding-bottom: 10px;
}

body.dark .rem-category-header {
    border-bottom: 1px solid #F5F5F5;
}

.rem-cat-title-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rem-cat-icon {
    font-size: 28px;
    color: var(--brand-color, #E67E22);
}

.rem-cat-name {
    font-size: 32px;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
    padding: 5px 0;
}

body.dark .rem-cat-name {
    color: #f7fafc;
}

/* "View All" Link Styling */
.rem-cat-view-all {
    text-decoration: none;
    color: #e47200;
    font-weight: 600;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease;
}

.rem-cat-view-all:hover {
    transform: translateX(5px);
}

.rem-cat-arrow {
    font-size: 14px;
}

/* 
 * LAYOUT ENGINE: HERO & SIDEBAR 
 */
.rem-layout-wrapper {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 10px;
    align-items: flex-start;
    padding-bottom: 10px;
    border-bottom: 1px solid #2424;
}

body.dark .rem-layout-wrapper {
    border-bottom: 1px solid #2d3748;
}

/* 1. Hero Content Styles */
.rem-hero-card {
    text-decoration: none;
    color: inherit;
    display: block;
}

.rem-hero-img-container {
    width: 100%;
    height: auto;
    max-height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

body.dark .rem-hero-img-container {
    background: #1a202c;
}

.rem-hero-img {
    max-width: 100%;
    max-height: 400px;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.6s ease;
}

.rem-hero-card:hover .rem-hero-img {
    transform: scale(1.03);
}

/* Layout Reversed (Sidebar Left, Hero Right) */
.rem-layout-wrapper.layout-reversed {
    grid-template-columns: 1fr 1.6fr;
}

.layout-reversed .rem-hero-card {
    order: 2;
}

.layout-reversed .rem-side-list {
    order: 1;
    padding-right: 0;
}

.rem-hero-title {
    font-size: 28px;
    font-weight: 700;
    margin: 20px 0 10px;
    line-height: 1.3;
    padding: 8px 0;
    color: #2d3748;
    transition: color 0.3s ease;
}

body.dark .rem-hero-title {
    color: #edf2f7;
}

.rem-hero-card:hover .rem-hero-title {
    color: var(--brand-color, #E67E22);
}

.rem-hero-desc {
    font-size: 18px;
    color: #718096;
    line-height: 1.5;
    margin: 0;
}

/* 2. Scrollable Side List Styles */
.rem-side-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 500px;
    overflow-y: auto;
    padding: 0 10px;
    border-left: 1px solid #2424;
}

body.dark .rem-side-list {
    border-left: 1px solid #2d3748;
}

/* Custom Internal Scrollbar */
.rem-side-list::-webkit-scrollbar {
    width: 4px;
}

.rem-side-list::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.rem-side-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 10px;
}

.rem-side-item {
    display: flex;
    gap: 10px;
    padding: 10px 5px 10px 0px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #2424;
    transition: background 0.2s;
}

body.dark .rem-side-item {
    border-color: #2d3748;
}

.rem-side-item:last-child {
    border-bottom: none;
}

.rem-side-img-container {
    width: 100px;
    height: 70px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    overflow: hidden;
}

body.dark .rem-side-img-container {
    background: #1a202c;
}

.rem-side-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.rem-side-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.rem-side-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.6;
    color: #2d3748;
    margin: 0;
    padding-top: 5px;
    height: 3.2em;
    /* Constrain to 2 lines */
    overflow: hidden;
    display: block;
    transition: color 0.2s;
}

body.dark .rem-side-title {
    color: #cbd5e0;
}

.rem-side-item:hover .rem-side-title {
    color: var(--brand-color, #E67E22);
}

.rem-side-time {
    font-size: 13px;
    color: #a0aec0;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Side Content Reversed (Image Right, Title Left) */
.rem-side-item.side-reversed {
    flex-direction: row-reverse;
}

.side-reversed .rem-side-content {
    text-align: right;
}

.side-reversed .rem-side-time {
    justify-content: flex-end;
}

/* 
 * RESPONSIVE BREAKPOINTS 
 */
@media (max-width: 992px) {
    .rem-layout-wrapper {
        grid-template-columns: 1fr !important;
    }

    /* Reset layout-reversed for mobile: Hero on top, Sidebar below */
    .rem-layout-wrapper.layout-reversed .rem-hero-card {
        order: 1;
    }

    .rem-layout-wrapper.layout-reversed .rem-side-list {
        order: 2;
        padding-right: 0;
    }

    .rem-side-list {
        max-height: none;
        border-right: none;
        padding-right: 0;
    }

    /* Reset side-reversed for mobile: Image left, Title right */
    .rem-side-item.side-reversed {
        flex-direction: row !important;
    }

    .side-reversed .rem-side-content {
        text-align: left !important;
    }

    .side-reversed .rem-side-time {
        justify-content: flex-start !important;
    }

    /* Limit to 6 sub-news items on mobile (1 Hero + 6 Sub = 7 total) */
    .rem-side-item:nth-of-type(n+7) {
        display: none;
    }
}