/* =====================================================================
   Variables
   ===================================================================== */
:root {
  --accent:           #33BCF2;
  --accent-dark:      #1a9fd0;
  --accent-light:     #e3f6fd;
  --secondary:        #f47555;
  --secondary-dark:   #e05a35;
  --footer-bg:        #1a2332;
  --footer-text:      #8b949e;
  --footer-link:      #8b949e;
  --footer-heading:   #c9d1d9;
  --footer-brand:     #f0f6fc;
  --footer-divider:   rgba(255,255,255,.08);
  --card-border:      rgba(0,0,0,.08);
  --card-shadow:      0 2px 8px rgba(0,0,0,.06);
  --card-shadow-h:    0 6px 20px rgba(0,0,0,.14);
  --body-bg:          #F0EDE9;
  --card-bg:          #FDFCFB;
  --body-text:        #707070;
  --heading-text:     #555555;
  --text-muted-light: #888888;

  /* Override Bootstrap's global link and pagination colors to brand accent */
  --bs-link-color:                  #33BCF2;
  --bs-link-hover-color:            #1a9fd0;
  --bs-link-color-rgb:              51, 188, 242;
  --bs-link-hover-color-rgb:        26, 159, 208;
  --bs-pagination-color:            #33BCF2;
  --bs-pagination-hover-color:      #1a9fd0;
  --bs-pagination-hover-bg:         #e3f6fd;
  --bs-pagination-active-bg:        #33BCF2;
  --bs-pagination-active-border-color: #33BCF2;
  --bs-pagination-focus-color:      #33BCF2;
  --bs-pagination-focus-box-shadow: 0 0 0 .25rem rgba(51,188,242,.25);
}

[data-bs-theme="dark"] {
  --accent:           #33BCF2;
  --accent-dark:      #5dd5ff;
  --accent-light:     #0b2d40;
  --secondary:        #f47555;
  --card-border:      rgba(255,255,255,.08);
  --card-shadow:      0 2px 8px rgba(0,0,0,.3);
  --card-shadow-h:    0 6px 20px rgba(0,0,0,.5);
  --body-bg:          #131920;    /* dark blue-gray, not pure black            */
  --card-bg:          #1c2430;    /* slightly lighter than body for dark mode  */
  --body-text:        #cdd5de;    /* warm off-white, not pure white            */
  --heading-text:     #dde6f0;    /* slightly muted white for headings         */
  --text-muted-light: #778899;
}

/* =====================================================================
   Base
   ===================================================================== */
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--body-bg);
  color: var(--body-text);
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
}
main { flex: 1; }
img { max-width: 100%; height: auto; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, h5, h6 { color: var(--heading-text); }

/* =====================================================================
   Navbar  — fully explicit, zero Bootstrap theme dependency
   ===================================================================== */

/* Background: hardcoded so no CSS-variable scoping can break it */
.site-navbar {
  background: #33BCF2 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  padding-top: .55rem;
  padding-bottom: .55rem;
}
[data-bs-theme="dark"] .site-navbar {
  background: #161b22 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.45);
}

/* Brand text */
.site-navbar .navbar-brand,
.site-navbar .navbar-brand:hover,
.site-navbar .navbar-brand:focus {
  color: #fff;
  text-decoration: none;
}
[data-bs-theme="dark"] .site-navbar .navbar-brand {
  color: #e6edf3;
}
.brand-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: inherit;
  letter-spacing: -.3px;
}

/* Hamburger toggler — white lines on colored background */
.site-navbar .navbar-toggler {
  border-color: rgba(255,255,255,.5);
  padding: .3rem .6rem;
}
.site-navbar .navbar-toggler:focus {
  box-shadow: 0 0 0 .2rem rgba(255,255,255,.25);
}
.site-navbar .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255%2C255%2C255%2C0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
[data-bs-theme="dark"] .site-navbar .navbar-toggler {
  border-color: rgba(255,255,255,.3);
}

