/* ====== 1024px ====== */
@media (max-width: 1024px) {
  .side {
    max-width: 200px;
    font-size: 14px;
  }

  .topbar #time,
  .topbar #calendar-link {
    display: none !important;
  }

  .topbar .lang {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .topbar .left img {
    width: 80px;
    height: auto;
    margin: 0;
  }

  .main-nav {
    font-size: 0.9rem;
  }

  .main-nav ul {
    gap: 1px;
  }

  nav ul li .mega-dropdown {
    width: auto;
    gap: 10px;
  }

  nav ul li .mega-column {
    min-width: 150px;
  }

  .hero .title {
    font-size: 30px;
    text-align: right !important;
  }

  .hero .title.title-primary {
    font-size: 36px;
  }

  .hero .subtitle {
    font-size: 16px;
    text-align: right !important;
  }

  .program-card,
  .admission-card {
    padding: 5px;
  }

  .program-table th {
    width: 150px;
  }

  .research-table,
  .research-table thead,
  .research-table tbody,
  .research-table th,
  .research-table td,
  .research-table tr,
  .thesis-table,
  .thesis-table thead,
  .thesis-table tbody,
  .thesis-table th,
  .thesis-table td,
  .thesis-table tr {
    display: block;
    width: 100%;
  }

  .research-table,
  .thesis-table {
    background: white;
  }

  .research-table th,
  .research-table td,
  .thesis-table th,
  .thesis-table td {
    background: #F7FAFC;
  }

  .research-table tr {
    font-size: 14px;
    margin-bottom: 10px;
    padding-right: 8px;
    padding-left: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eee;
    transition: border-color 0.3s ease;
  }

  .thesis-table tr {
    font-size: 14px;
    margin-bottom: 10px;
    margin-right: 8px;
    padding-left: 12px;
    border-right: 3px solid transparent;
    transition: border-color 0.3s ease;
  }

  .research-table th,
  .research-table thead,
  .thesis-table th {
    display: none;
  }

  .research-table td,
  .thesis-table td {
    text-align: right;
    padding: 6px 10px;
  }

  .research-table td::before,
  .thesis-table td::before {
    content: attr(data-label);
    float: right;
    font-weight: bold;
    margin-left: 10px;
  }

  .research-table tr:first-child {
    padding-top: 8px;
  }

  .research-table tr:last-child {
    margin-bottom: 0px;
  }

  .library-summary .summary-inner {
    flex-direction: column;
    text-align: center;
  }

  .summary-stats {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.8rem;
  }

  .summary-text {
    max-width: 100%;
  }

  .announcements-section .ann-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .brand {
    display: none !important;
  }

  .hero {
    min-height: auto !important;
    border-bottom: 3px solid var(--brand-gray) !important;
    padding: 0 !important;
  }

  .hero .container {
    justify-content: center !important;
  }

  .hero-card {
    margin: 0 auto !important;
    padding: 30px 20px !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
    border: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    text-align: center !important;
  }

  .hero .title {
    font-size: 30px;
    text-align: center !important;
  }

  .hero .title.title-primary {
    font-size: 36px;
  }

  .hero .subtitle {
    font-size: 16px;
    text-align: center !important;
  }

  .hero-card .badge {
    display: inline-flex !important;
    margin: 0 auto 12px auto !important;
  }

  .hero-features {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    margin: 20px 0 15px 0 !important;
    padding-top: 15px !important;
  }

  .feat-item {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
  }

  .feat-num {
    font-size: 20px !important;
    min-width: 45px !important;
  }

  .hero-actions {
    flex-direction: column !important;
    gap: 10px !important;
    margin-top: 20px !important;
  }

  .btn-hero-primary,
  .btn-hero-secondary {
    width: 100% !important;
    justify-content: center !important;
  }

  .btn-hero-secondary {
    background-color: #ffffff !important;
    color: #191713 !important;
    border: 1px solid #191713 !important;
  }

  .btn-hero-secondary i {
    color: #191713 !important;
  }

  .btn-hero-secondary:hover,
  .btn-hero-secondary:active {
    background-color: #191713 !important;
    color: #ffffff !important;
    border-color: #191713 !important;
  }

  .btn-hero-secondary:hover i,
  .btn-hero-secondary:active i {
    color: #ffffff !important;
  }

  .mobile-only {
    display: inline-flex !important;
  }

  .badge {
    display: none;
  }

  .side {
    max-width: 100%;
    position: static;
    margin-bottom: 20px;
  }

  .section {
    margin: 0
  }

  #vision {
    grid-template-columns: repeat(1, 1fr)
  }

  .topbar {
    display: block !important;
    font-size: 12px;
  }

  .topbar .inner {
    padding: 6px 12px;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
  }

  .main-nav a {
    font-size: 16px;
  }

  .nav-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--brand-blue);
    margin: 0;
  }

  .nav-header {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0;
    z-index: 1004;
  }

  .nav-toggle,
  .icon-btn.burger {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: transparent !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 50% !important;
    cursor: pointer;
    color: #000000 !important;
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
    outline: none;
    box-sizing: border-box;
  }

  .nav-toggle svg,
  .icon-btn.burger svg {
    width: 20px;
    height: 20px;
    display: block;
    stroke-width: 2;
  }

  .nav-toggle:hover,
  .nav-toggle.active,
  .icon-btn.burger:hover {
    background: transparent !important;
    color: #000000 !important;
    border-color: #000000 !important;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 360px;
    height: 100vh;
    height: 100dvh;
    background: #ffffff;
    box-shadow: -4px 0 25px rgba(0, 0, 0, 0.15);
    transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1002;
  }

  .main-nav.open {
    right: 0;
  }

  /* Drawer Header */
  .main-nav .drawer-head {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    direction: rtl !important;
    padding: 12px 18px !important;
    border-bottom: 1px solid var(--color-border);
    background: #ffffff;
    flex-shrink: 0;
    width: 100% !important;
    height: 64px !important;
    box-sizing: border-box !important;
  }

  .main-nav .drawer-close {
    position: absolute !important;
    left: 18px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    background: transparent !important;
    border: 1.5px solid var(--color-border-strong) !important;
    outline: none;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: 50% !important;
    color: var(--color-ink);
    transition: all 0.2s ease;
    z-index: 5;
    box-sizing: border-box;
  }

  .main-nav .drawer-close svg {
    width: 18px;
    height: 18px;
    display: block;
  }

  .main-nav .drawer-close:hover {
    background: transparent !important;
    color: #000000 !important;
    border-color: #000000 !important;
  }

  .main-nav .drawer-logo-link {
    margin-right: 0 !important;
    margin-left: auto !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 !important;
    height: 100%;
    text-decoration: none;
  }

  .main-nav .drawer-logo-img {
    height: 38px;
    max-height: 38px;
    width: auto;
    object-fit: contain;
    display: block;
  }

  .menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(25, 23, 19, 0.5);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
  }

  .menu-overlay.show {
    opacity: 1;
    visibility: visible;
  }

  /* Drawer Nav Items List */
  .main-nav ul {
    list-style: none;
    padding: 12px 16px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
  }

  .main-nav .mobile-only {
    display: block !important;
  }

  .main-nav .screen-only {
    display: none !important;
  }

  .main-nav > ul > li {
    display: block;
    width: 100%;
  }

  .main-nav .fa-mosque,
  .main-nav > ul > li > a i {
    display: none !important;
  }

  .main-nav > ul > li > a {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 11px 14px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-ink);
    text-decoration: none;
    background: transparent;
    border-radius: 8px;
    transition: all 0.2s ease;
  }

  .main-nav > ul > li > a:hover,
  .main-nav > ul > li > a.active {
    color: var(--color-orange-ink);
    background: var(--color-bg);
  }

  /* Drawer Collapsible Accordion Sections */
  .main-nav .drawer-section {
    display: block;
    margin-bottom: 2px;
  }

  .main-nav .drawer-group-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    color: #1e293b;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  [dir="ltr"] .main-nav .drawer-group-trigger {
    text-align: left;
  }

  [dir="rtl"] .main-nav .drawer-group-trigger {
    text-align: right;
  }

  .main-nav .drawer-group-trigger:hover,
  .main-nav .drawer-group-trigger.active,
  .main-nav .drawer-group-trigger.open {
    background: #FAF9F6;
    color: #B5560C;
  }

  .main-nav .drawer-chevron {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.25s ease;
    flex-shrink: 0;
    margin: 0 4px;
  }

  .main-nav .drawer-group-trigger.open .drawer-chevron,
  .main-nav .drawer-group-trigger[aria-expanded="true"] .drawer-chevron {
    transform: rotate(-135deg);
  }

  .main-nav .drawer-submenu {
    display: none;
    flex-direction: column;
    padding: 4px 10px 8px 10px;
    margin: 4px 0 8px 0;
    border-right: none;
    border-bottom: 1px solid #FAF9F6;
    background: transparent;
    border-radius: 0;
  }

  .main-nav .drawer-submenu.show {
    display: flex;
  }

  .main-nav .drawer-submenu a.sub {
    display: block;
    padding: 8px 12px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
  }

  .main-nav .drawer-submenu a.sub:hover,
  .main-nav .drawer-submenu a.sub.active {
    color: #B5560C;
    background: #FAF9F6;
    padding-right: 16px;
  }

  /* Drawer Footer CTA */
  .main-nav .drawer-cta {
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
    margin-top: auto;
  }

  .main-nav .drawer-cta .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 11px 16px;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    box-sizing: border-box;
  }

  .main-nav .drawer-cta .btn-primary {
    background: var(--brand-orange);
    color: #ffffff !important;
    border: none;
    box-shadow: 0 2px 8px rgba(244, 121, 32, 0.25);
  }

  .main-nav .drawer-cta .btn-primary:hover {
    background: #e06810;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(244, 121, 32, 0.35);
  }

  .main-nav .drawer-cta .btn-ghost {
    background: #f1f5f9;
    color: var(--brand-blue) !important;
    border: 1px solid #cbd5e1;
  }

  .main-nav .drawer-cta .btn-ghost:hover {
    background: var(--brand-blue);
    color: #ffffff !important;
    border-color: var(--brand-blue);
  }


  #calendar-link {
    display: none !important;
  }

  #calendar-btn {
    display: flex !important;
    font-size: 14px;
    color: var(--brand-gray);
    background-color: white;
  }

  #calendar-btn:hover {
    background-color: var(--brand-orange);
    color: white;
    transform: translateY(-2px);
    text-decoration: none;
  }

  .calendar-container {
    margin: 20px 2px;
    padding: 12px 2px;
  }

  .calendar-container h1 {
    margin: 18px 0px;
    font-size: 24px;
  }

  .calendar-container table {
    margin-top: 0px;
    font-size: 12px;
  }

  .calendar-container th,
  .calendar-container td {
    padding: 2px;
  }

  .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .calendar-container tr.visa-row-highlight td {
    padding: 8px 4px !important;
  }

  #openApplyModal {
    font-size: 14px;
  }

  #openApplyModal:hover {
    background-color: white;
    color: var(--brand-blue);
    text-decoration: none;
  }

  /* everything else inherits from the desktop rule in style.css */
  #researchModal .modal-content {
    padding: 5px 10px;
  }

  .book-modal {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .book-modal table.modal-details {
    text-align: right;
  }

  .announcements-section {
    margin-top: 0;
  }

  .announcements-section .ann-list {
    grid-template-columns: 1fr;
  }

  #contact {
    padding: 16px;
  }

  .summary-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  header .brand-phone h1 {
    font-size: 16px;
  }

  .news-gallery img {
    height: 150px;
  }

  .news-full {
    padding: 20px;
  }

  .program-card h2,
  .admission-card h2 {
    font-size: 1.4rem;
  }

  .program-table th,
  .program-table td {
    display: block;
    width: 100%;
  }

  .program-table th {
    background: none;
    border: none;
    font-weight: 700;
    padding-top: 12px;
  }

  .program-table td {
    border: none;
    padding-top: 0;
  }

  footer .footer-grid {
    grid-template-columns: 1fr;
    text-align: right;
    padding: 10px 15px;
  }

  [dir="ltr"] footer .footer-grid,
  html[lang="en"] footer .footer-grid {
    text-align: left !important;
  }

  [dir="ltr"] .text-about,
  html[lang="en"] .text-about {
    text-align: justify !important;
  }

  .footer-qr-container {
    text-align: center;
  }

  [dir="ltr"] .footer-qr-container,
  html[lang="en"] .footer-qr-container {
    text-align: left !important;
  }

  .grid {
    grid-template-columns: 1fr;
  }


  #results {
    padding: 20px;
    box-shadow: none;
  }

  #admissionForm select,
  #admissionForm input {
    font-size: 14px;
  }

  .fees-card {
    padding: 10px 7px;
  }

  .fees-table,
  .fees-table tbody,
  .fees-table tr,
  .fees-table th,
  .fees-table td {
    display: block;
    width: 100%;
  }

  .fees-table thead {
    display: none;
  }

  .fees-table tr {
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid #e5e8eb;
    border-radius: 8px;
    background: #fff;
  }

  .fees-table th[scope="row"] {
    background: transparent;
    border: none;
    border-bottom: 1px dashed #e5e8eb;
    padding: 0 0 8px;
    margin-bottom: 6px;
    text-align: right;
    font-size: 1rem;
  }

  .fees-table td {
    border: none;
    padding: 4px 0;
    text-align: right;
  }

  .fees-table td[data-label]::before {
    content: attr(data-label);
    float: right;
    font-weight: bold;
    color: var(--brand-blue);
    margin-left: 10px;
  }

  .fees-table td.amt,
  .fees-table td.extra {
    text-align: left;
  }

  [dir="ltr"] .fees-table th[scope="row"],
  html[lang="en"] .fees-table th[scope="row"],
  [dir="ltr"] .fees-table td,
  html[lang="en"] .fees-table td {
    text-align: left !important;
  }

  [dir="ltr"] .fees-table td[data-label]::before,
  html[lang="en"] .fees-table td[data-label]::before {
    float: left !important;
    margin-right: 10px !important;
    margin-left: 0 !important;
  }

  [dir="ltr"] .fees-table td.amt,
  html[lang="en"] .fees-table td.amt,
  [dir="ltr"] .fees-table td.extra,
  html[lang="en"] .fees-table td.extra {
    text-align: right !important;
  }

  .otp-container {
    gap: 4px;
  }
}