/* ==========================================================================
   grilles-manouches.net — cassiopeia_gmstudio v1.0.2 (Unified Design System)
   Mode Sombre (Ébène & Ambre Lutherie) + Mode Clair (Papier Crème & Encre Chaude)
   Conserve 100 % des styles Accueil, Cours, Guides, Séries, Vidéos & Kunena.
   ========================================================================== */

:root,
:root[data-gm-theme="light"] {
    --gm-bg: #f6f1e7;
    --gm-surface: #fffdf8;
    --gm-soft: #efe7d8;
    --gm-text: #221b14;
    --gm-muted: #685b4c;
    --gm-line: #dfd3be;
    --gm-border: #dfd3be;
    --gm-accent: #b86214;
    --gm-accent-ink: #fffdf8;
    --gm-selected: #f5dfbe;
    --gm-shadow: 0 10px 28px rgba(34, 27, 20, 0.08);
    --gm-radius: 14px;

    --cassiopeia-font-family-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --cassiopeia-font-family-headings: Georgia, "Times New Roman", serif;
    --cassiopeia-font-weight-normal: 400;
    --cassiopeia-font-weight-headings: 700;
    --cassiopeia-color-primary: var(--gm-accent);
    --cassiopeia-color-hover: var(--gm-accent);
    --body-bg: var(--gm-bg);
    --body-color: var(--gm-text);
    --link-color: var(--gm-accent);
    --link-hover-color: var(--gm-text);
    --border-color: var(--gm-line);
    --template-bg-light: var(--gm-bg);
    --template-text-dark: var(--gm-text);
    --template-text-light: var(--gm-surface);
    --template-link-color: var(--gm-accent);
    --bs-body-bg: var(--gm-bg);
    --bs-body-color: var(--gm-text);
    --bs-border-color: var(--gm-line);
}

:root[data-gm-theme="dark"] {
    --gm-bg: #11100e;
    --gm-surface: #191613;
    --gm-soft: #24201b;
    --gm-text: #f3ede4;
    --gm-muted: #b0a493;
    --gm-line: #332c24;
    --gm-border: #332c24;
    --gm-accent: #e59a3c;
    --gm-accent-ink: #17120c;
    --gm-selected: rgba(229, 154, 60, 0.18);
    --gm-shadow: 0 12px 32px rgba(0, 0, 0, 0.42);
}

/* Base site */
body.site {
    background: var(--gm-bg) !important;
    color: var(--gm-text) !important;
    font-family: var(--cassiopeia-font-family-body);
}
body.site a {
    color: var(--gm-accent);
    text-underline-offset: 0.2em;
}
body.site a:is(.btn-primary, .btn-success, .gm-btn-primary, .gm-btn-active),
body.site a:is(.btn-primary, .btn-success, .gm-btn-primary, .gm-btn-active):hover,
body.site a:is(.btn-primary, .btn-success, .gm-btn-primary, .gm-btn-active):focus {
    background: var(--gm-accent) !important;
    border-color: var(--gm-accent) !important;
    color: var(--gm-accent-ink) !important;
    text-decoration: none;
}
body.site :is(button, input, select, textarea) { font-family: inherit; }
body.site :is(a, button, input, select, textarea, summary, [tabindex]):focus:not(:focus-visible),
body.site .btn:focus:not(:focus-visible),
body.site .form-control:focus:not(:focus-visible),
body.site .form-select:focus:not(:focus-visible) {
    outline: none !important;
    box-shadow: none !important;
}
body.site :is(a, button, input, select, textarea, summary):focus-visible {
    outline: 2px solid var(--gm-accent) !important;
    outline-offset: 2px;
    box-shadow: none !important;
}
body.site ::selection {
    background: var(--gm-selected);
    color: var(--gm-text);
}
html { scroll-padding-top: 96px; }

/* ==========================================================================
   1. EN-TÊTE CASSIOPEIA (Ébène / Crème, Z-Index au-dessus de Kunena, .jmodedit corrigé)
   ========================================================================== */
.container-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0 22px;
    padding: 12px clamp(16px, 2.4vw, 44px);
    min-height: 76px;
    background: var(--gm-surface) !important;
    background-image: none !important;
    color: var(--gm-text) !important;
    border-bottom: 1px solid var(--gm-line);
    box-shadow: none;
    position: relative;
    z-index: 1100 !important;
}
.container-header > .grid-child { width: auto; max-width: none; margin: 0; min-width: 0; }
.container-header > .grid-child:has(> .navbar-brand) { grid-column: 1; }
.container-header .navbar-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0;
    margin: 0;
    line-height: 1.1;
}
.container-header .navbar-brand .brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--gm-text) !important;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 19px;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
}
.container-header .brand-logo img,
.container-header .brand-logo svg {
    width: auto;
    max-width: 230px;
    max-height: 44px;
    object-fit: contain;
    display: block;
}
.container-header .site-description {
    font-size: 11px;
    color: var(--gm-muted);
    margin: 4px 0 0;
}

