/* legal.abdeljawad.com — hub + policy pages */

:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --text: #1c1917;
  --text-muted: #6b6560;
  --border: #e8e2d9;
  --shadow: 0 8px 32px rgba(28, 25, 23, 0.08);
  --shadow-sm: 0 2px 8px rgba(28, 25, 23, 0.05);
  --radius: 16px;
  --radius-sm: 10px;
  --max-policy: 44rem;
  --max-hub: 64rem;

  --hub-accent: #2a2622;
  --hub-muted: #8a847c;

  --dhikr: #c9a227;
  --dhikr-dark: #8f7318;
  --dhikr-soft: #fbf6e8;
  --dhikr-ring: rgba(201, 162, 39, 0.25);

  --quran: #b8943f;
  --quran-dark: #7d6328;
  --quran-soft: #f5efe4;
  --quran-ring: rgba(184, 148, 63, 0.22);

  --font-ar: "IBM Plex Sans Arabic", "Noto Sans Arabic", system-ui, sans-serif;
  --font-en: "Poppins", system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0e0d;
    --surface: #1a1816;
    --text: #f5f2ed;
    --text-muted: #a8a29e;
    --border: #2e2a26;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --hub-accent: #f5f2ed;
    --hub-muted: #a8a29e;
    --dhikr-soft: #221e14;
    --dhikr-ring: rgba(201, 162, 39, 0.15);
    --quran-soft: #221e16;
    --quran-ring: rgba(184, 148, 63, 0.15);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-en);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

html[lang="ar"] body,
body[dir="rtl"] { font-family: var(--font-ar); }
[lang="en"] { font-family: var(--font-en); }
[lang="ar"] { font-family: var(--font-ar); }

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 300;
  padding: 0.55rem 1rem;
  background: var(--hub-accent);
  color: var(--bg);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.skip-link:focus { top: 1rem; }

a { color: inherit; text-decoration: none; }
a:hover { opacity: 0.82; }

/* ── Shared hub topbar ── */
.hub-topbar {
  max-width: var(--max-hub);
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
}

.hub-topbar__home {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
  color: var(--text);
}

.hub-topbar__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--dhikr-soft), var(--quran-soft));
  border: 1px solid var(--border);
  font-size: 0.95rem;
  line-height: 1;
}

.hub-topbar__links {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
}

.hub-topbar__links a { font-weight: 500; }

/* ── Hub masthead ── */
.page--hub .hub-masthead {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.page--hub .hub-masthead::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, var(--dhikr-ring), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 10%, var(--quran-ring), transparent 50%);
  pointer-events: none;
}

.hub-masthead__body {
  position: relative;
  max-width: var(--max-hub);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
  text-align: center;
}

.hub-masthead__eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hub-muted);
}

.hub-masthead h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.hub-masthead__lead {
  margin: 0 auto 2rem;
  max-width: 36rem;
  font-size: 1.05rem;
  color: var(--text-muted);
}

.hub-pillars {
  display: grid;
  gap: 0.75rem;
  max-width: 40rem;
  margin: 0 auto;
}

@media (min-width: 640px) {
  .hub-pillars { grid-template-columns: repeat(3, 1fr); }
}

