/*
Theme Name: Tassmim
Theme URI: https://tassmim.ir
Author: Tassmim
Description: قالب اختصاصی مجله حقوقی تصمیم — هماهنگ با طراحی tassmim.ir با پشتیبانی از حالت روشن و تاریک.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: tassmim
*/

/* ---------- فونت ---------- */
@font-face {
  font-family: "Vazirmatn";
  src: url("assets/fonts/Vazirmatn-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- توکن‌های رنگ (برگرفته از tassmim.ir) ---------- */
:root {
  color-scheme: light;
  --bg: #f5f8fa;
  --surface: #ffffff;
  --surface-2: #eef3f7;
  --text: #08151f;
  --text-2: #5b7285;
  --text-3: #90a3b2;
  --border: #d9e3eb;
  --primary: #2b74aa;
  --primary-hover: #23618f;
  --primary-soft: rgba(43, 116, 170, 0.1);
  --link: #2b74aa;
  --cta: #dbbc60;
  --cta-hover: #cfae4c;
  --cta-text: #06334f;
  --gold: #af8e1d;
  --shadow: 0 8px 24px rgba(8, 21, 31, 0.08);
  --radius: 10px;
  --radius-lg: 14px;
  --container: 1200px;
  --header-h: 65px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c141b;
  --surface: #131e26;
  --surface-2: #1a2832;
  --text: #e6ecf1;
  --text-2: #90a4b4;
  --text-3: #5a6e7e;
  --border: rgba(126, 177, 246, 0.13);
  --primary: #2b74aa;
  --primary-hover: #3a86be;
  --primary-soft: rgba(126, 177, 246, 0.12);
  --link: #7eb1f6;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* ---------- پایه ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
  font-size: 15.2px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  line-height: 1.5;
  font-weight: 700;
}

p {
  margin: 0;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 6px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.site-main {
  flex: 1;
}

/* ---------- دکمه‌ها ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 18px;
  border: 0;
  border-radius: var(--radius);
  font-size: 14.8px;
  font-weight: 700;
  line-height: 1.75;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-cta {
  background: var(--cta);
  color: var(--cta-text);
}

.btn-cta:hover {
  background: var(--cta-hover);
}

.btn-lg {
  min-height: 52px;
  padding: 8px 24px;
  font-size: 16px;
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--primary-soft);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.2s;
}

.icon-btn:hover {
  background: var(--primary-soft);
}

.icon-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* ---------- هدر ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-inline-end: 12px;
  flex: none;
}

.brand-logo {
  width: 28px;
  height: 34px;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-logo .stem {
  stroke: var(--text);
  stroke-width: 3.4;
}

.brand-logo .branch {
  stroke: var(--gold);
  stroke-width: 2.4;
}

.brand-name {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.6;
}

.brand-tag {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--gold);
  padding: 1px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.main-nav {
  flex: 1;
  min-width: 0;
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 14px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 14.8px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s;
}

.main-nav a:hover,
.main-nav .current-menu-item > a,
.main-nav .current-cat > a {
  color: var(--text);
  background: var(--primary-soft);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-inline-start: auto;
  flex: none;
}

/* مثل سایت اصلی: در حالت تاریک آیکن خورشید و در حالت روشن آیکن ماه */
.theme-toggle span {
  display: inline-flex;
}

.theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: inline-flex;
}

.nav-toggle {
  display: none;
}

/* ---------- هیرو ---------- */
.hero {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 56px 0 48px;
  text-align: center;
}

.hero h1 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.4;
}

.hero p {
  max-width: 560px;
  margin: 12px auto 0;
  color: var(--text-2);
}

.search-form {
  display: flex;
  gap: 8px;
  max-width: 520px;
  margin: 24px auto 0;
}

.search-form input[type="search"] {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: 0;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hero .search-form input[type="search"] {
  background: var(--bg);
}

.search-form input[type="search"]::placeholder {
  color: var(--text-3);
}

.search-form input[type="search"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 2px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}

a.chip:hover,
.chip.is-active {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-soft);
}

:root[data-theme="dark"] a.chip:hover,
:root[data-theme="dark"] .chip.is-active {
  color: var(--link);
  border-color: var(--link);
}

/* ---------- بخش‌ها ---------- */
.section {
  padding: 48px 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.section-head h2 {
  font-size: 22.4px;
}

.section-head p {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 14px;
}

/* ---------- کارت مقاله ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.post-card {
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.post-card-thumb {
  display: block;
  aspect-ratio: 16 / 9;
  background: var(--surface-2);
  overflow: hidden;
}

.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  flex: 1;
}

.post-cat {
  align-self: flex-start;
  color: var(--gold);
  font-size: 12.8px;
  font-weight: 700;
}

:root[data-theme="dark"] .post-cat {
  color: var(--cta);
}

.post-card-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.7;
}

.post-card-title a:hover {
  color: var(--link);
}

.post-card-excerpt {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.8;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: auto;
  padding-top: 8px;
  color: var(--text-3);
  font-size: 12.8px;
}

.post-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.post-meta svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

/* مقاله‌ی ویژه */
.featured {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  margin-bottom: 16px;
}

.featured .post-card-thumb {
  aspect-ratio: auto;
  min-height: 320px;
}

.featured .post-card-body {
  justify-content: center;
  gap: 12px;
  padding: 32px;
}

.featured .post-card-title {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.6;
}

.featured .post-card-excerpt {
  font-size: 15.2px;
  -webkit-line-clamp: 4;
}

.featured .post-meta {
  margin-top: 4px;
}

/* ---------- صفحه‌بندی ---------- */
.pagination {
  margin-top: 32px;
}

.pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
}

.pagination .page-numbers.current,
.pagination a.page-numbers:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ---------- سربرگ آرشیو ---------- */
.page-head {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 40px 0 36px;
}

.page-head h1 {
  font-size: 28px;
  font-weight: 800;
}

.page-head p,
.page-head .archive-description {
  margin-top: 8px;
  max-width: 640px;
  color: var(--text-2);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--text-3);
  font-size: 13px;
}

