@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700;900&display=swap');

/* Écrase la variable de Quark 2 qui donne le fond gris (#1D1F25) des cartes */
:root,
html[data-theme='dark'],
html[data-theme='light'],
html.dark,
html.light {
    --q2-divider: #008751 !important;
    --q2-bg-elev: #1A1128 !important;
}

/* ============================================
   GLOBAL
   Sélecteurs renforcés pour battre les variables de
   mode clair/sombre de Quark 2 (data-theme sur <html>)
   ============================================ */
html,
html[data-theme='dark'],
html[data-theme='light'],
html body,
html[data-theme='dark'] body,
html[data-theme='light'] body,
body {
    font-family: 'Montserrat', sans-serif !important;
    background-color: #005885 !important;
    margin: 0;
    padding: 0;
}

#page-wrapper,
main#start,
html[data-theme='dark'] #page-wrapper,
html[data-theme='dark'] main#start {
    background-color: transparent !important;
}

body.header-fixed,
body.header-animated {
    padding-top: 0 !important;
}

/* ============================================
   HEADER
   (V2 : <header id="header"> au lieu de <section id="header">,
    <div class="container"> au lieu de <section class="container grid-lg">)
   ============================================ */
header#header {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
    z-index: 9000;
    overflow: visible !important;

    background-color: #4C9DD6 !important;
    background-image: url('../images/logo.webp') !important;
    background-size: contain !important;
    background-position: center center !important;
    background-repeat: no-repeat !important;
    border-bottom: none !important;
    box-shadow: none !important;

    height: 25vw !important;
    min-height: 250px !important;
    max-height: 475px !important;
    padding: 0 !important;
}

header#header .container,
header#header nav.navbar,
header#header .navbar-section,
header#header .navbar-section.logo {
    overflow: visible !important;
}

header#header .container {
    height: 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
}

header#header nav.navbar {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-end !important;
    height: 100% !important;
    padding: 0 20px 0 !important;
    position: relative !important;
}

/* Barre d'actions V2 (theme toggle / login) : pas prévue dans le design d'origine,
   on la masque pour garder l'agencement centré du header.
   Retire ce bloc si tu veux la réafficher. */
header#header .navbar-section.actions {
    display: none !important;
}

/* ============================================
   LOGO / HUMART.SYS
   ============================================ */
header#header .navbar-section.logo {
    position: absolute !important;
    left: 50% !important;
    bottom: -35px !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    z-index: 9999;
    flex: none !important;
    width: auto !important;
}

.main-logo {
    display: none !important;
}

.custom-site-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
    display: flex !important;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
}

.custom-site-name .hum { color: #BE2734; }
.custom-site-name .art { color: #EA892E; }
.custom-site-name .sys { color: #008751; }

.navbar-brand-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-decoration: none !important;
}

/* ============================================
   NAVIGATION — desktop
   (V2 : .dropmenu est un <div>, plus un <nav>)
   ============================================ */
header#header .navbar-section.desktop-menu {
    position: absolute !important;
    left: 50% !important;
    bottom: -75px !important;
    transform: translateX(-50%) !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    flex: none !important;
    width: auto !important;
    z-index: 9999;
    gap: 15px;
}

header#header .navbar-section.desktop-menu .dropmenu {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

header#header .navbar-section.desktop-menu li {
    position: relative;
}

header#header .navbar-section.desktop-menu li ul {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 40, 80, 0.96);
    padding: 8px 0;
    border-radius: 6px;
    min-width: 180px;
    display: none;
    z-index: 10000;
    list-style: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

header#header .navbar-section.desktop-menu li:hover > ul,
header#header .navbar-section.desktop-menu li:focus-within > ul {
    display: block;
}

header#header .navbar-section.desktop-menu li ul li {
    display: block;
}

header#header .navbar-section.desktop-menu li ul a {
    display: block !important;
    padding: 6px 20px !important;
    font-size: 0.85rem !important;
    white-space: nowrap !important;
    color: #EA892E !important;
    font-weight: 900 !important;
    text-transform: uppercase !important;
    letter-spacing: 2px !important;
}

header#header .navbar-section.desktop-menu a {
    color: #EA892E !important;
    font-weight: 900;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 8px 20px !important;
    text-decoration: none !important;
    transition: all 0.25s ease;
}

header#header .navbar-section.desktop-menu a:hover {
    color: #ffffff !important;
}

/* ============================================
   BODY / CONTENU
   ============================================ */
/* La classe .section de Quark 2 pose sa propre couleur de fond sur
   chaque section (thème clair/sombre) : on la neutralise partout,
   puis header#header et #footer reprennent la main juste en dessous
   grâce à leur sélecteur par ID, plus spécifique. */
.section,
html[data-theme='dark'] .section {
    background-color: transparent !important;
}

section#body-wrapper,
#body-wrapper,
html[data-theme='dark'] #body-wrapper {
    background-color: transparent !important;
    background-image: none !important;
    margin-top: 0 !important;
    padding-top: 100px !important;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

#body-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 70%;
    height: 100%;
    background-image: url('../images/bg.webp');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: right top;
    z-index: 0;
    pointer-events: none;
    opacity: 1;
}

#body-wrapper > * {
    position: relative;
    z-index: 2;
}

