/* ============================================= */
/* === TYPOGRAPHIE GLOBALE === */
/* ============================================= */
* {
    font-size: 14px !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Text",
                 "SF Pro Display", "Helvetica Neue", Arial, sans-serif !important;
}

/* ============================================= */
/* === FOND GÉNÉRAL : IMAGE DE FOND === */
/* ============================================= */
html, body, #app {
    background-color: transparent !important;
    background-image: url('/assets/background.jpg') !important;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
}

.content-bounds {
    padding: 0 20px!important;
    max-width: unset !important;
}

/* ============================================= */
/* === WIDGETS : FOND BLANC + HEADER BLEU === */
/* ============================================= */
.widget {
    border-radius: 6px !important;
    padding: 0 !important;
    margin-bottom: 10px !important;
    overflow: hidden !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15) !important;
}

.widget:hover {
    border-color: #b0b5bf !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.20) !important;
}

/* === HEADER BLEU VIF === */
.widget-header {
    background: linear-gradient(90deg, #1a6fd4 0%, #1560bb 100%) !important;
    padding: 6px 12px !important;
    margin: 0 !important;
    border-bottom: none !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.widget-header h2,
.widget-header .widget-title {
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    margin: 0 !important;
    letter-spacing: 0.01em !important;
}

.widget-header img,
.widget-header .widget-icon {
    width: 16px !important;
    height: 16px !important;
    opacity: 0.95 !important;
}

/* ============================================= */
/* === ARTICLES RSS === */
/* ============================================= */

/* Titre de l'article */
.widget-type-rss .list-item-title,
.widget-type-rss a {
    color: var(--color-text-base) !important;
    font-size: 15px !important;
    line-height: 1.3 !important;
    text-decoration: none !important;
}

/* Articles lus : grisés */
.widget-type-rss a:visited,
.widget-type-rss a.visited\:color-subdue,
.widget-type-custom-api .list-item a:visited {
    color: var(--color-text-subdue) !important;
}

.widget-type-rss a:hover {
    color: #1a6fd4 !important;
    text-decoration: underline !important;
}

/* === MASQUER SOURCE ET HEURE === */
.widget-type-rss .list-item-source,
.widget-type-rss .source,
.widget-type-rss .list-horizontal-text,
.widget-type-rss li[data-dynamic-relative-time],
.widget-type-rss [data-dynamic-relative-time] {
    display: none !important;
}

/* Items */
.widget-type-rss ul,
.widget-type-rss li {
    margin: 0 !important;
    padding: 0 !important;
    border-bottom: 1px dashed rgba(128, 128, 128, 0.4) !important;
}

.widget-type-rss .list-item {
    padding: 5px 10px !important;
    margin: 0 !important;
    border-bottom: 1px dashed rgba(128, 128, 128, 0.4) !important;
    min-height: auto !important;
}

.widget-type-rss .list-item:last-child {
    border-bottom: none !important;
}

.widget-type-rss .list-item:hover {
    background-color: rgba(128, 128, 128, 0.15) !important;
}

.widget-type-rss .list-item-content {
    margin: 0 !important;
    padding: 0 !important;
}

.widget-type-rss .list-item-title {
    margin: 0 !important;
    line-height: 1.3 !important;
}

/* ============================================= */
/* === BARRE DE RECHERCHE === */
/* ============================================= */
.widget-type-search input,
.widget-type-search [type="search"],
.widget-type-search [type="text"] {
    background-color: #ffffff !important;
    border: 1px solid #d0d3d9 !important;
    color: #1a1c1f !important;
    border-radius: 4px !important;
    padding: 6px 12px !important;
}

.widget-type-search kbd.hide-on-mobile {
    display: none !important;
}

.widget-type-search input::placeholder {
    color: #aab0bb !important;
}

.search-input {
    height: 1.5em !important;
}

/* ============================================= */
/* === COULEURS GÉNÉRALES === */
/* ============================================= */
/* IMPORTANT : on ne force plus body/.color-text-base sur une couleur fixe.
   C'était la cause du bug d'affichage en thème sombre : le texte restait
   noir (#1a1c1f) même quand le fond du widget devenait sombre, donc
   illisible. On laisse Glance gérer cette couleur via --color-text-base,
   qui s'adapte automatiquement au thème clair/sombre choisi. */

.color-subdue, .color-text-subdue {
    color: var(--color-text-subdue) !important;
}

.color-primary, .color-highlight {
    color: var(--color-primary) !important;
}

/* ============================================= */
/* === SCROLLBAR === */
/* ============================================= */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c5c9d0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aab0bb; }

/* ============================================= */
/* === NAVIGATION / ONGLETS === */
/* ============================================= */
nav, .tabs, [class*="tab"] {
    background-color: var(--color-widget-background) !important;
    border-bottom: 1px solid var(--color-border) !important;
}

[class*="tab"]:hover,
[class*="tab"].active,
[class*="tab"][aria-selected="true"] {
    color: var(--color-primary) !important;
}
/* Fige la hauteur du contenu RSS avec scroll 
.widget-type-rss .widget-content,
.widget-type-rss .padding-inline-widget {
    max-height: 400px !important;
    overflow-y: auto !important;
}
    */

@media (max-width: 1190px) {
    .header-content {
        display: block !important;
    }
}
/* ============================================= */
/* === FIX DYNACAT : cartes blanches (rendu Glance) === */
/* ============================================= */
/* Dynacat pilote son thème via l'attribut data-scheme="light" sur
   <html> (moteur natif, toutes les couleurs sont calculées via une
   formule qui s'inverse selon cet attribut). En forçant nos couleurs
   en dur SANS condition, on écrasait ce mécanisme et le sélecteur
   clair/sombre ne changeait plus que la barre de nav (seul élément
   qu'on n'avait pas hardcodé). On conditionne donc le fond blanc au
   mode clair uniquement ; en mode sombre, aucune règle ne s'applique
   et Dynacat retrouve son rendu natif (cartes sombres avec bordure
   subtile sur l'image de fond). */
:root[data-scheme="light"] .widget > .widget-content:not(.widget-content-frameless),
:root[data-scheme="light"] .widget > .widget-content-frame {
    background: #ffffff !important;
    border: none !important;
    box-shadow: none !important;

    /* Texte sombre à l'intérieur des cartes blanches (mode clair) */
    --color-text-base: #1a1c1f;
    --color-text-highlight: #000000;
    --color-text-subdue: #6b7280;
    --color-text-paragraph: #374151;
    --color-border: #e5e7eb;
    --color-widget-background-highlight: #eef2f7;
    --color-primary: #1a6fd4;

    color: #1a1c1f;
}

/* ============================================= */
/* === WIDGET RELEASES : espacement réduit === */
/* ============================================= */
/* Le widget releases utilise .list-gap-10 (--list-half-gap: 0.5rem,
   soit 1rem entre les lignes). On réduit cet espacement pour
   compacter la liste des dernières versions. Ajuster 0.15rem selon
   le rendu voulu (0 = lignes collées, 0.5rem = valeur d'origine). */
.widget-type-releases .list {
    --list-half-gap: 0.15rem !important;
}