/*
Theme Name: Borhan
Theme URI: https://borhanilf.ir/
Author: Borhan International Legal Foundation
Author URI: https://borhanilf.ir/
Description: قالب اختصاصی راست‌به‌چپ بنیاد حقوقی بین‌المللی برهان، منطبق با هویت بصری و معماری محتوای برند.
Version: 1.0.0
Requires at least: 6.2
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: borhan
Tags: rtl-language-support, custom-logo, custom-menu, featured-images, blog, one-column, accessibility-ready
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

:root {
  --borhan-primary: #0E8F96;
  --borhan-primary-dark: #0A5E66;
  --borhan-gold: #D5A52A;
  --borhan-cream: #F6F2EA;
  --borhan-charcoal: #17343A;
  --borhan-white: #FFFFFF;
  --borhan-muted: #6E7D80;
  --borhan-border: rgba(23, 52, 58, .13);
  --borhan-shadow: 0 18px 50px rgba(16, 58, 63, .10);
  --borhan-radius: 18px;
  --borhan-container: 1220px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  direction: rtl;
  background: #fff;
  color: var(--borhan-charcoal);
  font-family: Vazirmatn, IRANSansX, IRANSans, Tahoma, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.95;
  -webkit-font-smoothing: antialiased;
}
body.admin-bar .site-header { top: 32px; }
img { max-width: 100%; height: auto; }
a { color: var(--borhan-primary-dark); text-decoration: none; transition: .2s ease; }
a:hover { color: var(--borhan-primary); }
button, input, textarea, select { font: inherit; }
.container { width: min(calc(100% - 40px), var(--borhan-container)); margin-inline: auto; }
.screen-reader-text { position: absolute; clip: rect(1px,1px,1px,1px); width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { clip: auto; width: auto; height: auto; top: 10px; right: 10px; z-index: 9999; padding: 10px 16px; background: #fff; }

/* Top bar */
.topbar { background: var(--borhan-primary-dark); color: #fff; font-size: 13px; }
.topbar-inner { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.topbar-contact, .topbar-social { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.topbar a { color: #fff; opacity: .95; }
.topbar a:hover { color: #fff; opacity: 1; }
.topbar-item { display: inline-flex; align-items: center; gap: 8px; }
.topbar-item svg { width: 17px; height: 17px; stroke: var(--borhan-gold); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--borhan-border); backdrop-filter: blur(16px); }
.header-inner { min-height: 84px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 34px; }
.site-branding { min-width: 178px; }
.custom-logo-link { display: inline-flex; align-items: center; }
.custom-logo { width: auto; max-height: 60px; }
.text-logo { display: inline-flex; flex-direction: column; line-height: 1.25; color: var(--borhan-primary-dark); }
.text-logo strong { font-size: 35px; font-weight: 900; letter-spacing: -.8px; }
.text-logo span { font-size: 11px; font-weight: 700; }
.primary-navigation ul { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.primary-navigation li { position: relative; }
.primary-navigation a { display: block; padding: 12px 15px; color: var(--borhan-charcoal); font-size: 14px; font-weight: 700; }
.primary-navigation a:hover, .primary-navigation .current-menu-item > a { color: var(--borhan-primary); }
.primary-navigation .current-menu-item > a::after { content: ''; display: block; height: 2px; width: 26px; margin: 7px auto -9px; background: var(--borhan-gold); }
.primary-navigation .sub-menu { display: none; position: absolute; top: 100%; right: 0; min-width: 230px; padding: 10px; background: #fff; box-shadow: var(--borhan-shadow); border: 1px solid var(--borhan-border); border-radius: 12px; }
.primary-navigation li:hover > .sub-menu { display: block; }
.primary-navigation .sub-menu a { padding: 9px 12px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.menu-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--borhan-border); border-radius: 10px; background: #fff; color: var(--borhan-primary-dark); cursor: pointer; }
.menu-toggle span, .menu-toggle::before, .menu-toggle::after { content: ''; display: block; width: 21px; height: 2px; margin: 4px auto; background: currentColor; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 50px; padding: 10px 23px; border: 1px solid transparent; border-radius: 8px; font-weight: 800; font-size: 14px; cursor: pointer; transition: .2s ease; }
.button-primary { background: var(--borhan-primary-dark); color: #fff; box-shadow: 0 10px 25px rgba(10,94,102,.18); }
.button-primary:hover { background: var(--borhan-primary); color: #fff; transform: translateY(-2px); }
.button-gold { background: var(--borhan-gold); color: var(--borhan-charcoal); }
.button-gold:hover { background: #e2b63f; color: var(--borhan-charcoal); transform: translateY(-2px); }
.button-outline { border-color: var(--borhan-primary-dark); color: var(--borhan-primary-dark); background: transparent; }
.button-outline:hover { background: var(--borhan-primary-dark); color: #fff; }
.button svg { width: 18px; height: 18px; }

/* Hero */
.hero { position: relative; overflow: hidden; background: linear-gradient(125deg, #fff 0%, var(--borhan-cream) 100%); }
.hero::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 22% 15%, rgba(14,143,150,.08), transparent 30%); }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.04fr .96fr; min-height: 560px; }
.hero-content { display: flex; flex-direction: column; justify-content: center; padding: 74px 0 80px 55px; }
.eyebrow { margin: 0 0 14px; color: var(--borhan-gold); font-weight: 900; font-size: 15px; }
.hero h1 { margin: 0; max-width: 650px; color: var(--borhan-primary-dark); font-size: clamp(38px, 5vw, 66px); line-height: 1.35; letter-spacing: -2px; }
.hero h1 small { display: block; margin-top: 8px; font-size: .66em; color: var(--borhan-charcoal); }
.hero-text { max-width: 640px; margin: 22px 0 28px; color: #40575B; font-size: 18px; }
.hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hero-media { min-height: 560px; position: relative; overflow: hidden; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to left, rgba(255,255,255,.05), rgba(246,242,234,.15)); }

/* Trust strip */
.trust-wrap { position: relative; z-index: 4; margin-top: -38px; }
.trust-strip { display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border: 1px solid var(--borhan-border); border-radius: 14px; box-shadow: var(--borhan-shadow); overflow: hidden; }
.trust-item { min-height: 84px; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 16px; text-align: right; font-weight: 800; }
.trust-item + .trust-item { border-right: 1px solid var(--borhan-border); }
.trust-icon { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; color: var(--borhan-gold); }
.trust-icon svg { width: 34px; height: 34px; }

/* Sections */
.section { padding: 82px 0; }
.section-cream { background: var(--borhan-cream); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 25px; margin-bottom: 34px; }
.section-title-wrap { max-width: 700px; }
.section-kicker { color: var(--borhan-primary); font-weight: 900; font-size: 14px; }
.section-title { position: relative; margin: 5px 0 0; padding-bottom: 11px; color: var(--borhan-primary-dark); font-size: clamp(28px, 3vw, 40px); line-height: 1.4; }
.section-title::after { content: ''; position: absolute; bottom: 0; right: 0; width: 52px; height: 3px; border-radius: 3px; background: var(--borhan-gold); }
.section-intro { margin: 12px 0 0; color: var(--borhan-muted); }

.services-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.service-card { position: relative; display: flex; flex-direction: column; min-height: 326px; padding: 25px 20px 20px; background: #fff; border: 1px solid var(--borhan-border); border-radius: 12px; overflow: hidden; }
.service-card::before { content: ''; position: absolute; top: 0; right: 0; width: 100%; height: 3px; background: linear-gradient(90deg, transparent, var(--borhan-primary), var(--borhan-gold)); opacity: 0; transition: .25s; }
.service-card:hover { transform: translateY(-5px); box-shadow: 0 18px 38px rgba(12,76,82,.10); border-color: rgba(14,143,150,.25); }
.service-card:hover::before { opacity: 1; }
.service-icon { width: 66px; height: 66px; display: grid; place-items: center; margin-bottom: 19px; color: var(--borhan-primary-dark); background: rgba(14,143,150,.07); border-radius: 12px; }
.service-icon svg { width: 40px; height: 40px; stroke-width: 1.7; }
.service-card h3 { margin: 0 0 10px; color: var(--borhan-primary-dark); font-size: 18px; line-height: 1.6; }
.service-card p { margin: 0 0 18px; color: var(--borhan-muted); font-size: 14px; }
.service-link { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 900; }

.stats { background: var(--borhan-primary-dark); color: #fff; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat-item { display: flex; align-items: center; justify-content: center; gap: 18px; min-height: 118px; padding: 22px; }
.stat-item + .stat-item { border-right: 1px solid rgba(255,255,255,.18); }
.stat-icon { color: var(--borhan-gold); }
.stat-icon svg { width: 46px; height: 46px; }
.stat-number { display: block; font-size: 32px; font-weight: 900; line-height: 1; }
.stat-label { display: block; margin-top: 9px; opacity: .84; font-size: 13px; }

.about-grid { display: grid; grid-template-columns: .95fr 1.05fr; gap: 62px; align-items: center; }
.about-media { min-height: 405px; border-radius: var(--borhan-radius); overflow: hidden; box-shadow: var(--borhan-shadow); }
.about-media img { width: 100%; height: 100%; min-height: 405px; object-fit: cover; }
.about-content p { color: #53676A; font-size: 16px; }
.about-values { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin: 25px 0 30px; padding: 0; list-style: none; }
.about-values li { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 14px; }
.about-values li::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--borhan-gold); box-shadow: 0 0 0 5px rgba(213,165,42,.13); }

.posts-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.post-card { position: relative; overflow: hidden; background: #fff; border: 1px solid var(--borhan-border); border-radius: 13px; transition: .2s ease; }
.post-card:hover { transform: translateY(-4px); box-shadow: 0 15px 32px rgba(13,76,81,.09); }
.post-thumb { aspect-ratio: 16/8.7; overflow: hidden; background: #e7eeee; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.post-card:hover .post-thumb img { transform: scale(1.035); }
.post-category { position: absolute; top: 13px; right: 13px; padding: 3px 12px; background: var(--borhan-gold); color: var(--borhan-charcoal); border-radius: 6px; font-size: 11px; font-weight: 900; }
.post-body { padding: 18px; }
.post-body h3 { margin: 0 0 13px; font-size: 16px; line-height: 1.7; }
.post-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--borhan-muted); font-size: 12px; }

.cta { position: relative; overflow: hidden; background: var(--borhan-primary-dark); color: #fff; }
.cta::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 15% 50%, rgba(213,165,42,.13), transparent 30%); }
.cta-inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 30px; min-height: 160px; }
.cta h2 { margin: 0; max-width: 700px; font-size: clamp(25px, 3vw, 38px); line-height: 1.55; }
.cta-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cta-phone { color: #fff; border-color: var(--borhan-gold); }
.cta-phone:hover { background: var(--borhan-gold); color: var(--borhan-charcoal); }

/* Footer */
.site-footer { background: #073F46; color: rgba(255,255,255,.84); }
.footer-main { display: grid; grid-template-columns: 1.25fr .9fr .9fr 1.25fr; gap: 55px; padding: 64px 0 40px; }
.footer-brand .text-logo { color: #fff; }
.footer-brand .custom-logo-link { display: inline-flex; padding: 8px 12px; background: #fff; border-radius: 10px; }
.footer-brand .custom-logo { max-height: 54px; }
.footer-brand p { margin: 18px 0; font-size: 14px; }
.footer-title { margin: 0 0 17px; color: var(--borhan-gold); font-size: 16px; }
.footer-menu, .footer-contact { margin: 0; padding: 0; list-style: none; }
.footer-menu li, .footer-contact li { margin: 8px 0; }
.site-footer a { color: rgba(255,255,255,.88); }
.site-footer a:hover { color: #fff; }
.footer-contact li { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; }
.footer-contact svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 5px; color: var(--borhan-gold); }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; padding: 18px 0; border-top: 1px solid rgba(255,255,255,.15); font-size: 12px; }

/* Content */
.site-main-content { padding: 65px 0 90px; }
.content-shell { max-width: 860px; margin-inline: auto; }
.entry-header { margin-bottom: 30px; }
.entry-title { margin: 0 0 12px; color: var(--borhan-primary-dark); font-size: clamp(31px, 4vw, 50px); line-height: 1.45; }
.entry-meta { color: var(--borhan-muted); font-size: 13px; }
.entry-content { font-size: 17px; }
.entry-content h2, .entry-content h3, .entry-content h4 { color: var(--borhan-primary-dark); line-height: 1.55; }
.entry-content blockquote { margin: 30px 0; padding: 20px 25px; background: var(--borhan-cream); border-right: 4px solid var(--borhan-gold); }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { padding: 10px; border: 1px solid var(--borhan-border); }
.pagination { margin-top: 35px; }

/* Forms */
input[type="text"], input[type="email"], input[type="tel"], input[type="url"], textarea, select { width: 100%; padding: 13px 14px; background: #fff; border: 1px solid var(--borhan-border); border-radius: 8px; color: var(--borhan-charcoal); }
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(14,143,150,.2); border-color: var(--borhan-primary); }

/* Responsive */
@media (max-width: 1100px) {
  .services-grid { grid-template-columns: repeat(3, 1fr); }
  .posts-grid { grid-template-columns: repeat(2, 1fr); }
  .header-inner { gap: 18px; }
  .primary-navigation a { padding-inline: 9px; }
  .footer-main { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 920px) {
  body.admin-bar .site-header { top: 46px; }
  .topbar-inner { padding-block: 9px; }
  .topbar .topbar-social { display: none; }
  .header-inner { grid-template-columns: 1fr auto; min-height: 72px; }
  .header-actions .button { display: none; }
  .menu-toggle { display: block; }
  .primary-navigation { display: none; position: absolute; top: 100%; right: 20px; left: 20px; padding: 13px; background: #fff; border: 1px solid var(--borhan-border); border-radius: 12px; box-shadow: var(--borhan-shadow); }
  .primary-navigation.is-open { display: block; }
  .primary-navigation ul { display: block; }
  .primary-navigation a { padding: 11px 12px; }
  .primary-navigation .sub-menu { position: static; display: block; box-shadow: none; border: 0; padding: 0 18px 0 0; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-content { padding: 65px 0 55px; }
  .hero-media { min-height: 380px; order: 2; }
  .trust-wrap { margin-top: -26px; }
  .trust-strip { grid-template-columns: repeat(2, 1fr); }
  .trust-item:nth-child(3) { border-top: 1px solid var(--borhan-border); }
  .trust-item:nth-child(4) { border-top: 1px solid var(--borhan-border); }
  .trust-item:nth-child(3) { border-right: 0; }
  .about-grid { grid-template-columns: 1fr; gap: 35px; }
  .about-media { order: 2; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-item:nth-child(3) { border-top: 1px solid rgba(255,255,255,.18); border-right: 0; }
  .stat-item:nth-child(4) { border-top: 1px solid rgba(255,255,255,.18); }
  .cta-inner { flex-direction: column; align-items: flex-start; justify-content: center; padding-block: 35px; }
}
@media (max-width: 640px) {
  .container { width: min(calc(100% - 28px), var(--borhan-container)); }
  .topbar-contact { gap: 10px; }
  .topbar-address { display: none; }
  .text-logo strong { font-size: 29px; }
  .hero h1 { font-size: 39px; letter-spacing: -1px; }
  .hero-text { font-size: 16px; }
  .hero-actions .button { width: 100%; }
  .trust-strip { grid-template-columns: 1fr; }
  .trust-item + .trust-item { border-right: 0; border-top: 1px solid var(--borhan-border); }
  .section { padding: 62px 0; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .services-grid, .posts-grid { grid-template-columns: 1fr; }
  .service-card { min-height: auto; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-item + .stat-item { border-right: 0; border-top: 1px solid rgba(255,255,255,.18); }
  .about-values { grid-template-columns: 1fr; }
  .footer-main { grid-template-columns: 1fr; gap: 30px; }
  .footer-bottom { flex-direction: column; }
}
