/**
 * 880lifev2 - Template CSS principal
 * Design fidèle au site 880life.com
 * Mobile-first, Bootstrap 5
 *
 * Palette de couleurs :
 * - Brun foncé (footer) : #4b2f20
 * - Brun moyen : #6b4226
 * - Or/doré : #c9a96e
 * - Blanc : #ffffff
 * - Gris clair : #f8f5f0
 * - Texte : #333333
 */

/* ============================================
   VARIABLES CSS
   ============================================ */
:root {
    --color-primary: #4b2f20;
    --color-primary-light: #6b4226;
    --color-accent: #c9a96e;
    --color-green: #8bc63e;
    --color-white: #ffffff;
    --color-bg-light: #f8f5f0;
    --color-bg-cream: #faf8f5;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-text-white: #ffffff;
    --color-border: #e0d5c8;

    --font-heading: 'Times New Roman', 'Georgia', 'Palatino Linotype', serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    --header-height: 90px;
    --header-top-offset: 60px;
    --container-max-width: 1320px;
    --transition-speed: 0.3s;
}

/* ============================================
   RESET ET BASE
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-white);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--color-primary);
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

a:hover {
    color: var(--color-accent);
}

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

/* ============================================
   TOPBAR (drapeaux de langues)
   ============================================ */
.topbar {
    background-color: transparent;
    color: var(--color-text);
    font-size: 0.85rem;
    padding: 2px 0;
    text-align: center;
    border-bottom: none;
}

.topbar a {
    color: var(--color-text);
}

.topbar a:hover {
    color: var(--color-green);
}

/* Language switcher module inline */
.topbar .mod-languages ul {
    display: flex;
    gap: 4px;
    list-style: none;
    margin: 4px 0;
    padding: 0;
    justify-content: center;
}

.topbar .mod-languages li {
    display: inline-block;
}

.topbar .mod-languages img {
    width: 20px;
    height: auto;
}

/* ============================================
   EN-TETE / HEADER
   ============================================ */
.site-header {
    position: fixed;
    top: var(--header-top-offset);
    left: 0;
    right: 0;
    z-index: 1030;
    background-color: rgba(255, 255, 255, 0.92);
    box-shadow: none;
    border-bottom: none;
}

.site-header.scrolled {
    border-bottom: 2px solid var(--color-green);
}

.site-header.scrolled .navbar {
    min-height: 62px;
}

.site-header.scrolled .mod-menu .nav-item > a,
.site-header.scrolled .nav-link,
.site-header.scrolled .navbar-nav a {
    min-height: 62px;
    line-height: 62px;
}

.site-header.scrolled .site-logo {
    max-height: 45px;
}

/* Pages without banner need content push-down */
body.no-banner .site-content {
    padding-top: calc(var(--header-height) + var(--header-top-offset) + 20px);
}

.header-main {
    padding: 0;
}

.header-main .navbar {
    padding: 0;
    min-height: var(--header-height);
    transition: min-height 0.3s ease;
}

/* Logo */
.navbar-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    margin-right: 0;
}

.navbar-brand a {
    text-decoration: none;
}

.site-logo {
    max-height: 55px;
    width: auto;
}

.site-title {
    font-family: var(--font-body);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-green);
    letter-spacing: 0.5px;
    line-height: 1.1;
}

.site-description {
    font-size: 0;
    color: transparent;
    visibility: hidden;
    height: 0;
    margin: 0;
}

/* Navigation */
.navbar-toggler {
    border-color: var(--color-green);
    padding: 0.4rem 0.6rem;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%238bc63e' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-collapse {
    justify-content: flex-end;
}

/* Nav wrapper: menu + flags stacked */
.nav-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Styles du menu principal */
.site-header .mod-menu,
.site-header .nav,
.site-header .navbar-nav {
    display: flex;
    flex-wrap: nowrap;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
    align-items: stretch;
    height: 100%;
}

.site-header .nav-item {
    position: relative;
    display: flex;
    align-items: stretch;
}

