/* ---------- hub · «مكتبة عقل» articles · reader · writing pad ---------- */
#letters { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
body.armode > header.hero, body.armode > main, body.armode > footer,
body.hubmode > header.hero, body.hubmode > main, body.hubmode > footer { display: none; }
.hubview, .arview { position: relative; z-index: 1; width: min(1080px, 100%); margin: 0 auto; padding: 0 16px 96px; }
.hubh, .arh { text-align: center; padding: clamp(56px, 11vh, 110px) 0 18px; }
.hubh h1, .arh-t { font-family: var(--display); font-size: clamp(2.6rem, 8vw, 5rem); margin: .1em 0 0; line-height: 1.25;
  background: linear-gradient(100deg, var(--gold-2), var(--gold) 40%, #c9925a 60%, var(--gold-2)); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 9s linear infinite; }
.arview[lang="en"] .arh-t { font-family: "Cormorant Garamond", serif; font-weight: 600; letter-spacing: .01em; }
.hubg { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; margin-top: 18px; }
.hubc { display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto 1fr; gap: 4px 14px; text-align: start; padding: 18px; color: var(--text);
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; cursor: pointer; font: inherit;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: transform .25s, border-color .25s, background .25s; }
.hubc:hover:not([disabled]) { transform: translateY(-3px); border-color: rgba(232,195,122,.5); background: var(--glass-hi); }
.hubc.soon { opacity: .55; cursor: default; }
.hubi { grid-row: span 2; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; font-family: var(--display); font-size: 1.7rem;
  color: var(--gold-2); background: radial-gradient(circle at 30% 30%, rgba(232,195,122,.28), rgba(232,195,122,.05)); border: 1px solid rgba(232,195,122,.3); }
.hubt { font-weight: 600; color: var(--gold-2); font-size: 1.08rem; }
.hubt em { font-style: normal; font-size: .72rem; padding: 1px 8px; border-radius: 999px; background: rgba(111,198,192,.16); color: var(--teal); margin-inline-start: 6px; }
.hubt small { color: var(--muted); }
.hubd { color: var(--muted); font-size: .9rem; line-height: 1.7; }

.arh-top { display: flex; justify-content: flex-end; }
.langsw { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: rgba(7,11,26,.6); }
.langsw button { border: 0; background: none; color: var(--muted); padding: 6px 14px; border-radius: 999px; cursor: pointer; font: inherit; font-size: .88rem; }
.langsw button[aria-pressed="true"] { background: rgba(232,195,122,.2); color: var(--gold-2); }
.arstats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 34px; margin-top: 22px; }
.arstats b { display: block; font-family: var(--poem); font-size: 2rem; color: var(--gold-2); line-height: 1.1; font-variant-numeric: tabular-nums; }
.arstats span { color: var(--muted); font-size: .85rem; }
.arv { margin: 26px auto 8px; padding: 16px 18px; background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); }
.arv figcaption { color: var(--muted); font-size: .85rem; margin-bottom: 10px; }
.arv-bars { display: flex; align-items: flex-end; gap: 3px; height: 74px; }
.arv-b { flex: 1; height: var(--h); min-height: 2px; border-radius: 3px 3px 0 0; background: linear-gradient(to top, rgba(232,195,122,.45), var(--gold-2)); position: relative; }
.arv-b.z { background: rgba(255,255,255,.08); }
.arv-b:hover { filter: brightness(1.25); }
.arv-b:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: #0d1430; border: 1px solid var(--line); color: var(--text); font-size: .75rem; padding: 3px 8px; border-radius: 8px; z-index: 3; }
.arv-ax { display: flex; justify-content: space-between; color: var(--muted); font-size: .75rem; margin-top: 6px; }
.aropen { margin: 30px 0 10px; }
.aropen h2, .arshelf h2 { font-family: var(--display); color: var(--gold-2); font-size: 1.7rem; margin: 0 0 4px; font-weight: 400; }
.arview[lang="en"] .aropen h2, .arview[lang="en"] .arshelf h2 { font-family: "Cormorant Garamond", serif; font-weight: 600; font-size: 1.9rem; }
.muted { color: var(--muted); }
.aropen-g { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; margin-top: 12px; }
.arloop { padding: 18px; border-radius: var(--r); background: linear-gradient(160deg, rgba(232,195,122,.1), rgba(18,26,58,.6)); border: 1px dashed rgba(232,195,122,.4); }
.arloop h3 { font-family: var(--poem); color: var(--gold-2); margin: 6px 0; font-size: 1.2rem; }
.arloop p { color: var(--muted); font-size: .9rem; line-height: 1.8; margin: 0 0 12px; }
.arloop.pad-cta { border-style: solid; border-color: rgba(111,198,192,.35); background: linear-gradient(160deg, rgba(111,198,192,.1), rgba(18,26,58,.6)); }
.arloop-a { display: flex; gap: 8px; flex-wrap: wrap; }
button.primary { background: linear-gradient(120deg, var(--gold-2), var(--gold)); color: #1a1408; border: 0; border-radius: 999px; padding: 9px 18px; font: inherit; font-weight: 600; cursor: pointer; }
button.primary:hover { filter: brightness(1.08); }
.arsearch { margin: 26px 0 8px; }
.arsearch input { width: 100%; font: inherit; background: var(--glass); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 12px 18px; }
.arshelf { margin-top: 34px; }
.argrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; margin-top: 14px; }
.arc { position: relative; display: flex; flex-direction: column; gap: 6px; text-align: start; padding: 16px; color: var(--text); font: inherit; cursor: pointer; overflow: hidden;
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: transform .25s, border-color .25s; }
.arc[hidden] { display: none; }
.arc:hover { transform: translateY(-3px); border-color: rgba(232,195,122,.5); }
.arc img { width: calc(100% + 32px); max-width: none; margin: -16px -16px 6px; aspect-ratio: 16 / 9; object-fit: cover; opacity: .85; }
.arc-n { font-family: var(--poem); color: var(--gold); font-size: .9rem; opacity: .8; }
.arc-t { font-family: var(--poem); font-weight: 700; color: var(--gold-2); font-size: 1.18rem; line-height: 1.5; }
.arview[lang="en"] .arc-t { font-family: "Cormorant Garamond", serif; font-size: 1.28rem; }
.arc-s { font-size: .72rem; color: var(--teal); }
.arc-l { color: var(--muted); font-size: .88rem; line-height: 1.75; }
.arc-m { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: auto; padding-top: 6px; color: var(--muted); font-size: .76rem; }
.arb, .arc-tr { padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); }
.arc-tr { color: var(--teal); border-color: rgba(111,198,192,.35); }

