/**
 * Shri Damodar Maharaj Mahavidyalaya (SDMM) - Responsive Media Queries
 * Pixel-Perfect Layout across 320px, 360px, 375px, 390px, 412px, 768px, 1024px, 1280px+
 * Premium High-Contrast Mobile Navigation Drawer, Accessible Menus & Responsive Flow
 */

/* Desktop defaults for drawer items */
.mobile-drawer-header,
.mobile-drawer-footer {
  display: none;
}

/* Medium Desktops & Small Laptops (1081px - 1200px) */
@media (max-width: 1200px) {
  .nav-link {
    padding: 0.85rem 0.45rem;
    font-size: 0.82rem;
  }

  .nav-cta-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }

  .brand-quick-contacts {
    gap: 1rem;
  }
}

/* Tablet Landscape & Below (Switch to Mobile Drawer Navigation <= 1080px) */
@media (max-width: 1080px) {
  .mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.15rem 1.25rem;
    background: #030a14;
    border-bottom: 2px solid var(--accent-saffron);
  }

  .drawer-brand-wrap strong {
    color: #ffffff;
    font-size: 1.05rem;
    display: block;
    font-family: var(--font-heading);
  }

  .drawer-brand-wrap small {
    color: var(--accent-gold);
    font-size: 0.75rem;
    font-weight: 600;
  }

  .mobile-drawer-close {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    transition: all var(--transition-fast);
  }

  .mobile-drawer-close:hover {
    background: var(--accent-saffron);
    border-color: var(--accent-saffron);
  }

  .nav-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: #071526;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0 0 2rem 0;
    overflow-y: auto;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.7);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1060 !important;
  }

  .nav-menu.open {
    left: 0;
  }

  .nav-item {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .nav-link {
    color: #ffffff !important;
    padding: 0.95rem 1.25rem;
    width: 100%;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0;
  }

  .nav-link:hover,
  .nav-item.active>.nav-link {
    background: #0f2b4c;
    color: var(--accent-gold) !important;
  }

  .dropdown-chevron {
    color: var(--accent-gold);
    transition: transform 0.25s ease;
  }

  .nav-item.dropdown-open>.nav-link .dropdown-chevron {
    transform: rotate(180deg);
  }

  .nav-dropdown {
    position: static;
    display: none;
    background: #0c2340;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25);
    border: none;
    border-left: 4px solid var(--accent-saffron);
    border-radius: 0;
    margin: 0;
    padding: 0.25rem 0;
  }

  .nav-item.dropdown-open>.nav-dropdown {
    display: block;
  }

  .nav-dropdown-link {
    color: #f1f5f9 !important;
    padding: 0.7rem 1.25rem 0.7rem 1.5rem;
    font-size: 0.875rem;
    display: block;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  }

  .nav-dropdown-link:hover {
    background: rgba(217, 99, 18, 0.22);
    color: var(--accent-gold) !important;
    padding-left: 1.75rem;
  }

  .mobile-drawer-footer {
    display: block;
    padding: 1.25rem;
    margin-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
  }

  /* Overlay - strictly behind drawer */
  .mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 1040 !important;
  }

  .mobile-nav-overlay.open {
    display: block;
  }

  /* Brand Header on Mobile/Tablet */
  .brand-header {
    padding: 0.65rem 0;
  }

  .brand-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
  }

  .brand-identity {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    text-align: center;
  }

  .brand-logo-img {
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: 52px !important;
    object-fit: contain;
    margin: 0 auto;
    display: block;
  }

  .brand-quick-contacts {
    display: none !important;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

/* Tablet Portrait & Mobile Phones (<= 860px) */
@media (max-width: 860px) {

  html,
  body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
    width: 100%;
    max-width: 100%;
  }

  /* Top Bar - Clean Centered Layout */
  .topbar {
    padding: 0.45rem 0;
    text-align: center;
  }

  .topbar-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    text-align: center;
  }

  .topbar-left {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    width: 100%;
    text-align: center;
  }

  .topbar-right {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0.35rem;
    text-align: center;
  }

  .topbar-badge {
    font-size: 0.72rem;
    padding: 0.15rem 0.45rem;
  }

  .topbar-link {
    font-size: 0.75rem;
  }

  .topbar-tools {
    gap: 0.25rem;
  }

  .tool-btn {
    font-size: 0.72rem;
    padding: 0.12rem 0.4rem;
  }

  /* Nav Bar & CTA Alignment */
  .main-nav-bar {
    padding: 0.25rem 0;
    background: var(--primary-900);
  }

  .nav-container {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.35rem 0.75rem !important;
    min-height: 50px !important;
    width: 100% !important;
  }

  .mobile-menu-toggle {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    height: 38px !important;
    border-radius: var(--radius-sm) !important;
    background: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    cursor: pointer !important;
    padding: 0 0.75rem !important;
    font-size: 0.825rem !important;
    font-weight: 700 !important;
  }

  .mobile-menu-toggle:hover,
  .mobile-menu-toggle:focus {
    background: var(--accent-saffron) !important;
    border-color: var(--accent-saffron) !important;
  }

  .nav-cta-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 38px !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    padding: 0 0.85rem !important;
    white-space: nowrap !important;
    border-radius: var(--radius-sm) !important;
    background: linear-gradient(135deg, var(--accent-saffron), var(--accent-saffron-hover)) !important;
    color: #ffffff !important;
  }

  /* Trust Strip - Visually Separated with Rich Accent Border */
  .trust-strip {
    background: #030a14 !important;
    border-bottom: 2px solid rgba(217, 99, 18, 0.5) !important;
    padding: 0.85rem 0.5rem !important;
    margin-bottom: 0 !important;
    text-align: center !important;
  }

  .trust-strip-inner {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    width: 100% !important;
    text-align: center !important;
  }

  .trust-strip-message {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
    font-size: 0.825rem !important;
    line-height: 1.4 !important;
    color: #f1f5f9 !important;
    text-align: center !important;
  }

  .trust-shield-icon {
    width: 18px !important;
    height: 18px !important;
    flex-shrink: 0 !important;
    color: var(--accent-gold) !important;
  }

  .trust-strip-text {
    font-size: 0.825rem !important;
    line-height: 1.4 !important;
    color: #e2e8f0 !important;
  }

  .trust-verify-btn {
    font-size: 0.775rem !important;
    font-weight: 700 !important;
    padding: 0.4rem 1.1rem !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    border-radius: var(--radius-sm) !important;
    background: var(--accent-saffron) !important;
    color: #ffffff !important;
  }

  /* Hero Section Mobile Optimization */
  .hero-section {
    padding: 2rem 0 2.25rem 0 !important;
    background: #071526 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    width: 100% !important;
  }

  .hero-grid {
    grid-template-columns: 1fr !important;
    gap: 1.75rem !important;
  }

  .hero-visual-col {
    width: 100% !important;
    max-width: 480px !important;
    margin: 0 auto !important;
  }

  .hero-subtitle-top {
    font-size: 0.75rem !important;
    line-height: 1.4 !important;
    margin-bottom: 0.85rem !important;
  }

  .hero-sponsoring-badge {
    display: inline-block !important;
    font-size: 0.72rem !important;
    line-height: 1.4 !important;
    padding: 0.4rem 0.75rem !important;
    background: rgba(251, 191, 36, 0.12) !important;
    border: 1px solid rgba(251, 191, 36, 0.35) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--accent-gold) !important;
    font-weight: 700 !important;
  }

  .hero-title {
    font-size: 1.65rem !important;
    line-height: 1.25 !important;
    margin-bottom: 0.75rem !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    word-break: break-word !important;
  }

  .hero-location-line {
    font-size: 0.85rem !important;
    line-height: 1.4 !important;
    margin-bottom: 0.85rem !important;
    color: #cbd5e1 !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.4rem !important;
  }

  .hero-affiliation-line {
    font-size: 0.825rem !important;
    padding: 0.65rem 0.85rem !important;
    margin-bottom: 1.35rem !important;
    display: block !important;
    width: 100% !important;
    line-height: 1.4 !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border-left: 3px solid var(--accent-gold) !important;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important;
    color: #f8fafc !important;
  }

  .hero-cta-group {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.65rem !important;
    margin-bottom: 1.5rem !important;
  }

  .hero-cta-group .btn {
    width: 100% !important;
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    padding: 0.75rem 1rem !important;
    justify-content: center !important;
    text-align: center !important;
  }

  .hero-visual-card {
    width: 100% !important;
    position: relative !important;
    border-radius: var(--radius-xl) !important;
    overflow: hidden !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
  }

  .hero-badge-top-left {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    font-size: 0.72rem !important;
    padding: 0.3rem 0.65rem !important;
    z-index: 2 !important;
    background: rgba(7, 21, 38, 0.92) !important;
    border: 1px solid var(--accent-gold) !important;
    color: var(--accent-gold) !important;
    border-radius: var(--radius-sm) !important;
    white-space: nowrap !important;
  }

  .hero-badge-top-right {
    position: absolute !important;
    top: 10px !important;
    right: 10px !important;
    font-size: 0.72rem !important;
    padding: 0.3rem 0.65rem !important;
    z-index: 2 !important;
    background: rgba(16, 185, 129, 0.95) !important;
    color: #ffffff !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
  }

  /* Homepage Notice Board & Principal Split Grid Mobile */
  .notices-split-grid {
    grid-template-columns: 1fr !important;
    gap: 1.75rem !important;
  }

  /* Disclosure Gateway Card Mobile */
  .disclosure-gateway-card {
    padding: 1.75rem 1.25rem !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1.25rem !important;
  }

  .disclosure-gateway-title {
    font-size: 1.35rem !important;
  }

  .disclosure-gateway-desc {
    font-size: 0.875rem !important;
  }

  .disclosure-gateway-card .btn {
    width: 100% !important;
    justify-content: center !important;
  }

  .hero-image-frame {
    aspect-ratio: 4 / 3;
    min-height: 240px;
  }

  .hero-badge-top-left {
    top: 0.65rem;
    left: 0.65rem;
    font-size: 0.72rem;
    padding: 0.25rem 0.65rem;
    gap: 0.35rem;
    max-width: calc(100% - 1.3rem);
    white-space: nowrap;
  }

  .hero-badge-top-right {
    top: 2.65rem;
    left: 0.65rem;
    right: auto;
    font-size: 0.7rem;
    padding: 0.25rem 0.65rem;
    max-width: calc(100% - 1.3rem);
    white-space: nowrap;
  }

  .hero-caption-overlay {
    padding: 1.5rem 0.85rem 0.85rem 0.85rem;
  }

  .hero-caption-title {
    font-size: 0.92rem;
    font-weight: 700;
  }

  .hero-caption-sub {
    font-size: 0.72rem;
    line-height: 1.35;
  }

  /* Page Hero on Inner Pages */
  .page-hero {
    padding: 2rem 0;
    width: 100%;
  }

  .page-hero-title,
  .page-hero h1 {
    font-size: 1.65rem !important;
    word-break: break-word;
  }

  .page-hero-subtitle,
  .page-hero p {
    font-size: 0.9rem !important;
    line-height: 1.45;
  }

  /* Inner Pages Two-Column Grids -> Collapsed to 1 Column on Mobile */
  .about-grid,
  .principal-grid,
  .contact-grid,
  .notices-split-grid,
  .programmes-grid,
  .statutory-grid,
  .verified-grid,
  .facilities-preview-grid,
  .footer-grid {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 1.5rem !important;
  }

  .verified-panel-wrap {
    margin-top: -1rem;
    width: 100%;
  }

  .panel-header {
    padding: 0.65rem 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  .panel-body {
    padding: 1rem;
  }

  .form-row-2 {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
  }

  .course-wireframe {
    padding: 1.25rem;
  }

  /* Footer */
  .footer-bottom-content {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }

  .footer-bottom-links {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  /* Tables */
  .table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Small Mobile Phones (320px - 480px) */
@media (max-width: 480px) {

  html,
  body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .brand-logo-img {
    max-height: 44px !important;
  }

  .hero-title {
    font-size: 1.45rem !important;
  }

  .page-hero-title,
  .page-hero h1 {
    font-size: 1.4rem !important;
  }

  .section-title {
    font-size: 1.35rem;
  }

  .section-subtitle {
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
  }

  .topbar-badge,
  .topbar-link {
    font-size: 0.7rem;
  }

  .p-card-header {
    padding: 1.15rem;
  }

  .p-card-title {
    font-size: 1.25rem;
  }

  .p-card-body {
    padding: 1.15rem;
  }

  .disclosure-controls {
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem;
  }

  .search-box-wrap {
    width: 100%;
  }

  .filter-tabs {
    overflow-x: auto;
    padding-bottom: 0.25rem;
    width: 100%;
  }

  .nav-cta-btn {
    font-size: 0.75rem;
    padding: 0 0.65rem;
  }

  .hero-badge-top-left {
    top: 6px !important;
    left: 6px !important;
    font-size: 0.65rem !important;
    padding: 0.25rem 0.5rem !important;
  }

  .hero-badge-top-right {
    top: 6px !important;
    right: 6px !important;
    font-size: 0.65rem !important;
    padding: 0.25rem 0.5rem !important;
  }

  .trust-strip-message {
    font-size: 0.775rem !important;
  }

  .trust-verify-btn {
    font-size: 0.725rem !important;
    padding: 0.35rem 0.85rem !important;
  }

  .hero-sponsoring-badge {
    font-size: 0.68rem !important;
    padding: 0.3rem 0.55rem !important;
  }
}