.hub-pillar {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.hub-pillar span {
  display: block;
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

/* ── Hub app directory ── */
.hub-main {
  max-width: var(--max-hub);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

.hub-section-title {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--hub-muted);
}

.hub-section-heading {
  margin: 0 0 1.75rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.hub-app-list {
  display: grid;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.hub-app-tile {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.25rem;
  padding: 1.35rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}

.hub-app-tile::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.hub-app-tile--dhikr::before { background: var(--dhikr); }
.hub-app-tile--quran::before { background: var(--quran); }

.hub-app-tile:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.hub-app-tile__icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.hub-app-tile__info h3 {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
  font-weight: 700;
}

.hub-app-tile__info p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.hub-app-tile__en {
  font-size: 0.82rem;
  color: var(--hub-muted);
  margin-top: 0.2rem;
}

.hub-app-tile__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  min-width: 9rem;
}

@media (max-width: 640px) {
  .hub-app-tile {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }
  .hub-app-tile__actions {
    grid-column: 1 / -1;
    flex-direction: row;
    min-width: 0;
  }
  .hub-app-tile__actions .btn { flex: 1; justify-content: center; }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  white-space: nowrap;
}

.btn:hover { opacity: 0.9; transform: translateY(-1px); }

.btn--primary-dhikr { background: var(--dhikr); color: #fff; }
.btn--ghost-dhikr { background: transparent; color: var(--dhikr-dark); border: 1.5px solid var(--dhikr); }
.btn--primary-quran { background: var(--quran); color: #fff; }
.btn--ghost-quran { background: transparent; color: var(--quran-dark); border: 1.5px solid var(--quran); }
.btn--hub { background: var(--hub-accent); color: var(--bg); }

.hub-footnote {
  margin-top: 2rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}

/* ── Policy pages: hub chrome ── */
.page--policy {
  --page-accent: var(--dhikr);
  --page-accent-dark: var(--dhikr-dark);
  --page-soft: var(--dhikr-soft);
}

.page--policy.page--quran {
  --page-accent: var(--quran);
  --page-accent-dark: var(--quran-dark);
  --page-soft: var(--quran-soft);
}

.page--policy .hub-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.breadcrumb {
  max-width: var(--max-policy);
  margin: 0 auto;
  padding: 0.75rem 1.5rem 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.breadcrumb a { color: var(--page-accent-dark); font-weight: 500; }
.breadcrumb [aria-current="page"] { color: var(--text); font-weight: 600; }
.breadcrumb__sep { opacity: 0.45; }

.app-banner {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.app-banner__inner {
  max-width: var(--max-policy);
  margin: 0 auto;
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.app-banner__brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.app-banner__icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  outline: 3px solid var(--page-soft);
}

.app-banner h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--page-accent-dark);
}

.app-banner .tagline {
  margin: 0.15rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.app-banner__nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.app-banner__nav a {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-weight: 500;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.app-banner__nav a.is-active,
.app-banner__nav a.nav-lang-active {
  background: var(--page-accent);
  color: #fff;
  border-color: var(--page-accent);
}

/* ── Policy content ── */
main.policy-main {
  max-width: var(--max-policy);
  margin: 0 auto;
  padding: 2rem 1.5rem 3.5rem;
}

.meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  border-inline-start: 4px solid var(--page-accent);
  background: var(--page-soft);
}

.meta time { font-weight: 600; color: var(--text); }

section { margin-bottom: 2rem; }

section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: var(--page-accent-dark);
}

section p { margin: 0 0 0.85rem; }
section ul { margin: 0 0 0.85rem; padding-inline-start: 1.35rem; }
section li { margin-bottom: 0.4rem; }

.highlight-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow-sm);
}

.highlight-box ul { margin: 0; }

.policy-main section a {
  color: var(--page-accent-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}

.policy-main section a:hover { opacity: 0.8; }

.hub-switcher {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.hub-switcher__label {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hub-muted);
}

.hub-switcher__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.hub-switcher__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem 0.45rem 0.45rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: border-color 0.15s;
}

.hub-switcher__chip:hover { border-color: var(--page-accent); }
.hub-switcher__chip img { width: 24px; height: 24px; border-radius: 6px; }
.hub-switcher__chip.is-current { opacity: 0.55; pointer-events: none; }

/* ── Footer ── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1.75rem 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.site-footer__inner {
  max-width: var(--max-hub);
  margin: 0 auto;
}

.site-footer a { font-weight: 500; color: var(--text); }

@media (min-width: 600px) {
  body { font-size: 1.05rem; }
  section h2 { font-size: 1.2rem; }
}
