/* Custom Responsive Styles for UK Fusion Student Network */

/* CSS Variables for consistent spacing and colors */
:root {
  --mobile-padding: 20px;
  --tablet-padding: 40px;
  --desktop-padding: 60px;
  --mobile-font-size: 0.9rem;
  --tablet-font-size: 1rem;
  --desktop-font-size: 1.1rem;
  --mobile-button-height: 44px;
  --mobile-border-radius: 25px;
  --mobile-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  --mobile-transition: all 0.3s ease;
}

/* Responsive spacing overrides for tablets */
@media (max-width: 991px) {
  :root {
    --section-padding-top: 60px;
    --section-padding-bottom: 60px;
    --heading-margin-top: 40px;
    --heading-margin-bottom: 30px;

    /* Hero section spacing for tablets */
    --hero-title-margin: 25px;
    --hero-subtitle-margin: 25px;
    --hero-button-margin: 25px;
    --hero-tagline-margin: 25px;
    --hero-logo-margin: 25px;
  }
}

/* Responsive spacing overrides for mobile */
@media (max-width: 767px) {
  :root {
    --section-padding-top: 40px;
    --section-padding-bottom: 40px;
    --heading-margin-top: 30px;
    --heading-margin-bottom: 20px;

    /* Hero section spacing for mobile */
    --hero-title-margin: 20px;
    --hero-subtitle-margin: 20px;
    --hero-button-margin: 20px;
    --hero-tagline-margin: 20px;
    --hero-logo-margin: 20px;
  }
}

