/* Mobile layout for indexur.php, following mockup-mobile-ur.html.
   Everything is inside the media query, so desktop is unchanged.
   Selectors start with `body` to beat the page's inline <style>. */

@media (max-width: 768px) {

  /* ---- news ticker ---- */
  body .news-ticker__label {
    padding: 8px 14px;
    font-size: 16px;
  }

  body .news-ticker__item {
    padding: 8px 28px;
    font-size: 17px;
  }

  /* ---- "our goal" + search ---- */
  body .history-section {
    padding: 22px 0 18px;
  }

  body .history-section .text-box {
    padding: 0 20px;
  }

  body .history-section .heading-left h2 {
    font-size: 28px;
    margin-bottom: 12px;
  }

  body .history-section .text-box h4 {
    font-size: 18px;
    line-height: 1.9;
  }

  /* ---- WhatsApp channel banner ---- */
  body .wa-hero-section {
    padding: 20px 0 8px;
  }

  body .wa-hero-banner {
    border-radius: 16px;
    margin: 0 4px;
  }

  body .wa-banner-body {
    padding: 18px 16px;
    gap: 14px;
  }

  body .wa-banner-title {
    font-size: 20px;
    line-height: 1.7;
  }

  body .wa-banner-sub {
    font-size: 16px;
    line-height: 1.9;
  }

  body .wa-banner-tag {
    padding: 4px 14px;
  }

  body .wa-banner-btn {
    padding: 12px 16px;
  }

  /* ---- section headings ---- */
  body .heading-center h2 {
    font-size: 30px;
  }

  /* ---- "new articles" list as cards ---- */
  body .our-vision .row > .col-md-1,
  body .our-vision .row > .col-sm-1 {
    display: none;
  }

  body .our-vision .row > .col-md-10,
  body .our-vision .row > .col-sm-10 {
    width: 100%;
    padding: 0 16px;
  }

  body .cp-comments .children {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  body .cp-comments .children > li {
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
  }

  body .cp-comments .children .text {
    background: #fff;
    border: 1px solid #e3e8e4 !important;
    border-radius: 10px;
    padding: 12px 16px !important;
  }

  body .cp-comments .children .text p {
    margin: 0;
    font-size: 18px;
    line-height: 1.8;
  }

  /* ---- book card and video card text ---- */
  body .card.post-box .text-box {
    padding: 8px 4px 4px;
  }

  body .card.post-box .btn-row {
    padding-bottom: 10px;
  }

  /* ---- WhatsApp strip above the footer ---- */
  body .wa-footer-strip {
    flex-direction: column;
    padding: 22px 20px;
    gap: 12px;
    text-align: center;
  }

  body .wa-footer-btn {
    padding: 10px 32px;
  }
}

/* Video card download button: light outline, same as book downloads */
@media (max-width: 768px) {
  body .our-vision .card.post-box .btn-row .read-post {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 16px;
    border-radius: 8px;
    box-shadow: none;
    background: #fff !important;
    color: #155b2c !important;
    border: 1.5px solid #b9d3c1;
  }

  body .our-vision .card.post-box .btn-row .read-post i {
    color: #155b2c !important;
  }

  body .our-vision .card.post-box .btn-row {
    padding: 0 10px 12px;
    margin-top: 12px !important;
  }
}

/* Video download button: a bit stronger so it is easy to spot */
@media (max-width: 768px) {
  body .our-vision .card.post-box .btn-row .read-post {
    background: #e3f1e7 !important;
    border: 1.5px solid #3ea659;
    font-weight: 700;
  }
}

/* "More ..." links under each section: same light green style as the buttons */
@media (max-width: 768px) {
  body .mazeed h3 a {
    background: #e3f1e7;
    border: 1.5px solid #3ea659 !important;
    border-radius: 8px !important;
    color: #155b2c !important;
    font-weight: 700;
    padding: 10px 24px;
  }

  body .mazeed h3 a i {
    color: #155b2c;
    margin-right: 6px;
  }
}

/* ---- 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;
  }
}

/* Tighter gap between a "More ..." button and the next section heading */
@media (max-width: 768px) {
  body .blog-section {
    padding: 10px 0 6px;
  }

  body .mazeed h3 {
    margin-bottom: 4px;
  }

  body .our-vision {
    padding: 6px 0 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;
  }
}

/* "Our goal" paragraph: larger text on mobile */
@media (max-width: 768px) {
  body .history-section .text-box h4 {
    font-size: 22px;
    line-height: 2;
  }
}

/* ---- Header: transparent over the banner, white once scrolled ---- */
@media (max-width: 768px) {
  body .header {
    background: transparent;
    box-shadow: none;
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
  }

  body .header .logo,
  body .header a.logo {
    color: #fff;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
    transition: color 0.25s ease;
  }

  body .header .menu-toggle {
    background: rgba(255, 255, 255, 0.18);
    border: 0;
    border-radius: 14px;
    color: #fff;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }

  body .header .menu-toggle:hover,
  body .header .menu-toggle.active {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: none;
  }

  /* scrolled: solid white bar so the controls stay readable over page content */
  body .header.is-scrolled {
    background: #fff;
    box-shadow: 0 1px 0 #e3e8e4, 0 4px 14px rgba(0, 0, 0, 0.1);
  }

  body .header.is-scrolled .logo,
  body .header.is-scrolled a.logo {
    color: #155b2c;
    text-shadow: none;
  }

  body .header.is-scrolled .menu-toggle {
    background: #e3f1e7;
    border: 1px solid #cfe3d5;
    color: #155b2c;
    backdrop-filter: none;
  }

  body .header.is-scrolled .menu-toggle:hover,
  body .header.is-scrolled .menu-toggle.active {
    background: #d3e8d9;
  }
}

/* "Our goal": cancel the inline negative top margin, give the heading room */
@media (max-width: 768px) {
  body .history-section {
    margin-top: 0 !important;
    padding-top: 32px;
  }
}

/* "Our goal": less room above the heading than first tried */
@media (max-width: 768px) {
  body .history-section {
    padding-top: 12px;
  }
}

/* "Our goal": 8px above the heading (set by the site owner) */
@media (max-width: 768px) {
  body .history-section {
    padding-top: 8px;
  }
}

/* ---- Desktop only: article list matches the 1140px width of the other sections ---- */
@media (min-width: 768.01px) {
  body .our-vision .row > .col-md-1,
  body .our-vision .row > .col-sm-1 {
    display: none;
  }

  body .our-vision .row > .col-md-10,
  body .our-vision .row > .col-sm-10 {
    float: none;
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 15px;
  }
}

/* ---- Desktop/tablet banner: not full-screen, ayat artwork keeps its proportions and clears the fixed header ----
   Overrides style.css (min-width:1290px) { #banner, #main-banner, #ayatimg { height: 100vh !important } },
   which stretched the 977x575 ayat image and pushed all content below the fold. */
@media (min-width: 768.01px) {
  body #banner {
    height: clamp(480px, 64vh, 720px) !important;
  }

  body #banner .item,
  body #banner picture {
    display: block;
    height: 100%;
  }

  body #main-banner {
    width: 100%;
    height: 100% !important;
    object-fit: cover;
  }

  /* 64px = fixed header (54px) plus a little air */
  body #banner .caption {
    height: 100% !important;
    padding-top: 64px;
  }

  body #banner .caption .container {
    height: 100% !important;
    width: 100%;
    max-width: none;
  }

  body #ayatimg {
    width: auto !important;
    height: auto !important;
    max-width: min(86%, 960px);
    max-height: calc(100% - 28px);
    margin: 0 !important;
    object-fit: contain;
  }
}

