/*!
 * Shomineh mobile CSS (Divi-child). EVERY rule below lives inside a max-width media query,
 * so desktop (>= 981px) rendering is unaffected. Loaded with media="(max-width: 980px)".
 * 1) Endless-scroll feed cards (phones, <= 767px)
 * 2) Mobile fixes (<= 980px)
 */

/* ---------- 0. feed container is inert unless the phone media query matches ---------- */
.shm-feed { display: none; }

/* ---------- 1. Endless scroll feed (phones) ---------- */
@media (max-width: 767px) {
  .shm-orig-hidden { display: none !important; }

  .shm-feed {
    display: block;
    direction: rtl;
    text-align: right;
    box-sizing: border-box;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 14px 36px;
    background: transparent;
    font-family: inherit;
  }
  .shm-feed *, .shm-feed *::before, .shm-feed *::after { box-sizing: border-box; }

  .shm-feed__heading {
    margin: 8px 0 18px;
    padding: 0;
    font-size: 22px;
    line-height: 1.5;
    font-weight: 700;
    color: #222;
    text-align: center;
  }

  .shm-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 14px rgba(0, 0, 0, .09);
    margin: 0 0 22px;
    overflow: hidden;
  }
  .shm-card__media { display: block; background: #eee; line-height: 0; }
  .shm-card__media img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    margin: 0;
    border-radius: 0;
  }
  .shm-card__body { padding: 14px 16px 18px; }
  .shm-card__title {
    margin: 0 0 6px;
    padding: 0;
    font-size: 19px;
    line-height: 1.75;
    font-weight: 700;
    color: #1d1d1d;
  }
  .shm-card__title a { color: inherit; text-decoration: none; }
  .shm-card__date {
    display: block;
    margin: 0 0 8px;
    font-size: 13px;
    line-height: 1.6;
    color: #7a7a7a;
  }
  .shm-card__excerpt {
    margin: 0 0 10px;
    padding: 0;
    font-size: 15px;
    line-height: 1.95;
    color: #444;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
  }
  .shm-card__more {
    display: inline-block;
    padding: 6px 0;
    font-size: 14px;
    font-weight: 700;
    color: #d9541e;
    text-decoration: none;
  }
  .shm-card__more::after { content: " ←"; }

  .shm-feed__status {
    min-height: 28px;
    padding: 6px 0;
    text-align: center;
    font-size: 14px;
    color: #777;
  }
  .shm-feed__status:empty { min-height: 0; padding: 0; }
  .shm-feed__status.is-error { color: #b32d2e; }
  .shm-feed__btn {
    display: block;
    margin: 4px auto 0;
    padding: 10px 22px;
    min-height: 44px;
    font-family: inherit;
    font-size: 15px;
    color: #fff;
    background: #d9541e;
    border: 0;
    border-radius: 24px;
    cursor: pointer;
  }
  .shm-feed__sentinel { height: 1px; }

  /* on category/tag pages the original paginated list is replaced by the feed */
  .shm-feed.is-active { padding-top: 6px; }
}

