/* CSS pour le site SNT Lycée du Dauphiné - Mobile First */
/* Reset et styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    overflow-x: hidden;
}

body.is-preload * {
    animation: none !important;
    transition: none !important;
}

/* Bouton menu hamburger */
#headerToggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: #2c3e50;
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

#headerToggle:hover {
    background: #3498db;
}

#headerToggle .toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#headerToggle .toggle i {
    font-size: 1.5rem;
}

/* Overlay pour mobile */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay.active {
    display: block;
    opacity: 1;
}

/* Layout principal MOBILE FIRST */
#wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#main {
    width: 100%;
    padding: 1rem;
    padding-top: 80px; /* Pour éviter que le contenu passe sous le bouton hamburger */
    order: 2;
}

.inner {
    max-width: 100%;
}

/* Sidebar - Cachée par défaut sur mobile */
#sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100vh;
    background-color: #2c3e50;
    color: white;
    padding: 2rem;
    z-index: 999;
    overflow-y: auto;
    transition: left 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
}

#sidebar.active {
    left: 0;
}

/* Forcer le menu à être caché sur mobile et tablette */
@media (max-width: 1023px) {
    #sidebar {
        left: -320px !important;
    }
    
    #sidebar.active {
        left: 0 !important;
    }
}

/* Typographie */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #2980b9;
}

/* Header */
#header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid #eaeaea;
}

#header .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.icons {
    display: flex;
    list-style: none;
    justify-content: center;
    flex-wrap: wrap;
}

.icons li {
    margin: 0 0.5rem;
}

.icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f1f1f1;
    transition: all 0.3s ease;
    position: relative;
}

.icons a:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Couleurs spécifiques pour chaque réseau social */
.icons a:nth-child(1) i {
    color: #3B5998; /* Facebook */
}

.icons a:nth-child(2) i {
    color: #E4405F; /* Instagram */
}

.icons a:nth-child(3) i {
    color: #1DA1F2; /* Twitter */
}

.icons a:nth-child(4) i {
    color: #FF0000; /* YouTube */
}

.icons a:hover:nth-child(1) {
    background-color: #3B5998;
}

.icons a:hover:nth-child(1) i {
    color: white;
}

.icons a:hover:nth-child(2) {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.icons a:hover:nth-child(2) i {
    color: white;
}

.icons a:hover:nth-child(3) {
    background-color: #1DA1F2;
}

.icons a:hover:nth-child(3) i {
    color: white;
}

.icons a:hover:nth-child(4) {
    background-color: #FF0000;
}

.icons a:hover:nth-child(4) i {
    color: white;
}

/* Banner */
#banner {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 3rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #3498db 0%, #2c3e50 100%);
    border-radius: 10px;
    color: white;
    text-align: center;
}

#banner .content {
    width: 100%;
}

#banner h1 {
    color: white;
    margin-bottom: 1rem;
}

#banner p {
    color: rgba(255,255,255,0.9);
    margin-bottom: 1.5rem;
}

#banner .image.object {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#banner .image.object img {
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    max-width: 100%;
    height: auto;
}

#banner .button {
    background-color: white;
    color: #3498db;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

#banner .button:hover {
    background-color: #f1f1f1;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Section des notions techniques */
.features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.features article {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem 1rem;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.features article:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.features .icon {
    margin-bottom: 1rem;
    display: block;
}

.features .icon i {
    color: #3498db;
    transition: color 0.3s ease;
}

.features article:hover .icon i {
    color: #2980b9;
}

.features article a {
    text-decoration: none;
}

.features .content h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.features .content p {
    color: #666;
}

/* Section sommaire */
.posts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.posts article {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.posts article:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.posts .image {
    display: block;
    overflow: hidden;
    height: 200px;
}

.posts .image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.posts article:hover .image img {
    transform: scale(1.05);
}

.posts article > div {
    padding: 1.5rem;
}

.posts h3 {
    margin-bottom: 0.5rem;
}

.posts .actions {
    margin-top: 1rem;
    list-style: none;
}

.button {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.button:hover {
    background-color: #2980b9;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}

.button.big {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

.actions {
    list-style: none;
}

/* Menu */
#menu {
    margin-bottom: 2rem;
}

#menu h2 {
    color: white;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

#menu ul {
    list-style: none;
}

#menu ul li {
    margin-bottom: 0.5rem;
}

#menu ul li a {
    color: rgba(255,255,255,0.8);
    display: block;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

#menu ul li a:hover {
    color: white;
}

#menu ul li ul {
    margin-left: 1rem;
    margin-top: 0.5rem;
    display: none;
}

#menu ul li.active ul {
    display: block;
}

