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

/* ===========================================================
   HALIOTIS — reconstitution du template d'origine sur Cassiopeia
   Bleu accent #0088CC · Bleu marine #0A1743
   (surcharge update-safe : media/templates/site/cassiopeia/css/user.css)
   =========================================================== */

:root {
    --hue: 222;
    --template-bg-dark: #0A1743;
    --template-bg-dark-80: #0A1743cc;
    --template-special-color: #0A1743;
    --template-contrast: #0088CC;
    --template-link-color: #0088CC;
    --template-link-hover-color: #006699;
    --link-color: #0088CC;
    --link-hover-color: #006699;
    --template-bg-light: #f5f7fb;
    --hal-box: 1000px;
}

/* -----------------------------------------------------------
   1. Fond de page bleu marine + texture en bas
   ----------------------------------------------------------- */
html {
    background-color: #0b1743;
    font-size: 90%; /* réduit toutes les polices en rem de 10% (sauf menu principal reverrouillé en px) */
}
body.site {
    background-color: #0b1743;        /* couleur de fond du site */
    /* fond1 collé à GAUCHE de la colonne, fond2 collé à DROITE (multiple backgrounds) */
    background-image: url('/images/template/fond1.jpg'), url('/images/template/fond2.jpg');
    background-repeat: no-repeat, no-repeat;
    background-attachment: fixed, fixed;
    background-position: left top, right top;   /* fond1 rempli la marge GAUCHE (plongeur contre la boîte), fond2 la marge DROITE — positionnement déterministe */
    background-size: calc(50% - (var(--hal-box) / 2)) auto,
                     calc(50% - (var(--hal-box) / 2)) auto;   /* largeur = marge dispo -> redimensionné selon la LARGEUR de la fenêtre */
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #333;
    padding-bottom: 40px;
}

/* -----------------------------------------------------------
   2. En-tête Cassiopeia (logo de marque) masqué :
      le vrai en-tête visuel est l'image bandeau (module banner).
   ----------------------------------------------------------- */
header.container-header {
    background-color: transparent !important;
    box-shadow: none !important;
    position: static !important;
    max-width: var(--hal-box);
    margin: 0 auto;
    padding: 0;
}
header.container-header .grid-child .navbar-brand {
    display: none !important;
}
header.container-header > .grid-child:not(.container-nav) {
    display: none !important;
}

/* -----------------------------------------------------------
   3. La boîte blanche centrée = la grille de contenu
   ----------------------------------------------------------- */
.site-grid {
    max-width: var(--hal-box);
    margin: 0 auto;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 6px 30px rgba(0,0,0,0.45);
    /* pas d'overflow:hidden : sinon les menus déroulants seraient coupés */
    grid-template-columns:
        [full-start] 0
        [main-start] minmax(0, 25%) minmax(0, 75%) [main-end]
        0 [full-end] !important;
    column-gap: 0;
    row-gap: 0;
}

/* -----------------------------------------------------------
   4. Bandeau d'en-tête (image), tout en haut de la boîte
   ----------------------------------------------------------- */