/* Banner caption: some widths (responsive.css) offset it by top:100px, which pushed the ayat below the banner */
@media (min-width: 768.01px) {
  body #banner .caption {
    top: 0 !important;
  }
}

/* Narrower desktops/tablets: the fixed header can grow to ~84px (seen at 1100px and below), so clear it by more */
@media (min-width: 768.01px) and (max-width: 1279.98px) {
  body #banner .caption {
    padding-top: 100px;
  }
}

/* ---- Very wide screens (zoomed out): hold the banner to the same left/right edges as the sections below ----
   1140px = content width of the .container sections (goal text, WhatsApp banner, article list).
   The banner then sits below the fixed header instead of under it, so the header clearance is not needed. */
@media (min-width: 2200px) {
  body #banner {
    max-width: 1140px;
    margin: 70px auto 0;
    border-radius: 14px;
  }

  body #banner .caption {
    padding-top: 0;
  }

  body #banner .overlay-banner {
    border-radius: 14px;
  }
}

/* ---- Desktop: prominent menu button (white pill with icon and the word "مینو") ----
   The button has an inline font-size, so the icon and label are sized separately. */
@media (min-width: 768.01px) {
  body .header .menu-toggle {
    height: 44px;
    padding: 4px 18px;
    gap: 10px;
    background: #fff;
    color: #155b2c;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
    backdrop-filter: none;
  }

  body .header .menu-toggle i {
    font-size: 22px;
  }

  body .header .menu-toggle::after {
    content: "مینو";
    font-family: 'JameelNoori', serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
  }

  body .header .menu-toggle:hover {
    background: #e3f1e7;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  }

  body .header .menu-toggle.active {
    background: #d3e8d9;
    transform: none;
  }

  body .header .menu-toggle:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.85);
    outline-offset: 2px;
  }
}

