Modèle:Card/styles.css
De Nefald
Autres actions
/* =============================================================================
HOME CARD COMPONENT
Composant de carte stylisé pour affichage de contenu avec image
Compatible dark/light mode avec Citizen skin
============================================================================= */
/* -----------------------------------------------------------------------------
STRUCTURE DE BASE
----------------------------------------------------------------------------- */
.home-card {
/* Layout */
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
/* Style */
background: var(--color-surface-1);
border: 1px solid var(--border-color-base, rgba(0, 0, 0, 0.1));
border-radius: 12px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
/* Animation */
transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
.home-card:hover {
transform: translateY(-4px);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
border-color: var(--color-progressive, #36c);
}
/* Dark mode - Card base */
.skin-theme-clientpref-night .home-card {
border-color: var(--border-color-subtle, rgba(255, 255, 255, 0.1));
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.skin-theme-clientpref-night .home-card:hover {
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
}
/* -----------------------------------------------------------------------------
IMAGE - Section supérieure PLEINE LARGEUR
----------------------------------------------------------------------------- */
.home-card__image {
position: relative;
width: 100%;
height: 250px;
flex-shrink: 0;
overflow: hidden;
margin: 0;
padding: 0;
background: var(--color-surface-2);
display: flex;
align-items: center;
justify-content: center;
}
/* Forcer TOUS les éléments MediaWiki à être en pleine largeur */
.home-card__image * {
margin: 0 !important;
padding: 0 !important;
border: none !important;
background: transparent !important;
}
.home-card__image .thumb,
.home-card__image .thumbinner,
.home-card__image .thumbcaption,
.home-card__image .magnify {
display: block !important;
width: 100% !important;
height: 100% !important;
max-width: none !important;
}
/* L'image elle-même */
.home-card__image img {
display: block !important;
width: 100% !important;
height: 100% !important;
max-width: none !important;
max-height: none !important;
object-fit: cover !important;
transition: transform 0.3s ease;
}
.home-card:hover .home-card__image img {
transform: scale(1.05);
}
/* Liens autour de l'image */
.home-card__image a {
display: block !important;
width: 100% !important;
height: 100% !important;
line-height: 0 !important;
}
/* Cacher les légendes et icônes de zoom */
.home-card__image .thumbcaption,
.home-card__image .magnify {
display: none !important;
}
/* -----------------------------------------------------------------------------
BADGE - Overlay sur l'image
----------------------------------------------------------------------------- */
.home-card__badge {
/* Position */
position: absolute;
top: 12px;
right: 12px;
z-index: 10;
/* Style */
background: var(--color-progressive, #36c);
color: #fff;
padding: 6px 12px;
border-radius: 6px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
/* Typography */
font-size: 0.75rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
}
/* Dark mode - Badge */
.skin-theme-clientpref-night .home-card__badge {
background: var(--color-progressive, #4d90fe);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
/* -----------------------------------------------------------------------------
CONTENT - Zone de texte
----------------------------------------------------------------------------- */
.home-card__content {
/* Layout */
display: flex;
flex-direction: column;
flex-grow: 1;
gap: 12px;
padding: 24px;
}
/* -----------------------------------------------------------------------------
TITLE - Titre principal
----------------------------------------------------------------------------- */
.home-card__title {
margin: 0;
font-size: 1.5rem;
font-weight: 600;
line-height: 1.3;
color: var(--color-emphasized, #000);
}
.home-card__title a {
color: inherit;
text-decoration: none;
transition: color 0.2s ease;
}
.home-card__title a:hover {
color: var(--color-progressive, #36c);
}
/* Dark mode - Title */
.skin-theme-clientpref-night .home-card__title {
color: var(--color-emphasized, #fff);
}
/* -----------------------------------------------------------------------------
SUBTITLE - Sous-titre
----------------------------------------------------------------------------- */
.home-card__subtitle {
margin: 0;
font-size: 0.95rem;
line-height: 1.5;
color: var(--color-subtle, #666);
}
/* Dark mode - Subtitle */
.skin-theme-clientpref-night .home-card__subtitle {
color: var(--color-subtle, #aaa);
}
/* -----------------------------------------------------------------------------
TEXT - Corps de texte (supporte wikitext)
----------------------------------------------------------------------------- */
.home-card__text {
margin: 0;
line-height: 1.6;
flex-grow: 1;
color: var(--color-base, #202122);
}
/* Dark mode - Text */
.skin-theme-clientpref-night .home-card__text {
color: var(--color-base, #eee);
}
/* Paragraphes dans le texte */
.home-card__text p:first-child {
margin-top: 0;
}
.home-card__text p:last-child {
margin-bottom: 0;
}
/* Listes dans le texte */
.home-card__text ul,
.home-card__text ol {
margin: 8px 0;
padding-left: 20px;
}
/* Liens dans le texte */
.home-card__text a {
color: var(--color-progressive, #36c);
text-decoration: none;
}
.home-card__text a:hover {
text-decoration: underline;
}
/* Dark mode - Links */
.skin-theme-clientpref-night .home-card__text a {
color: var(--color-progressive, #4d90fe);
}
/* =============================================================================
GRILLES - Layouts multiples
============================================================================= */
.home-cards-grid,
.home-cards-grid-1,
.home-cards-grid-2,
.home-cards-grid-3 {
display: grid;
gap: 24px;
margin: 24px 0;
width: 100%;
}
/* Auto-responsive (défaut) */
.home-cards-grid {
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
/* Layouts fixes */
.home-cards-grid-1 {
grid-template-columns: 1fr;
max-width: 600px;
margin-left: auto;
margin-right: auto;
}
.home-cards-grid-2 {
grid-template-columns: repeat(2, 1fr);
}
.home-cards-grid-3 {
grid-template-columns: repeat(3, 1fr);
}
/* =============================================================================
RESPONSIVE - Adaptation mobile
============================================================================= */
@media (max-width: 1024px) {
.home-cards-grid-3 {
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 768px) {
.home-cards-grid,
.home-cards-grid-2,
.home-cards-grid-3 {
grid-template-columns: 1fr;
gap: 16px;
}
.home-card__image {
height: 200px;
}
.home-card__content {
padding: 16px;
}
.home-card__title {
font-size: 1.25rem;
}
}
@media (max-width: 480px) {
.home-card__image {
height: 180px;
}
}
/* =============================================================================
RESPONSIVE
============================================================================= */
/* Tablet et mobile */
@media (max-width: 768px) {
.home-cards-grid {
grid-template-columns: 1fr;
gap: 16px;
}
.home-card__image {
height: 200px;
}
.home-card__content {
padding: 16px;
}
.home-card__title {
font-size: 1.25rem;
}
}
/* Petit mobile */
@media (max-width: 480px) {
.home-card__image {
height: 180px;
}
}
/* =============================================================================
LAYOUT AVEC ESPACEMENT VERTICAL RÉDUIT
============================================================================= */
.home-layout-with-sidebar {
display: grid;
grid-template-columns: 1fr 300px;
gap: 8px; /* ← ESPACE HORIZONTAL réduit */
margin: 8px 0; /* ← MARGES VERTICALES réduites */
width: 100%;
align-items: start;
}
/* Colonne principale (gauche) */
.home-main-content {
display: flex;
flex-direction: column;
gap: 8px; /* ← ESPACE VERTICAL entre sections réduit */
}
/* Sidebar (droite) */
.home-sidebar {
position: sticky;
top: 10px; /* ← Position sticky plus basse */
display: flex;
flex-direction: column;
gap: 8px; /* ← ESPACE entre cards sidebar réduit */
}
/* Grilles avec espacement minimal */
.home-cards-grid-1,
.home-cards-grid-2 {
display: grid;
gap: 8px; /* ← ESPACE entre cards réduit */
width: 100%;
}
.home-cards-grid-1 {
grid-template-columns: 1fr;
}
.home-cards-grid-2 {
grid-template-columns: repeat(2, 1fr);
}
/* =============================================================================
RÉDUCTION DES MARGES INTERNES DES CARDS
============================================================================= */
/* Si les cards ont trop de padding interne */
.home-card-compact .home-card__content {
padding: 8px !important; /* ← Padding interne réduit */
}
.home-card-compact .home-card__image {
height: 150px !important; /* ← Hauteur image réduite */
margin-bottom: 4px !important;
}
.home-card-compact .home-card__title {
margin-bottom: 4px !important;
font-size: 1rem !important;
}
/* =============================================================================
RESPONSIVE
============================================================================= */
@media (max-width: 1024px) {
.home-layout-with-sidebar {
grid-template-columns: 1fr;
gap: 6px;
margin: 6px 0;
}
.home-sidebar {
position: static;
order: -1;
gap: 6px;
}
.home-main-content {
gap: 6px;
}
}
@media (max-width: 768px) {
.home-cards-grid-2 {
grid-template-columns: 1fr;
gap: 6px;
}
.home-layout-with-sidebar,
.home-main-content {
gap: 6px;
margin: 4px 0;
}
}
/* DEBUG ESPACEMENT */
.home-layout-with-sidebar > * {
outline: 2px solid red !important;
}
.home-main-content > * {
outline: 2px solid blue !important;
}
.home-sidebar > * {
outline: 2px solid green !important;
}
.home-cards-grid-2 > * {
outline: 1px dashed orange !important;
}