/*
Theme Name: ChinaGuide
Description: Thème premium pour guide de voyage en Chine
Version: 1.2
Author: Votre Agence
Text Domain: chinaguide
*/

/* VARIABLES COULEURS */
:root {
    --bg-main: #F8F8F8;
    --bg-white: #FFFFFF;
    --text-title: #333333;
    --text-body: #555555;
    --cta-red: #D64545;
    --accent-gold: #CFAE70;
    --border-light: #E0E0E0;
}

/* TYPOGRAPHIE */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Open+Sans:wght@300;400;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-body);
    line-height: 1.6;
    font-size: 16px;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    color: var(--text-title);
    margin-bottom: 20px;
}

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

/* ===== HERO SECTION PLEINE LARGEUR CORRIGÉE ===== */
.hero-section {
    width: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 120px 20px;
    text-align: center;
    color: white;
    position: relative;
    margin: 0;
    min-height: 350px;
    display: flex;
    align-items:center;
    justify-content:center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero-section h1 {
    color: white;
    margin-bottom: 20px;
    font-size: 2.8rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    line-height: 1.2;
}

.hero-section p {
    font-size: 1.3rem;
    margin-bottom: 30px;
    color: #f8f8f8;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    line-height: 1.5;
    font-weight: 300;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-button-primary {
    background: #D64545;
    color: white;
    padding: 14px 30px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(214, 69, 69, 0.3);
}

.hero-button-primary:hover {
    background: #c03939;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(214, 69, 69, 0.4);
}

.hero-button-secondary {
    background: transparent;
    border: 2px solid white;
    color: white;
    padding: 14px 30px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.hero-button-secondary:hover {
    background: white;
    color: #333;
    transform: translateY(-2px);
}

/* LAYOUT PRINCIPAL */
.container {
    display: flex;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.main-content {
    flex: 2;
    width: 66.66%;
}

.sidebar {
    flex: 1;
    width: 33.33%;
}

/* HEADER */
.site-header {
    background: var(--bg-white);
    padding: 15px 0;
    margin-bottom: 0 !important;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* LOGO SUR DEUX LIGNES */
.logo {
    line-height: 1.2;
    flex-shrink: 0;
}

.logo h1 {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo a {
    text-decoration: none;
    color: var(--text-title);
    display: block;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo-line-1 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.8rem !important;
    font-weight: 700;
    white-space: nowrap;
    height: 30px;
}

.flag-china {
    font-size: 1.6rem !important;
    display: flex;
    align-items: center;
    width: 26px;
    justify-content: center;
}

.logo-line-2 {
    font-size: 1.2rem !important;
    font-weight: 400;
    color: var(--cta-red);
    letter-spacing: 0.5px;
    white-space: nowrap;
    height: 22px;
    margin-left: 34px !important;
    text-align: left;
}

.logo-description {
    font-size: 0.7rem;
    color: #888;
    margin: 2px 0 0 0;
    font-weight: 300;
}

/* NAVIGATION ET RECHERCHE COLLÉES À DROITE */
.header-right {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-left: auto;
}

/* ===== SOLUTION DÉFINITIVE MENU DÉROULANT ===== */
.primary-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px;
    position: relative;
}

.primary-menu > li {
    position: relative;
}

.primary-menu > li > a {
    text-decoration: none;
    color: var(--text-body);
    font-weight: 600;
    font-size: 0.95rem !important;
    padding: 8px 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    position: relative;
}

.primary-menu > li > a:hover {
    color: var(--cta-red);
}

.dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    margin-left: 3px;
}

.has-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

/* SOLUTION RADICALE POUR LE MENU DÉROULANT */
.has-dropdown {
    position: relative;
}

/* Zone de hover étendue */
.has-dropdown::before {
    content: '';
    position: absolute;
    top: 100%;
    left: -10px;
    right: -10px;
    height: 20px;
    background: transparent;
    z-index: 999;
}

.sub-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: -10px;
    background: white;
    min-width: 240px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    border-radius: 6px;
    padding: 8px 0;
    margin: 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
    border: 1px solid #f0f0f0;
}

/* FORCER l'affichage avec JavaScript */
.has-dropdown.dropdown-open .sub-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    display: block !important;
}

/* Styles des liens du sous-menu */
.sub-menu a {
    display: block;
    padding: 10px 20px;
    text-decoration: none;
    color: var(--text-body);
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    position: relative;
    z-index: 1001;
}

.sub-menu a:hover {
    background: var(--bg-main);
    color: var(--cta-red);
    border-left-color: var(--cta-red);
}

.sub-menu li:not(:last-child) a {
    border-bottom: 1px solid #f5f5f5;
}

.has-dropdown > a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--cta-red);
    transition: width 0.3s ease;
}

.has-dropdown:hover > a::after {
    width: 100%;
}

/* BARRE DE RECHERCHE */
.header-search {
    flex-shrink: 0;
}

.header-search form {
    display: flex;
}

.header-search input {
    padding: 6px 12px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.85rem;
    min-width: 320px !important;
    width: 320px !important;
}

/* ===== MENU BURGER ===== */
.menu-burger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-left: 15px;
}

.menu-burger span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--text-body);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.menu-burger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.menu-burger.active span:nth-child(2) {
    opacity: 0;
}

