/* ==========================================================================
   مكتب سلطان البلوشي للمحاماة والاستشارات القانونية
   Design system — navy & gold, elegant Arabic, RTL, light/dark
   ========================================================================== */

/* ---- Tokens: light (default) ---- */
:root {
  --navy-900: #0b1b33;
  --navy-800: #10244a;
  --navy-700: #163257;
  --navy-600: #1d3f6e;
  --gold-600: #b5912f;
  --gold-500: #c7a24a;
  --gold-400: #d9bd6e;
  --gold-100: #f3ead1;

  --bg:        #faf8f3;
  --bg-alt:    #f3efe6;
  --surface:   #ffffff;
  --surface-2: #fbfaf6;
  --ink:       #16202f;
  --ink-soft:  #35435a;
  --muted:     #5c6678;
  --line:      #e7e1d4;
  --line-soft: #efeadf;

  --brand:        var(--navy-800);
  --brand-strong: var(--navy-900);
  --accent:       var(--gold-600);
  --accent-soft:  var(--gold-100);
  --on-brand:     #f6f2e8;

  --radius:   14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 3px rgba(11,27,51,.06), 0 1px 2px rgba(11,27,51,.04);
  --shadow:    0 10px 30px rgba(11,27,51,.08), 0 2px 8px rgba(11,27,51,.05);
  --shadow-lg: 0 24px 60px rgba(11,27,51,.14);

  --font-head: "El Messiri", "Tajawal", system-ui, sans-serif;
  --font-body: "Tajawal", system-ui, "Segoe UI", sans-serif;

  --container: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 76px;

  --t-fast: .16s ease;
  --t: .28s cubic-bezier(.2,.7,.3,1);
}

/* ---- Tokens: dark ---- */
:root[data-theme="dark"] {
  --bg:        #0a1322;
  --bg-alt:    #0d1829;
  --surface:   #101d31;
  --surface-2: #132339;
  --ink:       #e9eef7;
  --ink-soft:  #c3cddd;
  --muted:     #93a1b8;
  --line:      #203350;
  --line-soft: #1a2b44;

  --brand:        #0e1f3a;
  --brand-strong: #081020;
  --accent:       var(--gold-400);
  --accent-soft:  #26324a;
  --on-brand:     #f6f2e8;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
  --shadow:    0 14px 36px rgba(0,0,0,.45);
  --shadow-lg: 0 28px 64px rgba(0,0,0,.55);
}

/* follow OS when the user hasn't chosen */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:#0a1322; --bg-alt:#0d1829; --surface:#101d31; --surface-2:#132339;
    --ink:#e9eef7; --ink-soft:#c3cddd; --muted:#93a1b8; --line:#203350; --line-soft:#1a2b44;
    --brand:#0e1f3a; --brand-strong:#081020; --accent:var(--gold-400); --accent-soft:#26324a;
    --shadow-sm:0 1px 3px rgba(0,0,0,.4); --shadow:0 14px 36px rgba(0,0,0,.45); --shadow-lg:0 28px 64px rgba(0,0,0,.55);
  }
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background var(--t), color var(--t);
}
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
ul { list-style: none; padding: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1,h2,h3,h4 { font-family: var(--font-head); line-height: 1.3; font-weight: 600; color: var(--ink); }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.3rem); }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); }
h3 { font-size: clamp(1.25rem, 1.05rem + .8vw, 1.6rem); }

/* ---- Layout ---- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(48px, 7vw, 92px); }
.section--alt { background: var(--bg-alt); }
.section-head { text-align: center; max-width: 680px; margin-inline: auto; margin-bottom: clamp(28px, 4vw, 48px); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-head); font-weight: 600; letter-spacing: .02em;
  color: var(--accent); font-size: .95rem; margin-bottom: 12px;
}
.eyebrow::before { content:""; width: 26px; height: 2px; background: var(--accent); display:inline-block; }
.section-head p { color: var(--muted); margin-top: 12px; }
.lead { font-size: 1.12rem; color: var(--ink-soft); }

/* ---- Buttons ---- */
.btn {
  --_bg: var(--brand); --_fg: var(--on-brand);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 26px; border-radius: 999px; border: 1.5px solid transparent;
  background: var(--_bg); color: var(--_fg); font-weight: 600; font-family: var(--font-head);
  transition: transform var(--t-fast), box-shadow var(--t), background var(--t), color var(--t);
  box-shadow: var(--shadow-sm); white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--gold { --_bg: linear-gradient(135deg, var(--gold-500), var(--gold-600)); --_fg: #2a2206; }
.btn--ghost { --_bg: transparent; --_fg: var(--ink); border-color: var(--line); box-shadow: none; }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--on-dark { --_bg: transparent; --_fg: #fff; border-color: rgba(255,255,255,.4); box-shadow:none; }
.btn--on-dark:hover { background: rgba(255,255,255,.1); }
.btn--sm { padding: 9px 18px; font-size: .92rem; }
.btn--block { width: 100%; }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
  transition: box-shadow var(--t), background var(--t);
}
.site-header.is-scrolled { box-shadow: var(--shadow-sm); }
.nav { display: flex; align-items: center; gap: 20px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; font-family: var(--font-head); font-weight: 700; }
.brand__mark {
  width: 42px; height: 42px; border-radius: 11px; flex: none;
  display: grid; place-items: center; color: var(--gold-400);
  background: linear-gradient(145deg, var(--navy-800), var(--navy-900));
  box-shadow: var(--shadow-sm); font-size: 1.1rem;
}
.brand__name { font-size: 1.05rem; line-height: 1.25; }
.brand__name small { display: block; font-weight: 500; font-size: .74rem; color: var(--muted); font-family: var(--font-body); }
.nav__menu { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.nav__menu a {
  padding: 9px 14px; border-radius: 10px; font-weight: 500; color: var(--ink-soft);
  transition: color var(--t-fast), background var(--t-fast); position: relative;
}
.nav__menu a:hover, .nav__menu a.is-active { color: var(--accent); background: var(--accent-soft); }
.nav__actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  width: 42px; height: 42px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); display: grid; place-items: center;
  transition: border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); transform: rotate(-12deg); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.nav__burger { display: none; width: 44px; height: 44px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); place-items: center; }

