/* Shared phone design for the INNER Urdu pages (articles, article detail, categories, subcategories, books, search, questions, graphics, policy pages).
   These are the header / side-menu / footer rules of the redesigned home page (css/mobile-ur.css), copied verbatim, minus everything that is only
   about home sections (ticker, goal, WhatsApp banner, article cards, banner) and minus the home's transparent-over-banner header: inner pages
   have no banner, so the header is solid white from the start.
   Everything is inside @media (max-width: 768px) except the one drawer-scroll rule, so desktop keeps its current look.
   Loaded through includes/mobile_inner_ur.php. CSS is cached for a year: BUMP $dii_mi_ver in that include after every edit here. */


/* ---- Header bar and drawer: white, per mockup-mobile-ur.html ---- */
@media (max-width: 768px) {
  body .header {
    background: #fff;
    box-shadow: 0 1px 0 #e3e8e4, 0 4px 14px rgba(0, 0, 0, 0.1);
  }

  body .header .logo,
  body .header a.logo {
    color: #155b2c;
  }

  body .header .menu-toggle {
    background: #e3f1e7;
    border: 1px solid #cfe3d5;
    color: #155b2c;
    backdrop-filter: none;
  }

  body .header .menu-toggle:hover,
  body .header .menu-toggle.active {
    background: #d3e8d9;
    box-shadow: none;
  }

  body .drawer-menu {
    background: #fff;
    backdrop-filter: none;
    box-shadow: -6px 0 24px rgba(0, 0, 0, 0.3);
    scrollbar-color: rgba(21, 91, 44, 0.35) transparent;
  }

  body .drawer-menu::-webkit-scrollbar-thumb {
    background: rgba(21, 91, 44, 0.35);
  }

  body .drawer-menu .drawer-header {
    background: #155b2c;
    border-bottom: 0;
    backdrop-filter: none;
  }

  body .drawer-menu .menu-item {
    border-bottom: 1px solid #eef1ee;
  }

  body .drawer-menu .menu-link {
    padding: 14px 20px;
    font-size: 20px;
  }

  body .drawer-menu .menu-link,
  body .drawer-menu .menu-link span {
    color: #1b1b1b !important;
  }

  body .drawer-menu .menu-link:hover {
    background: #eef6f0;
    padding-right: 20px;
  }

  body .drawer-menu .menu-link:hover span {
    color: #155b2c !important;
  }

  body .drawer-menu .menu-icon,
  body .drawer-menu .submenu-arrow {
    color: #155b2c;
  }

  body .drawer-menu .submenu {
    background: #f5f8f5;
    border-top: 1px solid #e3e8e4;
  }

  body .drawer-menu .submenu-item {
    color: #2d3b32;
    font-size: 18px;
    padding: 12px 20px 12px 40px;
    border-bottom: 1px solid #e9eee9;
  }

  body .drawer-menu .submenu-item::before {
    color: #155b2c;
  }

  body .drawer-menu .submenu-item:hover {
    background: #e3f1e7;
    color: #155b2c;
    padding-right: 25px;
  }

  /* current page: tint and bold, no side bar */
  body .drawer-menu .submenu-item.active-link {
    background: #e3f1e7;
    color: #155b2c;
    border-right: 0;
  }

  body .drawer-menu .menu-link.active-link,
  body .drawer-menu .menu-link.current-section {
    background: #eef6f0;
  }

  body .drawer-menu .menu-link.active-link > span,
  body .drawer-menu .menu-link.current-section > span {
    color: #155b2c !important;
    font-weight: 700;
  }
}

/* ---- Footer: drop links the drawer already has, compact the rest ---- */
@media (max-width: 768px) {
  /* column 3 = the 8 category links, all in the drawer */
  body #footer .footerrow > .footercol-md-3:nth-child(3) {
    display: none !important;
  }

  /* column 2: first three links (poetry, fatawa, Q&A) are also in the drawer */
  body #footer .footerrow > .footercol-md-3:nth-child(2) li:nth-child(-n+3) {
    display: none;
  }

  /* what is left (about, privacy, terms, ask a question) as a 2-column grid */
  body #footer .footerrow > .footercol-md-3:nth-child(2) ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 12px;
    margin: 0;
    padding: 0;
  }

  body #footer .footerrow > .footercol-md-3:nth-child(2) h5 {
    margin: 0;
    padding: 6px 0;
    font-size: 18px;
  }

  body #footer .footer-section-1 {
    padding: 20px 0 8px;
  }

  body #footer .footer-box {
    margin-bottom: 12px;
  }

  body #footer .footer-section-2 {
    padding: 16px 0;
  }

  body #footer .footer-section-2 .footer-box p {
    margin: 0 0 12px;
    font-size: 16px;
    line-height: 1.9;
  }
}

