/* Responsive Utilities and Breakpoint Adjustments
   Last Updated: 2026-05-09 (Europe/Zurich) */

/* ==========================================================
   Global mobile overflow prevention
   html + body required for iOS Safari
   ========================================================== */
@media (max-width: 1024px) {
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }
}

/* Tablet (Portrait) */
@media (max-width: 1024px) {
    :root {
        --font-size-6xl: 3rem;
        --font-size-5xl: 2.5rem;
        --font-size-4xl: 2rem;
        --space-24: 4rem;
        --space-20: 3.5rem;
    }
}

/* Mobile (Landscape) */
@media (max-width: 768px) {
    :root {
        --font-size-6xl: 2.5rem;
        --font-size-5xl: 2rem;
        --font-size-4xl: 1.75rem;
        --space-24: 3rem;
        --space-20: 2.5rem;
        --space-16: 2rem;
        --container-padding: var(--space-4);
    }
    
    /* Adjust button sizing */
    .btn {
        padding: var(--space-3) var(--space-5);
        font-size: var(--font-size-sm);
    }
    
    .btn-large {
        padding: var(--space-3) var(--space-6);
        font-size: var(--font-size-base);
    }
}

/* Mobile (Small — 640px gap between 768px and 480px) @updated 2026-05-14 */
@media (max-width: 640px) {
    :root {
        --space-24: 2.5rem;   /* 40px — was 3rem/48px at ≤768px */
        --space-20: 2rem;     /* 32px — was 2.5rem/40px at ≤768px */
        --space-16: 1.75rem;  /* 28px — was 2rem/32px at ≤768px */
    }
}

/* Mobile (Portrait) */
@media (max-width: 480px) {
    :root {
        --font-size-6xl: 2rem;
        --font-size-5xl: 1.75rem;
        --font-size-4xl: 1.5rem;
        --space-24: 2.5rem;
        --space-20: 2rem;
        --container-padding: var(--space-3);
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .nav-link,
    .btn,
    .service-link {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch */
    .service-card:hover,
    .btn:hover {
        transform: none;
    }
    
    /* Add active states instead */
    .service-card:active {
        transform: scale(0.98);
    }
    
    .btn:active {
        transform: scale(0.95);
    }
}

/* Footer Legal - responsive handled in components.css */

/* Print Styles */
@media print {
    .site-header,
    .site-footer,
    .mega-menu,
    .mobile-menu-toggle,
    .language-switcher,
    .cta-section {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }
    
    a {
        text-decoration: underline;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-graphic svg {
        animation: none;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --color-primary: #0000ff;
        --color-text: #000000;
        --color-background: #ffffff;
        --color-border: #000000;
    }
    
    .btn-primary {
        border: 2px solid #000;
    }
}

/* Landscape Orientation */
@media (max-height: 600px) and (orientation: landscape) {
    section {
        padding: var(--space-12) 0;
    }
    
    .hero-section {
        padding: var(--space-16) 0;
    }
}

/* Extra Large Screens */
@media (min-width: 1920px) {
    :root {
        --font-size-6xl: 4.5rem;
        --container-width: 1400px;
    }
}

/* Accessibility Utilities */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-primary);
    color: var(--color-white);
    padding: var(--space-3) var(--space-6);
    text-decoration: none;
    z-index: var(--z-tooltip);
}

.skip-to-content:focus {
    top: 0;
}

/* Focus Visible Styles */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}
/* ==========================================================
   Quote page — box-sizing safety
   ========================================================== */
.page-quote .dq-wrap,
.page-quote .dq-wrap * {
  max-width: 100%;
  box-sizing: border-box;
}


/* Auth table — card + bullet list on mobile
   Updated: 2026-03-31 */
@media (max-width: 900px) {
    .auth-table thead { display: none; }
    .auth-table,
    .auth-table tbody,
    .auth-table tr,
    .auth-table td { display: block; width: 100%; }

    .auth-table tr {
        margin-bottom: var(--space-4);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        padding: var(--space-4) var(--space-4) var(--space-4) var(--space-3);
        background: var(--color-white);
    }

    /* Method name → card title */
    .auth-table td:first-child {
        font-weight: 700;
        font-size: var(--font-size-base);
        color: var(--color-secondary);
        padding: 0 0 var(--space-3) 0 !important;
        margin-bottom: var(--space-3);
        border-bottom: 2px solid var(--color-primary);
        text-align: left !important;
        vertical-align: top !important;
    }

    /* Attributes → bullet list */
    .auth-table td:not(:first-child) {
        padding: var(--space-1) 0 !important;
        font-size: var(--font-size-sm);
        line-height: var(--line-height-relaxed);
        border: none !important;
        text-align: left !important;
        vertical-align: top !important;
    }

    .auth-table td:not(:first-child)::before {
        content: "• " attr(data-label) " : ";
        font-weight: 600;
        color: var(--color-secondary);
    }
}