/*
Theme Name: تیتر حقوقی حرفه‌ای
Theme URI: https://example.com/titr-hoghoghi-pro
Author: Hamid Zarei
Author URI: https://example.com
Description: قالب خبری، مجله‌ای و خدمات حقوقی فارسی با چیدمان سه‌ستونه، اسلایدر، بخش مقالات، اخبار، مشاوره، مجله و پنل تنظیمات.
Version: 1.0.0
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: titr-hoghoghi
Tags: news, blog, rtl-language-support, custom-logo, custom-menu, featured-images, theme-options
*/

:root {
  --th-accent: #6f0507;
  --th-accent-dark: #430204;
  --th-text: #22191a;
  --th-muted: #74696b;
  --th-line: #eadfe1;
  --th-bg: #f7f5f5;
  --th-card: #ffffff;
  --th-radius: 12px;
  --th-shadow: 0 10px 30px rgba(53, 12, 18, .08);
  --th-font: "Vazirmatn", "IRANSansX", "IRANSans", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  direction: rtl;
  color: var(--th-text);
  background: var(--th-bg);
  font-family: var(--th-font);
  font-size: 14px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--th-accent); }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.screen-reader-text { position: absolute!important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); }
.container { width: min(1480px, calc(100% - 34px)); margin-inline: auto; }

