/* FONTES */
@font-face {
    font-family: "Cumulus";
    src: url('../fonts/cirruscumulus-webfont.woff2') format('woff2'),
        url('../fonts/cirruscumulus-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "Trappist";
    src: url('../fonts/montrappist-black-webfont.woff2') format('woff2'),
        url('../fonts/montrappist-black-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "CopalOutline";
    src: url('../fonts/CopalOutline.woff2') format('woff2'),
        url('../fonts/CopalOutline.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: "Copal";
    src: url('../fonts/CopalSolid.woff2') format('woff2'),
        url('../fonts/CopalSolid.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}


/* INDEX STRUCTURE 3 BLOCS, gestion des borders et hauteurs */

* body {
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    /* dvh = hauteur réellement visible sur mobile (barre de nav du
       téléphone exclue) ; 100vh reste le filet pour les navigateurs
       qui ne la comprennent pas */
    height: 100dvh;
    overflow: hidden;
}

header {
    height: 10%;
    border-bottom: 3px solid black;
}

main {
    height: 80%;
    background-color: pink;
    position: relative;
}


footer {
    height: 10%;
    border-top: 3px solid black;
}



/* TEXTE DEFILANT + DATE DU JOUR */

header {
    position: relative;
    /* pour positionner la date par-dessus */
    background-color: #26d9f7;
    overflow: hidden;
    container-type: size;
}


.marquee {
    display: flex;
    width: 100%;
    animation: marquee 50s linear infinite;
    height: 100%;
    align-items: center;
}

.marquee span {
    display: inline-block;
    font-family: "Copal";
    font-size: 95cqh;
    color: white;
    letter-spacing: 5px;
    -webkit-text-stroke: 1px black;
    white-space: nowrap;
}

@keyframes marquee {
    0% {
        transform: translateX(0%);
    }

    100% {
        transform: translateX(-100%);
    }
}


.date {
    position: absolute;
    height: 100%;
    width: 80px;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    padding: 2px;
    background-color: #F5F00E;
    text-align: center;
    white-space: nowrap;
    z-index: 2;
    /* s'assure que la date reste au-dessus */
    border-left: 3px solid black;

    display: flex;
    align-items: center;
    /* alignement vertical */
    justify-content: center;
    /* alignement horizontal */

    container-type: size;
    /* important */
}

#todayDate {
    font-family: "Trappist";
    font-size: 20cqh;
    line-height: 1;
}





/* CALENDRIER */

#no-event,
#loader {
    font-family: "Trappist";
    font-size: x-large;
    text-align: center;
    background-color: white;
    border-bottom: 3px black solid;

}

/* CONTENEUR GLOBAL : scroll horizontal des jours */
#event-list {
    display: flex;
    flex-direction: row;
    gap: 5px;
    padding: 10px;
    /* scroll désactivé : navigation uniquement via les boutons (smooth_slider.js) */
    overflow-x: hidden;
    overflow-y: hidden;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    user-select: none;
    background-color: pink;
}

/* TILE JOUR : conteneur d’une journée */
.day-tile {
    background: #fff;
    min-width: 300px;
    width: 32%;
    height: fit-content;
    /* min-height: 400px; */
    max-height: 100%;
    display: flex;
    flex-direction: column;
    border: 3px black solid;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    /* text-align: center; */
}

/* HEADER de la date */
.event-date {
    font-size: 30px;
    font-family: 'Trappist';
    background-color: red;
    color: white;
    text-align: center;

}

.event-date--today {
    background-color: #F5F00E;
    color: black;
}

/* CONTENU scrollable avec titres */
.day-tile-content {
    flex: 1;
    /* prend toute la hauteur restante */
    overflow-y: auto;
    /* scroll vertical interne */
    max-width: 99%;
    padding: 10px;

    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}




/* Scrollbar interne */
.day-tile-content::-webkit-scrollbar {
    width: 10px;
}

.day-tile-content::-webkit-scrollbar-track {
    background: #eee;
}

.day-tile-content::-webkit-scrollbar-thumb {
    background: #000;
    border-radius: 3px;
}


/* tile d’un événement (garde ton style) */
.event-tile {
    background: #fff;
    width: 300px;
    flex-shrink: 0;
    /* Ne jamais rétrécir */
    font-family: 'Trappist';
    height: fit-content;
    border-left: 3px black solid;
    border-right: 3px black solid;
    padding: 5px;
}

.event-title {
    font-family: "Copal";
    font-size: 30px;
    display: inline-block;
    /* important pour transform */
    transition: transform 0.2s ease;
    overflow-wrap: break-word;
    hyphens: auto;
}

.event-row {
    display: flex;
    /* align-items: baseline; */
    gap: 15px;
}

.event-start-hour {
    font-family: 'Trappist';
    font-size: 18px;
    /* vertical-align: middle; */
}

.event-type-tag {
    font-family: 'Trappist';
    font-size: 15px;
    border: 1.5px solid black;
    border-radius: 20px;
    padding: 2px 8px;
    margin-left: 5px;
    vertical-align: middle;
    display: inline-block;
    white-space: nowrap;
}

/* Couleurs par type — une couleur pastel distincte par type,
   teintes réparties sur toute la roue chromatique (+ variations de clarté)
   pour rester différenciables à l'œil nu. Classées par teinte. */

/* Roses → magentas */
.event-type-tag--party {
    background-color: #FF89A8;
}

.event-type-tag--dating {
    background-color: #FFC2D4;
}

.event-type-tag--sex-positive {
    background-color: #E35D8A;
}

.event-type-tag--drag {
    background-color: #F272DC;
}

/* Violets → indigos */
.event-type-tag--exhibition {
    background-color: #C773E8;
}

.event-type-tag--music {
    background-color: #A886F7;
}

.event-type-tag--screening {
    background-color: #7F7FE0;
}

.event-type-tag--performance {
    background-color: #D9BFFA;
}

/* Bleus */
.event-type-tag--conference {
    background-color: #74A8F0;
}

.event-type-tag--talk {
    background-color: #A8DCFF;
}

/* Cyans → turquoises */
.event-type-tag--gaming {
    background-color: #62C8DE;
}

.event-type-tag--board-games {
    background-color: #9FEBD5;
}

.event-type-tag--sports {
    background-color: #52CBAA;
}

/* Verts */
.event-type-tag--nature {
    background-color: #7CC47F;
}

.event-type-tag--tours {
    background-color: #B8D96E;
}

/* Jaunes → oranges */
.event-type-tag--fundraiser {
    background-color: #FFEB8C;
}

.event-type-tag--workshop {
    background-color: #E0C68A;
}

.event-type-tag--food {
    background-color: #FFD24D;
}

.event-type-tag--festival {
    background-color: #FFA050;
}

.event-type-tag--gathering {
    background-color: #FFB897;
}

/* Corail → rouge */
.event-type-tag--market {
    background-color: #FF8B72;
}

.event-type-tag--protest {
    background-color: #F26055;
}

/* Bruns */
.event-type-tag--books {
    background-color: #D69A5E;
}

.event-type-tag--archive {
    background-color: #BE9C7E;
}

/* Gris */
.event-type-tag--event {
    background-color: #D3D3D3;
}

.event-type-tag--other {
    background-color: #A9A9A9;
}

.event-title:hover {
    /* background : #F5F00E; */
    cursor: pointer;
    transform: scaleX(1.08);
    /* étirement horizontal */
    opacity: 0.8;
    color: red;

}

.event-separator {
    line-height: 0;
    align-self: center;
    padding-top: 20px;
    padding-bottom: 20px;
}


.day-column-footer {
    height: 15px;

    background: white;
    border-left: 3px black solid;
    border-right: 3px black solid;
    border-bottom: 3px black solid;

    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}






/* CONTENU OVERLAY*/


.event-overlay {
    position: fixed;
    inset: 0;
    background: rgba(249, 207, 229, 0.8);
    display: none;
    z-index: 2000;
}

.event-overlay.open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-close {
    position: absolute;
    top: 5px;
    right: 6px;
    font-size: 15px;
    cursor: pointer;
    background: white;
    border: 2px solid black;
    color: black;
}

.event-overlay-content {
    background: white;
    border: 3px black solid;
    box-shadow: 6px 6px 6px black;
    max-width: 72%;
    position: relative;
    border-radius: 12px;
    text-align: center;
    font-family: 'Trappist';
    font-size: 23px;
}

.overlay-body-wrapper {
    padding: 20px;
}

.field-label {
    font-family: 'Cumulus';
    color: red;
    font-style: italic;
}

.field-value {
    color: black;
}

.overlay-date {
    font-size: 30px;
    background-color: red;
    color: white;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.overlay-title {
    font-family: 'Copal';
    font-size: 50px;
    padding-bottom: 15px;
    /* les mots très longs se coupent au lieu de déborder de l'écran */
    overflow-wrap: break-word;
    hyphens: auto;
}

.overlay-title-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.overlay-title {
    position: relative;
    z-index: 1;
}

.overlay-event-type {
    position: absolute;
    top: -15px;
    right: -60px;
    font-family: 'Trappist';
    font-size: 18px;
    border: 1.5px solid black;
    border-radius: 20px;
    transform: rotate(20deg);
    z-index: 2;
    background-color: white;
    padding: 2px 8px;
    box-shadow: 2px 2px 2px black;
}



.overlay-description {
    padding: 15px;
}

.description-text {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
    font-style: italic;
}

.overlay-link {
    padding-top: 15px;
}

.overlay-link a {
    font-family: 'Copal';
    color: black;
}

.overlay-link a:hover {
    color: red;
}






/* SCROLL BAR */










/* BARRE DE NAVIGATION  */

footer {
    background-color: #26d9f7;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-inline: 5px;

    container-type: size;
}


footer a {
    font-family: 'Cumulus';
    font-size: 75cqh;
    line-height: 1;
    text-decoration: none;
    color: black;

}

footer a:hover {
    background-color: pink;
    color: red;
    font-style: italic;
    /* font-weight: bold; */
}


/* BOUTONS NAVIGATION TIMELINE */

.timeline-nav-group {
    position: absolute;
    bottom: 10px;
    display: flex;
    gap: 8px;
    z-index: 100;
}

.timeline-nav-group--left  { left:  10px; }
.timeline-nav-group--right { right: 10px; }

.timeline-nav {
    display: none;
    font-family: 'Cumulus';
    font-size: 22px;
    background: #F5F00E;
    border: 1px solid black;
    padding: 5px 10px;
    cursor: pointer;
    color: black;
}

.timeline-nav:hover {
    color: red;
    font-style: italic;
    font-weight: bold;
}

.timeline-nav.visible { display: block; }


/* FLECHE DE RETOUR A L'INDEX */


.go-back-link {
    position: fixed;
    left: 5px;
    z-index: 1000;
    bottom: 5px;
    background: #F5F00E;
    border: 1px solid black;
}

.go-back-link a {
    font-family: 'Cumulus';
    font-size: 26px;
    text-decoration: none;
    color: black;
    display: flex;
    align-items: center;
    gap: 5px;
    background-color: transparent;
    padding: 5px;
}

.go-back-link a:hover {
    color: red;
    font-style: italic;
    font-weight: bold;
}

.go-back-link a:hover .arrow {
    transform: translateX(-4px);
    transition: transform 0.2s ease;
}




/* PAGE FORMULAIRE */

.formular-page {
    width: 100%;
    height: 100%;
    background-color: pink;
    text-align: center;
    overflow-y: scroll;

}

.formular-container {
    padding: 50px;
}

.formular-title {
    font-family: 'Copal';
    font-size: 50px;
    line-height: 1;
    margin-bottom: 20px;
}

.formular-text p {
    font-family: 'Trappist';
    font-size: 20px;
    line-height: 1;
}

.formular-text a {
    text-decoration: underline;
    color: red;
}


.formular {
    background-color: white;
    font-family: "Trappist";
    color: black;
    font-size: 20px;
    line-height: 1.1;
    box-shadow: 5px 5px 5px black;
    padding: 50px;
    /* border-radius: 10px; */
}

::placeholder,
#date,
#startingHour,
#endingHour,
#price,
.hint {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
}

.hint {
    font-style: italic;
}

/* le textarea reprend l'apparence des inputs (sa police par défaut est monospace) */
#description {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    resize: vertical;
    vertical-align: middle;
    box-sizing: border-box;
}

.accessibility-options {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    display: inline-grid;
    grid-template-columns: repeat(4, auto);
    gap: 4px 16px;
    text-align: left;
}


.submit-button {
    font-family: "Copal";
    font-size: 30px;
    background-color: #26d9f7;
    padding: 5px;
    border: 3px black solid;
    border-radius: 5px;
}

.submit-button:hover {
    background-color: #F5F00E;
}





/* PAGE ABOUT */


.about-page {
    width: 100%;
    height: 100%;
    background-color: pink;
    text-align: center;
    display: flex;
    overflow-y: scroll;

}

.about-container {
    max-width: 80%;
    padding-left: 10%;
    padding-right: 10%;
    padding-top: 5%;
    text-align: center;
}

.about-title {
    font-family: 'Copal';
    font-size: 50px;
    line-height: 1;
    margin-bottom: 20px;
}

.about-text p {
    font-family: 'Trappist';
    font-size: 23px;
    line-height: 1.2;
}

.about-text a {
    text-decoration: underline;
    color: red;
}

/* Logos partenaires en fin de page */
.about-logos {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
    padding: 40px 0;
}

.about-logos img {
    max-height: 90px;
    max-width: 45%;
    height: auto;
}









/* PAGE ADMIN */


.admin-page-container {
    width: 100%;
    height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 20px;
    overflow: scroll;
}

.admin-page-container button {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 20px;
    padding: 5px;
}

#admin-login {
    text-align: center;
    padding-top: 20px;
}

.admin-logout {
    text-align: center;
    padding-top: 20px;
    display: flex;
    justify-content: center;
    gap: 12px;
}


/* Container de la liste admin */
#admin-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#admin-event-list ul {
    padding: 0;
    margin: 0;
}

