/* SHANI ACADEMY — responsive hardening only. No colours, fonts or desktop layout changed. */
html, body { max-width: 100%; }
img, video, canvas, svg { max-width: 100%; }

@supports (height: 100dvh) {
  [data-intro-root] { height: 100dvh; }
}

@media (max-width: 900px) {
  a[href^="https://wa.me"],
  a[href^="tel:"],
  a[href^="mailto:"],
  button,
  [role="button"],
  summary { min-height: 44px; }
  a[aria-label], button[aria-label] { min-width: 44px; min-height: 44px; }
  input, select, textarea { font-size: 16px !important; }
}

@media (max-width: 480px) {
  h1, h2, h3 { overflow-wrap: anywhere; }
}

/* notch + home-bar safe areas, only where something is pinned */
header { padding-inline: max(0px, env(safe-area-inset-left)) max(0px, env(safe-area-inset-right)); }
#sa-a11y-btn { margin-bottom: env(safe-area-inset-bottom); }
/* Floating panels only. The three full-screen viewers (image viewer, certificate viewer,
   accessibility statement) size their own content; capping the overlay itself left a 32px
   strip of the page uncovered and clickable beside and below the backdrop. */
[role="dialog"]:not([aria-labelledby="sa-box-title"]):not(#sa-cert-view):not(#sa-stmt) {
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}

/* mobile legibility: only raise the smallest inline sizes, desktop untouched */
@media (max-width: 900px) {
  [style*="font-size:13px"] { font-size: 15px !important; }
  [style*="font-size:14px"] { font-size: 15px !important; }
  [style*="font-size:10px"] { font-size: 12px !important; }
}


/* "מה כוללת התוכנית" holds a fixed set of four cards. auto-fit settled on three tracks at
   common widths and orphaned the fourth, so the count is stated explicitly and steps
   1 -> 2 -> 4, never landing on three. */
[data-includes-grid] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 560px) {
  [data-includes-grid] { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 1100px) {
  [data-includes-grid] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}


/* Image viewer: the sticky header lives in a wrapper with its own stacking context and a
   backdrop-filter, so it painted above the dialog and intercepted clicks on the close
   button. Hide the page chrome for as long as the viewer is open. */
/* main carries an inline z-index, so this one state needs to outrank it */
body.sa-box-open main { z-index: 2147482000 !important; }
body.sa-box-open header,
body.sa-box-open #sa-a11y-btn { visibility: hidden; pointer-events: none; }
