/*
 Theme Name:   Bati Home Access Child
 Theme URI:    https://bati-home-access.com
 Description:  Child theme Astra optimise SEO/GEO local pour Bati Home Access - Constructeur maisons petit budget Blois (41)
 Author:       Groupe AYLE
 Author URI:   https://bati-home-access.com
 Template:     astra
 Version:      2.0.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  bha-child
*/

/* ==========================================================================
   FONTS
   ========================================================================== */

/* Fonts loaded via functions.php wp_enqueue_style preload — not @import */

/* ==========================================================================
   VARIABLES
   ========================================================================== */

:root {
    --bha-blue: #046bd2;
    --bha-blue-hover: #0355a8;
    --bha-teal: #3a9cb9;
    --bha-dark: #0f172a;
    --bha-text: #334155;
    --bha-muted: #64748b;
    --bha-light: #f7f9fc;
    --bha-border: #e5e7eb;
    --bha-white: #ffffff;
    --bha-radius: 12px;
    --bha-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   GLOBAL — Force Outfit/DM Sans sur tout le site
   ========================================================================== */

body,
.entry-content,
.ast-single-post .entry-content,
.page .entry-content {
    font-family: 'DM Sans', sans-serif !important;
    font-size: 17px;
    line-height: 1.7;
    color: var(--bha-text);
}

h1, h2, h3, h4, h5, h6,
.wp-block-heading,
.entry-title {
    font-family: 'Outfit', sans-serif !important;
    color: var(--bha-dark);
    line-height: 1.15;
}

/* ==========================================================================
   GUTENBERG BLOCKS — Enrichir le rendu par defaut
   ========================================================================== */

/* --- Cover block (Hero) --- */
.wp-block-cover.alignfull {
    min-height: 88vh !important;
}

.wp-block-cover .wp-block-cover__inner-container {
    max-width: 780px;
    margin: 0 auto;
}

.wp-block-cover h1.wp-block-heading {
    font-size: clamp(30px, 5vw, 56px) !important;
    font-weight: 800 !important;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 20px rgba(0,0,0,0.2);
}

.wp-block-cover p {
    font-size: clamp(16px, 2vw, 20px) !important;
    opacity: 0.92;
    text-shadow: 0 1px 8px rgba(0,0,0,0.15);
}

/* --- Buttons --- */
.wp-block-button__link {
    font-family: 'Outfit', sans-serif !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    border-radius: 50px !important;
    padding: 14px 32px !important;
    transition: all 0.35s var(--bha-ease) !important;
    text-decoration: none !important;
}

.wp-block-button__link:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 24px rgba(4, 107, 210, 0.3) !important;
}

.is-style-outline .wp-block-button__link {
    border-width: 2px !important;
}

.is-style-outline .wp-block-button__link:hover {
    background: var(--bha-white) !important;
    color: var(--bha-blue) !important;
}

/* Outline button on white bg — visible border + white bg */
.wp-block-group:not([style*="046bd2"]) .is-style-outline .wp-block-button__link {
    border-color: var(--bha-blue) !important;
    color: var(--bha-blue) !important;
    background: var(--bha-white) !important;
}

.wp-block-group:not([style*="046bd2"]) .is-style-outline .wp-block-button__link:hover {
    background: var(--bha-blue) !important;
    color: var(--bha-white) !important;
}

/* Card buttons — center */
.wp-block-column[style*="border-width"] .wp-block-buttons {
    justify-content: center !important;
    padding: 0 24px;
}

.wp-block-column[style*="border-width"] .wp-block-button__link {
    width: 100%;
    text-align: center;
}

/* CTA outline button on blue bg — white border visible */
.wp-block-group[style*="046bd2"] .is-style-outline .wp-block-button__link {
    border-color: rgba(255,255,255,0.6) !important;
}

.wp-block-group[style*="046bd2"] .is-style-outline .wp-block-button__link:hover {
    border-color: #fff !important;
    background: rgba(255,255,255,0.1) !important;
    color: #fff !important;
}

/* --- Group blocks as sections --- */
.wp-block-group.alignfull {
    overflow: hidden;
}

