/* ==========================================
   MANCHIX - CSS MODERNE 2026
   Design System avec mode sombre, animations fluides
   et fonctionnalités CSS de pointe
   ========================================== */

/* Variables CSS avancées avec mode sombre */
:root {
    /* Couleurs principales */
    --primary-50: #e3f2fd;
    --primary-100: #bbdefb;
    --primary-200: #90caf9;
    --primary-300: #64b5f6;
    --primary-400: #42a5f5;
    --primary-500: #0066cc;
    --primary-600: #1e88e5;
    --primary-700: #1976d2;
    --primary-800: #1565c0;
    --primary-900: #0d47a1;
    
    /* Système de couleurs adaptative */
    --accent: #00d4ff;
    --accent-hover: #00b8e6;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    /* Surfaces et backgrounds */
    --surface-1: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f1f5f9;
    --surface-elevated: #ffffff;
    
    /* Texte */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    
    /* Bordures */
    --border-subtle: #e2e8f0;
    --border-medium: #cbd5e1;
    --border-strong: #94a3b8;
    
    /* Ombres modernes avec profondeur */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    
    /* Espacements fluides */
    --space-xs: clamp(0.5rem, 1vw, 0.75rem);
    --space-sm: clamp(0.75rem, 1.5vw, 1rem);
    --space-md: clamp(1rem, 2vw, 1.5rem);
    --space-lg: clamp(1.5rem, 3vw, 2rem);
    --space-xl: clamp(2rem, 4vw, 3rem);
    --space-2xl: clamp(3rem, 6vw, 5rem);
    
    /* Typographie fluide */
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
    --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);
    --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);
    --text-3xl: clamp(1.875rem, 1.5rem + 1.5vw, 2.5rem);
    --text-4xl: clamp(2.25rem, 1.8rem + 2vw, 3rem);
    
    /* Animations */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* Bordures arrondies modernes */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;
    
    /* Backdrop blur pour glassmorphism */
    --blur-sm: 8px;
    --blur-md: 12px;
    --blur-lg: 16px;
    --blur-xl: 24px;
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
    :root {
        --surface-1: #0f172a;
        --surface-2: #1e293b;
        --surface-3: #334155;
        --surface-elevated: #1e293b;
        
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-tertiary: #64748b;
        
        --border-subtle: #334155;
        --border-medium: #475569;
        --border-strong: #64748b;
        
        --primary-500: #3b82f6;
        --accent: #06b6d4;
    }
}

/* Mode sombre forcé via classe */
[data-theme="dark"] {
    --surface-1: #0f172a;
    --surface-2: #1e293b;
    --surface-3: #334155;
    --surface-elevated: #1e293b;
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #64748b;
    
    --border-subtle: #334155;
    --border-medium: #475569;
    --border-strong: #64748b;
    
    --primary-500: #3b82f6;
    --accent: #06b6d4;
}

/* Reset moderne */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Smooth scroll avec support Safari */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

@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;
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--surface-1);
    min-height: 100dvh;
    overflow-x: hidden;
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--surface-2);
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: var(--radius-full);
    border: 3px solid var(--surface-2);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-strong);
}

/* Selection personnalisée */
::selection {
    background: var(--primary-500);
    color: white;
}

::-moz-selection {
    background: var(--primary-500);
    color: white;
}

/* Container moderne */
.container {
    max-width: min(1400px, 100% - 2rem);
    margin-inline: auto;
    padding-inline: var(--space-md);
    container-type: inline-size;
}

/* ==========================================
   HEADER AVEC GLASSMORPHISM
   ========================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: linear-gradient(135deg, 
        rgb(15 23 42 / 0.95) 0%, 
        rgb(30 41 59 / 0.95) 100%);
    backdrop-filter: blur(var(--blur-lg));
    -webkit-backdrop-filter: blur(var(--blur-lg));
    box-shadow: var(--shadow-md);
    border-bottom: 1px solid rgb(255 255 255 / 0.1);
    animation: slideDown var(--transition-slow) ease-out;
}

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

.nav-container {
    max-width: min(1400px, 100% - 2rem);
    margin-inline: auto;
    padding: var(--space-md) var(--space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-lg);
}

.logo a {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: white;
    font-size: var(--text-xl);
    font-weight: 700;
    transition: transform var(--transition-base);
}

.logo a:hover {
    transform: scale(1.05);
}

.logo img {
    border-radius: var(--radius-full);
    transition: transform var(--transition-bounce);
}

.logo a:hover img {
    transform: rotate(360deg) scale(1.1);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--space-lg);
    align-items: center;
}

.nav-menu a {
    position: relative;
    color: rgb(255 255 255 / 0.9);
    text-decoration: none;
    font-weight: 500;
    padding: var(--space-xs) var(--space-sm);
    transition: color var(--transition-base);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: all var(--transition-base);
    transform: translateX(-50%);
    border-radius: var(--radius-full);
}

.nav-menu a:hover {
    color: var(--accent);
}

.nav-menu a:hover::after {
    width: 100%;
}

/* ==========================================
   HERO SECTION MODERNE
   ========================================== */

