/* ============================================================================
   KI-DAY 2026 - Responsive Stylesheet (Mobile-First)
   ============================================================================
   Breakpoints:
   - Mobile:  < 768px (default)
   - Tablet:  >= 768px
   - Desktop: >= 1024px
   - Wide:    >= 1440px
   ============================================================================ */

/* === TABLET (768px+) === */
@media (min-width: 768px) {

  /* Typography */
  html {
    font-size: 17px;
  }

  /* Navigation */
  .navbar__toggle {
    display: none;
  }

  .navbar__menu {
    display: flex;
  }

  .navbar__mobile {
    display: none !important;
  }

  /* Hero */
  .hero {
    padding: var(--spacing-xxl) var(--spacing-lg);
  }

  .hero__meta {
    flex-direction: row;
    justify-content: center;
    gap: var(--spacing-lg);
  }

  .hero__meta-item::after {
    content: "|";
    margin-left: var(--spacing-lg);
    opacity: 0.5;
  }

  .hero__meta-item:last-child::after {
    display: none;
  }

  /* Features Grid */
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Timeline */
  .timeline-item {
    grid-template-columns: 140px 1fr auto;
  }

  /* Speakers Grid */
  .speakers-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Sponsors */
  .sponsors__grid--premium {
    grid-template-columns: repeat(3, 1fr);
  }

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

  /* Form */
  .form {
    padding: var(--spacing-xxl);
  }

  .form__row--two-col {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Footer */
  .footer__links {
    gap: var(--spacing-lg);
  }

  .footer__social {
    gap: var(--spacing-md);
  }
}

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

  /* Typography */
  html {
    font-size: 18px;
  }

  /* Container */
  .container {
    padding: 0 var(--spacing-lg);
  }

  /* Section Spacing */
  .section {
    padding: 6rem 0;
  }

  /* Navigation */
  .navbar__container {
    padding: var(--spacing-md) var(--spacing-lg);
  }

  .navbar__logo img {
    height: 48px;
  }

  .navbar__menu {
    gap: var(--spacing-xl);
  }

  /* Hero */
  .hero {
    padding: var(--spacing-xxl);
  }

  /* Features Grid */
  .features-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .feature-card {
    padding: var(--spacing-xl) var(--spacing-lg);
  }

  /* Timeline */
  .timeline-item {
    padding: var(--spacing-xl);
  }

  /* Speakers Grid */
  .speakers-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Sponsors */
  .sponsors__grid--premium {
    grid-template-columns: repeat(3, 1fr);
  }

  .sponsors__grid--standard {
    grid-template-columns: repeat(5, 1fr);
  }

  /* Form stays at 2 columns max for readability */

  /* Footer */
  .footer {
    padding: var(--spacing-xxl) 0 var(--spacing-xl);
  }

  .footer__container {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: start;
    text-align: left;
    gap: var(--spacing-xl);
  }

  .footer__logo {
    justify-self: start;
  }

  .footer__links {
    justify-content: center;
  }

  .footer__social {
    justify-content: flex-end;
    margin-bottom: 0;
  }

  .footer__copyright {
    grid-column: 1 / -1;
    text-align: center;
    margin-top: var(--spacing-lg);
  }
}

/* === WIDE DESKTOP (1440px+) === */
@media (min-width: 1440px) {

  /* Typography */
  html {
    font-size: 18px;
  }

  /* Section Spacing */
  .section {
    padding: 7rem 0;
  }

  /* Speakers Grid - 4 columns on very wide screens */
  .speakers-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Features - more padding on wide screens */
  .feature-card {
    padding: var(--spacing-xxl);
  }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero__scroll {
    animation: none;
  }
}

/* === PRINT === */
@media print {
  .navbar,
  .hero__scroll,
  .footer__social,
  .btn {
    display: none;
  }

  .section {
    page-break-inside: avoid;
  }

  a {
    text-decoration: underline;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
  }
}

/* === HIGH CONTRAST MODE === */
@media (prefers-contrast: high) {
  :root {
    --border-light: #999;
  }

  .btn--primary,
  .btn--secondary {
    border: 2px solid currentColor;
  }

  .form__input {
    border-width: 3px;
  }
}

/* === DARK MODE SUPPORT (Optional) === */
@media (prefers-color-scheme: dark) {
  /* If dark mode support is needed in future, add variables here */
  /* Currently not implemented as per brand guidelines */
}

