/* ======================================
   DESIGN SYSTEM — DE MARTIN & FILS
   Bleu marine #262E7E + Jaune #EFED3A
   Bootstrap 5.3.8
   ====================================== */

:root {
    --dm-blue:         #262E7E;
    --dm-blue-dark:    #1a2060;
    --dm-blue-light:   #3d4bb0;
    --dm-yellow:       #EFED3A;
    --dm-yellow-dark:  #d4d100;
    --dm-white:        #ffffff;
    --dm-bg:           #f5f7fc;
    --dm-text:         #333333;
    --dm-muted:        #aaaaaa;
    --dm-border:       rgba(38, 46, 126, 0.12);
    --dm-radius:       0.375rem;
    --dm-shadow:       0 0.5rem 2rem rgba(38, 46, 126, 0.12);
    --dm-shadow-lg:    0 1rem 4rem rgba(38, 46, 126, 0.2);

    /* aliases de compatibilité */
    --demartin-primary:      var(--dm-blue);
    --demartin-primary-dark: var(--dm-blue-dark);
    --demartin-surface:      var(--dm-white);
    --demartin-border:       var(--dm-border);
    --demartin-radius:       var(--dm-radius);
    --demartin-shadow:       var(--dm-shadow);
    --demartin-ink:          var(--dm-text);
    --demartin-muted:        var(--dm-muted);
    --demartin-bg:           var(--dm-bg);
}

/* --- Base --- */
body.demartin-theme {
    background: var(--dm-bg);
    color: var(--dm-text);
    font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    line-height: 1.7;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--dm-blue);
}

a:hover {
    color: var(--dm-blue-dark);
}

img {
    max-width: 100%;
    height: auto;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--dm-blue);
}

/* --- Utilities --- */
.py-lg-6 {
    padding-top: 6rem;
    padding-bottom: 6rem;
}

/* --- Barre supérieure --- */
.top-bar {
    background: var(--dm-blue);
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.82rem;
    padding: 0.45rem 0;
    border-bottom: 2px solid var(--dm-yellow);
}

.top-bar a {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    transition: color 0.18s;
}

.top-bar a:hover {
    color: var(--dm-yellow);
}

.top-bar-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* --- Header / Navbar --- */
.site-header {
    box-shadow: 0 2px 8px rgba(38, 46, 126, 0.08);
}

.demartin-navbar {
    background: var(--dm-white);
    border-bottom: 1px solid var(--dm-border);
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

.custom-logo {
    max-height: 70px;
    width: auto;
}

.navbar-brand {
    font-weight: 800;
    color: var(--dm-blue);
    font-size: 1.1rem;
}

.brand-mark {
    display: inline-flex;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 25%, rgba(239,237,58,.7), transparent 24%),
        linear-gradient(135deg, var(--dm-yellow), var(--dm-blue));
    box-shadow: 0 0.5rem 1rem rgba(38, 46, 126, 0.2);
    flex-shrink: 0;
}

.brand-text {
    font-size: 1rem;
    color: var(--dm-blue);
}

.navbar .nav-link {
    font-weight: 700;
    color: var(--dm-blue);
    border-radius: var(--dm-radius);
    padding-inline: 0.9rem !important;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: background 0.18s, color 0.18s;
}

a.demartin-navbar .btn {
    font-size: 0.875rem;
    padding: 0.45rem 1.1rem;
}

.navbar .nav-link:hover,
.navbar .active > .nav-link,
.navbar .current-menu-item > .nav-link {
    color: var(--dm-blue-dark);
    background: rgba(38, 46, 126, 0.07);
}

.dropdown-menu {
    border: 1px solid var(--dm-border);
    border-radius: var(--dm-radius);
    box-shadow: var(--dm-shadow);
    padding: 0.4rem;
}

.dropdown-item {
    border-radius: calc(var(--dm-radius) - 1px);
    font-weight: 600;
    color: var(--dm-blue);
    font-size: 0.875rem;
}

.dropdown-item:hover {
    background: rgba(38, 46, 126, 0.07);
    color: var(--dm-blue-dark);
}

/* --- Boutons --- */
.btn {
    --bs-btn-border-radius: 50rem;
    font-weight: 700;
}

/* Bouton primaire : bleu → hover jaune */
.btn-primary,
.btn-ace {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--dm-blue);
    --bs-btn-border-color: var(--dm-blue);
    --bs-btn-hover-color: var(--dm-blue);
    --bs-btn-hover-bg: var(--dm-yellow);
    --bs-btn-hover-border-color: var(--dm-yellow);
    --bs-btn-active-color: var(--dm-blue);
    --bs-btn-active-bg: var(--dm-yellow-dark);
    --bs-btn-active-border-color: var(--dm-yellow-dark);
    box-shadow: 0 0.4rem 1.2rem rgba(38, 46, 126, 0.25);
    transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

