/* =========================================================
   STYLES GÉNÉRAUX - COPAINS D'SABORD VR
   ========================================================= */

/* --------- Reset de base --------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f8ff;
    color: #333333;
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

img,
video,
iframe,
svg {
    max-width: 100%;
}

img {
    height: auto;
}

a {
    color: #004080;
}

a:hover {
    color: #cc0000;
}

main {
    padding: 2em;
}

/* Bootstrap met déjà un .container, on sécurise seulement les débordements */
.container {
    max-width: 100%;
}

/* =========================================================
   HEADER - STRUCTURE GÉNÉRALE
   Attention : le header/menu principal peut aussi être stylé
   dans base.html.twig. On garde ici des règles sobres.
   ========================================================= */

header {
    background-color: #003366;
    color: #ffffff;
    padding: 1em 0;
    text-align: center;
}

header h1 {
    font-size: 2em;
    margin: 0;
}

header nav a {
    color: #f0f8ff;
    text-decoration: none;
    margin: 0 1em;
    font-weight: bold;
}

header nav a:hover {
    color: #ffcc00;
}

/* =========================================================
   BOUTONS
   ========================================================= */

button,
.btn {
    display: inline-block;
    background-color: #ff3333;
    color: #ffffff;
    border: none;
    padding: 0.7em 1.5em;
    cursor: pointer;
    font-size: 1em;
    border-radius: 5px;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    transition:
        background-color 0.25s ease,
        color 0.25s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

button:hover,
.btn:hover {
    background-color: #cc0000;
    color: #ffffff;
    text-decoration: none;
}

button:focus,
.btn:focus {
    outline: 3px solid rgba(0, 64, 128, 0.25);
    outline-offset: 2px;
}

.btn-add {
    display: inline-block;
    padding: 0.5em 1em;
    background-color: #007bff;
    color: #ffffff;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.25s ease;
}

.btn-add:hover {
    background-color: #0056b3;
    color: #ffffff;
}

/* =========================================================
   SECTIONS GÉNÉRALES
   ========================================================= */

.section-blue {
    background-color: #0077b6;
    color: #ffffff;
    padding: 2em;
    border-radius: 8px;
    margin-bottom: 1em;
}

.section-white {
    background-color: #ffffff;
    color: #003366;
    padding: 2em;
    border-radius: 8px;
    margin-top: 2em;
    margin-bottom: 1em;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.10);
    overflow: hidden;
}

.card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.10);
    padding: 1.5em;
    margin-bottom: 1em;
    color: #333333;
    overflow: hidden;
}

.card h2 {
    color: #003366;
    font-size: 1.5em;
    margin-bottom: 0.5em;
}

.card p {
    color: #666666;
}

/* =========================================================
   TABLEAUX
   ========================================================= */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
    font-size: 0.9em;
}

table th,
table td {
    padding: 0.8em;
    text-align: center;
    border: 1px solid #dddddd;
    vertical-align: middle;
}

table th {
    background-color: #003366;
    color: #ffffff;
}

table tr:nth-child(even) {
    background-color: #f2f2f2;
}

/* Permet d’envelopper les tableaux larges dans les containers */
.section-white,
.press-container,
.ranking-container,
.comments-section {
    overflow-x: auto;
}

/* =========================================================
   POINTS PRESSE - LISTE
   ========================================================= */

.press-container {
    width: min(100%, 900px);
    margin: 0 auto;
    padding: 2em;
    background-color: #ffffff;
    color: #003366;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.10);
    overflow: hidden;
}

.press-container h1 {
    font-size: 2em;
    color: #003366;
    margin-bottom: 1em;
    text-align: center;
}

.press-container .btn {
    display: block;
    width: fit-content;
    max-width: 100%;
    background-color: #ff3333;
    color: #ffffff;
    padding: 0.7em 1.5em;
    text-align: center;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    margin: 1em auto;
    transition: background-color 0.25s ease;
}

