/* --- Reset les marges et paddings par défaut --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-y: scroll;
    overflow-x: hidden;
}

.success {
    color: #155724; /* Texte vert foncé */
    background-color: #d4edda; /* Fond vert clair */
    border: 1px solid #c3e6cb; /* Bordure légèrement plus foncée */
    padding: 10px 15px; /* Espacement intérieur */
    border-radius: 4px; /* Bords arrondis */
    font-size: 16px; /* Taille du texte */
    line-height: 1.5; /* Hauteur de ligne */
}

/* --- Body prend toute la hauteur de la fenêtre --- */
html, body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image: url("../images/logotrp.webp");
    background-repeat: no-repeat;
    background-position: 50% 80%;
    background-size: 500px auto;
    background-origin: content-box;
    background-color: #f7f5f5;
    color: #333;
    font-family: "Open Sans", sans-serif;
    line-height: 1.6;
}

/* --- Le conteneur principal prend toute la place restante --- */
main {
    flex: 1;
    padding: 20px;
    min-height: 300px;
}

/* --- Header reste en haut --- */
header {
    display: flex; /* Organisation en ligne */
    justify-content: space-between; /* Espace entre la navigation et le titre */
    align-items: center; /* Alignement vertical au centre */
    box-sizing: border-box; /* Padding inclus dans la largeur */
    width: 100%; /* Prend toute la largeur */
    margin: 20px;
    padding: 0 30px; /* Espacement horizontal pour le contenu */
    max-height: 200px; /* Hauteur maximale pour éviter un débordement */
}

.title-container {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centre le contenu horizontalement */
    text-align: center; /* Aligne le texte à l'intérieur */
    flex: 1; /* Permet au titre de prendre tout l'espace disponible s'il y a des conflits */
    padding-bottom: 2px;
    margin-right: 170px;
}

.title-container h1 a {
    text-decoration: none;
    color: inherit;
    cursor: default;
    outline: none;
}


.nav-container {
    display: flex;
    flex-direction: column; /* Aligne les liens verticalement */
    align-items: flex-start; /* Garde les liens alignés à gauche */
    margin-right: auto; /* Assure que la navigation est à gauche du conteneur */
    margin-left: 30px;
    margin-top: 30px;
}

.security-links {
    position: absolute;
    top: 30px;
    right: 10px;
    margin: 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.security-links a {
    color: #844f6b;
    text-decoration: none;
    font-size: 1.2rem;
    font-style: italic;
    margin: 5px 0;
    transition: color 0.3s ease;
}

.security-links a:hover {
    color: #a8707d;
}

.security-links p {
    color: #844f6b;
    font-size: 1.2rem;
    font-family: "Cormorant Garamond", serif;
    font-weight: bolder;
    font-style: normal;
}


header h1 {
    color: #601467;
    font-size: 5rem;
    font-weight: 400;
    font-style: normal;
    font-family: "Updock", cursive;
}

header h2 {
    color: #844f6b;
    font-size: 1.4rem;
    font-family: "Cormorant Garamond", serif;
    font-weight: 300;
    font-style: normal;
    margin-top: -10px;

}

header img {
    height: 50px;
    width: 50px;
    border-radius: 50%;
    margin-right: 15px;
}

/* --- Nav en colonne, sous le titre h1 --- */
nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
}

nav a {
    color: #844f6b;
    text-decoration: none;
    font-size: 1.2rem;
    font-style: italic;
    margin: 5px 0;
    transition: color 0.3s ease;
}

nav a:hover {
    color: #a8707d;
}

/* --- Footer --- */
footer {
    color: #844f6b;
    text-align: center;
    padding: 10px 0;
    font-size: 1rem;
}

footer .footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

footer .footer-section {
    margin: 10px 0;
}

footer h2 {
    color: #f9f1e5;
    font-family: "Javanese Text", cursive;
    font-size: 2.5rem;
}

footer .monNom {
    font-weight: bold;
    color: #af9489;
}

.footer-bottom {
    padding: 5px 0;
    font-size: 0.9rem;
}

.post-mariage {
    display: none;
}

/* --- Responsive --- */
@media (max-width: 768px) {

    header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0 15px;
        margin: 10px 0;
        overflow-y: auto; /* <-- Permet le scroll si ça déborde */
        max-height: 100vh; /* <-- Limite la hauteur */
    }
    .nav-container {
        margin: 15px 0 5px;
        align-items: center;
    }

    .title-container {
        margin: 10px 0;
        padding: 0;
    }

    .security-links {
        position: static;
        margin: 10px 0;
        align-items: center;
        text-align: center;
    }

    .security-links a,
    .security-links p {
        font-size: 0.9rem;
    }

    nav {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    nav a {
        font-size: 0.8rem;
        padding: 4px 8px;
    }

    header h1 {
        font-size: 2.5rem;
    }

    header h2 {
        font-size: 1rem;
        margin-top: 5px;
    }
}

@media (min-width: 769px) {
    header {
        flex-direction: row;
    }

    .nav-container {
        order: 1;
    }

    .title-container {
        order: 2;
    }
}
