/* =========================================================
   SINGLE PROFESSIONNEL
   Version harmonisée avec l'univers Caniguide
   Cohérente avec les templates :
   - single-professionnel.php
   - pro-hero.php
   - pro-common-sections.php
   - pro-metier.php
========================================================= */

/* =========================================================
   WRAPPER GLOBAL
========================================================= */

.single-professionnel-wrapper {
    width: 100%;
    background: #fff;
    padding-bottom: 40px;
}

/* =========================================================
   ARTICLE
========================================================= */

.single-professionnel {
    width: 100%;
}

/* Astra met padding:2.5em sur .ast-article-single → ~40px de vide en haut.
   Hero aplati : on neutralise le padding-top pour que le hero remonte juste
   sous le margin-bottom du fil d'Ariane (espacement géré par le breadcrumb). */
.single-professionnel-wrapper .single-professionnel.ast-article-single {
    padding-top: 0;
}

/* =========================================================
   HERO PROFESSIONNEL
========================================================= */

.pro-hero {
    max-width: 1200px;
    margin: 0 auto 28px;
    padding: clamp(20px, 3vw, 28px);
    border: 1px solid var(--cg-border);
    border-radius: var(--cg-radius-lg);
    background: #ffffff;
    box-shadow: var(--cg-shadow-sm);
}

.pro-hero {
    display: flex;
    align-items: flex-start;
    gap: 36px;
}

.pro-hero-main {
    flex: 1;
    max-width: 620px;
    min-width: 0;
}

.pro-hero-media {
    width: 450px;
    flex: 0 0 450px;
}

.pro-hero-kicker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 14px;
}

.pro-hero-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 6px 12px;
    border: 1px solid var(--cg-border);
    border-radius: var(--cg-radius-pill);
    background: #fff;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--cg-primary);
}

.pro-title {
    margin: 0 0 18px;
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.95rem, 3.2vw, 2.6rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--cg-heading);
    text-wrap: balance;
}

.pro-description {
    max-width: 620px;
    margin-bottom: 18px;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--cg-text);
}

.pro-description p {
    margin: 0 0 12px;
}

.pro-description p:last-child {
    margin-bottom: 0;
}

.pro-infos {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 12px 24px;
    margin-top: 18px;
    padding: 18px 20px;
    background: #ffffff;
    border: 1px solid var(--cg-border);
    border-radius: var(--cg-radius-md);
    box-shadow: var(--cg-shadow-sm);
}

.pro-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.pro-info-label {
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.35;
    color: #111827;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.pro-info-value {
    font-size: 0.95rem;
    line-height: 1.55;
    color: var(--cg-text);
    overflow-wrap: anywhere;
}

.pro-info-value a {
    color: var(--cg-accent);
    font-weight: 700;
    text-decoration: none;
}

.pro-info-value a:hover {
    text-decoration: underline;
}

.pro-hero-media {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--cg-border);
    border-radius: var(--cg-radius-md);
    background: var(--cg-border);
    box-shadow: var(--cg-shadow-sm);
}

.pro-hero-media img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

/* =========================================================
   BLOCS COMMUNS
========================================================= */

.pro-common-sections,
.pro-metier-section,
.single-professionnel-content {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.pro-common-sections {
    margin-top: 0;
    margin-bottom: 28px;
}

.pro-common-grid {
    display: grid;
    /* auto-fit : les tracks vides se collapsent → 1 section = pleine largeur,
       pas de colonne fantôme quand la grille n'est pas pleine. */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.pro-section {
    margin-bottom: 24px;
}

.pro-section:last-child {
    margin-bottom: 0;
}

.pro-section-title,
.pro-common-sections h2,
.single-professionnel-content h2 {
    display: block;
    margin: 32px 0 18px;
    padding: 4px 0 4px 16px;
    border: 0;
    border-left: 3px solid var(--cg-accent);
    background: none;
    box-shadow: none;
    border-radius: 0;
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.5rem, 2vw, 1.875rem);
    font-weight: 500;
    line-height: 1.2;
    color: var(--cg-heading);
}

.pro-section-card,
.pro-card {
    padding: 20px 22px;
    background: #ffffff;
    border: 1px solid var(--cg-border);
    border-radius: var(--cg-radius-lg);
    box-shadow: var(--cg-shadow-sm);
}

.pro-section-card p,
.pro-card-content p,
.pro-card p,
.single-professionnel-content p {
    margin: 0 0 14px;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--cg-text);
}

