/**
 * ============================================================================
 * RESPONSIVE - FRANCE TRAVAIL PARTENAIRES
 * ============================================================================
 * Adaptations pour tablettes et mobiles
 */

/* ============================================================================
   BREAKPOINTS:
   - Mobile: < 640px
   - Tablet: 640px - 1023px
   - Desktop: >= 1024px
   - Large Desktop: >= 1280px
   ============================================================================ */

/* ============================================================================
   1. LARGE DESKTOP (1280px et plus)
   ============================================================================ */

@media (min-width: 1280px) {
    .container {
        padding-left: var(--space-8);
        padding-right: var(--space-8);
    }
}

/* ============================================================================
   2. DESKTOP (1024px à 1279px)
   ============================================================================ */

@media (max-width: 1279px) {
    .footer-main {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-brand {
        grid-column: span 2;
        margin-bottom: var(--space-4);
    }
}

/* ============================================================================
   3. TABLET (640px à 1023px)
   ============================================================================ */

@media (max-width: 1023px) {
    /* Typography adjustments */
    h1, .hero-title {
        font-size: var(--text-3xl);
    }
    
    h2 {
        font-size: var(--text-2xl);
    }
    
    h3 {
        font-size: var(--text-xl);
    }
    
    /* Header */
    .header-quick-links {
        display: none;
    }
    
    .nav-toggle {
        display: block;
    }
    
    .nav-main {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        flex-direction: column;
        background-color: var(--ft-bleu-france);
        padding: var(--space-16) var(--space-6) var(--space-6);
        transform: translateX(-100%);
        transition: transform var(--transition-base);
        overflow-y: auto;
        z-index: var(--z-fixed);
    }
    
    .nav-main.is-open {
        transform: translateX(0);
    }
    
    .nav-main-link {
        padding: var(--space-4);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background-color: rgba(0, 0, 0, 0.1);
        border-radius: var(--radius-md);
        margin: var(--space-2) 0;
    }
    
    .nav-dropdown-link {
        color: var(--white);
    }
    
    .nav-dropdown-link:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: var(--white);
    }
    
    .nav-connect {
        margin-left: 0;
        margin-top: var(--space-6);
    }
    
    .btn-connect {
        width: 100%;
        justify-content: center;
    }
    
    /* Hero */
    .hero {
        padding: var(--space-10) 0;
    }
    
    .hero-image {
        display: none;
    }
    
    .hero-subtitle {
        font-size: var(--text-lg);
    }
    
    /* Orientation cards */
    .orientation-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .orientation-card:last-child {
        grid-column: span 2;
        max-width: 50%;
        margin: 0 auto;
    }
    
    /* Needs grid */
    .needs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Sidebar layout */
    .page-with-sidebar {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        padding: var(--space-4);
        background-color: var(--grey-50);
        border-radius: var(--radius-lg);
        margin-bottom: var(--space-6);
    }
    
    .sidebar-sticky {
        position: static;
    }
    
    .sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-2);
    }
    
    .sidebar-nav-section {
        margin-bottom: 0;
    }
    
    .sidebar-nav-link {
        border-left: none;
        border-radius: var(--radius-full);
        padding: var(--space-2) var(--space-4);
    }
    
    .sidebar-nav-link.is-active {
        background-color: var(--ft-bleu-france);
        color: var(--white);
    }
    
    /* Footer */
    .footer-main {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    
    .footer-brand {
        grid-column: span 1;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }
    
    .footer-legal {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* Cards horizontal */
    .card-horizontal {
        flex-direction: column;
    }
    
    .card-horizontal .card-image {
        flex: none;
        max-width: none;
        height: 200px;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================================================
   4. MOBILE (moins de 640px)
   ============================================================================ */

@media (max-width: 639px) {
    /* Base */
    body {
        font-size: var(--text-sm);
    }
    
    .container {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }
    
    /* Typography */
    h1, .hero-title {
        font-size: var(--text-2xl);
    }
    
    h2 {
        font-size: var(--text-xl);
    }
    
    h3 {
        font-size: var(--text-lg);
    }
    
    /* Buttons */
    .btn {
        padding: var(--space-3) var(--space-4);
        font-size: var(--text-sm);
    }
    
    .btn-lg {
        padding: var(--space-3) var(--space-6);
        font-size: var(--text-base);
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .hero-actions .btn {
        width: 100%;
    }
    
    /* Header */
    .header-logo-text {
        display: none;
    }
    
    .header-logo-separator {
        display: none;
    }
    
    .header-logo-rf {
        height: 40px;
    }
    
    .header-logo-ft {
        height: 32px;
    }
    
    /* Hero */
    .hero {
        padding: var(--space-8) 0;
    }
    
    .hero-subtitle {
        font-size: var(--text-base);
    }
    
    /* Orientation */
    .orientation-section {
        padding: var(--space-10) 0;
    }
    
    .orientation-question {
        font-size: var(--text-2xl);
    }
    
    .orientation-cards {
        grid-template-columns: 1fr;
    }
    
    .orientation-card:last-child {
        grid-column: span 1;
        max-width: none;
    }
    
    .orientation-card {
        padding: var(--space-6);
    }
    
    .orientation-card-icon {
        width: 64px;
        height: 64px;
    }
    
    /* Needs */
    .needs-section {
        padding: var(--space-8) 0;
    }
    
    .needs-grid {
        grid-template-columns: 1fr;
    }
    
    /* Solutions */
    .solutions-section {
        padding: var(--space-8) 0;
    }
    
    .solutions-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-4);
    }
    
    .solutions-grid {
        grid-template-columns: 1fr;
    }
    
    /* Cards */
    .card-body {
        padding: var(--space-4);
    }
    
    .card-header,
    .card-footer {
        padding: var(--space-3) var(--space-4);
    }
    
    /* Need card */
    .need-card {
        padding: var(--space-4);
    }
    
    .need-card-header {
        flex-direction: column;
        gap: var(--space-3);
    }
    
    /* Steps */
    .steps {
        flex-direction: column;
        gap: var(--space-4);
    }
    
    .step:not(:last-child)::after {
        display: none;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    /* API catalog */
    .api-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }
    
    .api-item-info {
        flex-wrap: wrap;
    }
    
    /* Tabs */
    .tabs-list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .tabs-list::-webkit-scrollbar {
        display: none;
    }
    
    .tabs-link {
        white-space: nowrap;
        padding: var(--space-3);
        font-size: var(--text-sm);
    }
    
    /* Modal */
    .modal {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header {
        padding: var(--space-3) var(--space-4);
    }
    
    .modal-body {
        padding: var(--space-4);
    }
    
    .modal-footer {
        padding: var(--space-3) var(--space-4);
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* Accordion */
    .accordion-button {
        padding: var(--space-3) var(--space-4);
        font-size: var(--text-sm);
    }
    
    .accordion-body {
        padding: 0 var(--space-4) var(--space-4);
    }
    
    /* Breadcrumb */
    .breadcrumb {
        font-size: var(--text-xs);
    }
    
    /* CTA Banner */
    .cta-banner {
        padding: var(--space-6);
    }
    
    .cta-banner-title {
        font-size: var(--text-xl);
    }
    
    .cta-banner-text {
        font-size: var(--text-base);
    }
    
    /* Help box */
    .help-box {
        padding: var(--space-4);
    }
    
    /* Steps guide */
    .steps-guide {
        padding: var(--space-4);
    }
    
    .step-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }
    
    /* Page header */
    .need-page-header {
        padding: var(--space-6) 0;
    }
    
    .need-page-title {
        font-size: var(--text-2xl);
    }
    
    .need-page-intro {
        font-size: var(--text-base);
    }
    
    /* Divider text */
    .divider-text {
        font-size: var(--text-xs);
    }
}

/* ============================================================================
   5. SMALL MOBILE (moins de 375px)
   ============================================================================ */

@media (max-width: 374px) {
    .container {
        padding-left: var(--space-3);
        padding-right: var(--space-3);
    }
    
    .hero {
        padding: var(--space-6) 0;
    }
    
    .hero-title {
        font-size: var(--text-xl);
    }
    
    .orientation-card {
        padding: var(--space-4);
    }
    
    .orientation-card-icon {
        width: 48px;
        height: 48px;
    }
    
    .btn {
        padding: var(--space-2) var(--space-3);
    }
}

/* ============================================================================
   6. UTILITAIRES RESPONSIVE
   ============================================================================ */

/* Hide/Show utilities */
@media (max-width: 639px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    .hide-tablet {
        display: none !important;
    }
}

@media (min-width: 1024px) {
    .hide-desktop {
        display: none !important;
    }
}

@media (max-width: 1023px) {
    .show-desktop-only {
        display: none !important;
    }
}

@media (min-width: 640px) {
    .show-mobile-only {
        display: none !important;
    }
}

/* Grid responsive */
@media (min-width: 640px) {
    .sm\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .sm\:flex-row {
        flex-direction: row;
    }
}

@media (min-width: 1024px) {
    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    
    .md\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Text alignment responsive */
@media (max-width: 639px) {
    .mobile\:text-center {
        text-align: center;
    }
}

/* Spacing responsive */
@media (max-width: 639px) {
    .mobile\:mb-4 {
        margin-bottom: var(--space-4);
    }
    
    .mobile\:py-6 {
        padding-top: var(--space-6);
        padding-bottom: var(--space-6);
    }
}

/* ============================================================================
   7. PRINT STYLES
   ============================================================================ */

@media print {
    /* Hide navigation and interactive elements */
    .site-header,
    .site-footer,
    .nav-toggle,
    .btn,
    .modal,
    .modal-backdrop {
        display: none !important;
    }
    
    /* Reset backgrounds */
    body {
        background: white !important;
        color: black !important;
    }
    
    .hero,
    .hero-home,
    .hero-profile,
    .orientation-section,
    .solutions-section {
        background: white !important;
        color: black !important;
    }
    
    /* Reset cards */
    .card,
    .need-card,
    .solution-card,
    .orientation-card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
    
    /* Links */
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
    
    /* Page breaks */
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    .card,
    .need-card {
        page-break-inside: avoid;
    }
}

/* ============================================================================
   8. HIGH CONTRAST MODE
   ============================================================================ */

@media (prefers-contrast: high) {
    .btn-primary {
        border: 2px solid var(--white);
    }
    
    .btn-secondary {
        border-width: 2px;
    }
    
    .card,
    .need-card,
    .orientation-card {
        border-width: 2px;
    }
    
    a:focus,
    button:focus {
        outline-width: 3px;
    }
}

/* ============================================================================
   9. DARK MODE (Préparation future)
   ============================================================================ */

@media (prefers-color-scheme: dark) {
    /* 
     * Note: Dark mode n'est pas activé par défaut
     * pour respecter la charte graphique France Travail.
     * Ces styles peuvent être activés via une classe .dark-mode
     */
}

.dark-mode {
    --grey-50: #1a1a1a;
    --grey-100: #2a2a2a;
    --grey-200: #3a3a3a;
    --grey-300: #4a4a4a;
    --grey-400: #6a6a6a;
    --grey-500: #8a8a8a;
    --grey-600: #aaaaaa;
    --grey-700: #cccccc;
    --grey-800: #e0e0e0;
    --grey-900: #f0f0f0;
    --white: #121212;
    
    --ft-bleu-bg: #1a1a2e;
}
