/* Maqbali Core v1.0.0 — common shell. Independent from /tools/. */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');
:root {
  color-scheme: light;
  --site-bg: #f5f0e8;
  --site-panel: #ffffff;
  --site-text: #2a1f0a;
  --site-muted: #6b604d;
  --site-gold: #89651e;
  --site-border: rgba(150,120,40,.25);
  --site-gold-muted: rgba(160,120,40,.10);
  --site-topbar-bg: rgba(245,240,232,.94);
  --site-toggle-bg: #ffffff;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --site-bg: #0a0a0a;
  --site-panel: #131312;
  --site-text: #f0ede6;
  --site-muted: #99968e;
  --site-gold: #c8a96e;
  --site-border: rgba(255,255,255,.085);
  --site-gold-muted: rgba(200,169,110,.15);
  --site-topbar-bg: rgba(10,10,10,.95);
  --site-toggle-bg: #0e0e0e;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --site-bg: #0a0a0a;
    --site-panel: #131312;
    --site-text: #f0ede6;
    --site-muted: #99968e;
    --site-gold: #c8a96e;
    --site-border: rgba(255,255,255,.085);
    --site-gold-muted: rgba(200,169,110,.15);
    --site-topbar-bg: rgba(10,10,10,.95);
    --site-toggle-bg: #0e0e0e;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { min-width: 280px; scroll-behavior: smooth; }
body.site-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at 86% 0%, var(--site-gold-muted), transparent 42%), var(--site-bg);
  color: var(--site-text);
  font: 400 14px/1.8 'Cairo', Tahoma, Arial, sans-serif;
}
.site-page a { color: inherit; text-decoration: none; }
.site-page button, .site-page a { -webkit-tap-highlight-color: transparent; }
.site-page a:focus-visible, .site-page button:focus-visible { outline: 2px solid var(--site-gold); outline-offset: 4px; }
.site-topbar { width: 100%; flex: none; }
.site-topbar__inner {
  max-width: 1376px;
  margin-inline: auto;
  padding: 18px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--site-border);
}
.site-brand { display: inline-flex; align-items: center; gap: 14px; min-width: 0; }
.site-brand__logo { width: 64px; height: 64px; display: block; object-fit: contain; flex: none; }
:root[data-theme="light"] .site-brand__logo { filter: brightness(0); }
.site-brand__text { display: flex; flex-direction: column; min-width: 0; }
.site-brand__text b { display: block; font-size: 13px; font-weight: 600; line-height: 1.65; white-space: nowrap; }
.site-brand__text small { display: block; color: var(--site-muted); font: 400 8px/1.5 Arial, sans-serif; letter-spacing: 2px; white-space: nowrap; margin-top: 3px; }
.site-actions { display: flex; gap: 10px; align-items: center; flex: none; }
.site-icon-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1.5px solid var(--site-gold);
  border-radius: 50%;
  background: var(--site-toggle-bg);
  color: var(--site-gold) !important;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.site-icon-button:hover { background: var(--site-gold-muted); transform: translateY(-1px); }
.site-icon-button svg { display: block; width: 18px; height: 18px; }
.site-sitemap-button { border-radius: 11px; }
.site-sitemap-button[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  pointer-events: none;
  background: var(--site-panel);
  color: var(--site-text);
  border: 1px solid var(--site-border);
  border-radius: 8px;
  padding: 3px 10px;
  font: 600 11px/1.8 'Cairo', sans-serif;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s;
}
.site-sitemap-button:hover::after, .site-sitemap-button:focus-visible::after { opacity: 1; visibility: visible; }
.site-main { flex: 1 0 auto; width: 100%; max-width: 1280px; margin-inline: auto; padding-inline: 32px; }
.site-footer { flex: none; width: min(100%, 1280px); margin-inline: auto; padding: 22px 32px; border-top: 1px solid var(--site-border); text-align: center; color: var(--site-muted); font-size: 11px; }
.site-footer__credit a { font-weight: 600; color: var(--site-gold); }
.site-footer__credit a:hover { text-decoration: underline; text-underline-offset: 4px; }
.site-footer__heart { color: #d55058; margin-inline: 3px; }
@media (max-width: 680px) {
  .site-topbar__inner { padding: 12px 20px; gap: 8px; }
  .site-brand { gap: 9px; }
  .site-brand__logo { width: 52px; height: 52px; }
  .site-brand__text b { font-size: 11px; }
  .site-brand__text small { font-size: 6px; letter-spacing: 1.4px; }
  .site-icon-button { width: 40px; height: 40px; }
  .site-actions { gap: 7px; }
  .site-main { padding-inline: 17px; }
  .site-footer { padding: 18px 17px; }
}
@media (max-width: 360px) {
  .site-topbar__inner { flex-wrap: wrap; }
  .site-actions { margin-inline-start: auto; }
  .site-brand__text small { letter-spacing: .7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
