/*
Theme Name: Stamlia Professional
Description: A high-end, clean health portal design. 95% Width, RTL, Mobile-ready.
Version: 1.4
*/

:root {
    --primary: #00695c;
    --primary-dark: #004d40;
    --primary-light: #00897b;
    --accent: #e65100;
    /* Darker orange for better contrast */
    --text-main: #2c3e50;
    --text-muted: #546e7a;
    --bg-body: #f8fafb;
    --card-bg: #ffffff;
    --border-color: #e3edf3;
    --white: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.08);
    --radius-md: 12px;
}

/* --- GLOBAL RESET --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    direction: rtl;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.7;
    text-align: right;
}

a {
    color: inherit;
    text-decoration: none;
    transition: 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 95%;
    /* Requested desktop improvement */
    margin: 0 auto;
    padding: 0 20px;
}

/* --- SITE HEADER --- */
.site-header {
    background: var(--white);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.header-top {
    padding: 15px 0;
}

.header-top-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-branding .logo-text a {
    font-size: 34px;
    font-weight: 900;
    color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.site-description {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: -5px;
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* SEARCH BOX */
.header-search .search-form {
    display: flex;
    align-items: center;
    background: #f1f5f7;
    border-radius: 30px;
    padding: 2px 15px;
    transition: 0.3s;
    border: 1px solid transparent;
}

.header-search .search-form:focus-within {
    background: var(--white);
    border-color: var(--primary-light);
}

.search-input {
    border: none;
    background: transparent;
    padding: 8px 10px;
    outline: none;
    font-family: inherit;
    width: 220px;
    font-size: 14px;
}

.search-submit {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: var(--primary);
}

/* NAVIGATION BAR */
.header-nav-bar {
    background: var(--primary) !important;
    color: var(--white) !important;
}

.main-menu-list {
    display: flex;
    gap: 0;
}

.main-menu-list>li>a {
    padding: 15px 25px;
    display: block;
    font-weight: 700;
    font-size: 16px;
    color: var(--white);
}

.main-menu-list>li {
    position: relative;
}

.main-menu-list .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--primary-dark);
    min-width: 220px;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
    z-index: 999;
}

.main-menu-list li:hover>.sub-menu {
    display: block;
}

.main-menu-list .sub-menu li a {
    padding: 12px 20px;
    color: var(--white);
    display: block;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
}

.main-menu-list .sub-menu li a:hover {
    background: var(--primary);
}

.main-menu-list>li:hover>a {
    background: var(--primary-dark);
}

/* --- MAIN LAYOUT --- */
.site-main {
    padding: 40px 0;
}

.main-layout-grid {
    display: grid;
    grid-template-columns: 69% 29%;
    gap: 1%;
}

.articles-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.article-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    display: flex;
    transition: 0.3s;
}

.article-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.article-thumb {
    width: 320px;
    flex-shrink: 0;
}

/* Requested IMPROVEMENT: Show Full Image */
.article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Shows literal full image without clipping */
    background: #f0f0f0;
}

.article-body {
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.article-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 12px;
}