/* Bouton accent : jaune → hover bleu */
.btn-accent {
    background-color: var(--dm-yellow);
    color: var(--dm-blue);
    border: 1px solid var(--dm-yellow);
    font-weight: 700;
    box-shadow: 0 0.4rem 1rem rgba(239, 237, 58, 0.25);
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-accent:hover,
.btn-accent:focus {
    background-color: var(--dm-blue);
    color: #fff;
    border-color: var(--dm-blue);
}

/* --- Hero Slider --- */
.hero-section {
    position: relative;
    overflow: hidden;
}

/* Le carousel occupe toute la section */
.hero-carousel {
    width: 100%;
}

/* Chaque slide = image de fond + overlay + hauteur */
.hero-carousel .carousel-item {
    min-height: 540px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* overlay gradient */
    background-color: var(--dm-blue); /* fallback si pas d'image */
}

.hero-carousel .carousel-item::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(239, 237, 58, 0.38) 0%,
        rgba(38, 46, 126, 0.75) 100%
    );
    pointer-events: none;
    z-index: 1;
}

/* Contenu centré verticalement dans la slide */
.hero-slide-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    min-height: 540px;
    padding: 5rem 0;
}

.hero-section h1 {
    color: #fff;
    font-size: clamp(1.7rem, 3.8vw, 2.8rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.2;
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.92);
    font-size: clamp(0.95rem, 1.8vw, 1.2rem);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Indicators repositionnés (pas cachés par le chevron) */
.hero-carousel .carousel-indicators {
    bottom: 2.2rem;
    z-index: 5;
}

.hero-carousel .carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.7);
    background: transparent;
    opacity: 1;
    transition: background .2s;
}

.hero-carousel .carousel-indicators button.active {
    background: var(--dm-yellow);
    border-color: var(--dm-yellow);
}

/* Flèches prev/next */
.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next {
    width: 3.5rem;
    z-index: 5;
    opacity: 0.6;
    transition: opacity .2s;
}

.hero-carousel .carousel-control-prev:hover,
.hero-carousel .carousel-control-next:hover {
    opacity: 1;
}

.hero-carousel .carousel-control-prev-icon,
.hero-carousel .carousel-control-next-icon {
    width: 2rem;
    height: 2rem;
    background-size: 100%;
}

/* Chevron décoratif bas du hero */
.hero-chevron {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 44px solid transparent;
    border-right: 44px solid transparent;
    border-top: 26px solid var(--dm-bg);
    z-index: 6;
}

/* =========================================
   Animations texte hero — fade-up staggeré
   ========================================= */

/* État de départ (éléments avant animation) */
.hero-anim {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* État final (ajouté par JS quand la slide devient active) */
.hero-anim.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Décalage staggeré : h1, sous-titre, bouton */
.hero-anim:nth-child(1) { transition-delay: 0.10s; }
.hero-anim:nth-child(2) { transition-delay: 0.28s; }
.hero-anim:nth-child(3) { transition-delay: 0.44s; }

/* --- Section fond bleu --- */
.section-blue {
    background-color: var(--dm-blue);
    color: rgba(255, 255, 255, 0.9);
}

.section-blue h2,
.section-blue h3,
.section-blue h4 {
    color: #fff;
}

/* --- Cartes services (fond bleu) --- */
.service-card-blue {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--dm-radius);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: background 0.2s, transform 0.2s;
    height: 100%;
}

.service-card-blue:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-4px);
}

.service-card-blue p {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.9rem;
}

.service-icon-wrapper {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    border: 2px solid rgba(239, 237, 58, 0.5);
}

.service-icon-wrapper img {
    width: 2.4rem;
    height: 2.4rem;
    filter: brightness(0) invert(1);
}

/* --- Section expérience --- */
.experience-section {
    background: var(--dm-white);
}

.experience-img {
    border-radius: var(--dm-radius);
    width: 100%;
    height: 400px;
    object-fit: cover;
    box-shadow: var(--dm-shadow-lg);
}

/* --- FooGallery override --- */
.foogallery.fg-dark .fg-item-inner {
    background-color: transparent !important;
    color: inherit !important;
    border-color: #262E7E !important;
}

/* --- Galerie expérience --- */
.gallery-main-img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: var(--dm-radius);
    box-shadow: var(--dm-shadow-lg);
    transition: opacity 0.2s;
    display: block;
}

.gallery-main-img:hover {
    opacity: 0.88;
}

.gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.gallery-thumb {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: var(--dm-radius);
    transition: opacity 0.2s, transform 0.2s;
    display: block;
}

.gallery-thumb:hover {
    opacity: 0.82;
    transform: scale(1.03);
}

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

.check-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.check-list .check-icon {
    flex-shrink: 0;
    width: 1.1rem;
    height: 1.1rem;
    background: var(--dm-yellow);
    border-radius: 50%;
    margin-top: 0.28rem;
}

/* --- CTA band --- */
.cta-band {
    border-radius: var(--dm-radius);
    color: #fff;
    background: var(--dm-blue);
    box-shadow: var(--dm-shadow-lg);
    text-align: center;
    padding: 3.5rem 2rem;
}

