/*!
 * Decroubuzz — compléments au thème News5 (contenu riche, favoris, préchargeur, formulaires).
 */

/* ---------------------------------------------------------------
 * Marque DecrouBuzz (surcharge le thème après main.min.css)
 * ------------------------------------------------------------- */
:root {
    --color-primary: #c50606;
    --color-primary-500: #c50606;
    --color-primary-600: #a00505;
    --color-primary-700: #7a0404;
    --color-brand-violet: #690974;
    --color-brand-yellow: #fbe101;
    --color-brand-black: #080808;
}

/* Titres forts / copyright */
.uc-footer .copyright,
.uni-body h1,
.uni-body .h1 {
    color: var(--color-brand-black);
}
.uc-dark .uc-footer .copyright,
.uc-dark .uni-body h1,
.uc-dark .uni-body .h1 {
    color: inherit;
}

/* Accent jaune (trending, badges) */
.uc-bookmark-toggle[aria-pressed="true"]::after,
.badge-trending,
.post-badge.trending,
.uc-label.trending {
    background-color: var(--color-brand-yellow);
    color: var(--color-brand-black);
}

/* Nav principale (fond clair) — hover violet */
.uc-header .uc-navbar-nav > li > a:hover {
    color: var(--color-brand-violet);
}
.uc-header .uc-navbar-nav > li.uc-active > a {
    color: var(--color-primary);
}

/* Barre catégories (fond rouge) — jamais de rouge/violet sur rouge */
.uc-bottom-navbar,
.uc-bottom-navbar .nav-x,
.uc-bottom-navbar .nav-x a {
    color: #fff !important;
}
.uc-bottom-navbar .nav-x a:hover {
    color: var(--color-brand-yellow) !important;
}
.uc-bottom-navbar .nav-x li.uc-active > a,
.uc-bottom-navbar .nav-x a[aria-current="page"] {
    color: #fff !important;
    box-shadow: inset 0 -3px 0 0 var(--color-brand-yellow);
}

/* ---------------------------------------------------------------
 * Contenu riche des articles et pages (saisi dans l'éditeur)
 * ------------------------------------------------------------- */
.post-content > * + *,
.page-content > * + * {
    margin-top: 1.25rem;
}
.post-content p,
.page-content p {
    margin-bottom: 0;
}
.post-content h2,
.post-content h3,
.post-content h4,
.page-content h2,
.page-content h3,
.page-content h4 {
    margin-top: 2.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.25;
}
.post-content h2, .page-content h2 { font-size: clamp(1.375rem, 1.1rem + 1vw, 1.875rem); }
.post-content h3, .page-content h3 { font-size: clamp(1.25rem, 1.05rem + 0.7vw, 1.5rem); }
.post-content h4, .page-content h4 { font-size: 1.125rem; }
.post-content a:not(.btn),
.page-content a:not(.btn) {
    color: var(--color-primary, #c50606);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.post-content ul,
.post-content ol,
.page-content ul,
.page-content ol {
    padding-left: 1.5rem;
}
.post-content ul,
.page-content ul { list-style: disc; }
.post-content ol,
.page-content ol { list-style: decimal; }
.post-content li + li,
.page-content li + li {
    margin-top: 0.5rem;
}
.post-content blockquote,
.page-content blockquote {
    margin-left: 0;
    margin-right: 0;
    padding: 0.5rem 0 0.5rem 1.5rem;
    border-left: 4px solid var(--color-primary, #c50606);
    font-size: 1.15em;
    font-style: italic;
}
.post-content figure,
.page-content figure {
    margin-left: 0;
    margin-right: 0;
}
.post-content img,
.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}
.post-content figcaption,
.page-content figcaption {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    text-align: center;
    opacity: 0.6;
}
.post-content .align-left,
.page-content .align-left {
    float: left;
    max-width: 50%;
    margin: 0.25rem 1.5rem 1rem 0;
}
.post-content .align-right,
.page-content .align-right {
    float: right;
    max-width: 50%;
    margin: 0.25rem 0 1rem 1.5rem;
}
.post-content .align-center,
.page-content .align-center {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}
.post-content .lead { font-size: 1.2em; font-weight: 500; }
.post-content .highlight { background: rgba(197, 6, 6, 0.08); padding: 1rem 1.25rem; border-radius: 0.5rem; }
.post-content table,
.page-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}
.post-content th,
.post-content td,
.page-content th,
.page-content td {
    padding: 0.6rem 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.1);
    text-align: left;
}
.post-content pre,
.page-content pre {
    padding: 1rem;
    overflow-x: auto;
    border-radius: 0.5rem;
    background: rgba(0, 0, 0, 0.05);
    font-size: 0.875em;
}
.post-content hr { opacity: 0.15; }
.post-content::after { content: ""; display: table; clear: both; }
.uc-dark .post-content th,
.uc-dark .post-content td,
.uc-dark .page-content th,
.uc-dark .page-content td { border-color: rgba(255, 255, 255, 0.15); }
.uc-dark .post-content pre,
.uc-dark .page-content pre { background: rgba(255, 255, 255, 0.06); }
@media (max-width: 575.98px) {
    .post-content .align-left,
    .post-content .align-right {
        float: none;
        max-width: 100%;
        margin: 1rem 0;
    }
}
/* Pas de lettrine sur les pages statiques */
.page-content.post-content p:first-child::first-letter {
    font-size: inherit;
    float: none;
    line-height: inherit;
    margin-right: 0;
}

