/* ===== سكربت التعازي — التصميم الزجاجي ===== */
:root {
  --bg: #09090a;
  --panel: #161618;
  --panel-2: #1d1d20;
  --glass: rgba(255, 255, 255, .05);
  --glass-2: rgba(255, 255, 255, .08);
  --glass-b: rgba(255, 255, 255, .10);
  --line: #f2f2f2;
  --text: #f2f2f2;
  --muted: #9a9aa2;
  --ok: #9fd3a8;
  --err: #f0a3a3;
  --radius: 18px;
  --r-sm: 12px;
  --font: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
  --gap: clamp(12px, 2.6dvh, 26px);
}
* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  background: radial-gradient(120% 55% at 50% 0%, #26262b 0%, #121215 55%, #09090a 100%) no-repeat, #09090a;
  min-height: 100%;
}
body {
  margin: 0; color: var(--text); background: transparent;
  font-family: var(--font); font-size: 17px; line-height: 1.7;
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 980px; margin: 0 auto; padding: 0 12px; }
@media (min-width: 420px) { .wrap { padding: 0 16px; } }
.wrap.narrow { max-width: 640px; }
main.wrap { flex: 1; padding-bottom: 8px; }
.page-home main.wrap { display: flex; flex-direction: column; justify-content: center; }
.center { text-align: center; }
.muted { color: var(--muted); }

/* ----- الأسطح الزجاجية ----- */
.box, .cell, .card, .item {
  background: var(--glass);
  border: 1px solid var(--glass-b);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}

