/*
Theme Name: LebNews Premium (V2)
Theme URI: https://lebnews.org
Author: Mohamad
Description: Advanced Arabic News Aggregator Theme with Sidebar, Hero sections, and Premium UI.
Version: 2.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: lebnews
*/

:root {
    --primary-color: #e60000;
    --secondary-color: #2c3e50;
    --bg-color: #f4f7f6;
    --text-color: #2b2b2b;
    --border-color: #e9ecef;
    --link-color: #e60000;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    direction: rtl;
    text-align: right;
    line-height: 1.7;
}

a {
    color: var(--link-color);
    text-decoration: none;
    transition: 0.2s;
}

a:hover {
    color: var(--secondary-color);
}

img {
    max-width: 100%;
    height: auto;
}

/* ======== TOP BAR ======== */
.top-bar {
    background: var(--secondary-color);
    color: #fff;
    font-size: 13px;
}

.top-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
}

.top-bar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 15px;
}

.top-bar-nav a {
    color: #cfd8dc;
}

.top-bar-nav a:hover {
    color: #fff;
}

.top-bar-social a {
    color: #fff;
    margin-right: 12px;
    font-size: 14px;
}

.top-bar-social a:hover {
    color: var(--primary-color);
}

/* ======== HEADER ======== */
.site-header {
    background: var(--white);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    max-width: 1250px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-branding {
    display: flex;
    align-items: center;
    background: transparent;
}

.site-branding .custom-logo-link img {
    max-height: 80px;
    /* Reduced from 95 to fit naturally */
    width: auto;
    object-fit: contain;
    /* Removed the problematic scale and mix-blend-mode */
}

/* Mobile Menu Elements (Hidden on Desktop) */
.mobile-menu-checkbox {
    display: none;
}

.mobile-menu-button {
    display: none;
    font-size: 24px;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 10px;
}

/* Navigation */
.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
}

.main-navigation a {
    color: var(--secondary-color);
    font-weight: 700;
    font-size: 16px;
    padding: 10px 0;
    display: block;
    position: relative;
}

.main-navigation a:after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 3px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.main-navigation a:hover:after {
    width: 100%;
}

/* Search form */
.header-search form {
    display: flex;
    position: relative;
}

.search-field {
    padding: 8px 35px 8px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    width: 220px;
    outline: none;
    transition: 0.3s;
    font-family: 'Cairo';
}

.search-field:focus {
    border-color: var(--primary-color);
}

.search-submit {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
}

/* ======== LAYOUT ======== */
.container {
    max-width: 1250px;
    margin: 40px auto;
    padding: 0 20px;
}

.main-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
}

.section-heading {
    font-size: 24px;
    color: var(--secondary-color);
    margin: 0 0 20px 0;
    position: relative;
    font-weight: 800;
    padding-bottom: 10px;
}

.heading-line {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 4px;
    background: var(--primary-color);
}

/* ======== HERO POST ======== */
.hero-section {
    margin-bottom: 40px;
}

.hero-post {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    height: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.hero-post img,
.hero-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-placeholder {
    background: var(--secondary-color);
    color: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0) 100%);
    padding: 40px 30px 30px;
    color: #fff;
}

.hero-title {
    margin: 10px 0;
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    line-height: 1.4;
}

.hero-meta {
    color: #cfd8dc;
    font-size: 14px;
}

.cat-label,
.cat-abs-label {
    background: var(--primary-color);
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
}

/* ======== GRID ======== */
.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.article-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
    transition: 0.3s;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.card-thumb-wrapper {
    position: relative;
    padding-top: 60%;
}

