/*
Theme Name: QadraTech
Theme URI: https://qadratech.com
Author: Kadev 
Description: Version V31.7 - Radius 15px & Soft UI.
Version: 31.7
Text Domain: qadratech
*/
/* =========================================
   4. AJOUTS V31.3 : PARTAGE & SÉPARATION
   ========================================= */
.qadra-share-bar {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 15px;
}
.share-label { font-weight: 800; font-size: 0.85rem; text-transform: uppercase; color: var(--text-muted); }
.share-icons { display: flex; gap: 10px; }
.share-link {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-input); color: var(--text-main);
    transition: all 0.3s ease;
}
.share-link svg { width: 18px; height: 18px; fill: currentColor; }
.share-link:hover { background: var(--color-accent); color: #fff; transform: translateY(-3px); }

.comments-separator {
    margin: 60px 0 40px;
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
}
.comments-separator::before, .comments-separator::after {
    content: "";
    flex: 1;
    border-bottom: 2px solid var(--border-color);
}
.comments-separator:not(:empty)::before { margin-right: 1.5em; }
.comments-separator:not(:empty)::after { margin-left: 1.5em; }
.comments-separator span { font-weight: 800; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 1px; }

/* =========================================
   1. VARIABLES & RESET
   ========================================= */
* { box-sizing: border-box; }

:root {
    --font-body: 'Open Sans', sans-serif;
    --font-heading: 'Montserrat', sans-serif;
    --bg-body: #F5F7FA;
    --bg-card: #FFFFFF;
    --bg-card-rgb: 255,255,255; /* nouvelle variable RGB pour rgba() correct */
    --bg-input: #f1f5f9;
    --text-main: #1A1A1A;
    --text-muted: #64748b;
    --color-accent: #0088FF;
    --border-color: #E2E8F0;
    --header-height: 80px;
    --radius: 13px;
    --gradient-brand: linear-gradient(90deg, #FF0055 0%, #00FF99 50%, #0088FF 100%);
    --gradient-neon: linear-gradient(90deg, #FF0055, #00FF99, #0088FF);
    --shadow-soft: 0 4px 20px rgba(0,0,0,0.05);
}

[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-card-rgb: 30,41,59; /* RGB pour le dark */
    --bg-input: #0b1120;
    --text-main: #ffffff;
    --text-muted: #cbd5e1;
    --border-color: #334155;
    --color-accent: #38bdf8;
    --shadow-soft: 0 4px 20px rgba(0,0,0,0.2);
}

body {
    background-color: var(--bg-body); color: var(--text-main); font-family: var(--font-body);
    margin: 0; font-size: 17px; line-height: 1.6; overflow-x: hidden; text-rendering: optimizeLegibility; font-weight: 500;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: 800; margin-top: 0; line-height: 1.3; }
a { text-decoration: none; color: inherit; transition: 0.3s; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; padding: 0; margin: 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; position: relative; }

/* =========================================
   2. HEADER & MENU (MODIFIÉ POUR OFF-CANVAS)
   ========================================= */
.site-header {
    position: sticky; top: 0; z-index: 9999;
    /* utilisation valide de rgba via la variable --bg-card-rgb */
    background: rgba(var(--bg-card-rgb), 0.95);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    height: var(--header-height); display: flex; align-items: center;
}
.header-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; width: 100%; }
.menu-toggle { background: transparent; border: 1px solid var(--border-color); width: 40px; height: 40px; border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-main); font-size: 1.5rem; justify-self: start; }
.site-logo { justify-self: center; text-align: center; }
.site-logo a { font-size: 24px; font-weight: 900; font-family: var(--font-heading); letter-spacing: -1px; white-space: nowrap; background: var(--gradient-brand); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; color: transparent; }
.header-actions { justify-self: end; display: flex; gap: 10px; align-items: center; }
.icon-btn { background: transparent; border: 1px solid var(--border-color); width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-main); transition: 0.3s; }
.icon-btn:hover { background: var(--bg-input); color: var(--color-accent); border-color: var(--color-accent); }