/* Fix icône d'édition front-end Joomla (.jmodedit) qui chevauchait "Mon compte" */
.container-header .jmodedit {
    position: static !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    padding: 4px 7px !important;
    width: auto !important;
    height: auto !important;
    border-radius: 6px;
    background: var(--gm-selected) !important;
    border: 1px solid var(--gm-accent) !important;
    color: var(--gm-accent) !important;
}

/* Navigation principale */
.container-header .container-nav {
    grid-column: 2;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 0;
}
.container-header .container-nav > .navbar { padding: 0; margin: 0; }
.container-header .container-nav .navbar-collapse { flex-grow: 0; }
.container-header .container-topbar,
.container-header .container-below-top { grid-column: 1 / -1; }

.container-header .mod-menu {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    margin: 0;
    color: var(--gm-text);
}
.container-header .mod-menu > li {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0;
    margin: 0;
    border-radius: 10px;
}
.container-header .mod-menu > li > a,
.container-header .mod-menu > li > button:not(.mm-toggler):not(.mm-toggler-link),
.container-header .mod-menu > li > span {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 11px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--gm-text) !important;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
}
.container-header .mod-menu > li:is(.active, .current) > a,
.container-header .mod-menu > li > a[aria-current],
.container-header .mod-menu > li > a:hover {
    background: var(--gm-selected) !important;
    color: var(--gm-accent) !important;
    text-decoration: none;
}
.container-header .mod-menu > li > a::before,
.container-header .mod-menu > li > a::after { content: none !important; }

/* Flèches & menus déroulants (z-index 1200 au-dessus de Kunena) */
.container-header .mod-menu .mm-toggler,
.container-header .mod-menu .mm-toggler-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 36px;
    padding: 6px;
    margin: 0;
    background: transparent;
    border: 0;
    border-radius: 7px;
    color: var(--gm-muted);
}
.container-header .mod-menu .mm-toggler:hover { background: var(--gm-soft); color: var(--gm-accent); }
.container-header .mod-menu ul,
.container-header .mod-menu.metismenu :is(.mm-collapse, .mm-collapsing) {
    position: absolute;
    z-index: 1200 !important;
    top: calc(100% + 6px);
    inset-inline-start: 0;
    min-width: 220px;
    width: max-content;
    max-width: min(320px, 90vw);
    padding: 7px;
    margin: 0;
    background: var(--gm-surface) !important;
    color: var(--gm-text) !important;
    border: 1px solid var(--gm-line) !important;
    border-radius: 12px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
    list-style: none;
}
.container-header .mod-menu .mm-collapse:not(.mm-show) { display: none; }
.container-header .mod-menu .mm-show { display: block; }
.container-header .mod-menu ul li { display: block; margin: 0; padding: 0; width: 100%; }
.container-header .mod-menu ul a,
.container-header .mod-menu ul span {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 7px;
    color: var(--gm-text) !important;
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    background: transparent;
}
.container-header .mod-menu ul a:hover,
.container-header .mod-menu ul li:is(.active, .current) > a {
    background: var(--gm-selected) !important;
    color: var(--gm-accent) !important;
}

/* Boutons d'outils en-tête (Recherche, Thème Sombre/Clair, Menu mobile) */
.gm-header-tools {
    grid-column: 3;
    display: flex;
    align-items: center;
    gap: 7px;
}
.gm-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 9px;
    border: 1px solid var(--gm-line);
    border-radius: 10px;
    background: var(--gm-soft);
    color: var(--gm-text);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.gm-icon-button:hover,
.gm-icon-button[aria-expanded="true"] {
    border-color: var(--gm-accent);
    background: var(--gm-selected);
    color: var(--gm-accent);
}
.gm-icon-button svg,
.gm-mobile-bar svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.gm-mobile-menu-toggle { display: none; }
.container-header .navbar-toggler,
.container-header button.gm-native-toggle { display: none !important; }

/* Barre de recherche déroulante en-tête */
.gm-site-search {
    grid-column: 1 / -1;
    width: min(100%, 760px);
    justify-self: end;
    padding: 14px 0 4px;
}
.gm-site-search[hidden] { display: none; }
.gm-site-search label {
    display: block;
    margin-bottom: 6px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--gm-muted);
}
.gm-search-row { display: flex; align-items: stretch; gap: 10px; }
.gm-search-row input {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 8px 14px;
    border: 1px solid var(--gm-line);
    border-radius: 10px;
    background: var(--gm-bg);
    color: var(--gm-text);
    font-size: 14.5px;
}
.gm-search-row input:focus { outline: none; border-color: var(--gm-accent); }
.gm-search-submit {
    padding: 8px 18px;
    border: 1px solid var(--gm-accent);
    border-radius: 10px;
    background: var(--gm-accent);
    color: var(--gm-accent-ink);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
}

/* ==========================================================================
   2. GRILLE DE PAGE, CONTENUS JOOMLA, ALERTES & FORMULAIRES COMPTE
   ========================================================================== */
