/*
Theme Name: Dine Jahani
Author: Soroush Moradi
Description: نسخه ۵۳ - کوچک کردن فونت و پدینگ جدول‌ها در موبایل برای نمایش تمیزتر + تمامی قابلیت‌های قبلی.
Version: 53.0
*/

@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');
@import url('https://unpkg.com/swiper/swiper-bundle.min.css');

:root {
    --primary-color: #0a84ff;
    --bg-dark: #10121b;
    --card-bg: #1a1d26;
    --text-color: #f1f5f9;
    --header-height: 120px;
    --gold-color: #ffd700;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { width: 100%; overflow-x: hidden; }

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

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-color);
    line-height: 1.8;
    direction: rtl;
    font-size: 16px;
    padding-top: var(--header-height);
}

a { text-decoration: none !important; border: none !important; outline: none !important; color: inherit; }
.entry-content a { color: var(--primary-color); }

#wave-canvas {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: -999; background: var(--bg-dark);
}

/* --- هدر --- */
#main-header {
    height: var(--header-height);
    position: fixed; top: 0; left: 0; width: 100%;
    z-index: 1000;
    display: flex; align-items: center;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    /* انیمیشن نرم برای ظاهر/مخفی شدن */
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
    will-change: transform;
}

/* کلاس برای مخفی کردن هدر */
#main-header.header-hidden {
    transform: translateY(-100%);
    box-shadow: none;
}

#full-header-flag { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; }

.header-click-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1; cursor: pointer;
    background: rgba(16, 18, 27, 0.5); backdrop-filter: none; transition: background 0.4s ease-in-out;
}
#main-header:hover .header-click-overlay { background: rgba(16, 18, 27, 0.1); }

