/* Limite le nombre de caractères avant retour à la ligne sur le titre principal */
.img-caption.main-caption {
    max-width: 20ch;
    white-space: normal;
    overflow-wrap: break-word;
}

:root {
    --background-primary-color: rgba(190, 190, 190);
    --background-op-primary-color: rgba(190, 190, 190, 0.75);
    --background-secondary-color: rgba(248, 185, 148);
    --background-op-secondary-color: rgba(248, 185, 148, 0.5);
}

html {
    scroll-behavior: smooth;
}

body {
    font-size: 1.7rem;
    margin: 0;
    background: conic-gradient(#FBEADF, #BEBEBE, #CFCECD, #E3F1FA, #FBEADF);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: "degular", sans-serif;
    overflow-x: hidden;
}


.rain-png {
    position: fixed;
    top: -100px;
    pointer-events: none;
    z-index: -1;
    width: 60px;
    height: auto;
    animation: fall 4s linear forwards;
    will-change: transform, top;
    backface-visibility: hidden;
}

@keyframes fall {
    to {
        top: 110vh;
        transform: rotate(360deg) translateZ(0);
    }
}

@font-face {
    font-family: Beatrice;
    font-weight: 700;
    src: url(../../src/fonts/BeatriceDeck-Bold.woff) format("woff");
    src: url(../../src/fonts/BeatriceDeck-Bold.woff2) format("woff2");
}

/* =========================
   HEADER & NAVIGATION
   ========================= */
header {
    font-family: "alize", sans-serif;
    font-weight: 700;
    font-style: normal;
    color: black;
    font-size: 2rem;
    text-align: center;
    user-select: none;
}

.header-index {
    margin-bottom: 6vh;
}

.header-grid {
    display: grid;
    align-items: center;
    gap: 2.5rem;
    grid-template-columns: auto 1fr auto;
    padding: 3% 0 3% 0;
}

.header-grid h2 {
    font-size: 1.7em;
}


.title-container {
    font-family: Beatrice;
    background: var(--background-secondary-color);
    border: 2px solid black;
    line-height: 2em;
    border-radius: 5vw;
    display: grid;
    align-items: center;
    justify-content: center;
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem;
    padding: 0.5em 0;
    transition: transform 0.3s ease;
}


.title-container:hover {
    transform: rotate(-2.5deg);
}

.ornamentTitle {
    width: 35%;
}

.ornamentTitle img {
    width: 100%;
    height: auto;
    display: block;
}

.ornamentTitle:first-of-type {
    grid-column: 1;
    justify-self: end;
}

.header-flex h2 {
    grid-column: 2;
    justify-self: center;
}

.ornamentTitle:last-of-type {
    grid-column: 3;
    justify-self: start;
}


.header-page {
    width: auto;
    grid-column: 1;
}

.header-page img {
    width: 100%;
    height: auto;
    display: block;
}

.header-index img {
    max-width: 55%;
    height: auto;
    display: block;
    margin: 3vh auto 0 auto;
    transition: transform 0.3s ease-in-out;
}

.block {
    margin: auto 0;
    background: var(--background-primary-color);
    top: 0;
    height: 3vh;
}

.main-nav {
    background: none;
    padding: 0.3rem 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.main-nav.nav-index {
    position: sticky;
    top: 0;
    z-index: 2000;
    background: transparent;
    transition: background 0.15s ease-in;
    padding: 1rem 0;
}

.main-nav.nav-index.scrolled {
    background: white;
    border-bottom: 2px solid black;
}

.nav-index {
    margin: 4vh auto 0 auto;
}

.main-nav ul {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav li {
    display: flex;
}

.main-nav a {
    color: black;
    text-decoration: none;
    font-size: 1.2rem;
    font-family: "degular", sans-serif;
    font-weight: 700;
    padding: 0.9rem 0.8rem;
    border-radius: 3px;
    transition: background 0.2s;
    background: url('../../src/logos/menuContainer.svg') center center no-repeat;
    background-size: cover;
    z-index: 1;
    position: relative;
}

.main-nav a:hover {
    color: var(--background-secondary-color);
}

.burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    cursor: pointer;
    margin-left: 1rem;
}

.burger span {
    display: block;
    width: 24px;
    height: 3px;
    background: #fff;
    margin: 4px 0;
    border-radius: 2px;
    transition: 0.3s;
}

/* =========================
   SLIDESHOW & VIDEO
   ========================= */
.slideshow-container,
.video-container {
    position: relative;
    width: 100%;
    max-width: 100vw;
    margin: 2rem auto;
    border: 2px solid black;
    background: #fff;
    overflow: hidden;
    min-height: 340px;
}

.video-container {
    position: relative;
    background: var(--background-secondary-color);
}


/* Vidéo principale */
.main-video {
    width: 65%;
    height: 65%;
    min-height: 480px;
    object-fit: contain;
    background: #000;
    display: block;
    margin: 0 auto;
    border-left: 2px solid black;
    border-right: 2px solid black;
}

/* Contrôles vidéo personnalisés - Barre de tâches */
.video-controls {
    position: relative;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    margin: 0;
    padding: 1em 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-primary-color);
    height: 40px;
    border-top: 2px solid black;
    box-sizing: border-box;
    z-index: 2;
}

.video-controls-inner {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 75%;
    max-width: 700px;
    margin: 0 auto;
}

/* Boutons de contrôle */
.control-btn {
    background: black;
    border: none;
    border-radius: 6px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: var(--background-secondary-color);
    transform: scale(1.05);
}

.control-btn:active {
    transform: scale(0.95);
}

/* Conteneur de la barre de progression */
.progress-container {
    flex: 1;
    height: 7px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    margin: 0 10px;
}

.progress-bar {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.progress-filled {
    height: 100%;
    background: var(--background-secondary-color);
    width: 0%;
    transition: width 0.1s ease;
    border-radius: 4px;
}

.slide-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(.77, 0, .18, 1);
    width: 100%;
    height: 650px;
}

/* Slider item: one per image */
.slide-item {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 33.3333%;
    height: 100%;
    flex-shrink: 0;
}

/* Cas spécial: 1 image = 100% width */
.slide-item[style*="width: 100%"] {
    width: 100% !important;
}

/* Cas spécial: 2 images = 50% width chacune pour afficher les 2 */
.slide-item[style*="width: 50%"] {
    width: 50% !important;
}

/* Image inside slider item */
.slide-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    user-select: none;
    pointer-events: none;
    border-right: 2px solid #111;
    box-sizing: border-box;
}