.press-container .btn:hover {
    background-color: #cc0000;
}

.press-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.press-list li {
    padding: 1em;
    border-bottom: 1px solid #dddddd;
}

.press-list li:last-child {
    border-bottom: none;
}

.press-list li a {
    font-size: 1.2em;
    font-weight: bold;
    color: #003366;
    text-decoration: none;
    word-break: break-word;
}

.press-list li a:hover {
    color: #ff3333;
    text-decoration: underline;
}

.press-list li .published-date,
.press-list .published-date {
    display: block;
    font-size: 0.9em;
    color: #888888;
    margin-top: 0.3em;
}

/* =========================================================
   POINT PRESSE - DÉTAIL
   ========================================================= */

.press-release {
    width: min(100%, 900px);
    margin: 0 auto 2em;
    padding: 2em;
    background-color: #ffffff;
    color: #333333;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.10);
    font-family: Arial, sans-serif;
    overflow: hidden;
}

.press-release h1 {
    font-size: 2em;
    color: #003366;
    margin: 0 0 0.5em;
    line-height: 1.2;
    word-break: break-word;
}

.press-release h2,
.press-release h3,
.press-release h4 {
    color: #003366;
    line-height: 1.25;
    word-break: break-word;
}

.press-release p {
    color: #555555;
    line-height: 1.7;
    margin: 0 0 1em;
    overflow-wrap: break-word;
}

.press-release .published-date {
    font-size: 0.9em;
    color: #888888;
    margin-top: 0.5em;
}

/* Correction importante : images contenues dans le point presse */
.press-release img,
.press-container img,
.comments-section img,
.section-white img,
.card img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Si du HTML injecté contient des styles width fixes */
.press-release [style*="width"],
.press-container [style*="width"] {
    max-width: 100% !important;
}

/* Si du HTML injecté contient des images avec width/height forcés */
.press-release img[style],
.press-container img[style] {
    max-width: 100% !important;
    height: auto !important;
}

/* Si TinyMCE / éditeur HTML ajoute des figures */
.press-release figure,
.press-container figure {
    max-width: 100%;
    margin: 1em auto;
    overflow: hidden;
}

.press-release figure img,
.press-container figure img {
    max-width: 100%;
    height: auto;
}

.press-release figcaption,
.press-container figcaption {
    font-size: 0.9em;
    color: #666666;
    text-align: center;
    margin-top: 0.5em;
}

/* Liens longs */
.press-release a,
.press-container a,
.comment a {
    overflow-wrap: anywhere;
}

/* =========================================================
   COMMENTAIRES
   ========================================================= */

.comments-section {
    width: min(100%, 900px);
    margin: 0 auto 2em;
    background-color: #f9f9f9;
    padding: 2em;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.10);
    overflow: hidden;
}

.comments-section h2 {
    font-size: 1.5em;
    color: #333333;
    margin-bottom: 1em;
}

.comment {
    border-bottom: 1px solid #dddddd;
    padding: 1em 0;
    overflow-wrap: break-word;
}

.comment:last-child {
    border-bottom: none;
}

.comment .author {
    font-weight: bold;
    color: #003366;
    margin-bottom: 0.3em;
}

.comment .date {
    font-size: 0.85em;
    color: #888888;
}

.comment p {
    margin: 0.5em 0 0;
    color: #333333;
}

.comment-form {
    margin-top: 2em;
    padding: 1em;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.10);
}

.comment-form label {
    font-weight: bold;
    color: #333333;
    display: block;
    margin-bottom: 0.5em;
}

.comment-form textarea,
.comment-form input,
.comment-form select {
    width: 100%;
    max-width: 100%;
    padding: 0.6em;
    border: 1px solid #dddddd;
    border-radius: 4px;
    font-family: Arial, sans-serif;
}

.comment-form textarea {
    resize: vertical;
    min-height: 120px;
}

.comment-form button {
    display: block;
    margin-top: 1em;
}