/* ----- الشريط العلوي ----- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; }
.logo img { height: 44px; width: auto; }
.top-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px;
  background: var(--glass); color: var(--text); border: 1px solid var(--glass-b); border-radius: var(--r-sm);
  font: 500 13px var(--font); text-decoration: none; cursor: pointer;
}
.top-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ----- الرأس ----- */
.cal {
  width: auto; height: clamp(56px, 10.5dvh, 130px); max-width: 80%;
  margin: var(--gap) auto 0;
  filter: drop-shadow(0 0 18px rgba(255, 255, 255, .16));
}
.kicker { text-align: center; font-size: 14px; font-weight: 500; letter-spacing: .5px; color: #b4b4bb; margin: 6px 0 var(--gap); }

.box { padding: 14px 10px; text-align: center; margin-bottom: var(--gap); }
.hero .name-title { display: block; color: var(--muted); font-size: 13px; font-weight: 500; }
.hero .name { display: block; font-size: clamp(20px, 5.8vw, 32px); font-weight: 800; line-height: 1.35; margin: 2px 0 6px; }
.meta {
  display: grid; grid-template-columns: auto auto auto; justify-content: center; align-items: baseline;
  gap: 2px 6px; white-space: nowrap; overflow: hidden; max-width: 100%;
  font-size: 13px; line-height: 1.9; color: #d8d8de;
  margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--glass-b);
}
.meta-k { color: var(--muted); font-weight: 700; text-align: right; }
.meta-sep { color: rgba(255, 255, 255, .25); }
.meta-v { text-align: right; }
.meta .num { font-variant-numeric: tabular-nums; }
.meta .dot { color: var(--muted); }
@media (min-width: 760px) { .meta { font-size: 15px; } }
.note { margin: 8px 0 0; color: #d6d6d6; font-size: 14px; }
.hero-sm { padding: 12px 14px; }
.hero-sm .name { font-size: clamp(19px, 5.4vw, 26px); margin-bottom: 6px; }
.tag { display: inline-block; font-size: 13px; color: #111; background: var(--line); padding: 3px 14px; border-radius: 999px; font-weight: 700; }

.list { display: grid; gap: 12px; }
.box-link { display: block; text-decoration: none; margin: 0; transition: background .2s; }
.box-link .name { display: block; font-size: 21px; margin: 0; }
@media (hover: hover) { .box-link:hover { background: var(--glass-2); } }

/* ----- مجالس الرجال والنساء (جنباً إلى جنب) ----- */
.sessions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sessions.one { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; width: 100%; }
.session { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.session-head {
  margin: 0; text-align: center; font-size: 14px; font-weight: 700; line-height: 1.5;
  background: var(--line); color: #111; border-radius: var(--r-sm); padding: 7px 6px;
}
.cell { display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px 6px; }
.cell.slot { flex-direction: column; border-radius: 16px; }
.slot-l { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.slot-t { font-size: 30px; font-weight: 800; line-height: 1.15; direction: ltr; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.cell.place { flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 700; line-height: 1.55; min-height: 58px; border-radius: 16px; }
.map-link {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700;
  color: #111; background: var(--line); border-radius: 10px; padding: 3px 10px; text-decoration: none;
}
.map-link svg { width: 12px; height: 12px; fill: currentColor; }

/* ----- الأزرار ----- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 10px 18px; border-radius: 14px; border: 1px solid transparent;
  font: 800 16px var(--font); text-decoration: none; cursor: pointer; text-align: center;
  transition: background .2s, color .2s, border-color .2s, opacity .2s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn svg { width: 20px; height: 20px; fill: currentColor; }
.btn-primary { background: var(--line); color: #111; }
.btn-primary:disabled { opacity: .6; cursor: wait; }
.btn-ghost { background: var(--glass); color: var(--text); border-color: var(--glass-b); }
@media (hover: hover) {
  .btn-primary:hover { background: #fff; }
  .btn-ghost:hover { background: var(--glass-2); }
}
.btn-block { width: 100%; }
.btn.cta { margin-top: auto; min-height: 46px; font-size: 15px; padding: 8px 10px; }
.chip { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 999px; background: #111; color: #fff; font-size: 12px; line-height: 22px; font-weight: 700; }
.btn-ghost .chip, .feed-head .chip { background: var(--line); color: #111; }

@media (min-width: 760px) {
  .logo img { height: 64px; }
  .sessions { gap: 22px; }
  .session { gap: 12px; }
  .session-head { font-size: 17px; padding: 9px; }
  .cell { padding: 12px 10px; }
  .cell.slot { flex-direction: row; justify-content: space-around; min-height: 84px; }
  .slot-l { font-size: 18px; }
  .slot-t { font-size: 40px; }
  .cell.place { font-size: 18px; min-height: 76px; }
  .map-link { font-size: 13px; }
  .btn.cta { min-height: 52px; font-size: 17px; }
  .kicker { font-size: 17px; }
  .box { padding: 18px; }
}

/* ----- النموذج ----- */
.card { padding: 18px 16px; margin-bottom: var(--gap); }
.form { position: relative; }
.form-title { margin: 0 0 12px; font-size: 19px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; color: #cfcfd5; margin-bottom: 6px; font-weight: 500; }
.field input, .field textarea {
  width: 100%; background: rgba(0, 0, 0, .35); color: var(--text); border: 1px solid var(--glass-b); border-radius: var(--r-sm);
  font: 16px/1.8 var(--font); padding: 12px 14px; outline: none; resize: none; transition: border-color .2s, background .2s;
}
.field textarea { min-height: 120px; }
.field input:focus, .field textarea:focus { border-color: rgba(255, 255, 255, .45); background: rgba(0, 0, 0, .5); }
.field ::placeholder { color: #6b6b72; }
.field-meta { display: flex; justify-content: flex-end; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.counter { direction: ltr; font-variant-numeric: tabular-nums; }
.counter.warn { color: var(--err); }
.hp { position: absolute !important; top: 0; inset-inline-start: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }
.alert { padding: 10px 14px; border-radius: var(--r-sm); margin-bottom: 12px; font-size: 14.5px; }
.alert-ok { background: rgba(159, 211, 168, .1); color: var(--ok); border: 1px solid rgba(159, 211, 168, .3); }
.alert-err { background: rgba(240, 163, 163, .1); color: var(--err); border: 1px solid rgba(240, 163, 163, .3); }
.closed { text-align: center; color: #d0d0d0; }

/* ----- قائمة التعازي ----- */
.feed-head { font-size: 19px; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.empty { color: var(--muted); text-align: center; padding: 18px 0; }
.items { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.item { padding: 13px 15px; border-radius: 16px; }
.item-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 2px; }
.item-name { font-size: 15.5px; font-weight: 700; color: #fff; overflow-wrap: anywhere; }
.item-time { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.item-msg { margin: 0; white-space: pre-line; overflow-wrap: anywhere; color: #e0e0e6; font-size: 15.5px; line-height: 1.9; }
.item.pinned { margin-bottom: 10px; background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .22); }
.pin-badge { font-size: 11px; color: #111; background: var(--line); border-radius: 999px; padding: 0 9px; line-height: 20px; white-space: nowrap; }
.item.fresh { animation: fresh 1.8s ease-out; }
@keyframes fresh {
  0% { opacity: 0; transform: translateY(-8px); background: rgba(255, 255, 255, .14); }
  25% { opacity: 1; transform: none; }
  100% { background: var(--glass); }
}
.admin-edit { display: inline-block; margin-top: 8px; font-size: 12.5px; color: #f0c878; text-decoration: none; border: 1px solid rgba(240, 200, 120, .4); padding: 2px 10px; border-radius: 999px; }

/* ----- الإعلان ----- */
.ad { margin: var(--gap) 0 0; }
.ad a, .ad img { display: block; }
.ad img { width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--glass-b); }
.ad-registry { margin: 0 0 var(--gap); }

/* ----- التذييل ----- */
.foot { text-align: center; padding: 14px 16px 16px; font-size: 12.5px; line-height: 1.8; color: #85858c; }
.foot a { color: #d4d4da; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, .25); }
@media (hover: hover) { .foot a:hover { color: #fff; border-color: #fff; } }

/* ----- الشاشات القصيرة ----- */
@media (max-height: 760px) and (max-width: 759px) {
  :root { --gap: 12px; }
  .topbar { padding-top: 8px; }
  .logo img { height: 38px; }
  .cal { height: clamp(48px, 9dvh, 68px); }
  .kicker { margin-top: 4px; }
  .box { padding: 10px 12px; }
  .hero .name { margin-bottom: 6px; }
  .sessions, .session { gap: 7px; }
  .cell { padding: 5px 6px; }
  .slot-t { font-size: 27px; }
  .cell.place { min-height: 50px; font-size: 13px; }
  .session-head { padding: 5px; font-size: 13.5px; }
  .btn.cta { min-height: 44px; }
  .foot { padding: 10px 0 12px; }
}
@media (max-height: 640px) and (max-width: 759px) {
  :root { --gap: 8px; }
  .cal { height: 44px; }
  .slot-t { font-size: 24px; }
  .slot-l { font-size: 11.5px; line-height: 1.3; }
  .cell.place { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
