@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cabin:ital,wght@0,400..700;1,400..700&display=swap');

:root {
    --cb-green: rgb(5, 72, 52);

    --cb-red: #860000;
    --cb-red-rgb: rgb(134, 0, 0);
    --shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    --tagged: rgb(0, 60, 255);
}

:popover-open {
    position: fixed;
    top: 95%;
}

html {
    font-size: 16px;
    height: 100%;
}

.post.preview {
    background: white;

}

body {
    padding: 0;
    margin: 0;
    height: 100%;
    font-family: Poppins, sans-serif;
    font-size: 1rem;
    display: flex;
    flex-direction: column;
}

body > main {
    flex: 1;
}


footer::before {
    min-height: 80vh;
}

.title-logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-decoration: none;
}

.hamburger {
    margin-top: 8px;
    display: none;
    cursor: pointer;
}

.title-logo h1 {
    margin-left: 30px;
    min-width: 50vw;
    text-align: left;
}

.screen-header {
    background: var(--cb-green);
    padding: 20px 0;
}

.nav-fragment {
    font-size: 20px;
}

.nav-fragment a {
    text-decoration: none;
}

.mobile-menu {
    display: none;
}

nav h1 {
    text-align: center;
    margin: 0;
    color: white;
    padding: 10px 0;
    font-size: 2.2rem;
    font-family: 'Cabin', sans-serif;
}

nav ul {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

nav li a {
    color: white;
}

sup, .error {
    color: red;
}

.complete-post-buttons {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.delete-post-button {
    margin-right: 10px;
}

.delete {
    color: red;
    border: none;
    background: none;
}

.delete:hover {
    cursor: pointer;
    opacity: 0.7;
}

.back-button {
    background: transparent;
    border: none;
}

.back-button:hover {
    cursor: pointer;
    color: darkred;
    opacity: 0.8;
}

.author-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1 1 auto; /* prend la place restante, mais peut se réduire */
    min-width: 0;
}

.post__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap; /* ❗️ Pas de saut de ligne */
    gap: 1rem;
    min-width: 0; /* évite les débordements */
}


.author-wrapper img {
    width: 48px;
    height: 48px;
    object-fit: cover;     /* remplissage sans déformation */
    aspect-ratio: 1 / 1;   /* assure un carré si height/width ne suffisent pas */
    border-radius: 50%;    /* pour arrondir (facultatif si tu veux un cercle) */
    flex-shrink: 0;        /* ne se rétrécit jamais */
}

.star {
    font-size: 0.9rem;
    color: gray;
}

button.share:hover {
    cursor: pointer;
    color: darkred;
    opacity: 0.8;
}

section:not(.long-text) input[type="checkbox"] {
    display: none;
}

.long-text p.post__body {
    --max-lines: 3;
    --line-height: 1.55;
    max-height: calc(var(--max-lines) * 1em * var(--line-height));
    line-height: var(--line-height);
    overflow: hidden;
    position: relative;
}

.post__body:has(+ .expand-button:not(:checked))::before {
    content: "";
    position: absolute;
    height: calc(1em * var(--line-height));
    width: 100%;
    bottom: 0;
    pointer-events: none;
    background: linear-gradient(to bottom, transparent, white);
}

.long-text .expand-button {
    appearance: none;
    padding: .5em;
    margin: 0;
    border-radius: .25em;
    cursor: pointer;
    text-decoration: underline;
}

.expand-button:hover {
    background-color: #ccc;
}

.expand-button::before {
    content: "Voir plus"
}

.expand-button:checked::before {
    content: "Voir moins"
}

.post__body:has(+ .expand-button:checked) {
    max-height: none;
}

.post__title a {
    text-decoration: none;
    color: var(--cb-red);
}

.next-page-button {
    display: flex;
    align-items: center;
    justify-content: center;
}

.next-page-button button {
    background: none;
    border: none;
    color: var(--cb-red);
}

.next-page-button button:hover {
    cursor: pointer;
}

.next-page-button button:disabled {
    opacity: 0.5;
    cursor: default;
}

.next-page-button svg {
    width: 24px;

}

.current.reaction {
    border: 2px solid red;
    border-radius: 50px;
    background-color: #fffaf0;
}
.page-number {
    box-sizing: border-box;
    padding: 5px 12px;
    margin: 0 5px;
    border-radius: 10px;
    background-color: #fde5e5;
    color: black;
    border:1px solid var(--cb-red);
    font-weight: bold;
    cursor:pointer;
}

.current-page-number {
    box-sizing: border-box;
    padding: 7px 15px;
    margin: 0 15px;
    border-radius: 10px;
    background-color: var(--cb-red);
    color: white;
    font-weight: bold;
    cursor:pointer;
}

.create-post {
    margin-top: 40px;
}

.newpost-body {
    width: 100%;
}

footer {
    margin: 10px 0;
    padding: 20px 0;
    text-align: center;
}


.media-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    width: 100%;
    padding: 10px 0;
}