.hero {
    position: relative;
    background: linear-gradient(135deg, 
        var(--primary-700) 0%, 
        var(--primary-900) 100%);
    color: white;
    padding: var(--space-2xl) var(--space-xl);
    border-radius: var(--radius-2xl);
    margin-block: var(--space-xl);
    box-shadow: var(--shadow-2xl);
    overflow: hidden;
    animation: fadeInUp var(--transition-slow) ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Effet de particules en arrière-plan */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgb(255 255 255 / 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgb(255 255 255 / 0.1) 0%, transparent 50%);
    pointer-events: none;
    animation: particleFloat 20s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% { 
        transform: translate(0, 0) scale(1); 
        opacity: 0.5;
    }
    50% { 
        transform: translate(30px, -30px) scale(1.1); 
        opacity: 0.8;
    }
}

.hero > * {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-lg);
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, rgb(255 255 255 / 0.8) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero .lead {
    font-size: var(--text-lg);
    margin-bottom: var(--space-md);
    opacity: 0.95;
    line-height: 1.7;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

.hero p {
    margin-bottom: var(--space-md);
    line-height: 1.8;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
    background: rgb(255 255 255 / 0.1);
    backdrop-filter: blur(var(--blur-sm));
}

.hero a:hover {
    background: rgb(255 255 255 / 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgb(0 0 0 / 0.2);
}

.hero strong {
    background: linear-gradient(135deg, 
        rgb(255 255 255 / 0.2) 0%, 
        rgb(255 255 255 / 0.3) 100%);
    padding: 4px 12px;
    border-radius: var(--radius-md);
    backdrop-filter: blur(var(--blur-sm));
    border: 1px solid rgb(255 255 255 / 0.3);
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 0 0 0 rgb(255 255 255 / 0.4);
    }
    50% { 
        transform: scale(1.05); 
        box-shadow: 0 0 20px 10px rgb(255 255 255 / 0);
    }
}

/* ==========================================
   PHOTO GRID MODERNE
   ========================================== */

.photos {
    margin-block: var(--space-2xl);
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: var(--space-xl);
}

.photo-grid figure {
    background: var(--surface-elevated);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-slow);
    border: 1px solid var(--border-subtle);
    animation: fadeInUp 0.8s ease-out both;
}

.photo-grid figure:nth-child(2) {
    animation-delay: 0.1s;
}

.photo-grid figure:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-2xl);
    border-color: var(--primary-500);
}

.photo-grid img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform var(--transition-slow);
}

.photo-grid figure:hover img {
    transform: scale(1.05);
}

.photo-grid figcaption {
    padding: var(--space-md);
    text-align: center;
    font-size: var(--text-sm);
    color: var(--text-secondary);
    background: linear-gradient(to top, var(--surface-2), transparent);
}

.photo-grid figcaption a {
    color: var(--primary-500);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-base);
}

.photo-grid figcaption a:hover {
    color: var(--accent);
}

/* ==========================================
   MEETINGS SECTION
   ========================================== */

.meetings {
    margin-block: var(--space-2xl);
}

.meetings h2 {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-xl);
    color: var(--text-primary);
    border-bottom: 3px solid var(--primary-500);
    padding-bottom: var(--space-md);
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-500), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeInUp 0.8s ease-out both;
}

.meeting {
    background: var(--surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out both;
}

.meeting::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-500), var(--accent));
    transition: width var(--transition-base);
}

.meeting:hover {
    box-shadow: var(--shadow-xl);
    transform: translateX(8px);
    border-color: var(--primary-500);
}

.meeting:hover::before {
    width: 8px;
}

.meeting h3 {
    color: var(--primary-500);
    font-size: var(--text-xl);
    margin-bottom: var(--space-sm);
    font-weight: 700;
}

