/*
Theme Name: Bazar Salam
Theme URI: https://bazar-salam.ir/
Author: Bazar Salam
Description: قالب عملیاتی بازارسلام برای شبکه کالایابی، داشبورد درخواست‌دهنده و پنل کالایاب.
Version: 2.4.0
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: bazar-salam-theme
*/

:root {
  --bsl-brand: #197149;
  --bsl-brand-dark: #0f5334;
  --bsl-accent: #e0a52c;
  --bsl-page-bg: #fbfdfb;
  --bsl-surface: #fff;
  --bsl-ink: #17221b;
  --bsl-muted: #627066;
  --bsl-line: #dce5de;
  --bsl-shadow: 0 20px 60px rgba(17, 64, 39, .10);
  --bsl-font: "Vazirmatn", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; direction: rtl; }
body {
  margin: 0;
  direction: rtl;
  color: var(--bsl-ink);
  background: var(--bsl-page-bg);
  font-family: var(--bsl-font);
  -webkit-font-smoothing: antialiased;
}
body.bsl-menu-is-open { overflow: hidden; }
body, button, input, select, textarea, table { font-family: var(--bsl-font); }
input[type=tel], input[type=email], input[type=url], input[inputmode=numeric], .ltr { direction: ltr; text-align: left; }
:where(p, li, dd, td) { text-wrap: pretty; }
a { color: var(--bsl-brand-dark); }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }
.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px;
}
.bsl-skip-link {
  position: fixed; right: 16px; top: -80px; z-index: 99999;
  background: var(--bsl-ink); color: #fff; padding: 10px 16px; border-radius: 10px; text-decoration: none;
}
.bsl-skip-link:focus { top: 16px; }