.pro-section-card p:last-child,
.pro-card-content p:last-child,
.pro-card p:last-child,
.single-professionnel-content p:last-child {
    margin-bottom: 0;
}

.pro-card-title,
.pro-common-sections h3,
.single-professionnel-content h3 {
    margin: 0 0 14px;
    font-size: 1.18rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--cg-primary);
}

.pro-card-content > * + * {
    margin-top: 12px;
}

.pro-card-content ul,
.pro-section-card ul,
.single-professionnel-content ul {
    margin: 16px 0 0;
    padding-left: 20px;
}

.pro-card-content li,
.pro-section-card li,
.single-professionnel-content li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: var(--cg-text);
}

.pro-card-content strong,
.pro-section-card strong,
.pro-card strong,
.single-professionnel-content strong {
    color: #111827;
    font-weight: 700;
}

/* =========================================================
   HORAIRES
========================================================= */

.pro-horaires-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pro-horaires-list li {
    margin: 0 0 10px;
    padding: 0 0 10px;
    border-bottom: 1px solid #f1f2f4;
    font-size: 0.96rem;
    line-height: 1.6;
    color: var(--cg-text);
}

.pro-horaires-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* =========================================================
   PRÉSENCE EN LIGNE
========================================================= */

.pro-reseaux-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pro-reseaux-list li {
    margin: 0;
}

.pro-reseaux-list a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 9px 14px;
    border: 1px solid var(--cg-border);
    border-radius: var(--cg-radius-pill);
    background: #fff;
    color: var(--cg-primary);
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    transition: background-color 0.22s ease, border-color 0.22s ease, color 0.22s ease;
}

.pro-reseaux-list a:hover {
    background: #fffaf5;
    border-color: rgba(234, 125, 31, 0.28);
    color: var(--cg-accent);
    text-decoration: none;
}

/* =========================================================
   LISTES MÉTIER (choix + features cochées)
========================================================= */

.pro-acf-list,
.pro-feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pro-acf-list li,
.pro-feature-list li {
    position: relative;
    padding-left: 1.4em;
    line-height: 1.4;
}

.pro-acf-list li::before,
.pro-feature-list li::before {
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 700;
}

.pro-acf-list li::before {
    content: "•";
    color: var(--cg-border);
}

.pro-feature-list li::before {
    content: "✓";
    color: var(--cg-accent);
}

/* =========================================================
   GALERIE
========================================================= */

.pro-galerie {
    margin-top: 0;
}

.pro-galerie-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.pro-galerie-count-1 {
    grid-template-columns: 1fr;
}

.pro-galerie-item {
    overflow: hidden;
    border: 1px solid var(--cg-border);
    border-radius: var(--cg-radius-lg);
    background: var(--cg-border);
    box-shadow: var(--cg-shadow-sm);
}

.pro-galerie-item img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    transition: transform 0.28s ease;
}

.pro-galerie-item:hover img {
    transform: scale(1.02);
}

/* =========================================================
   BLOCS MÉTIER
========================================================= */

.pro-metier-section {
    margin-bottom: 28px;
}