/* Mobile-first approach */
@media (max-width: 767px) {

  /* Typography adjustments for mobile */
  .slider_section .detail-box h1 {
    font-size: 2.5rem !important;
    line-height: 1.2;
  }

  .slider_section .detail-box p {
    font-size: 1.1rem;
  }

  /* Mobile navigation improvements */
  .navbar-brand span {
    font-size: 1.2rem;
  }

  .header_section .navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 4px 0;
  }

  .header_section .navbar-brand span {
    line-height: 1.2;
  }

  .hero_area .slider_section .slider_container {
    margin-top: 3rem;
    padding-top: 1.25rem;
  }

  .hero_area .slider_section .slider_container .img-box {
    margin: 1.75rem auto 145px;
  }

  /* Ensure navbar stays on top when overlay is open */
  .navbar {
    position: relative;
    z-index: 10000;
  }

  .navbar-brand {
    position: relative;
    z-index: 10001;
  }

  .overlay-content {
    padding-top: 100px;
  }

  .overlay-content a {
    font-size: 1rem;
    padding: 0.8rem 1.5rem;
    margin: 0.5rem 0;
    min-width: 200px;
    max-width: 250px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  }

  /* Mobile button improvements */
  .btn {
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 25px;
  }

  .btn-lg {
    padding: 15px 30px;
    font-size: 1.1rem;
  }

  /* Mobile spacing improvements */
  .layout_padding {
    padding: 60px 0;
  }

  .layout_padding-top {
    padding-top: 60px;
  }

  .layout_padding-bottom {
    padding-bottom: 60px;
  }

  /* Mobile card improvements */
  .box {
    margin-bottom: 2rem;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  }

  .box .img-box {
    height: 200px;
    overflow: hidden;
  }

  .box .img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Mobile form improvements */
  .form-control {
    height: 50px;
    border-radius: 25px;
    border: 2px solid #e9ecef;
  }

  .form-control:focus {
    border-color: #4855fe;
    box-shadow: 0 0 0 0.2rem rgba(72, 85, 254, 0.25);
  }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 991px) {
  .slider_section .detail-box h1 {
    font-size: 3rem;
  }

  .navbar-brand span {
    font-size: 1.4rem;
  }

  .box .img-box {
    height: 250px;
  }

  /* Tablet navigation adjustments */
  .desktop-nav .nav-link {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    gap: 0.3rem;
  }

  .desktop-nav {
    gap: 0.7rem;
  }

  /* Ensure mobile menu button is visible on tablet */
  .custom_menu-btn {
    display: block !important;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .slider_section .detail-box h1 {
    font-size: 2rem !important;
  }

  .slider_section .detail-box p {
    font-size: 1rem;
  }

  .heading_container h2 {
    font-size: 2rem;
  }

  .navbar-brand span {
    font-size: 1rem;
  }

  .header_section .navbar-brand {
    gap: 0.35rem;
    padding: 2px 0;
  }

  .header_section .navbar-brand span {
    line-height: 1.2;
  }

  .hero_area .slider_section .slider_container {
    margin-top: 3.25rem;
  }

  .overlay-content {
    padding-top: 100px;
    justify-content: flex-start;
  }

  .overlay-content a {
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
    margin: 0.4rem 0;
    min-width: 180px;
    max-width: 220px;
    border-radius: 8px;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  .btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
  }
}

/* Extra small devices */
@media (max-width: 360px) {
  .slider_section .detail-box h1 {
    font-size: 1.8rem !important;
  }

  .navbar-brand span {
    font-size: 0.9rem;
  }

  .hero_area .slider_section .slider_container {
    margin-top: 3.5rem;
  }

  .overlay-content a {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    margin: 0.3rem 0;
    min-width: 160px;
    max-width: 200px;
    border-radius: 8px;
  }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
  .btn {
    min-height: 44px;
    min-width: 44px;
  }

  .overlay-content a {
    min-height: 44px;
    min-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.5rem;
  }

  .navbar-toggler {
    min-height: 44px;
    min-width: 44px;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
  .box-img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 767px) and (orientation: landscape) {
  .slider_section {
    padding-top: 30px;
    padding-bottom: 120px;
  }

  .overlay-content {
    padding-top: 80px;
    justify-content: flex-start;
  }
}

/* Specific optimizations for Nest Hub/Tablets and short-height desktop screens */
/* Specific optimizations for Nest Hub, Tablets, iPad Pro, and Desktop screens */
@media (min-width: 768px) and (max-height: 1450px) {
  :root {
    /* Tighter hero spacing for short screens to prevent overlap */
    --hero-title-margin: 25px;
    --hero-subtitle-margin: 25px;
    --hero-button-margin: 25px;
    --hero-tagline-margin: 25px;
    --hero-logo-margin: 25px;
  }

  .slider_section {
    padding-top: 20px !important;
    padding-bottom: 270px !important;
    /* Reduced from 220px to prevent content overflow on short screens */
    margin-top: 25px !important;
    /* Positive margin to ensure header clearance on short screens */
  }

  .slider_section .detail-box {
    margin-bottom: 0.25rem !important;
  }

  .slider_section .detail-box h1 {
    font-size: clamp(1rem, 5vw, 2rem) !important;
  }

  .slider_section .detail-box p {
    font-size: 0.85rem !important;
  }

  .find_container .welcome-message h3 {
    font-size: 1rem !important;
  }

  .find_container .welcome-message p {
    font-size: 0.8rem !important;
    margin-bottom: 30px !important;
  }

  .hero_area .slider_section .slider_container {
    margin-top: 5rem !important;
    /* Ensure 5rem gap on Nest Hub and Nest Hub Max */
    margin-bottom: -115px !important;
  }
}

/* Ensure gap exists on very tall screens too */
@media (min-width: 900px) and (min-height: 1451px) {
  .hero_area .slider_section .slider_container {
    margin-top: 5rem !important;
    /* Ensure 5rem gap on iPad Pro and Desktop */
  }
}

/* Ensure adequate spacing for mobile and small tablets even on short screens */
@media (max-width: 767px) {
  .slider_section {
    padding-bottom: 300px !important;
    /* Reduced from 350px to allow proper hero spacing */
  }

  .slider_section .slider_container .slick-prev,
  .slider_section .slider_container .slick-next {
    top: 50% !important;
  }

  .slider_section .detail-box h1 {
    font-size: clamp(0.9rem, 6vw, 2.2rem) !important;
    /* Slightly larger for visibility but still safe */
  }

  .hero_area .slider_section .slider_container {
    margin-top: 2rem !important;
    margin-bottom: -160px !important;
    /* Maintain slider visibility */
  }
}

/* Extra specific for very narrow phones to prevent horizontal overflow */
@media (max-width: 380px) {
  .slider_section .detail-box h1 {
    font-size: 1.5rem !important;
    /* Force smaller size for narrowest phones */
  }
}

/* Print styles */
@media print {

  .overlay,
  .custom_menu-btn,
  .btn {
    display: none !important;
  }

  .slider_section {
    padding: 20px 0;
  }

  .box {
    break-inside: avoid;
    margin-bottom: 20px;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  .slider_section .slider_container .slick-slide {
    transition: none !important;
  }

  .box {
    transition: none !important;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .box {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
  }

  .overlay-content a {
    color: #fff;
  }

  .overlay-content a:hover {
    background-color: rgba(255, 255, 255, 0.1);
  }
}

/* Additional mobile optimizations */
@media (max-width: 767px) {

  /* Improve mobile scrolling */
  html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
  }

  /* Mobile-specific container adjustments */
  .container {
    padding-left: var(--mobile-padding);
    padding-right: var(--mobile-padding);
  }

  /* Mobile-specific button improvements */
  .btn-box {
    text-align: center;
    margin-top: 1.5rem;
  }

  /* Mobile-specific image optimizations */
  .img-box img {
    transition: var(--mobile-transition);
  }

  .img-box img:hover {
    transform: scale(1.05);
  }

  /* Mobile-specific text improvements */
  .detail-box h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
  }

  .detail-box p {
    line-height: 1.6;
    margin-bottom: 1.5rem;
  }

  /* Mobile-specific spacing */
  .section {
    margin-bottom: 3rem;
  }

  /* Mobile-specific overlay improvements */
  .overlay {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.98) 0%, rgba(0, 0, 0, 0.95) 100%);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
  }

  .overlay-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    height: calc(100vh - 120px);
    margin-top: -120px;
    padding-top: 0;
    overflow-y: auto;
  }

  .overlay-content a {
    margin: 0.4rem 0;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 160px;
    max-width: 220px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  }

  .overlay-content a:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  }
}

