
/* =========================================================
   Hebrew (RTL) overrides for Neuromodulators page (/he/neuromodulator.html)
   IMPORTANT: Keep this file loaded AFTER ../neuromodulator.css and AFTER rtl.css
   ========================================================= */

html[dir="rtl"] body{
  font-family: "Heebo", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

/* Reading alignment */
html[dir="rtl"] .page-hero .inner,
html[dir="rtl"] .page-body,
html[dir="rtl"] .page-aside,
html[dir="rtl"] .site-footer{
  text-align: right;
}

/* ---------------------------------------------------------
   Desktop layout swap:
   - Main content stays on the RIGHT
   - Sidebar moves to the LEFT
   Fixes grid auto-placement gaps by forcing grid-row: 1
   --------------------------------------------------------- */
@media (min-width: 980px){
  html[dir="rtl"] .page-grid{
    direction: ltr;                    /* predictable grid placement */
    grid-template-columns: 0.8fr 1.2fr;/* left = sidebar, right = main */
    align-items: start;
  }

  html[dir="rtl"] .page-aside{
    grid-column: 1;
    grid-row: 1;                       /* critical: prevent pushing down */
    direction: rtl;                    /* keep internal text RTL */
  }

  html[dir="rtl"] .page-body{
    grid-column: 2;
    grid-row: 1;                       /* critical: prevent pushing down */
    direction: rtl;
  }
}

/* ---------------------------------------------------------
   "How it works" block:
   - Copy on the RIGHT
   - Image on the LEFT
   Fixes wrapping/stacking in RTL by forcing grid-row: 1
   --------------------------------------------------------- */
@media (min-width: 980px){
  html[dir="rtl"] .how-grid{
    direction: ltr;
    grid-template-columns: 0.95fr 1.05fr; /* left = image, right = copy */
    align-items: start;
  }

  html[dir="rtl"] .how-it-works .media-card{
    grid-column: 1;
    grid-row: 1;
  }

  html[dir="rtl"] .how-it-works .copy{
    grid-column: 2;
    grid-row: 1;
    direction: rtl;
  }

  html[dir="rtl"] .caption{
    text-align: right;
  }
}

/* Lists: move indents/bullets to the RIGHT */
html[dir="rtl"] ul.bullet,
html[dir="rtl"] ul.bullets{
  padding-left: 0;
  padding-right: 18px;
}

/* Aside custom bullets: move to the RIGHT */
html[dir="rtl"] .aside-list li{
  padding-left: 0;
  padding-right: 18px;
}
html[dir="rtl"] .aside-list li::before{
  left: auto;
  right: 0;
}

/* Dropdown alignment */
html[dir="rtl"] .nav-sub{
  left: auto;
  right: 0;
}

/* Sidebar image crop tweak (optional) */
html[dir="rtl"] .neuromod-aside-image img{
  object-position: 50% 35%;
}