.pro-metier-grid {
    display: grid;
    /* auto-fit : carte seule = pleine largeur, dernière rangée impaire sans
       vide à droite. */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.pro-metier-grid .pro-card {
    height: 100%;
}

/* =========================================================
   CONTENU WORDPRESS LIBRE
========================================================= */

.single-professionnel-content {
    margin-top: 8px;
}

.single-professionnel-content > * + * {
    margin-top: 1.2em;
}

.single-professionnel-content h2:first-child {
    margin-top: 0;
}

.single-professionnel-content h3 {
    margin-top: 30px;
}

.single-professionnel-content blockquote {
    margin: 24px 0;
    padding: 16px 18px;
    background: #fffaf5;
    border: 1px solid rgba(234, 125, 31, 0.18);
    border-left: 4px solid var(--cg-accent);
    border-radius: 0 14px 14px 0;
    color: #3b3229;
}

.single-professionnel-content a {
    color: var(--cg-accent);
    font-weight: 700;
    text-decoration: none;
}

.single-professionnel-content a:hover {
    text-decoration: underline;
}

/* =========================================================
   TOC PROFESSIONNEL
========================================================= */

#cg-toc-pro-fixed,
#toc-pro-mobile-wrapper {
    display: none;
}

#toc-pro-mobile-panel ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#toc-pro-mobile-panel li {
    margin: 0;
}

#toc-pro-mobile-panel a {
    display: block;
    padding: 10px 0;
    color: var(--cg-primary);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid #f1f2f4;
}

#toc-pro-mobile-panel a:hover {
    color: var(--cg-accent);
}

/* =========================================================
   LIGHTBOX GALERIE
========================================================= */

.pro-lightbox {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(17, 24, 39, 0.88);
    z-index: 12000;
}

.pro-lightbox.open {
    display: flex;
}

.pro-lightbox-img-wrap {
    max-width: min(1100px, 90vw);
    max-height: 80vh;
}

.pro-lightbox-img {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--cg-radius-md);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.pro-lightbox-close,
.pro-lightbox-prev,
.pro-lightbox-next {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: var(--cg-radius-pill);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: background-color 0.22s ease, transform 0.22s ease;
}

.pro-lightbox-close:hover,
.pro-lightbox-prev:hover,
.pro-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
}

.pro-lightbox-close {
    top: 20px;
    right: 20px;
}

.pro-lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.pro-lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

/* =========================================================
   COPIE INFOS
========================================================= */

[data-copy-target].copied {
    background: var(--cg-accent);
    border-color: var(--cg-accent);
    color: #fff;
}

/* =========================================================
   RESPONSIVE TABLETTE
========================================================= */

@media (max-width: 1023px) {
    .pro-hero {
        flex-direction: column;
        gap: 24px;
    }

    .pro-hero-media {
        width: 100%;
        flex: 0 0 auto;
        order: -1;
    }

    .pro-infos {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .pro-common-grid,
    .pro-metier-grid {
        grid-template-columns: 1fr;
    }

    .single-professionnel-content,
    .pro-common-sections,
    .pro-metier-section {
        max-width: 100%;
    }
}

/* =========================================================
   RESPONSIVE MOBILE / TABLETTE TOC
========================================================= */

@media (max-width: 1199px) {
    #toc-pro-mobile-wrapper {
        position: sticky;
        top: var(--header-height, 0px);
        z-index: 999;
        display: none;
        width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        background: #fff;
        border-top: 1px solid var(--cg-border);
        border-bottom: 1px solid var(--cg-border);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    }

    #toc-pro-mobile-wrapper.visible {
        display: block;
    }

    #toc-pro-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 14px 16px;
        border: none;
        background: #fff;
        color: var(--cg-primary);
        font-size: 0.94rem;
        font-weight: 800;
        text-align: left;
        cursor: pointer;
    }

    #toc-pro-mobile-toggle::after {
        content: "▾";
        font-size: 0.9rem;
        transition: transform 0.2s ease;
    }

    #toc-pro-mobile-toggle.open::after {
        transform: rotate(180deg);
    }

    #toc-pro-mobile-panel {
        display: none;
        padding: 0 16px 12px;
        background: #fff;
    }

    #toc-pro-mobile-panel.open {
        display: block;
    }
}

