/**
 * Kulwatha Center — v1.2.4 mobile fixes.
 * Fixes the "مختارات المركز / للقراءة أيضًا" news picks panel on phones.
 */

@media (max-width: 680px) {
  /*
   * Older responsive rules changed the sidebar itself to a two-column grid.
   * On a phone that leaves each news item only half the viewport width and
   * forces Arabic headlines into one-word lines. Return the panel to a proper
   * single-column editorial list.
   */
  .kwn-sidebar {
    display: block !important;
    grid-template-columns: none !important;
    padding: 0 !important;
    overflow: hidden !important;
    width: 100%;
    min-width: 0;
    border-radius: 15px !important;
  }

  .kwn-sidebar-title {
    display: block !important;
    grid-column: auto !important;
    padding: 17px 18px 15px !important;
    border-bottom: 3px solid var(--kwd-gold, #e7bd24) !important;
    text-align: right;
  }

  .kwn-sidebar-title span {
    display: block;
    margin: 0 0 3px;
    font-size: 14px !important;
    line-height: 1.55;
    color: var(--kwd-muted, #7b7f81);
  }

  .kwn-sidebar-title strong {
    display: block;
    margin: 0;
    font-size: 20px !important;
    line-height: 1.45;
    color: var(--kwd-ink, #202427);
  }

  .kwn-popular-item {
    display: grid !important;
    grid-template-columns: 42px minmax(0, 1fr) !important;
    gap: 12px !important;
    align-items: start !important;
    width: 100%;
    min-width: 0;
    padding: 15px 17px !important;
    border-bottom: 1px solid var(--kwd-line, #e8e2d7) !important;
  }

  .kwn-popular-item:last-child {
    border-bottom: 0 !important;
  }

  .kwn-popular-number {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin-top: 1px;
    border-radius: 10px;
    background: rgba(231, 189, 36, 0.11);
    border: 1px solid rgba(180, 134, 0, 0.18);
    color: var(--kwd-gold-dark, #b48600) !important;
    font-size: 14px !important;
    line-height: 1;
    font-weight: 900;
    direction: ltr;
  }

  .kwn-popular-item > div:last-child {
    min-width: 0;
  }

  .kwn-popular-item h4 {
    margin: 0 0 5px !important;
    font-size: 16px !important;
    line-height: 1.65 !important;
    font-weight: 800;
    overflow-wrap: anywhere;
  }

  .kwn-popular-item h4 a {
    display: -webkit-box;
    overflow: hidden;
    color: var(--kwd-ink, #202427) !important;
    text-decoration: none;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .kwn-popular-item span {
    display: block;
    font-size: 14px !important;
    line-height: 1.5;
    color: var(--kwd-muted, #7b7f81) !important;
    direction: ltr;
    unicode-bidi: isolate;
    text-align: right;
  }
}

/* Tablet: keep the picks compact without inheriting the cramped desktop-to-tablet grid. */
@media (min-width: 681px) and (max-width: 980px) {
  .kwn-sidebar {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0 !important;
    padding: 0 !important;
    overflow: hidden;
  }

  .kwn-sidebar-title {
    grid-column: 1 / -1 !important;
  }

  .kwn-popular-item {
    grid-template-columns: 42px minmax(0, 1fr) !important;
    min-width: 0;
    padding: 16px 18px !important;
  }

  .kwn-popular-item:nth-of-type(even) {
    border-inline-start: 1px solid var(--kwd-line, #e8e2d7);
  }

  .kwn-popular-item h4 {
    font-size: 15px !important;
    line-height: 1.6 !important;
  }
}