/* Top bar */
.topbar {
  background: linear-gradient(90deg, var(--th-accent-dark), var(--th-accent));
  color: #fff;
  min-height: 40px;
}
.topbar-inner { display:flex; align-items:center; justify-content:space-between; gap:18px; min-height:40px; }
.topbar-tools, .topbar-social { display:flex; align-items:center; gap:13px; }
.topbar-social a { width:24px; height:24px; display:grid; place-items:center; border-radius:6px; font-weight:800; opacity:.92; }
.topbar-social a:hover { background:rgba(255,255,255,.14); color:#fff; }
.topbar-search { position:relative; width:230px; }
.topbar-search input { width:100%; height:28px; border:0; color:#fff; background:rgba(255,255,255,.09); border-radius:5px; padding:0 34px 0 10px; outline:0; }
.topbar-search input::placeholder { color:rgba(255,255,255,.78); }
.topbar-search button { position:absolute; right:5px; top:2px; width:26px; height:24px; border:0; color:#fff; background:transparent; }
.updated-date { font-size:12px; opacity:.92; white-space:nowrap; }

/* Branding */
.branding { background:#fff; border-bottom:1px solid var(--th-line); }
.branding-inner { min-height:135px; display:flex; align-items:center; justify-content:center; position:relative; }
.site-brand { display:flex; align-items:center; gap:22px; text-align:center; }
.custom-logo { max-height:102px; width:auto; }
.site-brand-text { display:flex; flex-direction:column; align-items:center; line-height:1.2; }
.site-title { margin:0; color:var(--th-accent); font-size:48px; font-weight:900; letter-spacing:-2px; }
.site-description { margin:7px 0 0; font-size:17px; color:#32282a; font-weight:700; }
.site-tag-en { margin-top:5px; font-family:Georgia, serif; font-size:15px; font-style:italic; color:#7a5c60; direction:ltr; }
.brand-mark { width:86px; height:96px; display:grid; place-items:center; }
.brand-mark svg { width:100%; height:100%; }

/* Navigation */
.primary-nav { background:#fff; border-bottom:1px solid var(--th-line); position:sticky; top:0; z-index:50; }
.admin-bar .primary-nav { top:32px; }
.nav-inner { display:flex; align-items:center; min-height:52px; }
.menu-toggle { display:none; margin-right:auto; border:1px solid var(--th-line); background:#fff; border-radius:8px; padding:7px 12px; }
.primary-menu { list-style:none; display:flex; align-items:center; justify-content:center; gap:0; padding:0; margin:0; width:100%; }
.primary-menu > li { position:relative; }
.primary-menu > li > a { display:block; padding:14px 22px 12px; font-weight:800; border-bottom:3px solid transparent; }
.primary-menu > li.current-menu-item > a, .primary-menu > li > a:hover { color:var(--th-accent); border-color:var(--th-accent); }
.primary-menu .sub-menu { position:absolute; z-index:80; top:100%; right:0; width:230px; list-style:none; margin:0; padding:8px; border:1px solid var(--th-line); background:#fff; border-radius:0 0 10px 10px; box-shadow:var(--th-shadow); opacity:0; visibility:hidden; transform:translateY(8px); transition:.2s; }
.primary-menu li:hover > .sub-menu { opacity:1; visibility:visible; transform:none; }
.primary-menu .sub-menu a { display:block; padding:9px 10px; border-radius:7px; }
.primary-menu .sub-menu a:hover { background:#f9eff0; }

/* Main grid */
.site-main-wrap { padding:16px 0 26px; }
.site-layout { display:grid; grid-template-columns: 226px minmax(0, 1fr) 282px; gap:18px; align-items:start; direction:rtl; }
.main-column { min-width:0; }
.sidebar { min-width:0; display:flex; flex-direction:column; gap:16px; }
.widget-card, .content-card { background:var(--th-card); border:1px solid var(--th-line); border-radius:var(--th-radius); box-shadow:0 4px 16px rgba(62,20,26,.035); overflow:hidden; }
.widget-title, .section-heading { margin:0; }
.widget-title { color:#fff; background:linear-gradient(90deg, var(--th-accent-dark), var(--th-accent)); font-size:15px; font-weight:900; text-align:center; padding:7px 12px; }
.widget-body { padding:12px; }

/* Sidebar */
.quick-list, .category-list, .rank-list, .latest-list { list-style:none; margin:0; padding:0; }
.quick-list li + li, .category-list li + li { margin-top:7px; }
.quick-list a { min-height:39px; display:flex; align-items:center; justify-content:space-between; gap:10px; border:1px solid #eee5e6; border-radius:7px; padding:5px 11px; background:#fff; box-shadow:0 3px 10px rgba(30,0,0,.035); font-weight:700; }
.quick-list a::after { content:"›"; width:25px; height:25px; border-radius:50%; display:grid; place-items:center; color:var(--th-accent); background:#f8ecee; font-size:20px; }
.social-grid { display:grid; grid-template-columns:repeat(4, 1fr); gap:11px; }
.social-grid a { aspect-ratio:1; display:grid; place-items:center; border-radius:11px; color:#fff; font-weight:900; font-size:18px; box-shadow:0 7px 16px rgba(0,0,0,.12); }
.social-grid a:nth-child(1) { background:#2795d9; }
.social-grid a:nth-child(2) { background:#111; }
.social-grid a:nth-child(3) { background:linear-gradient(135deg,#7c2cff,#ff275b,#ffac18); }
.social-grid a:nth-child(4) { background:#0a66c2; }
.social-grid a:nth-child(5) { background:#ef4c23; }
.social-grid a:nth-child(6) { background:#1da1f2; }
.social-grid a:nth-child(7) { background:#5ac8fa; }
.social-grid a:nth-child(8) { background:#2aabee; }
.latest-item { display:grid; grid-template-columns:72px 1fr; gap:9px; padding:9px 0; border-bottom:1px dashed var(--th-line); }
.latest-item:last-child { border-bottom:0; }
.latest-thumb { height:52px; border-radius:7px; overflow:hidden; background:#efe8e8; }
.latest-thumb img { width:100%; height:100%; object-fit:cover; }
.latest-title { font-size:12.5px; font-weight:800; line-height:1.65; margin:0; }
.latest-date { color:var(--th-muted); font-size:10.5px; }
.category-list a { display:flex; align-items:center; justify-content:space-between; padding:7px 4px; border-bottom:1px solid #f0e8e9; font-weight:700; }
.category-list a::after { content:"◈"; color:var(--th-accent); font-size:12px; }
.rank-list { counter-reset:rank; padding:10px 12px; }
.rank-list li { counter-increment:rank; position:relative; padding:7px 34px 7px 0; border-bottom:1px dashed var(--th-line); font-size:12.5px; font-weight:700; }
.rank-list li:last-child { border:0; }
.rank-list li::before { content:counter(rank); position:absolute; right:0; top:8px; width:21px; height:21px; display:grid; place-items:center; background:var(--th-accent); color:#fff; border-radius:50%; font-size:10px; }

/* Hero */
.hero-slider { position:relative; min-height:350px; border-radius:13px; overflow:hidden; background:#0d090a; box-shadow:var(--th-shadow); }
.hero-slide { position:absolute; inset:0; display:grid; grid-template-columns:58% 42%; direction:ltr; opacity:0; visibility:hidden; transition:opacity .45s ease; }
.hero-slide.is-active { opacity:1; visibility:visible; position:relative; }
.hero-media { min-height:350px; background:#1c1516; overflow:hidden; }
.hero-media img { width:100%; height:100%; min-height:350px; object-fit:cover; }
.hero-content { direction:rtl; color:#fff; display:flex; flex-direction:column; justify-content:center; align-items:flex-start; padding:34px 31px; background:linear-gradient(135deg,#150d0e,#080607); }
.hero-badge { display:inline-flex; padding:4px 10px; margin-bottom:14px; color:#fff; background:#b40e15; border-radius:4px; font-size:11px; font-weight:800; }
.hero-title { margin:0 0 14px; font-size:28px; line-height:1.6; font-weight:900; }
.hero-excerpt { margin:0 0 15px; color:#e7dcde; font-size:14px; line-height:2; }
.hero-meta { display:flex; flex-wrap:wrap; gap:10px 17px; color:#c7b8bb; font-size:11.5px; }
.hero-dots { position:absolute; z-index:5; bottom:15px; left:50%; transform:translateX(-50%); display:flex; gap:7px; direction:ltr; }
.hero-dot { width:9px; height:9px; padding:0; border:0; border-radius:50%; background:rgba(255,255,255,.58); }
.hero-dot.is-active { width:23px; border-radius:9px; background:#e20b17; }

/* Home blocks */
.home-panels { display:grid; grid-template-columns:1fr 1fr 1fr; gap:15px; margin-top:16px; }
.panel { min-width:0; }
.panel-head { display:flex; align-items:center; justify-content:center; gap:8px; min-height:48px; border-bottom:1px solid var(--th-line); padding:8px 12px; }
.panel-head h2 { margin:0; color:var(--th-accent); font-size:18px; font-weight:900; }
.panel-head .icon { color:var(--th-accent); font-size:19px; }
.post-mini-list { list-style:none; margin:0; padding:5px 13px 8px; }
.post-mini { display:grid; grid-template-columns:74px 1fr; gap:10px; padding:10px 0; border-bottom:1px dashed var(--th-line); }
.post-mini:last-child { border:0; }
.post-mini-thumb { height:51px; border-radius:6px; overflow:hidden; background:#eee6e7; }
.post-mini-thumb img { width:100%; height:100%; object-fit:cover; }
.post-mini h3 { margin:0 0 3px; font-size:12.5px; line-height:1.65; font-weight:900; }
.post-mini .meta { color:var(--th-muted); font-size:10.5px; }
.panel-more { display:block; text-align:center; padding:9px; border-top:1px solid var(--th-line); font-size:12px; font-weight:900; color:var(--th-accent); }
.consult-panel { padding:14px 17px 12px; text-align:center; }
.consult-panel p { margin:0 0 12px; color:#4f4547; }
.consult-btn { display:inline-flex; align-items:center; justify-content:center; min-width:150px; min-height:36px; padding:6px 18px; border:0; border-radius:5px; color:#fff!important; background:linear-gradient(90deg,var(--th-accent-dark),var(--th-accent)); box-shadow:0 6px 15px rgba(111,5,7,.18); font-weight:900; }
.consult-features { list-style:none; margin:14px 0 0; padding:0; text-align:right; }
.consult-features li { padding:6px 0; border-bottom:1px dashed var(--th-line); }
.consult-features li:last-child { border:0; }
.consult-features li::before { content:"✓"; color:var(--th-accent); margin-left:8px; font-weight:900; }

/* Magazine */
.magazine-section { display:grid; grid-template-columns:42% 58%; margin-top:16px; }
.magazine-current { display:grid; grid-template-columns:155px 1fr; gap:19px; padding:19px; background:linear-gradient(135deg,#fff,#fbf4f5); }
.magazine-cover { border-radius:8px; overflow:hidden; box-shadow:0 10px 24px rgba(80,20,30,.17); background:#eee; }
.magazine-cover img { width:100%; aspect-ratio:3/4; object-fit:cover; }
.magazine-info h2 { margin:0 0 4px; color:var(--th-accent); font-size:20px; }
.magazine-info h3 { margin:0 0 8px; font-size:14px; }
.magazine-info ul { margin:5px 0 13px; padding-right:18px; font-size:12px; }
.magazine-actions { display:flex; flex-wrap:wrap; gap:8px; }
.magazine-actions a { display:inline-flex; min-height:35px; align-items:center; justify-content:center; border:1px solid #cfbfc2; padding:5px 13px; border-radius:5px; font-size:12px; font-weight:900; }
.magazine-actions a.primary { color:#fff; background:var(--th-accent); border-color:var(--th-accent); }
.magazine-archive { border-right:1px solid var(--th-line); padding:17px; }
.magazine-archive h2 { margin:0 0 13px; text-align:center; color:var(--th-accent); font-size:18px; }
.issue-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.issue-card { text-align:center; }
.issue-card img { width:100%; aspect-ratio:3/4; object-fit:cover; border-radius:6px; box-shadow:0 8px 20px rgba(75,15,25,.12); }
.issue-card h3 { margin:6px 0 0; font-size:11.5px; }
.issue-filters { display:grid; grid-template-columns:1fr 1fr 1fr; gap:9px; margin-top:15px; }
.issue-filters input, .issue-filters select { width:100%; height:36px; border:1px solid #dfd4d6; border-radius:5px; background:#fff; padding:0 9px; color:#493d40; }

/* Inner pages */
.page-shell { display:grid; grid-template-columns:minmax(0,1fr) 290px; gap:18px; align-items:start; }
.article-card { padding:25px 28px; }
.breadcrumbs { margin-bottom:12px; color:var(--th-muted); font-size:12px; }
.entry-title { margin:0 0 13px; font-size:30px; line-height:1.55; color:#281c1e; }
.entry-meta { display:flex; flex-wrap:wrap; gap:7px 15px; margin-bottom:18px; color:var(--th-muted); font-size:12px; }
.entry-thumbnail { margin:0 -3px 22px; border-radius:10px; overflow:hidden; }
.entry-thumbnail img { width:100%; max-height:560px; object-fit:cover; }
.entry-content { font-size:15px; line-height:2.15; }
.entry-content h2, .entry-content h3 { color:var(--th-accent); }
.entry-content a { color:var(--th-accent); text-decoration:underline; }
.post-tags { display:flex; flex-wrap:wrap; gap:7px; margin-top:25px; }
.post-tags a { padding:4px 9px; border:1px solid var(--th-line); border-radius:20px; background:#fff8f8; font-size:11px; }
.archive-header { padding:18px 22px; margin-bottom:14px; }
.archive-header h1 { margin:0; color:var(--th-accent); font-size:24px; }
.archive-grid { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:14px; }
.archive-card { overflow:hidden; }
.archive-card-thumb { height:190px; background:#eee; }
.archive-card-thumb img { width:100%; height:100%; object-fit:cover; }
.archive-card-body { padding:15px; }
.archive-card h2 { margin:0 0 7px; font-size:17px; line-height:1.75; }
.archive-card p { margin:0; color:var(--th-muted); font-size:12.5px; }
.pagination { display:flex; justify-content:center; margin-top:18px; }
.pagination .page-numbers { min-width:34px; min-height:34px; margin:2px; display:grid; place-items:center; border:1px solid var(--th-line); border-radius:7px; background:#fff; }
.pagination .current { color:#fff; background:var(--th-accent); border-color:var(--th-accent); }

/* Consultation template */
.consult-form { display:grid; grid-template-columns:1fr 1fr; gap:13px; margin-top:20px; }
.consult-form .full { grid-column:1/-1; }
.consult-form label { display:block; font-weight:800; margin-bottom:4px; }
.consult-form input, .consult-form select, .consult-form textarea { width:100%; border:1px solid #dfd4d6; border-radius:7px; background:#fff; padding:10px 12px; outline:0; }
.consult-form input:focus, .consult-form textarea:focus { border-color:var(--th-accent); box-shadow:0 0 0 3px rgba(111,5,7,.08); }
.notice { padding:10px 13px; border-radius:7px; margin-bottom:15px; }
.notice.success { color:#14532d; background:#dcfce7; }
.notice.error { color:#7f1d1d; background:#fee2e2; }

/* Footer */
.site-footer { margin-top:20px; color:#e9dfe1; background:linear-gradient(135deg,#21080b,#4b0306); }
.footer-grid { display:grid; grid-template-columns:1.2fr 1fr 1fr; gap:26px; padding:34px 0; }
.footer-title { margin:0 0 12px; color:#fff; font-size:16px; }
.footer-menu { list-style:none; margin:0; padding:0; columns:2; }
.footer-menu li { margin-bottom:7px; }
.footer-menu a { color:#e9dfe1; }
.footer-about { color:#ddcfd2; }
.copyright { border-top:1px solid rgba(255,255,255,.12); padding:11px 0; font-size:12px; text-align:center; }

/* Widgets */
.widget-card .widget { margin:0; }
.widget ul { list-style:none; margin:0; padding:0; }
.widget li { padding:7px 0; border-bottom:1px solid #f0e8e9; }
.widget_search .search-form { display:flex; }
.widget_search input { min-width:0; flex:1; border:1px solid var(--th-line); padding:7px; }
.widget_search button { border:0; color:#fff; background:var(--th-accent); padding:7px 11px; }

/* Responsive */
@media (max-width: 1220px) {
  .site-layout { grid-template-columns:210px minmax(0,1fr); }
  .sidebar-left { display:none; }
  .hero-title { font-size:23px; }
  .primary-menu > li > a { padding-inline:14px; }
}
@media (max-width: 920px) {
  .container { width:min(100% - 22px, 760px); }
  .topbar-search { width:170px; }
  .branding-inner { min-height:105px; }
  .site-title { font-size:36px; }
  .brand-mark { width:65px; height:75px; }
  .menu-toggle { display:block; }
  .nav-inner { min-height:50px; }
  .primary-menu { display:none; position:absolute; top:100%; right:11px; left:11px; width:auto; padding:9px; border:1px solid var(--th-line); border-radius:0 0 10px 10px; background:#fff; box-shadow:var(--th-shadow); flex-direction:column; align-items:stretch; }
  .primary-menu.is-open { display:flex; }
  .primary-menu > li > a { padding:9px 11px; border-bottom:1px solid #f1eaeb; }
  .primary-menu .sub-menu { position:static; width:100%; opacity:1; visibility:visible; transform:none; border:0; box-shadow:none; display:none; }
  .primary-menu li.is-sub-open > .sub-menu { display:block; }
  .site-layout { grid-template-columns:1fr; }
  .sidebar-right { order:2; display:grid; grid-template-columns:1fr 1fr; }
  .main-column { order:1; }
  .home-panels { grid-template-columns:1fr 1fr; }
  .home-panels .panel:last-child { grid-column:1/-1; }
  .magazine-section { grid-template-columns:1fr; }
  .magazine-archive { border-right:0; border-top:1px solid var(--th-line); }
  .page-shell { grid-template-columns:1fr; }
  .inner-sidebar { display:grid; grid-template-columns:1fr 1fr; }
}
@media (max-width: 680px) {
  body { font-size:13px; }
  .topbar-inner { min-height:38px; }
  .updated-date { display:none; }
  .topbar-search { width:145px; }
  .topbar-social { gap:5px; }
  .branding-inner { min-height:90px; }
  .site-brand { gap:10px; }
  .site-title { font-size:29px; }
  .site-description { font-size:12px; }
  .site-tag-en { font-size:11px; }
  .brand-mark { width:53px; height:60px; }
  .hero-slider { min-height:0; }
  .hero-slide { grid-template-columns:1fr; }
  .hero-media, .hero-media img { min-height:210px; height:210px; }
  .hero-content { padding:20px 18px 38px; min-height:240px; }
  .hero-title { font-size:20px; }
  .home-panels { grid-template-columns:1fr; }
  .home-panels .panel:last-child { grid-column:auto; }
  .magazine-current { grid-template-columns:110px 1fr; gap:13px; padding:14px; }
  .issue-grid { gap:8px; }
  .issue-filters { grid-template-columns:1fr; }
  .sidebar-right, .inner-sidebar { display:block; }
  .sidebar-right .widget-card, .inner-sidebar .widget-card { margin-bottom:13px; }
  .archive-grid { grid-template-columns:1fr; }
  .article-card { padding:18px 15px; }
  .entry-title { font-size:23px; }
  .consult-form { grid-template-columns:1fr; }
  .consult-form .full { grid-column:auto; }
  .footer-grid { grid-template-columns:1fr; }
}