/* =========================================================
   RESPONSIVE MOBILE
========================================================= */

@media (max-width: 768px) {
    .single-professionnel-wrapper {
        padding-bottom: 28px;
    }

    .pro-hero {
        padding: 20px;
        border-radius: var(--cg-radius-md);
        margin-bottom: 20px;
    }

    .pro-title {
        font-size: 1.7rem;
        line-height: 1.2;
        margin-bottom: 16px;
    }

    .pro-description {
        font-size: 0.98rem;
        line-height: 1.65;
    }

    .pro-section-title,
    .pro-common-sections h2,
    .single-professionnel-content h2 {
        margin: 24px 0 14px;
        padding: 2px 0 2px 12px;
        font-size: 1.3rem;
    }

    .pro-card,
    .pro-section-card {
        padding: 18px;
        border-radius: var(--cg-radius-md);
    }

    .pro-card-title,
    .pro-common-sections h3,
    .single-professionnel-content h3 {
        font-size: 1.08rem;
        margin-bottom: 12px;
    }

    .pro-section-card p,
    .pro-card-content p,
    .pro-card p,
    .single-professionnel-content p {
        font-size: 0.96rem;
        line-height: 1.68;
    }

    .pro-galerie-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .pro-reseaux-list {
        flex-direction: column;
    }

    .pro-reseaux-list a {
        width: 100%;
        justify-content: center;
    }

    .pro-lightbox {
        padding: 14px;
    }

    .pro-lightbox-close {
        top: 14px;
        right: 14px;
    }

    .pro-lightbox-prev,
    .pro-lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .pro-lightbox-prev {
        left: 10px;
    }

    .pro-lightbox-next {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .pro-title {
        font-size: 1.52rem;
    }

    .pro-hero {
        padding: 16px;
    }

    .pro-card,
    .pro-section-card {
        padding: 16px;
    }

    .pro-section-card p,
    .pro-card-content p,
    .pro-card p,
    .single-professionnel-content p {
        font-size: 0.93rem;
    }
}

/* =========================================================
   DESKTOP TOC
========================================================= */

@media (min-width: 1200px) {
    #cg-toc-pro-fixed {
        display: block;
    }

    #toc-pro-mobile-wrapper {
        display: none !important;
    }
}
/* =========================================================
   CONCEPT B — fiche pro : hero léger + colonne principale + aside identité
   (pattern universel : aside commun aux 8 métiers, colonne principale spécifique)
========================================================= */

.pro-shell {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 var(--cg-space-5);
}

/* Hero allégé : on neutralise l'ancien hero-carte 2 colonnes */
.single-professionnel .pro-hero {
    display: block;
    max-width: none;
    margin: 0 0 var(--cg-space-6);
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
}

.pro-welcome {
    max-width: 64ch;
    margin-top: var(--cg-space-3);
    color: var(--cg-text-soft);
    font-size: var(--cg-text-md);
}
.pro-welcome p { margin: 0 0 var(--cg-space-2); }
.pro-welcome p:last-child { margin-bottom: 0; }

/* Layout 2 colonnes */
.pro-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: var(--cg-space-7);
    align-items: start;
}
/* Bascule "solo" : colonne principale vide → 1 colonne centrée (carte = contenu) */
.pro-layout--solo {
    grid-template-columns: minmax(0, 1fr);
    max-width: 520px;
    margin: 0 auto;
}
.pro-main { min-width: 0; }

/* Faits rapides : pills */
.pro-facts {
    display: flex;
    flex-wrap: wrap;
    gap: var(--cg-space-2);
    margin-bottom: var(--cg-space-6);
}
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--cg-radius-pill);
    border: 1px solid var(--cg-border);
    background: #fff;
    font-size: var(--cg-text-sm);
    font-weight: 600;
    color: var(--cg-text);
}
.pill--attr {
    background: var(--cg-bg-alt);
    border-color: transparent;
    font-weight: 700;
    color: var(--cg-primary);
}
/* booléen = traitement neutre/accent (le vert status-good reste réservé aux scores) */
.pill--bool { border-color: var(--cg-border-strong); }
.pill--bool::before {
    content: "✓";
    color: var(--cg-accent);
    font-weight: 800;
}