.container-wrapper { width: 92%; max-width: 1200px; margin: 0 auto; position: relative; z-index: 2; }
#main-header .container-wrapper { pointer-events: none; }
.header-flex { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.site-logo { position: relative; pointer-events: auto; }
.site-logo a { font-size: 26px; font-weight: 900; color: #fff !important; text-shadow: 0 2px 5px rgba(0,0,0,0.9), 0 5px 15px rgba(0,0,0,0.9); }

/* --- منو --- */
.main-navigation { position: relative; pointer-events: auto; }
.main-navigation ul { display: flex; list-style: none; gap: 20px; }
.main-navigation a {
    font-weight: 700; font-size: 16px; color: #fff !important; text-shadow: 0 2px 4px rgba(0,0,0,0.8); transition: 0.3s;
}
.main-navigation a:hover { color: #ffe600 !important; }

.hamburger-menu {
    display: none; 
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 48px; height: 48px;
    padding: 10px;
    cursor: pointer;
    pointer-events: auto !important;
    position: relative;
    z-index: 1002;
    background: transparent;
}
.hamburger-menu .bar {
    width: 28px; height: 3px; background-color: #fff; border-radius: 10px; transition: 0.4s; margin: 0 auto; display: block;
}
.hamburger-menu.active .bar:nth-child(1) { transform: translateY(9px) rotate(45deg); background-color: var(--gold-color); }
.hamburger-menu.active .bar:nth-child(2) { opacity: 0; }
.hamburger-menu.active .bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); background-color: var(--gold-color); }

.mobile-menu-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    background: rgba(16, 18, 27, 0.98); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    z-index: 1050; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: 0.4s ease; transform: translateY(-20px);
}
.mobile-menu-overlay.active { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
.mobile-menu-content ul { list-style: none; text-align: center; padding: 0; }
.mobile-menu-content li { margin: 25px 0; opacity: 0; transform: translateY(20px); transition: 0.5s ease; }
.mobile-menu-overlay.active .mobile-menu-content li { opacity: 1; transform: translateY(0); }
.mobile-menu-content a {
    font-size: 1.5rem; font-weight: bold; color: #ffffff !important; text-decoration: none !important; transition: 0.3s;
}
.mobile-menu-content a:hover { color: var(--gold-color) !important; letter-spacing: 1px; }

.mobile-only { display: none !important; }

/* --- تنظیمات ریسپانسیو --- */
@media (max-width: 900px) {
    .header-flex { flex-direction: row-reverse; } 
    .desktop-only { display: none !important; }
    .mobile-only { display: flex !important; } 
    .about-grid-layout { grid-template-columns: 1fr; }
    .profile-card { position: static; max-width: 400px; margin: 0 auto 40px; }
    .about-content-text { padding-right: 0; }
    .vote-buttons { flex-direction: column; width: 100%; }
    .vote-btn { width: 100%; justify-content: center; }
}

@media (max-width: 768px) {
    .post-card-image { height: auto !important; aspect-ratio: 16 / 9; width: 100%; }
    .full-slide-link img { height: auto; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
    .single-hero-fixed { width: 100%; height: 100vh; }
    
    /* تنظیم ارتفاع شروع کادر در موبایل (۵۵) */
    .single-scroll-container { margin-top: 60vh !important; } 
    
    .single-content-box { padding: 30px 20px !important; } 
    .single-title { font-size: 1.6rem !important; margin-bottom: 10px !important; }
    
    /* --- تنظیمات جدید جدول برای موبایل --- */
    /* فونت کوچکتر برای جدول‌ها در موبایل */
    .entry-content th, .entry-content td {
        font-size: 0.9rem !important; /* یک سایز کوچکتر از متن اصلی */
        padding: 8px 5px !important; /* کاهش پدینگ برای جا شدن بهتر */
    }
}

/* --- محتوای پست --- */
.single-hero-fixed { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: -1; overflow: hidden; }
.single-hero-img { width: 100%; height: 100%; object-fit: cover; opacity: 1; will-change: transform, opacity; }
.single-hero-overlay { position: absolute; top:0; left:0; width:100%; height:100%; background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, transparent 50%, #10121b 100%); }

/* دسکتاپ */
.single-scroll-container { 
    position: relative; 
    z-index: 10; 
    margin-top: 65vh; 
    background: transparent; 
}

.single-content-box { background-color: var(--card-bg); color: var(--text-color); padding: 50px; border-radius: 30px 30px 0 0; box-shadow: 0 -10px 50px rgba(0,0,0,0.6); border-top: 1px solid rgba(255,255,255,0.1); min-height: 100vh; }

.single-title { 
    font-size: clamp(1.5rem, 3vw, 2.2rem); 
    font-weight: 900; 
    margin-bottom: 15px; 
    color: #fff; 
    text-align: center; 
}

.post-meta-custom { text-align: center; color: #a0aec0; margin-bottom: 10px; font-size: 0.9rem; }

.entry-content { 
    font-size: 1rem; 
    line-height: 1.8; 
    color: #e2e8f0; 
}

.entry-content p { margin-bottom: 25px; }
.entry-content blockquote { border-right: 4px solid var(--gold-color); margin: 25px 0; padding: 5px 10px; background: rgba(255,255,255,0.03); border-radius: 8px; font-style: italic; font-size: 1.2rem; color: #fff; }

/* === جدول‌ها (استایل عمومی) === */
.entry-content table {
    width: 100%; border-collapse: separate; border-spacing: 0; margin: 30px 0;
    background: rgba(0,0,0,0.3); border: 1px solid var(--text-color) !important; border-radius: 12px;
}
.entry-content th, .entry-content td {
    padding: 15px; text-align: right; color: var(--text-color);
    border-bottom: 1px solid var(--text-color) !important; border-left: 1px solid var(--text-color) !important;
}
.entry-content th {
    background: rgba(255, 255, 255, 0.1); font-weight: bold; color: var(--gold-color);
    border-bottom: 2px solid var(--text-color) !important;
}
.entry-content thead tr:first-child th:first-child { border-top-right-radius: 11px; }
.entry-content thead tr:first-child th:last-child { border-top-left-radius: 11px; border-left: none !important; }
.entry-content td:last-child { border-left: none !important; }
.entry-content tbody tr:last-child td:first-child { border-bottom-right-radius: 11px; border-bottom: none !important; }
.entry-content tbody tr:last-child td:last-child { border-bottom-left-radius: 11px; border-bottom: none !important; }
.entry-content tbody tr:last-child td { border-bottom: none !important; }

/* --- رای‌دهی --- */
.post-voting-section { margin: 50px 0; padding: 30px; background: rgba(0,0,0,0.3); border-radius: 16px; border: 1px solid rgba(255,215,0,0.1); text-align: center; }
.post-voting-section h4 { color: var(--gold-color); margin-bottom: 20px; }
.vote-buttons { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.vote-btn { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: #fff; padding: 10px 25px; border-radius: 50px; font-family: inherit; font-size: 1rem; cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; gap: 10px; }
.vote-btn:hover { background: rgba(255,255,255,0.1); transform: scale(1.05); }
.vote-btn.like-btn.voted { background: rgba(46, 204, 113, 0.2); border-color: #2ecc71; color: #2ecc71; box-shadow: 0 0 15px rgba(46, 204, 113, 0.4); }
.vote-btn.dislike-btn.voted { background: rgba(231, 76, 60, 0.2); border-color: #e74c3c; color: #e74c3c; box-shadow: 0 0 15px rgba(231, 76, 60, 0.4); }
.tags-section { margin-top: 30px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; }
.tag-label { color: var(--gold-color); font-weight: bold; }
.tags-section a { background: rgba(255,255,255,0.05); padding: 5px 12px; border-radius: 6px; font-size: 0.9rem; color: #cbd5e1 !important; margin-left: 5px; transition: 0.3s; }
.tags-section a:hover { background: var(--primary-color); color: #fff !important; }
.separator-line { border: 0; height: 1px; background: rgba(255,255,255,0.1); margin: 40px 0; }
.comments-section-wrapper { margin-top: 40px; }
.comment-list { list-style: none; padding: 0; margin-bottom: 40px; }
.comment-body { background: rgba(0,0,0,0.2); padding: 20px; border-radius: 12px; margin-bottom: 20px; border: 1px solid rgba(255,255,255,0.05); }
.comment-author { font-weight: bold; color: var(--gold-color); margin-bottom: 5px; }
.comment-meta { font-size: 0.8rem; color: #718096; margin-bottom: 10px; }
.comment-content p { margin-bottom: 0; color: #e2e8f0; font-size: 0.95rem; }
.reply { text-align: left; margin-top: 10px; }
.comment-reply-link { color: var(--primary-color); font-size: 0.9rem; }
.comment-respond { background: rgba(255,255,255,0.02); padding: 30px; border-radius: 16px; border: 1px solid rgba(255,215,0,0.1); }
.comment-reply-title { color: #fff; margin-bottom: 20px; border-bottom: 2px solid var(--gold-color); display: inline-block; padding-bottom: 5px; }
.comment-form label { display: block; color: #cbd5e1; margin-bottom: 5px; margin-top: 15px; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form textarea { width: 100%; background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.1); color: #fff; padding: 12px; border-radius: 8px; font-family: inherit; transition: 0.3s; }
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--gold-color); outline: none; box-shadow: 0 0 10px rgba(255,215,0,0.1); }
.comment-form p.comment-form-cookies-consent, .comment-form p.comment-subscription-form { display: flex; align-items: center; justify-content: flex-start; gap: 10px; margin-top: 15px; }
.comment-form input[type="checkbox"] { width: auto !important; margin: 0 !important; cursor: pointer; transform: scale(1.2); }
.comment-form .comment-form-cookies-consent label, .comment-form .comment-subscription-form label { margin: 0; display: inline-block; font-size: 0.9rem; cursor: pointer; }
.form-submit .submit { background: var(--gold-color); color: #000; font-weight: bold; border: none; padding: 12px 30px; border-radius: 8px; cursor: pointer; margin-top: 20px; font-family: inherit; transition: 0.3s; }
.form-submit .submit:hover { background: #fff; box-shadow: 0 0 15px rgba(255,255,255,0.5); }
.site-slogan-banner { text-align: center; margin: 30px 0; }
.site-slogan-banner h1 { color: #fff; font-size: clamp(1.4rem, 4vw, 2.2rem); text-shadow: 0 4px 10px rgba(0,0,0,0.5); }
.hero-slider-section { margin-bottom: 50px; position: relative; }
.swiper-container { width: 100%; height: auto; border-radius: 20px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,0.4); background: transparent; padding-bottom: 0; }
.swiper-slide { position: relative; }
.full-slide-link { display: block; position: relative; width: 100%; height: 100%; }
.full-slide-link img { width: 100%; height: auto; display: block; max-height: 500px; object-fit: cover; }
.slide-caption { position: absolute; bottom: 0; left: 0; width: 100%; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent); padding: 40px 30px 50px; pointer-events: none; }
.slide-caption h2 { color: #fff; margin: 0; font-size: 1.5rem; }
.swiper-pagination { position: absolute; bottom: 15px !important; left: 0; width: 100%; z-index: 20; text-align: center; }
.swiper-pagination-bullet { background: rgba(255,255,255,0.5); width: 10px; height: 10px; margin: 0 5px !important; opacity: 1; }
.swiper-pagination-bullet-active { background: #fff; transform: scale(1.2); }

/* --- کارت‌های پست --- */
.posts-grid-layout { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; margin: 40px 0; }

.post-card-link { 
    display: block; 
    background: var(--card-bg); 
    border-radius: 16px; 
    overflow: hidden; 
    box-shadow: 0 10px 20px rgba(0,0,0,0.2); 
    border: 1px solid rgba(255,255,255,0.05); 
    opacity: 0;
    transform: translateY(60px) scale(0.9);
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1); 
}

.post-card-link.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.post-card-link:hover { transform: translateY(-10px) scale(1.02); border-color: var(--gold-color); z-index: 2; }
.post-card-link:nth-child(4n+1):hover { box-shadow: 5px -5px 15px rgba(255, 215, 0, 0.6), 15px -15px 40px rgba(255, 215, 0, 0.3), -10px 20px 40px rgba(0, 0, 0, 0.5); }
.post-card-link:nth-child(4n+2):hover { box-shadow: 2px -6px 15px rgba(255, 215, 0, 0.6), 5px -18px 40px rgba(255, 215, 0, 0.3), -5px 22px 40px rgba(0, 0, 0, 0.5); }
.post-card-link:nth-child(4n+3):hover { box-shadow: -2px -6px 15px rgba(255, 215, 0, 0.6), -5px -18px 40px rgba(255, 215, 0, 0.3), 5px 22px 40px rgba(0, 0, 0, 0.5); }
.post-card-link:nth-child(4n):hover { box-shadow: -5px -5px 15px rgba(255, 215, 0, 0.6), -15px -15px 40px rgba(255, 215, 0, 0.3), 10px 20px 40px rgba(0, 0, 0, 0.5); }

.post-card-image { width: 100%; height: 220px; overflow: hidden; background: #000; }
.post-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.post-card-link:hover .post-card-image img { transform: scale(1.1); }
.post-card-content { padding: 15px 20px; }
.post-card-title { color: #fff; margin-bottom: 8px; font-size: 1.1rem; font-weight: bold; }
.post-card-excerpt { color: #cbd5e1; font-size: 0.9rem; }

.about-grid-layout { display: grid; grid-template-columns: 300px 1fr; gap: 40px; align-items: start; }
.profile-card { background: rgba(0,0,0,0.25); border: 1px solid rgba(255,215,0,0.15); border-radius: 20px; padding: 30px 20px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.3); position: sticky; top: 140px; transition: 0.4s ease; }
.profile-card:hover { border-color: var(--gold-color); box-shadow: 0 15px 40px rgba(255,215,0,0.15); transform: translateY(-5px); }
.profile-image-container { width: 180px; height: 180px; flex: 0 0 180px; margin: 0 auto 20px; border-radius: 50%; overflow: hidden; border: 3px solid var(--gold-color); box-shadow: 0 0 20px rgba(255,215,0,0.3); }
.profile-image-container img, img.custom-profile-img { width: 100% !important; height: 100% !important; max-width: 100%; object-fit: cover !important; display: block; border-radius: 50%; }
.profile-name { font-size: 1.5rem; color: #fff; margin-bottom: 5px; font-weight: 900; }
.profile-job { color: #a0aec0; font-size: 0.95rem; margin-bottom: 25px; }
.profile-stats { display: flex; justify-content: space-around; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; }
.stat-item { display: flex; flex-direction: column; }
.stat-num { font-size: 1.4rem; font-weight: bold; color: #fff; }
.stat-label { font-size: 0.8rem; color: #718096; }
.about-content-text { padding-right: 20px; }
.site-footer { text-align: center; padding: 30px; border-top: 1px solid rgba(255,255,255,0.05); color: #a0aec0; margin-top: 60px; position: relative; z-index: 20; background: var(--card-bg); }

@media (max-width: 900px) {
    .about-grid-layout { grid-template-columns: 1fr; }
    .profile-card { position: static; max-width: 400px; margin: 0 auto 40px; }
    .about-content-text { padding-right: 0; }
}