.opener {
    cursor: pointer;
    position: relative;
    padding-right: 1.5rem;
    color: rgba(255,255,255,0.8);
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: color 0.3s ease;
}

.opener:hover {
    color: white;
}

.opener:after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

#menu ul li.active > .opener:after {
    transform: translateY(-50%) rotate(180deg);
}

/* Sections de la sidebar */
#sidebar section {
    margin-bottom: 2rem;
}

#sidebar section .major {
    margin-bottom: 1rem;
}

#sidebar section .major h2 {
    color: white;
    font-size: 1.3rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 0.5rem;
}

.mini-posts {
    margin-bottom: 1rem;
}

.mini-posts article {
    margin-bottom: 1rem;
}

.mini-posts .image {
    display: block;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.mini-posts .image img {
    width: 100%;
    height: auto;
    transition: transform 0.5s ease;
}

.mini-posts article:hover .image img {
    transform: scale(1.05);
}

.mini-posts p {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

.contact {
    list-style: none;
}

.contact li {
    color: rgba(255,255,255,0.8);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contact li i {
    color: #3498db;
    font-size: 1.1rem;
}

.contact a {
    color: rgba(255,255,255,0.8);
}

.contact a:hover {
    color: white;
}

/* Footer de la sidebar */
#footer {
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

#footer p {
    color: rgba(255,255,255,0.6);
    font-size: 0.8rem;
}

#footer a {
    color: rgba(255,255,255,0.8);
}

#footer a:hover {
    color: white;
}

/* Animation pour le changement d'image */
#image-container {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 8px;
}

#current-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 1s ease-in-out;
}

/* Styles pour les informations de géolocalisation */
.geo-info {
    background-color: rgba(255,255,255,0.1);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.geo-info p {
    margin-bottom: 0.5rem;
}

.geo-info span {
    font-weight: bold;
}

/* Styles pour les sections */
section {
    margin-bottom: 3rem;
}

section .major {
    text-align: center;
    margin-bottom: 2rem;
}

section .major h2 {
    position: relative;
    display: inline-block;
    padding-bottom: 0.5rem;
}

section .major h2:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background-color: #3498db;
}

/* ========================================= */
/* VERSION DESKTOP */
/* ========================================= */
@media (min-width: 1024px) {
    #headerToggle {
        display: none !important;
    }
    
    .overlay {
        display: none !important;
    }
    
    #wrapper {
        flex-direction: row;
    }
    
    #sidebar {
        position: sticky !important;
        top: 0;
        left: 0 !important;
        width: 300px;
        height: 100vh;
        transform: none !important;
        order: 1;
        box-shadow: none;
    }
    
    #sidebar.active {
        left: 0 !important;
    }
    
    #main {
        flex: 1;
        padding: 2rem;
        padding-top: 2rem;
        order: 2;
        margin-left: 0 !important;
    }
    
    #header {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
        align-items: center;
    }
    
    #header .logo {
        margin-bottom: 0;
    }
    
    .icons {
        justify-content: flex-end;
    }
    
    .icons li {
        margin-left: 1rem;
        margin-right: 0;
    }
    
    #banner {
        flex-direction: row;
        text-align: left;
        padding: 2rem;
        align-items: center;
    }
    
    #banner .content {
        flex: 1;
    }
    
    #banner .image.object {
        flex: 1;
    }
    
    .features {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .posts {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    #image-container {
        height: 350px;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
}

/* Version tablette */
@media (min-width: 768px) and (max-width: 1023px) {
    #main {
        padding-top: 80px;
    }
    
    .features {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .posts {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    #header .logo {
        margin-bottom: 0;
        font-size: 1.3rem;
    }
    
    #banner {
        text-align: left;
    }
    
    #image-container {
        height: 300px;
    }
}

/* Version desktop large */
@media (min-width: 1200px) {
    .features {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .posts {
        grid-template-columns: repeat(3, 1fr);
    }
    
    #main {
        padding: 3rem;
    }
}

/* Utilitaires */
.text-center {
    text-align: center;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.hidden {
    display: none;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Amélioration du scroll dans la sidebar mobile */
#sidebar::-webkit-scrollbar {
    width: 6px;
}

#sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.1);
}

#sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
}

#sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.5);
}

/* Correction pour les petits écrans */
@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    #header .logo {
        font-size: 1.2rem;
    }
    
    .icons a {
        width: 35px;
        height: 35px;
    }
    
    #banner {
        padding: 1rem;
    }
    
    .features article {
        padding: 1rem 0.75rem;
    }
    
    .button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .button.big {
        padding: 0.65rem 1.25rem;
        font-size: 1rem;
    }
}