.article-excerpt {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.btn-read-more {
    margin-top: auto;
    font-weight: 800;
    color: var(--primary);
}

/* --- SIDEBAR --- */
.sidebar-widget {
    background: var(--card-bg);
    padding: 25px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

.widget-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 20px;
    border-right: 4px solid var(--primary);
    padding-right: 12px;
}

/* SIDEBAR POPULAR POSTS WITH IMAGES */
.site-sidebar .popular-posts-list {
    padding: 0;
    margin: 0;
    list-style: none;
}

.site-sidebar .popular-posts-list li {
    display: flex !important;
    gap: 15px;
    margin-bottom: 18px;
    align-items: flex-start;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.site-sidebar .popular-posts-list li:last-child {
    border-bottom: none;
}

.pop-thumb {
    width: 80px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.pop-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pop-content {
    flex: 1;
}

.pop-content a {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    display: block;
    color: var(--text-main);
}

.sidebar-ad-box {
    width: 360px;
    height: 360px;
    background: #f1f5f7;
    border: 1px dashed #cfd8dc;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #90a4ae;
    font-size: 13px;
    overflow: hidden;
}

/* --- PAGINATION IMPROVEMENT --- */
.pagination-wrapper .page-numbers {
    display: flex;
    list-style: none;
    gap: 8px;
    justify-content: center;
}

.pagination-wrapper li {
    display: inline-block;
}

.pagination-wrapper .page-numbers a,
.pagination-wrapper .page-numbers span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 45px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-weight: 700;
    color: var(--text-main);
}

.pagination-wrapper .page-numbers span.current {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* --- MOBILE SPECIFIC FIXES --- */
@media (max-width: 1024px) {
    .main-layout-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-top-container {
        display: flex;
        flex-direction: row-reverse;
        justify-content: space-between;
        align-items: center;
        padding: 5px 0;
    }

    .site-branding {
        text-align: right;
    }

    .site-branding .logo-text a {
        font-size: 24px;
    }

    .menu-toggle {
        display: block;
        order: 1;
        background: none;
        border: none;
        cursor: pointer;
        padding: 10px;
    }

    .menu-toggle span {
        display: block;
        width: 25px;
        height: 3px;
        background: var(--primary);
        margin: 4px 0;
        border-radius: 2px;
    }

    .header-tools {
        order: 2;
        gap: 10px;
    }

    .header-search {
        display: none;
    }

    .header-nav-bar {
        display: none;
        background: var(--primary-dark);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }

    .article-card {
        flex-direction: column;
    }

    .article-thumb {
        width: 100%;
        height: 200px;
    }

    body.mobile-active .header-nav-bar {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        z-index: 1001;
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    }

    body.mobile-active .main-menu-list {
        flex-direction: column;
        padding: 10px 0;
    }

    body.mobile-active .main-menu-list>li>a {
        padding: 12px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
}

/* --- SITE FOOTER --- */
.site-footer {
    background: var(--primary);
    color: var(--white);
    padding: 30px 0;
    margin-top: 60px;
    text-align: center;
}

.footer-minimal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.footer-minimal-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
}

.footer-minimal-links li {
    display: flex;
    align-items: center;
}

.footer-minimal-links li:not(:last-child)::after {
    content: "|";
    margin: 0 15px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
}

.footer-minimal-links li a {
    color: var(--white);
    font-size: 15px;
    font-weight: 500;
    transition: 0.3s;
}

.footer-minimal-links li a:hover {
    color: var(--accent);
}

.footer-copyright p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 10px;
}

/* --- SINGLE ARTICLE PAGE --- */
.article-card-single {
    background: var(--card-bg);
    padding: 11px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 8px;
}

.post-title {
    font-size: 36px;
    font-weight: 900;
    line-height: 1.3;
    color: var(--text-main);
    margin: 20px 0;
}

.post-meta {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 30px;
    display: flex;
    gap: 15px;
    align-items: center;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-thumbnail {
    margin-bottom: 35px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.post-content {
    font-size: 18px;
    line-height: 1.9;
    color: var(--text-main);
}

.post-content h2,
.post-content h3 {
    margin: 40px 0 20px;
    color: var(--primary-dark);
}

.post-content p {
    margin-bottom: 25px;
}

.post-content ul,
.post-content ol {
    margin-bottom: 25px;
    padding-right: 25px;
}

.post-content li {
    margin-bottom: 10px;
}

/* --- BREADCRUMBS --- */
.post-breadcrumbs {
    margin-bottom: 25px;
    font-size: 13px;
    color: var(--text-muted);
}

.post-breadcrumbs a {
    color: var(--primary);
    font-weight: 600;
}

/* --- POST TAGS (LABELS) --- */
.post-tags-container {
    margin: 7px 0;
    padding: 7px;
    background: #fdfdfd;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.tags-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--primary-dark);
}

.post-tags-list {
    display: flex;
    flex-direction: row;
    /* Horizontal row */
    flex-wrap: wrap;
    gap: 12px;
    padding: 0;
    margin: 0;
}

.post-tags-list li {
    width: auto;
}

.post-tags-list li a {
    display: block;
    background: var(--white);
    color: var(--text-main);
    padding: 10px 25px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    transition: 0.3s;
}

.post-tags-list li a:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    transform: translateY(-3px);
}

/* --- AUTHOR BOX --- */
.author-box {
    margin: 7px 0;
    padding: 7px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.author-box-right {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex: 2;
    /* Take more space */
}

.author-avatar {
    width: 100px;
    height: 100px;
    flex: 0 0 100px;
    /* Force fixed width, no growing or shrinking */
    overflow: hidden;
    border-radius: 50%;
    border: 3px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    background: #f8f9fa;
}

.author-avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

.author-name {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.author-bio {
    font-size: 15px;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 20px;
    /* Removed max-width to let it expand */
}

.author-socials {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.author-socials a {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: var(--primary-dark);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    font-size: 20px;
    transition: 0.3s;
    text-decoration: none !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.author-socials a i,
.author-socials a svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    display: block;
}

.author-socials a:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
    transform: translateY(-3px);
}

.author-socials a.facebook:hover {
    background: #1877f2;
    border-color: #1877f2;
}

.author-socials a.twitter:hover {
    background: #000;
    border-color: #000;
}

.author-socials a.linkedin:hover {
    background: #0077b5;
    border-color: #0077b5;
}

.author-socials a.instagram:hover {
    background: #e1306c;
    border-color: #e1306c;
}

.author-box-left {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.author-more-link {
    display: inline-block;
    padding: 14px 28px;
    background: var(--white);
    color: var(--primary-dark);
    border-radius: 30px;
    font-size: 15px;
    font-weight: 700;
    border: 1px solid var(--primary-light);
    box-shadow: var(--shadow-sm);
    transition: 0.3s;
    white-space: nowrap;
}

.author-more-link:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* RESPONSIVE AUTHOR BOX */
@media (max-width: 768px) {
    .author-box {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .author-box-right {
        flex-direction: column;
        align-items: center;
    }

    .author-socials {
        justify-content: center;
    }

    .author-bio {
        max-width: 100%;
    }
}

/* --- RELATED POSTS SECTION --- */
.related-posts-section {
    margin-top: 40px;
}

.section-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 30px;
    border-right: 5px solid var(--primary);
    padding-right: 15px;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* Single horizontal row of 4 */
    gap: 20px;
}

.related-card {
    background: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: 0.3s;
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.related-thumb {
    height: 150px;
    /* Adjusted height for 4-column layout */
    overflow: hidden;
    position: relative;
}

.related-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
    transition: transform 0.5s ease;
}

.related-title {
    padding: 15px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* RESPONSIVE SINGLE */
@media (max-width: 768px) {
    .article-card-single {
        padding: 25px;
    }

    .post-title {
        font-size: 28px;
    }

    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 columns on mobile for better fit */
        gap: 15px;
    }

    .related-thumb {
        height: 140px;
    }
}

/* --- ACCESSIBILITY OVERRIDES (High Specificity) --- */
/* Target header navigation links specifically to prevent color overrides */
.header-nav-bar nav.main-navigation ul.main-menu-list li a {
    color: #ffffff !important;
    font-weight: 700 !important;
}

/* LuckyWP Table of Contents Overrides */
div.lwptoc_i {
    border-color: var(--border-color) !important;
    background-color: #f9f9f9 !important;
}

div.lwptoc_i .lwptoc_header {
    border-bottom: 2px solid var(--primary-light) !important;
}

div.lwptoc_i .lwptoc_toggle_label,
div.lwptoc_i a.lwptoc_toggle_label {
    color: var(--primary) !important;
    font-weight: 700 !important;
}

div.lwptoc_i .lwptoc_item_number {
    color: var(--primary-dark) !important;
    font-weight: 800 !important;
}

div.lwptoc_i .lwptoc_item_label {
    color: var(--text-main) !important;
}

div.lwptoc_i .lwptoc_item a:hover .lwptoc_item_label {
    color: var(--primary) !important;
}

/* Breadcrumbs Overrides (Rank Math) */
div.post-breadcrumbs nav.rank-math-breadcrumb p,
div.post-breadcrumbs nav.rank-math-breadcrumb p a {
    color: var(--primary-dark) !important;
    text-decoration: underline;
}

div.post-breadcrumbs nav.rank-math-breadcrumb p span.last-breadcrumb {
    color: var(--text-muted) !important;
    text-decoration: none;
}

/* Post Meta Contrast - Darker for readability */
.post-meta,
.post-meta span,
.post-meta span i {
    color: #37474f !important;
    /* Blue Grey 800 - Very high contrast */
}

.post-meta span i {
    color: var(--primary) !important;
}