/* ---------------------------------------------------------
   Polices personnalisées (hébergées localement)
   --------------------------------------------------------- */
@font-face {
    font-family: 'Hurricane';
    src: url('fonts/Hurricane-Regular.woff2') format('woff2'),
         url('fonts/Hurricane-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Chilanka';
    src: url('fonts/Chilanka-Regular.woff2') format('woff2');
}

/* ---------------------------------------------------------
   Base globale
   --------------------------------------------------------- */
body {
    margin: 0;
    font-family: sans-serif;
    line-height: 1.6;
    background: #f7f7f7;
    color: #222;

    /* Espace réservé au header fixe + barre de navigation en version desktop */
    padding-top: 320px;
}

/* Texte uniquement pour les moteurs de recherche / lecteurs d'écran */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
}

/* ---------------------------------------------------------
   En-tête (desktop par défaut)
   --------------------------------------------------------- */
header {
    display: flex;
    flex-direction: column;
    align-items: center; /* logo centré */
    padding-top: 0.5rem;
    background: #222;
    color: #fff;

    /* Header toujours visible en haut de page */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9998;
}

/* Style prévu pour un h1 visible, conservé au cas où.
   Les h1 actuels sont masqués avec .visually-hidden. */
header h1 {
    font-family: 'Hurricane', cursive;
    font-size: 10rem;
    letter-spacing: 0;
    margin-top: 0;
    margin-bottom: 0.2rem;
    line-height: 0.9;
}

/* Sous-éléments textuels du header */
header p {
    font-family: 'Chilanka', cursive;
    text-align: left;
    align-self: flex-start;
}

/* Logo typographique principal */
header .logo-titre {
    font-family: 'Hurricane', cursive;
    font-size: 10rem;
    letter-spacing: 0;
    margin-top: 0;
    margin-bottom: 0.2rem;
    line-height: 0.9;
}

/* Ligne "Artisan Électricien" */
header .sous-titre {
    font-family: 'Chilanka', cursive;
    font-size: 2.2rem;
    margin-top: 0.2rem;
    line-height: 1;
    margin-bottom: 0.2rem;
    text-align: center;
    align-self: center;
}

/* Phrase descriptive sous le titre */
header .description {
    font-family: 'Chilanka', cursive;
    font-size: 1.3rem;
    margin-top: 1.5rem;
    line-height: 1.2;
    text-align: center;
    align-self: center;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
}

/* ---------------------------------------------------------
   Navigation principale (desktop)
   --------------------------------------------------------- */
nav {
    display: flex;
    justify-content: center;
    background: #444;

    /* Barre fixe sous le header */
    position: fixed;
    top: 267px; /* ajusté à la hauteur visuelle du header desktop */
    left: 0;
    width: 100%;
    z-index: 9998;
}

nav a {
    color: #fff;
    padding: 1rem;
    text-decoration: none;
}

nav a:hover {
    background: #666;
}

/* ---------------------------------------------------------
   Bouton de menu hamburger (mobile)
   - Masqué par défaut (desktop)
   --------------------------------------------------------- */
.nav-toggle {
    display: none;          /* visible uniquement dans les media queries */
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Barres du hamburger */
.nav-toggle-bar {
    display: block;
    width: 24px;
    height: 3px;
    margin: 4px 0;
    background: #fff;
    border-radius: 2px;
}

/* ---------------------------------------------------------
   Contenu principal
   --------------------------------------------------------- */
section {
    max-width: 800px;
    padding: 2rem;
    margin: auto;
}

/* Titres de section */
h2 {
    margin-top: 2rem;
}

h3 {
    margin-top: 2.2rem;
    margin-left: 20px;
}

/* Bouton WhatsApp */
a.whatsapp-btn {
    display: inline-block;
    padding: 0.6rem 1rem;
    background-color: #25D366 !important; /* vert WhatsApp */
    color: #fff !important;
    text-decoration: none;
    border-radius: 6px;
    border: none;
}

a.whatsapp-btn:hover {
    background-color: #1da851 !important;
}

/* ---------------------------------------------------------
   Encart de contact (contenu des pages) — hors zone flottante
   --------------------------------------------------------- */
.encart-contact {
    max-width: 260px;
    margin-left: auto;
    background-color: #fff;
    padding: 1rem 1.2rem;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-family: 'Chilanka', cursive;
}

.encart-contact h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
}

.encart-contact a {
    color: #222;
    text-decoration: none;
}

.encart-contact a:hover {
    text-decoration: underline;
}

/* ---------------------------------------------------------
   Formulaire de contact
   --------------------------------------------------------- */
.form-contact {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    max-width: 500px;
    margin-top: 1.5rem;
}

.form-contact input,
.form-contact textarea {
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-family: sans-serif;
    font-size: 1rem;
}