.card-thumb-wrapper img,
.thumb-placeholder {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-placeholder {
    background: #e2e8f0;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
}

.cat-abs-label {
    position: absolute;
    top: 15px;
    right: 15px;
}

.article-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.article-title {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.5;
}

.article-title a {
    color: var(--secondary-color);
}

.article-title a:hover {
    color: var(--primary-color);
}

.article-meta {
    font-size: 13px;
    color: #888;
    margin-bottom: 15px;
}

.article-excerpt {
    font-size: 14px;
    color: #555;
}

/* ======== SIDEBAR ======== */
.widget {
    background: var(--white);
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
    margin-bottom: 30px;
}

.widget-title {
    font-size: 18px;
    color: var(--secondary-color);
    margin: 0 0 20px;
    position: relative;
    padding-bottom: 10px;
    font-weight: 800;
    border-bottom: 1px solid var(--border-color);
}

.widget-title .title-line {
    position: absolute;
    bottom: -1px;
    right: 0;
    width: 40px;
    height: 3px;
    background: var(--primary-color);
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget_recent_entries li {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed var(--border-color);
}

.widget_recent_entries li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.widget-thumb {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
}

.widget-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fallback-thumb {
    background: #e2e8f0;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.widget-post-info a {
    font-weight: 700;
    font-size: 14px;
    color: var(--secondary-color);
    line-height: 1.4;
    display: block;
    margin-bottom: 5px;
}

.widget-post-info a:hover {
    color: var(--primary-color);
}

.widget-date {
    font-size: 12px;
    color: #888;
}

.widget_categories li {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.widget_categories a {
    color: var(--text-color);
    font-weight: 600;
    display: block;
}

.widget_categories a:hover {
    color: var(--primary-color);
    padding-right: 5px;
}

/* ======== SINGLE POST ======== */
.single-post-container {
    background: var(--white);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.03);
}

.single-post-title {
    font-size: 36px;
    color: var(--secondary-color);
    font-weight: 800;
    margin: 15px 0 20px;
    line-height: 1.4;
}

.meta-sep {
    margin: 0 10px;
    color: #ccc;
}

.single-featured-image {
    margin: 0 -40px 30px;
}

.single-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.single-post-content {
    font-size: 18px;
    line-height: 1.9;
    color: #444;
}

.single-post-content p {
    margin-bottom: 25px;
}

/* Share Buttons */
.social-share {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.share-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    color: #fff !important;
    font-weight: bold;
    margin-left: 10px;
    margin-bottom: 10px;
}

.share-btn.fb {
    background: #3b5998;
}

.share-btn.tw {
    background: #1da1f2;
}

.share-btn.wa {
    background: #25d366;
}

.share-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* ======== RESPONSIVE ======== */
@media (max-width: 992px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .grid-2col {
        grid-template-columns: 1fr;
    }

    .top-bar {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 15px 20px;
        align-items: center;
        justify-content: space-between;
    }

    .site-branding {
        flex-shrink: 0;
    }

    .site-branding .custom-logo-link img {
        transform-origin: center right;
        max-height: 55px;
    }

    .main-navigation {
        position: static;
        order: 2;
    }

    .mobile-menu-button {
        display: block;
        padding: 8px 12px;
        border: 1px solid var(--border-color);
        border-radius: 4px;
        background: var(--white);
    }

    .nav-menu-wrapper {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
        padding: 0 20px 20px;
        z-index: 1000;
        border-top: 3px solid var(--primary-color);
    }

    .mobile-menu-checkbox:checked~.nav-menu-wrapper {
        display: block;
    }

    .main-navigation ul {
        flex-direction: column;
        gap: 0;
    }

    .main-navigation a {
        padding: 15px 10px;
        border-bottom: 1px solid #f1f5f9;
        font-size: 16px;
        text-align: right;
    }

    .main-navigation a:after {
        display: none;
    }

    .header-search {
        width: 100%;
        order: 3;
        margin-top: 15px;
    }

    .search-field {
        width: 100%;
    }

    .search-form {
        width: 100%;
        display: block;
    }
}

.main-layout {
    gap: 20px;
}

.single-post-container {
    padding: 25px;
}

.single-featured-image {
    margin: 0 -25px 25px;
}

.hero-title {
    font-size: 22px;
}

.hero-post {
    height: 300px;
}

.single-post-title {
    font-size: 26px;
}
}