/* main.css - Version modernisée */

/* Variables CSS pour une meilleure maintenabilité */
:root {
    --primary-color: #52739e;
    --primary-dark: #3a5478;
    --secondary-color: #b2132e;
    --accent-color: #813c54;
    --text-color: #2d3748;
    --text-light: #718096;
    --bg-color: #f8fafc;
    --bg-card: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    margin: 0 auto;
    max-width: 100%;
    padding: 0 20px;
}

/* En-tête et navigation */
.banner {
    position: relative;
    margin: 30px auto 50px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    max-width: 900px;
}

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

.banner img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

.top-left {
    position: absolute;
    top: 30px;
    left: 30px;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 30px;
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
}

.title {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1.2;
    display: block;
}

.bottom-right {
    position: absolute;
    bottom: 30px;
    right: 30px;
    background: rgba(82, 115, 158, 0.9);
    color: white;
    padding: 15px 25px;
    border-radius: var(--border-radius);
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    backdrop-filter: blur(10px);
}

/* Navigation */
.navigation-container {
    margin: 30px auto 50px;
    display: flex;
    justify-content: center;
    max-width: 900px;
}

.navigation {
    display: flex;
    gap: 2px;
    background: white;
    padding: 8px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.navigation a {
    padding: 15px 30px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    border-radius: calc(var(--border-radius) - 4px);
    transition: var(--transition);
    position: relative;
}

.navigation a:hover {
    background: rgba(82, 115, 158, 0.1);
    color: var(--primary-color);
}

.navigation a.current {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(82, 115, 158, 0.3);
}

/* Contenu principal */
.content {
    background: var(--bg-card);
    padding: 35px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin: 0 auto 50px;
    max-width: 900px;
}

/* CORRECTION : Réduire l'espace blanc en haut du contenu */
.content > :first-child {
    margin-top: 0.5em;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-dark);
    margin: 1.5em 0 0.8em; /* Réduit de 2em 0 1em */
    line-height: 1.3;
}

h1 {
    font-size: 2.8rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 15px;
    margin-top: 0.5em; /* Réduit spécifiquement pour h1 */
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--secondary-color);
    border-radius: 2px;
}

h2 {
    font-size: 2.2rem;
    font-weight: 600;
    border-left: 5px solid var(--accent-color);
    padding-left: 20px;
    margin-left: -25px;
    margin-top: 1.5em; /* Réduit spécifiquement pour h2 */
}

h3 {
    font-size: 1.8rem;
    color: var(--accent-color);
    margin-top: 1.8em; /* Réduit de 2.5em */
}

p {
    margin: 1.2em 0; /* Réduit de 1.5em 0 */
    text-align: justify;
    line-height: 1.7; /* Légèrement réduit */
}

/* Indentation pour les paragraphes de la page argumentaire */
/* Nous ciblons les paragraphes qui suivent directement un h2 ou h3 dans la page argumentaire */
body:has(.content h2:first-of-type) .content p {
    text-indent: 1.5em;
}

/* Ne pas indenter le premier paragraphe après un titre */
body:has(.content h2:first-of-type) .content h2 + p,
body:has(.content h2:first-of-type) .content h3 + p {
    text-indent: 0;
}

/* Style pour les listes à puces */
ul, ol {
    margin: 1em 0;
    padding-left: 2em;
}

li {
    margin: 0.5em 0;
    line-height: 1.7;
    text-align: justify; /* Justifier le texte des éléments de liste */
}

/* Indentation pour les listes dans la page argumentaire */
body:has(.content h2:first-of-type) .content ul,
body:has(.content h2:first-of-type) .content ol {
    margin-left: 1.5em;
    margin-right: 1.5em;
}

body:has(.content h2:first-of-type) .content li {
    text-indent: 0;
    margin: 0.7em 0;
    text-align: justify; /* Justifier le texte des éléments de liste dans la page argumentaire */
}

/* Style spécifique pour les listes à puces */
body:has(.content h2:first-of-type) .content ul li {
    list-style-type: disc;
}

body:has(.content h2:first-of-type) .content ol li {
    list-style-type: decimal;
}

/* Liens */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
    padding-bottom: 2px;
}

a:hover {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
}

/* Tables - Version compacte */
table.comitee, table.housing {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 15px 0; /* Réduit de 20px */
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    max-width: 900px;
    font-size: 0.95rem; /* Police légèrement plus petite */
}

table.comitee tr, table.housing tr {
    transition: var(--transition);
    height: 42px; /* Hauteur fixe pour les lignes */
}

table.comitee tr:hover, table.housing tr:hover {
    background: rgba(82, 115, 158, 0.05);
}

