:root {
    --turquoise: #44c7c5;
    --turquoise-dark: #169fa4;
    --navy: #071f32;
    --ink: #10283a;
    --paper: #f7f3ea;
    --white: #ffffff;
    --yellow: #f7c936;
    --orange: #f28a2e;
    --purple: #6e36a8;
    --pink: #d83376;
    --border-soft: rgba(7, 31, 50, 0.1);
    --shadow-soft: 0 18px 44px rgba(7, 31, 50, 0.13);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow-x: hidden;
    background:
        conic-gradient(from 18deg at 12% 18%, rgba(68, 199, 197, 0.4), transparent 23%, rgba(247, 201, 54, 0.28), transparent 47%),
        conic-gradient(from 205deg at 88% 20%, rgba(110, 54, 168, 0.32), transparent 27%, rgba(216, 51, 118, 0.16), transparent 52%),
        linear-gradient(135deg, #d9f0ed 0%, #f9f5ed 45%, #e9ddf2 100%);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    text-align: left;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: url("../image/graffiti-pages-bg.png");
    background-repeat: no-repeat;
    background-position: center top;
    background-size: max(1280px, 100vw) auto;
    opacity: 0.42;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        repeating-linear-gradient(0deg, rgba(7, 31, 50, 0.026) 0 1px, transparent 1px 42px),
        repeating-linear-gradient(90deg, rgba(7, 31, 50, 0.022) 0 1px, transparent 1px 42px);
    opacity: 0.55;
}

a {
    color: var(--turquoise-dark);
    text-decoration: none;
}

a:hover {
    color: var(--navy);
}

/* ===================== */
/* HEADER */
/* ===================== */
header {
    width: min(1120px, calc(100% - 24px));
    margin: 14px auto 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 18px 16px 20px;
    background:
        radial-gradient(circle at 18% 20%, rgba(247, 201, 54, 0.95) 0 18%, transparent 19%),
        radial-gradient(circle at 86% 10%, rgba(68, 199, 197, 0.85) 0 16%, transparent 17%),
        linear-gradient(120deg, #fdf6d8 0%, #d9f3ef 46%, #eadcf6 100%);
    color: var(--navy);
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(7, 31, 50, 0.14);
    box-sizing: border-box;
}

.site-title {
    margin: 0;
    padding-left: 0;
    color: var(--navy);
    font-size: clamp(22px, 3vw, 31px);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.05;
    text-align: center;
    text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.72);
}

.site-title::before {
    content: none;
}

/* ===================== */
/* CONTENU */
/* ===================== */
.container {
    box-sizing: border-box;
    max-width: 900px;
    width: min(900px, calc(100% - 32px));
    margin: 26px auto 42px;
    padding: 20px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
    align-self: center;
}

body > main {
    width: min(760px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 40px;
    box-sizing: border-box;
    text-align: left;
}

body > main > section,
body > main > form:not(.standard-form) {
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
}

body > main > form:not(.standard-form) {
    max-width: 460px;
    margin: 0 auto;
    padding: 24px;
}

body > main > form:not(.standard-form) h2,
body > main > section h2 {
    margin-top: 0;
    color: var(--navy);
}

body > main > form:not(.standard-form) label {
    display: block;
    margin: 12px 0 6px;
    color: var(--navy);
    font-weight: 900;
}

body > main > form:not(.standard-form) input,
body > main > form:not(.standard-form) select,
body > main > form:not(.standard-form) textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid rgba(7, 31, 50, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--ink);
    font: inherit;
}

button,
input[type="submit"] {
    border: 0;
    border-radius: 12px 18px 11px 20px;
    padding: 10px 16px;
    background: var(--yellow);
    color: var(--navy);
    font: inherit;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 5px 5px 0 var(--navy);
}

button:hover,
input[type="submit"]:hover {
    background: #ffe071;
    transform: translateY(-1px);
}

/* ===================== */
/* NAV */
/* ===================== */
.site-nav,
.social-media {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.site-nav {
    padding: 7px;
    border-radius: 18px 28px 16px 24px;
    background: rgba(255, 255, 255, 0.66);
    box-shadow: 0 12px 30px rgba(7, 31, 50, 0.08);
    backdrop-filter: blur(14px);
}

.site-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 13px 18px 12px 17px;
    color: var(--navy);
    font-weight: 900;
    text-decoration: none;
}

.social-media a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.site-nav a:hover {
    background: var(--yellow);
    color: var(--navy);
    transform: rotate(-1deg);
}

.social-media a:hover {
    opacity: 0.85;
}

/* ===================== */
/* FOOTER */
/* ===================== */
.site-footer {
    width: 100%;
    margin-top: auto;
    padding: 16px 6%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    background: var(--navy);
    color: var(--white);
    box-shadow: 0 -12px 36px rgba(7, 31, 50, 0.14);
    box-sizing: border-box;
}

/* colonnes */
.footer-left,
.footer-center,
.footer-right {
    flex: 1;
    display: flex;
    align-items: center;
}

/* gauche */
.footer-left {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 8px 14px;
}

/* centre */
.footer-center {
    justify-content: center;
    text-align: center;
    font-size: 14px;
}

.footer-center p {
    margin: 0;
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--white);
    color: var(--navy);
    font-weight: 700;
}