/* ---- Hero ---- */
.hero {
  position: relative; overflow: hidden; color: var(--on-brand);
  background:
    radial-gradient(120% 120% at 85% -10%, rgba(199,162,74,.22), transparent 55%),
    linear-gradient(160deg, var(--navy-900), var(--navy-700));
}
.hero::after {
  content:""; position:absolute; inset:0; pointer-events:none;
  background-image:
    radial-gradient(circle at 12% 80%, rgba(255,255,255,.05), transparent 40%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M0 59h60M59 0v60' stroke='%23ffffff' stroke-opacity='0.03'/%3E%3C/svg%3E");
}
.hero__inner { position: relative; z-index: 1; display: grid; gap: 40px; align-items: center; padding-block: clamp(56px, 9vw, 110px); grid-template-columns: 1.1fr .9fr; }
.hero h1 { color: #fff; margin-bottom: 18px; }
.hero h1 .accent { color: var(--gold-400); }
.hero p { color: #d8e0ef; font-size: 1.15rem; max-width: 52ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.hero__stats { display: flex; gap: 32px; margin-top: 44px; flex-wrap: wrap; }
.hero__stats .num { font-family: var(--font-head); font-size: 2rem; color: var(--gold-400); font-weight: 700; }
.hero__stats .lbl { color: #c3cde0; font-size: .92rem; }
.hero__card {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-lg); padding: 28px; backdrop-filter: blur(6px);
}
.hero__card h3 { color: #fff; margin-bottom: 14px; }
.hero__card ul { display: grid; gap: 12px; }
.hero__card li { display: flex; gap: 10px; color: #dbe3f1; }
.hero__card li svg { color: var(--gold-400); flex: none; margin-top: 4px; }

/* ---- Cards grid ---- */
.grid { display: grid; gap: clamp(16px, 2.4vw, 28px); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-sm); transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line); }
.card__icon {
  width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 16px;
  background: var(--accent-soft); color: var(--accent);
}
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); }

/* ---- Service / team ---- */
.team-card { text-align: center; }
.team-card img, .team-card .ph {
  width: 110px; height: 110px; border-radius: 50%; object-fit: cover; margin: 0 auto 14px;
  border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--accent);
  background: linear-gradient(145deg, var(--navy-700), var(--navy-900)); color: var(--gold-400);
  display: grid; place-items: center; font-family: var(--font-head); font-size: 2rem; font-weight: 700;
}
.team-card .role { color: var(--accent); font-weight: 600; }

/* ---- Article cards ---- */
.post-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.post-card__media { aspect-ratio: 16/9; overflow: hidden; background: var(--bg-alt); position: relative; }
.post-card__media img { width:100%; height:100%; object-fit: cover; transition: transform var(--t); }
.post-card:hover .post-card__media img { transform: scale(1.05); }
.post-card__body { padding: 20px 22px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.chip {
  align-self: flex-start; font-size: .78rem; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); padding: 4px 11px; border-radius: 999px; font-family: var(--font-head);
}
.post-card h3 { font-size: 1.22rem; }
.post-card h3 a:hover { color: var(--accent); }
.post-card .excerpt { color: var(--muted); font-size: .98rem; }
.post-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .86rem; margin-top: auto; }
.post-meta time::before { content:"•"; margin-inline-end: 8px; color: var(--line); }

/* ---- Article (single) ---- */
.article-head { padding-block: clamp(32px,5vw,56px); }
.breadcrumbs { color: var(--muted); font-size: .9rem; margin-bottom: 18px; }
.breadcrumbs a:hover { color: var(--accent); }
.article-title { max-width: 820px; }
.author-row { display: flex; align-items: center; gap: 14px; margin-top: 22px; }
.author-row img, .author-row .ph {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none;
  background: linear-gradient(145deg, var(--navy-700), var(--navy-900)); color: var(--gold-400);
  display: grid; place-items: center; font-family: var(--font-head); font-weight: 700;
}
.author-row .name { font-weight: 700; font-family: var(--font-head); }
.author-row .meta { color: var(--muted); font-size: .88rem; }
.cover { border-radius: var(--radius-lg); overflow: hidden; margin-block: 8px 28px; box-shadow: var(--shadow); }