/* ---------- 2. Mobile fixes (tablet + phone) ---------- */
@media (max-width: 980px) {
  /*
   * 2a. Divi dynamic CSS is sometimes generated WITHOUT the Menu module styles (seen on
   * category/tag/author pages: whole menu printed twice as bullet lists inside a fixed,
   * ~900px-tall sticky header). These are the stock Divi menu-module mobile rules, so when
   * Divi does output them nothing changes.
   */
  .et_pb_menu .et_pb_menu__wrap { flex: 1 1 auto; display: flex; justify-content: flex-start; align-items: stretch; flex-wrap: wrap; opacity: 1; }
  .et_pb_menu .et_pb_menu__menu { display: none; }
  .et_pb_menu .et_mobile_nav_menu { float: none; margin: 0 6px; display: flex; align-items: center; }
  .et_pb_menu .et_pb_menu__search-container--disabled { display: none; }
  .et_pb_menu .et_pb_menu__search-container { position: absolute; display: flex; justify-content: stretch; align-content: stretch; left: 0; bottom: 0; width: 100%; height: 100%; opacity: 0; z-index: 999; }
  .et_pb_menu .et_pb_menu__search-container--visible { opacity: 1; }
  .et_pb_menu_inner_container { position: relative; }
  .mobile_menu_bar { position: relative; display: block; line-height: 0; }
  .mobile_menu_bar:before { content: "a"; font-size: 32px; position: relative; left: 0; top: 0; cursor: pointer; }
  .et_pb_module .mobile_menu_bar:before { top: 2px; }
  .mobile_nav .select_page { display: none; }
  .et_pb_menu .et_mobile_menu { top: 100%; padding: 5%; }
  .et_pb_menu .et_mobile_menu, .et_pb_menu .et_mobile_menu ul { list-style: none !important; }
  .et_pb_menu .et_mobile_menu ul { padding: 0; }
  .et_pb_menu .mobile_nav.closed .et_mobile_menu { display: none; }
  button.et_pb_menu__icon { display: flex; align-items: center; padding: 0; margin: 0 11px; font-size: 17px; line-height: normal; background: none; border: 0; cursor: pointer; flex-direction: row-reverse; }
  button.et_pb_menu__icon:after { font-family: ETmodules; }
  .et_pb_menu__search-button:after { content: "U"; }

  /* 2b. touch targets for the header icons */
  .et_pb_menu .et_pb_menu__icon, .et_pb_menu .mobile_menu_bar { min-width: 40px; min-height: 40px; justify-content: center; }
  .et_pb_menu .mobile_menu_bar { display: flex; align-items: center; }

  /* 2c. article-list teaser text was 11px on phones */
  .et_pb_posts .post-content, .et_pb_posts .post-content p, .et_pb_posts .post-content-inner, .et_pb_posts .post-content-inner p { font-size: 14px !important; line-height: 1.9 !important; }

  /* 2d. newsletter form: keep inputs/labels aligned with the RTL layout */
  footer.et-l--footer input[type="text"], footer.et-l--footer input[type="email"] { text-align: right; max-width: 100%; }
}

/* =====================================================================
 * Round 2 (2026-10-03): off-canvas menu, home = chips + feed, source logo, Lottie dividers
 * Everything below is inside max-width media queries except the inert defaults.
 * ===================================================================== */
.shm-drawer, .shm-drawer-overlay, .shm-chips, .shm-lottie { display: none; }