.wp-block-group.alignfull > * {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* --- Columns (cards) --- */
.wp-block-columns {
    gap: 28px !important;
}

.wp-block-column {
    transition: all 0.4s var(--bha-ease);
}

/* Card-style columns (with border) */
.wp-block-column[style*="border-width"] {
    border-radius: var(--bha-radius) !important;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
}

.wp-block-column[style*="border-width"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
    border-color: #d1d5db !important;
}

/* Image zoom on card hover */
.wp-block-column[style*="border-width"] .wp-block-image {
    overflow: hidden;
}

.wp-block-column[style*="border-width"] .wp-block-image img {
    transition: transform 0.6s var(--bha-ease);
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.wp-block-column[style*="border-width"]:hover .wp-block-image img {
    transform: scale(1.02);
}

/* --- Headings in sections --- */
.wp-block-group.alignfull h2.wp-block-heading {
    font-size: clamp(26px, 3.5vw, 40px) !important;
    font-weight: 700 !important;
}

.wp-block-group.alignfull h3.wp-block-heading {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: var(--bha-blue) !important;
}

/* --- Images --- */
.wp-block-image img {
    border-radius: var(--bha-radius);
}

.wp-block-image.aligncenter img {
    border-radius: 50%;
    background: #e8f0fe;
    padding: 16px;
}

/* Step icons — round with bg */
.wp-block-image.aligncenter.size-thumbnail img {
    width: 72px !important;
    height: 72px !important;
    border-radius: 50% !important;
    background: #e8f0fe !important;
    padding: 14px !important;
    object-fit: contain !important;
}

/* --- Details / FAQ --- */
.wp-block-details {
    border-bottom: 1px solid var(--bha-border);
    padding: 0;
    margin: 0;
}

.wp-block-details summary {
    font-family: 'Outfit', sans-serif !important;
    font-size: 17px !important;
    font-weight: 600 !important;
    color: var(--bha-dark);
    padding: 20px 0;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.3s ease;
}

.wp-block-details summary:hover {
    color: var(--bha-blue);
}

.wp-block-details summary::after {
    content: '+';
    font-size: 24px;
    font-weight: 300;
    color: var(--bha-blue);
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 16px;
}

.wp-block-details[open] summary::after {
    transform: rotate(45deg);
}

.wp-block-details summary::-webkit-details-marker {
    display: none;
}

.wp-block-details p {
    font-size: 15px !important;
    color: var(--bha-muted) !important;
    line-height: 1.7 !important;
    padding-bottom: 20px;
}

/* --- USP blocks (bg-alt with left accent) --- */
.wp-block-column[style*="F5F7FA"],
.wp-block-column[style*="f5f7fa"],
.wp-block-column[style*="f7f9fc"] {
    border-left: 4px solid var(--bha-blue) !important;
    border-radius: var(--bha-radius) !important;
    transition: all 0.35s var(--bha-ease);
}

.wp-block-column[style*="F5F7FA"]:hover,
.wp-block-column[style*="f5f7fa"]:hover,
.wp-block-column[style*="f7f9fc"]:hover {
    background: #eef4fd !important;
    transform: translateX(4px);
}

/* --- Stats section (blue bg) --- */
.wp-block-group[style*="046bd2"] {
    position: relative;
}

.wp-block-group[style*="046bd2"] .wp-block-group {
    border-right: 1px solid rgba(255,255,255,0.15);
    padding: 32px 30px !important;
}

.wp-block-group[style*="046bd2"] .wp-block-group:last-child {
    border-right: none;
}

.wp-block-group[style*="046bd2"] h2.wp-block-heading {
    font-size: clamp(36px, 4.5vw, 52px) !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    margin-bottom: 4px !important;
}

/* Stats labels only — scope tightly to avoid CTA section */
.wp-block-group[style*="046bd2"][style*="padding-top:0px"] p,
.wp-block-group[style*="046bd2"][style*="padding-bottom:0px"] p {
    font-size: 13px !important;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    opacity: 0.75;
    margin: 0 !important;
}

/* CTA section (blue bg with padding) — normal text, no uppercase */
.wp-block-group[style*="046bd2"][style*="padding-top:80px"] p {
    font-size: 17px !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    opacity: 0.9 !important;
}

/* ==========================================================================
   ANIMATIONS — Scroll reveal
   ========================================================================== */

.bha-slide-up {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.bha-slide-left {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.bha-slide-right {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.bha-scale-in {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.bha-slide-up.visible,
.bha-slide-left.visible,
.bha-slide-right.visible,
.bha-scale-in.visible {
    opacity: 1;
    transform: none;
}

/* ==========================================================================
   MOBILE CTA STICKY
   ========================================================================== */

.bha-mobile-cta {
    display: none;
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */

:focus-visible {
    outline: 2px solid var(--bha-blue);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--bha-blue);
    color: #fff;
    padding: 8px 16px;
    z-index: 100;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

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

@media (max-width: 1024px) {
    .wp-block-cover.alignfull {
        min-height: 70vh !important;
    }
}

@media (max-width: 768px) {
    .wp-block-cover.alignfull {
        min-height: 65vh !important;
    }

    .wp-block-cover h1.wp-block-heading {
        font-size: 28px !important;
    }

    .wp-block-group[style*="046bd2"] {
        flex-direction: column !important;
    }

    .wp-block-group[style*="046bd2"] .wp-block-group {
        border-right: none !important;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        padding: 20px 16px !important;
    }

    .wp-block-group.alignfull h2.wp-block-heading {
        font-size: 24px !important;
    }

    .wp-block-columns {
        gap: 20px !important;
    }

    .bha-mobile-cta {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 999;
        background: var(--bha-blue);
        padding: 12px 20px;
        justify-content: center;
        gap: 12px;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
    }

    .bha-mobile-cta a {
        color: #FFFFFF;
        font-family: 'Outfit', sans-serif;
        font-weight: 600;
        text-decoration: none;
        font-size: 16px;
    }

    body {
        padding-bottom: 56px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .bha-slide-up,
    .bha-slide-left,
    .bha-slide-right,
    .bha-scale-in {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    .wp-block-column,
    .wp-block-button__link,
    .wp-block-column[style*="border-width"] .wp-block-image img {
        transition: none !important;
    }
}

/* ============================================
   UX POLISH : cursor pointer + hover states
   ============================================ */

/* Cursor pointer sur tout élément cliquable (liens, boutons, figures avec link) */
a,
button,
.wp-block-button__link,
.wp-block-column a,
figure.wp-block-image a,
figure.wp-block-image img[data-lightbox],
.wp-block-image.has-lightbox img,
.wp-element-button,
[role="button"],
details summary {
    cursor: pointer;
}

/* Feedback hover sur boutons */
.wp-block-button__link,
.wp-element-button {
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.wp-block-button__link:hover,
.wp-element-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(4, 107, 210, 0.2);
}

/* Feedback hover sur liens texte simples */
a:not(.wp-block-button__link):not(.wp-element-button):hover {
    opacity: 0.82;
    transition: opacity 0.15s ease;
}

/* Images cliquables : indiquer clairement avec curseur + subtle hover */
figure.wp-block-image a img,
figure.wp-block-image[class*="has-lightbox"] img,
.wp-block-image img.wp-lightbox-image {
    cursor: zoom-in;
    transition: transform 0.25s ease, filter 0.25s ease;
}
figure.wp-block-image a:hover img,
figure.wp-block-image[class*="has-lightbox"]:hover img {
    transform: scale(1.02);
    filter: brightness(0.95);
}

/* WP Core lightbox (dialog) styling */
.wp-lightbox-overlay {
    background: rgba(15, 23, 42, 0.95);
}

/* Résumé détails (FAQ) */
details summary:hover {
    color: #046bd2;
    transition: color 0.15s ease;
}

/* ============================================
   BRAND COLOR OVERRIDES : amber garage badges → brand blue
   (one-shot fix pour toutes les pages sans repousser)
   ============================================ */

/* Badges garage paragraph style (terrain+maison, modele pages) */
p[style*="#fef3c7"],
p[style*="background-color:#fef3c7"],
p[style*="background: #fef3c7"] {
    background: linear-gradient(90deg, #eff6ff 0%, #f0f9ff 100%) !important;
    background-color: #eff6ff !important;
    border-left-color: #046bd2 !important;
    color: #046bd2 !important;
}

/* Strong text inside garage badges */
p[style*="#fef3c7"] strong,
p[style*="#92400e"] strong {
    color: #046bd2 !important;
}

/* Homepage garage pill badges (span inline) */
span[style*="#fef3c7"],
span[style*="background:#fef3c7"] {
    background: #dbeafe !important;
    background-color: #dbeafe !important;
    color: #046bd2 !important;
}

/* Direct text color override (for amber text) */
[style*="color:#92400e"] {
    color: #046bd2 !important;
}

/* Border-left amber override */
[style*="border-left:4px solid #f59e0b"],
[style*="border-left: 4px solid #f59e0b"] {
    border-left-color: #046bd2 !important;
}