table.comitee td, table.housing td {
    padding: 10px 18px; /* Réduit de 15px 20px */
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

table.comitee tr:last-child td, table.housing tr:last-child td {
    border-bottom: none;
}

/* Style compact spécifique pour table.comitee */
table.comitee {
    line-height: 1.4; /* Réduction de l'interligne */
}

table.comitee span {
    font-variant: small-caps; /* Petites majuscules pour les noms de famille */
    font-weight: 600; /* Un peu plus gras pour les noms */
    color: var(--primary-dark);
    margin-left: 4px;
}

/* Alternance de couleurs pour plus de lisibilité */
table.comitee tr:nth-child(even) {
    background-color: rgba(248, 250, 252, 0.5);
}

table.comitee tr:nth-child(even):hover {
    background: rgba(82, 115, 158, 0.08);
}

/* Tableau flyers - Boîte avec style de navigation */
table.flyers {
    width: 100%;
    border-collapse: collapse;
    margin: 25px auto;
    text-align: center;
}

table.flyers tr {
    border: none;
    display: block;
}

table.flyers td {
    padding: 0;
    border: none;
    text-align: center;
    display: block;
}

table.flyers td.flyer {
    text-align: center;
    display: inline-block;
    background: white;
    padding: 8px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    margin: 0 auto;
}

table.flyers td.flyer:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

table.flyers td.flyer a {
    display: inline-block;
    padding: 15px 30px;
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    border-radius: calc(var(--border-radius) - 4px);
    transition: var(--transition);
    position: relative;
    background: white;
}

table.flyers td.flyer a:hover {
    background: rgba(82, 115, 158, 0.1);
    color: var(--primary-color);
}

/* Style pour que le lien du flyer ressemble à un bouton actif de la navigation */
table.flyers td.flyer a.current,
table.flyers td.flyer a:active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(82, 115, 158, 0.3);
}

/* Sponsors */
.sponsors-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 25px;
    margin: 25px 0; /* Réduit de 35px */
    max-width: 900px;
}

.sponsor-card {
    background: white;
    padding: 20px; /* Réduit de 25px */
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sponsor-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.sponsor-card img {
    max-width: 100%;
    height: auto;
    filter: grayscale(0);
    opacity: 0.8;
    transition: var(--transition);
}

.sponsor-card:hover img {
    filter: grayscale(0);
    opacity: 1;
}

/* Flyers (ancien style conservé pour compatibilité) */
.flyer-link {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 15px 30px;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow);
    margin: 15px 0; /* Réduit de 20px */
}

.flyer-link:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    background: linear-gradient(135deg, var(--primary-dark), var(--accent-color));
}