.menu-burger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ARTICLES ET CARDS */
.article-card {
    background: var(--bg-white);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    transition: transform 0.3s;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.article-card:hover {
    transform: translateY(-5px);
}

.article-card h3 {
    margin-bottom: 15px;
}

.article-card h3 a {
    text-decoration: none;
    color: var(--text-title);
}

.article-card h3 a:hover {
    color: var(--cta-red);
}

/* BOUTONS CTA */
.cta-button {
    background: var(--cta-red);
    color: white;
    padding: 12px 25px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.cta-button:hover {
    background: #c03939;
}

/* SIDEBAR WIDGETS */
.sidebar-widget {
    background: var(--bg-white);
    padding: 25px;
    margin-top: 30px;
    margin-bottom: 20px;
    border-radius: 8px;
    border-top: 3px solid var(--accent-gold);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.widget-title {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--text-title);
}

/* LIENS TRIP.COM */
.trip-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.trip-links a {
    display: block;
    padding: 10px;
    background: var(--bg-main);
    text-align: center;
    text-decoration: none;
    color: var(--text-body);
    border-radius: 4px;
    transition: all 0.3s;
}

.trip-links a:hover {
    background: var(--cta-red);
    color: white;
}

/* FOOTER */
.site-footer {
    background: var(--text-title);
    color: white;
    padding: 40px 0;
    margin-top: 50px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-columns {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 40px;
}

.footer-column h4 {
    color: white;
    margin-bottom: 20px;
}

.footer-column ul {
    list-style: none;
}

.footer-column a {
    color: #ccc;
    text-decoration: none;
}

.footer-column a:hover {
    color: white;
}

/* ===== MENU MOBILE ===== */
@media (max-width: 768px) {
    .menu-burger {
        display: flex;
    }

    .main-navigation {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: white;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        z-index: 1001;
        padding: 80px 20px 20px;
        overflow-y: auto;
    }

    .main-navigation.active {
        right: 0;
    }

    .primary-menu {
        flex-direction: column;
        gap: 0;
    }

    .primary-menu > li {
        width: 100%;
        border-bottom: 1px solid #f0f0f0;
    }

    .primary-menu > li > a {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 0 !important;
        font-size: 1.1rem !important;
        width: 100%;
    }

    /* Désactiver les corrections desktop sur mobile */
    .has-dropdown::before {
        display: none;
    }

    .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: var(--bg-main);
        display: none;
        min-width: auto;
        border: none;
        padding: 0 !important;
        margin: 0 0 0 20px;
        left: 0;
        top: 0;
    }

    .sub-menu.active {
        display: block;
    }

    .sub-menu a {
        padding: 12px 0 !important;
        font-size: 1rem !important;
        border-left: none !important;
        border-bottom: 1px solid #e0e0e0;
    }

    .dropdown-arrow {
        transition: transform 0.3s ease;
    }

    .has-dropdown.active .dropdown-arrow {
        transform: rotate(180deg);
    }

    /* Overlay */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 1000;
    }

    .menu-overlay.active {
        display: block;
    }

    /* Ajustements header mobile */
    .header-right {
        gap: 15px;
    }

    .header-search {
        display: none;
    }

    .container {
        flex-direction: column;
        gap: 20px;
    }
    
    .main-content, .sidebar {
        width: 100%;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        position: static;
    }
    
    .header-right {
        position: static;
        transform: none;
        margin-left: 0;
        width: 100%;
        justify-content: center;
        flex-direction: column;
        gap: 15px;
    }
    
    .logo {
        text-align: center;
        width: 100%;
    }
    
    .logo h1 {
        align-items: center;
    }
    
    .logo-line-2 {
        margin-left: 0 !important;
        text-align: center;
    }
    
    .logo-line-1 {
        justify-content: center;
    }
    
    .header-search input {
        min-width: auto !important;
        width: 100% !important;
        font-size: 1rem !important;
    }
    
    .footer-columns {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* HERO SECTION MOBILE */
    .hero-section {
        padding: 80px 15px;
    }
    
    .hero-section h1 {
        font-size: 2.2rem !important;
    }
    
    .hero-section p {
        font-size: 1.1rem !important;
        margin-bottom: 30px;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .hero-button-primary,
    .hero-button-secondary {
        width: 100%;
        max-width: 280px;
        text-align: center;
        padding: 12px 25px;
    }
}

@media (max-width: 1024px) {
    .primary-menu {
        gap: 15px;
    }
    
    .primary-menu > li > a {
        font-size: 0.9rem !important;
    }
    
    .header-right {
        gap: 20px;
    }
    
    .header-search input {
        min-width: 250px !important;
    }
    
    .footer-columns {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

/* Pour les très grands écrans */
@media (min-width: 1400px) {
    .primary-menu {
        gap: 25px;
    }
    
    .primary-menu > li > a {
        font-size: 1rem !important;
    }
    
    .header-search input {
        min-width: 400px !important;
    }
}

/* ===== DÉBOGAGE MENU ===== */
.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 220px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    border-radius: 6px;
    padding: 8px 0;
    margin: 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

/* FORCER l'affichage pour test */
.has-dropdown:hover .sub-menu,
.has-dropdown:focus-within .sub-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    display: block !important;
}

/* Zone de sécurité étendue */
.has-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: -20px;
    right: -20px;
    height: 30px;
    z-index: 999;
    pointer-events: none;
}

/* ===== SOLUTION ULTRA-SIMPLE ===== */
.has-dropdown.dropdown-open .sub-menu {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    display: block !important;
}

/* SURTOUT - Désactiver tout transition problématique */
.sub-menu {
    transition: opacity 0.2s ease !important;
    transition: all 0.2s ease !important;
}