/* Nav links — reset every Bootstrap state so nothing bleeds through */
.site-navbar .navbar-nav .nav-link {
  font-size: .9375rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .045em;
  padding: .4rem .85rem !important;
  border-radius: .4rem;
  color: rgba(255,255,255,.92) !important;
  background: transparent;
  transition: background .15s, color .15s;
}
.site-navbar .navbar-nav .nav-link:hover,
.site-navbar .navbar-nav .nav-link:focus,
.site-navbar .navbar-nav .nav-link.active,
.site-navbar .navbar-nav .nav-link.show,
.site-navbar .navbar-nav .show > .nav-link {
  color: #ffffff !important;
  background: rgba(255,255,255,.18);
  text-decoration: none;
}
[data-bs-theme="dark"] .site-navbar .navbar-nav .nav-link {
  color: rgba(230,237,243,.85) !important;
}
[data-bs-theme="dark"] .site-navbar .navbar-nav .nav-link:hover,
[data-bs-theme="dark"] .site-navbar .navbar-nav .nav-link:focus,
[data-bs-theme="dark"] .site-navbar .navbar-nav .nav-link.active,
[data-bs-theme="dark"] .site-navbar .navbar-nav .show > .nav-link {
  color: #e6edf3 !important;
  background: rgba(255,255,255,.1);
}

/* Dropdown caret inherits from nav-link color — force it white too */
.site-navbar .navbar-nav .dropdown-toggle::after {
  border-top-color: rgba(255,255,255,.85);
}

/* Dropdown menu panel (Bootstrap themes it automatically in dark mode) */
.site-navbar .dropdown-menu {
  border: 1px solid var(--card-border);
  border-radius: .6rem;
  font-size: .875rem;
  padding: .4rem;
  margin-top: .35rem;
}
.site-navbar .dropdown-item {
  border-radius: .4rem;
  padding: .45rem .85rem;
}
.site-navbar .dropdown-item:hover {
  background: var(--accent-light);
  color: var(--accent);
}

/* Navbar action buttons (theme toggle, login, user menu) */
.btn-nav {
  color: rgba(255,255,255,.9);
  border: 1px solid rgba(255,255,255,.5);
  background: transparent;
  font-size: .8125rem;
  line-height: 1.4;
  transition: color .15s, border-color .15s, background .15s;
  text-decoration: none !important;
}
.btn-nav:hover,
.btn-nav:focus {
  color: #fff;
  border-color: #fff;
  background: rgba(255,255,255,.15);
  box-shadow: none;
}
[data-bs-theme="dark"] .btn-nav {
  color: rgba(230,237,243,.8);
  border-color: rgba(255,255,255,.3);
}
[data-bs-theme="dark"] .btn-nav:hover,
[data-bs-theme="dark"] .btn-nav:focus {
  color: #e6edf3;
  border-color: rgba(255,255,255,.55);
  background: rgba(255,255,255,.08);
}

/* =====================================================================
   Buttons
   ===================================================================== */
.btn-primary {
  background-color: var(--accent) !important;
  border-color: var(--accent) !important;
}
.btn-primary:hover {
  background-color: var(--accent-dark) !important;
  border-color: var(--accent-dark) !important;
}

/* =====================================================================
   Hero
   ===================================================================== */
.site-hero {
  background: linear-gradient(135deg, #33BCF2 0%, #1a7abf 100%);
  color: #fff;
  padding: 4rem 0 3.5rem;
  position: relative;
  overflow: hidden;
}
.site-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.site-hero .container { position: relative; }
.hero-title { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; }
.hero-sub   { opacity: .85; font-size: 1.05rem; }

/* =====================================================================
   Section headers
   ===================================================================== */
.section-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.section-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}
.section-accent {
  display: inline-block;
  width: 4px;
  height: 1.5rem;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

/* =====================================================================
   Category cards
   ===================================================================== */
.cat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: .8rem;
  padding: 1.75rem 1.5rem;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  display: block;
  text-decoration: none !important;
  height: 100%;
}
.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-h);
  border-color: var(--accent);
}
.cat-card .cat-icon {
  font-size: 2.4rem;
  color: var(--accent);
  margin-bottom: .75rem;
  display: block;
}
.cat-card .cat-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: .3rem;
}
.cat-card .cat-count {
  font-size: .8rem;
  color: var(--text-muted-light);
}

/* =====================================================================
   Post cards
   ===================================================================== */