/* =========================================================
   VIDÉOS / IFRAMES
   ========================================================= */

.video-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background: #000000;
    border-radius: 8px;
}

.video-container iframe,
.video-container video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.video-player {
    width: min(100%, 700px);
    margin: 0 auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.20);
    border-radius: 8px;
    overflow: hidden;
}

/* =========================================================
   RADIO
   ========================================================= */

.radio-container {
    background-image: url('/uploads/radio.png');
    background-size: cover;
    background-position: center;
    min-height: 100vh;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #ffffff;
    padding: 2em;
    overflow: hidden;
}

.radio-container > * {
    max-width: 100%;
}

/* =========================================================
   CLASSEMENT
   ========================================================= */

.ranking-container {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.10);
    padding: 1em;
    overflow-x: auto;
    max-width: 100%;
    margin: 0 auto;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
    color: #333333;
    table-layout: auto;
    min-width: 640px;
}

.ranking-table thead tr {
    background-color: #003366;
    color: #ffffff;
    text-align: left;
}

.ranking-table th,
.ranking-table td {
    padding: 0.75em 1em;
    border-bottom: 1px solid #dddddd;
    text-align: center;
    vertical-align: middle;
}

.ranking-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.ranking-table tbody tr:hover {
    background-color: #e9ecef;
}

.ranking-table td img {
    max-width: 36px;
    height: auto;
    margin-right: 0.5em;
    vertical-align: middle;
}

/* =========================================================
   RÉACTIONS
   ========================================================= */

.reaction-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.reaction-icon {
    width: 24px;
    height: 24px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.reaction-icon:hover {
    transform: scale(1.5);
}

/* =========================================================
   IMAGES / CARTES AVEC IMAGE
   ========================================================= */

.image-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    text-align: center;
    border-radius: 8px;
    background-color: #eef3f8;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
    position: relative;
    z-index: 1;
}

/* Sécurisation des cartes custom */
.custom-card {
    position: relative;
    max-width: 100%;
    overflow: hidden;
}

/*
   Ancien effet : position fixed au hover.
   C’est souvent lui qui provoque des débordements et soucis mobiles.
   On le remplace par un zoom simple et contenu.
*/
@media (min-width: 769px) {
    .image-container:hover img {
        transform: scale(1.04);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
    }
}

/* =========================================================
   NOTIFICATIONS INTERNES
   ========================================================= */

.notification-content {
    background-color: #e8ffe8;
    border: 1px solid #007b55;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    color: #004d00;
    position: relative;
    overflow: hidden;
    overflow-wrap: break-word;
}

.delete-notification-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    color: #004d00;
    border: none;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0;
}

.delete-notification-btn:hover {
    color: #002b00;
    background: none;
}

/* =========================================================
   ANCIENNES CLASSES NAVBAR
   On conserve pour ne pas casser les anciennes vues.
   ========================================================= */

.navbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1em;
    background-color: #003366;
    box-sizing: border-box;
    gap: 20px;
}

.navbar-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.navbar-logo .logo {
    width: 250px;
    max-width: 100%;
    height: auto;
}

.navbar-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: -130px;
    margin-left: -205px;
}

.navbar-profile .profile-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 5px;
}

.navbar-profile .dropbtn {
    background-color: #ff3333;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
}

.navbar-profile .dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.20);
    border-radius: 5px;
    z-index: 10;
    min-width: 150px;
    padding: 10px 0;
}

.navbar-profile .dropdown-content a {
    text-decoration: none;
    color: #333333;
    padding: 10px;
    display: block;
    transition: background-color 0.25s ease;
}

.navbar-profile .dropdown-content a:hover {
    background-color: #dddddd;
}

.navbar-profile:hover .dropdown-content {
    display: block;
}

.navbar-links {
    display: flex;
    gap: 30px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.navbar-links li a img {
    width: 200px;
    max-width: 100%;
    height: auto;
    transition: transform 0.25s ease;
}

.navbar-links li a img:hover {
    transform: scale(1.35);
}

/* =========================================================
   TITRES
   ========================================================= */

h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    line-height: 1.2;
    word-break: break-word;
}