/* Pied de page */
footer {
    margin-top: 60px;
    padding: 25px 0;
    text-align: center;
    color: var(--text-light);
    border-top: 1px solid #e2e8f0;
    font-size: 0.9rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

footer a {
    color: var(--primary-color);
    font-weight: 500;
}

footer a:hover {
    color: var(--secondary-color);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 0 15px;
    }
    
    .banner {
        margin: 20px auto 40px;
        max-width: 95%;
    }
    
    .top-left {
        position: relative;
        top: auto;
        left: auto;
        margin: -60px 20px 20px;
        padding: 15px;
    }
    
    .title {
        font-size: 1.6rem;
    }
    
    .bottom-right {
        position: relative;
        bottom: auto;
        right: auto;
        margin: 20px 20px 0;
        display: inline-block;
    }
    
    .navigation-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 95%;
    }
    
    .navigation {
        flex-wrap: nowrap;
        min-width: max-content;
    }
    
    .navigation a {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .content {
        padding: 25px;
        max-width: 95%;
    }
    
    h1 {
        font-size: 2.2rem;
        margin-top: 0.3em;
    }
    
    h2 {
        font-size: 1.8rem;
        padding-left: 15px;
        margin-left: -20px;
        margin-top: 1.2em;
    }
    
    h3 {
        font-size: 1.4rem;
        margin-top: 1.5em;
    }
    
    p {
        margin: 1em 0;
        line-height: 1.6;
    }
    
    /* Table responsive pour mobile */
    table.comitee, table.housing {
        font-size: 0.9rem;
        margin: 12px 0;
    }
    
    table.comitee td, table.housing td {
        padding: 8px 12px;
    }
    
    table.comitee tr {
        height: auto;
        min-height: 38px;
    }
    
    /* Indentation réduite sur mobile pour la page argumentaire */
    body:has(.content h2:first-of-type) .content p {
        text-indent: 1em;
    }
    
    /* Listes sur mobile */
    ul, ol {
        padding-left: 1.5em;
        margin: 0.8em 0;
    }
    
    body:has(.content h2:first-of-type) .content ul,
    body:has(.content h2:first-of-type) .content ol {
        margin-left: 1em;
        margin-right: 1em;
    }
    
    /* Tableau flyers sur mobile */
    table.flyers td.flyer {
        padding: 6px;
    }
    
    table.flyers td.flyer a {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .sponsors-container {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: 95%;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.3rem;
    }
    
    .navigation {
        flex-direction: column;
        gap: 4px;
    }
    
    .navigation a {
        text-align: center;
    }
    
    .content {
        padding: 20px;
    }
    
    /* Table encore plus compacte sur très petits écrans */
    table.comitee, table.housing {
        font-size: 0.85rem;
    }
    
    table.comitee td, table.housing td {
        padding: 6px 10px;
    }
    
    /* Indentation réduite sur mobile pour la page argumentaire */
    body:has(.content h2:first-of-type) .content p {
        text-indent: 0.8em;
    }
    
    /* Listes sur très petits écrans */
    ul, ol {
        padding-left: 1.2em;
    }
    
    body:has(.content h2:first-of-type) .content ul,
    body:has(.content h2:first-of-type) .content ol {
        margin-left: 0.8em;
        margin-right: 0.8em;
    }
    
    /* Tableau flyers sur très petits écrans */
    table.flyers td.flyer {
        padding: 4px;
        width: 100%;
    }
    
    table.flyers td.flyer a {
        padding: 10px 15px;
        font-size: 0.85rem;
        width: 100%;
        box-sizing: border-box;
    }
}

/* Animation pour l'apparition du contenu */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content, .sponsors-container, table.comitee {
    animation: fadeIn 0.6s ease-out;
}

/* Style pour les dates importantes */
.date-highlight {
    background: linear-gradient(135deg, #fff7e6, #ffe8cc);
    border-left: 4px solid #ff9800;
    padding: 20px;
    border-radius: var(--border-radius);
    margin: 25px 0; /* Réduit de 30px */
}

.date-highlight b {
    color: #e65100;
    font-weight: 700;
}

/* Style pour les emails */
.email-link {
    color: var(--secondary-color);
    font-weight: 600;
}

/* Google Translate Widget */
#google_translate_element {
    margin: 20px 0;
    display: inline-block;
}

/* Navigation améliorée avec logo et traduction */
.nav-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 15px 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin: 30px auto 50px;
    gap: 25px;
    max-width: 900px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-logo {
    width: 60px;
    height: 60px;
    transition: var(--transition);
}

.nav-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.nav-logo:hover {
    transform: scale(1.1);
}

.nav-center {
    display: flex;
    flex: 1;
    justify-content: center;
}

.nav-center .navigation {
    display: flex;
    gap: 10px;
    background: transparent;
    padding: 0;
    box-shadow: none;
}

.nav-center .navigation a {
    padding: 12px 25px;
    font-weight: 500;
    border-radius: calc(var(--border-radius) - 4px);
    transition: var(--transition);
}

.nav-center .navigation a.current {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 4px rgba(82, 115, 158, 0.3);
}

.nav-right {
    display: flex;
    align-items: center;
    min-width: 200px;
    justify-content: flex-end;
}

#google_translate_element {
    width: 100%;
    max-width: 300px;
}

/* Style pour le sélecteur de langue Google Translate */
.goog-te-gadget {
    font-family: 'Inter', sans-serif !important;
    font-size: 0.9rem !important;
}

.goog-te-gadget-simple {
    background-color: transparent !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: calc(var(--border-radius) - 4px) !important;
    padding: 8px 15px !important;
    transition: var(--transition) !important;
}

.goog-te-gadget-simple:hover {
    border-color: var(--primary-color) !important;
    box-shadow: 0 2px 8px rgba(82, 115, 158, 0.15) !important;
}

.goog-te-menu-value {
    color: var(--text-color) !important;
}

.goog-te-menu-value span:first-child {
    color: var(--primary-color) !important;
}

.goog-te-menu-value span:last-child {
    display: none;
}

/* Masquer la bannière Google Translate */
.goog-te-banner-frame {
    display: inline-block !important;
}

.goog-te-gadget img {
    display: inline-block !important;
}

/* Responsive pour la nouvelle navigation */
@media (max-width: 1024px) {
    .nav-wrapper {
        max-width: 95%;
        padding: 15px 20px;
    }
    
    .content, .banner {
        max-width: 95%;
    }
    
    .sponsors-container {
        grid-template-columns: repeat(2, 1fr);
        max-width: 95%;
    }
}

@media (max-width: 768px) {
    .nav-wrapper {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
        max-width: 95%;
    }
    
    .nav-center .navigation {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-center .navigation a {
        padding: 10px 15px;
        font-size: 0.9rem;
        flex: 1;
        text-align: center;
        min-width: 120px;
    }
    
    .nav-logo {
        width: 50px;
        height: 50px;
    }
    
    .content {
        padding: 25px;
        max-width: 95%;
    }
    
    .sponsors-container {
        grid-template-columns: 1fr;
        gap: 15px;
        max-width: 95%;
    }
    
    .navigation-container {
        max-width: 95%;
    }
}

@media (max-width: 480px) {
    .nav-center .navigation {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-center .navigation a {
        width: 100%;
        margin-bottom: 5px;
    }
}