/*
Theme Name: ميزان — قالب مكاتب المحاماة
Theme URI: https://alraedlaw.com
Author: رائد الحلول الرقمية
Description: قالب عربي رصين لمكاتب المحاماة — تصميم مسطّح، طباعة قوية، مساحات سخية. مبني ليُعاد استخدامه لكل عميل بتبديل الألوان والشعار.
Version: 1.0
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 8.0
Text Domain: mizan
*/

/* ═══════════════════════════════════════════════════════════
   1) نظام التصميم — كل شيء مشتق من هنا
   لتبديل هوية عميل: غيّر --brand و--accent فقط.
   ═══════════════════════════════════════════════════════════ */
:root {
  /* الألوان */
  --brand:        #0F2A47;   /* كحلي — الهوية */
  --brand-deep:   #0A1E33;
  --brand-soft:   #17395E;
  --accent:       #B8912F;   /* ذهبي مطفأ — رصين لا لامع */
  --accent-soft:  #D4AC48;

  --ink:          #101820;   /* نص أساسي */
  --ink-2:        #46525E;   /* نص ثانوي */
  --ink-3:        #77828D;   /* نص خافت */
  --paper:        #FFFFFF;
  --surface:      #F6F7F9;   /* خلفية أقسام */
  --surface-2:    #EEF1F4;
  --line:         #E1E6EB;

  /* الطباعة */
  --font: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-display: clamp(2.15rem, 1.25rem + 3.4vw, 3.9rem);
  --fs-h1:      clamp(1.85rem, 1.2rem + 2.4vw, 2.85rem);
  --fs-h2:      clamp(1.5rem, 1.1rem + 1.6vw, 2.15rem);
  --fs-h3:      clamp(1.15rem, 1rem + .6vw, 1.4rem);
  --fs-body:    1.0625rem;
  --fs-sm:      .9375rem;
  --fs-xs:      .8125rem;

  /* المقاس */
  --container: 1180px;
  --gutter: clamp(20px, 5vw, 40px);
  --section-y: clamp(68px, 9vw, 128px);
  --radius: 4px;          /* حواف شبه قائمة — رصانة لا نعومة */
  --radius-lg: 8px;
}

/* ═══════════════════════════════════════════════════════════
   2) الأساس
   ═══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.9;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 700; line-height: 1.32; color: var(--brand); letter-spacing: -.01em; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.45; }
p  { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

a { color: var(--brand-soft); text-decoration: none; transition: color .16s ease; }
a:hover { color: var(--accent); }

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

::selection { background: var(--accent); color: #fff; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ═══════════════════════════════════════════════════════════
   3) تخطيطات مساعدة
   ═══════════════════════════════════════════════════════════ */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
.section--surface { background: var(--surface); }
.section--brand { background: var(--brand); color: rgba(255,255,255,.86); }
.section--brand h2, .section--brand h3 { color: #fff; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em;
  color: var(--accent); text-transform: none; margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--accent); }
.section--brand .eyebrow { color: var(--accent-soft); }
.section--brand .eyebrow::before { background: var(--accent-soft); }

.lede { font-size: clamp(1.05rem, 1rem + .35vw, 1.2rem); color: var(--ink-2); line-height: 1.95; max-width: 62ch; }
.section--brand .lede { color: rgba(255,255,255,.72); }

.section-head { max-width: 66ch; margin-bottom: clamp(34px, 5vw, 56px); }

/* ═══════════════════════════════════════════════════════════
   4) الأزرار — مسطّحة تماماً، بلا ظل ولا تدرّج
   ═══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 26px; border-radius: var(--radius);
  font-size: var(--fs-sm); font-weight: 600; font-family: var(--font);
  border: 1.5px solid transparent; cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
  line-height: 1.2;
}
.btn--primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn--primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--ghost { background: transparent; color: var(--brand); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--brand); color: var(--brand); background: transparent; }
.btn--onbrand { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--onbrand:hover { background: #fff; color: var(--brand); border-color: #fff; }
.btn--outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.btn--outline-light:hover { border-color: #fff; background: rgba(255,255,255,.06); color: #fff; }

.link-arrow { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: var(--fs-sm); }
.link-arrow::after { content: "←"; transition: transform .16s ease; }
.link-arrow:hover::after { transform: translateX(-4px); }

/* ═══════════════════════════════════════════════════════════
   5) الترويسة
   ═══════════════════════════════════════════════════════════ */
.site-header {
  position: sticky; top: 0; z-index: 90;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 28px; min-height: 76px; }

.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand__mark { width: 34px; height: 34px; flex-shrink: 0; }
.brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.brand__name { font-weight: 700; font-size: 1.02rem; color: var(--brand); }
.brand__tag { font-size: .72rem; color: var(--ink-3); font-weight: 500; }

