Modèle:Header/styles.css
De Nefald
Autres actions
/* =============================================================================
HEADER COMPONENT — Pleine largeur + clic global sans :has()
============================================================================ */
/* 1) Pleine largeur dans la colonne de contenu */
.mw-parser-output > .home-header {
display: block;
width: 100% !important;
max-width: none !important;
margin-left: 0 !important;
margin-right: 0 !important;
box-sizing: border-box;
}
/* Variante “bleed” (débord) pour Vector 2022 : étire dans la colonne */
.skin-vector-2022 .mw-parser-output > .home-header.home-header--bleed {
margin-left: -24px !important;
margin-right: -24px !important;
border-radius: 10px;
}
/* 2) Bloc principal */
.home-header {
position: relative; /* nécessaire pour l’overlay cliquable */
display: flex;
flex-direction: column;
gap: 6px;
min-height: 70px;
padding: 16px 20px;
background: var(--color-surface-1, #f8f9fa);
color: var(--color-base, #202122);
border: 1px solid rgba(0,0,0,0.08);
border-radius: 12px;
box-shadow: 0 2px 4px rgba(0,0,0,0.08);
transition: box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}
/* 3) Overlay cliquable qui couvre 100% du header quand link est défini */
.home-header__overlay {
position: absolute;
inset: 0; /* top/right/bottom/left: 0 */
display: block;
/* l’élément est dans un [[link|<span>]] : il devient cliquable */
background: transparent;
/* Ne gêne pas le focus du lien visible en bas */
z-index: 1;
}
/* 4) Rendre visuellement “cliquable” quand un lien est présent */
.home-header--has-link {
cursor: pointer;
}
.home-header--has-link:hover {
box-shadow: 0 4px 8px rgba(0,0,0,0.15);
transform: translateY(-1px);
}
/* 5) Contenu interne */
.home-header__content {
position: relative;
z-index: 2; /* au-dessus de l’overlay */
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px 14px;
}
/* Badges, titres, textes */
.home-header__badge {
display: inline-block;
padding: 6px 10px;
font-weight: 700;
font-size: 0.78rem;
line-height: 1;
color: #fff;
background: #1a73e8;
border-radius: 999px;
letter-spacing: .02em;
}
.home-header__title {
font-weight: 700;
font-size: 1.15rem;
}
.home-header__subtitle {
color: var(--color-subtle, #54595d);
font-size: .95rem;
}
.home-header__text {
color: var(--color-subtle, #54595d);
font-size: .92rem;
}
/* Lien visible “En savoir plus” */
.home-header__link-wrapper {
margin-left: auto; /* pousse le lien à droite */
}
.home-header__link {
color: var(--color-progressive, #36c);
text-decoration: none;
font-weight: 600;
white-space: nowrap;
transition: color .2s ease;
}
.home-header__link-wrapper:hover .home-header__link,
.home-header--has-link:hover .home-header__link {
color: var(--color-progressive--hover, #2a4b8d);
text-decoration: underline;
}
/* 6) Dark mode (Vector 2022 Client Preferences) */
.skin-theme-clientpref-night .home-header {
background: #11181f;
color: #e6edf3;
border-color: rgba(255,255,255,0.08);
box-shadow: 0 2px 4px rgba(0,0,0,0.35);
}
.skin-theme-clientpref-night .home-header__subtitle,
.skin-theme-clientpref-night .home-header__text {
color: #9fb1c1;
}
.skin-theme-clientpref-night .home-header__badge {
background: #0b6efd;
}
.skin-theme-clientpref-night .home-header--has-link:hover {
box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}
/* 7) Responsive */
@media (max-width: 768px) {
.home-header { padding: 14px 16px; min-height: 80px; }
.home-header__content { gap: 10px 12px; }
.home-header__title { font-size: 1.02rem; }
.home-header__subtitle,
.home-header__text,
.home-header__link { font-size: .88rem; }
}
@media (max-width: 480px) {
.home-header { padding: 12px 14px; min-height: 90px; }
.home-header__badge,
.home-header__title,
.home-header__subtitle,
.home-header__text,
.home-header__link-wrapper { flex-basis: 100%; }
.home-header__text { display: none; }
.home-header__link-wrapper { margin-left: 0; text-align: right; }
}
/* 8) Sécurité : reset des liens dans le composant (couleur héritée) */
.home-header a,
.home-header a:visited {
color: inherit;
}