/* ==========================================================================
   RESPONSIVE DESIGN BREAKPOINTS
   ========================================================================== */

/* --------------------------------------------------------------------------
   Large Tablets & Laptops (Max Width: 1024px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 1024px) {
  .container {
    padding: 0 20px;
  }

  .section-padding {
    padding: 40px 0 30px;
  }

  /* Bento Grid adjustments */
  .bento-grid {
    gap: 20px;
  }

  .span-8,
  .span-7,
  .span-6,
  .span-5 {
    grid-column: span 12;
  }

  .span-4 {
    grid-column: span 6;
  }

  .span-3 {
    grid-column: span 6;
  }

  /* Hero adjustments */
  .hero-intro h1 {
    font-size: 2.8rem;
  }

  /* Footer column resizing */
  .footer-col-about {
    grid-column: span 6;
  }

  .footer-col-links {
    grid-column: span 6;
    padding-left: 0;
  }

  .footer-col-contact {
    grid-column: span 12;
    margin-top: 20px;
  }

  /* Trustee Grid adjustments */
  .trustee-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  /* Gallery Bento Masonry Grid adjustments */
  .gallery-grid .span-8,
  .gallery-grid .span-4,
  .gallery-grid .span-6 {
    grid-column: span 6;
  }
}

/* --------------------------------------------------------------------------
   Medium Tablets & Small Laptops (Max Width: 992px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 992px) {
  /* Navbar Collapse to mobile drawer */
  .menu-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 90px;
    left: -100%;
    width: calc(100% - 40px);
    margin: 0 20px;
    height: auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-lg);
    flex-direction: column;
    align-items: stretch;
    padding: 30px;
    gap: 20px;
    box-shadow: var(--shadow-lg);
    transition: var(--transition-smooth);
    z-index: 999;
  }

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

  .nav-link {
    font-size: 1.1rem;
    padding: 10px 0;
    display: block;
    border-bottom: 1px solid rgba(13, 59, 102, 0.05);
  }

  .nav-link::after {
    display: none;
  }

  .nav-cta {
    margin-left: 0;
    margin-top: 10px;
  }

  .nav-cta .btn {
    width: 100%;
  }

  /* Reduce top margins to eliminate large white gaps above banners on mobile/tablet */
  .hero-wrapper {
    margin-top: 90px !important;
  }

  .page-header-section {
    margin-top: 90px !important;
  }
}

/* --------------------------------------------------------------------------
   Intermediate Desktop Viewports (993px to 1200px)
   -------------------------------------------------------------------------- */
@media screen and (min-width: 993px) and (max-width: 1200px) {
  .navbar {
    padding: 12px 20px;
  }
  .logo-wrapper {
    gap: 10px;
  }
  .logo-img {
    height: 42px;
  }
  .logo-title {
    font-size: 1rem;
  }
  .logo-subtitle {
    font-size: 0.6rem;
  }
  .nav-menu {
    gap: 16px;
  }
  .nav-link {
    font-size: 0.9rem;
    padding: 6px 10px;
  }
  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }
}