.form-contact button {
    padding: 0.8rem 1rem;
    background: #222;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.form-contact button:hover {
    background: #444;
}

/* ---------------------------------------------------------
   Encart photo (page À propos)
   --------------------------------------------------------- */
.encart-photo {
    float: right;
    width: 180px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 0.8rem;
    margin: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.encart-photo img {
    width: 100%;
    border-radius: 8px;
}

.encart-photo .nom-artisan {
    margin-top: 0.5rem;
    font-family: 'Chilanka', cursive;
    font-size: 1.1rem;
    line-height: 1.2;
}

/* ---------------------------------------------------------
   Bloc fixe flottant à droite : QR code + contact
   --------------------------------------------------------- */
.zone-fixe-droite {
    position: fixed;
    top: 720px;      /* distance depuis le haut de la fenêtre sur desktop */
    right: 10px;
    display: flex;
    flex-direction: row;   /* QR à gauche, Contact à droite */
    align-items: flex-start;
    gap: 1rem;
    z-index: 9999;
}

/* Bloc du QR Code dans la zone flottante */
.qr-contact {
    width: 130px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.qr-contact img {
    width: 100%;
    display: block;
    border-radius: 6px;
}

/* Encart Contact rapide — hauteur EXACTE alignée avec le QR */
.encart-flottant {
    width: 242px;              /* largeur suffisante pour loger l'adresse en une ligne */
    height: 148px;             /* EXACTEMENT la hauteur du bloc QR (calculée) */
    padding: 0.8rem 1rem;      /* paddings inclus dans height grâce à box-sizing */
    background: #fff;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    font-family: 'Chilanka', cursive;

    box-sizing: border-box;    /* height et width incluent le padding */
    display: flex;
    flex-direction: column;
    justify-content: space-between;  /* espace maîtrisé */
}

/* Titre sur une seule ligne */
.encart-flottant h3 {
    font-size: 1.05rem;
    white-space: nowrap;
    margin: 0;
}

/* Texte interne — email 100% visible */
.encart-flottant p,
.encart-flottant a {
    font-size: 0.9rem;
    line-height: 1.25;
    white-space: nowrap;       /* pas de retour à la ligne */
    overflow: hidden;          /* aucune coupure qui dépasse */
    text-overflow: clip;
}


/* ---------------------------------------------------------
   Pied de page
   --------------------------------------------------------- */
footer {
    text-align: center;
    padding: 1rem;
    background: #222;
    color: #fff;
    margin-top: 2rem;
}

/* ---------------------------------------------------------
   Responsive : mobile / tablette (<= 768px)
   - Réduction du header
   - Menu hamburger
   - Contenu en colonne
   - Masquage de la zone flottante
   --------------------------------------------------------- */
@media (max-width: 768px) {

    /* Corps de page en colonne pour maintenir le footer en bas */
    body {
        padding-top: 200px;          /* header plus compact */
        display: flex;
        flex-direction: column;
        min-height: 100vh;
    }

    main {
        flex: 1 0 auto;
    }

    footer {
        flex-shrink: 0;
    }

    /* Header compact sur mobile (même rendu desktop conservé) */
    header .logo-titre {
        font-size: 3.2rem;
    }

    header .sous-titre {
        font-size: 1.6rem;
    }

    header .description {
        font-size: 1rem;
        margin-top: 0.5rem;
        max-width: 90%;
    }

    /* Section : un peu moins de marge pour gagner de l’espace */
    section {
        padding: 1.2rem 1rem;
    }

    /* Encadré photo centré et non flottant */
    .encart-photo {
        float: none;
        margin: 1rem auto;
    }

    /* Zone flottante masquée sur mobile pour ne pas gêner la lecture */
    .zone-fixe-droite {
        display: none;
    }

    /* Bouton hamburger visible et placé en haut à droite */
    .nav-toggle {
        display: block;
        position: fixed;
        top: 0.8rem;
        right: 1rem;
        z-index: 10000;
    }

    /* Menu replié par défaut, déroulé en colonne lorsqu'ouvert */
    nav {
        top: 120px;                  /* positionné sous le header compact */
        flex-direction: column;
        align-items: flex-start;
        display: none;               /* caché tant que nav-open n'est pas présent */
    }

    nav.nav-open {
        display: flex;
    }

    nav a {
        width: 100%;
        padding: 0.8rem 1rem;
        border-top: 1px solid #555;
    }
}

/* ---------------------------------------------------------
   Affichage des encarts flottants UNIQUEMENT à zoom 100%
   --------------------------------------------------------- */

/* Zoom à 100 % → encarts visibles */
@media (resolution: 1dppx) {
    .zone-fixe-droite {
        display: flex !important;
    }
}

/* Zoom ≠ 100 % → encarts masqués */
@media not (resolution: 1dppx) {
    .zone-fixe-droite {
        display: none !important;
    }
}