/* ---- 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;
}

/* ---- Drawer, desktop/tablet: dark green theme refined (the phone version above is white) ---- */
@media (min-width: 768.01px) {
  body .drawer-menu .drawer-content {
    padding: 8px 0 80px;
  }

  body .drawer-menu .menu-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  body .drawer-menu .menu-link {
    padding: 15px 24px;
    font-size: 23px;
    line-height: 1.7;
  }

  /* hover: tint only, no sideways shift */
  body .drawer-menu .menu-link:hover {
    background: rgba(255, 255, 255, 0.08);
    padding-right: 24px;
  }

  body .drawer-menu .menu-link:hover span {
    color: #b8f5c8;
  }

  /* an open section is tinted so it reads as the parent of the items under it */
  body .drawer-menu .menu-item:has(> .submenu.active) > .menu-link {
    background: rgba(255, 255, 255, 0.07);
  }

  /* one icon per entry (replaces the lone home icon), matched by position like the phone version */
  body .drawer-menu .menu-icon {
    display: none;
  }

  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: 26px;
    margin-left: 14px;
    text-align: center;
    font-size: 18px;
    color: #90ee90;
  }

  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 */
  }

  /* sub-items */
  body .drawer-menu .submenu {
    background: rgba(0, 0, 0, 0.22);
  }

  body .drawer-menu .submenu-item {
    right: 0;
    padding: 11px 56px 11px 24px;
    font-size: 18px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.9);
  }

  body .drawer-menu .submenu-item::before {
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    line-height: 1;
  }

  body .drawer-menu .submenu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    padding-right: 56px;
    color: #fff;
  }

  body .drawer-menu .submenu-item:hover::before {
    right: 30px;
    transform: translateY(-50%) scale(1.2);
  }

  /* current page: tint and bold, no edge bar */
  body .drawer-menu .submenu-item.active-link {
    background: rgba(46, 204, 113, 0.2);
    color: #8ff0b0;
    font-weight: 700;
    border-right: 0;
  }

  body .drawer-menu .menu-link.active-link > span,
  body .drawer-menu .menu-link.current-section > span {
    color: #8ff0b0 !important;
    font-weight: 700;
  }

  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(144, 238, 144, 0.55);
    outline-offset: -3px;
  }
}
