/* Qadir study editorial system — design-taste-frontend implementation */
:root {
  --q-ink: #102a2a;
  --q-muted: #5f7370;
  --q-paper: #f5f7f2;
  --q-surface: #ffffff;
  --q-line: #d7e1db;
  --q-soft: #e8f1eb;
  --q-action: #087f62;
  --q-action-dark: #075744;
  --q-gold: #b8832d;
  --q-radius: 16px;
}

html[data-theme="light"] { --bg: var(--q-paper); --surface: var(--q-surface); --text: var(--q-ink); --muted: var(--q-muted); --line: var(--q-line); --soft: var(--q-soft); --green: var(--q-action); --gold: var(--q-gold); }
body { background: var(--q-paper); color: var(--q-ink); font-family: "Tajawal", "IBM Plex Sans Arabic", system-ui, sans-serif; }
.public-header { position: sticky; top: 0; min-height: 72px; padding-inline: max(20px, calc((100% - 1180px) / 2)); background: rgba(255,255,255,.96); border-bottom: 1px solid var(--q-line); box-shadow: 0 8px 24px rgba(16,42,42,.045); backdrop-filter: none; }
.public-brand { gap: 11px; font-size: 20px; letter-spacing: -.035em; }
.public-brand-mark { width: 42px; height: 42px; border-radius: 12px; background: var(--q-action); color: #fff; box-shadow: 0 7px 0 #d1e5d8; }
.public-nav { gap: 4px; }
.public-nav a, .theme-toggle { min-height: 42px; border-radius: 10px; padding-inline: 12px; font-size: 13px; font-weight: 700; transition: transform .18s ease, background .18s ease, color .18s ease; }
.public-nav a:hover, .theme-toggle:hover { transform: translateY(-2px); background: var(--q-soft); color: var(--q-action-dark); }
.public-nav a[aria-current="page"] { background: var(--q-ink); color: #fff; border-color: var(--q-ink); }
.qadir-journey-bar { padding-block: 11px; background: var(--q-ink); border: 0; }
.qadir-journey-bar a { border-color: rgba(255,255,255,.25); background: transparent; color: #fff; }
.qadir-journey-bar a:hover { transform: translateY(-2px); border-color: #8ed5b6; background: rgba(255,255,255,.09); }
.qadir-journey-bar a span { color: #9ec7b5; }
.qadir-journey-bar a[aria-current="page"] { background: #d8f0df; border-color: #d8f0df; color: var(--q-ink); }
.qadir-journey-bar a[aria-current="page"] span { color: var(--q-action-dark); }
.page-shell { width: min(1180px, calc(100% - 40px)); padding-top: clamp(38px, 7vw, 88px); }
.page-hero { display: grid; gap: 14px; min-height: 360px; align-content: center; padding: clamp(32px, 6vw, 76px); border: 0; border-radius: 0; background: var(--q-ink); color: #fff; box-shadow: 14px 14px 0 #d7e8db; }
.page-hero::after { display: none; }
.page-hero h1 { max-width: 12ch; font-size: clamp(34px, 6vw, 68px); line-height: 1.05; letter-spacing: -.055em; }
.page-hero p { max-width: 62ch; color: #c4d8cf; font-size: 17px; line-height: 1.9; }
.page-hero .tag { background: #d8f0df; color: var(--q-action-dark); border: 0; }
.page-hero a { color: #f1cf85; text-decoration: underline; text-underline-offset: 4px; }
main.page-shell > section:not(.page-hero) { margin-top: clamp(70px, 10vw, 128px); }
main.page-shell > section > h2 { margin-bottom: 28px; font-size: clamp(28px, 4vw, 44px); letter-spacing: -.045em; }
.toolbar { border: 1px solid var(--q-line); border-radius: 14px; background: var(--q-surface); box-shadow: 8px 8px 0 #e6eee8; }
.toolbar input, .toolbar select, .form-field input, .form-field textarea { border-radius: 10px; border-color: var(--q-line); }
.content-grid { gap: 20px; }
.content-card { border: 1px solid var(--q-line); border-radius: var(--q-radius); padding: 20px; box-shadow: 7px 7px 0 #e6eee8; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.content-card:hover { transform: translateY(-4px); border-color: #8dc5a7; box-shadow: 10px 12px 0 #dcebe0; }
.content-card img { height: 190px; border-radius: 10px; }
.content-card h2 { font-size: 20px; letter-spacing: -.025em; }
.tag { border-radius: 8px; background: var(--q-soft); color: var(--q-action-dark); }
.button { min-height: 46px; border-radius: 10px; border-color: var(--q-line); }
.button.primary { border-color: var(--q-action); background: var(--q-action); }
.button.primary:hover { background: var(--q-action-dark); }
.contact-form, .note-card { border-radius: var(--q-radius); border-color: var(--q-line); box-shadow: 7px 7px 0 #e6eee8; }
.site-footer { margin-top: 80px; padding: 34px 20px; border-top: 1px solid var(--q-line); background: var(--q-ink); color: #c4d8cf; }
.mobile-menu-drawer { width: min(88vw, 380px); background: var(--q-paper); }
.mobile-menu-links a, .mobile-menu-theme { border-radius: 10px; }
:where(a,button,input,textarea,select):focus-visible { outline: 3px solid #d29a3d; outline-offset: 3px; }
@media (max-width: 760px) {
  .public-header { min-height: 64px; padding-inline: 14px; }
  .public-brand-mark { width: 38px; height: 38px; }
  .page-shell { width: min(100% - 28px, 1180px); padding-top: 28px; }
  .page-hero { min-height: 330px; padding: 28px 24px; box-shadow: 7px 7px 0 #d7e8db; }
  .page-hero h1 { font-size: clamp(34px, 11vw, 52px); }
  .page-hero p { font-size: 15px; }
  main.page-shell > section:not(.page-hero) { margin-top: 72px; }
  .content-card { box-shadow: 5px 5px 0 #e6eee8; }
}
@media (prefers-reduced-motion: reduce) { .content-card, .public-nav a, .theme-toggle { transition: none; } .content-card:hover, .public-nav a:hover, .theme-toggle:hover { transform: none; } }

/* Chat surface follows the same study room system. */
html[data-theme="light"] { --bg: var(--q-paper); --surface: #fff; --surface-2: #edf4ef; --text: var(--q-ink); --muted: var(--q-muted); --line: var(--q-line); --green: var(--q-action); --green-strong: var(--q-action-dark); }
.chat-header { min-height: 72px; padding-inline: max(18px, calc((100% - 1180px) / 2)); background: #fff; backdrop-filter: none; }
.brand-mark { border-radius: 12px; box-shadow: 0 6px 0 #d1e5d8; }
.chat-main { width: min(1180px, calc(100% - 40px)); padding-top: 38px; }
.chat-panel { border-radius: 16px; box-shadow: 8px 8px 0 #e6eee8; }
.message { border-radius: 13px; }
.composer, .scope-note { border-radius: 12px; }
.send-button { background: var(--q-action); border-radius: 10px; }
@media (max-width: 640px) { .chat-header { min-height: 64px; padding-inline: 12px; } .chat-main { width: min(100% - 20px, 1180px); padding-top: 18px; } .chat-panel { box-shadow: 5px 5px 0 #e6eee8; } }

/* Dark mode: one coherent ink/surface palette instead of mixing the light redesign with the old theme. */
html[data-theme="dark"] {
  --q-paper: #0c1716; --q-surface: #142321; --q-ink: #edf7f0; --q-muted: #b2c8bc;
  --q-line: #2c4840; --q-soft: #1b342e; --q-action: #61d6a1; --q-action-dark: #a5f0c8; --q-gold: #f0c979;
  --bg: var(--q-paper); --surface: var(--q-surface); --surface-2: #1b342e; --text: var(--q-ink);
  --muted: var(--q-muted); --line: var(--q-line); --soft: var(--q-soft); --green: var(--q-action);
  --green-strong: var(--q-action-dark); color-scheme: dark;
}
html[data-theme="dark"] body { background: var(--q-paper); color: var(--q-ink); }
html[data-theme="dark"] .public-header, html[data-theme="dark"] .chat-header { background: #101f1d; border-color: var(--q-line); box-shadow: 0 8px 24px rgba(0,0,0,.22); }
html[data-theme="dark"] .public-brand, html[data-theme="dark"] .public-nav a, html[data-theme="dark"] .theme-toggle, html[data-theme="dark"] .chat-header, html[data-theme="dark"] .brand-title { color: var(--q-ink); }
html[data-theme="dark"] .public-brand-mark, html[data-theme="dark"] .brand-mark { color: #092019; background: var(--q-action); box-shadow: 0 6px 0 #203e34; }
html[data-theme="dark"] .public-nav a:hover, html[data-theme="dark"] .theme-toggle:hover { background: var(--q-soft); color: var(--q-action); }
html[data-theme="dark"] .public-nav a[aria-current="page"] { background: var(--q-action); border-color: var(--q-action); color: #092019; }
html[data-theme="dark"] .page-hero { background: #1a3932; color: var(--q-ink); box-shadow: 10px 10px 0 #203e34; }
html[data-theme="dark"] .page-hero p { color: #c9e4d5; }
html[data-theme="dark"] .page-hero .tag, html[data-theme="dark"] .tag { background: #274b3e; color: #b8f2d0; }
html[data-theme="dark"] .page-hero a { color: var(--q-gold); }
html[data-theme="dark"] .toolbar, html[data-theme="dark"] .content-card, html[data-theme="dark"] .contact-form, html[data-theme="dark"] .note-card, html[data-theme="dark"] .chat-panel, html[data-theme="dark"] .message, html[data-theme="dark"] .composer, html[data-theme="dark"] .scope-note { background: var(--q-surface); border-color: var(--q-line); box-shadow: 7px 7px 0 #0a1211; }
html[data-theme="dark"] .toolbar input, html[data-theme="dark"] .toolbar select, html[data-theme="dark"] .form-field input, html[data-theme="dark"] .form-field textarea, html[data-theme="dark"] #chat-input { background: #0f1d1b; color: var(--q-ink); border-color: var(--q-line); }
html[data-theme="dark"] .content-card:hover { border-color: var(--q-action); box-shadow: 10px 12px 0 #0a1211; }
html[data-theme="dark"] .button, html[data-theme="dark"] .header-button, html[data-theme="dark"] .attach-button, html[data-theme="dark"] .voice-button, html[data-theme="dark"] .remove-image, html[data-theme="dark"] .listen-button { background: #1b342e; color: var(--q-ink); border-color: var(--q-line); }
html[data-theme="dark"] .button.primary, html[data-theme="dark"] .send-button { background: var(--q-action); color: #092019; border-color: var(--q-action); }
html[data-theme="dark"] .button.primary:hover, html[data-theme="dark"] .send-button:hover { background: var(--q-action-dark); }
html[data-theme="dark"] .site-footer { background: #081211; border-color: var(--q-line); color: #b9d6c7; }
html[data-theme="dark"] .mobile-menu-drawer { background: var(--q-paper); border-color: var(--q-line); }
html[data-theme="dark"] .mobile-menu-links a, html[data-theme="dark"] .mobile-menu-theme { background: var(--q-surface); color: var(--q-ink); border-color: var(--q-line); }
html[data-theme="dark"] .qadir-journey-bar { background: #081211; }
html[data-theme="dark"] .qadir-journey-bar a { color: var(--q-ink); border-color: var(--q-line); }
html[data-theme="dark"] .qadir-journey-bar a[aria-current="page"] { background: var(--q-action); color: #092019; border-color: var(--q-action); }