.prose { max-width: 760px; margin-inline: auto; font-size: 1.12rem; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 1.8em; padding-bottom: .2em; border-bottom: 2px solid var(--accent-soft); }
.prose h3 { margin-top: 1.5em; }
.prose p { color: var(--ink-soft); }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose img { border-radius: var(--radius); margin-block: 1.4em; box-shadow: var(--shadow-sm); }
.prose ul, .prose ol { padding-inline-start: 1.4em; color: var(--ink-soft); }
.prose ul { list-style: disc; } .prose ol { list-style: decimal; }
.prose li + li { margin-top: .5em; }
.prose blockquote {
  border-inline-start: 4px solid var(--accent); background: var(--surface-2);
  padding: 16px 22px; border-radius: 0 var(--radius) var(--radius) 0; color: var(--ink-soft); font-size: 1.1rem;
}
.prose figure figcaption { text-align: center; color: var(--muted); font-size: .9rem; margin-top: 8px; }

.share-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.share-row .btn { width: 44px; height: 44px; padding: 0; }

.author-box {
  display: flex; gap: 18px; background: var(--surface-2); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 22px; margin-top: 36px;
}
.author-box img, .author-box .ph { width: 72px; height: 72px; border-radius: 50%; flex: none; }

/* ---- Toolbar (search / filter) ---- */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 30px; }
.search {
  display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 8px 6px 16px; flex: 1; min-width: 220px; max-width: 420px;
}
.search input { border: 0; background: transparent; color: var(--ink); flex: 1; outline: none; font: inherit; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters a {
  padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-soft);
  font-size: .9rem; font-weight: 500; transition: all var(--t-fast);
}
.filters a:hover, .filters a.is-active { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }

/* ---- Contact ---- */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: start; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: .92rem; }
.field input, .field textarea, .field select {
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: inherit; transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.info-list { display: grid; gap: 18px; }
.info-list li { display: flex; gap: 14px; align-items: flex-start; }
.info-list .ic { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.info-list .k { font-weight: 700; font-family: var(--font-head); }
.info-list .v { color: var(--muted); }

/* ---- Footer ---- */
.site-footer { margin-top: auto; background: linear-gradient(170deg, var(--navy-900), var(--navy-800)); color: #cdd6e6; }
.site-footer a { color: #cdd6e6; }
.site-footer a:hover { color: var(--gold-400); }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 36px; padding-block: 56px; }
.site-footer h4 { color: #fff; margin-bottom: 16px; font-size: 1.05rem; }
.site-footer .muted { color: #9fabc2; }
.footer-links { display: grid; gap: 10px; }
.social { display: flex; gap: 10px; margin-top: 16px; }
.social a { width: 42px; height: 42px; border-radius: 11px; border: 1px solid rgba(255,255,255,.16); display: grid; place-items: center; transition: all var(--t-fast); }
.social a:hover { background: var(--gold-500); color: var(--navy-900); border-color: transparent; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-block: 20px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; color: #9fabc2; font-size: .9rem; }

/* ---- CTA band ---- */
.cta-band { background: linear-gradient(135deg, var(--navy-800), var(--navy-900)); color: #fff; border-radius: var(--radius-lg); padding: clamp(32px,5vw,56px); text-align: center; position: relative; overflow: hidden; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #d4dcec; max-width: 54ch; margin: 12px auto 26px; }

/* ---- Empty state ---- */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty .ic { width: 72px; height: 72px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin: 0 auto 18px; }

/* ---- Flash / alert ---- */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 18px; border: 1px solid; }
.alert--ok { background: #e9f7ef; border-color: #b7e4c9; color: #1c6b3f; }
.alert--err { background: #fdeceC; border-color: #f3c0c0; color: #a12a2a; }
:root[data-theme="dark"] .alert--ok { background:#12301f; color:#7fe0a6; }
:root[data-theme="dark"] .alert--err { background:#3a1717; color:#f1a1a1; }

/* ---- Pagination ---- */
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 40px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 42px; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-soft); font-weight: 600; }
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.pager .is-active { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }

/* ---- Utilities ---- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0 !important; }
.skip-link { position: absolute; inset-inline-start: 50%; transform: translateX(50%); top: -60px; background: var(--brand); color: #fff; padding: 10px 18px; border-radius: 0 0 10px 10px; z-index: 100; transition: top var(--t); }
.skip-link:focus { top: 0; }

/* ---- Responsive ---- */
@media (max-width: 960px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__card { display: none; }
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav__menu { position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch;
    background: var(--surface); border-bottom: 1px solid var(--line); padding: 14px var(--gutter); gap: 4px;
    transform: translateY(-120%); transition: transform var(--t); box-shadow: var(--shadow); margin: 0; }
  .nav__menu.is-open { transform: translateY(0); }
  .nav__menu a { padding: 12px 14px; }
  .nav__burger { display: grid; }
  .grid--3, .grid--4, .grid--2 { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: 28px; }
}

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