.media-container > a {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%;
}

.media-container > a > img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photoswipe-a {
    height: 150px;
}

.post-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pinned {
    display: flex;
    flex-direction: row-reverse;
    gap: 0.5rem;
    flex-shrink: 0; /* ❗️ ne se rétrécit pas */
    align-items: center;
}


.pin-button, .unpin-button {
    background: none;
    border: none;
    width: 1rem;
}

.pin-button:hover, .unpin-button:hover {
    color: var(--cb-red);
    cursor: pointer;
    opacity: 0.7;
}


body {
    background: rgba(157, 211, 145, 0.21);

}

.form-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    margin: 50px 0;
}

form.auth-form {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    background-color: white;
    width: 500px;
    padding: 1rem;
    border-radius: 15px;
    border: 5px solid var(--cb-green);
}

form.auth-form h2 {
    margin: 0.5rem 0;
    font-size: 2rem;
}

form.auth-form label {
    padding: 0.5rem 0;
}

form.auth-form input {
    font-size: 1rem;
    border-radius: 15px;
    border: none;
    background-color: #eee;
    width: 95%;
    height: 30px;
    margin-bottom: 0.5rem;
    padding: 0.2rem 0.5rem;
}

form.auth-form button {
    padding: 10px 16px;
    font-size: 19px;
    margin: 1rem 0;
    color: white;
    background-color: var(--cb-red);
    border: 1px solid white;
    border-radius: 15px;
    cursor: pointer;

}

form.new-post {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    background-color: white;
    width: 500px;
    padding: 1rem;
    border-radius: 15px;
    border: 5px solid var(--cb-green);
}


section.new-post {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-forum {
    padding: 0 20%;
}

.notif-newpost-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-right: 20px;
}

.new-post-button, .notif-button, .previous-button {
    background: var(--cb-red);
    font-family: Poppins, sans-serif;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    font-size: 16px;
    margin: 16px 0px;
    padding: 8px 12px;
    border-radius: 50px;
}

.new-post-button:hover, .notif-button:hover,  .previous-button:hover {
    opacity: 0.8;
    cursor: pointer;
}

.new-post-button:active, .notif-button:active,  .previous-button:active {
    opacity: 0.6;
}

#previous-select, #previous-select>option {
    display: none;
    padding:5px 8px;
    background:var(--cb-red);
    border:none;
    border-radius:15px;
    color:white;
}

.new-post-button svg + span {
    padding-left: .3rem;
}

.welcome {
    font-size: 24px;
    margin: 10px;
    color: var(--cb-red);
}

form.new-post {
    margin: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

form.new-post h2 {
    color: var(--cb-red);
    font-size: 24px;
}

form.new-post input {
    width: 90%;
    margin: 0 10px;
    outline: none;
    border: 1px solid #ddd;
    transition: border-color 0.1s ease-out;
    font-size: 1rem;
    border-radius: 15px;
    background-color: #eee;
    height: 30px;
    padding: 0.2rem 0.5rem;
}

form.new-post textarea {
    width: 90%;
    min-height: 20vh;
    margin: 0 10px;
    padding: 15px;
    border: 1px solid #ddd;
    background: #eee;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    border-radius: 15px;
    outline: none;
    transition: border-color 0.1s ease-out;
}

form.new-post :is(input, textarea):focus {
    border-color: var(--cb-red);
}

form.new-post label[for="media"] {
    margin-top: 20px;
    cursor: pointer;
    text-decoration: underline;
}

form.new-post label[for="media"]:hover {
    color: var(--cb-red);
    font-weight: bold;
}

.tag-button,#confirm-bleu-taglist {
    background: none;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 16px;
}

.tag-button:hover,#confirm-bleu-taglist:hover {
    color: var(--cb-red);
    background: rgba(218, 164, 164, 0.28);
    cursor: pointer;
}

.tagged-bleu {
    color: var(--tagged);
    font-weight: bold;
    text-decoration: underline;
}


.ancien {
    color: darkgoldenrod;
    font-weight: bold;
}

.togé {
    color: var(--cb-red);
    font-weight: bold;
}

.assistant {
    color: var(--cb-green);
}

.bleu {
    color: #0367d9;
}

.banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: url("../img/current-landing-background-image.png") no-repeat center top;
    height: 500px;
    color: white;
    -webkit-background-size: cover;
    box-shadow: 0 5px 5px black;
}

.banner-logo {
    width: 200px;
    margin: 25px 0;

}

.banner-title {
    margin: 25px 0;
    font-size: 40px;
    text-transform: capitalize;
    text-align: center;
    text-shadow: 0 0 20px black;
}

.banner-subtitle {
    margin-bottom: 25px;
    text-shadow: 0 0 20px black;
}

.landing-container {
    margin: 50px auto;
    max-width: 900px;
    background: white;
    padding: 30px;
    border-radius: 15px;
    font-family: "Cabin", sans-serif;
    font-size: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    line-height: 1.6;
}