.post-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: .8rem;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: transform .2s, box-shadow .2s;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;   /* required for stretched-link ::after */
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-h);
}
.post-card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--accent-light);
}
.post-card-img-placeholder {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 2.5rem;
}
.post-card-body {
  padding: 1.1rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.post-card-cat {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #fff;
  background: var(--secondary);
  padding: .2rem .6rem;
  border-radius: 2rem;
  margin-bottom: .6rem;
  text-decoration: none !important;
  position: relative;   /* float above stretched-link ::after overlay */
  z-index: 2;
}
.post-card-cat:hover { background: var(--secondary-dark); color: #fff; text-decoration: none; }
.post-card-title {
  font-size: .975rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: .5rem;
}
.post-card-title a { color: inherit; text-decoration: none; }
.post-card-title a:hover { color: var(--accent); text-decoration: none; }
.post-card-excerpt {
  font-size: .82rem;
  color: var(--text-muted-light);
  flex: 1;
  margin-bottom: .75rem;
  line-height: 1.6;
}
.post-card-meta {
  font-size: .75rem;
  color: var(--text-muted-light);
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: auto;
  padding-top: .75rem;
  border-top: 1px solid var(--card-border);
}

/* Persian post cards */
.post-card-body[dir="rtl"] {
  font-family: 'Vazirmatn', Tahoma, 'Noto Naskh Arabic', Arial, sans-serif;
  text-align: right;
}
.post-card-body[dir="rtl"] .post-card-title { text-align: right; }
.post-card-body[dir="rtl"] .post-card-excerpt {
  text-align: right;
  line-height: 1.95;
}
.post-card-body[dir="rtl"] .post-card-meta { flex-direction: row-reverse; }

/* =====================================================================
   Article / single post
   ===================================================================== */
.article-header { margin-bottom: 2rem; }
.article-title {
  font-size: clamp(1.6rem, 3.5vw, 2.375rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--heading-text);
}
.article-meta {
  font-size: .82rem;
  color: var(--text-muted-light);
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
}
.article-featured-img {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  border-radius: .8rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--card-shadow);
}

/* ── English / LTR article body ─────────────────────────────────────── */
.article-body {
  font-size: 1.0625rem;        /* 17px — slightly larger than base for comfort */
  line-height: 1.9;
  color: var(--body-text);
  max-width: 72ch;             /* keeps line length readable                  */
}
.article-body p {
  margin-bottom: 1.35rem;
}
.article-body h2 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--heading-text);
  margin-top: 2.5rem;
  margin-bottom: .8rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--accent-light);
}
.article-body h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--heading-text);
  margin-top: 2rem;
  margin-bottom: .65rem;
}
.article-body h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--heading-text);
  margin-top: 1.5rem;
  margin-bottom: .5rem;
}
.article-body ul,
.article-body ol {
  padding-left: 1.75rem;
  margin-bottom: 1.35rem;
}
.article-body li {
  margin-bottom: .55rem;
  line-height: 1.8;
}
.article-body strong { color: var(--heading-text); }
.article-body a { color: var(--accent); }
.article-body a:hover { color: var(--secondary); text-decoration: underline; }
.article-body img {
  border-radius: .5rem;
  margin: 1.25rem 0;
  max-width: 100%;
}
.article-body blockquote {
  border-left: 4px solid var(--accent);
  padding: 1rem 1.35rem;
  margin: 1.75rem 0;
  background: var(--accent-light);
  border-radius: 0 .5rem .5rem 0;
  font-style: italic;
  color: var(--body-text);
}

/* ── Persian / RTL article body ─────────────────────────────────────── */
article[dir="rtl"] .article-body {
  font-family: 'Vazirmatn', Tahoma, 'Noto Naskh Arabic', Arial, sans-serif;
  font-size: 1.125rem;         /* 18px — Persian glyphs need slightly more space */
  line-height: 2.15;
  text-align: right;
  direction: rtl;
}
article[dir="rtl"] .article-body p {
  margin-bottom: 1.5rem;
}
article[dir="rtl"] .article-body h2,
article[dir="rtl"] .article-body h3,
article[dir="rtl"] .article-body h4 {
  font-family: 'Vazirmatn', Tahoma, 'Noto Naskh Arabic', Arial, sans-serif;
  text-align: right;
}
article[dir="rtl"] .article-body ul,
article[dir="rtl"] .article-body ol {
  padding-left: 0;
  padding-right: 1.75rem;
  text-align: right;
}
article[dir="rtl"] .article-body li {
  line-height: 2.1;
  margin-bottom: .65rem;
}
article[dir="rtl"] .article-body blockquote {
  border-left: none;
  border-right: 4px solid var(--accent);
  border-radius: .5rem 0 0 .5rem;
  text-align: right;
}
/* RTL page-level (html dir=rtl) adjustments */
[dir="rtl"] .breadcrumb-item + .breadcrumb-item { padding-right: .5rem; padding-left: 0; }
[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before { float: right; padding-right: 0; padding-left: .5rem; }
[dir="rtl"] .article-title { text-align: right; font-family: 'Vazirmatn', Tahoma, Arial, sans-serif; }
[dir="rtl"] .article-meta  { flex-direction: row-reverse; }

/* ── .text-rtl div (WordPress migration wrapper) ─────────────────────
   Ensures RTL styling even when a single article paragraph appears on
   an otherwise LTR listing page.                                        */
.text-rtl {
  font-family: 'Vazirmatn', Tahoma, 'Noto Naskh Arabic', Arial, sans-serif;
  font-size: 1.125rem;
  line-height: 2.1;
  direction: rtl;
  text-align: right;
}
.text-rtl p {
  margin-bottom: 1.5rem;
  text-align: right;
  direction: rtl;
}
/* Paragraph visual separator: subtle top border on every p except the first */
.text-rtl p + p {
  padding-top: .25rem;
  border-top: 1px solid var(--card-border);
}
/* Author / date info block at top of Persian articles */
.text-rtl .topic-info,
.article-body .topic-info {
  display: block;
  background: var(--accent-light);
  color: var(--text-muted-light);
  font-size: .875rem;
  line-height: 1.8;
  padding: .65rem 1rem;
  border-radius: .5rem;
  margin-bottom: 1.75rem;
  direction: rtl;
  text-align: right;
  white-space: pre-line;    /* preserves the author/date line breaks         */
}

/* =====================================================================
   Breadcrumb
   ===================================================================== */
.breadcrumb-nav {
  font-size: .82rem;
  margin-bottom: 1.25rem;
}
.breadcrumb { margin: 0; background: none; padding: 0; }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted-light); }
.breadcrumb-item a { color: var(--accent); }