#admin-overview {
    padding: 20px 20px 0;
}

.overview-table {
    width: 100%;
    border-collapse: collapse;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
}

.overview-table th,
.overview-table td {
    border: 2px solid black;
    padding: 8px 16px;
    text-align: center;
}

.overview-table thead {
    background-color: white;
    font-weight: bold;
}

.overview-table tbody td:nth-child(1) { background-color: #F5F00E; }
.overview-table tbody td:nth-child(2) { background-color: #85E89D; }
.overview-table tbody td:nth-child(3) { background-color: #FFADAD; }
.overview-table tbody td:nth-child(6) { background-color: #C7CEEA; }

/* Cellules cliquables du tableau récap (filtres) */
.overview-table .filter-cell {
    cursor: pointer;
    user-select: none;
}

.overview-table .filter-cell:hover {
    text-decoration: underline;
}

.overview-table .filter-active {
    box-shadow: inset 0 0 0 3px black;
    font-weight: bold;
}

/* Barre de recherche sous le tableau récap */
#admin-search {
    padding: 12px 20px 0;
}

#admin-search input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 16px 8px 42px;
    border: 2px solid black;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    /* Fond grisé + icône loupe à gauche pour distinguer la barre du fond du site */
    background-color: #E9E9E9;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='16.5' y1='16.5' x2='22' y2='22'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
    background-size: 18px 18px;
}

#admin-search-count {
    margin: 6px 0 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-style: italic;
}

/* Chaque ligne d’événement = 3 blocs en flex */
.admin-event-item {
    display: flex;
    align-items: center;
    /* verticalement centré */
    justify-content: space-between;
    /* espace entre les 3 blocs */
    gap: 1rem;
    /* petit espace entre colonnes si supporté */
    padding: 20px;
}

/* Bloc infos = prend plus de place */
.event-info-block {
    flex: 2;
    max-width: 60%;
}

.event-info-block a {
    display: block;
    max-width: 100%;
    overflow-y: hidden;
}

/* Boutons + statut = colonnes plus étroites */
.event-actions-block,
.event-status-block {
    flex: 0 0 auto;
}


/* MOBILE VERSION */

@media (max-width: 767px) {

    header {
        height: 8%;
        border-bottom: none;
    }

    main {
        height: 84%;
    }

    footer {
        height: 8%;
        border-top: none;
    }



    .marquee {
        animation: marquee 10s linear infinite;
    }

    .date {
        display: none;
    }

    #event-list {
        gap: 5px;
        padding: 5px;
        /* mobile : retour au scroll tactile natif */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* mobile : pas de navigation par boutons */
    .timeline-nav-group {
        display: none;
    }



    /* une tuile et demie visible par écran (gap de 5px compris) */
    .day-tile {
        height: max-content;
        min-width: 0;
        flex: 0 0 calc((100% - 5px) / 1.5);
        border: none;
        box-shadow: 3px 3px 3px black;

    }

    .day-tile-content {
        padding: 10px;
        /* pas de scroll horizontal à l'intérieur d'une tuile */
        overflow-x: hidden;
    }

    /* .day-tile-content:has(:only-child) {
	justify-content: start;
    } */

    .event-date {
        font-size: 22px;
        border-bottom: none;
        border-radius: 0px;
    }

    .event-row {
        display: block;
        text-align: center;
    }

    /* l'horaire occupe toujours sa propre ligne, le titre passe dessous */
    .event-start-hour {
        display: block;
    }

    .event-title {
        font-size: 30px;
    }

    .event-separator {
        padding-top: 10px;
        padding-bottom: 10px;
    }

    /* les trois liens alignés horizontalement dans un footer compact */
    footer {
        background-color: #26d9f7;
        text-align: center;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-around;
        container-type: size;
    }

    footer a {
        font-size: 40cqh;
        white-space: nowrap;
        padding-inline: 0;
        border-radius: 5px;
        /* background-color: pink; */
        line-height: 1;

    }

    .event-overlay-content {
        width: 100vw;
        font-size: 20px;
        height: 100vh;
        /* dvh = hauteur réellement visible sur mobile, sinon le
           bandeau du haut (date) est poussé hors écran par le
           centrage vertical */
        height: 100dvh;
        overflow-y: scroll;
        /* le tag du titre ne doit jamais créer de débordement latéral */
        overflow-x: hidden;
        max-width: 100%;
        border: none;
        box-shadow: none;
        border-radius: 0;
    }

    .overlay-date{
        border-top-left-radius: 0;
        border-top-right-radius: 0;
    }

    /* tag recentré : léger débord sur le coin du titre, mais toujours dans l'écran
       (le wrapper du titre est à 20px minimum du bord grâce au padding) */
    .overlay-event-type {
        top: -12px;
        right: -10px;
        font-size: 15px;
    }



    .about-container {
        margin: 20px;
        padding: 20px;
        max-width: 100%;
    }

    .about-title {
        font-size: 28px;
        margin-bottom: 15px;
    }

    .about-text {
        font-size: 21px;
    }


    .formular-container {
        margin: 20px;
        padding: 20px;
    }

    .formular {
        font-size: 18px;
        text-align: center;
        padding: 20px;
    }

    .formular-title {
        font-size: 30px;
    }

    input {
        max-width: 100%;
        text-align: center;
    }

    /* placeholders un peu plus petits pour tenir en entier dans l'écran */
    ::placeholder {
        font-size: 11px;
    }

    .accessibility-options {
        grid-template-columns: auto;
        width: 100%;
        text-align: center;
    }

    textarea {
        max-width: 100%;
    }


    .admin-page-container {
        font-size: 12px;
    }

    .admin-page-container button {
        font-size: 12px;
    }

    .overview-table thead {
        display: none;
    }

    .overview-table,
    .overview-table tbody {
        display: block;
        width: 100%;
    }

    .overview-table tr {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .overview-table td {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 8px 4px;
        font-size: 13px;
        border: 1.5px solid black;
        text-align: center;
        gap: 4px;
    }

    .overview-table td::before {
        content: attr(data-label);
        font-weight: bold;
        text-transform: uppercase;
        font-size: 9px;
        color: #333;
    }

    .overview-table tbody td:nth-child(1) { background-color: #F5F00E; }
    .overview-table tbody td:nth-child(2) { background-color: #85E89D; }
    .overview-table tbody td:nth-child(3) { background-color: #FFADAD; }
    .overview-table tbody td:nth-child(6) { background-color: #C7CEEA; }

    .event-actions-block,
    .event-status-block {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }


    /* en haut à gauche sur mobile, avec seulement la flèche */
    .go-back-link {
        top: 5px;
        bottom: auto;
        left: 5px;
    }

    .go-back-link a {
        font-size: 0; /* masque le texte "Agenda" (nœud texte nu) */
        padding: 3px;
    }

    .go-back-link .arrow {
        font-size: 20px;
        line-height: 1;
        /* centrage propre du glyphe dans sa propre boîte, plutôt
           qu'un décalage fixe en pixels qui dépend du rendu de la
           police sur chaque appareil */
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }


}








/* MODALE SUCCESS - soumission formulaire */

#success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(170, 170, 170, 0.6);
    display: none;
    z-index: 3000;
}

#success-overlay.open {
    display: flex;
    align-items: center;
    justify-content: center;
}

#success-modal {
    background: white;
    border: 3px solid black;
    border-radius: 12px;
    padding: 40px 48px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    animation: fadeInScale 0.3s ease;
}

#success-title {
    font-family: 'Copal';
    font-size: 40px;
    margin: 0 0 12px;
    color: black;
    line-height: 1.1;
}

#success-subtitle {
    font-family: 'Trappist';
    font-size: 22px;
    margin: 0;
}



@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.85);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 767px) {
    #success-modal {
        padding: 28px 24px;
        max-width: 85vw;
    }

    #success-title {
        font-size: 30px;
    }

    #success-subtitle {
        font-size: 15px;
    }
}