.site-grid {
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 18px;
    width: 100%;
    max-width: 1460px;
    margin: 0 auto;
    padding: 18px clamp(14px, 2.2vw, 36px) 36px;
}
.site-grid > .grid-child { min-width: 0; max-width: none; }
.site-grid > :is(.container-banner, .container-top-a, .container-top-b, .container-bottom-a, .container-bottom-b) { flex: 0 0 100%; }
.site-grid > .container-component { flex: 1 1 0; }
.site-grid > :is(.container-sidebar-left, .container-sidebar-right) { flex: 0 0 250px; }

/* Pleine largeur confortable pour le Studio com_gmstudio */
body.com_gmstudio .site-grid {
    max-width: 1580px;
    padding: 12px clamp(10px, 1.8vw, 24px) 28px;
}
body.com_gmstudio.view-chart .site-grid {
    max-width: none;
    padding: 10px 14px 28px;
}

.container-component main { width: 100%; max-width: none; min-width: 0; margin-top: 0; }
.container-component :is(.page-header h1, .com-content-article__title) { color: var(--gm-text); }
.container-component .breadcrumb {
    margin-bottom: 14px;
    padding: 0;
    background: transparent;
    color: var(--gm-muted);
    font-size: 12.5px;
}
.container-component .breadcrumb a { color: var(--gm-accent); }
.container-component :is(.article-info, .article-info dd, .article-info-term, .com-content-article__info) {
    color: var(--gm-muted) !important;
}
.container-component .article-info a { color: var(--gm-accent) !important; }