.slide-item:last-child .slide-img {
    border-right: none;
}

/* Fullscreen button overlay */

.fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--background-op-primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.fullscreen-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: black;
    border: none;
    padding: 6px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
    pointer-events: auto;
}

.fullscreen-btn svg {
    width: 22px;
    height: 22px;
    stroke: white;
    transition: stroke 0.2s;
}


.fullscreen-img {
    max-width: 75vw;
    max-height: 80vh;
    border-radius: 2vw;
    border: 2px solid black;
    /*box-shadow: 0 0 40px #000;*/
    transition: transform 0.3s ease-in-out;
}

.fullscreen-btn:hover {
    background: var(--background-secondary-color);
    box-shadow: 0 0 8px #2222;
}

.close-fullscreen {
    position: absolute;
    top: 30px;
    right: 30px;
    background: black;
    border: none;
    border-radius: 50%;
    padding: 10px;
    cursor: pointer;
    z-index: 100000;
}

.close-fullscreen svg {
    width: 24px;
    height: 24px;
    stroke: white;
}

.close-fullscreen:hover {
    background: var(--background-secondary-color);
    box-shadow: 0 0 8px #2222;
}

/* =========================
   EXPLAIN CONTAINER & PARAGRAPHS
   ========================= */

.explain-header {
    display: flex;
    align-items: center;
    gap: 7.5rem;
    justify-content: center;
}

.explain-container {
    font-family: "degular", sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 1.2rem;
    background: var(--background-primary-color);
    padding: 3rem 5rem;
    margin-bottom: 10vh;
    transform: translateZ(0);
    will-change: transform;
    position: relative;
    z-index: 1;
}

.explain-container h2 {
    font-family: "alize", sans-serif;
    font-weight: 700;
    font-style: normal;
    text-align: center;
    margin: 0;
}

.explain-container-page {
    width: 50%;
    border: 2px solid black;
    border-radius: 5vw;
    background: white;
    margin: 5rem auto;
}

.paragraphs-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4rem;
    justify-content: center;
}

.paragraphs-page {
    gap: 12rem;
    justify-content: start;
}

.paragraphs-container div {
    flex: 1 1 300px;
    min-width: 300px;
    max-width: 615px;
}

/* =========================
   ORNAMENT
   ========================= */
.ornament {
    margin: 0 auto;
    padding: 0 0 2rem 0;
    width: 18%;
    background-size: cover;
}

