/* ===== Reset & base ===== */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: Arial, sans-serif; }

body {
    background: url('../background.jpg') no-repeat center center fixed;
    background-size: cover;
    color: #fff;
    display: flex; flex-direction: column;
    min-height: 100vh;
}

/* ===== Header / Navbar ===== */
header { position: absolute; top: 0; width: 100%; padding: 20px; background: rgba(0,0,0,0.5); z-index: 1000; }

nav ul { list-style: none; display: flex; justify-content: flex-end; align-items: center; }
nav ul li { margin-left: 20px; }
nav ul li.logo { margin-right: auto; }
nav ul li.logo img { height: 50px; }

nav ul li a {
    position: relative; color: #fff; text-decoration: none; font-size: 18px; transition: color .3s ease;
}
nav ul li a:hover, nav ul li a.active { color: #4a4af4; }
nav ul li a::after{
    content:""; position:absolute; left:0; bottom:-4px; width:0%; height:2px; background:#4a4af4; transition:width .3s ease;
}
nav ul li a:hover::after, nav ul li a.active::after { width:100%; }

.burger { display:none; }
.burger span { width:25px; height:3px; background:#fff; margin:4px; transition:all .3s ease; }

@media (max-width: 768px){
    .burger{ display:flex; flex-direction:column; cursor:pointer; position:absolute; top:20px; right:20px; z-index:1100; }
    nav ul{ position:fixed; top:60px; right:0; height:calc(100vh - 60px); width:100%; background:rgba(0,0,0,.9);
        flex-direction:column; justify-content:center; align-items:center; transform:translateX(100%); transition:transform .5s; }
    nav ul.nav-active{ transform:translateX(0); }
    nav ul li{ margin:20px 0; }
    nav ul li.logo{ display:none; }
}

/* ===== Main ===== */
main { flex:1; display:flex; flex-direction:column; align-items:center; padding:120px 20px 60px; text-align:center; }
h1 { font-size:3em; margin-bottom:20px; }

/* ===== Category block ===== */
.category {
    background: rgba(0,0,0,0.7);
    border-radius: 15px;
    padding: 30px 20px;
    width: 100%; max-width: 1100px;
    margin-top: 20px;
    box-shadow: 0 0 25px rgba(74,74,244,0.6);
    animation: fadeIn .8s ease-out;
}
.category h2 { color:#4a4af4; font-size:2.2em; margin-bottom: 10px; }

/* ===== Project card ===== */
.project-card {
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
    transition: transform .25s ease, box-shadow .25s ease;
}
.project-card:hover { transform: translateY(-4px); box-shadow: 0 0 18px rgba(74,74,244,0.45); }

.project-header { display:flex; gap:18px; align-items:center; }
.project-header .cover {
    width: 120px; height: 120px; border-radius: 10px; object-fit: cover;
    box-shadow: 0 0 12px rgba(74,74,244,0.5);
}
.project-title h3 { font-size:1.6em; margin-bottom:4px; }
.subtitle { color:#bbb; }

.project-body { margin-top: 12px; }
.excerpt { color:#ddd; line-height:1.6; }

.more-content { display:none; margin-top:16px; }
.more-content.active { display:block; }

.two-cols { display:grid; grid-template-columns: 1fr 1fr; gap:16px; margin:10px 0 18px; }
.two-cols h4 { color:#4a4af4; margin-bottom:6px; }
.two-cols ul { padding-left: 18px; }
.two-cols li { margin-bottom: 6px; }

@media (max-width: 800px){
    .project-header{ flex-direction:column; align-items:flex-start; }
    .two-cols{ grid-template-columns:1fr; }
}

/* ===== Gallery ===== */
.gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
.gallery img{
    width:100%; height:120px; object-fit:cover; border-radius:8px;
    cursor:pointer; transition: transform .2s ease, box-shadow .2s ease;
    box-shadow: 0 0 8px rgba(74,74,244,0.35);
}
.gallery img:hover{ transform: scale(1.03); box-shadow: 0 0 14px rgba(74,74,244,0.6); }

.toggle-more{
    margin-top:14px; padding:10px 18px; border:none; cursor:pointer; border-radius:24px;
    background:#4a4af4; color:#fff; font-weight:bold; transition: all .25s ease;
}
.toggle-more:hover{ background:#3737d6; box-shadow:0 0 15px #4a4af4; transform:scale(1.03); }

/* ===== Lightbox ===== */
.lightbox {
    position: fixed; inset: 0; display:flex; align-items:center; justify-content:center;
    background: rgba(0,0,0,0.75); z-index: 2000; padding: 20px;
}
.lightbox.hidden{ display:none; }
.lightbox img{
    max-width: min(1100px, 90vw); max-height: 85vh; border-radius: 10px; box-shadow: 0 0 20px rgba(74,74,244,0.7);
}
.lightbox-close{
    position:absolute; top:18px; right:22px;
    font-size:32px; line-height:32px; background: transparent; color:#fff;
    border:none; cursor:pointer; padding:6px 10px;
}

/* ===== Footer ===== */
footer { background: rgba(0,0,0,0.6); text-align:center; padding:10px; }
footer a { color:#fff; text-decoration:none; font-size:14px; }
footer a:hover { color:#4a4af4; }

/* ===== Anim ===== */
@keyframes fadeIn { from{opacity:0; transform: translateY(18px);} to{opacity:1; transform:none;} }

/* === Bloc détaillé Morpion / TCP-UDP === */
.section-detail {
    margin-top: 25px;
    padding: 25px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 14px;
    box-shadow: 0 0 25px rgba(74, 74, 244, 0.4);
    overflow-x: hidden;
}

.section-title {
    color: #4a4af4;
    font-size: 1.8em;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(74, 74, 244, 0.3);
    padding-bottom: 6px;
}

.code-block {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 16px;
    margin-top: 20px;
    font-family: 'Courier New', monospace;
    position: relative;
    box-shadow: 0 0 15px rgba(74, 74, 244, 0.3);
}
.code-block pre {
    margin: 0;
    overflow-x: auto;
    white-space: pre-wrap;
    color: #c6c6ff;
}
.code-block code {
    color: #d7d7ff;
    font-size: 15px;
    line-height: 1.6;
}
.code-desc {
    color: #ccc;
    margin-top: 10px;
    line-height: 1.5;
}

/* ===== Images & Vidéos responsives ===== */
.section-detail img.cover {
    display: block;
    width: 100%;
    max-width: 700px;
    height: auto;
    margin: 25px auto;
    border-radius: 10px;
    object-fit: contain;
    box-shadow: 0 0 15px rgba(74, 74, 244, 0.4);
}
.video-container {
    margin-top: 25px;
    display: flex;
    justify-content: center;
}
.video-container iframe {
    width: 100%;
    max-width: 700px;
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(74, 74, 244, 0.6);
}

/* ===== Responsive ===== */
@media (max-width: 768px){
    .section-detail{ padding:18px; }
    .section-detail img.cover{ max-width:95%; margin:15px auto; }
    .video-container iframe{ max-width:95%; }
}
/* === Exception : image structure non responsive en desktop === */
.section-detail img.fixed-desktop {
    width: auto;                 /* ne force plus 100% */
    max-width: 850px;            /* limite la taille max */
    height: auto;
    display: block;
    margin: 25px auto;
    border-radius: 10px;
    object-fit: contain;
    box-shadow: 0 0 15px rgba(74, 74, 244, 0.4);
}

/* Sur mobile, elle redevient responsive */
@media (max-width: 768px) {
    .section-detail img.fixed-desktop {
        width: 100%;
        max-width: 95%;
    }
}

