/* EduBab school module UI. Components draw their own light surfaces so contrast
   (>= 4.5:1 text, >= 3:1 focus ring) holds on any product background. */
.ebs-overlay, .ebs-badge, .ebs-notice, .ebs-footer {
  --ebs-ink: #10233d;      /* 15.6:1 on white */
  --ebs-muted: #3d4f66;    /* 8.6:1 on white */
  --ebs-paper: #ffffff;
  --ebs-line: #8a99ad;
  --ebs-focus: #b45309;    /* ring: 5.0:1 on white, visible next to the dark button */
  font-family: "IBM Plex Sans Arabic", "Noto Naskh Arabic", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ebs-ink);
  direction: rtl;
  text-align: right;
  box-sizing: border-box;
}
.ebs-overlay *, .ebs-badge *, .ebs-notice *, .ebs-footer * { box-sizing: border-box; }

.ebs-overlay a:focus-visible, .ebs-overlay button:focus-visible,
.ebs-badge a:focus-visible, .ebs-notice a:focus-visible, .ebs-notice button:focus-visible,
.ebs-footer a:focus-visible, .ebs-footer button:focus-visible {
  outline: 3px solid var(--ebs-focus);
  outline-offset: 2px;
}

/* visually hidden live region (A11Y-18) */
.ebs-sr {
  position: absolute !important;
  width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* entry dialog */
.ebs-overlay {
  position: fixed; inset: 0; z-index: 2147483000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(16, 35, 61, 0.72);
  overflow-y: auto;
}
.ebs-dialog {
  width: 100%; max-width: 30rem;
  background: var(--ebs-paper);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex; flex-direction: column; gap: 0.75rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.ebs-dialog h2 { margin: 0; font-size: 1.5rem; line-height: 1.3; }
.ebs-dialog p { margin: 0; }
.ebs-hint { color: var(--ebs-muted); font-size: 0.95rem; }

/* owl (primary) button */
.ebs-owl {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem;
  padding: 0.85rem 1rem;
  min-height: 3rem;
  border-radius: 10px;
  background: var(--ebs-ink);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}
.ebs-owl:hover { background: #1c3657; }
.ebs-owl img { flex: none; border-radius: 50%; }
.ebs-owl span[lang="he"] { font-weight: 500; font-size: 0.95rem; }

/* generic button */
.ebs-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.75rem;
  padding: 0.6rem 1rem;
  border: 2px solid var(--ebs-ink);
  border-radius: 10px;
  background: var(--ebs-paper);
  color: var(--ebs-ink);
  font: inherit; font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.ebs-btn:hover { background: #e8edf3; }
.ebs-btn-small { min-height: 2.25rem; padding: 0.3rem 0.75rem; font-size: 0.95rem; }
.ebs-btn[aria-pressed="true"] { background: var(--ebs-ink); color: #ffffff; }

/* user badge (IDM-09): top, inline-start corner (right in RTL) */
.ebs-badge {
  position: fixed; top: 8px; inset-inline-start: 8px; z-index: 2147482000;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem;
  max-width: calc(100vw - 16px);
  padding: 0.35rem 0.6rem;
  background: var(--ebs-paper);
  border: 1px solid var(--ebs-line);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  font-size: 0.95rem;
}
.ebs-badge-name { font-weight: 700; }
.ebs-badge-school { color: var(--ebs-muted); }

/* idle warning / session ended */
.ebs-notice {
  position: fixed; bottom: 16px; left: 16px; right: 16px; z-index: 2147482500;
  max-width: 34rem; margin: 0 auto;
  display: flex; flex-direction: column; gap: 0.75rem;
  padding: 1rem;
  background: var(--ebs-paper);
  border: 2px solid var(--ebs-ink);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}
.ebs-notice p { margin: 0; }

/* legal footer */
.ebs-footer {
  margin-top: 2rem;
  padding: 1rem 16px;
  background: var(--ebs-paper);
  border-top: 1px solid var(--ebs-line);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem;
  font-size: 0.95rem;
}
.ebs-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.ebs-footer nav a { color: var(--ebs-ink); text-decoration: underline; }
.ebs-footer-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ebs-footer .ebs-owl { padding: 0.4rem 0.75rem; min-height: 2.25rem; font-size: 0.95rem; }

@media (prefers-reduced-motion: reduce) {
  .ebs-overlay *, .ebs-badge *, .ebs-footer * { transition: none !important; animation: none !important; }
}
@media print {
  .ebs-overlay, .ebs-badge, .ebs-notice, .ebs-footer-actions { display: none !important; }
}