#body-wrapper * {
    color: #ffffff !important;
}

#body-wrapper a,
#body-wrapper a * {
    color: #4dd9c0 !important;
    text-decoration: none !important;
}

#body-wrapper a:hover,
#body-wrapper a:hover * {
    color: #7eebd6 !important;
    text-decoration: underline !important;
}

.content-wrapper,
.blog-content-item,
.content-item {
    background-color: #1A1128 !important;
    padding: 30px;
    border-radius: 12px;
    border: none !important;
    max-width: 60%;
    position: relative;
    z-index: 2;
}

#item {
    background: rgba(255, 255, 255, 0.92);
    padding: 2.5rem;
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

#body-wrapper h1 {
    font-weight: 900 !important;
    font-size: 2.8rem !important;
    text-shadow: 2px 3px 8px rgba(0,0,0,0.4);
    margin-bottom: 0.8rem !important;
}

#body-wrapper h2 {
    font-weight: 700 !important;
    font-size: 1.8rem !important;
    text-shadow: 1px 2px 5px rgba(0,0,0,0.3);
}

/* Titres d'articles/applications (h3) : gris muet par défaut -> rouge de la charte (.hum) */
#body-wrapper h3,
.content-item h3,
.content-wrapper h3,
.blog-content-item h3 {
    color: #BE2734 !important;
    font-weight: 700 !important;
}

/* Séparateurs "—" : gris par défaut du thème -> vert de la charte (.sys) */
#body-wrapper hr,
.content-item hr,
.content-wrapper hr,
.blog-content-item hr {
    border: none !important;
    border-top: 3px solid #008751 !important;
    width: 40px !important;
    margin: 1.5rem 0 !important;
    opacity: 1 !important;
}

#body-wrapper p {
    line-height: 1.7 !important;
    font-size: 1.05rem !important;
}

/* ============================================
   FOOTER
   ============================================ */
#footer,
footer#footer {
    position: relative;
    padding: 0 !important;
    background-color: #51A6DC !important;
    color: #ffffff !important;
    border-top: 3px solid #ff4500;
    overflow: hidden;
    background-image: url('../images/footeur.webp') !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center top !important;
    min-height: 500px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    max-width: 1100px;
    margin: 0 auto;
    gap: 60px;
    padding: 30px 20px;
    background: none;
    width: 100%;
}

.footer-section { flex: 1 1 250px; }

.footer-section h3 {
    color: #ff4500 !important;
    font-size: 1.5rem;
    margin-bottom: 1.2rem;
    text-transform: uppercase;
    font-weight: 900;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
}

.footer-section p {
    line-height: 1.6;
    font-size: 0.95rem;
    color: #ffffff !important;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
}

.footer-bottom {
    text-align: center;
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.15);
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6) !important;
    background: none;
}

.footer-section a {
    color: #EA892E !important;
    text-decoration: none !important;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
}

.footer-section a:hover {
    color: #ff4500 !important;
    text-decoration: underline !important;
}

/* ============================================
   MENU MOBILE (V2 natif : bouton hamburger + overlay)
   On style juste l'overlay avec nos couleurs,
   plus besoin des anciens hacks de visibilité.
   ============================================ */
.mobile-menu .button_container span {
    background-color: #EA892E !important;
}

.mobile-container .overlay {
    background: rgba(0, 40, 80, 0.97) !important;
}

.mobile-container .overlay-menu a {
    color: #EA892E !important;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.mobile-container .overlay-menu a:hover {
    color: #ffffff !important;
}

/* ============================================
   TABLETTE
   ============================================ */
@media (max-width: 1024px) {
    header#header {
        height: 25vw !important;
        min-height: 200px !important;
    }
    .custom-site-name { font-size: 1.6rem; }
    .content-wrapper,
    .blog-content-item,
    .content-item { max-width: 55%; }
}

/* ============================================
   MOBILE ≤ 840px
   Le menu desktop est masqué (V2 bascule sur l'overlay natif).
   ============================================ */
@media (max-width: 840px) {
    header#header .navbar-section.desktop-menu {
        display: none !important;
    }

    header#header {
        background-color: #005885 !important;
        height: 25vw !important;
        min-height: 120px !important;
        overflow: visible !important;
    }

    header#header .navbar-section.logo {
        position: absolute !important;
        left: 50% !important;
        bottom: -35px !important;
        transform: translateX(-50%) !important;
        z-index: 9999 !important;
        width: auto !important;
    }

    .custom-site-name {
        font-size: 1.1rem;
        justify-content: center !important;
    }

    section#body-wrapper,
    #body-wrapper {
        padding-top: 90px !important;
        overflow: hidden !important;
    }

    .content-wrapper,
    .blog-content-item,
    .content-item { max-width: 100%; }

    #body-wrapper h1 { font-size: 1.8rem !important; }

    #footer { min-height: 350px; }
    .footer-content { gap: 30px; padding: 20px 15px; }
}

/* ============================================
   PAGES SPÉCIALES
   ============================================ */
body.palettes_sur_palettes #body-wrapper::before {
    background-image: url('../images/bg-palettes.webp') !important;
    background-size: contain !important;
    background-position: right center !important;
    width: 50% !important;
}