.ornament-page {
    width: 50%;
}

/* =========================
   GRID
   ========================= */



.grid-container {
    display: flex;
    flex-wrap: wrap;
    background-color: var(--background-secondary-color);
    border: 2px solid black;
    justify-content: center;
    border-radius: 15vw;
    padding: 2rem 1rem;
    flex: 1 0 auto;
    width: 85%;
    margin: 0 auto 4vh auto;
}

.grid-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 30%;
    margin-top: 2em;
}

.grid-cell:nth-last-child(-n+3) {
    margin-bottom: 8vh;
}

.grid-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.grid-item {
    position: relative;
    background: #fff;
    border: 2px solid var(--background-primary-color);
    border-radius: 4.5vw;
    width: 75%;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: visible;
    transition: transform 0.3s ease;
    margin-bottom: 0.5em;
}

.grid-item:hover {
    transform: scale(1.05) rotate(-1.5deg);
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 4.5vw;
}

.image-number {
    font-family: "alize", sans-serif;
    font-weight: 400;
    font-style: normal;
    position: absolute;
    left: 2.5vw;
    bottom: 3.5vh;
    width: 50px;
    height: 50px;
    background: black;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.4rem;
    z-index: 2;
}

/* Bandeaux de statut */
.status-banner {
    font-family: "beatrice", sans-serif;
    font-style: normal;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.75rem;
    letter-spacing: 1px;
    z-index: 3;
    border-bottom: 2px solid var(--background-primary-color);
    border-radius: 4.5vw 4.5vw 0 0;
    overflow: hidden;
}

.nommes-banner {
    background: white;
    color: black;
}

.laureat-banner {
    background: white;
    color: black;
}

.laureat-image {
    position: absolute;
    top: -25px;
    right: -15px;
    background: transparent;
    height: auto;
    width: 150px;
    border-bottom: none;
    z-index: 4;
    transform: rotate(15deg);
}

.laureat-image img {
    width: 100%;
    height: auto;
}

.status-page {
    color: var(--background-primary-color)
}

/* =========================
   CAPTIONS
   ========================= */
.img-caption {
    color: black;
    text-align: center;
    width: 100%;
}

.main-caption {
    font-size: 1.8rem;
    font-family: "alize", sans-serif;
    font-weight: 700;
    font-style: normal;
    margin-bottom: 5px;
    margin-top: 10px;
}

.secondary-caption {
    font-family: "degular-display", sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 1.2rem;
    line-height: 1.4rem;
}

/* =========================
   BADGES
   ========================= */
.number-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border-radius: 50%;
    color: white;
    width: 55px;
    height: 55px;
    background: black;
    margin-top: 0;
}

.image-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 245px;
    height: 160px;
    border-radius: 5vw;
    border: 2px solid black;
    background: var(--background-secondary-color);
    color: #222;
    font-weight: bold;
    font-size: 1.1rem;
    margin-left: 1rem;
    rotate: 7deg;
    gap: 0.5rem;
}

.image-badge small {
    text-align: center;
    font-family: "degular", sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: capitalize;
}

/* =========================
   FOOTER
   ========================= */
footer {
    margin-top: 2vh;
    background: white;
    padding: 1.5rem 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5rem;
    flex-wrap: wrap;
}

.footer-logo {
    width: 80px;
    height: 40px;
    background: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.footer-logo img {
    max-width: 100px;
    max-height: 75px;
    object-fit: contain;
}



/* =========================
   404
   ========================= */

.page-404,
.error-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    background: #fff;

}

.error-container {
    padding-top: 10vh;
}

.error-title {
    font-family: 'Beatrice', Arial, sans-serif;
    font-size: 8rem;
    font-weight: bold;
    color: #222;
    margin-bottom: 0.5em;
    text-align: center;
}

.error-subtitle,
.error-message,
.error-actions a {
    font-family: 'Alize', Arial, sans-serif;
    color: #444;
    text-align: center;
}

.error-subtitle {
    font-size: 2rem;
    margin-bottom: 1em;
}

.error-message {
    font-size: 1.2rem;
    margin-bottom: 2em;
}

.error-actions {
    display: flex;
    gap: 1em;
    justify-content: center;
}

.btn-home,
.btn-gallery {
    padding: 0.7em 1.5em;
    background: var(--background-secondary-color);
    color: #fff;
    border-radius: 30px;
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.2s;
}

.btn-home:hover,
.btn-gallery:hover {
    background: #444;
}