/* --------------------------------------------------------------------------
   Small Tablets (Max Width: 768px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 768px) {
  /* Bento Grid vertical stacking */
  .bento-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  /* Hero Carousel Card tweaks on mobile */
  .hero-carousel-card {
    height: auto !important;
  }

  .carousel-slide {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 0 !important;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    padding: 0 !important;
    transition: opacity 0.8s ease-in-out;
  }

  .carousel-slide.active {
    position: relative !important;
    height: auto !important;
    opacity: 1;
    overflow: visible;
    pointer-events: auto;
    padding: 35px 20px 65px !important; /* bottom padding to leave space for dots */
  }

  /* Page Banner container tweaks on mobile */
  .page-banner {
    padding: 35px 20px !important;
  }

  .carousel-content h1 {
    font-size: 2.2rem !important;
    margin-bottom: 16px;
  }

  .carousel-content p {
    font-size: 1rem;
    margin-bottom: 24px;
  }

  .carousel-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .carousel-actions .btn {
    margin-left: 0 !important;
    width: 100%;
    text-align: center;
  }

  .carousel-control {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .carousel-control.prev {
    left: 12px;
  }

  .carousel-control.next {
    right: 12px;
  }

  .span-8,
  .span-7,
  .span-6,
  .span-5,
  .span-4,
  .span-3 {
    grid-column: span 12;
  }

  /* Gallery structural collapse */
  .gallery-grid .span-8,
  .gallery-grid .span-4,
  .gallery-grid .span-6 {
    grid-column: span 12;
  }

  .height-2,
  .height-3 {
    height: 320px;
  }

  /* Stats grid collapse */
  .stat-number {
    font-size: 2.2rem;
  }

  /* About Us page details */
  .values-list {
    grid-template-columns: 1fr;
  }

  /* Trustee Grid collapse */
  .trustee-grid {
    grid-template-columns: 1fr;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Donation Page styling */
  .amount-selector {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .form-group.col-span-2 {
    grid-column: span 1;
  }

  /* Contact Page styling */
  .contact-info-list {
    gap: 20px;
  }

  /* Footer layout vertical stacking */
  .footer-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
  }

  /* Footer bottom adjustments */
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 15px;
  }

  /* Services Page Modal Tweak */
  .services-modal-content {
    padding: 30px;
  }
  .modal-service-title {
    font-size: 1.6rem;
  }
}

/* --------------------------------------------------------------------------
   Extra Small Mobile Devices (Max Width: 480px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 480px) {
  .section-title {
    font-size: 1.8rem;
  }

  .bento-card,
  .contact-form-card {
    padding: 20px;
  }

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

  .amount-btn {
    padding: 10px;
    font-size: 1rem;
  }

  .custom-amount-input {
    padding: 12px 16px 12px 35px;
    font-size: 1.1rem;
  }

  /* Header layout tweaks for mobile */
  .header {
    top: 10px;
  }

  .header-container {
    padding: 0 10px;
  }

  .navbar {
    padding: 10px 14px;
  }

  .logo-wrapper {
    gap: 8px;
  }

  .logo-img {
    height: 36px;
  }

  .logo-title {
    font-size: 0.85rem;
    letter-spacing: 0;
  }

  .logo-subtitle {
    font-size: 0.55rem;
    letter-spacing: 0.5px;
  }

  .menu-toggle {
    padding: 4px;
    gap: 5px;
  }

  .menu-toggle span {
    width: 24px;
    height: 2px;
  }

  /* Navigation drawer spacing adjustments */
  .nav-menu {
    top: 70px;
    width: calc(100% - 20px);
    margin: 0 10px;
    padding: 20px;
  }

  .footer-col-about,
  .footer-col-links,
  .footer-col-contact {
    grid-column: span 12;
  }

  /* Services Page Mobile Tweaks */
  .services-modal-content {
    padding: 20px 24px;
  }
  .modal-service-title {
    font-size: 1.4rem;
  }
  .modal-details-grid {
    grid-template-columns: 1fr;
    gap: 15px;
    padding: 15px;
  }
  .modal-actions .btn {
    width: 100%;
  }
}
@media (max-width: 375px) {
  .highlight-tag {
    font-size: 10px;
    white-space: nowrap;
  }
}

/* Defensive scale rule for ultra-narrow mobile viewports (320px - 340px) */
@media screen and (max-width: 340px) {
  .navbar {
    padding: 8px 10px;
  }

  .logo-img {
    height: 30px;
  }

  .logo-title {
    font-size: 0.75rem;
  }

  .logo-subtitle {
    font-size: 0.5rem;
  }

  .menu-toggle span {
    width: 20px;
  }
}

/* Custom mobile overrides for Latest Highlights & Bento Cards */
@media screen and (max-width: 576px) {
  .bento-card {
    padding: 20px !important;
  }
  
  .highlight-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .highlight-list {
    padding-left: 20px;
    gap: 20px;
  }

  .highlight-item::before {
    left: -20px;
  }
}

/* Responsive styles for Vision & Mission Section */
@media screen and (max-width: 992px) {
  .vision-mission-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media screen and (max-width: 576px) {
  .vision-mission-section {
    padding: 50px 0;
  }

  .vision-mission-card {
    flex-direction: column;
    gap: 16px;
    padding: 24px;
  }
}