/* Header */
.bsl-site-header {
  z-index: 1000;
  border-bottom: 1px solid rgba(205, 220, 210, .8);
  background: rgba(251, 253, 251, .92);
  backdrop-filter: blur(18px);
}
.bsl-has-sticky-header .bsl-site-header { position: sticky; top: 0; }
.admin-bar.bsl-has-sticky-header .bsl-site-header { top: 32px; }
.bsl-header-inner {
  max-width: 1240px; min-height: 76px; margin: 0 auto; padding: 10px 24px;
  display: flex; align-items: center; gap: 24px;
}
.bsl-brand-area { display: flex; align-items: center; gap: 12px; min-width: 230px; }
.bsl-brand-mark {
  width: 46px; height: 46px; flex: 0 0 46px; border-radius: 15px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px; font-weight: 900; text-decoration: none;
  background: linear-gradient(145deg, var(--bsl-brand), var(--bsl-brand-dark));
  box-shadow: 0 13px 30px rgba(15, 83, 52, .23);
}
.custom-logo-link { display: inline-flex; align-items: center; }
.custom-logo { max-height: 52px; width: auto; }
.bsl-brand-copy { display: flex; flex-direction: column; gap: 3px; }
.bsl-site-name { color: var(--bsl-ink); font-size: 19px; font-weight: 900; text-decoration: none; white-space: nowrap; }
.bsl-brand-copy span { color: var(--bsl-muted); font-size: 11px; white-space: nowrap; }
.bsl-primary-nav { margin-right: auto; }
.bsl-nav-list { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.bsl-nav-list > li { position: relative; }
.bsl-nav-list a {
  display: block; padding: 10px 12px; border-radius: 10px;
  color: var(--bsl-ink); font-size: 14px; font-weight: 750; text-decoration: none; transition: .2s ease;
}
.bsl-nav-list a:hover, .bsl-nav-list .current-menu-item > a, .bsl-nav-list .current_page_item > a {
  color: var(--bsl-brand-dark); background: rgba(25, 113, 73, .08);
}
.bsl-nav-list .sub-menu {
  display: none; position: absolute; top: 100%; right: 0; min-width: 220px; margin: 0; padding: 9px;
  list-style: none; border: 1px solid var(--bsl-line); border-radius: 15px; background: #fff; box-shadow: var(--bsl-shadow);
}
.bsl-nav-list li:hover > .sub-menu, .bsl-nav-list li:focus-within > .sub-menu { display: block; }
.bsl-header-cta {
  white-space: nowrap; padding: 11px 18px; border-radius: 12px; color: #fff; text-decoration: none; font-weight: 800;
  background: linear-gradient(135deg, var(--bsl-brand), var(--bsl-brand-dark));
  box-shadow: 0 12px 28px rgba(15, 83, 52, .20); transition: .2s ease;
}
.bsl-header-cta:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 16px 34px rgba(15, 83, 52, .27); }
.bsl-menu-toggle { display: none; width: 44px; height: 44px; padding: 10px; border: 1px solid var(--bsl-line); border-radius: 12px; background: #fff; cursor: pointer; }
.bsl-menu-toggle span:not(.screen-reader-text) { display: block; width: 21px; height: 2px; margin: 4px auto; background: var(--bsl-ink); transition: .2s ease; }

/* Main and generic content */
.bsl-main-content { min-height: 60vh; }
.bsl-managed-page { margin: 0; }
.bsl-content-page { max-width: 920px; margin: 0 auto; padding: 64px 22px 80px; }
.bsl-content-header { margin-bottom: 30px; }
.bsl-content-header > span {
  display: inline-flex; padding: 7px 12px; border-radius: 999px; background: #e2f3e9;
  color: var(--bsl-brand-dark); font-size: 13px; font-weight: 800;
}
.bsl-content-header h1 { margin: 12px 0; font-size: clamp(32px, 5vw, 52px); line-height: 1.35; letter-spacing: -.025em; }
.bsl-content-header p { color: var(--bsl-muted); font-size: 17px; line-height: 2; }
.bsl-content-body { color: var(--bsl-ink); font-size: 16px; line-height: 2.05; }
.bsl-content-body h2 { margin-top: 2.2em; font-size: 28px; line-height: 1.5; }
.bsl-content-body h3 { margin-top: 1.8em; font-size: 21px; }
.bsl-content-body a { font-weight: 700; }
.bsl-content-body table { width: 100%; border-collapse: collapse; margin: 24px 0; overflow: hidden; border-radius: 14px; }
.bsl-content-body th, .bsl-content-body td { padding: 14px; border-bottom: 1px solid var(--bsl-line); text-align: right; }
.bsl-content-body th { background: #eff7f2; }
.bsl-content-body blockquote { margin: 24px 0; padding: 18px 20px; border-right: 4px solid var(--bsl-brand); background: #eff8f2; border-radius: 12px; }
.bsl-breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; color: var(--bsl-muted); font-size: 13px; margin-bottom: 28px; }
.bsl-breadcrumb a { text-decoration: none; }
.bsl-guide-bottom-cta {
  margin-top: 48px; padding: 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  border-radius: 22px; background: linear-gradient(135deg, #143e2a, #1f6845); color: #fff;
}
.bsl-guide-bottom-cta strong, .bsl-guide-bottom-cta span { display: block; }
.bsl-guide-bottom-cta span { opacity: .85; margin-top: 6px; }
.bsl-guide-bottom-cta a { padding: 11px 16px; border-radius: 10px; background: #fff; color: var(--bsl-brand-dark); text-decoration: none; font-weight: 800; white-space: nowrap; }
.bsl-post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.bsl-post-card { padding: 24px; border: 1px solid var(--bsl-line); border-radius: 20px; background: #fff; box-shadow: 0 10px 30px rgba(17,64,39,.05); }
.bsl-post-card > span { color: var(--bsl-brand-dark); font-size: 12px; font-weight: 800; }
.bsl-post-card h2 { font-size: 22px; }
.bsl-post-card h2 a { color: var(--bsl-ink); text-decoration: none; }
.bsl-post-card p { color: var(--bsl-muted); line-height: 1.9; }
.bsl-empty-state { grid-column: 1 / -1; padding: 46px; text-align: center; border: 1px dashed #b8ccbd; border-radius: 20px; background: #f3f9f5; }

/* Footer */
.bsl-site-footer { background: linear-gradient(180deg, #f2f8f4, #e9f4ed); border-top: 1px solid var(--bsl-line); }
.bsl-footer-inner { max-width: 1240px; margin: 0 auto; padding: 52px 24px 38px; display: grid; grid-template-columns: 1.35fr .8fr .8fr; gap: 48px; }
.bsl-footer-logo-row { display: flex; align-items: center; gap: 12px; font-size: 20px; }
.bsl-brand-mark--footer { width: 40px; height: 40px; flex-basis: 40px; border-radius: 13px; }
.bsl-footer-brand p, .bsl-footer-note p { color: var(--bsl-muted); line-height: 2; }
.bsl-footer-nav h2, .bsl-footer-note h2 { font-size: 16px; }
.bsl-footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bsl-footer-links a { color: var(--bsl-ink); text-decoration: none; }
.bsl-footer-links a:hover { color: var(--bsl-brand-dark); }
.bsl-footer-contact, .bsl-social-links { display: flex; flex-wrap: wrap; gap: 10px; }
.bsl-footer-contact a, .bsl-social-links a { padding: 7px 10px; border-radius: 9px; background: rgba(255,255,255,.65); text-decoration: none; font-size: 13px; }
.bsl-footer-bottom { max-width: 1240px; margin: 0 auto; padding: 18px 24px 24px; border-top: 1px solid rgba(190,210,197,.7); display: flex; justify-content: space-between; gap: 20px; color: var(--bsl-muted); font-size: 12px; }

/* 404 */
.bsl-error-page { max-width: 680px; margin: 0 auto; padding: 90px 22px; text-align: center; }
.bsl-error-graphic { width: 180px; height: 180px; margin: 0 auto 24px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #fff, #e3f3e9); box-shadow: var(--bsl-shadow); }
.bsl-error-graphic span { color: var(--bsl-brand-dark); font-size: 50px; font-weight: 900; }
.bsl-error-page h1 { font-size: 42px; }
.bsl-error-page p { color: var(--bsl-muted); }
.bsl-error-page > div:last-child { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }
.bsl-theme-button { display: inline-flex; padding: 11px 18px; border-radius: 11px; background: var(--bsl-brand); color: #fff; text-decoration: none; font-weight: 800; }
.bsl-theme-button--ghost { background: #fff; color: var(--bsl-brand-dark); border: 1px solid var(--bsl-line); }

@media (max-width: 1080px) {
  .bsl-header-inner { gap: 14px; }
  .bsl-brand-copy span { display: none; }
  .bsl-brand-area { min-width: auto; }
  .bsl-nav-list a { padding-inline: 9px; font-size: 13px; }
}
@media (max-width: 980px) {
  .admin-bar.bsl-has-sticky-header .bsl-site-header { top: 46px; }
  .bsl-header-inner { min-height: 68px; padding-inline: 16px; }
  .bsl-primary-nav {
    display: none; position: fixed; inset: 69px 0 auto 0; max-height: calc(100vh - 69px); overflow: auto;
    padding: 18px; background: rgba(251,253,251,.98); border-bottom: 1px solid var(--bsl-line); box-shadow: 0 20px 40px rgba(17,64,39,.10);
  }
  .admin-bar .bsl-primary-nav { inset-block-start: 115px; }
  .bsl-primary-nav.is-open { display: block; }
  .bsl-nav-list { display: grid; gap: 4px; }
  .bsl-nav-list a { padding: 13px 14px; font-size: 15px; }
  .bsl-nav-list .sub-menu { display: block; position: static; box-shadow: none; border: 0; background: transparent; padding-right: 18px; }
  .bsl-menu-toggle { display: block; margin-right: auto; }
  .bsl-header-cta { display: none; }
  .bsl-footer-inner { grid-template-columns: 1fr 1fr; }
  .bsl-footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .bsl-site-name { font-size: 16px; }
  .bsl-brand-mark { width: 40px; height: 40px; flex-basis: 40px; }
  .bsl-content-page { padding: 44px 16px 60px; }
  .bsl-content-header h1 { font-size: 34px; }
  .bsl-post-grid, .bsl-footer-inner { grid-template-columns: 1fr; }
  .bsl-footer-brand { grid-column: auto; }
  .bsl-footer-bottom { flex-direction: column; }
  .bsl-guide-bottom-cta { align-items: stretch; flex-direction: column; }
  .bsl-error-page > div:last-child { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Logged-in account controls — v1.2.0 */
.bsl-header-account{display:flex;align-items:center;gap:7px;margin-right:10px}.bsl-header-account__dashboard{display:flex;align-items:center;gap:8px;padding:6px 8px 6px 11px;border:1px solid #d5e5da;border-radius:13px;background:#fff;color:#153b29;text-decoration:none;transition:.18s}.bsl-header-account__dashboard:hover{border-color:var(--bsl-brand-color,#197149);color:var(--bsl-brand-dark,#0f5334);transform:translateY(-1px)}.bsl-header-account__dashboard>span{display:grid;place-items:center;width:31px;height:31px;border-radius:10px;background:#197149;color:#fff;font-size:13px;font-weight:900}.bsl-header-account__dashboard strong{font-size:11px}.bsl-header-account__logout{padding:9px 10px;border-radius:10px;background:#fff0ee;color:#9b3029;text-decoration:none;font-size:10px;font-weight:900}.bsl-header-account__logout:hover{color:#7c211d;background:#ffe5e1}.bsl-nav-logout{display:none}
@media(max-width:920px){.bsl-header-account{margin-right:auto}.bsl-header-account__dashboard strong{display:none}.bsl-header-account__dashboard{padding:5px}.bsl-header-account__logout{display:none}.bsl-nav-logout{display:list-item}}
.bsl-article-featured{margin:0 0 32px}.bsl-article-featured img{display:block;width:100%;border-radius:22px}.bsl-article-single .bsl-content-header small{color:var(--bsl-muted)}

/* Article taxonomy and editorial metadata — 2.3 */
.bsl-article-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; color: var(--bsl-muted); }
.bsl-article-meta small { display: inline-flex; align-items: center; gap: 5px; }
.bsl-article-meta a { color: inherit; text-underline-offset: 3px; }
.bsl-article-taxonomy { margin: 32px 0 10px; padding: 22px; border: 1px solid var(--bsl-line); border-radius: 18px; background: var(--bsl-surface); }
.bsl-article-taxonomy > strong { display: block; margin-bottom: 12px; }
.bsl-article-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.bsl-article-tags a { display: inline-flex; padding: 7px 12px; border: 1px solid var(--bsl-line); border-radius: 999px; background: #f5faf7; color: var(--bsl-brand-dark); font-size: 13px; font-weight: 700; text-decoration: none; }
.bsl-article-tags a:hover { border-color: var(--bsl-brand); background: #edf8f1; }
.bsl-content-body .bsl-article-callout { margin: 24px 0; padding: 18px 20px; border-right: 4px solid var(--bsl-brand); border-radius: 14px; background: #f1f8f4; }
.bsl-content-body .bsl-article-callout--warning { border-right-color: var(--bsl-accent); background: #fff9eb; }
.bsl-content-body .bsl-article-table-wrap { margin: 24px 0; overflow-x: auto; border: 1px solid var(--bsl-line); border-radius: 14px; }
.bsl-content-body .bsl-article-table-wrap table { width: 100%; min-width: 620px; border-collapse: collapse; }
.bsl-content-body .bsl-article-table-wrap th, .bsl-content-body .bsl-article-table-wrap td { padding: 13px 15px; border-bottom: 1px solid var(--bsl-line); text-align: right; vertical-align: top; }
.bsl-content-body .bsl-article-table-wrap th { background: #f2f7f4; }
.bsl-content-body .bsl-related-inline { padding-right: 20px; }
.bsl-content-body .bsl-related-inline li { margin-bottom: 10px; }
