/* ============================================================
   VICTORIA HOSPITAL BLOOD BANK
   responsive.css — Mobile-First Responsive Design
   ============================================================ */

/* ============================================================
   BREAKPOINTS:
   xs: < 480px (small phones)
   sm: 480px+
   md: 768px+ (tablets)
   lg: 1024px+ (laptops)
   xl: 1280px+ (desktop)
   ============================================================ */

/* === MOBILE FIRST BASE (applies to all) === */

/* Container padding on small screens */
@media (max-width: 479px) {
  .container {
    padding-inline: var(--sp-4);
  }

  .section {
    padding-block: var(--sp-12);
  }

  .section--lg {
    padding-block: var(--sp-16);
  }

  .section-title {
    font-size: var(--text-3xl);
  }

  .section-header {
    margin-bottom: var(--sp-10);
  }
}

/* === TABLET & BELOW (max 1023px) === */
@media (max-width: 1023px) {

  /* Header */
  .nav,
  .header__actions .btn {
    display: none;
  }

  .mobile-toggle {
    display: flex;
  }

  .mobile-menu {
    display: block;
  }

  .header__logo img {
    height: 40px;
    width: 40px;
    aspect-ratio: 1 / 1;
  }

  /* Services grid */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* About grid */
  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-10);
  }

  .about-grid > :first-child {
    order: 2;
  }

  .about-grid > :last-child {
    order: 1;
  }

  /* Location grid */
  .location-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-10);
  }

  .location-map {
    aspect-ratio: 16/9;
  }

  /* Footer grid */
  .footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-10);
  }

  /* Contact grid */
  .contact-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin-inline: auto;
  }

  /* Stats strip */
  .stats-strip {
    grid-template-columns: repeat(2, 1fr);
    padding: var(--sp-6);
    gap: var(--sp-4);
  }

  .stat-item + .stat-item {
    border-inline-start: none;
  }

  .stat-item:nth-child(odd) + .stat-item:nth-child(even) {
    border-inline-start: 1px solid var(--clr-gray-200);
  }

  /* Team grid */
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Service page */
  .service-page-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-10);
  }

  .service-page-grid > :first-child { order: 2; }
  .service-page-grid > :last-child { order: 1; }

  /* Related services */
  .related-services {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Hero */
  .hero__title {
    font-size: clamp(var(--text-3xl), 7vw, var(--text-5xl));
  }

  .hero__subtitle {
    font-size: var(--text-lg);
  }
}

/* === MOBILE ONLY (max 767px) === */
@media (max-width: 767px) {

  /* Services grid */
  .services-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin-inline: auto;
  }

  /* Stats strip */
  .stats-strip {
    grid-template-columns: repeat(2, 1fr);
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    border-top: 1px solid var(--clr-gray-200);
  }

  /* About features */
  .about-features {
    grid-template-columns: 1fr;
  }

  /* Team grid */
  .team-grid {
    grid-template-columns: 1fr;
    max-width: 360px;
    margin-inline: auto;
  }

  /* Footer grid */
  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--sp-8);
  }

  /* Hero actions */
  .hero__actions {
    flex-direction: column;
    align-items: flex-start;
  }

  [dir="rtl"] .hero__actions {
    align-items: flex-start;
  }

  .hero__actions .btn {
    width: 100%;
    justify-content: center;
    max-width: 320px;
  }

  /* Service features grid */
  .service-features-grid {
    grid-template-columns: 1fr;
  }

  /* Related services */
  .related-services {
    grid-template-columns: 1fr;
    max-width: 360px;
    margin-inline: auto;
  }

  /* CTA actions */
  .cta-section .cta-actions {
    flex-direction: column;
    align-items: center;
  }

  .cta-section .cta-actions .btn {
    width: 100%;
    max-width: 320px;
    justify-content: center;
  }

  /* Contact buttons */
  .contact-card .btn {
    width: 100%;
    justify-content: center;
  }

  /* Page hero */
  .page-hero {
    padding-block: var(--sp-16) var(--sp-12);
  }

  /* WhatsApp float */
  .whatsapp-float {
    width: 50px;
    height: 50px;
    bottom: var(--sp-4);
  }

  [dir="rtl"] .whatsapp-float { left: var(--sp-4); }
  [dir="ltr"] .whatsapp-float { right: var(--sp-4); }

  

  [dir="rtl"] 
  [dir="ltr"] 
}

/* === SMALL PHONES (max 479px) === */
@media (max-width: 479px) {

  /* Header */
  :root {
    --header-h: var(--header-h-mob);
  }

  .header__logo img {
    height: 36px;
    width: 36px;
    aspect-ratio: 1 / 1;
  }

  /* Hero */
  .hero {
    min-height: 100svh;
  }

  .hero__container {
    padding-block: var(--sp-16) var(--sp-20);
  }

  .hero__badge {
    font-size: var(--text-xs);
  }

  .hero__subtitle {
    font-size: var(--text-base);
  }

  /* Section headers */
  .section-subtitle {
    font-size: var(--text-base);
  }

  /* Mobile menu */
  .mobile-menu {
    padding: var(--sp-4);
  }

  /* Stats */
  .stat-item__number {
    font-size: var(--text-3xl);
  }

  /* Footer */
  .footer__bottom {
    flex-direction: column;
    text-align: center;
  }

  /* Buttons on very small screens */
  .btn--xl {
    padding: var(--sp-4) var(--sp-8);
    font-size: var(--text-base);
  }
}

/* === DESKTOP ONLY (min 1024px) === */
@media (min-width: 1024px) {

  /* Show desktop nav */
  .mobile-toggle,
  .mobile-menu {
    display: none !important;
  }

  /* Contact grid - 3 columns */
  .contact-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Hero content max-width */
  .hero__content {
    max-width: 65%;
  }
}

/* === RTL-SPECIFIC ADJUSTMENTS === */
[dir="rtl"] {

  /* Flip chevron arrows */
  .nav__dropdown-item::after {
    transform: scaleX(-1);
  }

  /* Flip breadcrumb separator */
  .breadcrumb__sep {
    transform: scaleX(-1);
    display: inline-block;
  }

  /* Footer nav arrow */
  .footer__nav-link::before {
    content: '‹';
  }

  /* About section feature border */
  .about-feature {
    border-inline-start: 3px solid var(--clr-red);
    border-inline-end: none;
  }
}

/* === PRINT STYLES === */
@media print {
  .header,
  .mobile-toggle,
  .mobile-menu,
  .whatsapp-float,
    .hero__scroll,
  footer {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: #000;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }
}

/* === HIGH CONTRAST / ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .fade-in {
    opacity: 1;
    transform: none;
  }

  html {
    scroll-behavior: auto;
  }
}

/* Focus styles for accessibility */
:focus-visible {
  outline: 3px solid var(--clr-navy);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* Smooth image loading */
img {
  background: var(--clr-gray-100);
}