/* Cartes articles & pages compte Joomla */
.site-grid > .grid-child > .card,
.container-component > main > :is(.com-users-login, .com-users-registration, .com-users-reset, .com-users-remind, .com-users-profile, .com-users-profile__edit, .com-content-article) {
    padding: clamp(18px, 3vw, 34px);
    border: 1px solid var(--gm-line);
    border-radius: var(--gm-radius);
    background: var(--gm-surface);
    color: var(--gm-text);
}
.site-grid .card-header { background: var(--gm-soft); color: var(--gm-text); border-color: var(--gm-line); }
.site-grid .card-body { background: var(--gm-surface); color: var(--gm-text); }
.container-component :is(.com-users-login, .com-users-registration, .com-users-reset, .com-users-remind) {
    max-width: 720px;
    margin: 20px auto;
}
html.gm-shell :is(.com-users-login, .com-users-registration, .com-users-reset, .com-users-remind, .com-users-profile__edit, .mod-login, #login-form) :is(.form-control, .form-select) {
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--gm-line);
    border-radius: 10px;
    background: var(--gm-bg);
    color: var(--gm-text);
}
html.gm-shell :is(.com-users-login, .com-users-registration, .com-users-reset, .com-users-remind, .com-users-profile__edit, .mod-login, #login-form) :is(.form-control, .form-select):focus {
    border-color: var(--gm-accent);
    box-shadow: 0 0 0 2px var(--gm-selected);
}
html.gm-shell :is(.com-users-login, .com-users-registration, .com-users-reset, .com-users-remind, .com-users-profile, .com-users-profile__edit, .mod-login, #login-form) :is(.btn-primary, .btn-success, a.btn-primary, a.btn-success) {
    background: var(--gm-accent) !important;
    color: var(--gm-accent-ink) !important;
    border-color: var(--gm-accent) !important;
    border-radius: 9px;
    font-weight: 700;
}
html.gm-shell :is(.com-users-login, .com-users-registration, .com-users-reset, .com-users-remind, .com-users-profile, .com-users-profile__edit, .mod-login, #login-form) :is(.btn-primary, .btn-success, a.btn-primary, a.btn-success):hover {
    filter: brightness(1.06);
    color: var(--gm-accent-ink) !important;
}
html.gm-shell :is(.com-users-login, .com-users-registration, .com-users-profile__edit, .mod-login, #login-form) .btn-secondary,
html.gm-shell .plg_system_webauthn_login_button {
    background: var(--gm-soft) !important;
    color: var(--gm-text) !important;
    border-color: var(--gm-line) !important;
}
html.gm-shell :is(.com-users-login, .com-users-registration, .com-users-profile__edit, .mod-login, #login-form) .btn-secondary:hover,
html.gm-shell .plg_system_webauthn_login_button:hover {
    border-color: var(--gm-accent) !important;
    color: var(--gm-text) !important;
}
/* WebAuthn / Passkey icon contrast in Dark Mode */
html.gm-shell[data-gm-theme="dark"] :is(.plg_system_webauthn_login_button, [class*="webauthn"]) :is(svg, path, circle, rect, polygon) {
    fill: currentColor !important;
    color: var(--gm-text) !important;
}
html.gm-shell[data-gm-theme="dark"] :is(.plg_system_webauthn_login_button, [class*="webauthn"]) :is(img, svg, .icon-key, [class*="icon-"]) {
    color: var(--gm-text) !important;
    filter: brightness(0) invert(0.95) !important;
}

/* Alertes système Joomla (clair & sombre lisibles) */
.gm-shell :is(.alert, joomla-alert) :is(.alert-message, .alert-heading, .alert-wrapper) { background: transparent !important; color: inherit !important; }
.gm-shell :is(.alert, joomla-alert) { color: #183e55 !important; background: #e8f1f8 !important; border-color: #7398b3 !important; }
html.gm-shell[data-gm-theme="dark"] :is(.alert, joomla-alert) { color: #e7f4ff !important; background: #19384b !important; border-color: #6591ac !important; }
.gm-shell :is(.alert-danger, joomla-alert[type="danger"]) { color: #692429 !important; background: #fff0f0 !important; }
html.gm-shell[data-gm-theme="dark"] :is(.alert-danger, joomla-alert[type="danger"]) { color: #ffe3e3 !important; background: #49282c !important; }
.gm-shell :is(.alert-success, joomla-alert[type="success"]) { color: #204a32 !important; background: #eaf7ed !important; }
html.gm-shell[data-gm-theme="dark"] :is(.alert-success, joomla-alert[type="success"]) { color: #dff7e4 !important; background: #223e2d !important; }
.gm-shell :is(.alert-warning, joomla-alert[type="warning"]) { color: #563d0f !important; background: #fff5df !important; }
html.gm-shell[data-gm-theme="dark"] :is(.alert-warning, joomla-alert[type="warning"]) { color: #fff0cd !important; background: #4c3b20 !important; }

/* Pied de page */
.container-footer.footer {
    background: var(--gm-surface) !important;
    background-image: none !important;
    color: var(--gm-muted) !important;
    border-top: 1px solid var(--gm-line);
    margin-top: 0;
}
.container-footer.footer > .grid-child { padding: 18px clamp(18px, 2.4vw, 48px); }
.container-footer.footer :is(a, .nav-link, .mod-menu a, .mod-menu li > a) {
    color: var(--gm-accent) !important;
    opacity: 1 !important;
}
.container-footer.footer :is(a:hover, .nav-link:hover, .mod-menu a:hover) {
    color: var(--gm-text) !important;
    text-decoration: underline;
}
.container-footer.footer :is(li.active > a, li.current > a, a.active, a[aria-current], .nav-link.active) {
    color: var(--gm-text) !important;
    font-weight: 700 !important;
    text-decoration: underline;
    opacity: 1 !important;
}
.back-to-top-link { background: var(--gm-surface); color: var(--gm-accent); border-color: var(--gm-line); }

/* ==========================================================================
   3. PAGE D'ACCUEIL (.gm-home) — CONSERVÉE DE L'ANCIEN SITE
   ========================================================================== */
.gm-home { --home-accent: var(--gm-accent); max-width: 1240px; margin: 0 auto; color: var(--gm-text); }
.gm-home * { box-sizing: border-box; }
.gm-home a { text-decoration: none; }
.gm-home img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gm-home-hero { min-height: 410px; border-radius: 16px; position: relative; overflow: hidden; display: flex; align-items: center; background: #171513; }
.gm-home-hero > img { position: absolute; inset: 0; opacity: 0.92; object-position: center 52%; }
.gm-home-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(13, 13, 13, 0.96), rgba(13, 13, 13, 0.8) 38%, rgba(13, 13, 13, 0.04)); }
.gm-home-hero-copy { position: relative; z-index: 1; padding: 3rem; max-width: 650px; color: #fffaf3; }
.gm-home-kicker { color: #e5aa67; font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem; }
.gm-home h1 { font-size: clamp(2.4rem, 5vw, 4.3rem); line-height: 1.02; letter-spacing: -0.04em; color: inherit; margin: 0.7rem 0 1rem; }
.gm-home-hero-copy > p:not(.gm-home-kicker) { font-size: 1.1rem; max-width: 40ch; line-height: 1.6; color: #f2e9df; }
.gm-home-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 1.5rem; }
.gm-home-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.75rem 1.05rem; border-radius: 8px; background: #bb793d; color: #fff !important; font-weight: 700; border: 1px solid #bb793d; }
.gm-home-btn.secondary { background: transparent; color: #fffaf3 !important; border-color: #c7a886; }
.gm-home-section { margin: 3.5rem 0; }
.gm-home-feature { display: grid; grid-template-columns: 1.15fr 1fr; gap: 1.2rem; }
.gm-home-photo, .gm-home-panel, .gm-home-card, .gm-home-forum { background: var(--gm-surface); border: 1px solid var(--gm-border); border-radius: 14px; overflow: hidden; }
.gm-home-photo { min-height: 340px; }
.gm-home-panel { padding: 2rem; display: flex; flex-direction: column; justify-content: center; }
.gm-home-panel h2 { font-size: clamp(1.8rem, 3vw, 2.8rem); margin: 0.35rem 0; }
.gm-home-panel p { line-height: 1.65; color: var(--gm-muted); }
.gm-home-textlink { color: var(--gm-accent) !important; font-weight: 700; }
.gm-home-record { border-top: 1px solid var(--gm-border); margin-top: 1.2rem; padding-top: 1.2rem; display: flex; align-items: center; gap: 1rem; color: var(--gm-text) !important; }
.gm-home-play { width: 42px; height: 42px; border: 1px solid var(--gm-accent); border-radius: 50%; display: grid; place-items: center; color: var(--gm-accent); flex: none; }
.gm-home-record small, .gm-home-card small { display: block; color: var(--gm-muted); line-height: 1.5; }
.gm-home-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.gm-home-heading h2 { font-size: clamp(1.55rem, 2.5vw, 2.1rem); margin: 0; color: var(--gm-text); }
.gm-home-heading h2::after { content: ""; display: block; background: var(--gm-accent); width: 38px; height: 2px; margin-top: 0.6rem; }
.gm-home-grid3, .gm-home-grid2 { display: grid; gap: 1rem; }
.gm-home-grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gm-home-grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gm-home-card { display: flex; flex-direction: column; color: var(--gm-text) !important; transition: border-color 0.2s, transform 0.2s; }
.gm-home-card:hover { border-color: var(--gm-accent); transform: translateY(-2px); }
.gm-home-card img { aspect-ratio: 16 / 10; }
.gm-home-card span { padding: 1rem 1.1rem; }
.gm-home-card strong { font-size: 1.08rem; }
.gm-home-grid2 .gm-home-card img { aspect-ratio: 2 / 1; }
.gm-home-forum { padding: 1.6rem; display: flex; align-items: center; gap: 1.4rem; justify-content: space-between; }
.gm-home-forum p { color: var(--gm-muted); margin: 0.3rem 0 0; }
.gm-home-forum .gm-home-btn { flex: none; }

/* ==========================================================================
   4. COURS, RESSOURCES, GUIDES ACCORDS, SÉRIES & VIDÉOS — CONSERVÉS
   ========================================================================== */
body.view-category:is(.itemid-1369, .itemid-1740, .itemid-1616, .itemid-1617, .itemid-1618) .blog-items {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem;
}
body.view-category:is(.itemid-1369, .itemid-1740, .itemid-1616, .itemid-1617, .itemid-1618) .blog-item {
    display: flex; flex-direction: column; min-width: 0; overflow: hidden;
    background: var(--gm-surface); border: 1px solid var(--gm-border); border-radius: 12px;
}
body.view-category:is(.itemid-1369, .itemid-1740, .itemid-1616, .itemid-1617, .itemid-1618) .blog-item .item-image {
    float: none; width: 100%; margin: 0; aspect-ratio: 16 / 9; overflow: hidden; background: var(--gm-soft);
}
body.view-category:is(.itemid-1369, .itemid-1740, .itemid-1616, .itemid-1617, .itemid-1618) .blog-item .item-image img {
    width: 100%; height: 100%; object-fit: cover; object-position: center; display: block;
}
body.view-category:is(.itemid-1369, .itemid-1740, .itemid-1616, .itemid-1617, .itemid-1618) .blog-item .item-image img[src*="accords-jazz-manouche-poster"] {
    object-fit: contain; padding: 0.6rem;
}
body.view-category:is(.itemid-1369, .itemid-1740, .itemid-1616, .itemid-1617, .itemid-1618) .blog-item .item-image figcaption { display: none; }
body.view-category:is(.itemid-1369, .itemid-1740, .itemid-1616, .itemid-1617, .itemid-1618) .blog-item .item-content {
    display: flex; flex-direction: column; padding: 1.15rem 1.2rem 1.25rem; color: var(--gm-text);
}
body.view-category:is(.itemid-1369, .itemid-1740, .itemid-1616, .itemid-1617, .itemid-1618) .blog-item h2 {
    font-size: 1.22rem; line-height: 1.3; margin: 0 0 0.75rem; overflow-wrap: anywhere;
}
body.view-category:is(.itemid-1369, .itemid-1740, .itemid-1616, .itemid-1617, .itemid-1618) .blog-item h2 a { color: inherit; text-decoration: none; }
body.view-category:is(.itemid-1369, .itemid-1740, .itemid-1616, .itemid-1617, .itemid-1618) .blog-item h2 a:hover { text-decoration: underline; }
body.view-category:is(.itemid-1369, .itemid-1740, .itemid-1616, .itemid-1617, .itemid-1618) .blog-item .gm-course-article > :not(p:first-child),
body.view-category:is(.itemid-1369, .itemid-1740, .itemid-1616, .itemid-1617, .itemid-1618) .blog-item .gm-harmony-series > :not(p:first-child),
body.view-category:is(.itemid-1369, .itemid-1740, .itemid-1616, .itemid-1617, .itemid-1618) .blog-item .gm-chapter-guide > :not(p:first-child),
body.view-category:is(.itemid-1369, .itemid-1740, .itemid-1616, .itemid-1617, .itemid-1618) .blog-item .item-content > :is(script, link),
body.view-category:is(.itemid-1369, .itemid-1740, .itemid-1616, .itemid-1617, .itemid-1618) .blog-item .item-content > p ~ p { display: none; }
body.view-category:is(.itemid-1369, .itemid-1740, .itemid-1616, .itemid-1617, .itemid-1618) .blog-item .item-content p {
    font-size: 0.96rem; line-height: 1.55; margin: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}

.gm-learn-home { max-width: 1250px; margin: 0 auto; padding: 0 0 2rem; color: var(--gm-text); }
.gm-learn-intro { font-size: 1.08rem; line-height: 1.6; color: var(--gm-muted); max-width: 65ch; margin: 0 0 1.7rem; }
.gm-learn-entries, .gm-learn-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.gm-learn-entry { display: flex; flex-direction: column; gap: 0.6rem; padding: 1.5rem; border: 1px solid var(--gm-border); border-radius: 12px; background: var(--gm-surface); color: var(--gm-text); text-decoration: none; line-height: 1.55; }
a.gm-learn-entry:hover { border-color: var(--gm-accent); text-decoration: none; transform: translateY(-2px); }
.gm-learn-entry strong { font-size: 1.35rem; line-height: 1.2; }
.gm-learn-kicker { font-size: 0.72rem; letter-spacing: 0.1em; font-weight: 700; color: var(--gm-accent); }
.gm-learn-action { margin-top: auto; padding-top: 0.7rem; color: var(--gm-accent); font-weight: 700; }
.gm-learn-muted { margin-top: auto; padding-top: 0.7rem; color: var(--gm-muted); font-size: 0.9rem; }
.gm-learn-selection { margin-top: 3rem; }
.gm-learn-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1rem; }
.gm-learn-heading h2 { margin: 0 0 0.25rem; }
.gm-learn-heading p { margin: 0; color: var(--gm-muted); }
.gm-learn-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--gm-border); border-radius: 12px; background: var(--gm-surface); color: var(--gm-text); text-decoration: none; }
.gm-learn-card:hover { border-color: var(--gm-accent); text-decoration: none; }
.gm-learn-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--gm-soft); }
.gm-learn-card img[src*="accords-jazz-manouche-poster"] { object-fit: contain; padding: 0.6rem; }
.gm-learn-card > span { display: flex; flex-direction: column; gap: 0.3rem; padding: 1rem 1.2rem; }
.gm-learn-card strong { font-size: 1.08rem; line-height: 1.3; }
.gm-learn-card small { color: var(--gm-muted); }

body.view-category.itemid-1740 .cat-children { margin: 3rem 0 1rem; padding-top: 1.6rem; border-top: 1px solid var(--gm-border); display: flex; align-items: center; flex-wrap: wrap; gap: 0.65rem; }
body.view-category.itemid-1740 .cat-children::before { content: "Explorer par thème"; font-weight: 700; margin-right: 0.55rem; color: var(--gm-text); }
body.view-category.itemid-1740 .cat-children h3 { margin: 0; font-size: 0.95rem; }
body.view-category.itemid-1740 .cat-children h3 a { display: block; text-decoration: none; color: var(--gm-text); padding: 0.6rem 0.95rem; border: 1px solid var(--gm-border); border-radius: 999px; background: var(--gm-surface); }
body.view-category.itemid-1740 .cat-children h3 a:hover { border-color: var(--gm-accent); color: var(--gm-accent); }

/* Guides accords & séries vidéo */
.gm-chapter-guide { max-width: 1200px; margin: auto; color: var(--gm-text); }
.gm-guide-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 280px); gap: 1.5rem; align-items: start; margin: 1.5rem 0; }
.gm-guide-content { min-width: 0; }
.gm-guide-content details { border: 1px solid var(--gm-border); background: var(--gm-surface); border-radius: 12px; margin: 0 0 0.75rem; overflow: hidden; scroll-margin-top: 90px; }
.gm-guide-content summary { font-weight: 700; font-size: 1.1rem; cursor: pointer; padding: 1rem 1.15rem; }
.gm-guide-content details[open] summary { border-bottom: 1px solid var(--gm-border); }
.gm-guide-body { padding: 1rem 1.15rem; line-height: 1.7; }
.gm-guide-body table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.gm-guide-body th, .gm-guide-body td { padding: 0.5rem; border: 1px solid var(--gm-border); text-align: left; }
.gm-guide-body img { max-width: 100%; height: auto; }
.gm-guide-nav { position: sticky; top: 90px; background: var(--gm-surface); border: 1px solid var(--gm-border); border-radius: 12px; padding: 1rem; }
.gm-guide-nav h2 { font-size: 1.05rem; margin: 0 0 0.8rem; }
.gm-guide-nav ol { padding-left: 1.3rem; }
.gm-guide-nav li { margin: 0.55rem 0; }
.gm-guide-nav a { color: var(--gm-text); }
.gm-guide-example { padding: 0.9rem 1rem; border-left: 3px solid var(--gm-accent); background: var(--gm-soft); border-radius: 4px; margin: 1rem 0; }

.gm-harmony-series { max-width: 1200px; margin: 0 auto; color: var(--gm-text); }
.gm-series-shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); gap: 1.4rem; margin: 1.5rem 0 2rem; align-items: start; }
.gm-series-main, .gm-series-program { min-width: 0; }
.gm-series-player { width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px; background: #141414; }
.gm-series-player iframe { border: 0; width: 100%; height: 100%; display: block; }
.gm-series-current { font-size: 1.2rem; font-weight: 700; margin: 1rem 0 0.65rem; }
.gm-series-controls { display: flex; gap: 0.6rem; justify-content: flex-end; }
.gm-series-controls button { border: 1px solid var(--gm-border); border-radius: 8px; background: var(--gm-surface); color: var(--gm-text); padding: 0.55rem 0.9rem; font-weight: 600; }
.gm-series-program { background: var(--gm-surface); border: 1px solid var(--gm-border); border-radius: 12px; padding: 1rem; max-height: 620px; overflow: auto; }
.gm-series-program ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.25rem; }
.gm-series-program a { display: block; padding: 0.65rem 0.7rem; border-radius: 7px; color: var(--gm-text); text-decoration: none; }
.gm-series-program a[aria-current] { background: var(--gm-soft); border-left: 3px solid var(--gm-accent); font-weight: 700; }
.gm-video { width: 100%; aspect-ratio: 16 / 9; }
.gm-video iframe { width: 100%; height: 100%; border: 0; }

.gm-video-course { max-width: 1180px; margin: 0 auto; color: var(--gm-text); }
.gm-video-course-intro { font-size: 1.08rem; line-height: 1.6; max-width: 70ch; color: var(--gm-muted); }
.gm-video-course-meta { display: flex; flex-wrap: wrap; gap: 0.55rem; margin: 1rem 0 1.4rem; }
.gm-video-course-meta span { border: 1px solid var(--gm-border); border-radius: 999px; padding: 0.32rem 0.75rem; font-size: 0.85rem; color: var(--gm-muted); }
.gm-video-course-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); gap: 1.5rem; align-items: start; }
.gm-video-course-player { aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px; background: #111; }
.gm-video-course-player iframe { display: block; width: 100%; height: 100%; border: 0; }
.gm-video-course-side { background: var(--gm-surface); border: 1px solid var(--gm-border); border-radius: 12px; padding: 1.2rem; }

/* ==========================================================================
   5. FORUM KUNENA (Palette unifiée + titres propres sans soulignage permanent)
   ========================================================================== */
@media screen {
    html.gm-shell body.com_kunena #kunena {
        color: var(--gm-text);
        position: relative;
        z-index: 10;
        --bs-body-color: var(--gm-text);
        --bs-body-bg: var(--gm-surface);
        --bs-emphasis-color: var(--gm-text);
        --bs-secondary-color: var(--gm-muted);
        --bs-border-color: var(--gm-line);
        --bs-link-color: var(--gm-accent);
        --bs-link-hover-color: var(--gm-text);
        --gm-forum-user: #245b81;
        --gm-forum-admin: #9b2f2b;
        --gm-forum-moderator: #315d36;
    }
    html.gm-shell[data-gm-theme="dark"] body.com_kunena #kunena {
        color-scheme: dark;
        --gm-forum-user: #9ecbff;
        --gm-forum-admin: #ffb0aa;
        --gm-forum-moderator: #b4dbaa;
    }
    html.gm-shell body.com_kunena #kunena a {
        color: var(--gm-accent);
        text-decoration: none !important;
    }
    html.gm-shell body.com_kunena #kunena a:hover {
        color: var(--gm-text);
        text-decoration: underline !important;
        text-underline-offset: 3px;
    }
    html.gm-shell body.com_kunena #kunena :is(.card, .card-body, .dropdown-menu, .offcanvas, .modal-content, .list-group-item) {
        color: var(--gm-text) !important;
        background-color: var(--gm-surface) !important;
        border-color: var(--gm-line) !important;
    }
    html.gm-shell body.com_kunena #kunena .card {
        border-radius: 12px !important;
        overflow: hidden;
        margin-bottom: 16px;
    }
    html.gm-shell body.com_kunena #kunena :is(.card-header, .card-footer, .bg-faded, .input-group-text) {
        color: var(--gm-text) !important;
        background-color: var(--gm-soft) !important;
        border-color: var(--gm-line) !important;
    }
    html.gm-shell body.com_kunena #kunena .card-header {
        padding: 12px 16px !important;
        font-family: Georgia, "Times New Roman", serif;
    }
    html.gm-shell body.com_kunena #kunena .table,
    html.gm-shell body.com_kunena #kunena .table > :not(caption) > * > * {
        color: var(--gm-text) !important;
        background-color: var(--gm-surface) !important;
        border-color: var(--gm-line) !important;
    }
    html.gm-shell body.com_kunena #kunena :is(.text-muted, .text-body-secondary, .kcat-last, .ksignature) {
        color: var(--gm-muted) !important;
    }
    html.gm-shell body.com_kunena #kunena .navbar {
        color: var(--gm-text) !important;
        background: var(--gm-surface) !important;
        border-color: var(--gm-line) !important;
    }
    html.gm-shell body.com_kunena #kunena :is(.nav-link, .dropdown-item) { color: var(--gm-text) !important; }
    html.gm-shell body.com_kunena #kunena :is(.nav-link.active, .dropdown-item.active) {
        color: var(--gm-accent) !important;
        background-color: var(--gm-selected) !important;
    }
    html.gm-shell body.com_kunena #kunena :is(input.form-control, textarea.form-control, select, .form-select) {
        color: var(--gm-text) !important;
        background-color: var(--gm-bg) !important;
        border-color: var(--gm-line) !important;
    }
    /* Évite le texte coupé dans le sélecteur de catégorie Kunena */
    html.gm-shell body.com_kunena #kunena select.form-select,
    html.gm-shell body.com_kunena #kunena #kcatlist {
        min-width: 260px;
        max-width: 100%;
        padding-right: 2.2rem !important;
    }
    html.gm-shell body.com_kunena #kunena .btn-primary {
        color: var(--gm-accent-ink) !important;
        background-color: var(--gm-accent) !important;
        border-color: var(--gm-accent) !important;
    }
    html.gm-shell body.com_kunena #kunena :is(.btn-light, .btn-secondary, .btn-outline-secondary) {
        color: var(--gm-text) !important;
        background-color: var(--gm-soft) !important;
        border-color: var(--gm-line) !important;
    }
    html.gm-shell[data-gm-theme="dark"] body.com_kunena #kunena :is(.btn-close, .navbar-toggler-icon) {
        filter: brightness(0) invert(1);
    }
}