/* Off-canvas navigation: hidden off-screen by default */
.main-navigation {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 320px;
    max-width: 90%;
    background: var(--bg-card);
    padding: 20px;
    /* ombre adoucie pour moins de coût de rendu */
    box-shadow: 0 8px 24px rgba(2,6,23,0.18);
    transform: translate3d(-110%,0,0);
    transition: transform 0.32s cubic-bezier(.2,.9,.2,1);
    z-index: 10001;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.main-navigation.toggled {
    transform: translate3d(0,0,0);
}

/* Overlay behind the menu */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 25, 0.45);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
}
.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Menu list styles */
.main-navigation ul { display: flex; flex-direction: column; gap: 6px; }
.main-navigation li { position: relative; }
.main-navigation a { font-weight: 700; font-size: 0.95rem; text-transform: none; display: block; padding: 10px 10px; border-radius: 8px; color: var(--text-main); }
.main-navigation a:hover { background: var(--bg-input); color: var(--color-accent); }

/* Submenu (accordion) styles */
.main-navigation .sub-menu {
    display: none;
    padding-left: 8px;
    margin-top: 4px;
}
.main-navigation .submenu-open > .sub-menu {
    display: block;
}
.menu-item-has-children > .submenu-toggle {
    background: transparent;
    border: none;
    font-size: 0.95rem;
    padding: 10px;
    cursor: pointer;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.menu-item-has-children > .submenu-toggle .arrow {
    transition: transform 0.25s ease;
}
.menu-item-has-children.submenu-open > .submenu-toggle .arrow {
    transform: rotate(90deg);
}

/* Ensure header stays above overlay when open */
.site-header { position: sticky; z-index: 10002; }

/* Responsive adjustments */
@media (max-width: 900px) {
    .main-navigation { width: 80vw; }
    .main-navigation a { font-size: 0.95rem; }
    /* désactiver le blur sur petits écrans pour améliorer la perf */
    .site-header, .search-overlay {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

/* Search overlay */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    z-index: 10003;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    /* on garde le blur pour écrans larges, mais désactivé sur small via media query ci-dessus */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}
.search-overlay.active {
    opacity: 1;
    visibility: visible;
}
.search-container {
    width: 100%;
    max-width: 900px;
    padding: 20px;
    margin: 0 auto;
    padding-top: calc(var(--header-height) + 16px);
    box-sizing: border-box;
    text-align: left;
}
/* règle plus spécifique sans !important */
.search-overlay .search-input-overlay {
    width: calc(100% - 40px);
    max-width: 820px;
    background: #ffffff;
    color: #111;
    border: 2px solid rgba(0,0,0,0.08);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 1.05rem;
    outline: none;
    box-sizing: border-box;
}
.search-overlay .search-close-btn { position: absolute; top: calc(var(--header-height) - 34px); left: 12px; z-index: 10010; }

/* ===== existing styles kept below (unchanged) ===== */

/* =========================================
   3. HERO & STORIES
   ========================================= */
.hero-wrapper { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; height: 450px; margin: 30px 0; }
.hero-card { position: relative; border-radius: var(--radius); overflow: hidden; background-size: cover; background-position: center; width: 100%; }
.hero-card.large { height: 100%; } .hero-card.small { flex: 1; height: 100%; }
.hero-right { display: flex; flex-direction: column; gap: 20px; height: 100%; width: 100%; }
.hero-overlay { position: absolute; bottom: 0; left: 0; width: 100%; background: linear-gradient(to top, rgba(0,0,0,0.95) 10%, transparent); padding: 20px; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.hero-overlay h1, .hero-overlay h2, .hero-overlay h3 { color: #FFFFFF !important; margin: 0; text-shadow: 0 2px 5px rgba(0,0,0,0.9); font-weight: 800 !important; }
.hero-overlay h1, .hero-overlay h2 { font-size: 1.8rem; line-height: 1.2; } 
.hero-cat { background: var(--gradient-brand); color: white; padding: 4px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; align-self: flex-start; margin-bottom: 5px; text-shadow: none; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.stories-container { margin: 0 -20px 30px -20px; width: 100vw; position: relative; left: 50%; right: 50%; margin-left: -50vw; margin-right: -50vw; padding: 0 20px; }
.stories-scroll { display: flex; gap: 12px; overflow-x: auto; padding: 5px 0; scrollbar-width: none; -ms-overflow-style: none; }
.stories-scroll::-webkit-scrollbar { display: none; }
.story-item { display: inline-flex; align-items: center; justify-content: center; padding: 2px; border-radius: 50px; background: var(--gradient-brand); transition: transform 0.2s; text-decoration: none; flex-shrink: 0; }
.story-name { display: block; background: var(--bg-card); color: var(--text-main); padding: 6px 16px; border-radius: 48px; font-weight: 700; font-size: 0.8rem; text-transform: uppercase; white-space: nowrap; }

/* =========================================
   4. MODULES BAS DE PAGE
   ========================================= */
.bottom-modules-wrapper { padding: 60px 0; margin-top: 80px; background: var(--bg-body); }
.modules-grid-layout { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.neon-title { font-size: 1.4rem; font-weight: 800; text-transform: uppercase; margin-bottom: 25px; padding-bottom: 10px; position: relative; border-bottom: 4px solid transparent; border-image: var(--gradient-brand); border-image-slice: 1; width: 100%; }
.mini-grid { display: flex; flex-direction: column; gap: 15px; }
.mini-card { display: flex; height: 70px; background: var(--bg-card); border-radius: 8px; overflow: hidden; text-decoration: none; transition: transform 0.2s, box-shadow 0.2s; border: 1px solid var(--border-color); }
.mini-card:hover { transform: translateX(5px); box-shadow: 0 4px 10px rgba(0,0,0,0.05); border-color: var(--color-accent); }
.mini-thumb { flex: 0 0 33%; height: 100%; position: relative; }
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mini-content { flex: 1; padding: 8px 12px; display: flex; align-items: center; }
.mini-content h4 { font-size: 0.85rem; line-height: 1.3; margin: 0; font-weight: 700; color: var(--text-main); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* =========================================
   5. CONTENU & WIDGETS
   ========================================= */
.page-layout { display: flex; gap: 40px; margin-bottom: 60px; }
.main-content { flex: 2; min-width: 0; }
.sidebar { flex: 1; min-width: 300px; }
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 30px; }
.article-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform 0.3s; }
.article-thumb { height: 180px; overflow: hidden; }
.article-thumb img { width: 100%; height: 100%; object-fit: cover; }
.article-content { padding: 20px; }
.cat-badge { color: var(--color-accent); font-weight: 800; font-size: 0.8rem; text-transform: uppercase; display: block; margin-bottom: 5px; }
.article-content h3 { font-size: 1.1rem; margin: 0; font-weight: 800; }
.entry-content { padding: 0 10px; font-size: 1.1rem; line-height: 1.8; color: var(--text-muted); }
.entry-content a { color: var(--color-accent); font-weight: 700; text-decoration: underline; transition: 0.2s; }
.entry-content a:hover { color: var(--text-main); text-decoration: none; }

.widget { margin-bottom: 40px; }
.widget-title { font-size: 1.2rem; border-left: 4px solid var(--color-accent); padding-left: 15px; margin-bottom: 25px; font-weight: 800; }
.qadra-recent-item { display: flex; align-items: center; gap: 15px; background: var(--bg-card); padding: 12px; border-radius: 12px; position: relative; border: 2px solid transparent; background-clip: padding-box; margin-bottom: 15px; box-shadow: var(--shadow-soft); }
.qadra-recent-item::before { content: ""; position: absolute; inset: 0; z-index: -1; margin: -2px; border-radius: 14px; background: var(--gradient-brand); }
.qadra-recent-title { color: var(--text-main); font-weight: 700; font-size: 0.9rem; line-height: 1.3; margin-bottom: 4px; display: block; }
.qadra-recent-title:hover { color: var(--color-accent); }
.qadra-recent-thumb { flex-shrink: 0; width: 65px; height: 65px; border-radius: 10px; overflow: hidden; }

/* =========================================
   6. FOOTER
   ========================================= */
.site-footer { background-color: #0f172a; color: #e2e8f0; padding-top: 80px; padding-bottom: 40px; margin-top: 0; border-top: 1px solid rgba(255,255,255,0.05); }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; margin-bottom: 60px; }
.footer-logo { font-size: 2rem; font-weight: 900; font-family: var(--font-heading); margin-bottom: 15px; background: var(--gradient-brand); -webkit-background-clip: text; color: transparent; display: inline-block; }
.footer-social { display: flex; gap: 10px; margin-top: 15px; }
.footer-social span { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; background: rgba(255,255,255,0.1); border-radius: 50%; font-size: 0.9rem; cursor: pointer; transition: all 0.3s ease; color: white; border: 1px solid rgba(255,255,255,0.05); font-weight: 700; }
.footer-social span:hover { background: var(--color-accent); transform: translateY(-3px); border-color: var(--color-accent); }

#back-to-top { position: fixed; bottom: 30px; right: 30px; width: 50px; height: 50px; background: var(--gradient-brand); color: #fff; border: none; border-radius: 50%; font-size: 24px; cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.3); z-index: 99999; opacity: 0; visibility: hidden; transition: all 0.3s ease; display: flex; align-items: center; justify-content: center; font-weight: 700; }
#back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }

/* =========================================
   7. FORMULAIRES
   ========================================= */
input[type="text"]:not(.search-input-overlay), input[type="email"], input[type="url"], input[type="password"], textarea, select {
    width: 100%; background-color: var(--bg-input); border: 2px solid transparent; border-radius: 12px; padding: 15px; font-size: 1rem; color: var(--text-main); outline: none; font-family: var(--font-body); box-shadow: none; transition: 0.3s ease; margin-bottom: 15px; -webkit-appearance: none; font-weight: 600;
}
input:not(.search-input-overlay):focus, textarea:focus, select:focus { background-color: var(--bg-card); border-color: var(--color-accent); box-shadow: 0 4px 12px rgba(0,136,255,0.1); }
button[type="submit"], input[type="submit"], .btn-qadra { background: var(--gradient-brand); color: white; border: none; padding: 12px 35px; border-radius: 50px; font-weight: 800; cursor: pointer; text-transform: uppercase; letter-spacing: 1px; text-shadow: none; }

/* =========================================
   8. STYLE PAGE CONTACT
   ========================================= */
.contact-box { background: var(--bg-card); padding: 40px; border-radius: var(--radius); border: 1px solid var(--border-color); box-shadow: var(--shadow-soft); width: 100%; }
.contact-title { font-size: 2.2rem; margin-bottom: 10px; text-align: center; background: var(--gradient-brand); -webkit-background-clip: text; color: transparent; font-weight: 900; }
.contact-intro { text-align: center; margin-bottom: 40px; color: var(--text-muted); font-size: 1.1rem; font-weight: 500; }
.contact-grid-wrapper { display: grid; grid-template-columns: 1fr 2fr; gap: 50px; }
.contact-info-side { background: var(--bg-input); padding: 30px; border-radius: 12px; height: fit-content; }
.contact-info-side ul { margin: 20px 0; padding: 0; list-style: none; }
.contact-info-side li { margin-bottom: 15px; color: var(--text-muted); font-weight: 500; }
.form-row { display: flex; gap: 20px; }
.form-group.half { flex: 1; }

/* =========================================
   9. FIX IMAGES
   ========================================= */
.entry-content img, 
.entry-content figure img, 
.wp-block-image img,  
.entry-content iframe, .entry-content video {
    border-radius: var(--radius); box-shadow: var(--shadow-soft); margin-bottom: 20px;
}
.single-featured-image img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}
.single-featured-image,
.entry-content {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
}

@media (max-width: 900px) {
    .header-inner { grid-template-columns: 1fr auto 1fr; }
    .hero-wrapper { display: flex !important; flex-direction: column !important; height: auto !important; gap: 15px; margin-bottom: 30px; }
    .hero-left { width: 100%; height: 250px; } .hero-left .hero-card { height: 100%; }
    .hero-right { width: 100%; height: 220px !important; display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 10px; }
    .hero-right .hero-card { height: 100% !important; flex: 1; }
    .hero-right .hero-overlay h3 { font-size: 0.85rem !important; line-height: 1.3; } .hero-right .hero-overlay { padding: 12px; }

    .page-layout { flex-direction: column; }
    .modules-grid-layout { grid-template-columns: 1fr; gap: 30px; }
    .footer-grid { grid-template-columns: 1fr; gap: 40px; text-align: center; }
    .footer-social { justify-content: center; }
    
    .contact-grid-wrapper { grid-template-columns: 1fr !important; }
    .form-row { flex-direction: column; gap: 20px; }
    .single-featured-image,
    .entry-content {
        max-width: 100%;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* --- Style Global pour tous vos tableaux (Identifiant Qadra-tab) --- */
.Qadra-tab {
    width: 100%;
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    -webkit-overflow-scrolling: touch;
}
.Qadra-tab table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    background-color: #ffffff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.95rem;
}
.Qadra-tab thead tr { background-color: #0056b3; color: #ffffff; text-align: left; font-weight: bold; }
.Qadra-tab th, Qadra-tab td { padding: 12px 15px; border-bottom: 1px solid #eeeeee; }
.Qadra-tab tbody tr:nth-of-type(even) { background-color: #f8f9fa; }
.Qadra-tab tbody tr:hover { background-color: #f1f4f9; transition: background-color 0.2s ease; }
.Qadra-tab table { border-radius: 8px 8px 0 0; overflow: hidden; }

/* Boutons */
.qadra-container { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; margin: 30px 0; width: 100%; }
.qadra-bt {
    display: inline-flex; align-items: center; justify-content: center; padding: 12px 24px; text-decoration: none; border-radius: 12px; font-weight: 600; font-family: inherit; transition: all 0.3s ease;
    border: 2px solid transparent;
    background-image: linear-gradient(white, white), linear-gradient(to right, #ffeb3b, #f44336, #2196f3);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    color: #333;
}
.qadra-bt img { width: 22px; height: 22px; margin-right: 12px; }
.qadra-bt:hover { transform: translateY(-3px); box-shadow: 0 6px 15px rgba(0,0,0,0.1); }

/* MODE SOMBRE - compatibilité */
@media (prefers-color-scheme: dark) {
    .qadra-bt { background-image: linear-gradient(#1a1a1a, #1a1a1a), linear-gradient(to right, #ffeb3b, #f44336, #2196f3); color: #ffffff; }
}
body.dark-mode .qadra-bt, body.night-mode .qadra-bt, body[data-theme="dark"] .qadra-bt, .dark-mode .qadra-bt, .dark .qadra-bt {
    background-image: linear-gradient(#1a1a1a, #1a1a1a), linear-gradient(to right, #ffeb3b, #f44336, #2196f3);
    color: #ffffff;
}

.related-posts { margin: 60px auto 40px auto; max-width: 700px; }
.related-posts h2 { font-size: 1.5rem; font-weight: 800; margin-bottom: 25px; }