/* ---------------------------------------------------------------
 * Commentaires
 * ------------------------------------------------------------- */
#blog-comment ol { list-style: none; padding-left: 0; }
#blog-comment ol ol { padding-left: 2.5rem; margin-top: 1.5rem; }
#blog-comment li + li { margin-top: 1.5rem; }
#blog-comment .comment-initial {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 1.5rem;
}

/* ---------------------------------------------------------------
 * Favoris
 * ------------------------------------------------------------- */
.favorites-list { max-height: 50vh; overflow-y: auto; }
.favorites-item { padding: 0.5rem 0; border-bottom: 1px solid rgba(0, 0, 0, 0.08); }
.uc-dark .favorites-item { border-color: rgba(255, 255, 255, 0.1); }
.favorites-thumb { width: 64px; height: 40px; object-fit: cover; flex-shrink: 0; }
.uc-bookmark-toggle[aria-pressed="true"] { color: var(--color-primary, #c50606); }

/* Logos marque (ratio large DecrouBuzz MEDIA) */
.uc-header .uc-logo img.brand-logo {
    width: auto;
    height: 36px;
    max-width: 160px;
    object-fit: contain;
}
@media (min-width: 992px) {
    .uc-header .uc-logo img.brand-logo { height: 40px; max-width: 180px; }
}
.uc-footer img.brand-logo {
    width: auto;
    height: 44px;
    max-width: 180px;
    object-fit: contain;
}
.uc-offcanvas-header .uc-logo img.brand-logo {
    width: auto;
    height: 28px;
    max-width: 140px;
    object-fit: contain;
}

/* ---------------------------------------------------------------
 * FAQ (accordéon)
 * ------------------------------------------------------------- */
.faq-accordion { list-style: none; padding: 0; margin: 0; }
.faq-accordion .uc-accordion-title::after {
    content: "+";
    font-weight: 400;
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.faq-accordion .uc-open > .uc-accordion-title::after { transform: rotate(45deg); }

/* ---------------------------------------------------------------
 * Préchargeur (déplacé depuis le JavaScript pour respecter la CSP)
 * ------------------------------------------------------------- */
.uc-pageloader {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    background-color: #fff;
}
.uc-dark .uc-pageloader { background-color: #131313; }
.uc-pageloader > .loading { display: inline-block; position: relative; width: 40px; height: 40px; }
.uc-pageloader > .loading > div {
    box-sizing: border-box;
    display: block;
    position: absolute;
    width: 40px;
    height: 40px;
    margin: 0;
    border: 4px solid transparent;
    border-radius: 50%;
    animation: uc-loading 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    border-color: var(--color-primary) transparent transparent transparent;
}
.uc-pageloader > .loading > div:nth-child(1) { animation-delay: -0.1s; }
.uc-pageloader > .loading > div:nth-child(2) { animation-delay: -0.2s; }
.uc-pageloader > .loading > div:nth-child(3) { animation-delay: -0.3s; }
@keyframes uc-loading { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
html.show-preloader body { display: none; }

/* ---------------------------------------------------------------
 * Divers
 * ------------------------------------------------------------- */
.pe-none { pointer-events: none !important; }
.pe-auto { pointer-events: auto !important; }
.ad-slot img { display: block; }
.ad-slot iframe { max-width: 100%; }
.alert { padding: 0.75rem 1rem; border-radius: 0.375rem; border: 1px solid transparent; }
.alert-success { color: #0f5132; background-color: #d1e7dd; border-color: #badbcc; }
.alert-danger { color: #842029; background-color: #f8d7da; border-color: #f5c2c7; }
.uc-dark .alert-success { color: #a3cfbb; background-color: rgba(25, 135, 84, 0.15); border-color: rgba(25, 135, 84, 0.3); }
.uc-dark .alert-danger { color: #ea868f; background-color: rgba(220, 53, 69, 0.15); border-color: rgba(220, 53, 69, 0.3); }
