/* Harmonisation des pages avec le header et le fond V5.
   Tout est prefixe par html:has(.bg5) : l'archive /header-classic (LegacyLayout, sans fond V5)
   garde exactement l'ancien rendu. Quelques !important : ils ne visent que les couleurs de
   boutons et de focus que dark-theme.css impose avec des selecteurs tres specifiques. */

html:has(.bg5){
    --v5-lime: #BFD641;
    --v5-lime-ink: #5f6f12;
    --v5-pink: #BC70A4;
    --v5-ink: #1d1a24;
    --v5-night: #0c0d12;
}

/* ------------------------------------------------ titres de page : la voix de la home */
html:has(.bg5) body .col-md-8 h1:not(.visually-hidden):not(main.h4 *){
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 400;
    letter-spacing: -.01em;
}

/* ------------------------------------------------ bandeau degrade sous l'ancienne barre */
/* Il prolongeait la barre de menu d'avant ; sous la barre collante, il faisait doublon. */
html:has(.bg5) .brand-accent-bar{ display: none; }

/* ------------------------------------------------ bouton principal */
html:has(.bg5) body .btn.btn-gin-primary{
    background: var(--v5-lime) !important;
    border-color: var(--v5-lime) !important;
    color: var(--v5-ink) !important;
    border-radius: 999px;
    font-weight: 700;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
html:has(.bg5) body .btn.btn-gin-primary:hover,
html:has(.bg5) body .btn.btn-gin-primary:focus-visible{
    transform: translateY(-1px);
    box-shadow: 0 8px 20px -10px rgba(140, 160, 30, .9) !important;
    filter: brightness(1.03);
}
html:has(.bg5) body .btn.btn-gin-primary:disabled,
html:has(.bg5) body .btn.btn-gin-primary.disabled{
    opacity: .55;
    transform: none;
    box-shadow: none !important;
}

/* ------------------------------------------------ champs : anneau de focus citron vert */
html:has(.bg5) body .form-control:focus,
html:has(.bg5) body .form-select:focus,
html:has(.bg5) body .form-check-input:focus{
    border-color: rgba(95, 111, 18, .55) !important;
    box-shadow: 0 0 0 .2rem rgba(191, 214, 65, .3) !important;
}
html[data-theme="dark"]:has(.bg5) body .form-control:focus,
html[data-theme="dark"]:has(.bg5) body .form-select:focus{
    border-color: rgba(191, 214, 65, .6) !important;
}
html:has(.bg5) body .form-check-input:checked{
    background-color: var(--v5-lime-ink) !important;
    border-color: var(--v5-lime-ink) !important;
}

/* ------------------------------------------------ menus deroulants Bootstrap */
html:has(.bg5) body .dropdown-menu{
    border-radius: 14px;
    border-color: rgba(29, 26, 36, .1);
    box-shadow: 0 20px 44px -22px rgba(40, 20, 40, .45);
    padding: 6px;
}
html:has(.bg5) body .dropdown-item{ border-radius: 9px; }
html:has(.bg5) body .dropdown-item:active,
html:has(.bg5) body .dropdown-item.active{ background-color: var(--v5-lime) !important; color: var(--v5-ink) !important; }

/* ------------------------------------------------ selection de texte */
html:has(.bg5) ::selection{ background: rgba(191, 214, 65, .45); color: inherit; }

/* ------------------------------------------------ bouton d'edition admin des cartes */
/* Dans les cartes de gins et de tonics, le bouton admin n'affichait qu'un « e ». Il devient un
   petit crayon rond, comme sur les cartes des nouveautes. Limite aux rangees d'actions des
   cartes : ailleurs (pages admin, anciennes homes) la meme classe porte un vrai libelle. */
html:has(.bg5) :is(.gin-card-actions, .tonic-card-actions) .btn-edit-home{
    display: inline-grid; place-items: center;
    width: 32px; height: 32px; padding: 0;
    border: 1px solid rgba(29, 26, 36, .14); border-radius: 50%;
    background: #fff;
    font-size: 0; line-height: 0; color: #6b6276;
    text-decoration: none;
}
html:has(.bg5) :is(.gin-card-actions, .tonic-card-actions) .btn-edit-home::before{
    content: "\f303";
    font: 900 13px/1 "Font Awesome 6 Free";
}
html:has(.bg5) :is(.gin-card-actions, .tonic-card-actions) .btn-edit-home:hover{ border-color: #9fb52a; color: #5f6f12; }
html[data-theme="dark"]:has(.bg5) :is(.gin-card-actions, .tonic-card-actions) .btn-edit-home{
    background: rgba(255, 255, 255, .06); border-color: rgba(245, 240, 246, .16); color: #b9b1c2;
}

/* ------------------------------------------------ cartes de tonics : la note deborde */
/* Cinq etoiles + « Pas encore note » ne tenaient pas sur une ligne et sortaient de la carte. */
html:has(.bg5) .tonic-card-rating{
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
    gap: 2px;
}
html:has(.bg5) .tonic-card-rating > span{
    flex-basis: 100%;
    margin: 3px 0 0 !important;
    text-align: center;
}

/* ------------------------------------------------ articles : intertitres dans la voix du titre */
html:has(.bg5) body .news-details__content :is(h2, h3){
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 400;
    letter-spacing: -.005em;
}