.nav { margin-inline-start: auto; }
.nav ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav a {
  display: block; padding: 9px 14px; border-radius: var(--radius);
  font-size: var(--fs-sm); font-weight: 500; color: var(--ink-2);
}
.nav a:hover { color: var(--brand); background: var(--surface); }
.nav .current-menu-item > a, .nav .current_page_item > a { color: var(--brand); font-weight: 600; }

.header-cta { flex-shrink: 0; }

.nav-toggle {
  display: none; width: 42px; height: 42px; border: 1px solid var(--line);
  border-radius: var(--radius); background: #fff; cursor: pointer;
  align-items: center; justify-content: center; margin-inline-start: auto;
}
.nav-toggle span { display: block; width: 18px; height: 1.5px; background: var(--brand); position: relative; }
.nav-toggle span::before, .nav-toggle span::after {
  content: ""; position: absolute; inset-inline-start: 0; width: 18px; height: 1.5px; background: var(--brand);
}
.nav-toggle span::before { top: -5.5px; }
.nav-toggle span::after  { top: 5.5px; }

@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .header-cta { display: none; }
  .nav {
    position: absolute; inset-inline: 0; top: 100%;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 10px var(--gutter) 18px; display: none;
  }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .nav a { padding: 12px 4px; border-bottom: 1px solid var(--line); border-radius: 0; }
}

/* ═══════════════════════════════════════════════════════════
   6) البطل (Hero)
   ═══════════════════════════════════════════════════════════ */
.hero {
  background: var(--brand-deep); color: #fff;
  padding-block: clamp(76px, 11vw, 150px);
  position: relative; overflow: hidden;
}
/* زخرفة هندسية مسطّحة — خطوط لا تدرّجات */
.hero::after {
  content: ""; position: absolute; inset-block: 0; inset-inline-start: -12%;
  width: 46%;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.045) 0 1px, transparent 1px 78px);
  pointer-events: none;
}
.hero::before {
  content: ""; position: absolute; inset-block-start: -110px; inset-inline-end: -110px;
  width: 380px; height: 380px; border: 1px solid rgba(184,145,47,.20); border-radius: 50%;
  pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; max-width: 780px; }
.hero__title {
  font-size: var(--fs-display); font-weight: 700; color: #fff;
  line-height: 1.22; margin: 0 0 20px; letter-spacing: -.02em;
}
.hero__title em { font-style: normal; color: var(--accent-soft); }
.hero__text { font-size: clamp(1.05rem, 1rem + .4vw, 1.22rem); color: rgba(255,255,255,.74); line-height: 1.95; max-width: 60ch; margin-bottom: 32px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero__meta {
  display: flex; flex-wrap: wrap; gap: clamp(28px, 5vw, 64px);
  margin-top: clamp(44px, 6vw, 72px); padding-top: 30px;
  border-top: 1px solid rgba(255,255,255,.14);
  position: relative; z-index: 1;
}
.hero__stat b { display: block; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); color: var(--accent-soft); font-weight: 700; line-height: 1.2; }
.hero__stat span { font-size: var(--fs-xs); color: rgba(255,255,255,.60); }

/* ═══════════════════════════════════════════════════════════
   7) البطاقات والشبكات
   ═══════════════════════════════════════════════════════════ */
.grid { display: grid; gap: clamp(14px, 2vw, 22px); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(288px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: clamp(24px, 3vw, 32px);
  transition: border-color .18s ease;
}
.card:hover { border-color: var(--brand); }
.card__num {
  font-size: .78rem; font-weight: 700; color: var(--accent);
  letter-spacing: .12em; margin-bottom: 14px; display: block;
}
.card h3 { margin-bottom: 9px; }
.card p { color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.9; margin-bottom: 0; }
.card__link { margin-top: 16px; display: inline-flex; }

/* قائمة مزايا */
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.checks li { display: flex; gap: 12px; align-items: flex-start; font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.85; }
.checks li::before {
  content: ""; flex-shrink: 0; width: 7px; height: 7px; margin-top: 11px;
  background: var(--accent); transform: rotate(45deg);
}
.section--brand .checks li { color: rgba(255,255,255,.78); }

/* شريط الأرقام */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.stat { background: var(--paper); padding: clamp(24px, 3vw, 34px) 20px; text-align: center; }
.stat b { display: block; font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.4rem); color: var(--brand); font-weight: 700; line-height: 1.2; }
.stat span { font-size: var(--fs-xs); color: var(--ink-3); }

/* ═══════════════════════════════════════════════════════════
   8) المقالات
   ═══════════════════════════════════════════════════════════ */
