/* --- STYLE GLOBAL --- */

/* AJOUT : force html & body en mode colonne → footer en bas */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;

    display: flex;
    flex-direction: column;
}

body {
    font-family: "Helvetica Neue", Arial, sans-serif;
    background-color: #ffffff;
    color: #333333;
}

/* --- HEADER --- */

/* La barre principale contenant menu + logo */
.np-main-nav {
    background-color: #3f1f1f;   /* brun foncé du site nplusp.ch */
    border-bottom: 1px solid rgba(0,0,0,0.25);

    display: flex;
    justify-content: space-between;     /* menu à gauche, logo à droite */
    align-items: center;                /* centré verticalement */
    padding: 10px 30px;
}

/* MENU À GAUCHE */
.np-menu {
    list-style: none;
    display: flex;
    gap: 50px;
    margin: 0;
    padding: 0;
}

.np-menu a {
    color: #ffffff;          /* texte blanc */
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
}

.np-menu a:hover {
    text-decoration: underline;
}

/* LOGO À DROITE */
.np-logo img {
    height: 45px;       /* taille du logo → ajustable */
    display: block;
}


/* --- CONTENU CENTRAL --- */

/* AJOUT : permet au contenu de pousser le footer vers le bas */
.content {
    flex: 1;                 
    max-width: 1100px;
    padding: 40px 20px;
    margin: 0 auto;
    width: 100%;
}

.content h1 {
    color: #3f1f1f;
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.content h2 {
    color: #6b4444;
    font-size: 1.15rem;
    font-weight: 500;
    font-style: italic;
    margin-top: 0;
    margin-bottom: 15px;
}

.content h3 {
    color: #3f1f1f;
    font-size: 1.2rem;
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 8px;
    border-bottom: 2px solid #c9a227;
    padding-bottom: 4px;
}

.content > p {
    background-color: #fdf6e3;
    border-left: 4px solid #c9a227;
    padding: 10px 15px;
    font-size: 0.95rem;
    color: #444;
    margin-bottom: 20px;
}


/* --- BOUTON PLEIN ÉCRAN --- */
.btn-fullscreen {
    display: inline-block;
    background-color: #3f1f1f;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    margin: 15px 0 20px;
}

.btn-fullscreen:hover {
    background-color: #2a1515;
}

/* --- CONTENEUR IFRAME WEBSIG --- */
.np-iframe-wrap {
    width: 100%;
    height: 80vh;
    height: 80dvh;   /* corrige le saut de hauteur dû à la barre d'adresse mobile */
}

.np-iframe-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}


/* --- GRILLE DES CARTES (accueil lidar.nplusp.ch) --- */

.cartes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
    margin-top: 10px;
}

.carte-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background-color: #ffffff;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.carte-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.carte-apercu {
    height: 160px;
    background-color: #fdf6e3;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.carte-apercu-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    background: linear-gradient(135deg, #fdf6e3, #f0e2b8);
}

.carte-info {
    padding: 15px 18px 18px;
}

.carte-info h3 {
    margin: 0 0 4px;
    padding: 0;
    border: none;
    color: #3f1f1f;
    font-size: 1.1rem;
}

.carte-sous-titre {
    margin: 0 0 8px !important;
    padding: 0 !important;
    background: none !important;
    border: none !important;
    font-size: 0.85rem;
    font-style: italic;
    color: #6b4444;
}

.carte-info p {
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
}

.carte-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    color: #ffffff;
    background-color: #c9a227;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
    white-space: nowrap;
}

/* Carte non cliquable (carte pas encore publiée) */
.carte-indisponible {
    cursor: default;
    opacity: 0.6;
}

.carte-indisponible .carte-apercu-placeholder {
    filter: grayscale(40%);
}

.carte-indisponible:hover {
    transform: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

@media (max-width: 768px) {
    .cartes-grid {
        grid-template-columns: 1fr;
    }
}


/* --- FOOTER --- */
.np-footer {
    background-color: #f3f3f3;
    padding: 30px 20px;
    text-align: left;
    font-size: 0.95rem;
    color: #333;
    border-top: 1px solid #ddd;
}

.np-footer p {
    margin: 5px 0;
}


/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .np-main-nav {
        flex-direction: column;
        gap: 15px;
    }

    .np-menu {
        flex-direction: column;
        gap: 12px;
    }

    .np-logo img {
        height: 40px;
    }

    .content {
        padding: 20px 15px;
    }

    .content h1 {
        font-size: 1.3rem;
        line-height: 1.3;
    }

    .content h2 {
        font-size: 1rem;
    }

    .btn-fullscreen {
        display: block;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }

    /* Le WebSIG embarqué est difficilement utilisable au doigt sur petit écran :
       on masque l'iframe et on ne garde que le bouton plein écran ci-dessus. */
    .np-iframe-wrap {
        display: none;
    }
}