/* Services : chips */
.pro-chips { display: flex; flex-wrap: wrap; gap: var(--cg-space-2); }
.pro-chip {
    padding: 7px 14px;
    border-radius: var(--cg-radius-pill);
    border: 1px solid var(--cg-border);
    background: #fff;
    font-size: var(--cg-text-sm);
    color: var(--cg-text);
}

.pro-prose p { margin: 0 0 var(--cg-space-2); color: var(--cg-text-soft); }
.pro-prose p:last-child { margin-bottom: 0; }

/* ===== Aside : carte d'identité ===== */
.pro-aside { position: sticky; top: var(--cg-space-6); }
.pro-layout--solo .pro-aside { position: static; }

.pro-idcard {
    background: #fff;
    border: 1px solid var(--cg-border);
    border-radius: var(--cg-radius-lg);
    box-shadow: var(--cg-shadow-sm);
    overflow: hidden;
}
.pro-idcard-thumb {
    aspect-ratio: 16 / 10;
    background: var(--cg-bg-alt);
}
.pro-idcard-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pro-idcard-body { padding: var(--cg-space-5); }

.pro-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-bottom: var(--cg-space-4);
    padding: 13px 16px;
    border: none;
    border-radius: var(--cg-radius-sm);
    background: var(--cg-accent);
    color: #fff;
    font-size: var(--cg-text-base);
    font-weight: 700;
    text-decoration: none;
}
.pro-cta:hover { background: var(--cg-accent-hover); color: #fff; text-decoration: none; }

.pro-contact { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--cg-space-3); }
.pro-contact li { display: flex; gap: 10px; align-items: flex-start; font-size: var(--cg-text-sm); }
.pro-contact-ico { flex: 0 0 18px; color: var(--cg-accent); line-height: 1.4; }
.pro-contact-ico .pro-icon { display: block; }
.pro-contact-lab {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--cg-text-muted);
    font-weight: 700;
}
.pro-contact a { color: var(--cg-text); }
.pro-contact a:hover { color: var(--cg-accent); }

.pro-idcard-divider { height: 1px; background: var(--cg-border); margin: var(--cg-space-4) 0; }
.pro-idcard-hours .pro-contact-lab { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.pro-hours-list { margin: 0; padding: 0; }
.pro-hours-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--cg-border, #ececec); }
.pro-hours-row:last-child { border-bottom: 0; }
.pro-hours-row dt { font-size: var(--cg-text-sm); font-weight: 600; color: var(--cg-text, #222); margin: 0; }
.pro-hours-row dd { margin: 0; text-align: right; display: flex; flex-direction: column; gap: 2px; }
.pro-hours-slot { font-size: var(--cg-text-sm); color: var(--cg-text-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pro-hours-row.is-closed dt { color: var(--cg-text-soft); font-weight: 500; }
.pro-hours-closed { font-size: var(--cg-text-sm); color: var(--cg-text-soft); font-style: italic; }

.pro-idcard-social { display: flex; gap: var(--cg-space-2); margin-top: var(--cg-space-4); }
.pro-idcard-social a {
    flex: 1;
    text-align: center;
    padding: 8px;
    border: 1px solid var(--cg-border);
    border-radius: var(--cg-radius-sm);
    font-size: var(--cg-text-xs);
    font-weight: 600;
    color: var(--cg-primary);
}
.pro-idcard-social a:hover { border-color: var(--cg-accent); text-decoration: none; }

/* Responsive : aside remonté sous le hero, contact/CTA d'abord */
@media (max-width: 880px) {
    .pro-layout { grid-template-columns: 1fr; gap: var(--cg-space-5); }
    .pro-layout .aside,
    .pro-layout .pro-aside { order: -1; position: static; }
}
