/* 
   Articles System - Professional RTL Theme
   Matches Vendoratravel Design Language
*/

:root {
    --site-blue: #0053c2;
    --site-dark-blue: #24a4f5;
    --site-bg: #f8fafc;
    --site-card: #ffffff;
    --site-border: rgba(0, 0, 0, 0.08);
    --site-radius: 12px;
    --site-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body.articles-body {
    background: var(--site-bg);
    color: #333;
    font-family: 'Tajawal', sans-serif;
    padding-top: 100px; 
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Controls --- */
.articles-controls {
    max-width: 1200px;
    margin: 20px auto 50px;
    padding: 0 20px;
}

.search-container {
    max-width: 600px;
    margin: 0 auto 30px;
}

.search-box {
    display: flex;
    background: #fff;
    border: 2px solid var(--site-border);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--site-blue);
    box-shadow: 0 0 15px rgba(0, 83, 194, 0.1);
}

.search-box input {
    flex: 1;
    border: none;
    padding: 15px 20px;
    outline: none;
    font-size: 1rem;
    font-family: inherit;
}

.search-box button {
    background: var(--site-blue);
    color: #fff;
    border: none;
    padding: 0 35px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s;
}

.search-box button:hover {
    background: var(--site-dark-blue);
}

.category-chips {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.chip {
    padding: 10px 25px;
    background: #fff;
    border: 1px solid var(--site-border);
    border-radius: 50px;
    color: #555;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.chip:hover, .chip.active {
    background: var(--site-blue);
    color: #fff;
    border-color: var(--site-blue);
}

/* --- Layout --- */
.articles-layout {
    flex: 1 0 auto; /* This ensures the layout takes up available space and pushes footer down */
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 80px;
    display: grid;
    grid-template-columns: 1fr 350px; 
    gap: 40px;
    width: 100%;
}

footer.global-footer {
    flex-shrink: 0;
    margin-top: auto !important; /* Forces footer to the bottom */
}

/* --- Featured Card --- */
.featured-card {
    background: #fff;
    border-radius: var(--site-radius);
    border: 1px solid var(--site-border);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr 1fr;
    box-shadow: var(--site-shadow);
    margin-bottom: 50px;
    position: relative;
}

.featured-img {
    height: 420px;
}

.featured-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-body {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cat-label {
    display: inline-block;
    color: var(--site-blue);
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.featured-body h2 {
    font-size: 2.2rem;
    color: var(--site-blue);
    margin-bottom: 20px;
    line-height: 1.3;
}

.featured-body p {
    color: #666;
    line-height: 1.7;
    margin-bottom: 30px;
}

.btn-read-more {
    display: inline-block;
    padding: 14px 35px;
    background: var(--site-blue);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    width: fit-content;
    transition: all 0.3s;
}

.btn-read-more:hover {
    background: var(--site-dark-blue);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 83, 194, 0.2);
}

/* --- Articles Grid --- */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.article-card {
    background: #fff;
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius);
    overflow: hidden;
    transition: all 0.4s;
    display: flex;
    flex-direction: column;
    position: relative;
}

.article-card:hover {
    transform: translateY(-8px);
    border-color: var(--site-blue);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}

.card-img {
    height: 240px;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-body {
    padding: 25px;
    flex: 1;
}

.card-body h3 {
    font-size: 1.3rem;
    color: var(--site-blue);
    margin-bottom: 12px;
    font-weight: 700;
}

.card-body h3 a {
    color: inherit;
    text-decoration: none;
}

.card-body p {
    color: #777;
    font-size: 0.95rem;
    line-height: 1.6;
}

.card-footer {
    padding: 18px 25px;
    border-top: 1px solid var(--site-border);
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #999;
}

.card-footer i {
    color: var(--site-blue);
    margin-left: 5px;
}

/* --- Sidebar --- */
.sidebar-widget {
    background: #fff;
    border: 1px solid var(--site-border);
    border-radius: var(--site-radius);
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--site-shadow);
}

.widget-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--site-blue);
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--site-blue);
    display: inline-block;
}

.sidebar-latest-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--site-border);
    position: relative;
}

.sidebar-latest-item:last-child {
    border: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.sidebar-latest-item img {
    width: 80px;
    height: 65px;
    border-radius: 8px;
    object-fit: cover;
}

.sidebar-latest-item .info a {
    color: #333;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.4;
    display: block;
    margin-bottom: 5px;
}

.sidebar-latest-item .info a:hover {
    color: var(--site-blue);
}

.sidebar-latest-item .info small {
    color: #999;
    font-size: 0.8rem;
}

.sidebar-cat-list {
    list-style: none;
}

.sidebar-cat-list li {
    margin-bottom: 12px;
}

.sidebar-cat-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #fdfdfd;
    border: 1px solid var(--site-border);
    border-radius: 8px;
    color: #555;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.sidebar-cat-list li a:hover {
    background: var(--site-blue);
    color: #fff;
    border-color: var(--site-blue);
}

.sidebar-cat-list .badge {
    background: rgba(0, 83, 194, 0.1);
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.8rem;
}

.sidebar-cat-list li a:hover .badge {
    background: rgba(255, 255, 255, 0.2);
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 50px;
}

.pagination a {
    padding: 10px 20px;
    background: #fff;
    border: 1px solid var(--site-border);
    color: var(--site-blue);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    transition: all 0.3s;
}

.pagination a.active, .pagination a:hover {
    background: var(--site-blue);
    color: #fff;
    border-color: var(--site-blue);
}

/* --- Responsive --- */
@media (max-width: 1200px) {
    .articles-layout { grid-template-columns: 1fr; }
    .featured-card { grid-template-columns: 1fr; }
    .featured-img { height: 300px; }
}

@media (max-width: 768px) {
    .articles-grid { grid-template-columns: 1fr; }
    .articles-hero h1 { font-size: 2.2rem; }
    .featured-body { padding: 25px; }
}

/* --- Utility --- */
.stretched-link::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    content: "";
}