dialog.arreader, dialog.arpad { width: min(880px, 100vw); max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0 auto; padding: 0; border: 0; color: var(--text);
  background: rgba(7,11,26,.97); }
dialog.arreader::backdrop, dialog.arpad::backdrop { background: rgba(3,5,14,.75); backdrop-filter: blur(6px); }
.arreader > article { display: flex; flex-direction: column; height: 100%; }
.arr-h { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.arr-meta { display: flex; gap: 12px; color: var(--muted); font-size: .85rem; align-items: center; }
.arr-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.arr-body { overflow-y: auto; padding: 22px clamp(16px, 5vw, 56px) 60px; }
.arr-body h1 { font-family: var(--poem); color: var(--gold-2); font-size: clamp(1.6rem, 4.5vw, 2.3rem); line-height: 1.5; margin: 0 0 6px; }
.arr-note { color: var(--teal); font-size: .82rem; margin: 0 0 14px; }
.arr-text p, .arr-both p { margin: 0 0 1em; line-height: 2.05; font-size: 1.12rem; max-width: 68ch; overflow-wrap: anywhere; }
.arr-text[lang="ar"] p, .arr-both p.o { font-family: var(--poem); font-size: 1.28rem; }
.arr-text[lang="en"] p { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.24rem; line-height: 1.75; }
.arr-both { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.arr-both p.t { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.14rem; line-height: 1.7; color: #d9d3c4; border-inline-start: 1px solid var(--line); padding-inline-start: 14px; }
.arr-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin: 10px 0 18px; }
.arr-photos img, .arr-body video { width: 100%; border-radius: 12px; border: 1px solid var(--line); }
.arr-body video { margin-bottom: 16px; max-height: 70vh; background: #000; }
.deck { margin: 14px 0 24px; }
.deck-v { cursor: pointer; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #fff; }
.deck-v img { display: block; width: 100%; height: auto; }
.deck figcaption a { color: var(--gold); }
.deck figcaption { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 8px; color: var(--muted); font-size: .85rem; }
.deck-tx { margin-top: 12px; padding: 12px 16px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); }
.deck-tx p { margin: 0 0 .5em; line-height: 1.9; }
.deck-tx[lang="ar"] p { font-family: var(--poem); font-size: 1.15rem; }
.deck-tx[lang="en"] p { font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.15rem; }
.arr-src { margin-top: 26px; font-size: .9rem; }
.arr-src a, .arr-text a, .arr-both a { color: var(--gold); }
.arpad .pad { display: flex; flex-direction: column; height: 100%; padding: 16px clamp(16px, 4vw, 40px); gap: 12px; }
.arpad header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.arpad h2 { font-family: var(--poem); color: var(--gold-2); margin: 0; font-size: 1.4rem; }
.pad-ctx { background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; max-height: 30vh; overflow: auto; }
.pad-ctx p { font-family: var(--poem); color: var(--muted); line-height: 1.9; margin: 6px 0; }
.arpad textarea { flex: 1; width: 100%; resize: none; font-family: var(--poem); font-size: 1.3rem; line-height: 2; color: var(--text);
  background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 14px; padding: 18px; outline: none; }
.arpad textarea:focus { border-color: rgba(232,195,122,.5); }
.arpad footer { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; font-size: .85rem; }
@media (max-width: 640px) {
  .arr-both { grid-template-columns: 1fr; } .arr-both p.t { border: 0; padding: 0 0 10px; margin-bottom: 14px; border-bottom: 1px dashed var(--line); }
  .arstats b { font-size: 1.6rem; }
}
@media (prefers-reduced-motion: reduce) { .hubh h1, .arh-t { animation: none; } }
