/*
Theme Name: RiskBan Blog
Theme URI: https://riskban.app/blog
Description: قالب اختصاصی وبلاگ ریسک‌بان، هماهنگ با وب‌سایت اصلی.
Version: 1.0.0
Text Domain: riskban-blog
*/

@font-face {
  font-family: Vazirmatn;
  src: url('https://riskban.app/fonts/vazirmatn-arabic.woff2') format('woff2');
  font-display: swap;
}

:root {
  --navy-950: #0b1f3a;
  --navy-900: #102a4c;
  --navy-100: #dce7f2;
  --accent: #1677c8;
  --warning: #d99000;
  --ink: #263238;
  --muted: #607080;
  --surface: #f5f7fa;
  --white: #ffffff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: Vazirmatn, Tahoma, Arial, sans-serif;
  font-size: 16px;
  line-height: 2;
  text-align: right;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { display: block; height: auto; max-width: 100%; }

.rb-container { width: min(1280px, calc(100% - 32px)); margin: 0 auto; }
.rb-site-header { background: rgba(255,255,255,.95); border-bottom: 1px solid var(--navy-100); position: sticky; top: 0; z-index: 50; backdrop-filter: blur(12px); }
.rb-header-inner { align-items: center; display: flex; justify-content: space-between; height: 80px; gap: 16px; }
.rb-brand { color: var(--navy-950); display: inline-flex; align-items: center; gap: 12px; white-space: nowrap; }
.rb-brand-logo { height: 40px; width: 40px; object-fit: contain; }
.rb-nav { align-items: center; display: flex; gap: 28px; font-size: 14px; color: var(--muted); }
.rb-nav a { color: var(--muted); }
.rb-nav a:hover { color: var(--navy-700); }
.rb-header-actions { align-items: center; display: flex; gap: 8px; }
.rb-header-cta { background: var(--warning); border-radius: 12px; color: #fff !important; font-size: 14px; font-weight: 500; padding: 12px 20px; transition: filter .2s; }
.rb-header-cta:hover { background: var(--warning); filter: brightness(.95); color: #fff !important; }
.rb-mobile-menu { display: none; position: relative; }
.rb-mobile-menu summary { align-items: center; border: 1px solid var(--navy-100); border-radius: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; height: 44px; justify-content: center; list-style: none; width: 44px; }
.rb-mobile-menu summary::-webkit-details-marker { display: none; }
.rb-mobile-menu summary span { background: var(--ink); border-radius: 1px; display: block; height: 2px; width: 18px; }
.rb-mobile-menu nav { background: var(--white); border: 1px solid var(--navy-100); border-radius: 12px; box-shadow: 0 12px 28px rgba(11,31,58,.12); display: flex; flex-direction: column; margin-top: 8px; min-width: 180px; padding: 6px; position: absolute; left: 0; top: 44px; }
.rb-mobile-menu nav a { border-radius: 8px; color: var(--ink); font-size: 14px; padding: 9px 12px; }
.rb-mobile-menu nav a:hover { background: var(--surface); color: var(--navy-700); }

.rb-article-hero { background: var(--navy-950); color: #fff; overflow: hidden; padding: 66px 0 72px; position: relative; }
.rb-article-hero::before { background-image: radial-gradient(rgba(77,163,230,.26) 1px, transparent 1px); background-size: 18px 18px; content: ''; inset: 0; opacity: .45; position: absolute; }
.rb-hero-content { max-width: 880px; position: relative; }
.rb-breadcrumb { color: #b9cce0; font-size: 14px; margin-bottom: 20px; }
.rb-breadcrumb a { color: #dce7f2; }
.rb-breadcrumb span { margin: 0 8px; }
.rb-article-hero h1 { color: #fff; font-size: clamp(28px, 4vw, 46px); line-height: 1.45; margin: 0; font-weight: 800; }
.rb-post-meta { align-items: center; color: #c8d8e8; display: flex; flex-wrap: wrap; gap: 9px; font-size: 14px; margin-top: 23px; }
.rb-post-meta span + span::before { color: #7e9dbd; content: '•'; margin-left: 9px; }

.rb-layout { display: grid; gap: 30px; grid-template-columns: minmax(0, 770px) 260px; padding: 48px 0 64px; }
.rb-article { background: var(--white); border: 1px solid var(--navy-100); border-radius: 14px; box-shadow: 0 8px 24px rgba(11,31,58,.06); overflow: hidden; }
.rb-featured-image { border-bottom: 1px solid var(--navy-100); width: 100%; }
.rb-entry { font-size: 17px; line-height: 2.15; padding: 42px 48px 50px; }
.rb-entry > :first-child { margin-top: 0; }
.rb-entry h2, .rb-entry h3, .rb-entry h4 { color: var(--navy-950); font-weight: 800; line-height: 1.65; margin: 42px 0 14px; }
.rb-entry h2 { border-right: 4px solid var(--accent); font-size: 25px; padding-right: 13px; }
.rb-entry h3 { font-size: 21px; }
.rb-entry p, .rb-entry ul, .rb-entry ol { margin: 0 0 22px; }
.rb-entry ul, .rb-entry ol { padding-right: 25px; padding-left: 0; }
.rb-entry li { margin-bottom: 8px; }
.rb-entry a { color: var(--accent); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.rb-entry blockquote { background: #eef6fc; border: 0; border-right: 4px solid var(--accent); color: var(--navy-900); margin: 30px 0; padding: 18px 22px; }
.rb-entry figure { margin: 30px 0; }
.rb-entry figcaption { color: var(--muted); font-size: 13px; margin-top: 7px; text-align: center; }
.rb-entry img { border-radius: 10px; }
.rb-article-footer { border-top: 1px solid var(--navy-100); margin-top: 40px; padding-top: 26px; }
.rb-tags { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }
.rb-tags a { background: var(--surface); border-radius: 99px; color: var(--navy-900); font-size: 13px; padding: 3px 11px; }
.rb-tags a:hover { background: var(--navy-100); }

.rb-sidebar { align-self: start; position: sticky; top: 96px; }
.rb-sidebar-card { background: var(--white); border: 1px solid var(--navy-100); border-radius: 12px; margin-bottom: 20px; padding: 23px; }
.rb-sidebar-card h2 { color: var(--navy-950); font-size: 17px; line-height: 1.6; margin: 0 0 14px; }
.rb-sidebar-card p { color: var(--muted); font-size: 14px; line-height: 1.9; margin: 0 0 16px; }
.rb-sidebar-button { background: var(--warning); border-radius: 8px; color: #fff; display: block; font-size: 14px; font-weight: 700; padding: 8px 12px; text-align: center; }
.rb-sidebar-button:hover { background: #bb7b00; color: #fff; }
.rb-latest-posts { list-style: none; margin: 0; padding: 0; }
.rb-latest-posts li { border-bottom: 1px solid var(--navy-100); padding: 11px 0; }
.rb-latest-posts li:last-child { border: 0; padding-bottom: 0; }
.rb-latest-posts a { color: var(--ink); display: block; font-size: 14px; font-weight: 700; line-height: 1.8; }
.rb-latest-posts a:hover { color: var(--accent); }

.rb-post-grid { display: grid; gap: 24px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rb-post-card { background: var(--white); border: 1px solid var(--navy-100); border-radius: 12px; box-shadow: 0 8px 24px rgba(11,31,58,.05); overflow: hidden; }
.rb-post-card > a img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.rb-post-card-content { padding: 22px; }
.rb-card-date { color: var(--muted); font-size: 13px; margin-bottom: 7px; }
.rb-post-card h2 { color: var(--navy-950); font-size: 19px; line-height: 1.75; margin: 0 0 10px; }
.rb-post-card p { color: var(--muted); font-size: 14px; line-height: 1.9; margin: 0 0 16px; }
.rb-read-more { color: var(--accent); font-size: 14px; font-weight: 700; }
.rb-card-meta { align-items: center; color: var(--muted); display: flex; flex-wrap: wrap; gap: 7px; font-size: 13px; margin-bottom: 7px; }
.rb-card-meta span + span::before { color: #94a3b8; content: '•'; margin-left: 7px; }
.rb-article-lead { background: #eef6fc; border-right: 4px solid var(--accent); border-radius: 10px; color: var(--navy-900); font-size: 18px; font-weight: 700; padding: 16px 20px; }
.rb-table-wrap { margin: 24px 0 30px; overflow-x: auto; }
.rb-entry table { border-collapse: collapse; min-width: 640px; width: 100%; }
.rb-entry th, .rb-entry td { border: 1px solid var(--navy-100); padding: 10px 12px; text-align: right; vertical-align: top; }
.rb-entry th { background: #eef6fc; color: var(--navy-950); font-weight: 800; }
.rb-article-cta { background: var(--navy-950); border-radius: 12px; color: #dce7f2; margin-top: 34px; padding: 24px; }
.rb-article-cta h2 { border: 0; color: #fff; margin-top: 0; padding-right: 0; }
.rb-article-cta a { color: #fff; }

.rb-site-footer { background: var(--navy-950); color: #c8d8e8; padding: 36px 0; }
.rb-footer-inner { align-items: center; display: flex; font-size: 14px; justify-content: space-between; gap: 18px; }
.rb-footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.rb-site-footer a:hover { color: #fff; }

@media (max-width: 1023px) {
  .rb-container { width: min(100% - 48px, 1280px); }
  .rb-nav { display: none; }
  .rb-mobile-menu { display: block; }
}

@media (max-width: 640px) {
  .rb-container { width: min(100% - 32px, 1280px); }
  .rb-header-inner { height: 64px; }
  .rb-brand { gap: 9px; }
  .rb-brand-logo { height: 36px; width: 36px; }
  .rb-brand-copy small { display: none; }
  .rb-header-cta { display: none; }
  .rb-article-hero { padding: 42px 0 48px; }
  .rb-layout { display: block; padding: 28px 0 42px; }
  .rb-sidebar { margin-top: 22px; position: static; }
  .rb-entry { font-size: 16px; padding: 28px 22px 34px; }
  .rb-entry h2 { font-size: 22px; }
  .rb-post-grid { grid-template-columns: 1fr; }
  .rb-footer-inner { align-items: flex-start; flex-direction: column; }
}

.rb-featured-image img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }

.rb-brand-copy { display: flex; flex-direction: column; gap: 2px; line-height: 1.25; }
.rb-brand-copy strong { color: #0f172a; font-size: 16px; font-weight: 700; }
.rb-brand-copy small { color: #64748b; font-size: 12px; font-weight: 400; white-space: nowrap; }
