.font-custom1 {
    font-family: inherit;
}
.news-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}
.category-main-wrapper {
    width: 100%;
    min-height: 100vh;
    margin-top: 100.59px; /* Add space to avoid logo overlap */
}

@media (min-width: 1024px) {
    .category-main-wrapper {
        margin-top: 108px;
    }
}

.custom_height {
    min-height: calc(100vh - 108px);
}

.category-header {
    margin-top: 33px;
    
    height: 100px;
    padding-left: 32px;
    padding-right: 32px;
    border-top: 0.5px solid black;
    border-bottom: 0.5px solid black;
    background: white;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.category-title {
    font-size: 44px;
    font-weight: 700;
    line-height: 40px;
    letter-spacing: -2.96px;
    color: black;
    margin: 0;
    text-transform: uppercase;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 14.65px;
}

.sort-controls-desktop {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sort-controls-mobile {
    display: none;
}

.sort-label {
    color: #666;
    font-weight: normal;
    letter-spacing: -0.08px;
}

.sort-link {
    color: black;
    text-decoration: none;
    font-weight: 400;
    line-height: 25px;
    letter-spacing: 0.08px;
    cursor: pointer;
    text-transform: uppercase;
}

.sort-link.selected {
    font-weight: 600;
}

.sort-link:hover {
    text-decoration: underline;
}

.sort-dropdown {
    padding: 8px 12px;
    border: 0;
    background: white;
    font-size: 14.65px;
    color: black;
    text-transform: uppercase;
    font-family: inherit;
}

.sort-dropdown:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* Masonry Grid */
.news-grid {
    columns: 4;
    column-gap: 20px;
    column-fill: balance;
}

.news-item {
    display: inline-block;
    width: 100%;
    margin-bottom: 20px;
    break-inside: avoid;
    page-break-inside: avoid;
    background: #fff;
    border-radius: 0;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.news-grid .news-item-description { display: none; }

.news-item:hover {
    transform: translateY(-2px);
}

.news-item-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.news-item-link:hover {
    text-decoration: none;
    color: inherit;
}

.news-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}


.news-date {
    font-size: 0.85rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: -4px;
    font-weight: 500;
    
}

.news-title-item {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    color: #000;
}

.news-excerpt {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    margin-top: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .news-grid {
        columns: 3;
    }
}

@media (max-width: 900px) {
    .news-grid {
        columns: 2;
        column-gap: 15px;
    }
    
    .news-item {
        margin-bottom: 15px;
    }
    
    .news-title {
        font-size: 2rem;
    }
    
    .news-header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .news-controls {
        width: 100%;
        justify-content: flex-end;
    }
}

@media (max-width: 600px) {
    
    .news-image {
    width: 80%;
    display: block;
    margin: 0 auto;
}
    
    .news-grid {
        columns: 1;
    }
    
    .news-container {
        padding: 0 15px;
    }
    
    .news-header {
        padding: 40px 0 30px;
    }
    
    .news-title {
        font-size: 1.8rem;
    }
    
    .news-controls {
        justify-content: stretch;
    }
    
    .sort-dropdown {
        flex: 1;
    }
}

/* Pagination */
.pagination-wrapper {
    margin-top: 60px;
    padding: 40px 0;
    text-align: center;
    border-top: 1px solid #e5e5e5;
}

.pagination {
    display: inline-flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 5px;
}

.pagination li {
    margin: 0;
}

.pagination a,
.pagination span {
    display: block;
    padding: 10px 15px;
    text-decoration: none;
    color: #666;
    border: 1px solid #e5e5e5;
    font-size: 0.9rem;
}

.pagination a:hover {
    background: #f5f5f5;
    color: #000;
}

.pagination .current span {
    background: #000;
    color: #fff;
    border-color: #000;
}

.pagination .disabled span {
    color: #ccc;
    cursor: not-allowed;
}

/* Loading placeholder for empty state */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #999;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 10px;
}

/* Arabic text direction support */
.ar .news-content {
    text-align: right;
    direction: rtl;
}

.ar .news-header-content {
    direction: rtl;
}

.ar .news-controls {
    justify-content: flex-start;
}

.ar .sort-label {
    margin-right: 0;
    margin-left: 10px;
}

/* View Toggle Controls */
.view-toggle {
    display: flex;
    margin-right: 20px;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
}

.view-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: #666;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-btn:hover {
    background: #f5f5f5;
    color: #000;
}

.view-btn.active {
    background: #00375f;
    color: #fff;
}

.view-btn + .view-btn {
    border-left: 1px solid #ccc;
}

/* List View Styles */
.news-grid.list-view {
    columns: 1;
    display: block;
}

.news-grid.list-view .news-item-description {
    display: block;
    margin: 0;
    padding: 0;
    text-align: justify;
}

.news-grid.list-view a{
    width: 100%;
}

.news-grid.list-view .news-item {
    display: flex;
    width: 80%;
    margin: 30px auto;
    border: 1px solid #e5e5e5;
    border-radius: 0;
    overflow: hidden;
    break-inside: auto;
    background: #fff;
}

.news-grid.list-view .news-date {
    margin: 25px;
}

.news-grid.list-view .news-item:hover {
    transform: none;
    border-color: #ccc;
}

.news-grid.list-view .news-image {
    width: 300px;
    object-fit: cover;
    flex-shrink: 0;
    margin: 6px;
    border-radius: 6px;
}

.news-grid.list-view .news-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-grid.list-view .news-title-item {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.news-grid.list-view .news-excerpt {
    -webkit-line-clamp: 4;
    margin-top: 15px;
    font-size: 1rem;
}

/* Responsive for list view */
@media (max-width: 768px) {
    .view-toggle {
        margin-right: 15px;
    }
    
    .news-grid.list-view .news-item {
        flex-direction: column;
    }
    
    .news-grid.list-view .news-image {
        width: 95%;
    }
    
    .news-grid.list-view .news-content {
        padding: 20px;
    }
}

@media (max-width: 600px) {
    .view-toggle {
        margin-right: 10px;
        margin-bottom: 10px;
    }
    
    .news-controls {
        flex-wrap: wrap;
    }

.news-grid.list-view .news-date {
 float: none !important;
}

}