.landing-container h1 {
    text-align: center;
    font-size: 40px;
}

.landing-container h2 {
    font-size: 30px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 5px;
}

.landing-container p {
    text-align: justify;
}

.landing-container ul {
    padding-left: 20px;
}

.landing-container blockquote {
    font-style: italic;
    border-left: 5px solid #ccc;
    padding-left: 15px;
    color: #555;
}

.landing-container a {
    color: #007bff;
    text-decoration: none;
}

.landing-container a:hover {
    text-decoration: underline;
}


.app-container {
    max-width: 900px; /* Même largeur que .landing-container */
    margin: 0 auto; /* Centre le bloc */
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 20px;
}

.app-container h2 {
    margin: 0;
}

.app-container button {
    margin-left: auto;
    margin-right: auto;
    box-shadow: var(--shadow);
    cursor: pointer;
    background: var(--cb-red);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    padding: 15px 20px;
    border-radius: 50px;
    gap: 8px;
    white-space: nowrap;
}

.app-container button svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

.app-container button span {
    display: inline-block;
    line-height: 1;
    vertical-align: middle;
    font-size: 20px;
}


.comite-members {
    display: flex;
    flex-direction: column;
}

.comite-list a {
    text-decoration: none;
    color: var(--cb-green);
}

.ancien-list li {
    color: var(--cb-green);
}

.comite-role-title {
    color: var(--cb-red);
    font-weight: bold;
}

.comite-list, .ancien-list {
    list-style-type: none;
}


.post.preview, article.post, button.reaction {
    /*background: rgba(208, 208, 208, 0.32);*/
    background: white;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
article.post.previously,.post.preview.previously, button.reaction.previously {
    background-color: rgba(231, 219, 219, 0.28);
font-style:italic;
}

/* LANDING ADMIN FORM */

.new-landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    width: 50%;
}

.new-landing h2 {
    width: 100%;
    text-align: center;
}

button.new-landing-button {
    box-shadow: var(--shadow);
}

.main-post {
    padding: 20px 20%;
}


/* Overlay sombre */
.tag-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Conteneur de la popup */
.tag-popup {
    background: #fff;
    max-width: 90%;
    width: 400px;
    max-height: 80vh;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    position: relative;
    font-family: sans-serif;
}


/* Bouton de fermeture */
.tag-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
}
.all-bleus-list-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.all-bleus-list {
    list-style: none;
}

@media only screen and (max-width: 1200px) {
    .main-post {
        padding: 20px 10%;
    }

    .main-admin {
        padding: 0;
    }

    .title-logo img {
        margin-left: 15px;
    }

    .title-logo h1 {
        margin-left: 10px;
        min-width: 0;
        text-align: center;
    }

    .hamburger {
        margin-right: 10px;
    }

    .media-container {
        grid-template-columns: repeat(4, 1fr);
    }

    .new-comite {
        margin: 50px;
    }

    .new-landing {
        width: 80%;
    }
}



@media only screen and (max-width: 850px) {
    form.auth-form, form.new-post {
        width: 90%;
    }

    body {
        overflow-x: hidden;
    }

    .banner {
        height: 400px;
    }

    .banner-logo {
        width: 150px;

    }

    .banner-title {
        margin: 5px 0;
        font-size: 30px;
        text-transform: capitalize;
        text-align: center;
    }

    .banner-subtitle {
        margin-bottom: 0;
    }

    .nav-fragment {
        display: none;
    }

    .hamburger {
        display: block;
    }

    .mobile-menu {
        z-index: 999;
        display: grid;
        align-content: center;
        position: fixed;
        left: 100%;
        width: 100vw;
        height: 100vh;
        background: var(--cb-green);
        transition: transform 0.1s ease;
    }

    .mobile-ul {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        align-items: center;
        height: 50vh;
    }

    .mobile-fragment {
        font-size: 30px;
        font-weight: bold;
    }

    .mobile-fragment:hover {
        opacity: 0.8;
    }

    .mobile-fragment:active {
        opacity: 0.6;
    }

    .mobile-fragment a {
        text-decoration: none;
    }

    .close-mobile-menu {
        position: absolute;
        top: 5%;
        left: 85%;
    }

    .auth-form {
        width: 80%;
    }

    .media-container {
        grid-template-columns: repeat(3, 1fr);
    }

    .new-comite {
        margin: 25px 15px;
    }

    main, .main-post {
        padding: 0 15px;
    }

    .main-admin {
        padding: 0;
    }

    .new-landing {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    main.main-new-landing {
        padding: 0 5%;
    }
    .page-number {
        padding: 5px 8px;
        margin: 0 2px;
        font-size: 12px;
    }

    .current-page-number {
        box-sizing: border-box;
        padding: 7px 10px;
        margin: 0 5px;
        border-radius: 10px;
        background-color: var(--cb-red);
        color: white;
        font-weight: bold;
        cursor:pointer;
    }
}