.container-banner {
    grid-column: full-start / full-end;
    background: #0A1743;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}
.container-banner .mod-custom,
.container-banner .custom {
    margin: 0;
    padding: 0;
}
.container-banner img {
    display: block;
    width: 100%;
    height: auto;
}

/* -----------------------------------------------------------
   5. Menu principal horizontal (module Main Menu en top-b)
   ----------------------------------------------------------- */
.container-top-b {
    grid-column: full-start / full-end;
    background: #ffffff;            /* barre de menu transparente/blanche comme l'ancien site */
    padding: 4px 10px;
    margin: 0;
    border-bottom: 1px solid #e2e8f0;
}
/* neutraliser le wrapper "card" que Cassiopeia ajoute autour du module menu */
.container-top-b .card,
.container-top-b .top-b,
.container-top-b .card-body {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
}
.container-top-b .card-header { display: none !important; }
.container-top-b .moduletable,
.container-top-b .mod-menu {
    margin: 0;
    padding: 0;
}
.container-top-b ul.mod-menu {
    list-style: none;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;       /* tout sur une seule ligne */
    align-items: center;
    justify-content: flex-start;
    margin: 0;
    padding: 0;
}
.container-top-b ul.mod-menu > li {
    margin: 0;
    padding: 0;
    width: auto !important;
    flex: 0 0 auto;
    border-bottom: 0 !important;
}
.container-top-b ul.mod-menu > li > a,
.container-top-b ul.mod-menu > li > span {
    display: block;
    padding: 7px 11px;                  /* compact pour tenir sur une ligne à 1000px */
    color: #0088CC;                     /* liens bleus sur fond clair, comme l'ancien site */
    text-decoration: none;
    white-space: nowrap;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: -0.1px;
    border-right: 0;
    border-radius: 4px;
    transition: background .15s, color .15s;
}
.container-top-b ul.mod-menu > li > a:hover,
.container-top-b ul.mod-menu > li > span:hover {
    background: #e8f4fb;
    color: #006699;
}
.container-top-b ul.mod-menu > li.current > a,
.container-top-b ul.mod-menu > li.active > a {
    background: #0088CC;                /* item actif = bouton bleu plein, texte blanc */
    color: #fff;
}
/* indicateur ▾ sur les entrées avec sous-menu */
.container-top-b ul.mod-menu > li.parent > a::after,
.container-top-b ul.mod-menu > li.parent > span::after {
    content: " \25BE";
    font-size: 0.7em;
    opacity: 0.7;
}

/* --- SOUS-MENUS DÉROULANTS (au survol), comme le site d'origine --- */
.container-top-b ul.mod-menu > li {
    position: relative;
}
.container-top-b ul.mod-menu .mod-menu__sub {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 230px;
    margin: 0;
    padding: 6px 0;
    background: #f7fafd;                 /* clair doux */
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(10,23,67,0.12);
    z-index: 1000;
    list-style: none;
}
.container-top-b ul.mod-menu > li:hover > .mod-menu__sub,
.container-top-b ul.mod-menu > li:focus-within > .mod-menu__sub {
    display: block;
}
.container-top-b ul.mod-menu .mod-menu__sub > li {
    display: block;
    width: 100%;
}
.container-top-b ul.mod-menu .mod-menu__sub > li > a,
.container-top-b ul.mod-menu .mod-menu__sub > li > span {
    display: block;
    width: 100%;
    padding: 8px 18px;
    color: #0A1743;                      /* texte marine */
    white-space: nowrap;
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;    /* séparateur clair */
    font-weight: 400;
}
.container-top-b ul.mod-menu .mod-menu__sub > li:last-child > a,
.container-top-b ul.mod-menu .mod-menu__sub > li:last-child > span {
    border-bottom: 0;
}
.container-top-b ul.mod-menu .mod-menu__sub > li > a:hover {
    background: #e8f4fb;                  /* fond coloré au survol */
    color: #006699;
    text-decoration: none;               /* pas de souligné */
}

/* --- Reverrouille le MENU PRINCIPAL à sa taille actuelle en px absolus
   pour qu'il ne rétrécisse PAS avec le html { font-size: 90% } global --- */
.container-top-b ul.mod-menu > li > a,
.container-top-b ul.mod-menu > li > span {
    font-size: 13.5px;
}
.container-top-b ul.mod-menu .mod-menu__sub > li > a,
.container-top-b ul.mod-menu .mod-menu__sub > li > span {
    font-size: 13px;
}

/* -----------------------------------------------------------
   6. Colonnes : sidebar gauche + contenu
   ----------------------------------------------------------- */
.container-sidebar-left {
    grid-column: main-start / span 1;
    padding: 18px 14px;
    background: #ffffff;
}
.container-component {
    grid-column: span 1 / main-end;
    padding: 22px 26px;
    background: #ffffff;
}

/* Modules sidebar : boîtes claires avec barre de titre marine, comme l'ancien site */
.container-sidebar-left .card,
.container-sidebar-left .moduletable {
    border: 1px solid #d9e0ea;
    border-radius: 4px;
    margin-bottom: 20px;
    background: #fafbfd;
    overflow: hidden;
}
.container-sidebar-left .card-header,
.container-sidebar-left h3.card-header,
.container-sidebar-left .moduletable > h3,
.container-sidebar-left .card > h3:first-child {
    background: #0A1743;
    color: #fff !important;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 8px 12px;
    margin: 0;
    border-radius: 0;
}
.container-sidebar-left .card-body {
    padding: 12px;
    background: #fafbfd;
}

/* Module "Utilisateur" (login) : champs avec icône, bouton bleu, liens dessous */
.container-sidebar-left .mod-login__userdata input,
.container-sidebar-left input.form-control {
    margin-bottom: 8px;
}
.container-sidebar-left .mod-login__submit .btn,
.container-sidebar-left .btn-primary {
    background: #0088CC;
    border-color: #0088CC;
}
.container-sidebar-left ul.unstyled,
.container-sidebar-left .mod-login ul {
    list-style: none;
    padding-left: 0;
    margin: 10px 0 0;
    font-size: 0.85rem;
}

/* Module "Calendrier" (JEvents latest) : liste compacte avec séparateurs */
.container-sidebar-left .ev_latest_running li,
.container-sidebar-left .jevents li,
.container-sidebar-left .mod-jevents-latest li {
    border-bottom: 1px solid #e2e8f0;
    padding: 6px 0;
    list-style: none;
}
.container-sidebar-left .ev_latest_running ul,
.container-sidebar-left .mod-jevents-latest ul {
    padding-left: 0;
    margin: 0;
}

/* -----------------------------------------------------------
   7. Typographie, liens, titres
   ----------------------------------------------------------- */
h1, h2, h3, h4,
.page-header h1 {
    font-family: 'Open Sans', sans-serif;
    color: #0A1743;
}
a {
    color: #0088CC;
    text-decoration: none;
}
a:hover {
    color: #006699;
    text-decoration: underline;
}
.container-component h1,
.container-component h2,
.com-content-category-blog__title a,
.article-list h2 a,
main h2 a,
main h1 {
    color: #0088CC;
}
.com-content-category-blog__title a:hover,
.article-list h2 a:hover {
    color: #006699;
}

/* Breadcrumbs discrets */
.container-component .mod-breadcrumbs__wrapper {
    background: #f3f5f9;
    border-radius: 4px;
    margin-bottom: 14px;
    font-size: 0.85rem;
}

/* Boutons aux couleurs du club */
.btn-primary {
    --btn-bg: #0088CC;
    --btn-border-color: #0088CC;
    --btn-hover-bg: #006699;
    --btn-hover-border-color: #006699;
    --btn-active-bg: #006699;
    background-color: #0088CC;
    border-color: #0088CC;
}

/* -----------------------------------------------------------
   8. Pied de page marine (si module footer)
   ----------------------------------------------------------- */
.container-footer,
.footer {
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    max-width: 100% !important;
    margin: 0 auto;
    color: #fff;
    text-align: center !important;
    padding: 18px 22px 24px;
}
.container-footer a, .footer a { color: #9fd3f0; }
.container-footer a:hover, .footer a:hover { color: #cfe9f7; }
/* neutraliser le wrapper "card" autour du module footer */
.container-footer .card,
.container-footer .card-body,
.container-footer .moduletable {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.container-footer .card-header { display: none !important; }

/* Pied de page Haliotis : logo FFESSM au-dessus, puis texte/liens, tout centré */
.hal-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #fff;
    font-size: 0.82rem;
    line-height: 1.45;
    text-align: center;
}
.hal-footer-logo { flex: 0 0 auto; }
.hal-footer-logo img { display: block; margin: 0 auto; }
.hal-footer-text { flex: 0 1 auto; text-align: center; max-width: 760px; }
.hal-footer-text p { margin: 0 0 4px; color: #fff; }
.hal-footer-text a { color: #9fd3f0; }
.hal-footer-links { text-align: center; }
.hal-footer-links a { color: #9fd3f0; }
.hal-footer-copy {
    margin: 12px 0 0;
    color: #fff;
    font-size: 0.8rem;
    text-align: center;
}

.back-to-top-link { color: #0088CC; }

/* ============================================================
   MOBILE — rendre le site utilisable sur téléphone (<= 767px)
   ============================================================ */
@media (max-width: 991px) {
    /* Boîte pleine largeur, sans marges ni rayons */
    html, body.site { background-image: none; }
    body.site { padding-bottom: 0; }
    .site-grid, .container-header, .container-banner, .container-top-b,
    .container-footer {
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-radius: 0 !important;
    }
    /* Grille : une seule colonne (annule le 25/75 fixe) */
    .site-grid {
        display: block !important;
        box-shadow: none !important;
        overflow: visible !important;
    }
    .container-banner, .container-top-b,
    .container-component, .container-sidebar-left {
        width: 100% !important;
        grid-column: auto !important;
    }
    .container-component { padding: 16px !important; }
    .container-sidebar-left { padding: 12px !important; }

    /* MENU principal : vertical, pleine largeur, tap-friendly
       (supprime le flex nowrap qui forçait ~800px de large) */
    .container-top-b { border-bottom: 0 !important; }
    .container-top-b ul.mod-menu {
        flex-direction: column !important;
        flex-wrap: wrap !important;
        align-items: stretch !important;
    }
    .container-top-b ul.mod-menu > li {
        width: 100% !important;
        flex: 1 1 100% !important;
        border-bottom: 1px solid #e3e8f0 !important;
    }
    .container-top-b ul.mod-menu > li > a,
    .container-top-b ul.mod-menu > li > span {
        padding: 13px 16px !important;
        font-size: 1rem !important;
        border-right: 0 !important;
    }
    /* Sous-menus : dans le flux (pas en absolu), révélés au tap (focus) */
    .container-top-b ul.mod-menu .mod-menu__sub {
        position: static !important;
        display: none;
        min-width: 0 !important;
        box-shadow: none !important;
        border-top: 0 !important;
        background: #eef2f8 !important;
        padding: 0 !important;
    }
    .container-top-b ul.mod-menu > li:focus-within > .mod-menu__sub,
    .container-top-b ul.mod-menu > li:hover > .mod-menu__sub {
        display: block !important;
    }
    .container-top-b ul.mod-menu .mod-menu__sub > li > a,
    .container-top-b ul.mod-menu .mod-menu__sub > li > span {
        color: #0A1743 !important;
        padding: 11px 30px !important;
        border-bottom: 1px solid #dde4ee !important;
    }
    .container-top-b ul.mod-menu > li.parent > a::after,
    .container-top-b ul.mod-menu > li.parent > span::after { float: right; }

    /* Footer : une colonne, centré, logo au-dessus */
    .container-footer * { float: none !important; }
    .container-footer table, .container-footer tbody,
    .container-footer tr, .container-footer td,
    .container-footer .mod-custom > div { display: block !important; width: 100% !important; }
    .container-footer { text-align: center !important; padding: 16px !important; }
    .container-footer img { display: block; margin: 0 auto 10px !important; }
}

/* ---- Hamburger : caché sur desktop ---- */
.hal-burger { display: none; }
#hal-mnav { position: absolute; left: -9999px; opacity: 0; }

@media (max-width: 991px) {
    /* Réordonner : colonne latérale (connexion + menu) AVANT les articles */
    .site-grid { display: flex !important; flex-direction: column !important; }
    .container-banner      { order: 0 !important; overflow: visible !important; }
    .container-top-b       { order: 1 !important; padding: 0 !important; border-bottom: 0 !important; }
    /* display:contents -> les modules de la colonne deviennent réordonnables individuellement */
    .container-sidebar-left { display: contents !important; }
    .container-sidebar-left > * { order: 2 !important; }   /* connexion + menu utilisateur AU-DESSUS */
    .container-component   { order: 3 !important; }         /* articles */
    .hal-cal               { order: 4 !important; }         /* calendrier SOUS les articles */

    /* Bouton hamburger ☰ Menu (sous le bandeau) */
    .hal-burger {
        display: flex !important; align-items: center; gap: 8px;
        background: #0A1743; color: #fff; font-weight: 600;
        font-family: 'Open Sans', sans-serif; font-size: 1.05rem;
        padding: 13px 16px; cursor: pointer; -webkit-user-select: none; user-select: none;
        border-top: 2px solid #0088CC;
    }
    /* Menu masqué par défaut ; affiché quand la case est cochée */
    .container-top-b ul.mod-menu { display: none !important; }
    .container-banner:has(#hal-mnav:checked) ~ .container-top-b ul.mod-menu { display: flex !important; }

    /* Le menu utilisateur (colonne gauche) reste visible sur mobile */
    .hal-side-nav { display: block !important; }
}

/* ============================================================
   AJUSTEMENTS DEMANDÉS (2026-06-26)
   ============================================================ */
/* Zone centrale +10% (boîte plus large -> moins de marine sur les côtés) */
:root { --hal-box: min(1100px, calc(100vw - 440px)); }  /* colonne = 1100px max, mais rétrécit pour garder ~220px de marge (plongeur) de chaque côté */

/* Coller le menu principal au bandeau (réduire l'espace blanc) */
.container-banner { margin-bottom: 0 !important; }
.container-top-b { margin-top: 0 !important; }

/* Titres d'articles -30% (H1 36px -> ~25px) */
.item-page h1, .com-content-article h1, .page-header h1,
.com-content-category-blog__title, .com-content-category-blog__title a,
main .article-title, .blog .page-header h1, .blog-item > h2, .blog-item > h2 > a {
    font-size: 1.72rem !important;
    line-height: 1.2 !important;
}

/* Icônes d'édition front (news / modules / menus) -50% */
.jmodedit {
    padding: 1px 4px !important;
    font-size: 0.55rem !important;
    line-height: 1 !important;
    transform: scale(0.55);
    transform-origin: top right;
    display: inline-block;
}
.icons .dropdown-toggle, .icons > .btn, .com-content-category-blog__item .icons {
    transform: scale(0.55);
    transform-origin: top right;
}
.jmodedit .icon-edit, .icons .icon-edit { font-size: 9px !important; }

/* -----------------------------------------------------------
   8. Menu utilisateur (sidebar gauche, usermenu) — compact + séparateurs
   ----------------------------------------------------------- */
/* Espacement resserré entre les éléments */
.container-sidebar-left .hal-side-nav.mod-menu,
.container-sidebar-left .hal-side-nav .mod-menu__item {
    margin: 0;
}
.container-sidebar-left .hal-side-nav .mod-menu__link,
.container-sidebar-left .hal-side-nav .mod-menu__item > a {
    padding-top: 2px;
    padding-bottom: 2px;
    line-height: 1.25;
}

/* Séparateurs : ne pas afficher le texte "--", juste un espace */
.container-sidebar-left .hal-side-nav .mod-menu__separator,
.container-sidebar-left .hal-side-nav .separator {
    display: block;
    font-size: 0;          /* masque le libellé "--" */
    line-height: 0;
    padding: 0;
    margin: 0;
    height: 8px;           /* l'espace qui remplace le "--" */
    border: 0;
}

/* -----------------------------------------------------------
   9. Page "Gestion des adhérents" (com_adherents) : pleine largeur
   ----------------------------------------------------------- */
body.com_adherents .site-grid { max-width: 100%; }
body.com_adherents .container-sidebar-left { display: none; }
body.com_adherents .container-component {
    grid-column: main-start / main-end;
    padding: 16px 20px;
}

/* com_adherents : bannière à sa taille d'origine (1000px) et centrée, malgré la page pleine largeur */
body.com_adherents .container-banner { text-align: center; background: #0A1743; }
body.com_adherents .container-banner img { width: var(--hal-box) !important; max-width: 100% !important; margin: 0 auto !important; }

/* com_adherents : bannière retirée sur cette page */
body.com_adherents .container-banner { display: none !important; }

/* Mobile : menu utilisateur (colonne gauche) repliable au tap sur le titre */
@media (max-width: 991px) {
    .hal-usermenu-toggle { cursor: pointer; position: relative; }
    .hal-usermenu-toggle::after { content: '\25BE'; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); transition: transform .2s; }
    .hal-usermenu-toggle.open::after { transform: translateY(-50%) rotate(180deg); }
    .hal-side-nav .hal-usermenu-collapsed { display: none !important; }
}

/* ============================================================
   AJUSTEMENTS DEMANDÉS (2026-06-27)
   ============================================================ */
/* Accueil (blog catégorie 8) : chaque article dans un cadre avec fond léger,
   empilés les uns sous les autres (1 seule colonne -> réglé aussi côté menu) */
.com-content-category-blog .com-content-category-blog__item,
.com-content-category-blog .blog-item {
    border: 1px solid #d9e0ea;
    background: #f5f7fb;            /* fond léger */
    border-radius: 6px;
    padding: 18px 22px;
    margin-bottom: 22px;
    box-shadow: 0 1px 3px rgba(10,23,67,0.06);
}
/* Pas de marge basse superflue sur le dernier élément interne de l'article */
.com-content-category-blog .com-content-category-blog__item > :last-child {
    margin-bottom: 0;
}
/* Forcer l'empilage vertical (sécurité, au cas où une classe colonnes subsisterait) */
.com-content-category-blog .blog-items.columns-2,
.com-content-category-blog .blog-items.columns-3,
.com-content-category-blog .blog-items[class*="masonry-"] {
    display: block !important;
    column-count: 1 !important;
    grid-template-columns: 1fr !important;
}

/* ============================================================
   MOBILE — menu utilisateur accessible depuis la DROITE de la
   barre du menu principal (2026-06-27)
   ============================================================ */
/* Desktop : second bouton + sa case masqués */
.hal-userburger { display: none; }
#hal-unav { position: absolute; left: -9999px; opacity: 0; }

@media (max-width: 991px) {
    /* La barre contient les 2 boutons : "☰ Menu" à gauche, "Mon espace" à droite */
    .hal-bar {
        display: flex !important;
        align-items: stretch;
        justify-content: space-between;
        border-top: 2px solid #0088CC;
    }
    /* le liseré bleu est désormais porté par .hal-bar */
    .hal-burger, .hal-userburger { border-top: 0 !important; }

    /* Bouton droit "👤 Mon espace" (même style que le hamburger) */
    .hal-userburger {
        display: flex !important;
        align-items: center;
        gap: 8px;
        background: #0A1743;
        color: #fff;
        font-weight: 600;
        font-family: 'Open Sans', sans-serif;
        font-size: 1.05rem;
        padding: 13px 16px;
        cursor: pointer;
        -webkit-user-select: none;
        user-select: none;
    }
    /* Pas de menu utilisateur (visiteur non connecté) -> pas de bouton */
    .site-grid:not(:has(.hal-side-nav)) .hal-userburger { display: none !important; }

    /* Le menu utilisateur est caché par défaut et ouvert par le bouton de droite.
       (remplace l'ancien repli par tap sur le titre, désormais inutile) */
    .hal-side-nav { display: none !important; }
    .hal-side-nav .card-header { display: none !important; }
    .site-grid:has(#hal-unav:checked) .hal-side-nav {
        display: block !important;
        order: 1 !important;                 /* s'ouvre juste sous la barre */
        width: min(280px, 82vw) !important;
        margin-left: auto !important;        /* panneau aligné à DROITE */
        margin-bottom: 8px !important;
    }
    .site-grid:has(#hal-unav:checked) .hal-side-nav .card-body { display: block !important; }
}