/* === LANDSCAPE MOBILE === */
@media (max-width: 767px) and (orientation: landscape) {
  .section--hero {
    min-height: auto;
    padding: var(--spacing-xxl) 0;
  }

  .hero {
    padding: var(--spacing-xl) var(--spacing-md);
  }
}

/* === SMALL MOBILE (< 375px) === */
@media (max-width: 374px) {
  html {
    font-size: 15px;
  }

  .container {
    padding: 0 var(--spacing-sm);
  }

  .navbar__container {
    padding: var(--spacing-sm);
  }

  .hero {
    padding: var(--spacing-xl) var(--spacing-sm);
  }

  .form {
    padding: var(--spacing-lg);
  }

  .btn {
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .sponsors__grid--standard {
    grid-template-columns: 1fr;
  }
}

/* === VERY LARGE SCREENS (> 1920px) === */
@media (min-width: 1920px) {
  .container {
    max-width: 1600px;
  }

  .section {
    padding: 8rem 0;
  }

  /* Limit feature cards to 4 even on ultra-wide */
  .features-grid {
    max-width: 1400px;
    margin: 0 auto;
  }

  /* Speakers can go to 5 columns on ultra-wide */
  .speakers-grid {
    grid-template-columns: repeat(5, 1fr);
    max-width: 1600px;
    margin: 0 auto;
  }
}

/* === ACCESSIBILITY: FOCUS VISIBLE === */
@media (hover: none) {
  /* Touch devices - always show focus */
  a:focus,
  button:focus,
  input:focus,
  textarea:focus,
  select:focus {
    outline: 3px solid var(--brand-primary);
    outline-offset: 2px;
  }
}

/* === HOVER SUPPORT === */
@media (hover: hover) {
  /* Only apply hover effects on devices that support hover */
  .feature-card:hover,
  .speaker-card:hover,
  .sponsor-logo:hover,
  .timeline-item:hover {
    /* Hover effects already defined in main CSS */
  }
}

/* === ORIENTATION CHANGES === */
@media (orientation: portrait) {
  /* Optimizations for portrait mode if needed */
}

@media (orientation: landscape) {
  /* Optimizations for landscape mode if needed */
}

/* === TABLET LANDSCAPE (768px - 1023px) === */
@media (min-width: 768px) and (max-width: 1023px) {
  .speakers-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

/* === IPAD PRO SPECIFIC === */
@media (min-width: 1024px) and (max-width: 1366px) {
  .speakers-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* === MOBILE MENU ANIMATION === */
@media (max-width: 767px) {
  .navbar__mobile {
    animation: slideDown var(--transition-base) ease-out;
  }

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

  /* Stack timeline more compactly on mobile */
  .timeline-item {
    grid-template-columns: 1fr;
    gap: var(--spacing-xs);
  }

  .timeline__time {
    font-size: 0.875rem;
  }

  .timeline__speaker {
    text-align: left;
    font-size: 0.75rem;
  }

  /* Single column sponsors on mobile */
  .sponsors__grid--premium,
  .sponsors__grid--standard {
    grid-template-columns: 1fr;
    max-width: 300px;
    margin: 0 auto var(--spacing-xl);
  }

  /* Adjust sponsor logo sizes for mobile */
  .sponsor-logo--main img {
    max-height: 100px;
  }

  .sponsor-logo--premium img {
    max-height: 70px;
  }

  .sponsor-logo--standard img {
    max-height: 50px;
  }

  /* Full-width buttons on mobile */
  .btn {
    width: 100%;
  }

  /* Adjust form for mobile */
  .form {
    padding: var(--spacing-lg);
  }

  .form__row {
    gap: var(--spacing-sm);
  }
}

/* === SAFE AREA INSETS (iPhone X+) === */
@supports (padding: max(0px)) {
  .navbar__container,
  .container {
    padding-left: max(var(--spacing-md), env(safe-area-inset-left));
    padding-right: max(var(--spacing-md), env(safe-area-inset-right));
  }

  .footer__container {
    padding-bottom: max(var(--spacing-lg), env(safe-area-inset-bottom));
  }
}

/* === CONTAINER QUERIES (Future-proof) === */
@supports (container-type: inline-size) {
  /* Container queries support - for when browser support improves */
  /* Can be used to make components more modular */
}