.breadcrumb a {
  color: var(--text-2);
}

.breadcrumb a:hover {
  color: var(--link);
}

/* ---------- مقاله‌ی تکی ---------- */
.article-head {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 40px 0 0;
}

.article-head-inner {
  max-width: 800px;
  margin-inline: auto;
}

.article-head h1 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.55;
}

.article-lead {
  margin-top: 12px;
  color: var(--text-2);
  font-size: 16px;
}

.article-head .post-meta {
  margin-top: 16px;
  padding-top: 0;
  font-size: 13.5px;
}

.article-cover {
  max-width: 960px;
  margin: 32px auto -120px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface-2);
  aspect-ratio: 16 / 9;
}

.article-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-body {
  padding: 48px 0 56px;
}

.article-body.has-cover {
  padding-top: 160px;
}

.article-head.no-cover {
  padding-bottom: 36px;
}

.entry {
  max-width: 760px;
  margin-inline: auto;
  font-size: 16.5px;
  line-height: 2.1;
}

.entry > * + * {
  margin-top: 1.2em;
}

.entry h2 {
  margin-top: 2em;
  font-size: 23px;
  font-weight: 800;
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.entry h3 {
  margin-top: 1.7em;
  font-size: 19px;
  scroll-margin-top: calc(var(--header-h) + 16px);
}

.entry a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.entry ul,
.entry ol {
  padding-inline-start: 1.4em;
}

.entry li + li {
  margin-top: 0.4em;
}

.entry li::marker {
  color: var(--gold);
  font-weight: 700;
}

.entry strong {
  font-weight: 700;
}

.entry blockquote {
  margin-inline: 0;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-inline-start: 3px solid var(--cta);
  border-radius: var(--radius);
  color: var(--text-2);
}

.entry blockquote > * + * {
  margin-top: 0.6em;
}

.entry figure {
  margin-inline: 0;
}

.entry figure img,
.entry > p > img {
  display: block;
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.entry figcaption {
  margin-top: 8px;
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
}

.entry hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin-block: 2em;
}

.entry table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14.5px;
  line-height: 1.9;
}

.entry .wp-block-table {
  overflow-x: auto;
}

.entry th,
.entry td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: start;
  vertical-align: top;
}

.entry th {
  background: var(--surface-2);
  font-weight: 700;
}

.entry tr:last-child td {
  border-bottom: 0;
}

.entry code {
  padding: 2px 6px;
  background: var(--surface-2);
  border-radius: 6px;
  font-size: 0.9em;
}