.post-card { display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; transition: border-color .18s ease; }
.post-card:hover { border-color: var(--brand); }
.post-card__thumb { aspect-ratio: 16/9; overflow: hidden; background: var(--surface-2); }
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card__body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.post-card__meta { font-size: var(--fs-xs); color: var(--ink-3); margin-bottom: 9px; }
.post-card__title { font-size: 1.08rem; line-height: 1.55; margin-bottom: 9px; }
.post-card__title a { color: var(--brand); }
.post-card__title a:hover { color: var(--accent); }
.post-card__excerpt { font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.85; margin-bottom: 16px; }
.post-card__more { margin-top: auto; }

/* ═══════════════════════════════════════════════════════════
   9) شريط الدعوة
   ═══════════════════════════════════════════════════════════ */
.cta-band { background: var(--brand); color: #fff; padding-block: clamp(50px, 6vw, 78px); position: relative; overflow: hidden; }
.cta-band::before {
  content: ""; position: absolute; inset-block-end: -140px; inset-inline-start: -80px;
  width: 320px; height: 320px; border: 1px solid rgba(255,255,255,.08); transform: rotate(45deg);
}
.cta-band__inner { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 26px; }
.cta-band h2 { color: #fff; margin-bottom: 6px; }
.cta-band p { color: rgba(255,255,255,.72); margin: 0; max-width: 52ch; font-size: var(--fs-sm); }

/* ═══════════════════════════════════════════════════════════
   10) صفحة داخلية / محتوى
   ═══════════════════════════════════════════════════════════ */
.page-head { background: var(--surface); border-bottom: 1px solid var(--line); padding-block: clamp(48px, 6vw, 80px); }
.page-head h1 { margin-bottom: 10px; }
.breadcrumb { font-size: var(--fs-xs); color: var(--ink-3); }
.breadcrumb a { color: var(--ink-3); }
.breadcrumb a:hover { color: var(--accent); }

.entry { max-width: 74ch; }
.entry h2 { margin-top: 1.9em; }
.entry h3 { margin-top: 1.6em; }
.entry ul, .entry ol { padding-inline-start: 1.3em; line-height: 1.95; }
.entry li { margin-bottom: .5em; }
.entry blockquote {
  margin: 1.8em 0; padding: 20px 24px; background: var(--surface);
  border-inline-start: 3px solid var(--accent); border-radius: var(--radius);
  font-size: 1.05rem; color: var(--ink);
}
.entry blockquote p:last-child { margin-bottom: 0; }
.entry img { border-radius: var(--radius-lg); margin-block: 1.4em; }
.entry table { width: 100%; border-collapse: collapse; margin-block: 1.6em; font-size: var(--fs-sm); }
.entry th, .entry td { border: 1px solid var(--line); padding: 11px 13px; text-align: start; }
.entry th { background: var(--surface); color: var(--brand); font-weight: 700; }
.entry hr { border: 0; border-top: 1px solid var(--line); margin-block: 2.2em; }

/* ═══════════════════════════════════════════════════════════
   11) التذييل
   ═══════════════════════════════════════════════════════════ */
.site-footer { background: var(--brand-deep); color: rgba(255,255,255,.68); padding-block: clamp(52px, 6vw, 76px) 0; font-size: var(--fs-sm); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: clamp(28px, 4vw, 56px); padding-bottom: 44px; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

.site-footer h4 { color: #fff; font-size: .95rem; margin-bottom: 16px; font-weight: 600; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.site-footer a { color: rgba(255,255,255,.68); }
.site-footer a:hover { color: var(--accent-soft); }
.footer-about { max-width: 42ch; line-height: 1.9; }
.footer-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.footer-brand .brand__name { color: #fff; }
.footer-brand .brand__tag { color: rgba(255,255,255,.48); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.10); padding-block: 20px;
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
  font-size: var(--fs-xs); color: rgba(255,255,255,.44);
}
.footer-bottom a { color: rgba(255,255,255,.55); }

/* ═══════════════════════════════════════════════════════════
   12) متفرقات
   ═══════════════════════════════════════════════════════════ */
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(1px,1px,1px,1px); white-space: nowrap;
}
.skip-link { position: absolute; inset-inline-start: -9999px; }
.skip-link:focus { inset-inline-start: 12px; top: 12px; z-index: 999; background: #fff; padding: 10px 16px; border-radius: var(--radius); }

.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 44px; }
.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink-2); font-size: var(--fs-sm); font-weight: 500;
}
.pagination .page-numbers:hover { border-color: var(--brand); color: var(--brand); }
.pagination .page-numbers.current { background: var(--brand); border-color: var(--brand); color: #fff; }

.empty-state { padding: clamp(50px, 7vw, 90px) 0; text-align: center; color: var(--ink-3); }

/* طباعة */
@media print {
  .site-header, .site-footer, .cta-band, .hero::before, .hero::after { display: none !important; }
  body { color: #000; }
}
