/* =================================================================
   HMS Frontend — RESPONSIVE
   - All width-based media queries
   ================================================================= */

/* 1200 ↓ */
@media (max-width:1200px) {
  .hero__grid {
    grid-template-columns: 1fr !important;
    gap: var(--space-5);
  }

  .hero__content {
    max-width: 780px;
  }

  .hero__media .media-frame {
    height: clamp(260px, 48vw, 380px);
  }
}

/* 1024 ↓ */
@media (max-width:1024px) {
  .hero__media {
    display: none;
  }

  .nav__toggle {
    display: inline-block;
  }

  .nav__list {
    position: fixed;
    inset: 64px 0 auto 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: grid;
    gap: var(--space-4);
    padding: var(--space-6) var(--gutter);
    transform-origin: top;
    transform: scaleY(0);
    opacity: 0;
    pointer-events: none;
  }

  .nav__list.is-open {
    transform: scaleY(1);
    opacity: 1;
    pointer-events: auto;
  }

  .kpis {
    grid-template-columns: 1fr 1fr;
  }

  .logo-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .form__grid {
    grid-template-columns: 1fr;
  }

  .footer__grid {
    grid-template-columns: 1fr;
  }
}

/* 640 ↓ */
@media (max-width:640px) {
  .hero__title {
    line-height: 1.1;
  }

  /* .hero__media .media-frame{ height:260px; } */
  .hero__media {
    display: none;
  }

  .hero__tagline {
    grid-template-columns: 1fr
  }

  .hero__tagline span {
    justify-content: center;
    text-align: left;
  }

  .header__cta {
    display: none !important;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .section-header {
    border-radius: 12px;
  }

  .section-title::after {
    width: 72px;
  }

  .hero__actions {
    justify-content: center;

  }

}

/* mobile nav bar */
/* ==============================
   Mobile nav — Professional Themed Drawer (Navy)
   ============================== */
@media (max-width: 1024px) {

  /* Toggle (Clean) */
  .nav__toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 44px; /* Larger touch target */
    height: 44px;
    padding: 0;
    border-radius: 8px; /* Slightly squarer modern look */
    border: 1px solid var(--border);
    background: #fff;
    color: var(--brand-primary); /* Navy Icon */
  }

  .nav__toggle-bar {
    display: none;
  }

  .nav__toggle i {
    font-size: 1.25rem;
    line-height: 1;
  }

  /* Panel position — Clean dropdown */
  .nav__list {
    display: none;
    position: fixed;
    /* Full width dropdown style, or floating card? User said "professional" 
       Floating card is more modern SaaS. */
    left: 1rem;
    right: 1rem;
    top: calc(var(--header-h) + 1rem); 
    z-index: 100;

    /* Theme: Navy "Dark Mode" feel */
    background: var(--brand-primary);
    padding: 1rem 0;
    border-radius: 12px;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.3);
    border: 1px solid color-mix(in srgb, var(--brand-primary) 85%, white);
    
    transform-origin: top center;
    animation: navSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes navSlideDown {
    from { opacity: 0; transform: scaleY(0.95) translateY(-10px); }
    to { opacity: 1; transform: scaleY(1) translateY(0); }
  }

  /* Open when toggle expanded */
  .nav__toggle[aria-expanded="true"] + .nav__list {
    display: block;
  }

  /* Backdrop */
  .nav__list::before {
    content: ""; /* We use this for the overlay usually */
    position: fixed;
    inset: -100vh -100vw;
    z-index: -1;
    background: rgba(0,0,0,0.2);
    backdrop-filter: blur(2px);
    pointer-events: none; /* Let clicks pass through if clicking outside */
  }

  /* List Items */
  .nav__list li {
    margin: 0;
    list-style: none;
    display: block;
  }

  /* Dividers - Subtle dark lines */
  .nav__list li + li {
    border-top: 1px solid rgba(255,255,255,0.06);
  }

  /* Links */
  .nav__list a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Space out content and arrow */
    width: 100%;
    min-height: 52px; /* Generous touch target */
    padding: 0 1.5rem;
    
    color: rgba(255,255,255,0.9); /* High contrast white text */
    font-weight: 500;
    font-size: 1.05rem;
    text-decoration: none;
    transition: all 0.2s ease;
  }

  /* Chevron (Right side now) */
  .nav__list a::after {
    content: "›"; /* Simple, clean glyph */
    font-family: system-ui, sans-serif;
    font-size: 1.5rem;
    line-height: 1;
    font-weight: 300;
    color: rgba(255,255,255,0.3);
    margin-bottom: 0.2rem; /* Optical align */
    transition: transform 0.2s ease, color 0.2s ease;
  }
  
  /* Remove old Left Chevron */
  .nav__list a::before {
    content: none !important;
  }

  /* Hover state */
  @media (hover:hover) {
    .nav__list a:hover {
      background: rgba(255,255,255,0.04);
      color: white;
    }
    .nav__list a:hover::after {
      color: white;
      transform: translateX(3px);
    }
  }

  /* Active/Current settings */
  .nav__list a.is-active,
  .nav__list a[aria-current="page"] {
    background: rgba(255,255,255,0.06); /* Subtle highlight block */
    color: var(--brand-accent); /* Orange text for active */
    font-weight: 600;
  }

  .nav__list a.is-active::after,
  .nav__list a[aria-current="page"]::after {
    color: var(--brand-accent);
    opacity: 1;
  }
}

/* Header spacing on mobile */
@media (max-width:1024px) {
    .header__row {
        justify-content: space-between;
    }
}