/* ============================================
   POLICES ET VARIABLES
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@700;900&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #621708;
    --primary-light: #8B2F1F;
    --background: #f7f2ea;
    --card-shadow: 0 4px 6px rgba(52, 33, 5, 0.1);
    --card-shadow-hover: 0 8px 16px rgba(52, 33, 5, 0.15);
    
    /* Typographie */
    --font-display:  'Inter', sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;
}

/* ============================================
   STYLES DE BASE
   ============================================ */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   HIÉRARCHIE TYPOGRAPHIQUE
   ============================================ */

/* Titres de sections (Radio-Canada, Le Devoir) */
h2 {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 2rem; /* 32px */
    line-height: 1.2;
    color: var(--primary);
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
}

/* Titres d'articles dans les cartes */
.article-card h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem; /* 22px */
    line-height: 1.3;
    color: #1a1a1a;
    margin-top: 1rem;
    transition: color 0.2s ease;
}

.article-card h3:hover {
    color: var(--primary);
}

/* Corps de texte */
p, li {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: #333;
}

/* Petits textes (dates, métadonnées) */
.text-xs, small {
    font-family: var(--font-body);
    font-size: 0.9rem; /* 13px */
}

/* Accordéons */
.accordion button {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
}

/* ============================================
   CARTES D'ARTICLES
   ============================================ */
.article-card {
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: var(--card-shadow);
    will-change: transform;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
}

.article-card .p-6 {
    padding: 2rem;
}

.article-card .text-xs {
    display: inline-block;
    margin-bottom: 0.75rem;
}

.article-card h3 {
    margin-top: 0.5rem;
    margin-bottom: 0;
}

.article-card .mt-4 {
    margin-top: 1.5rem;
}

.article-image {
    aspect-ratio: 16/9;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-card:hover .article-image {
    transform: scale(1.02);
}

/* ============================================
   BADGES ET MÉTADONNÉES
   ============================================ */

/* Badge de date */
.article-card .date-badge {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.75rem; /* 12px */
    letter-spacing: 0.02em;
    padding: 0.2rem 0.5rem;
    background-color: #f7f2ea;
    color: rgb(50, 50, 50);
    border-radius: 4px;
}

/* ============================================
   ACCORDÉONS
   ============================================ */
.accordion-icon {
    transition: transform 0.5s ease;
    flex-shrink: 0;
}

.accordion button {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.accordion-content {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.5s ease, opacity 0.3s ease, padding 0.3s ease;
    opacity: 0;
}

.accordion-content.open {
    max-height: 500px;
    opacity: 1;
}

.hidden {
    display: none !important;
}

/* ============================================
   FOCUS ET ACCESSIBILITÉ
   ============================================ */
a:focus-visible,
button:focus-visible {
    outline-offset: 2px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
    outline: none;
}

/* Améliorer le contraste des liens */
a {
    text-decoration: none;
    transition: color 0.5s ease;
}

a:hover {
    text-decoration: underline;
}

/* ============================================
   ÉTATS DE CHARGEMENT
   ============================================ */
.loading-skeleton {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        opacity: 1; 
    }
    50% { 
        opacity: 0.5; 
    }
}

/* Spinner de chargement */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f7f2ea;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   NAVIGATION
   ============================================ */
nav {
    background-color: #ffffff;
    box-shadow: 0 2px 8px rgba(98, 23, 8, 0.08);
    transition: box-shadow 0.3s ease;
}

nav .title {
    color: var(--primary);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    padding-top : 6px;
    text-decoration: none;
}

/* Liens de navigation */
nav a[href$=".html"] {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    padding-bottom: 2px;
    text-decoration: none;
}

/* Lien actif */
nav a[class*="border-[#621708]"] {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Lien inactif */
nav a[class*="text-gray-500"] {
    color: #6b7280;
}

nav a[class*="text-gray-500"]:hover {
    color: var(--primary);
    border-bottom-color: var(--primary-light);
}

/* ============================================
   GRILLE RESPONSIVE
   ============================================ */
/* Amélioration de l'espacement sur mobile */
@media (max-width: 640px) {
    .article-card {
        margin-bottom: 1rem;
    }
}

/* ============================================
   IMAGES
   ============================================ */
img {
    max-width: 100%;
    height: auto;
}

/* Empêcher le flash de contenu non stylisé */
img[loading="lazy"] {
    min-height: 200px;
}

/* ============================================
   UTILITAIRES
   ============================================ */
.text-balance {
    text-wrap: balance;
}

/* Améliorer la lisibilité du texte */
p, li {
    line-height: 1.6;
}

/* ============================================
   ANIMATIONS D'ENTRÉE
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}