/* =====================================================================
   Empty state
   ===================================================================== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted-light);
}
.empty-state i { font-size: 3rem; margin-bottom: 1rem; display: block; opacity: .4; }
.empty-state p { max-width: 360px; margin: 0 auto; }

/* =====================================================================
   Flash alerts
   ===================================================================== */
.flash-alert { border-radius: .6rem; border-left: 4px solid; }

/* =====================================================================
   Auth / Login card
   ===================================================================== */
.auth-card {
  max-width: 420px;
  margin: 4rem auto 2rem;
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  box-shadow: var(--card-shadow-h);
  overflow: hidden;
}
.auth-card-header {
  background: linear-gradient(135deg, #33BCF2 0%, #1a7abf 100%);
  color: #fff;
  padding: 2rem 1.5rem;
  text-align: center;
}
.auth-card-body { padding: 2rem 1.75rem; }

/* =====================================================================
   Province grid
   ===================================================================== */
.province-card {
  border: 1px solid var(--card-border);
  border-radius: .7rem;
  padding: 1.1rem 1rem;
  text-align: center;
  text-decoration: none !important;
  display: block;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.province-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-h);
  border-color: var(--accent);
  color: var(--accent);
}
.province-card img {
  width: 60px;
  height: 40px;
  object-fit: cover;
  border-radius: .3rem;
  margin-bottom: .5rem;
}
.province-card .prov-name { font-size: .875rem; font-weight: 600; }

/* =====================================================================
   Gallery grid
   ===================================================================== */
.gallery-img-wrap {
  overflow: hidden;
  border-radius: .6rem;
  border: 1px solid var(--card-border);
  cursor: pointer;
}
.gallery-img-wrap img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform .3s;
  display: block;
}
.gallery-img-wrap:hover img { transform: scale(1.06); }

/* =====================================================================
   Footer
   ===================================================================== */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  margin-top: auto;
}
.footer-brand   { color: var(--footer-brand) !important; }
.footer-heading { color: var(--footer-heading); }
.footer-muted   { color: var(--footer-text); }
.footer-link    { color: var(--footer-link); transition: color .15s; }
.footer-link:hover { color: var(--accent) !important; text-decoration: none; }
.footer-divider { border-color: var(--footer-divider); }

/* =====================================================================
   RTL (layout-level — font/article rules are in the article section)
   ===================================================================== */
[dir="rtl"] .section-header { flex-direction: row-reverse; }
[dir="rtl"] .post-card-meta { flex-direction: row-reverse; }
[dir="rtl"] .site-footer    { text-align: right; }

/* =====================================================================
   Utilities
   ===================================================================== */
.fw-800 { font-weight: 800; }
.rounded-xl { border-radius: 1rem !important; }
.text-accent { color: var(--accent) !important; }
.text-secondary-accent { color: var(--secondary) !important; }
.bg-accent-light { background: var(--accent-light) !important; }
.badge-cat {
  background: var(--secondary);
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  padding: .25rem .65rem;
  border-radius: 2rem;
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 576px) {
  .site-hero { padding: 2.5rem 0 2rem; }
  .hero-title { font-size: 1.6rem; }
  .auth-card-body { padding: 1.5rem; }
}