.meeting-meta {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.attendees {
    background: var(--surface-3);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: 600;
    border: 1px solid var(--border-subtle);
    transition: all var(--transition-base);
}

.attendees:hover {
    background: var(--surface-2);
    transform: translateY(-2px);
}

.badge {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.meeting p {
    line-height: 1.7;
    color: var(--text-secondary);
}

.meeting a {
    color: var(--primary-500);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-base);
    padding: 2px 4px;
    border-radius: var(--radius-sm);
}

.meeting a:hover {
    color: var(--accent);
    background: var(--surface-2);
}

/* ==========================================
   ARCHIVE SECTION
   ========================================== */

.archive {
    margin-top: var(--space-xl);
    border: 2px dashed var(--border-medium);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    background: var(--surface-2);
    transition: all var(--transition-base);
}

.archive:hover {
    border-color: var(--primary-500);
    background: var(--surface-3);
}

.archive summary {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--primary-500);
    cursor: pointer;
    padding: var(--space-md);
    user-select: none;
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.archive summary::before {
    content: '📁';
    font-size: var(--text-2xl);
    transition: transform var(--transition-bounce);
}

.archive[open] summary::before {
    transform: rotate(20deg) scale(1.2);
}

.archive summary:hover {
    background: var(--surface-elevated);
    transform: translateX(8px);
}

.meeting.archived {
    opacity: 0.85;
    filter: grayscale(0.2);
}

/* ==========================================
   INFO BOX
   ========================================== */

.info-box {
    background: linear-gradient(135deg, 
        var(--surface-2) 0%, 
        var(--surface-3) 100%);
    border-left: 4px solid var(--primary-500);
    padding: var(--space-xl);
    border-radius: var(--radius-xl);
    margin-block: var(--space-2xl);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out both;
}

.info-box::before {
    content: '🐧';
    position: absolute;
    font-size: 200px;
    right: -50px;
    bottom: -50px;
    opacity: 0.05;
    pointer-events: none;
}

.info-box h2 {
    color: var(--primary-500);
    margin-bottom: var(--space-md);
    font-size: var(--text-2xl);
    font-weight: 700;
}

.info-box p {
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
    line-height: 1.7;
}

.info-box a {
    color: var(--primary-500);
    text-decoration: none;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

.info-box a:hover {
    background: var(--surface-elevated);
    color: var(--accent);
    transform: translateY(-2px);
}

/* ==========================================
   FOOTER MODERNE
   ========================================== */

.site-footer {
    background: linear-gradient(135deg, 
        rgb(15 23 42) 0%, 
        rgb(10 15 30) 100%);
    color: rgb(241 245 249 / 0.9);
    margin-top: var(--space-2xl);
    padding: var(--space-2xl) 0 0;
    position: relative;
    overflow: hidden;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        var(--accent), 
        transparent);
}

.footer-container {
    max-width: min(1400px, 100% - 2rem);
    margin-inline: auto;
    padding: 0 var(--space-lg) var(--space-xl);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
    gap: var(--space-xl);
}

.footer-section h3 {
    color: var(--accent);
    font-size: var(--text-xl);
    margin-bottom: var(--space-md);
    border-bottom: 2px solid var(--accent);
    padding-bottom: var(--space-sm);
    display: inline-block;
}

.footer-section p,
.footer-section address {
    line-height: 1.8;
    color: rgb(203 213 225 / 0.8);
    font-style: normal;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: var(--space-sm);
}

.footer-links a,
.footer-section a {
    color: var(--accent);
    text-decoration: none;
    transition: all var(--transition-base);
    display: inline-block;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.footer-links a:hover,
.footer-section a:hover {
    color: #fff;
    background: rgb(255 255 255 / 0.1);
    transform: translateX(4px);
}

.footer-bottom {
    background: rgb(0 0 0 / 0.3);
    padding: var(--space-lg);
    text-align: center;
    border-top: 1px solid rgb(255 255 255 / 0.1);
    backdrop-filter: blur(var(--blur-sm));
}

.footer-bottom p {
    margin: 0;
    color: rgb(203 213 225 / 0.7);
    font-size: var(--text-sm);
}

.footer-bottom a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition-base);
}

.footer-bottom a:hover {
    color: #fff;
}

/* ==========================================
   RESPONSIVE MODERNE
   ========================================== */

@container (max-width: 768px) {
    .photo-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .hero {
        padding: var(--space-xl) var(--space-md);
    }
    
    .hero h1 {
        font-size: var(--text-3xl);
    }
    
    .meeting {
        padding: var(--space-md);
    }
}

@media (max-width: 480px) {
    .container {
        padding-inline: var(--space-sm);
    }
    
    .hero {
        padding: var(--space-lg) var(--space-md);
        border-radius: var(--radius-lg);
    }
    
    .hero h1 {
        font-size: var(--text-2xl);
    }
}

/* ==========================================
   UTILITAIRES MODERNES
   ========================================== */

.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;
}

/* Focus visible moderne */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Boutons modernes (pour usage futur) */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-lg);
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: var(--text-base);
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Support des nouvelles unités viewport */
@supports (height: 100dvh) {
    body {
        min-height: 100dvh;
    }
}

/* Print styles modernes */
@media print {
    .site-header,
    .site-footer,
    .archive {
        display: none;
    }
    
    .hero {
        background: white;
        color: black;
        border: 2px solid black;
    }
    
    .meeting {
        page-break-inside: avoid;
    }
}