/* ==========================================================================
   6. RESPONSIVE, BARRE MOBILE, PUPITRE & IMPRESSION
   ========================================================================== */
.gm-mobile-bar { display: none; }

@media (max-width: 1100px) {
    .container-header { grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; padding: 12px 16px; min-height: 68px; }
    .container-header > .grid-child:has(> .navbar-brand) { grid-column: 1; }
    .gm-header-tools { grid-column: 2; order: 1; }
    .gm-mobile-menu-toggle { display: inline-flex; }
    .container-header .container-nav { display: none; grid-column: 1 / -1; order: 2; width: 100%; padding: 12px 0 4px; }
    .container-header.gm-menu-open .container-nav { display: block; }
    .container-header.gm-menu-open .navbar-collapse,
    .container-header.gm-menu-open .navbar-collapse.collapse { display: block !important; height: auto !important; }
    .container-header .mod-menu { flex-direction: column; align-items: stretch; gap: 4px; }
    .container-header .mod-menu > li { flex-wrap: wrap; }
    .container-header .mod-menu > li > a { flex: 1; }
    .container-header .mod-menu ul,
    .container-header .mod-menu.metismenu :is(.mm-collapse, .mm-collapsing) {
        position: static;
        flex-basis: 100%;
        width: 100%;
        max-width: 100%;
        box-shadow: none;
        margin: 4px 0 6px;
        background: var(--gm-bg) !important;
    }
    .gm-site-search { grid-column: 1 / -1; order: 3; }
}