/* Mobile landscape optimizations */
@media (max-width: 767px) and (orientation: landscape) {
  .slider_section .detail-box h1 {
    font-size: 2rem !important;
  }

  .slider_section .detail-box p {
    font-size: 1rem;
  }

  .overlay-content {
    padding-top: 80px;
    justify-content: flex-start;
  }

  .overlay-content a {
    padding: 0.6rem 1.2rem;
    margin: 0.3rem 0;
    font-size: 0.9rem;
    min-width: 180px;
    max-width: 220px;
  }
}

/* Overlay positioning and styling */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  overflow: hidden;
  transition: all 0.3s ease-in-out;
  opacity: 0;
  visibility: hidden;
}

.overlay.menu_width {
  width: 100%;
  opacity: 1;
  visibility: visible;
}

/* Ensure overlay is visible when menu is open */
.overlay[style*="width: 100%"] {
  opacity: 1 !important;
  visibility: visible !important;
}

.overlay-content {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  height: calc(100vh - 120px);
  margin-top: -120px;
  padding-top: 0;
  opacity: 1;
  visibility: visible;
  overflow-y: auto;
  /* Allow scrolling if needed */
}

.overlay-content a {
  display: block;
  margin: 0.4rem 0;
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff !important;
  text-decoration: none;
  text-align: center;
  min-width: 160px;
  max-width: 220px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  opacity: 1;
  visibility: visible;
}

.overlay-content a:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

/* Ensure navbar stays visible */
.header_section {
  position: relative;
  z-index: 10000;
}

.navbar-brand {
  position: relative;
  z-index: 10001;
  color: #fff !important;
}

.navbar-brand span {
  color: #fff !important;
}

/* Navbar layout improvements */
.custom_nav-container {
  justify-content: space-between;
  align-items: center;
}

.navbar-collapse {
  flex-grow: 0;
}

/* Ensure proper spacing between brand and navigation */
.navbar-brand {
  margin-right: 0;
}

/* Menu button styling - visible on smaller screen sizes */
.custom_menu-btn {
  background: none;
  border: none;
  padding: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: block;
  /* Visible by default */
  position: relative;
  z-index: 10002;
  /* Higher than overlay */
  visibility: visible !important;
  opacity: 1 !important;
}

