/*
 * imse-hero-mosaic.css — Phase 1 refonte theme S108 22/05/2026
 * Hero banner + services mosaic. Look Hostinger inspired (dark + serif italic).
 */

/* ===========================================
   1. HERO BANNER
   =========================================== */

.imse-hero-banner {
    position: relative;
    width: 100%;
    min-height: 60vh;
    background-image: var(--imse-hero-image);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    overflow: hidden;
    isolation: isolate;
    margin-bottom: 0;
}

.imse-hero-banner__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 34, 54, 0.45) 0%, rgba(15, 34, 54, 0.7) 50%, rgba(15, 34, 54, 0.9) 100%);
    z-index: 1;
}

.imse-hero-banner__inner {
    position: relative;
    z-index: 2;
    max-width: 880px;
    margin: 0 auto;
    padding: 6rem 1.5rem 4rem;
    color: #FAF4E5;
    text-align: center;
}

.imse-hero-banner__breadcrumb {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #F4A340;
}

.imse-hero-banner__breadcrumb a {
    color: #F4A340;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}
.imse-hero-banner__breadcrumb a:hover { border-bottom-color: #F4A340; }
.imse-hero-banner__breadcrumb span { color: rgba(244, 163, 64, 0.6); }
.imse-hero-banner__current { color: #fff !important; font-weight: 600; }

.imse-hero-banner__title {
    font-family: 'Fraunces', 'DM Serif Display', Georgia, serif;
    font-style: italic;
    font-weight: 600;
    font-size: clamp(2.2rem, 5vw, 4rem);
    line-height: 1.12;
    margin: 0 0 1.5rem;
    color: #fff;
    letter-spacing: -0.01em;
}

.imse-hero-banner__lede {
    font-family: 'Inter', sans-serif;
    font-size: clamp(1.05rem, 1.8vw, 1.25rem);
    line-height: 1.55;
    margin: 0 auto 2rem;
    max-width: 640px;
    color: rgba(250, 244, 229, 0.9);
}

.imse-hero-banner__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.imse-hero-banner__cta {
    display: inline-block;
    padding: 0.95rem 2rem;
    background: #F4A340;
    color: #0F2236;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 999px;
    border: 2px solid #F4A340;
    transition: all 0.25s ease;
}
.imse-hero-banner__cta:hover {
    background: #fbbf24;
    border-color: #fbbf24;
    transform: translateY(-1px);
}

.imse-hero-banner__cta--ghost {
    background: transparent;
    color: #FAF4E5;
    border-color: rgba(250, 244, 229, 0.4);
}
.imse-hero-banner__cta--ghost:hover {
    background: rgba(250, 244, 229, 0.1);
    color: #FAF4E5;
    border-color: #FAF4E5;
}

.imse-hero-banner__signature {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: rgba(250, 244, 229, 0.75);
    letter-spacing: 0.04em;
}
.imse-hero-banner__signature strong { color: #F4A340; }
.imse-hero-banner__signature-label { opacity: 0.7; margin-right: 0.3rem; }

/* ===========================================
   2. SERVICES MOSAIC
   =========================================== */

.imse-services-mosaic {
    background: #0F2236;
    padding: 5rem 1.5rem 6rem;
    color: #FAF4E5;
}

.imse-services-mosaic__inner {
    max-width: 1280px;
    margin: 0 auto;
}

.imse-services-mosaic__title {
    font-family: 'Fraunces', 'DM Serif Display', Georgia, serif;
    font-style: italic;
    font-weight: 500;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.15;
    text-align: center;
    color: #fff;
    margin: 0 0 3rem;
}

.imse-services-mosaic__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

@media (min-width: 900px) {
    .imse-services-mosaic__grid { grid-template-columns: repeat(4, 1fr); }
}

.imse-services-mosaic__card {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 12px;
    background-image: var(--imse-card-image);
    background-size: cover;
    background-position: center center;
    text-decoration: none;
    color: #fff;
    isolation: isolate;
    transition: transform 0.3s ease;
}

.imse-services-mosaic__card:hover { transform: translateY(-4px); }

.imse-services-mosaic__card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(15, 34, 54, 0.15) 0%, rgba(15, 34, 54, 0.85) 100%);
    z-index: 1;
}

.imse-services-mosaic__card-content {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
    color: #FAF4E5;
}

.imse-services-mosaic__card-label {
    display: block;
    font-family: 'Fraunces', 'DM Serif Display', Georgia, serif;
    font-style: italic;
    font-weight: 600;
    font-size: 1.45rem;
    line-height: 1.2;
    color: #fff;
    margin-bottom: 0.5rem;
}

.imse-services-mosaic__card-desc {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    line-height: 1.4;
    color: rgba(250, 244, 229, 0.85);
}

/* ===========================================
   3. SITE HEADER DARK MODE OVERRIDE
   =========================================== */

.imse-site-header {
    background: rgba(15, 34, 54, 0.96) !important;
    backdrop-filter: blur(8px);
    color: #FAF4E5 !important;
    border-bottom: 1px solid rgba(244, 163, 64, 0.2);
}

.imse-site-header .imse-brand-name {
    color: #fff !important;
    font-family: 'Fraunces', 'DM Serif Display', Georgia, serif;
    font-style: italic;
    font-size: 1.4rem;
}

.imse-site-header .imse-brand-sub {
    color: rgba(244, 163, 64, 0.85) !important;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.imse-site-header .imse-menu a {
    color: #FAF4E5 !important;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.imse-site-header .imse-menu a:hover { color: #F4A340 !important; }

.imse-site-header .imse-newsletter-cta {
    background: transparent !important;
    color: #FAF4E5 !important;
    border: 2px solid rgba(250, 244, 229, 0.5) !important;
    border-radius: 999px;
    padding: 0.55rem 1.4rem !important;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.imse-site-header .imse-newsletter-cta:hover {
    background: #F4A340 !important;
    color: #0F2236 !important;
    border-color: #F4A340 !important;
}

.imse-hoguet-strip {
    background: #0F2236 !important;
    color: #F4A340 !important;
    border-top: 1px solid rgba(244, 163, 64, 0.15);
    font-family: 'JetBrains Mono', 'Inter', sans-serif;
    font-size: 0.78rem;
    padding: 0.6rem 1rem;
}

.imse-hoguet-strip__sep { opacity: 0.4; }

/* ===========================================
   4. LOGO REAL IMAGE (replace SVG JJ)
   =========================================== */

.imse-brand-mark--image img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #F4A340;
}

/* ===========================================
   5. HOME HERO variant + CONTENT IMAGES LAYOUT
   =========================================== */

.imse-hero-banner--home {
    min-height: 75vh;
}

.imse-hero-banner__eyebrow {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: #F4A340;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.imse-hero-banner__title em {
    font-style: italic;
    font-weight: 400;
    color: #F4A340;
    display: block;
    margin-top: 0.2em;
}

/* Layout grid for images in commune content (corrige photos mal réparties) */
.imse-single__content figure {
    margin: 0;
}

.imse-single__content figure img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

/* Group consecutive figures in a responsive grid */
.imse-single__content {
    --img-gap: 1rem;
}

.imse-single__content figure + figure {
    margin-top: 0.5rem;
}

/* Make consecutive figures into a 2-col grid via CSS contain */
@media (min-width: 768px) {
    .imse-single__content figure:has(+ figure) {
        display: inline-block;
        width: calc(50% - var(--img-gap) / 2);
        margin-right: var(--img-gap);
        vertical-align: top;
    }
    .imse-single__content figure:has(+ figure) + figure {
        display: inline-block;
        width: calc(50% - var(--img-gap) / 2);
        margin-right: 0;
        margin-top: 0;
        vertical-align: top;
    }
}

/* Filter out useless small thumbs (responsive duplicates) */
.imse-single__content figure img[src*="w=158"],
.imse-single__content figure img[src*="w=297"],
.imse-single__content figure img[src*="h=184"] {
    display: none;
}
.imse-single__content figure:has(img[src*="w=158"]),
.imse-single__content figure:has(img[src*="w=297"]),
.imse-single__content figure:has(img[src*="h=184"]) {
    display: none !important;
}

/* ===========================================
   6. GRID LAYOUT for consecutive figures in content
   =========================================== */
.imse-img-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}
.imse-img-grid figure {
    margin: 0;
    border-radius: 8px;
    overflow: hidden;
}
.imse-img-grid figure img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 16 / 9;
    display: block;
}

/* Hide the small responsive variant images (each photo had 2 sizes : large + small thumbnail) */
.imse-img-grid figure img[width="328"],
.imse-img-grid figure img[width="184"],
.imse-img-grid figure img[width="158"],
.imse-img-grid figure img[height="184"],
.imse-img-grid figure img[width="297"] {
    display: none;
}
/* Hide figure if its only img is a small variant */
.imse-img-grid figure:has(> img:only-child[src*="w=328"]),
.imse-img-grid figure:has(> img:only-child[src*="w=158"]),
.imse-img-grid figure:has(> img:only-child[src*="w=297"]),
.imse-img-grid figure:has(> img:only-child[src*="h=184"]) {
    display: none;
}

/* ===========================================
   7. CORRECTION 1 — TYPO RÉDUITE + MENU COMPACT (S108 Julien feedback)
   =========================================== */

/* Hero banner title : H1 max 32-44px desktop (was clamp 2.2-4rem = 35-64px) */
.imse-hero-banner__title {
    font-size: clamp(1.75rem, 3vw, 2.5rem) !important; /* 28-40px */
    line-height: 1.2;
    margin-bottom: 1rem !important;
}
.imse-hero-banner__lede {
    font-size: clamp(0.95rem, 1.3vw, 1.05rem) !important; /* 15-17px */
    margin-bottom: 1.5rem !important;
}
.imse-hero-banner__eyebrow {
    font-size: 0.75rem !important;
    letter-spacing: 0.15em;
}
.imse-hero-banner__inner {
    padding: 4rem 1.5rem 3rem !important;
}
.imse-hero-banner--home {
    min-height: 60vh !important; /* was 75vh trop grand */
}

/* Single article H1 : reduce too */
.imse-single__title {
    font-size: clamp(1.6rem, 2.8vw, 2.2rem) !important;
    line-height: 1.2;
}

/* Site header : compacter padding */
.imse-site-header {
    padding: 0.5rem 1.5rem !important;
}
.imse-site-header .imse-brand-name {
    font-size: 1.1rem !important;
}
.imse-site-header .imse-brand-sub {
    font-size: 0.62rem !important;
    letter-spacing: 0.1em;
}
.imse-site-header .imse-menu {
    gap: 1rem !important;
}
.imse-site-header .imse-menu a {
    font-size: 0.72rem !important;
    letter-spacing: 0.08em;
}
.imse-site-header .imse-newsletter-cta {
    padding: 0.45rem 1.1rem !important;
    font-size: 0.72rem !important;
}

/* Hoguet sub-header strip : affiner padding */
.imse-hoguet-strip {
    padding: 0.4rem 1rem !important;
    font-size: 0.7rem !important;
}

/* Section titles homepage : réduire */
.imse-home-bio__title,
.imse-home-communes__title,
.imse-home-process__title,
.imse-services-mosaic__title {
    font-size: clamp(1.5rem, 3vw, 2.2rem) !important;
}

/* ===========================================
   8. CORRECTION 2 — Photo Julien object-position (centré visage)
   =========================================== */
.imse-home-bio__portrait {
    object-position: center top !important; /* biaiser vers le haut pour visage */
}
/* Author byline avatar : si on a une image au lieu des initiales JJ */
.imse-single__byline-avatar img,
.imse-single__author-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    border-radius: 50%;
}

/* ===========================================
   9. CORRECTION 6 — Pages polish (legal/piliers/communes)
   =========================================== */

/* Pages legal : taille texte + line-height confortable */
.imse-single__content {
    font-size: 1rem;
    line-height: 1.7;
    color: #1E3A5F;
}
.imse-single__content p {
    margin-bottom: 1.25rem;
}
.imse-single__content h2 {
    font-family: 'Fraunces', 'DM Serif Display', Georgia, serif;
    font-weight: 600;
    font-size: 1.5rem !important;
    line-height: 1.25;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: #0F2236;
}
.imse-single__content h3 {
    font-size: 1.15rem !important;
    font-weight: 600;
    color: #0F2236;
    margin-top: 1.75rem;
}
.imse-single__content ul, .imse-single__content ol {
    margin-left: 1.5rem;
    margin-bottom: 1.25rem;
}
.imse-single__content li {
    margin-bottom: 0.5rem;
}
.imse-single__content strong { color: #0F2236; }
.imse-single__content a { color: #F4A340; text-decoration: underline; }
.imse-single__content a:hover { color: #0F2236; }

/* Pages stubs : hero hauteur réduite (300+ mots = pas besoin gros hero) */
body.single-commune .imse-hero-banner:not(.imse-hero-banner--home) {
    min-height: 45vh;
}

/* Drop-cap on first paragraph only (rule Fraunces) */
.imse-single__content > p:first-of-type::first-letter {
    font-family: 'Fraunces', 'DM Serif Display', Georgia, serif;
    font-size: 4rem;
    font-style: italic;
    line-height: 0.85;
    float: left;
    margin-right: 0.5rem;
    margin-top: 0.3rem;
    color: #F4A340;
}

/* ===========================================
   10. PHASE 1.1 RIGOROUS — H1 max 32px desktop / 24px mobile (S108 Julien)
   =========================================== */
.imse-hero-banner__title {
    font-size: clamp(1.5rem, 2.2vw, 2rem) !important; /* 24-32px */
    line-height: 1.2 !important;
}
.imse-hero-banner__lede {
    font-size: clamp(1rem, 1.3vw, 1.125rem) !important; /* 16-18px */
    line-height: 1.55 !important;
}
.imse-single__title {
    font-size: clamp(1.5rem, 2.2vw, 2rem) !important; /* same as hero */
    line-height: 1.2 !important;
}

@media (max-width: 720px) {
    .imse-hero-banner__title { font-size: 1.5rem !important; } /* 24px mobile */
    .imse-hero-banner__lede { font-size: 1rem !important; } /* 16px mobile */
    .imse-single__title { font-size: 1.5rem !important; }
}

/* ===========================================
   V4.M — Logo header img (replace SVG JJ)
   =========================================== */
.imse-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
}
.imse-brand-mark img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
    border-radius: 50%;
    background: #FAF4E5;
    padding: 3px;
}
@media (max-width: 720px) {
    .imse-brand-mark {
        width: 40px;
        height: 40px;
    }
    .imse-brand-mark img {
        width: 40px;
        height: 40px;
        padding: 2px;
    }
}

/* ===========================================
   V5.Q — Logo header visibilité (S108)
   =========================================== */
.imse-brand-mark {
    width: 64px !important;
    height: 64px !important;
}
.imse-brand-mark img {
    width: 64px !important;
    height: 64px !important;
    border-radius: 50%;
    background: #FAF4E5 !important;
    padding: 4px !important;
    box-shadow: 0 0 0 2px #F4A340, 0 4px 10px rgba(0, 0, 0, 0.3);
    object-fit: contain;
    display: block;
}
@media (max-width: 720px) {
    .imse-brand-mark {
        width: 48px !important;
        height: 48px !important;
    }
    .imse-brand-mark img {
        width: 48px !important;
        height: 48px !important;
        padding: 3px !important;
    }
}

/* ===========================================
   V5.R — Replace SVG JJ with photo Julien (estimation page)
   =========================================== */
.imse-w1-portrait-img {
    width: 100%;
    max-width: 280px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center top;
    border-radius: 50%;
    border: 4px solid #F4A340;
    box-shadow: 0 10px 40px rgba(15, 34, 54, 0.25);
    display: block;
    margin: 0 auto;
}

/* === V7.2.1 — Hero homepage Piste 7 hybride visuel === */
.imse-hero-banner--v721-OLD {
    min-height: 85vh !important;
}
.imse-hero-banner--v721 .imse-hero-banner__overlay {
    background: linear-gradient(180deg, rgba(15, 34, 54, 0.30) 0%, rgba(15, 34, 54, 0.50) 50%, rgba(15, 34, 54, 0.65) 100%);
}
.imse-hero-banner--v721 .imse-hero-banner__inner {
    padding-top: 8vh;
    padding-bottom: 8vh;
}
@media (max-width: 768px) {
    .imse-hero-banner--v721-OLD {
        min-height: 70vh !important;
    }
}

/* === V7.2.12 — Design pages communes (retravail attractivité) === */
/* Hero plus grand : 60vh desktop, 50vh mobile */
body.single-commune .imse-hero-banner:not(.imse-hero-banner--home) {
    min-height: 60vh !important;
    padding-top: 5vh;
    padding-bottom: 5vh;
}
@media (max-width: 768px) {
    body.single-commune .imse-hero-banner:not(.imse-hero-banner--home) {
        min-height: 50vh !important;
    }
}

/* Body content : line-height confortable + espacements généreux */
body.single-commune .imse-single__content {
    font-size: 1.05rem;
    line-height: 1.75;
}
body.single-commune .imse-single__content p {
    margin: 0 0 1.5rem;
    line-height: 1.75;
}
body.single-commune .imse-single__content h2 {
    font-size: clamp(1.6rem, 2.6vw, 2.1rem);
    margin: 3.5rem 0 1.25rem;
    line-height: 1.25;
    color: var(--imse-navy, #0F2236);
}
body.single-commune .imse-single__content h2:first-of-type {
    margin-top: 2rem;
}
body.single-commune .imse-single__content h3 {
    font-size: clamp(1.2rem, 2vw, 1.4rem);
    margin: 2.25rem 0 1rem;
    color: var(--imse-navy, #0F2236);
}

/* Card communes voisines plus visuelles */
body.single-commune .imse-single__content p a[href*="immobilier-"] {
    color: var(--imse-navy, #0F2236);
    text-decoration: underline;
    text-decoration-color: rgba(244, 163, 64, 0.6);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: all 0.2s ease;
}
body.single-commune .imse-single__content p a[href*="immobilier-"]:hover {
    color: #F4A340;
    text-decoration-color: #F4A340;
}

/* Photos intra-article : plus grandes + cohérence visuelle */
body.single-commune .imse-single__content figure {
    margin: 2.5rem auto;
    text-align: center;
}
body.single-commune .imse-single__content figure img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 34, 54, 0.15);
}

/* === V7.3.2 — Hero homepage hauteur reduite (65vh desktop, 60vh mobile) === */
.imse-hero-banner--v721 {
    min-height: 65vh !important;
    max-height: 75vh;
}
@media (max-width: 768px) {
    .imse-hero-banner--v721 {
        min-height: 60vh !important;
    }
}

/* === V7.4.1 — Hero homepage 45vh (override V7.3.2 65vh) === */
.imse-hero-banner--v721 {
    min-height: 45vh !important;
    max-height: 55vh !important;
}
@media (max-width: 768px) {
    .imse-hero-banner--v721 {
        min-height: 45vh !important;
        max-height: 50vh !important;
    }
}
