/* ============================================================
   KHOVALIS — CSS Global v2
   Variables, typographie, utilitaires, composants partagés
   ============================================================ */

/* ---------- Variables de design ---------- */
:root {
    --kh-primary:     #C85D2A;
    --kh-primary-dk:  #A04520;
    --kh-secondary:   #1A2B4A;
    --kh-accent:      #F5A623;
    --kh-light:       #FAF7F2;
    --kh-grey:        #F0EDE8;
    --kh-grey-mid:    #9E9790;
    --kh-dark:        #0D1B2A;
    --kh-text:        #2C2C2C;
    --kh-font-title:  'Fraunces', Georgia, serif;
    --kh-font-body:   'DM Sans', sans-serif;
    --kh-radius:      8px;
    --kh-shadow:      0 4px 24px rgba(13,27,42,0.10);
    --kh-shadow-lg:   0 12px 48px rgba(13,27,42,0.18);
    --kh-transition:  all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Reset et base ---------- */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--kh-font-body);
    color: var(--kh-text);
    background: #fff;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
    font-family: var(--kh-font-title);
    color: var(--kh-secondary);
    line-height: 1.15;
    margin-top: 0;
}

a { color: var(--kh-primary); text-decoration: none; transition: var(--kh-transition); }
a:hover { color: var(--kh-primary-dk); }

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

/* ---------- Boutons ---------- */
.kh-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: var(--kh-radius);
    font-family: var(--kh-font-body);
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.3px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--kh-transition);
    text-decoration: none;
}
.kh-btn-primary {
    background: var(--kh-primary);
    color: #fff;
    border-color: var(--kh-primary);
}
.kh-btn-primary:hover {
    background: var(--kh-primary-dk);
    border-color: var(--kh-primary-dk);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(200,93,42,0.35);
}
.kh-btn-outline {
    background: transparent;
    color: var(--kh-secondary);
    border-color: var(--kh-secondary);
}
.kh-btn-outline:hover {
    background: var(--kh-secondary);
    color: #fff;
    transform: translateY(-2px);
}
.kh-btn-white {
    background: #fff;
    color: var(--kh-primary);
    border-color: #fff;
}
.kh-btn-white:hover {
    background: var(--kh-accent);
    border-color: var(--kh-accent);
    color: var(--kh-secondary);
    transform: translateY(-2px);
}
.kh-btn-lg { padding: 17px 40px; font-size: 16px; }

/* ---------- Sections ---------- */
.kh-section { padding: 80px 0; }
.kh-section-alt { background: var(--kh-light); }
.kh-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.kh-section-title {
    font-size: clamp(28px, 4vw, 42px);
    color: var(--kh-secondary);
    margin-bottom: 12px;
}
.kh-section-sub {
    font-size: 17px;
    color: var(--kh-grey-mid);
    margin-bottom: 48px;
    max-width: 560px;
}
.kh-section-header { margin-bottom: 48px; }
.kh-section-header.centered { text-align: center; }
.kh-section-header.centered .kh-section-sub { margin-left: auto; margin-right: auto; }

/* ---------- Tags ---------- */
.kh-tag {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 40px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.kh-tag-primary { background: rgba(200,93,42,0.12); color: var(--kh-primary); }
.kh-tag-accent  { background: rgba(245,166,35,0.15); color: #b87d00; }
.kh-tag-navy    { background: rgba(26,43,74,0.10);   color: var(--kh-secondary); }

/* ---------- Cards ---------- */
.kh-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--kh-shadow);
    overflow: hidden;
    transition: var(--kh-transition);
}
.kh-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--kh-shadow-lg);
}

/* ---------- Grilles ---------- */
.kh-grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 24px; }
.kh-grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.kh-grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }

@media (max-width: 900px) {
    .kh-grid-4 { grid-template-columns: repeat(2,1fr); }
    .kh-grid-3 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 600px) {
    .kh-grid-2, .kh-grid-3, .kh-grid-4 { grid-template-columns: 1fr; }
    .kh-section { padding: 56px 0; }
}

/* ---------- Divider ---------- */
.kh-divider {
    width: 56px;
    height: 4px;
    background: var(--kh-primary);
    border-radius: 2px;
    margin-bottom: 24px;
}
.kh-divider.centered { margin-left: auto; margin-right: auto; }

/* ---------- Badge ---------- */
.kh-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.kh-badge-success { background: #e6f7ee; color: #1a7a42; }

/* ---------- Animations fade-up ---------- */
.kh-fade-up {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}
.kh-fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- Header scrollé : backdrop blur via classe JS ---------- */
.kh-header-scrolled {
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    background: rgba(13, 27, 42, 0.85) !important;
    box-shadow: 0 2px 20px rgba(0,0,0,0.25) !important;
}

/* ---------- Override Astra pages full-width ---------- */
.khovalis-page .site-content   { padding-top: 0 !important; }
.khovalis-page .entry-content  { max-width: 100% !important; }
.khovalis-page .ast-container  { max-width: 100% !important; padding: 0 !important; }

/* ================================================================
   OVERRIDE ASTRA — neutralisation forcée du layout sidebar/content
   Ces règles écrasent tout wrapper Astra qui limiterait la largeur
   ================================================================ */

/* Zone principale de contenu */
.khovalis-page #primary,
.khovalis-page #content,
.khovalis-page .content-area,
.khovalis-page .ast-row,
.khovalis-page .ast-content-layout-flag,
.khovalis-page .ast-article-post,
.khovalis-page .entry-content,
.khovalis-page .site-content,
.khovalis-page .ast-container,
.khovalis-page #page,
.khovalis-page .ast-page-builder-template {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
    flex: none !important;
}

/* Supprime la sidebar et son espace */
.khovalis-page #secondary,
.khovalis-page .widget-area,
.khovalis-page .ast-sidebar-wrap,
.khovalis-page aside {
    display: none !important;
}

/* Supprime les paddings/margins parasites d'Astra sur le body */
.khovalis-page.ast-no-sidebar .ast-article-post,
.khovalis-page.ast-no-sidebar #primary {
    padding: 0 !important;
    margin: 0 !important;
}

/* S'assure que le hero prend toute la largeur viewport */
.kh-hero,
.kh-stats,
.kh-ticker-wrap,
.kh-cta-vendor {
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    width: 100vw !important;
    max-width: 100vw !important;
    position: relative !important;
}
