/*
Theme Name: Cerises Academy
Theme URI: /cerises/
Description: E-learning design d'intérieur - Cerises Academy
Version: 1.0
Author: Cerises Academy
*/

/* === Base === */
:root {
    --primary: #2d3436;
    --accent: #c0392b;
    --accent-light: #e74c3c;
    --gold: #d4af37;
    --light: #f8f9fa;
    --dark: #1a1a2e;
    --gray: #636e72;
    --light-gray: #dfe6e9;
    --shadow: 0 10px 30px rgba(0,0,0,0.08);
    --radius: 12px;
    --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--primary);
    line-height: 1.6;
    overflow-x: hidden;
    background: #fff;
}

img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    line-height: 1.2;
}

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

/* === Navbar === */
.navbar{ position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: rgba(255,255,255,0.92) !important; backdrop-filter: blur(12px) !important; -webkit-backdrop-filter: blur(12px) !important; border-bottom: 1px solid rgba(0,0,0,0.06) !important; padding: 14px 0 !important; }

.navbar.scrolled {
    background: rgba(26, 26, 46, 0.97);
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
    padding: 10px 0;
}

.nav-bar-inner {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 20px;
    justify-content: flex-start;
}

/* Logo (cap + text on desktop, cap-only on mobile/tablet) */
.ca-logo {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    white-space: nowrap;
    margin-left: -16px;
}
.ca-logo-cap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #c0392b;
    font-size: 1.9rem;
    margin-right: 10px;
    transition: transform 0.3s ease;
}
.ca-logo:hover .ca-logo-cap { transform: rotate(-8deg) scale(1.05); }
.ca-logo:hover, .ca-logo:focus, .ca-logo:active { text-decoration: none !important; }
.ca-logo-text { display: inline-flex; }
.ca-word-cerises { color: #c0392b; }
.ca-word-academy { color: rgba(255,255,255,0.85); margin-left: 4px; }

.nav-links-inline {
    flex: 1 1 auto;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    min-width: 0;
    margin-left: 34px;
    margin-right: 24px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 28px;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-links a{ color: #4a5568 !important; }

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: rgba(255,255,255,0.5);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Sous-menus (WordPress .sub-menu) — dropdown au survol en desktop */
.nav-links li {
    position: relative;
    list-style: none;
}
.nav-links .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    display: none;
    flex-direction: column;
    min-width: 210px;
    background: #1a1a2e;
    padding: 10px 0;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    gap: 0;
    z-index: 1100;
}
.nav-links li:hover > .sub-menu,
.nav-links li:focus-within > .sub-menu {
    display: flex;
}
.nav-links .sub-menu li {
    width: 100%;
    list-style: none;
}
.nav-links .sub-menu a {
    display: block;
    padding: 10px 18px;
    font-size: 0.9rem;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.85);
}
.nav-links .sub-menu a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.nav-cta-outline {
    padding: 8px 20px;
    font-size: 0.9rem;
    border: 2px solid rgba(255,255,255,0.5);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    background: transparent;
    cursor: pointer;
}
.nav-cta-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: white;
}
.nav-cta-solid {
    padding: 8px 20px;
    font-size: 0.9rem;
    background: #c0392b;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    border: none;
    transition: background 0.3s ease;
}
.nav-cta-solid:hover { background: #a93226; }

/* === Boutons génériques .btn (nav mobile, sections d'accueil, CTA) === */
.btn {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 50px;
  text-decoration: none !important;
  cursor: pointer;
  line-height: 1.2;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.btn-primary {
  background: #c0392b;
  color: #ffffff !important;
  border: 2px solid #c0392b;
}
.btn-primary:hover {
  background: #a93226;
  border-color: #a93226;
  color: #ffffff !important;
}
.btn-outline {
  background: transparent;
  color: #ffffff !important;
  border: 2px solid rgba(255, 255, 255, 0.6);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #ffffff;
  color: #ffffff !important;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

.nav-desktop-cta {
    flex-shrink: 0;
    display: flex;
    gap: 10px;
    align-items: center;
    margin-left: auto;
    white-space: nowrap;
}

.nav-menu-wrap {
    display: flex;
    align-items: center;
}

.nav-mobile-cta {
    display: none;
}

/* L'item de menu WP "Connexion / S'inscrire" (classe nav-cta-mobile) est
   remplacé par les CTA dédiés .nav-desktop-cta / .nav-mobile-cta -> on le masque
   pour éviter les doublons (il étirait la nav en desktop). */
.nav-cta-mobile {
    display: none !important;
}

/* === Content === */
main {
    padding-top: 100px;
    min-height: calc(100vh - 200px);
}

/* === Footer === */
footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: white;
    padding: 40px 0;
    text-align: center;
}

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

/* === Responsive === */
/* === Mobile / Tablet menu === */
@media (max-width: 1200px) {
    .menu-toggle {
        display: block !important;
        margin-left: auto;
    }

    .nav-desktop-cta {
        display: none !important;
    }

    .nav-links-inline {
        margin: 0;
        width: 100%;
    }

    .nav-menu-wrap {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: #ffffff;
        flex-direction: column;
        padding: 22px 22px 28px;
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
        transform: translateY(-120%);
        opacity: 0;
        visibility: hidden;
        transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease, visibility 0.3s;
        border-radius: 0 0 22px 22px;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }
    .nav-menu-wrap.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 0;
        align-items: stretch;
    }
    .nav-links li {
        width: 100%;
        text-align: left;
        padding: 4px 0;
        border-bottom: 1px solid var(--light-gray);
    }
    .nav-links li:last-child {
        border-bottom: none;
    }
    .nav-links a{ color: #4a5568 !important; }
    .nav-links a::after { display: none; }
    .nav-links a:hover {
        background: rgba(192, 57, 43, 0.08);
        color: #c0392b !important;
    }

    /* Sous-menus : affichés dans le panneau en mobile (indentés) */
    .nav-links .sub-menu {
        position: static;
        display: flex;
        background: transparent;
        box-shadow: none;
        padding: 0 0 0 14px;
        margin: 2px 0 6px;
        border-left: 2px solid var(--light-gray);
        border-radius: 0;
    }
    .nav-links .sub-menu a {
        color: var(--primary) !important;
        padding: 9px 14px;
        font-size: 0.92rem;
    }
    .nav-links .sub-menu a:hover {
        background: rgba(192, 57, 43, 0.08);
        color: #c0392b !important;
    }

    /* Page archive cours : liens foncés sur le panneau blanc en mobile
       (spécificité renforcée pour battre body.post-type-archive-mpcs-course .nav-links a) */
    body.post-type-archive-mpcs-course .nav-menu-wrap .nav-links a{ color: #4a5568 !important; }
    /* Page archive cours : html{font-size:20px} agrandit le logo et pousse le
       hamburger hors écran en mobile -> on réduit le logo (spécificité > règle existante) */
    body.post-type-archive-mpcs-course .navbar .container .ca-logo {
        font-size: 22px !important;
    }
    body.post-type-archive-mpcs-course .navbar .container .ca-logo-cap {
        font-size: 26px !important;
    }

    .nav-mobile-cta {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin-top: 20px;
    }
    .nav-mobile-cta .nav-cta-outline,
    .nav-mobile-cta .nav-cta-solid {
        text-align: center;
        padding: 13px 20px;
        font-size: 1rem;
        border-radius: 50px;
    }
    .nav-mobile-cta .nav-cta-outline {
        color: #c0392b !important;
        border: 2px solid #c0392b !important;
        background: transparent;
    }
    .nav-mobile-cta .nav-cta-solid {
        color: #ffffff !important;
    }

    /* Logo complet CERISES ACADEMY (cap + texte) aussi sur mobile/tablette.
       Taille identique à l'accueil (22px) pour éviter que le logo trop large
       pousse le hamburger hors écran / à la ligne. */
    .ca-logo { margin-left: 0; font-size: 22px; }
    .ca-logo-cap { font-size: 26px; }
    .nav-bar-inner { flex-wrap: nowrap !important; }

    main {
        padding-top: 80px;
    }

    /* LearnPress responsive overrides */
    .learn-press-courses .lp-archive-courses .course-grid {
        grid-template-columns: 1fr !important;
    }

    .lp-single-course-hero {
        padding: 80px 0 40px !important;
    }
}

@media (max-width: 600px) {
    .nav-menu-wrap { top: 66px; }
    main { padding-top: 70px; }
    .navbar { padding: 12px 0; }
}

@media (max-width: 480px) {
    .container { padding: 0 15px; }
    .navbar { padding: 12px 0; }
}

/* /courses/ (archive MemberPress) — align navbar with homepage.
   classroom.css sets html{font-size:20px}, which scales our rem-based navbar
   sizes; use px + !important so they match the homepage (html=16px). */
body.post-type-archive-mpcs-course .navbar {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%) !important;
}
body.post-type-archive-mpcs-course .nav-links a{ color: #4a5568 !important; }
body.post-type-archive-mpcs-course .navbar > .container > a {
    font-size: 28.8px !important;
}
body.post-type-archive-mpcs-course .nav-cta-outline {
    font-size: 14.4px !important;
}
/* Connexion / S'inscrire CTA use inline font-size:0.9rem which scales with
   classroom.css html{font-size:20px}. Force px to match the homepage (16px). */
body.post-type-archive-mpcs-course .nav-desktop-cta a,
body.post-type-archive-mpcs-course .nav-desktop-cta button {
    font-size: 14.4px !important;
    border-width: 2px !important;
}
/* Ensure all "Découvrir" buttons have white text on the archive */
body.post-type-archive-mpcs-course .ca-btn {
    color: #ffffff !important;
}

/* FIX soulignement menu + blocage clics */
.nav-links a, .nav-links a:hover, .navbar a, #navLinks a { text-decoration: none !important; border-bottom: none !important; box-shadow: none !important; }
.nav-links a::after { display: none !important; }
/* Le panneau mobile cache ne doit pas intercepter les clics — mais UNIQUEMENT
   en mobile (<=1200px). Sur desktop le menu est inline et doit rester cliquable. */
#navMenuWrap { pointer-events: auto; }
@media (max-width: 1200px) {
  #navMenuWrap:not(.active) { pointer-events: none; }
  #navMenuWrap.active { pointer-events: auto; }
}
#login-modal[style*="display: none"], #login-modal[style*="display:none"] { pointer-events: none !important; }

/* Barre admin WP (connecte) : ne pas recouvrir le nav fixe */
body.admin-bar .navbar { top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar .navbar { top: 46px; }
}

/* FIX fluidite moncompte */
.ca-moncompte .mepr-account-table { contain: layout paint; will-change: transform; }
.ca-moncompte, .legal-page { will-change: auto; }