/* Ensure mobile menu button is always visible on all small screens and split windows */
@media (max-width: 1199px) {

  .custom_menu-btn,
  .navbar-toggler.custom_menu-btn {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Hide desktop navigation */
  .desktop-nav {
    display: none !important;
  }
}

/* Ensure menu button is always visible on smaller screens and split windows */
@media (max-width: 1199px) {
  .custom_menu-btn {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Hide desktop navigation on smaller screens */
  .desktop-nav {
    display: none !important;
  }

  /* Show mobile menu button */
  .navbar-toggler.custom_menu-btn {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

.custom_menu-btn img {
  width: 25px;
  height: 25px;
  filter: brightness(0) invert(1);
  /* Make menu icon white */
}

/* Additional styles for split windows and small desktop views */
@media (max-width: 1199px) {
  .custom_menu-btn {
    position: relative;
    z-index: 10002;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    padding: 8px;
    margin-left: auto;
  }

  .custom_menu-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
  }

  .custom_menu-btn img {
    width: 20px;
    height: 20px;
  }
}

.custom_menu-btn.menu_btn-style {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  transform: scale(1.1);
}

/* Ensure menu button is visible on mobile */
.navbar-toggler.custom_menu-btn {
  visibility: visible !important;
  opacity: 1 !important;
}

/* Override Bootstrap's d-lg-none class for mobile */
@media (max-width: 767px) {
  .navbar-toggler.custom_menu-btn.d-lg-none {
    display: block !important;
  }
}

/* Overlay animation improvements */
.overlay-content {
  opacity: 1 !important;
  transform: translateY(0);
  transition: all 0.4s ease-in-out;
  transition-delay: 0.1s;
  visibility: visible !important;
}

.overlay.menu_width .overlay-content {
  opacity: 1 !important;
  transform: translateY(0);
  visibility: visible !important;
}

/* Ensure overlay content is visible when overlay is open */
.overlay[style*="width: 100%"] .overlay-content {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

/* Mobile performance optimizations */
@media (max-width: 767px) {

  /* Reduce animations on mobile for better performance */
  .box,
  .img-box img,
  .btn {
    will-change: transform;
  }

  /* Optimize mobile touch targets */
  .btn,
  .overlay-content a,
  .navbar-toggler {
    min-height: var(--mobile-button-height);
    min-width: var(--mobile-button-height);
  }

  /* Mobile-specific font loading optimization */
  body {
    font-display: swap;
  }

  /* Mobile overlay specific improvements */
  .overlay {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.98) 0%, rgba(0, 0, 0, 0.95) 100%);
  }

  .overlay-content {
    height: calc(100vh - 120px);
    margin-top: -120px;
    padding-top: 0;
    justify-content: flex-start;
  }

  .overlay-content a {
    margin: 0.5rem 0;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    min-width: 200px;
    max-width: 250px;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.1) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 10px;
  }

  .overlay-content a:hover {
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.2) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  }

  /* Ensure overlay works on all small screens including split windows */
  @media (max-width: 1199px) {
    .overlay {
      z-index: 9999;
      background: linear-gradient(135deg, rgba(0, 0, 0, 0.98) 0%, rgba(0, 0, 0, 0.95) 100%);
    }

    .overlay-content {
      height: calc(100vh - 120px);
      margin-top: -120px;
      padding-top: 0;
      justify-content: flex-start;
    }

    .overlay-content a {
      margin: 0.5rem 0;
      padding: 0.8rem 1.5rem;
      font-size: 1rem;
      min-width: 200px;
      max-width: 250px;
      background: linear-gradient(45deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.1) 100%);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      border-radius: 10px;
    }

    .overlay-content a:hover {
      background: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.2) 100%);
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    }
  }

  /* Ensure menu button is properly sized for mobile */
  .custom_menu-btn {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .custom_menu-btn img {
    width: 20px;
    height: 20px;
  }
}

/* Desktop and tablet overlay improvements */
@media (min-width: 768px) {
  .overlay {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.9) 100%);
  }

  .overlay-content {
    height: calc(100vh - 120px);
    margin-top: -120px;
    padding-top: 0;
    justify-content: flex-start;
    overflow-y: auto;
  }

  .overlay-content a {
    margin: 0.8rem 0;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    min-width: 250px;
    max-width: 300px;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.15) 100%);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 12px;
    font-weight: 600;
  }

  .overlay-content a:hover {
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.3) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  }
}