.cta-band h2 {
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* --- Section contact (fond bleu) --- */
.contact-form-section {
    background: var(--dm-blue);
}

.contact-form-section .card {
    border-radius: var(--dm-radius);
}

/* --- Cards génériques --- */
.feature-card,
.service-card,
.post-card,
.widget {
    border-radius: var(--dm-radius);
}

.feature-card,
.service-card {
    padding: 2rem;
    background: var(--dm-white);
    border: 1px solid var(--dm-border);
    box-shadow: var(--dm-shadow);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.feature-card:hover,
.service-card:hover,
.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--dm-shadow-lg);
    border-color: rgba(38, 46, 126, 0.28);
}

.feature-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.6rem;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, var(--dm-yellow), var(--dm-blue));
}

.service-number {
    display: inline-flex;
    margin-bottom: 1rem;
    font-size: .82rem;
    font-weight: 800;
    color: var(--dm-blue);
    letter-spacing: .16em;
}

.post-card .entry-title a {
    color: var(--dm-blue);
    text-decoration: none;
}

.post-card .entry-title a:hover {
    color: var(--dm-blue-dark);
}

.object-fit-cover {
    object-fit: cover;
}

/* --- Prose --- */
.prose {
    font-size: 1.05rem;
}

.prose > * + * {
    margin-top: 1.2rem;
}

.prose h2,
.prose h3,
.prose h4 {
    margin-top: 2.2rem;
    font-weight: 700;
    color: var(--dm-blue);
}

.prose blockquote {
    padding: 1.5rem;
    border-left: .35rem solid var(--dm-yellow);
    background: rgba(38, 46, 126, 0.04);
    border-radius: var(--dm-radius);
    font-size: 1.1rem;
    font-weight: 600;
}

.prose table {
    width: 100%;
    margin-bottom: 1rem;
    vertical-align: top;
    border-color: var(--dm-border);
}

.prose table th,
.prose table td {
    padding: .8rem 1rem;
    border: 1px solid var(--dm-border);
}

/* --- Pagination --- */
.page-link {
    border-radius: var(--dm-radius) !important;
    color: var(--dm-blue);
    border-color: var(--dm-border);
    font-weight: 700;
}

.active > .page-link,
.page-link.active {
    background: var(--dm-blue);
    border-color: var(--dm-blue);
}

/* --- Navigation articles --- */
.post-navigation {
    margin-top: 3rem;
}

.post-navigation .nav-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.post-navigation a {
    display: block;
    padding: 1.25rem;
    border-radius: var(--dm-radius);
    background: var(--dm-white);
    text-decoration: none;
    box-shadow: var(--dm-shadow);
    border: 1px solid var(--dm-border);
}

.nav-subtitle {
    display: block;
    color: var(--dm-muted);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 700;
}

.nav-title {
    color: var(--dm-blue);
    font-weight: 700;
}

/* --- Sidebar --- */
.sidebar-offset {
    top: 6rem;
}

.widget ul,
.footer-widget ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
}

.widget li + li,
.footer-widget li + li {
    margin-top: .5rem;
}

/* --- Footer --- */
.site-footer {
    background: var(--dm-blue);
    color: rgba(255, 255, 255, 0.8);
    border-bottom: 5px solid var(--dm-yellow);
    margin-top: 0 !important;
}

.site-footer h1,
.site-footer h2,
.site-footer h3,
.site-footer h4,
.site-footer h5,
.site-footer h6,
.site-footer strong {
    color: #fff;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: color 0.18s;
}

.site-footer a:hover {
    color: var(--dm-yellow);
}

.footer-title {
    letter-spacing: .1em;
    color: var(--dm-yellow) !important;
    font-weight: 800;
    font-size: 0.78rem;
}

.footer-contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-contact-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.78);
}

.footer-contact-list svg {
    flex-shrink: 0;
    margin-top: 0.2rem;
}

.footer-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-nav-list li {
    margin-bottom: 0.5rem;
}

.footer-nav-list a {
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    transition: color 0.18s;
}

.footer-nav-list a:hover {
    color: var(--dm-yellow);
}

.footer-bottom {
    background: rgba(0, 0, 0, 0.18);
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.footer-bottom span,
.footer-bottom .text-muted {
    color: rgba(255, 255, 255, 0.5) !important;
}

.partner-logo {
    max-height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
    opacity: 0.7;
    transition: opacity 0.2s;
}

.partner-logo:hover {
    opacity: 1;
}

/* --- Formulaires --- */
.form-control,
.form-select {
    border-radius: var(--dm-radius);
    border-color: var(--dm-border);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--dm-blue);
    box-shadow: 0 0 0 .25rem rgba(38, 46, 126, 0.18);
}

/* --- Responsive --- */
@media (max-width: 991.98px) {
    .py-lg-6 {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }

    .hero-section {
        min-height: 400px;
        padding: 4rem 0;
        text-align: center;
    }

    .experience-img {
        height: 260px;
    }

    .post-navigation .nav-links {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