h2,
h3,
h4,
h5,
h6 {
    line-height: 1.25;
    word-break: break-word;
}

/* =========================================================
   FOOTER
   ========================================================= */

footer {
    background-color: #003366;
    color: #ffffff;
    padding: 1em 0;
    text-align: center;
    font-size: 0.9em;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 2rem;
}

footer a {
    color: #ffcc00;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* =========================================================
   RESPONSIVE TABLETTE
   ========================================================= */

@media screen and (max-width: 768px) {
    body {
        font-size: 15px;
    }

    main {
        padding: 1em;
    }

    .section-blue,
    .section-white,
    .press-container,
    .press-release,
    .comments-section,
    .card {
        padding: 1.25em;
        border-radius: 8px;
    }

    h1,
    .press-container h1,
    .press-release h1 {
        font-size: 1.55em;
    }

    h2,
    .comments-section h2 {
        font-size: 1.25em;
    }

    table {
        font-size: 0.85em;
    }

    table th,
    table td {
        padding: 0.65em;
    }

    .ranking-container {
        padding: 1em 0.5em;
    }

    .ranking-table th,
    .ranking-table td {
        font-size: 0.9em;
        word-wrap: break-word;
    }

    .btn-switch {
        font-size: 11px;
    }

    .navbar {
        gap: 10px;
    }

    .navbar-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }

    .navbar-links li a img {
        width: 100px;
    }

    .navbar-links li a img:hover {
        transform: scale(1.15);
    }

    .navbar-profile {
        margin-top: 0;
        margin-left: 0;
    }

    .image-container {
        height: 150px;
        overflow: hidden;
    }

    .image-container img,
    .image-container:hover img {
        transform: none;
        object-fit: contain;
    }

    .radio-container {
        min-height: 70vh;
        padding: 1.5em;
    }
}

/* =========================================================
   RESPONSIVE MOBILE
   ========================================================= */

@media screen and (max-width: 480px) {
    body {
        font-size: 14px;
    }

    main {
        padding: 0.75em;
    }

    header h1 {
        font-size: 1.45em;
    }

    header nav a {
        display: inline-block;
        margin: 0.35em;
    }

    button,
    .btn,
    .btn-add {
        width: 100%;
        max-width: 100%;
        padding: 0.75em 1em;
        font-size: 0.95em;
    }

    .press-container,
    .press-release,
    .comments-section,
    .section-blue,
    .section-white,
    .card {
        padding: 1em;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    }

    .press-list li {
        padding: 0.9em 0;
    }

    .press-list li a {
        font-size: 1.05em;
    }

    .comment-form {
        padding: 0.9em;
    }

    .navbar-links li a img {
        width: 80px;
    }

    .navbar-links li a img:hover {
        transform: scale(1.08);
    }

    .navbar-logo .logo {
        width: 180px;
    }

    .ranking-table {
        min-width: 560px;
    }

    .image-container {
        height: 140px;
    }

    .reaction-icon:hover {
        transform: scale(1.2);
    }

    footer {
        padding: 1em;
    }
}

/* =========================================================
   SÉCURITÉ SUPPLÉMENTAIRE CONTRE LES DÉBORDEMENTS
   ========================================================= */

.press-release *,
.press-container *,
.comments-section *,
.section-white *,
.card * {
    max-width: 100%;
}

/* Exception : on laisse les tableaux gérer leur largeur via overflow-x */
.press-release table,
.press-container table,
.comments-section table,
.section-white table,
.card table {
    max-width: none;
}

/* Préserve les textes longs, URLs, mots sans espaces */
p,
li,
td,
th,
span,
div {
    overflow-wrap: break-word;
}

/* Les formulaires ne dépassent pas */
input,
textarea,
select {
    max-width: 100%;
}