/**
 * @file
 * LINCS Theme - Responsive Styles
 * 
 * Stili responsive e media queries.
 */

/* ========================================
   BREAKPOINTS
   - sm: 640px
   - md: 768px
   - lg: 1024px
   - xl: 1280px
   - 2xl: 1536px
   ======================================== */

/* ========================================
   MOBILE FIRST BASE
   ======================================== */

/* Default styles are mobile-first */

/* ========================================
   SMALL SCREENS (sm: 640px+)
   ======================================== */

@media (min-width: 640px) {
  .container {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
  
  .sm\\:hidden {
    display: none;
  }
  
  .sm\\:block {
    display: block;
  }
  
  .sm\\:flex {
    display: flex;
  }
  
  .sm\\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========================================
   MEDIUM SCREENS (md: 768px+)
   ======================================== */

@media (min-width: 768px) {
  .md\\:hidden {
    display: none;
  }
  
  .md\\:block {
    display: block;
  }
  
  .md\\:flex {
    display: flex;
  }
  
  .md\\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .md\\:grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .footer-bottom__content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* ========================================
   LARGE SCREENS (lg: 1024px+)
   ======================================== */

@media (min-width: 1024px) {
  .container {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }
  
  .lg\\:hidden {
    display: none;
  }
  
  .lg\\:block {
    display: block;
  }
  
  .lg\\:flex {
    display: flex;
  }
  
  .lg\\:grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .lg\\:grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .lg\\:grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .lg\\:col-span-2 {
    grid-column: span 2;
  }
  
  .main-content--with-sidebar {
    grid-template-columns: 1fr 300px;
  }
  
  .main-content--with-sidebar-left {
    grid-template-columns: 300px 1fr;
  }
  
  .main-content--with-both-sidebars {
    grid-template-columns: 260px 1fr 260px;
  }
  
  .footer__content {
    grid-template-columns: 2fr repeat(3, 1fr);
  }
  
  .funding-banner__content {
    flex-direction: row;
    align-items: center;
  }
  
  .funding-banner__divider {
    display: block;
  }
  
  .map-grid {
    grid-template-columns: 2fr 1fr;
  }
  
  .map-wrapper {
    height: 600px;
  }
  
  .map-sidebar__list {
    max-height: 500px;
  }
}

/* ========================================
   EXTRA LARGE SCREENS (xl: 1280px+)
   ======================================== */

@media (min-width: 1280px) {
  .xl\\:hidden {
    display: none;
  }
  
  .xl\\:block {
    display: block;
  }
  
  .xl\\:flex {
    display: flex;
  }
}

/* ========================================
   2XL SCREENS (2xl: 1536px+)
   ======================================== */

@media (min-width: 1536px) {
  .container {
    max-width: 1440px;
  }
}

/* ========================================
   MOBILE SPECIFIC (< 768px)
   ======================================== */

@media (max-width: 767px) {
  .section {
    padding: var(--space-12) 0;
  }
  
  .hero__title {
    font-size: 2rem;
  }
  
  .hero__subtitle {
    font-size: 1.25rem;
  }
  
  .card__title {
    font-size: var(--font-size-lg);
  }
  
  .node__title {
    font-size: 1.5rem;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .form-actions .btn {
    width: 100%;
  }
  
  .pager {
    flex-wrap: wrap;
  }
  
  .map-wrapper {
    height: 300px;
  }
  
  .map-controls {
    flex-direction: row;
    top: auto;
    bottom: var(--space-4);
  }
  
  .map-legend {
    display: none;
  }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
  .header,
  .footer,
  .sidebar,
  .pager,
  .tabs,
  .btn,
  .mobile-nav-toggle {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
  }
  
  .container {
    max-width: none;
    padding: 0;
  }
  
  .node__content {
    max-width: none;
  }
  
  a {
    color: #000;
    text-decoration: underline;
  }
  
  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 0.8em;
    word-break: break-all;
  }
  
  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }
  
  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
  }
  
  p, blockquote, ul, ol, dl, table, pre {
    page-break-inside: avoid;
  }
}

/* ========================================
   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;
  }
  
  .card:hover,
  .btn:hover {
    transform: none !important;
  }
}

/* ========================================
   HIGH CONTRAST MODE
   ======================================== */

@media (prefers-contrast: high) {
  :root {
    --text-primary: #000;
    --text-secondary: #333;
    --border-light: #666;
    --border-medium: #333;
  }
  
  .btn--primary {
    border: 2px solid #000;
  }
  
  .card {
    border: 2px solid #000;
  }
}
