/* Mobile-specific styles for SKweb */

@media (max-width: 900px) {
  /* Hero Section */
  .hero, .split-hero {
    flex-direction: column;
    padding: 0;
    min-height: 90vh;
  }

  .split-left, .split-right {
    flex-basis: 100%;
    width: 100%;
    padding: 2rem 1rem;
    align-items: center;
    text-align: center;
  }

  .split-name {
    text-align: center;
  }

  .split-university {
    text-align: center;
  }

  .split-social {
    align-items: center;
  }

  .split-social-link {
    text-align: center;
  }

  .hero-content, .hero-animation {
    padding: 1rem;
    width: 100%;
  }
  .animation-placeholder {
    width: 180px;
    height: 180px;
  }
  .viz-placeholder {
    width: 220px;
    height: 220px;
  }

  /* Split Sections and Footer */
  .split-section, .split-footer {
     flex-direction: column;
     width: 100%;
  }

  .split-section-left, .split-section-right,
  .split-footer-left, .split-footer-right {
    align-items: center;
    text-align: center;
    padding: 2rem 1rem;
  }

  .publication.journal-layout {
    margin: 2rem auto;
    padding: 0 1rem;
  }

  .pub-authors-institutions {
    flex-direction: column;
    gap: 1rem;
  }
}

@media (max-width: 1024px) {
  body {
    overflow-y: auto !important;
    overflow-x: hidden;
    height: auto !important;
    position: static !important;
  }
  
  html {
    overflow-y: auto !important;
  }
  
  .hero {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }
  
  .split-hero {
    flex-direction: column;
    height: auto;
  }
  
  /* New stacking order controls */
  .split-hero.left-on-top .split-left,
  .split-section.left-on-top .split-left {
    order: 1;
  }
  
  .split-hero.left-on-top .split-right,
  .split-section.left-on-top .split-right {
    order: 2;
  }
  
  .split-hero.right-on-top .split-left,
  .split-section.right-on-top .split-left {
    order: 2;
  }
  
  .split-hero.right-on-top .split-right,
  .split-section.right-on-top .split-right {
    order: 1;
  }
  
  .split-left { 
    min-height: 250px;
    width: 100% !important;
    flex-basis: auto !important;
  }
  
  .research-section .split-left { 
    min-height: 250px;
  }
  
  .split-right {
    width: 100% !important;
    flex-basis: auto !important;
    padding: 1.5rem;
    min-height: 60vh;
  }
  
  /* .bio-layer styling for mobile is handled by a later rule (around line 114) */
  
  .bio-layer.visible {
    opacity: 1;
    transform: translateY(0);
  }
  
  .mobile-hero .bio-contact-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .mobile-hero .bio-social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
  }
  
  .mobile-hero .bio-social-link {
    margin-right: 0;
  }
  
  .mobile-hero .bio-snapshot {
    flex-direction: column;
  }
  
  .mobile-hero .bio-snapshot-col {
    width: 100%;
    margin-bottom: 1.5rem;
  }
  
  .mobile-hero .bio-pub-item {
    grid-template-columns: 60px 1fr;
    margin-bottom: 1.2rem;
  }
  
  /* Adjust spacing for mobile */
  .bio-section-title {
    margin-top: 1.5rem;
  }
  
  /* Make sure ALL bio layers follow the animation on mobile */
  .bio-layer {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
  }
  
  /* Include bio-profile in the animation */
  .bio-profile {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
  }
  
  .bio-profile.visible {
    opacity: 1;
    transform: translateY(0);
  }
  
  /* Hide hero-spacer on small screens to remove extra space */
  .hero-spacer {
    display: none;
  }

  /* Publication highlight animation for mobile */
  .publication.highlighted .pub-journal,
  .publication.highlighted .pub-abstract-label {
    color: color-mix(in srgb, #222831 calc((1 - var(--highlight-intensity, 1)) * 100%), #00ADB5);
    transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }
}