.site-header .nav-link,
.site-header .navbar-nav a,
.site-header .mod-menu .nav-item > a {
    display: flex;
    align-items: center;
    padding: 0 28px;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: none;
    letter-spacing: 0;
    transition: color var(--transition-speed) ease, background-color var(--transition-speed) ease;
    text-decoration: none;
    white-space: nowrap;
    height: 100%;
    min-height: var(--header-height);
    line-height: var(--header-height);
    border-right: 2px solid var(--color-green);
}

.site-header .nav-link:hover,
.site-header .nav-link:focus,
.site-header .navbar-nav a:hover,
.site-header .mod-menu .nav-item > a:hover {
    color: var(--color-text-white);
    background-color: var(--color-green);
}

/* Reset: ensure all nav items are transparent by default */
.site-header .mod-menu .nav-item > a {
    background-color: transparent;
    color: var(--color-primary);
}

/* Last menu item has no right border */
.site-header .nav-item:last-child > a,
.site-header .mod-menu .nav-item:last-child > a {
    border-right: none;
}

.site-header .nav-link.active,
.site-header .active > .nav-link,
.site-header .current > a,
.site-header .mod-menu .active > a,
.site-header .mod-menu .current > a {
    color: var(--color-text-white) !important;
    background-color: var(--color-green) !important;
    font-weight: 600;
    border-bottom: none;
}


/* Sous-menus dropdown */
.site-header .dropdown-menu {
    border: none;
    border-radius: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    min-width: 220px;
}

.site-header .dropdown-item {
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
    color: var(--color-text);
}

.site-header .dropdown-item:hover {
    background-color: var(--color-bg-light);
    color: var(--color-primary);
}

/* ============================================
   HERO / BANNIERE
   ============================================ */
.site-hero {
    position: relative;
    overflow: hidden;
    background-color: #2c2c2c;
    line-height: 0;
}

.site-hero img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.site-banner {
    padding: 2rem 0;
    background-color: var(--color-bg-light);
}

/* ============================================
   CONTENU PRINCIPAL
   ============================================ */
.site-content {
    padding: 2rem 0;
    min-height: 400px;
}

.site-content main {
    padding: 0 0.75rem;
}

/* Styles pour les articles Joomla */
.site-content .item-page,
.site-content .blog {
    max-width: 100%;
}

.site-content .item-page h2 {
    color: var(--color-primary);
    margin-top: 1.5rem;
}

/* Hide Joomla page-header when article has its own headings */
.site-content .page-header {
    display: none;
}

/* Hide Joomla auto-rendered fulltext image (we display it as full-width banner in template) */
.site-content .item-image {
    display: none;
}

/* Bouton CTA dans les articles */
.btn-cta {
    display: inline-block;
    background-color: var(--color-primary);
    color: var(--color-text-white);
    padding: 0.75rem 2rem;
    font-size: 0.95rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    border: none;
    transition: background-color var(--transition-speed) ease, transform 0.2s ease;
}

.btn-cta:hover {
    background-color: var(--color-primary-light);
    color: var(--color-text-white);
    transform: translateY(-2px);
}

/* Grille 4 colonnes pour les sections de service */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding: 2rem 0;
}

.service-card {
    text-align: center;
    padding: 1.5rem;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.service-card h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-top: 1rem;
}

.service-card img {
    border-radius: 0;
    max-width: 100%;
}

/* Content top/bottom */
.content-top,
.content-bottom {
    border-bottom: 1px solid var(--color-border);
}

/* Sidebars */
.sidebar {
    padding-top: 1rem;
}

.sidebar .card {
    border: none;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
}

.sidebar .card-header {
    background-color: var(--color-primary);
    color: var(--color-text-white);
    font-family: var(--font-heading);
    border-radius: 0;
    padding: 0.75rem 1rem;
}

/* ============================================
   SECTION CTA (Appel à l'action)
   ============================================ */