/* Desktop Navigation Styling - Only show on large screens */
@media (min-width: 1200px) {
  .desktop-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .desktop-nav .nav-link {
    color: #fff !important;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .desktop-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    color: #fff !important;
  }

  .desktop-nav .nav-link.donate-link {
    background: linear-gradient(45deg, #28a745, #20c997);
    border-color: #28a745;
    color: #fff !important;
  }

  .desktop-nav .nav-link.donate-link:hover {
    background: linear-gradient(45deg, #218838, #1ea085);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
  }
}

/* Global heading visibility fixes */
/* Ensure all section headings using heading_container heading_center mb-5 are visible */
.heading_container.heading_center.mb-5 h2,
.heading_container.heading_center.mb-5 h2 span {
  color: #ffe537 !important;
  /* yellow */
}

/* Supporting paragraph under headings should remain readable */
.heading_container.heading_center.mb-5 p {
  color: #000000 !important;
  /* black for contrast on light backgrounds */
}

/* Medium desktop and split windows - show mobile menu button */
@media (min-width: 992px) and (max-width: 1199px) {
  .custom_menu-btn {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Hide desktop navigation on medium screens and split windows */
  .desktop-nav {
    display: none !important;
  }

  /* Ensure mobile menu button is visible */
  .navbar-toggler.custom_menu-btn {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Compact overlay for split views */
  .overlay-content {
    padding-top: 60px;
    justify-content: flex-start;
  }

  .overlay-content a {
    margin: 0.3rem 0;
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
    min-width: 160px;
    max-width: 200px;
    border-radius: 6px;
  }

  .overlay-content a:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
  }
}

/* Large desktop only - hide mobile menu button and show desktop nav */
@media (min-width: 1200px) {
  .custom_menu-btn {
    display: none !important;
  }

  .desktop-nav {
    display: flex !important;
  }
}

/* Split window and small desktop specific styles */
@media (max-width: 1199px) and (min-width: 768px) {
  .navbar-brand span {
    font-size: 1.2rem;
  }

  .custom_menu-btn {
    margin-left: auto;
    margin-right: 0;
  }

  /* Ensure proper spacing in split windows */
  .custom_nav-container {
    padding: 0 15px;
  }
}

/* Very small desktop windows (like split views) */
@media (max-width: 1199px) and (min-width: 992px) {
  .navbar-brand span {
    font-size: 1.1rem;
  }

  .custom_menu-btn {
    padding: 6px;
  }

  .custom_menu-btn img {
    width: 18px;
    height: 18px;
  }

  /* Smaller overlay buttons for split views */
  .overlay-content a {
    margin: 0.4rem 0;
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    min-width: 180px;
    max-width: 220px;
    border-radius: 8px;
  }

  .overlay-content a:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  }
}

/* Explicit active state for mobile overlay links (high specificity) */
.overlay .overlay-content a.active,
.overlay .overlay-content .overlay-link.active {
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.9) 100%) !important;
  border-color: #f4ff00 !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 2px rgba(244, 255, 0, 0.15), 0 6px 18px rgba(0, 0, 0, 0.45) !important;
}

.overlay .overlay-content a.active.donate-link,
.overlay .overlay-content .overlay-link.active.donate-link {
  border-color: #f4ff00 !important;
}

/* Fix for Slider Horizontal Alignment on Mobile (iPhone, Surface Duo, etc.) */
@media (max-width: 991px) {

  .slider_section .slider_container .slick-active .img-box,
  .slider_section .slider_container .slick-active+.slick-active .img-box,
  .slider_section .slider_container .slick-active+.slick-active+.slick-active .img-box,
  .slider_section .slider_container .slick-active+.slick-active+.slick-active+.slick-active .img-box {
    margin-top: 0 !important;
  }
}

/* Dropdown Z-index fix for all screen sizes (mobile and desktop stacking) */
.row:has(.nice-select.open) {
  z-index: 9999 !important;
  position: relative;
}

.col-md-6:has(.nice-select.open),
.col-lg-8:has(.nice-select.open),
.col-12:has(.nice-select.open),
.col-md-4:has(.nice-select.open),
.committee-member-row:has(.nice-select.open) {
  z-index: 100 !important;
  position: relative;
}