/* droite */
.footer-right {
    justify-content: flex-end;
    gap: 10px;
}

/* logos */
.footer-logo {
    width: 42px;
    height: 42px;
    padding: 5px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 24px rgba(7, 31, 50, 0.1);
}

/* lien */
.footer-left a {
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--white);
    color: var(--navy);
    font-weight: 900;
    text-decoration: none;
}

.footer-left a:hover {
    opacity: 0.86;
}

/* ===================== */
/* PAGES LÉGALES */
/* ===================== */
.legal-page {
    width: min(860px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 40px;
    box-sizing: border-box;
    text-align: left;
}

.legal-panel {
    padding: clamp(20px, 4vw, 30px);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
}

.legal-panel h2 {
    margin: 24px 0 8px;
    color: var(--navy);
}

.legal-panel h2:first-child {
    margin-top: 0;
}

.legal-panel p,
.legal-panel li,
.legal-panel dd {
    line-height: 1.6;
}

.legal-panel dl {
    display: grid;
    grid-template-columns: minmax(140px, 220px) 1fr;
    gap: 8px 16px;
    margin: 14px 0 0;
}

.legal-panel dt {
    color: var(--navy);
    font-weight: 900;
}

.legal-panel dd {
    margin: 0;
}

@media (max-width: 700px) {
    header {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-nav {
        justify-content: flex-start;
    }

    .site-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .footer-left,
    .footer-center,
    .footer-right {
        width: 100%;
        justify-content: flex-start;
    }

    .legal-panel dl {
        grid-template-columns: 1fr;
        gap: 4px;
    }
}

/* ===================== */
/* DÉROULANTS COMMENTAIRES */
/* ===================== */
.comments-dropdown {
    margin: 12px 0 6px;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.comments-dropdown summary {
    cursor: pointer;
    color: #555;
    font-size: 13px;
    font-weight: 700;
    list-style-position: inside;
}

.comments-dropdown summary:hover {
    color: #222;
}

.comments-dropdown .comments-list {
    margin: 10px 0 6px;
    border-top: 0;
    padding-top: 0;
}

/* ===================== */
/* COMPTE UTILISATEUR */
/* ===================== */
.account-page {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 24px 16px;
    box-sizing: border-box;
    text-align: left;
}

.account-panel {
    padding: 20px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
}

.account-panel h2 {
    margin-top: 0;
}

.account-help {
    color: rgba(16, 40, 58, 0.72);
    line-height: 1.5;
}

.account-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.account-form input {
    padding: 10px 12px;
    border: 1px solid rgba(7, 31, 50, 0.18);
    border-radius: 8px;
    font: inherit;
}

.account-form button {
    align-self: flex-start;
    margin-top: 6px;
    padding: 10px 16px;
    border: 0;
    border-radius: 12px 18px 11px 20px;
    background: var(--yellow);
    color: var(--navy);
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

.account-message {
    padding: 10px 12px;
    border-radius: 8px;
    font-weight: 800;
}

.account-message.success {
    background: rgba(238, 248, 238, 0.92);
    color: #2c5a37;
}

.account-message.error {
    background: rgba(253, 236, 234, 0.92);
    color: #c0392b;
}

/* ===================== */
/* FORMULAIRES COMMUNS */
/* ===================== */
.publish-page,
.form-page {
    width: min(640px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 34px;
    box-sizing: border-box;
    text-align: left;
}

.standard-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
}

.standard-form label {
    color: var(--navy);
    font-weight: 900;
}

.standard-form input,
.standard-form select,
.standard-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(7, 31, 50, 0.18);
    border-radius: 8px;
    font: inherit;
    box-sizing: border-box;
}

.standard-form input[type="file"] {
    background: rgba(247, 243, 234, 0.76);
}

.standard-form input:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.publication-media-field {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.publication-media-field[hidden] {
    display: none;
}

.standard-form button {
    align-self: flex-start;
    margin-top: 6px;
    padding: 10px 16px;
    border: 0;
    border-radius: 12px 18px 11px 20px;
    background: var(--yellow);
    color: var(--navy);
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

.standard-form button:hover {
    background: #ffe071;
}

.field-help {
    margin: -4px 0 4px;
    color: rgba(16, 40, 58, 0.72);
    font-size: 13px;
    line-height: 1.4;
}

.current-publication-media {
    display: grid;
    justify-items: center;
    gap: 8px;
    max-width: 100%;
    overflow: hidden;
    padding: 10px;
    border: 1px solid rgba(7, 31, 50, 0.1);
    border-radius: 8px;
    background: rgba(247, 243, 234, 0.72);
}

.current-publication-media strong {
    color: var(--navy);
    font-size: 13px;
}

.current-publication-media img {
    display: block;
    width: 100%;
    max-width: min(100%, 460px);
    height: auto;
    max-height: 520px;
    max-height: min(58vh, 520px);
    justify-self: center;
    border-radius: 8px;
    object-fit: contain;
    object-position: center;
    background: rgba(255, 255, 255, 0.8);
}

.current-publication-media video {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    object-fit: contain;
    object-position: center;
    background: rgba(255, 255, 255, 0.8);
}

.form-cancel-link {
    align-self: flex-start;
    color: var(--navy);
    font-size: 14px;
    font-weight: 700;
}

/* ===================== */
/* ACTUALITÉS INDEX */
/* ===================== */
.news-admin-page {
    width: min(920px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 34px;
    box-sizing: border-box;
    text-align: left;
}

.news-admin-panel {
    margin-bottom: 18px;
    padding: 20px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
}

.news-admin-panel h2 {
    margin-top: 0;
}

.news-admin-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.news-admin-form input[type="text"],
.news-admin-form input[type="datetime-local"],
.news-admin-form input[type="file"],
.news-admin-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(7, 31, 50, 0.18);
    border-radius: 8px;
    font: inherit;
    box-sizing: border-box;
}

.news-admin-form input[type="file"] {
    background: rgba(247, 243, 234, 0.76);
}

.news-admin-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-admin-current-image {
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: rgba(247, 243, 234, 0.72);
}

.news-admin-current-image img {
    display: block;
    width: 100%;
    max-width: 260px;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    object-position: center;
    border-radius: 6px;
    background: rgba(238, 243, 238, 0.88);
}

.news-admin-thumb {
    display: block;
    width: 120px;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: 10px;
    object-fit: contain;
    object-position: center;
    border-radius: 6px;
    background: rgba(238, 243, 238, 0.88);
}

.news-admin-actions,
.news-admin-item-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.news-admin-actions button,
.news-admin-item-actions button {
    padding: 9px 14px;
    border: 0;
    border-radius: 12px 18px 11px 20px;
    background: var(--yellow);
    color: var(--navy);
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

.news-admin-actions a,
.news-admin-item-actions a {
    color: var(--navy);
    text-underline-offset: 3px;
}

.news-admin-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-admin-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    padding: 16px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
}

.news-admin-item h3 {
    margin: 0 0 8px;
}

.news-admin-item p {
    margin: 0;
    line-height: 1.5;
}

.news-admin-meta {
    margin-bottom: 6px !important;
    color: rgba(16, 40, 58, 0.68);
    font-size: 13px;
    font-weight: 700;
}

.news-admin-empty {
    color: rgba(16, 40, 58, 0.68);
}

.news-admin-item-actions {
    justify-content: flex-end;
}

.news-admin-item-actions form {
    margin: 0;
}

.news-admin-item-actions button.delete {
    background: #fdecea;
    color: #c0392b;
    box-shadow: 5px 5px 0 rgba(192, 57, 43, 0.28);
}

/* ===================== */
/* ÉVÉNEMENTS SUR ACCUEIL */
/* ===================== */
.home-events {
    width: min(760px, 100%);
    margin: 18px auto 22px;
    text-align: left;
}

.home-events-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.home-events-heading h3 {
    margin: 0;
    font-size: 18px;
}

.home-events-heading a {
    color: var(--navy);
    font-size: 14px;
    text-underline-offset: 3px;
}

.home-events-grid {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 4px 14px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: rgba(7, 31, 50, 0.34) rgba(255, 255, 255, 0.5);
}

.home-events-grid::-webkit-scrollbar {
    height: 10px;
}

.home-events-grid::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.5);
}

.home-events-grid::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(7, 31, 50, 0.34);
}

.home-events-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(7, 31, 50, 0.48);
}

.home-event-card {
    display: flex;
    flex-direction: column;
    flex: 0 0 clamp(220px, 44vw, 280px);
    min-width: 220px;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 12px 28px rgba(7, 31, 50, 0.1);
    scroll-snap-align: start;
}

.home-event-card:hover {
    transform: translateY(-1px);
}

.home-event-media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: rgba(238, 243, 238, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2c5a37;
    font-weight: 700;
}

.home-event-media img,
.home-event-media video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: rgba(238, 243, 238, 0.88);
}

.home-event-play {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.home-event-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
}

.home-event-type {
    width: fit-content;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(68, 199, 197, 0.16);
    color: #2c5a37;
    font-size: 11px;
    font-weight: 700;
}

.home-event-body strong {
    font-size: 15px;
    line-height: 1.25;
}

.home-event-body small,
.home-event-body em {
    color: rgba(16, 40, 58, 0.68);
    font-size: 12px;
    font-style: normal;
}

@media (max-width: 760px) {
    .news-admin-item {
        grid-template-columns: 1fr;
    }

    .news-admin-item-actions {
        justify-content: flex-start;
    }

    .home-events-grid {
        margin-inline: -4px;
        padding-bottom: 12px;
    }

    .home-event-card {
        flex-basis: min(78vw, 280px);
    }
}