@media (max-width: 800px) {
    .gm-home-feature, .gm-series-shell, .gm-video-course-layout { grid-template-columns: 1fr; }
    .gm-guide-layout { display: flex; flex-direction: column-reverse; }
    .gm-guide-nav { position: static; width: 100%; }
    .gm-home-grid3, .gm-learn-entries, .gm-learn-cards,
    body.view-category:is(.itemid-1369, .itemid-1740, .itemid-1616, .itemid-1617, .itemid-1618) .blog-items {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .gm-home-forum { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 700px) {
    .site-grid > :is(.container-sidebar-left, .container-sidebar-right) { flex-basis: 100%; }
    .container-header .navbar-brand .brand-logo { font-size: 16px; }
    .gm-has-mobile-bar body.site { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
    .gm-mobile-bar {
        position: fixed;
        bottom: 0;
        inset-inline: 0;
        z-index: 1080;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 4px;
        padding: 7px 8px calc(7px + env(safe-area-inset-bottom, 0px));
        background: var(--gm-surface);
        color: var(--gm-text);
        border-top: 1px solid var(--gm-line);
    }
    .gm-mobile-bar a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-height: 44px;
        border-radius: 8px;
        color: var(--gm-muted);
        text-decoration: none;
        font-size: 10.5px;
        font-weight: 600;
    }
    .gm-mobile-bar a[aria-current="page"] { background: var(--gm-selected); color: var(--gm-accent); }
}

@media (max-width: 575px) {
    .gm-home-grid3, .gm-home-grid2, .gm-learn-entries, .gm-learn-cards,
    body.view-category:is(.itemid-1369, .itemid-1740, .itemid-1616, .itemid-1617, .itemid-1618) .blog-items {
        grid-template-columns: 1fr;
    }
}

/* Masque en-tête, footer et barre mobile quand le Mode Pupitre est actif */
@media screen {
    body.com_gmstudio.view-chart > .gm-mobile-bar,
    body.com_gmstudio.view-chart .gm-mobile-bar {
        display: none !important;
    }
    body.com_gmstudio.view-chart {
        padding-bottom: 0 !important;
    }
    body:has(.gm-st-shell.is-pupitre) > .container-header,
    body:has(.gm-st-shell.is-pupitre) > .container-footer,
    body:has(.gm-st-shell.is-pupitre) > .gm-mobile-bar {
        display: none !important;
    }
}

@media print {
    .container-header, .container-footer, .gm-mobile-bar, .back-to-top-link { display: none !important; }
    body.site { padding: 0 !important; background: #fff !important; color: #000 !important; }
    .site-grid { display: block; max-width: none; padding: 0; margin: 0; }
}
