/* Post Main Container */
.post-main{background-color:#fff}

/* Post Header */
.post-header{background:linear-gradient(135deg,#fffaf2 0%,#fff0e1 100%);padding:2rem 0 3rem;border-bottom:1px solid rgba(173,82,7,.08)}
.post-category{display:inline-flex;align-items:center;padding:.5rem 1.25rem;background-color:rgba(173,82,7,.1);color:#ad5207;border-radius:50px;text-decoration:none;font-size:.8125rem;font-weight:700;text-transform:uppercase;letter-spacing:.5px;margin-top:10px;margin-bottom:.5rem;transition:all .2s ease}
.post-category:hover{background-color:#ad5207;color:#fff}
.post-heading{font-size:clamp(1.75rem,5vw,2.75rem);color:#1F2937;font-weight:800;line-height:1.2;margin:0 0 1.5rem;letter-spacing:-.02em}

/* Post Meta Header */
.post-meta-header{display:flex;justify-content:space-between;align-items:flex-start;gap:1.5rem;flex-wrap:wrap;padding-top:1.5rem;border-top:1px solid rgba(173,82,7,.1)}
.author-info{display:flex;align-items:center;gap:1rem}
.author-avatar{width:56px;height:56px;background:linear-gradient(135deg,#ad5207,#e88e07);border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff;font-size:1.5rem;flex-shrink:0}
.author-details{display:flex;flex-direction:column;gap:.375rem}
.author-name{font-weight:700;color:#1F2937;font-size:1rem}

/* NEW: Styling for the Author Link in the Post Header/Hero Section */
.author-name .author-link-profile {
    /* Inherit the color and font weight from the parent .author-name */
    color: inherit; 
    font-weight: inherit;
    font-size: 1rem;
    
    /* Remove the default link underline for a cleaner look */
    text-decoration: none; 
    
    /* Add a subtle, text-color-matched underline */
    border-bottom: 2px solid rgba(31, 41, 55, 0.15); /* #1F2937 with 15% opacity */
    padding-bottom: 2px;
    
    /* Smooth transition for hover effects */
    transition: all 0.2s ease;
}

.author-name .author-link-profile:hover {
    /* Change text color to the primary accent color on hover */
    color: #ad5207; 
    
    /* Change the underline color to the primary accent color */
    border-bottom: 2px solid #ad5207; 
}

.post-metadata{display:flex;align-items:center;gap:1rem;flex-wrap:wrap;font-size:.8125rem;color:#6B7280}
.post-metadata span{display:flex;align-items:center;gap:.375rem}
.post-metadata i{color:#ad5207}

/* Social Share Buttons */
.social-share{display:flex;gap:.5rem}
.share-btn{width:40px;height:40px;display:flex;align-items:center;justify-content:center;background-color:#fff;border:1px solid #e5e7eb;border-radius:50%;color:#6B7280;cursor:pointer;transition:all .2s ease;padding:0;font-size:.875rem}
.share-btn:hover{background-color:#ad5207;border-color:#ad5207;color:#fff;transform:translateY(-2px)}
.share-btn i{font-size:.875rem}

/* Featured Image */
.featured-image-wrapper{background-color:#fff;padding:2rem 0}
.featured-image{max-width:900px;margin:0 auto;border-radius:16px;overflow:hidden;box-shadow:0 8px 24px rgba(0,0,0,.08)}
.featured-image img{width:100%;height:auto;aspect-ratio:16/9;object-fit:cover;display:block}

/* Post Body */
.post-body{padding:3rem 0;background-color:#fff}
.post-content-grid{display:flex;flex-direction:column;max-width:1100px;margin:0 auto;gap:2rem}

/* Author Sidebar */
/* ... (author sidebar styles remain unchanged) ... */
.author-sidebar-wrapper{background-color:#fffaf2;border:1px solid rgba(173,82,7,.1);border-radius:8px;padding:1.5rem;line-height:1.4;color:#374151;order:-1}
.author-sidebar-wrapper .author-header{display:flex;align-items:center;gap:1rem;margin-bottom:1rem;border-bottom:1px solid rgba(173,82,7,.1);padding-bottom:1rem}
.author-sidebar-wrapper img{width:50px;height:50px;border-radius:50%;object-fit:cover;flex-shrink:0}
.author-sidebar-wrapper h4{margin:0;font-size:1rem;font-weight:700;color:#ad5207}
.author-sidebar-wrapper .author-title{font-size:.9rem;color:#6B7280;font-weight:500;margin:0}
.author-sidebar-wrapper .author-bio-text{font-size:.9375rem;margin:0 0 1rem}
.author-sidebar-wrapper .read-more-link{color:#ad5207;font-size:.9375rem;font-weight:600;text-decoration:underline;text-underline-offset:3px;transition:color .2s ease}
.author-sidebar-wrapper .read-more-link:hover{color:#e88e07}

/* Newsletter Sidebar */
/* ... (newsletter sidebar styles remain unchanged) ... */
.newsletter-sidebar-box{
    background-color:#e88e07;
    color:#fff;
    padding:1.5rem;
    border-radius:8px;
    box-shadow:0 4px 12px rgba(0,0,0,.1);
    margin-top:2rem;
    /* Removed opacity/visibility transition to rely purely on display for breakpoints */
    text-align:center;
    /* NEW: Hide by default on mobile/tablet */
    display: none; 
}
.newsletter-sidebar-box h4{color:#fff;font-size:1.2rem;margin-top:0;margin-bottom:.75rem}
.newsletter-sidebar-box p{font-size:.9rem;margin-bottom:1rem;line-height:1.4}
.newsletter-sidebar-box input[type="email"]{width:100%;padding:.75rem;border:none;border-radius:6px;margin-bottom:.5rem;box-sizing:border-box}
.newsletter-sidebar-box .btn-primary{width:100%;background-color:#ad5207;border-radius:6px}
.newsletter-sidebar-box .btn-primary:hover{background-color:#92450a}

/* Author Footer Box */
/* ... (author footer styles remain unchanged) ... */
.author-content-footer-box{
    margin-top:2rem;
    padding:2rem;
    background-color:#fffaf2;
    border:1px solid rgba(173,82,7,.1);
    border-radius:12px;
    box-shadow:0 2px 8px rgba(0,0,0,.05);
    max-width:780px;
    order: 2; /* Ensures it is placed after post-content-wrapper (order: 1) on mobile/tablet */
}
.author-content-footer-box .author-header{padding-bottom:1.5rem;margin-bottom:1.5rem;display:flex;align-items:center;gap:1rem;border-bottom:1px solid rgba(173,82,7,.1)}
.author-content-footer-box .author-header img{width:64px;height:64px;border-radius:50%;object-fit:cover;flex-shrink:0;border:2px solid #e5e7eb}
.author-content-footer-box .author-header h4{margin:0 0 .125rem;font-size:1.125rem;font-weight:700;color:#ad5207;line-height:1.3}
.author-content-footer-box .author-header p{margin:0;font-size:.875rem;color:#6B7280;font-weight:500;line-height:1.3}
.author-content-footer-box .author-header>div{display:flex;flex-direction:column}
.author-content-footer-box .author-bio-full{font-size:1rem;line-height:1.7;color:#374151;margin:0 0 1.5rem}
.author-content-footer-box .read-more-link{display:inline-flex;align-items:center;gap:.5rem;color:#ad5207;font-weight:600;font-size:1rem;text-decoration:none;transition:color .2s ease;text-decoration:underline;text-underline-offset:3px}
.author-content-footer-box .read-more-link:hover{color:#e88e07}

/* Post Content */
.post-content-wrapper{margin:0;font-size:1rem;line-height:1.6;color:#374151;order:1}
.post-content-wrapper>*{margin-bottom:1.5rem}
.post-content-wrapper h2{font-size:1.65rem;font-weight:700;color:#1F2937;margin-top:3rem;margin-bottom:1rem;padding-top:1rem;border-top:2px solid #f3f4f6}
.post-content-wrapper h3{font-size:1.35rem;font-weight:700;color:#1F2937;margin-top:2.5rem;margin-bottom:1rem}
.post-content-wrapper h4{font-size:1.15rem;font-weight:700;color:#374151;margin-top:2rem;margin-bottom:.75rem}
.post-content-wrapper p{margin-bottom:1.5rem;line-height:1.6}
.post-content-wrapper ul,.post-content-wrapper ol{margin:1.5rem 0;padding-left:1.75rem}
.post-content-wrapper li{margin-bottom:.75rem;line-height:1.7}
.post-content-wrapper blockquote{margin:2.5rem 0;padding:1.5rem 1.5rem 1.5rem 2rem;border-left:4px solid #ad5207;background-color:#fffaf2;font-style:italic;color:#4B5563;border-radius:0 8px 8px 0;}
.post-content-wrapper blockquote p{margin:0}
.post-content-wrapper a{color:#ad5207;text-decoration:underline;text-decoration-color:rgba(173,82,7,.3);text-underline-offset:2px;transition:all .2s ease}
.post-content-wrapper a:hover{text-decoration-color:#ad5207;color:#92450a}
.post-content-wrapper strong{font-weight:700;color:#1F2937}
.post-content-wrapper code{background-color:#f3f4f6;padding:.25rem .5rem;border-radius:4px;font-family:'Courier New',monospace;font-size:.9em;color:#e88e07}
.post-content-wrapper pre{background-color:#1F2937;color:#e5e7eb;padding:1.5rem;border-radius:8px;overflow-x:auto;margin:2rem 0}
.post-content-wrapper pre code{background:none;padding:0;color:inherit}
.post-content-wrapper img,.inline-post-image{width:100%;max-width:100%;height:auto;border-radius:12px;margin:2.5rem auto;display:block;box-shadow:0 4px 16px rgba(0,0,0,.08)}

/* Tables */
/* Tables - Default styling for all tables */
.post-content-wrapper table {
    width: 100%;
    border-collapse: collapse;
    margin: 2.5rem 0;
    background-color: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: .9375rem;
    table-layout: auto; /* Allow natural column sizing */
}

/* Responsive table class - Applied automatically by TinyMCE */
.post-content-wrapper table.responsive-table {
    display: block;
    overflow-x: auto; /* Enable horizontal scroll when content is too wide */
    overflow-y: visible; /* Remove vertical scroll limit - content flows naturally */
    width: 100%; /* Occupy full width of post-content-wrapper */
    max-width: 100%; /* Prevent overflow */
    border-radius: 8px;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* CRITICAL FIX: Force the actual table element to fill container width */
.post-content-wrapper table.responsive-table > * {
    display: table;
    width: 100% !important; /* Force full width */
    min-width: 100%; /* Ensure minimum full width */
}

.post-content-wrapper table th,
.post-content-wrapper table td {
    padding: 1rem 1.25rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #e5e7eb;
    white-space: normal; /* Allow text wrapping in cells */
    word-wrap: break-word; /* Break long words if needed */
}

.post-content-wrapper table tr:last-child td{border-bottom:none}
.post-content-wrapper table th{background-color:#f9fafb;font-weight:700;color:#1F2937}
.post-content-wrapper table tbody tr:hover{background-color:#fffaf2}

/* --- CONSOLIDATED ARABIC STYLES (FRONTEND) --- */
/* Base Arabic font stack used by the .arabic-text class applied via TinyMCE */
.arabic-font-stack {
    font-family: 'Amiri', 'Scheherazade New', 'Traditional Arabic', serif;
}

/* 1. Table Arabic Names - Note: Tables may not receive the .arabic-text class easily */
.arabic-name {
    /* Apply the font stack directly to ensure compliance in tables */
    font-family: 'Amiri', 'Scheherazade New', 'Traditional Arabic', serif; 
    font-size: 1.6em; 
    direction: rtl; 
    text-align: right;
    font-weight: bold;
    color: #004d40; 
}

/* 2. Arabic Text in Content (Blocks, Quotes, Regular Text) */
.post-content-wrapper .arabic-text {
    direction:rtl;
    text-align:right;
    font-size:1.25rem; 
    line-height:2;
    /* Apply the font stack */
    font-family:'Amiri','Scheherazade','Traditional Arabic',serif; 
    color:#1F2937;
    padding:1rem 0;
}
/* Note: Simplified selector by removing .arabic-block/blockquote specific selectors, 
   relying on TinyMCE to apply the single .arabic-text class. */


/* NEW FIX: Target BOLD/STRONG Arabic text inside any Arabic block/quote */
.post-content-wrapper .arabic-text strong,
.post-content-wrapper .arabic-text b {
    font-size: 1.5rem; /* Larger size for bold Arabic words/phrases */
    color: #ad5207; /* Optional: Give bold Arabic a primary color accent */
    font-weight: 700;
}
/* --- END CONSOLIDATED ARABIC STYLES --- */

/* Post Footer */
/* ... (rest of the footer and responsive styles remain unchanged) ... */
.post-footer{max-width:780px;margin:4rem auto 0;padding-top:3rem;border-top:2px solid #f3f4f6}
.post-tags{display:flex;flex-wrap:wrap;gap:.75rem;margin-bottom:2.5rem}
.post-tags .tag{display:inline-flex;align-items:center;padding:.5rem 1.25rem;background-color:#fffaf2;border:1px solid rgba(173,82,7,.2);border-radius:50px;color:#ad5207;text-decoration:none;font-size:.875rem;font-weight:600;transition:all .2s ease}
.post-tags .tag:hover{background-color:#ad5207;border-color:#ad5207;color:#fff}
.share-prompt{background:linear-gradient(135deg,#fffaf2 0%,#fff0e1 100%);padding:2rem;border-radius:12px;text-align:center}
.share-prompt p{font-size:1.125rem;font-weight:600;color:#1F2937;margin:0 0 1.25rem}
.share-prompt .social-share{justify-content:center}
.share-prompt .share-btn{width:auto;height:auto;padding:.75rem 1.5rem;border-radius:50px;gap:.5rem;font-weight:600}

/* Comments Section */
.comments-section{background-color:#f9fafb;padding:4rem 0;border-top:1px solid #e5e7eb}
.section-title{font-size:2rem;font-weight:800;color:#1F2937;margin:0 0 2.5rem;text-align:center}
.comment-count{color:#6B7280;font-weight:600;font-size:1.5rem}

/* Alerts */
.alert{padding:1rem 1.25rem;border-radius:8px;margin-bottom:2rem;display:flex;align-items:center;gap:.75rem;font-weight:500}
.alert i{font-size:1.25rem}
.alert-success{background-color:#d1fae5;color:#065f46;border:1px solid #6ee7b7}
.alert-error{background-color:#fee2e2;color:#991b1b;border:1px solid #fca5a5}

/* Comment Form */
.comment-form-card{background-color:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:2rem;margin-bottom:3rem}
.comment-form-card h3{font-size:1.5rem;font-weight:700;color:#1F2937;margin:0 0 1.5rem}
.comment-form .form-row{display:grid;grid-template-columns:1fr;gap:1rem;margin-bottom:1rem}
.comment-form .form-group{margin-bottom:1rem}
.comment-form .form-label{display:block;font-weight:600;color:#374151;margin-bottom:.5rem;font-size:.9375rem}
.comment-form .form-input{width:100%;padding:.875rem 1rem;border:1px solid #e5e7eb;border-radius:8px;font-size:1rem;transition:all .2s ease;font-family:inherit}
.comment-form .form-input:focus{outline:none;border-color:#ad5207;box-shadow:0 0 0 3px rgba(173,82,7,.1)}
.comment-form textarea.form-input{resize:vertical;min-height:120px}
.submit-comment{display:inline-flex;align-items:center;gap:.5rem;padding:.875rem 2rem;font-size:1rem;margin-top:.5rem}

/* Comments List */
.comments-list{max-width:900px;margin:0 auto}
.comment-item{display:flex;gap:1.25rem;padding:1.75rem 0;border-bottom:1px solid #e5e7eb}
.comment-item:last-child{border-bottom:none}
.comment-avatar{flex-shrink:0;width:48px;height:48px;background:linear-gradient(135deg,#e5e7eb,#d1d5db);border-radius:50%;display:flex;align-items:center;justify-content:center;color:#6B7280;font-size:1.75rem}
.comment-content{flex:1;min-width:0}
.comment-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:.75rem;gap:1rem;flex-wrap:wrap}
.comment-author{font-weight:700;color:#1F2937;font-size:1rem}
.comment-date{font-size:.8125rem;color:#9CA3AF;display:flex;align-items:center;gap:.375rem}
.comment-body p{color:#374151;line-height:1.7;margin:0}
.no-comments{text-align:center;padding:3rem 2rem;background-color:#fff;border:1px solid #e5e7eb;border-radius:12px}
.no-comments i{font-size:3rem;color:#D1D5DB;margin-bottom:1rem}
.no-comments p{color:#6B7280;margin:0}

/* Related Posts */
.related-section{background-color:#fff;padding:4rem 0;border-top:1px solid #e5e7eb}
.related-grid{display:grid;grid-template-columns:1fr;gap:2rem;margin-top:2rem}
.related-card{background-color:#fff;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden;transition:all .3s ease}
.related-card:hover{transform:translateY(-4px);box-shadow:0 12px 24px rgba(0,0,0,.08)}
.related-image{display:block;overflow:hidden;aspect-ratio:16/9;background-color:#f3f4f6}
.related-image img{width:100%;height:100%;object-fit:cover;transition:transform .4s ease}
.related-card:hover .related-image img{transform:scale(1.06)}
.related-content{padding:1.5rem}
.related-content h3{font-size:1.25rem;font-weight:700;margin:0 0 .75rem}
.related-content h3 a{color:#1F2937;text-decoration:none;transition:color .2s ease}
.related-content h3 a:hover{color:#ad5207}
.related-content p{color:#6B7280;font-size:.9375rem;line-height:1.6;margin:0 0 1.25rem;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.related-content .read-more{display:inline-flex;align-items:center;gap:.5rem;color:#ad5207;font-weight:600;font-size:.9375rem;text-decoration:none;transition:gap .2s ease}
.related-content .read-more:hover{gap:.75rem}

/* Tablet (768px+) */
@media (min-width:768px){
.post-header{padding:3rem 0 4rem}
.post-heading{font-size:clamp(2rem,5vw,3rem)}
.author-avatar{width:64px;height:64px;font-size:1.75rem}
.featured-image-wrapper{padding:3rem 0}
.post-body{padding:4rem 0}
.comment-form .form-row{grid-template-columns:repeat(2,1fr)}
.related-grid{grid-template-columns:repeat(2,1fr);gap:2rem}
}

/* HIDE sidebar and newsletter on mobile/tablet (max-width: 1023px) */
@media (max-width: 1023px) {
    .author-sidebar-wrapper,
    .newsletter-sidebar-box {
        display: none !important; /* Forces these elements to hide and remove all space on mobile/tablet */
    }
}

/* Desktop (1024px+) */
@media (min-width:1024px){
.post-content-grid{display:grid;grid-template-columns:280px 1fr;gap:3rem;max-width:1280px;margin:0 auto;padding:0 1.5rem}

.author-sidebar-wrapper{
    /* RE-ENABLE DISPLAY for desktop. No need for explicit 'display: block;' if it's already defined above and grid-column/row is used. */
    height:fit-content;
    max-height:none;
    grid-column:1;
    grid-row:1;
}

.newsletter-sidebar-box{
    /* RE-ENABLE DISPLAY for desktop. Use display: block to override the mobile-first display: none. */
    display: block; 
    grid-column:1;
    grid-row:2;
}

.post-content-wrapper{font-size:1.0625rem;grid-column:2;grid-row:1;max-width:100%}
.post-content-wrapper>*:not(.author-content-footer-box){max-width:780px}
.author-content-footer-box{
    grid-column:2;
    grid-row:2;
    margin-left:0;
    max-width:780px;
    width:100%;
    order: unset; 
}
.post-footer{max-width:1280px;margin-left:auto;margin-right:auto;padding-left:1.5rem;padding-right:1.5rem}
.related-grid{grid-template-columns:repeat(3,1fr)}
}

/* Print Styles */
@media print{
.post-header,.social-share,.share-prompt,.comments-section,.related-section{display:none}
.post-content-wrapper{max-width:100%}
.featured-image{box-shadow:none}
}
.image-caption {
    display: none;
}