/* ==========================================================================
   SGM PU College - Responsive Layouts & Mobile Adaptation
   ========================================================================== */

@media (max-width: 1024px) {
  .college-title {
    font-size: 2.6rem;
    line-height: 1.25;
    padding-bottom: 8px;
  }
  .slideshow-viewport {
    aspect-ratio: 16 / 9;
  }
  .contact-grid-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

@media (max-width: 768px) {
  .site-header {
    padding: 12px 14px 10px;
  }

  .header-top-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    gap: 12px;
    width: 100%;
  }

  .header-center-branding {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    margin: 0 auto;
    text-align: left;
  }

  .header-logo-group {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
  }

  .header-logo-img {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
  }

  .header-titles-block {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    flex-shrink: 1;
  }

  .college-title {
    font-size: clamp(1.75rem, 6vw, 2.35rem);
    font-weight: 850;
    line-height: 1.18;
    padding-top: 1px;
    padding-bottom: 3px;
    text-align: left;
    margin: 0;
    display: inline-block;
    width: auto;
  }

  .college-location-sub {
    font-size: 12.5px;
    text-align: left;
    justify-content: flex-start;
    margin: 0;
    width: auto;
  }

  .header-auth-actions {
    position: static;
    transform: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
  }

  .site-search-wrapper {
    flex: 1;
    min-width: 0;
  }

  .search-input-box {
    width: 100% !important;
    display: flex !important;
    padding: 3px 3px 3px 12px !important;
  }

  .site-search-input {
    width: 100% !important;
    font-size: 13px !important;
    padding: 4px 6px 4px 0 !important;
  }
  .site-search-input:focus {
    width: 100% !important;
  }

  .btn-search-submit {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    font-size: 13.5px !important;
  }

  .search-results-dropdown {
    left: 0;
    right: 0;
    width: 100%;
    max-height: 320px;
    z-index: 99999 !important;
  }

  .btn-theme-toggle {
    flex-shrink: 0;
  }
  .btn-header-login {
    flex-shrink: 0;
    padding: 7px 14px;
  }

  /* Switch navigation to mobile drawer / collapsed menu */
  .mobile-nav-toggle {
    display: inline-flex !important;
    flex-shrink: 0 !important;
    margin-left: 2px !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    border-radius: 50% !important;
    font-size: 20px !important;
    align-items: center !important;
    justify-content: center !important;
  }

  body.theme-light .mobile-nav-toggle,
  html[data-theme="light"] .mobile-nav-toggle,
  [data-theme="light"] .mobile-nav-toggle {
    background: #ffffff !important;
    border: 1.5px solid #64748b !important;
    color: #0f172a !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
  }
  body.theme-light .mobile-nav-toggle i,
  html[data-theme="light"] .mobile-nav-toggle i,
  [data-theme="light"] .mobile-nav-toggle i {
    color: #0f172a !important;
    fill: #0f172a !important;
  }

  .nav-container {
    position: static;
    padding: 0;
    margin: 10px 0 0;
  }

  .nav-pill-wrapper {
    display: none;
    flex-direction: column;
    width: 100%;
    border-radius: var(--radius-lg);
    padding: 12px;
    gap: 8px;
    margin-top: 10px;
    background: rgba(10, 15, 29, 0.98);
  }

  body.theme-light .nav-pill-wrapper {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12) !important;
  }
  body.theme-light .nav-pill-wrapper .nav-item-btn {
    color: #1e293b !important;
  }
  body.theme-light .nav-pill-wrapper .nav-item-btn:hover,
  body.theme-light .nav-pill-wrapper .nav-item-btn.active {
    background: #e0f2fe !important;
    color: #0284c7 !important;
  }

  .nav-pill-wrapper.mobile-open {
    display: flex;
    animation: fadeIn 0.25s ease forwards;
  }

  .nav-item-btn {
    width: 100%;
    justify-content: flex-start;
    padding: 12px 16px;
    border-radius: var(--radius-md);
  }

  /* Mobile Dropdown Accordion for RESULTS */
  .nav-dropdown {
    width: 100% !important;
    position: relative !important;
    display: block !important;
  }

  .nav-dropdown-btn {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 12px 16px !important;
    border-radius: var(--radius-md) !important;
    cursor: pointer !important;
    background: transparent !important;
    border: none !important;
    color: inherit !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    text-align: left !important;
    box-sizing: border-box !important;
  }

  .nav-dropdown-btn .dropdown-arrow {
    margin-left: auto !important;
    font-size: 16px !important;
    transition: transform 0.25s ease !important;
  }

  .nav-dropdown.show .nav-dropdown-btn .dropdown-arrow {
    transform: rotate(180deg) !important;
  }

  .nav-dropdown-menu {
    position: static !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    box-shadow: none !important;
    margin: 6px 0 4px 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    background: rgba(15, 23, 42, 0.75) !important;
    border: 1px solid rgba(56, 189, 248, 0.25) !important;
    border-radius: 12px !important;
    padding: 8px !important;
    transition: all 0.2s ease !important;
  }

  .nav-dropdown.show .nav-dropdown-menu {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
    animation: dropdownSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }

  @keyframes dropdownSlideDown {
    from {
      opacity: 0;
      transform: translateY(-6px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .nav-dropdown-menu .dropdown-link-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 12px 14px !important;
    border-radius: 8px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: #f1f5f9 !important;
    text-decoration: none !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    transition: all 0.18s ease !important;
    box-sizing: border-box !important;
    width: 100% !important;
  }

  .nav-dropdown-menu .dropdown-link-item:hover,
  .nav-dropdown-menu .dropdown-link-item:active {
    background: rgba(56, 189, 248, 0.22) !important;
    border-color: rgba(56, 189, 248, 0.45) !important;
    color: #ffffff !important;
  }

  .nav-dropdown-menu .dropdown-link-item i {
    color: #38bdf8 !important;
    font-size: 18px !important;
    flex-shrink: 0 !important;
  }

  .nav-dropdown-menu .dropdown-link-item .dropdown-item-ext {
    margin-left: auto !important;
    font-size: 13px !important;
    opacity: 0.8 !important;
  }

  /* Light Theme Specific for Mobile Dropdown Menu */
  body.theme-light .nav-dropdown-menu {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.03) !important;
  }

  body.theme-light .nav-dropdown-menu .dropdown-link-item {
    color: #0f172a !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
  }

  body.theme-light .nav-dropdown-menu .dropdown-link-item:hover,
  body.theme-light .nav-dropdown-menu .dropdown-link-item:active {
    background: #e0f2fe !important;
    border-color: #0284c7 !important;
    color: #0284c7 !important;
  }

  body.theme-light .nav-dropdown-menu .dropdown-link-item i {
    color: #0284c7 !important;
  }

  body.theme-light .nav-dropdown-menu .dropdown-link-item .dropdown-item-ext {
    color: #64748b !important;
  }

  /* Hero & Slideshow adjustments */
  .hero-tagline {
    font-size: 1.85rem;
  }
  .hero-subtagline {
    font-size: 1rem;
  }

  .slideshow-viewport {
    aspect-ratio: 16 / 10;
    max-height: 380px;
  }
  .slide-caption-overlay {
    padding: 20px 16px 14px;
  }
  .slide-caption-title {
    font-size: 17px;
  }
  .slide-caption-text {
    font-size: 12.5px;
  }
  .slide-nav-arrow {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }

  /* Notices */
  .notice-header-row {
    padding: 14px 16px;
    gap: 12px;
  }
  .notice-date-box {
    min-width: 54px;
    padding: 6px 10px;
  }
  .notice-date-day {
    font-size: 18px;
  }
  .notice-title-text {
    font-size: 15px;
    flex-wrap: wrap;
  }
  .notice-body-details {
    padding: 14px 16px 16px;
  }

  /* Gallery & Subgallery */
  .albums-grid {
    gap: 16px;
  }
  .subgallery-grid {
    gap: 12px;
  }

  /* Achievements */
  .achievements-grid {
    gap: 16px;
  }

  /* Staff Profiles */
  /* Staff Profiles & Cards - Perfectly Centered on Mobile */
  .staff-grid,
  .achievements-grid,
  .albums-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 16px;
    width: 100%;
  }
  .staff-profile-card,
  .achievement-card-passport {
    flex: 0 1 260px;
    width: 260px;
    max-width: 90%;
    margin: 0 auto;
  }
  .achievement-card-standard,
  .album-card,
  .highlight-card {
    flex: 0 1 320px;
    width: 320px;
    max-width: 100%;
    margin: 0 auto;
  }
  .staff-photo-circle {
    width: 115px;
    height: 115px;
  }

  /* Floating button */
  .cms-fab-btn {
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    font-size: 22px;
  }
  .cms-fab-menu {
    bottom: 80px;
    right: 20px;
  }

  /* Lightbox buttons */
  .lightbox-arrow {
    width: 42px;
    height: 42px;
    font-size: 22px;
  }
  .lightbox-arrow.prev { left: 8px; }
  .lightbox-arrow.next { right: 8px; }
}

@media (max-width: 480px) {
  .header-center-branding {
    gap: 12px;
  }
  .header-logo-img {
    width: 60px;
    height: 60px;
  }
  .college-title {
    font-size: clamp(1.5rem, 5.5vw, 1.95rem);
    font-weight: 850;
    line-height: 1.2;
    padding-bottom: 3px;
  }
  .college-location-sub {
    font-size: 11.5px;
  }
  .main-wrapper {
    padding: 0 12px;
  }
  .glass-panel {
    padding: 20px 14px;
    border-radius: var(--radius-lg);
  }
  .highlights-grid {
    grid-template-columns: 1fr;
  }
  .iframe-container {
    height: 480px;
  }
}
