* { box-sizing: border-box; }
:root {
    --primary: #1b1f3b;
    --primary-light: #2e3468;
    --accent: #4a4f7a;
    --bg: #f5f6fa;
    --card: #ffffff;
    --text: #22252f;
    --muted: #6b7080;
    --radius: 12px;
}
body {
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    line-height: 1.95;
    font-size: 16px;
}
.container { max-width: 900px; margin: 0 auto; padding: 0 18px; }
a { color: var(--primary-light); }

/* هدر سایت */
.site-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    padding: 40px 0 34px;
}
.header-inner { text-align: center; }
.site-header .logo {
    color: #fff;
    font-size: 28px;
    font-weight: 800;
    text-decoration: none;
    display: inline-block;
}
.site-header .tagline { margin: 8px 0 0; color: #d6d9f5; font-size: 15px; }

main.container { padding: 30px 18px 70px; }

/* breadcrumb */
.breadcrumb { margin-bottom: 22px; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; font-size: 13px; color: var(--muted); }
.breadcrumb li:not(:last-child)::after { content: '/'; margin-inline-start: 6px; color: #c7c9da; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary-light); }

/* لیست پست‌ها */
.post-list h1 { font-size: 24px; margin-bottom: 26px; }
.post-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 22px 24px;
    margin-bottom: 18px;
    box-shadow: 0 2px 10px rgba(20,20,50,0.06);
    border: 1px solid #ececf3;
    transition: box-shadow .15s ease, transform .15s ease;
}
.post-card:hover { box-shadow: 0 6px 18px rgba(20,20,50,0.10); transform: translateY(-2px); }
.post-card { display: block; }
.post-thumb { width: 100%; max-height: 220px; object-fit: cover; border-radius: 8px; margin-bottom: 14px; }
.post-card h2 { margin: 0 0 8px; font-size: 20px; }
.post-card h2 a { color: var(--primary); text-decoration: none; font-weight: 700; }
.post-card time { color: var(--muted); font-size: 13px; }
.post-card p { margin: 12px 0 0; color: #464a58; }

/* مطلب/صفحه تکی */
.single-post, .single-page {
    background: var(--card);
    border-radius: var(--radius);
    padding: 30px 28px;
    box-shadow: 0 2px 10px rgba(20,20,50,0.06);
    border: 1px solid #ececf3;
}
.single-post h1, .single-page h1 { font-size: 27px; margin-top: 0; color: var(--primary); }
.single-post time { color: var(--muted); font-size: 13px; }
.post-content, .page-content { margin-top: 22px; font-size: 16.5px; }
.post-content h2, .page-content h2 { font-size: 21px; margin-top: 34px; color: var(--primary); }
.post-content h3, .page-content h3 { font-size: 18px; margin-top: 26px; }
.post-content img, .page-content img { max-width: 100%; height: auto; border-radius: 10px; }
.post-content ul, .page-content ul { padding-inline-start: 22px; }

/* لینک‌های داخلی تصادفی (سئو) در پایین هر مطلب/صفحه */
.internal-links {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin-top: 20px;
    border: 1px solid #ececf3;
}
.internal-links h2 { font-size: 18px; margin: 0 0 14px; color: var(--primary); }
.internal-links ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px 18px;
}
.internal-links li { border-bottom: 1px dashed #ececf3; padding-bottom: 6px; }
.internal-links a { color: #464a58; text-decoration: none; font-size: 14px; }
.internal-links a:hover { color: var(--primary); text-decoration: underline; }

/* فوتر سایت */
.site-footer {
    background: var(--primary);
    color: #c7cbe9;
    text-align: center;
    padding: 22px 0;
    font-size: 13px;
}

/* پنل مدیریت */
.admin-body { background: #eef0f6; font-family: 'Vazirmatn', Tahoma, sans-serif; }
.admin-wrap { max-width: 800px; margin: 40px auto; background: #fff; padding: 26px 28px; border-radius: var(--radius); box-shadow: 0 2px 14px rgba(0,0,0,0.08); }
.admin-nav { display: flex; gap: 10px; margin-bottom: 26px; flex-wrap: wrap; }
.admin-nav a { text-decoration: none; color: var(--primary); background: #eef0fb; padding: 9px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; }
.admin-nav a.logout { background: #ffe3e3; color: #b00020; }
label { display: block; margin: 16px 0 6px; font-weight: 700; font-size: 14px; }
input[type=text], input[type=password], textarea, select {
    width: 100%; padding: 11px; border: 1px solid #d7d9e6; border-radius: 8px; font-size: 14.5px; font-family: inherit;
}
textarea { min-height: 240px; }
button, .btn {
    margin-top: 20px; background: var(--primary); color: #fff; border: none; padding: 11px 20px;
    border-radius: 8px; cursor: pointer; font-size: 14.5px; font-weight: 700;
}
button.secondary { background: var(--accent); }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; }
.alert-success { background: #e0f7e6; color: #14602c; }
.alert-error { background: #fde0e0; color: #a10000; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; }
table th, table td { padding: 10px; border-bottom: 1px solid #eee; font-size: 14px; text-align: right; }
table th { color: var(--muted); font-weight: 700; }
table a { color: var(--primary); }
code { background: #f0f1f7; padding: 2px 6px; border-radius: 4px; font-size: 13px; }

/* تبلیغ شناور پایین صفحه */
.floating-ad {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    z-index: 9999;
    width: 94%;
    max-width: 560px;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border-radius: 20px;
    padding: 18px 22px;
    box-shadow: 0 10px 32px rgba(20,20,60,0.35);
    animation: floatingAdPulse 2.4s ease-in-out infinite, floatingAdIn .4s ease-out;
    overflow: hidden;
}
.floating-ad::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0; left: -60%;
    width: 40%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.5), transparent);
    animation: floatingAdShine 2.8s ease-in-out infinite;
}
.floating-ad-link {
    display: block;
    flex: 1;
    color: #fff;
    text-decoration: none;
    position: relative;
    z-index: 1;
}
.floating-ad-text {
    display: block;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.5;
}
.floating-ad-close {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    margin-inline-start: 14px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.floating-ad-close:hover { background: rgba(255,255,255,0.34); }

@keyframes floatingAdPulse {
    0%, 100% { box-shadow: 0 10px 32px rgba(20,20,60,0.35), 0 0 0 0 rgba(74,79,122,0.55); }
    50%      { box-shadow: 0 10px 32px rgba(20,20,60,0.35), 0 0 0 12px rgba(74,79,122,0); }
}
@keyframes floatingAdShine {
    0%   { left: -60%; }
    100% { left: 130%; }
}
@keyframes floatingAdIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@media (max-width: 480px) {
    .floating-ad-text { font-size: 15px; }
    .floating-ad { bottom: 14px; padding: 15px 18px; }
}