/* ---- Drawer icons (one per entry, by position, same order as DrawerMenu.php) ---- */
@media (max-width: 768px) {
  body .drawer-menu .drawer-content > .menu-item > .menu-link > span::before {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free";
    font-weight: 900;
    display: inline-block;
    width: 22px;
    margin-left: 14px;
    text-align: center;
    font-size: 16px;
    color: #155b2c;
  }

  body .drawer-menu .drawer-content > .menu-item:nth-child(1) > .menu-link > span::before {
    content: "\f015"; /* home */
  }

  body .drawer-menu .drawer-content > .menu-item:nth-child(2) > .menu-link > span::before {
    content: "\f678"; /* mosque */
  }

  body .drawer-menu .drawer-content > .menu-item:nth-child(3) > .menu-link > span::before {
    content: "\f02d"; /* book */
  }

  body .drawer-menu .drawer-content > .menu-item:nth-child(4) > .menu-link > span::before {
    content: "\f3ed"; /* shield */
  }

  body .drawer-menu .drawer-content > .menu-item:nth-child(5) > .menu-link > span::before {
    content: "\f071"; /* warning */
  }

  body .drawer-menu .drawer-content > .menu-item:nth-child(6) > .menu-link > span::before {
    content: "\f086"; /* comments */
  }

  body .drawer-menu .drawer-content > .menu-item:nth-child(7) > .menu-link > span::before {
    content: "\f03d"; /* video */
  }

  body .drawer-menu .drawer-content > .menu-item:nth-child(8) > .menu-link > span::before {
    content: "\f001"; /* music */
  }

  body .drawer-menu .drawer-content > .menu-item:nth-child(9) > .menu-link > span::before {
    content: "\f03e"; /* image */
  }

  body .drawer-menu .drawer-content > .menu-item:nth-child(10) > .menu-link > span::before {
    content: "\f52d"; /* feather */
  }

  body .drawer-menu .drawer-content > .menu-item:nth-child(11) > .menu-link > span::before {
    content: "\f0e3"; /* gavel */
  }

  body .drawer-menu .drawer-content > .menu-item:nth-child(12) > .menu-link > span::before {
    content: "\f059"; /* question */
  }
}

/* ---- Footer language dropdown ---- */
@media (max-width: 768px) {
  body #footer .footer-box h3 {
    font-size: 22px;
    margin: 0 0 10px;
  }

  body #footer select.selector {
    -webkit-appearance: none;
    appearance: none;
    float: none !important;
    display: block;
    width: 100% !important;
    max-width: none !important;
    padding: 12px 16px 12px 44px !important;
    font-family: 'JameelNoori', 'Segoe UI', serif;
    font-size: 20px !important;
    line-height: 1.6;
    font-weight: 700;
    color: #155b2c !important;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1.5l6 6 6-6' fill='none' stroke='%23155b2c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 16px center;
    border: 1.5px solid #b9d3c1 !important;
    border-radius: 10px !important;
    direction: rtl;
    cursor: pointer;
  }

  body #footer select.selector:focus {
    outline: 3px solid rgba(144, 238, 144, 0.55);
    outline-offset: 2px;
  }
}

/* Language dropdown: fixed height so tall Nastaliq/Latin glyphs are not clipped */
@media (max-width: 768px) {
  body #footer select.selector {
    height: 56px;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: normal;
    font-size: 19px !important;
  }

  body #footer select.selector option {
    line-height: normal;
    padding: 8px 12px;
  }
}

/* ---- Drawer sub-items: even rows, full-width highlight, no heavy focus box ---- */
@media (max-width: 768px) {
  body .drawer-menu .submenu-item {
    right: 0;
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 6px 44px 6px 20px;
    line-height: 1.6;
  }

  body .drawer-menu .submenu-item::before {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    line-height: 1;
  }

  body .drawer-menu .submenu-item:hover {
    padding-right: 44px;
  }

  body .drawer-menu .submenu-item:hover::before {
    right: 20px;
    transform: translateY(-50%) scale(1.2);
  }

  /* tap no longer leaves a black box; keyboard focus still gets a ring */
  body .drawer-menu .menu-link:focus {
    outline: none;
  }

  body .drawer-menu .menu-link:focus-visible,
  body .drawer-menu .submenu-item:focus-visible {
    outline: 3px solid rgba(21, 91, 44, 0.4);
    outline-offset: -3px;
  }
}

/* ---- Drawer, all widths: one scroll for the whole drawer (no scrollbar inside an open section) ---- */
body .drawer-menu .submenu.active {
  max-height: 4000px;
  overflow: visible;
}