.site-cta {
    background-color: var(--color-bg-cream);
    padding: 3rem 0;
    text-align: center;
}

.site-cta h2 {
    font-family: var(--font-heading);
    color: var(--color-primary);
}

.site-cta .btn-primary,
.site-cta button[type="submit"] {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-text-white);
    padding: 0.75rem 2rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 0;
    transition: background-color var(--transition-speed) ease;
}

.site-cta .btn-primary:hover,
.site-cta button[type="submit"]:hover {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary-light);
}

/* ============================================
   PIED DE PAGE / FOOTER
   ============================================ */
.site-footer {
    background-color: var(--color-primary);
    color: var(--color-text-white);
    padding: 2.5rem 0 0;
}

.footer-main {
    padding-bottom: 1.5rem;
}

.footer-col {
    margin-bottom: 1.5rem;
}

.site-footer h3,
.site-footer h4 {
    color: var(--color-accent);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.site-footer a {
    color: rgba(255, 255, 255, 0.8);
    transition: color var(--transition-speed) ease;
}

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

.site-footer p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* Liens sociaux */
.footer-social {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    align-items: center;
    margin-top: 1rem;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: var(--color-text-white);
    transition: all var(--transition-speed) ease;
}

.footer-link:hover {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-primary);
}

/* Barre inférieure */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding: 1rem 0;
    font-size: 0.85rem;
}

.footer-bottom p {
    margin: 0;
    color: rgba(255, 255, 255, 0.6);
}

/* ============================================
   BOUTON RETOUR EN HAUT
   ============================================ */
.back-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background-color: var(--color-primary);
    color: var(--color-text-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-speed) ease;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.back-top:hover {
    background-color: var(--color-accent);
    color: var(--color-primary);
}

.back-top.visible {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   FORMULAIRES
   ============================================ */
.form-control {
    border-radius: 0;
    border-color: var(--color-border);
    padding: 0.75rem 1rem;
}

.form-control:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 0.2rem rgba(201, 169, 110, 0.25);
}

.btn-primary {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    border-radius: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.btn-primary:hover {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary-light);
}

/* ============================================
   UTILITAIRES SPECIFIQUES 880LIFE
   ============================================ */

/* Texte accent doré */
.text-accent {
    color: var(--color-accent) !important;
}

/* Fond crème */
.bg-cream {
    background-color: var(--color-bg-cream) !important;
}

/* Fond brun */
.bg-brown {
    background-color: var(--color-primary) !important;
    color: var(--color-text-white) !important;
}

/* Section avec fond clair */
.section-light {
    background-color: var(--color-bg-light);
    padding: 3rem 0;
}

/* Citation/Slogan */
.tagline {
    font-family: var(--font-heading);
    font-style: italic;
    font-size: 1.4rem;
    color: var(--color-primary);
    text-align: center;
    padding: 2rem;
    line-height: 1.6;
}

/* Séparateur décoratif */
.separator-accent {
    width: 60px;
    height: 3px;
    background-color: var(--color-accent);
    margin: 1.5rem auto;
    border: none;
}

/* Piliers IP, EP, TA, AP */
.pillar-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    max-width: 500px;
    margin: 2rem auto;
}

.pillar-item {
    text-align: center;
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    transition: all var(--transition-speed) ease;
}

.pillar-item:hover {
    border-color: var(--color-accent);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.pillar-item strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}