/* جعبه‌ی نکته */
.entry .note {
  padding: 16px 20px;
  background: var(--primary-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.entry .note strong:first-child {
  color: var(--link);
}

.entry .disclaimer {
  margin-top: 2.4em;
  padding-top: 1.2em;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 13.5px;
  line-height: 1.9;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 760px;
  margin: 32px auto 0;
  padding: 0;
  list-style: none;
}

/* جعبه‌ی فراخوان */
.cta-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 760px;
  margin: 40px auto 0;
  padding: 24px;
}

.cta-box h2 {
  font-size: 19px;
  font-weight: 800;
}

.cta-box p {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 14px;
}

.band {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.band + .site-footer {
  border-top: 0;
}

/* ---------- صفحه‌ی ساده / ۴۰۴ ---------- */
.empty {
  padding: 72px 0;
  text-align: center;
}

.empty .code {
  font-size: 72px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-3);
}

.empty h1 {
  font-size: 24px;
  margin-top: 8px;
}

.empty p {
  margin-top: 8px;
  color: var(--text-2);
}

.empty .btn {
  margin-top: 24px;
}

/* ---------- دیدگاه‌ها ---------- */
.comments {
  max-width: 760px;
  margin: 48px auto 0;
}

.comments h2,
.comment-reply-title {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 16px;
}

.comment-list {
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
}

.comment-list .children {
  list-style: none;
  padding-inline-start: 24px;
}

.comment-body {
  padding: 16px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.comment-author .avatar {
  border-radius: 50%;
}

.comment-author .says {
  display: none;
}

.comment-metadata,
.comment-awaiting-moderation {
  color: var(--text-3);
  font-size: 12.8px;
}

.comment-content {
  margin-top: 8px;
  font-size: 14.5px;
}

.reply a,
.logged-in-as a,
.comment-metadata a:hover {
  color: var(--link);
  font-size: 13px;
}

.comment-form {
  display: grid;
  gap: 12px;
}

.comment-form label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-2);
  font-size: 13.5px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: 0;
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.comment-form .comment-notes,
.comment-form .logged-in-as,
.comment-form-cookies-consent {
  color: var(--text-3);
  font-size: 13px;
}

.comment-form-cookies-consent label {
  display: inline;
}

.comment-form .submit {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 18px;
  border: 0;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.comment-form .submit:hover {
  background: var(--primary-hover);
}

/* ---------- فوتر ---------- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 40px 0 32px;
  font-size: 14px;
  line-height: 1.8;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: 32px;
}

.footer-about .brand {
  margin-bottom: 12px;
}

.footer-about .lead {
  font-weight: 600;
}

.footer-about p + p {
  margin-top: 8px;
  color: var(--text-2);
}

.site-footer h2 {
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 700;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.site-footer li,
.site-footer li a {
  color: var(--text-2);
}

.site-footer li a:hover {
  color: var(--text);
}

.footer-bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 13px;
}

/* ---------- واکنش‌گرا ---------- */
@media (max-width: 1100px) {
  .header-actions .btn-login {
    display: none;
  }
}

@media (max-width: 960px) {
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .featured {
    grid-template-columns: 1fr;
  }

  .featured .post-card-thumb {
    aspect-ratio: 16 / 9;
    min-height: 0;
  }

  .featured .post-card-body {
    padding: 20px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    inset-inline: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 8px 16px 16px;
  }

  .main-nav.is-open {
    display: block;
  }

  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
  }

  .main-nav a {
    display: flex;
  }
}

@media (max-width: 640px) {
  .container {
    padding-inline: 16px;
  }

  .hero {
    padding: 40px 0 32px;
  }

  .hero h1,
  .article-head h1 {
    font-size: 25px;
  }

  .page-head h1 {
    font-size: 23px;
  }

  .post-grid {
    grid-template-columns: 1fr;
  }

  .featured .post-card-title {
    font-size: 20px;
  }

  .section {
    padding: 32px 0;
  }

  .entry {
    font-size: 15.5px;
    line-height: 2.05;
  }

  .entry h2 {
    font-size: 20px;
  }

  .article-cover {
    margin-bottom: -60px;
  }

  .article-body.has-cover {
    padding-top: 88px;
  }

  .cta-box {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .header-actions .btn-cta span.long {
    display: none;
  }

  .brand-tag {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