/* ---------- off-canvas menu (<= 980px) ---------- */
@media (max-width: 980px) {
  /* Divi's own mobile dropdown is replaced by the drawer */
  .et_pb_menu .et_mobile_menu, #et_mobile_nav_menu .et_mobile_menu, .mobile_nav .et_mobile_menu { display: none !important; }
  .et_slide_in_menu_container { display: none !important; }
  .mobile_menu_bar { cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .mobile_menu_bar:focus-visible { outline: 2px solid #d9541e; outline-offset: 2px; }

  html.shm-menu-lock, html.shm-menu-lock body { overflow: hidden !important; }
  html.shm-menu-lock body { touch-action: none; }

  .shm-drawer-overlay {
    display: block;
    position: fixed; top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(0, 0, 0, .55);
    opacity: 0; visibility: hidden;
    transition: opacity .25s ease, visibility 0s linear .25s;
    z-index: 2147483000;
    -webkit-tap-highlight-color: transparent;
  }
  .shm-drawer {
    display: flex; flex-direction: column;
    position: fixed; top: 0; right: 0; bottom: 0; left: auto;
    width: 86vw; max-width: 340px;
    background: #fff; color: #222;
    direction: rtl; text-align: right;
    font-family: inherit;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .28s ease, visibility 0s linear .28s;
    z-index: 2147483001;
    box-shadow: -6px 0 24px rgba(0, 0, 0, .25);
    overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
    box-sizing: border-box;
  }
  .shm-drawer *, .shm-drawer *::before, .shm-drawer *::after { box-sizing: border-box; }
  html.shm-menu-open .shm-drawer-overlay { opacity: 1; visibility: visible; transition-delay: 0s; }
  html.shm-menu-open .shm-drawer { transform: none; visibility: visible; transition-delay: 0s; }

  .shm-drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 10px 18px; border-bottom: 1px solid #eee; flex: 0 0 auto; }
  .shm-drawer__title { font-size: 17px; font-weight: 700; }
  .shm-drawer__close { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; padding: 0; background: none; border: 0; color: #222; cursor: pointer; border-radius: 50%; }
  .shm-drawer__close:focus-visible, .shm-drawer__toggle:focus-visible, .shm-drawer__link:focus-visible { outline: 2px solid #d9541e; outline-offset: -2px; }
  .shm-drawer__nav { flex: 1 1 auto; padding: 6px 0; }
  .shm-drawer__list { list-style: none !important; margin: 0; padding: 0; }
  .shm-drawer__item { margin: 0; padding: 0; list-style: none !important; border-bottom: 1px solid #f1f1f1; }
  .shm-drawer__item::before, .shm-drawer__item::after { display: none !important; content: none !important; }
  .shm-drawer__row { display: flex; align-items: stretch; }
  .shm-drawer__link { flex: 1 1 auto; display: block; padding: 14px 20px; min-height: 48px; font-size: 16px; line-height: 1.6; color: #222 !important; text-decoration: none; font-weight: 600; }
  .shm-drawer__link[aria-current="page"] { color: #d9541e !important; }
  .shm-drawer__toggle { flex: 0 0 52px; position: relative; background: none; border: 0; border-right: 1px solid #f1f1f1; cursor: pointer; padding: 0; color: #555; }
  .shm-drawer__toggle::before { content: ""; position: absolute; top: 50%; left: 50%; width: 9px; height: 9px; margin: -7px 0 0 -5px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s; }
  .shm-drawer__toggle[aria-expanded="true"]::before { transform: rotate(-135deg); margin-top: -3px; }
  .shm-drawer__list--1 { background: #fafafa; }
  .shm-drawer__list--1 .shm-drawer__item { border-bottom-color: #eee; }
  .shm-drawer__list--1 .shm-drawer__link { padding-right: 34px; font-weight: 400; font-size: 15px; }
  .shm-drawer__list[hidden] { display: none; }
  .shm-drawer__search { display: flex; gap: 8px; padding: 14px 18px 22px; border-top: 1px solid #eee; flex: 0 0 auto; }
  .shm-drawer__search input[type="search"] { flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid #ccc; border-radius: 8px; font-family: inherit; font-size: 16px; direction: rtl; text-align: right; background: #fff; color: #222; }
  .shm-drawer__search button { flex: 0 0 auto; height: 44px; padding: 0 16px; border: 0; border-radius: 8px; background: #d9541e; color: #fff; font-family: inherit; font-size: 15px; cursor: pointer; }
}
@media (max-width: 980px) and (prefers-reduced-motion: reduce) {
  .shm-drawer, .shm-drawer-overlay, .shm-drawer__toggle::before { transition: none !important; }
}

/* ---------- phones (<= 767px): home = chips + feed, source logo, Lottie dividers ---------- */
@media (max-width: 767px) {
  /* mobile home: no About / Latest / category sections; the feed replaces them */
  body.home .et-l--post .et_pb_section { display: none !important; }

  .shm-chips { display: block; margin: 0 -14px 14px; padding: 0 14px; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; direction: rtl; }
  .shm-chips::-webkit-scrollbar { display: none; }
  .shm-chips__row { display: flex; flex-wrap: nowrap; gap: 8px; width: max-content; min-width: 100%; padding: 4px 0 8px; }
  .shm-chip { flex: 0 0 auto; display: flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 22px; background: #fff; color: #222 !important; font-size: 14px; font-weight: 600; white-space: nowrap; text-decoration: none; box-shadow: 0 1px 6px rgba(0, 0, 0, .12); }
  .shm-chip:active { background: #fdeee6; }
  .shm-feed--home { padding-top: 12px; }

  .shm-card__body { padding: 14px 16px 8px; }
  .shm-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px 14px; }
  .shm-card__foot .shm-card__more { padding: 6px 0; }
  .shm-card__source { display: flex; align-items: center; flex: 0 1 auto; min-width: 0; line-height: 0; text-decoration: none; }
  .shm-card__source img { display: block; width: auto; height: auto; max-height: 26px; max-width: 120px; margin: 0; }
  .shm-card__source-name { font-size: 12px; line-height: 1.6; color: #666; }

  .shm-lottie { display: block; position: relative; height: 140px; margin: 0 0 22px; overflow: hidden; opacity: 0; transition: opacity .4s ease; contain: layout paint; pointer-events: none; }
  .shm-lottie.is-ready { opacity: 1; }
  .shm-lottie svg { display: block; margin: 0 auto; max-width: 100%; }
  .shm-lottie.is-static { height: 2px; margin: 4px 24% 26px; opacity: 1; background: linear-gradient(90deg, transparent, #d9541e, transparent); }
}
@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .shm-lottie { transition: none; }
}