/* Logos accréditations */
.accreditations {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.accreditations img {
    max-height: 60px;
    width: auto;
    filter: grayscale(30%);
    transition: filter var(--transition-speed) ease;
}

.accreditations img:hover {
    filter: grayscale(0%);
}

/* ============================================
   RESPONSIVE - TABLETTE
   ============================================ */
@media (max-width: 991.98px) {
    :root {
        --header-height: 65px;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.6rem; }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-social {
        justify-content: center;
    }

    .navbar-collapse {
        background-color: rgba(255, 255, 255, 0.95);
        padding: 0;
        border-top: 2px solid var(--color-green);
        margin-top: 0;
    }

    .site-header .mod-menu,
    .site-header .navbar-collapse .nav {
        flex-direction: column;
        align-items: stretch;
        flex-wrap: wrap;
    }

    .site-header .nav-link,
    .site-header .navbar-nav a,
    .site-header .mod-menu .nav-item > a {
        padding: 0.75rem 1rem;
        min-height: auto;
        line-height: 1.5;
        border-right: none;
        border-bottom: 1px solid var(--color-green);
    }

    .site-header .mod-menu .nav-item:last-child > a {
        border-bottom: none;
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 767.98px) {
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.3rem; }

    .site-content {
        padding: 1.5rem 0;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .pillar-grid {
        grid-template-columns: 1fr;
    }

    .site-cta {
        padding: 2rem 0;
    }

    .footer-col {
        text-align: center;
    }

    .footer-social {
        justify-content: center;
    }

    .site-footer .text-lg-end {
        text-align: center;
    }

    .tagline {
        font-size: 1.1rem;
        padding: 1rem;
    }

    .back-top {
        bottom: 15px;
        right: 15px;
        width: 38px;
        height: 38px;
    }
}

/* ============================================
   RESPONSIVE - PETIT MOBILE
   ============================================ */
@media (max-width: 575.98px) {
    body {
        font-size: 15px;
    }

    .site-logo {
        max-height: 45px;
    }

    .site-title {
        font-size: 1.4rem;
    }

    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* ============================================
   ANIMATIONS - Scroll Reveal
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes accentLine {
    from { width: 0; }
    to { width: 60px; }
}

/* Éléments animés au scroll - état initial */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.reveal-left {
    transform: translateX(-40px);
}

.reveal.reveal-right {
    transform: translateX(40px);
}

.reveal.reveal-scale {
    transform: scale(0.9);
}

/* État visible */
.reveal.visible {
    opacity: 1;
    transform: translateY(0) translateX(0) scale(1);
}

/* Délais échelonnés pour les grilles */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Smooth header top transition */
.site-header {
    animation: fadeIn 0.6s ease-out;
    transition: top 0.05s linear;
}

/* Hero banner animation */
.site-hero img {
    animation: scaleIn 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Service cards hover amélioré */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background-color: var(--color-accent);
    transition: width 0.4s ease, left 0.4s ease;
}

.service-card:hover::after {
    width: 100%;
    left: 0;
}

/* Pillar items animation hover */
.pillar-item {
    position: relative;
    overflow: hidden;
}

.pillar-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(201, 169, 110, 0.08), transparent);
    transition: left 0.6s ease;
}

.pillar-item:hover::before {
    left: 100%;
}

/* Footer links hover animation */
.footer-link svg {
    transition: transform 0.3s ease;
}

.footer-link:hover svg {
    transform: scale(1.15);
}

/* Séparateur animé */
.separator-accent.animated {
    animation: accentLine 0.8s ease-out forwards;
}

/* Bouton CTA pulse subtil */
.btn-cta {
    position: relative;
    overflow: hidden;
}

.btn-cta::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-cta:hover::after {
    width: 300px;
    height: 300px;
}

/* Image hover zoom subtil */
.img-hover-zoom {
    overflow: hidden;
}

.img-hover-zoom img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.img-hover-zoom:hover img {
    transform: scale(1.05);
}

/* Lien souligné animé */
.link-animated {
    position: relative;
    display: inline-block;
}

.link-animated::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-accent);
    transition: width 0.3s ease;
}

.link-animated:hover::after {
    width: 100%;
}

/* Réduire les animations si l'utilisateur le préfère */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   IMPRESSION
   ============================================ */
@media print {
    .site-header,
    .site-footer,
    .back-top,
    .site-cta,
    .sidebar {
        display: none !important;
    }

    .site-content {
        padding: 0;
    }

    body {
        font-size: 12pt;
        color: #000;
    }

    a {
        color: #000;
        text-decoration: underline;
    }
}
