/* ==========================================
   LEXIQUE DE L'ANTIQUITÉ - CSS
   Style moderne et coloré
   ========================================== */

:root {
    /* Palette de couleurs */
    --primary: #4A90E2;
    --secondary: #7B68EE;
    --success: #50C878;
    --warning: #FFB347;
    --danger: #FF6B6B;
    
    /* Couleurs par nature grammaticale */
    --nom-masculin: #4A90E2;
    --nom-feminin: #E24A90;
    --adjectif: #3b7d4f;
    --verbe:    #d27b2f;
    
    /* Couleurs de fond */
    --bg-light: #F8F9FA;
    --bg-white: #FFFFFF;
    --text-dark: #2C3E50;
    --text-muted: #6C757D;
    --border: #E0E0E0;
    
    /* Ombres */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 16px rgba(0,0,0,0.2);
	
	/* Palette spécifique du lexique (parchemin) */
    --lex-bg:           #e9e0cf;  /* fond général du bloc lexique */
    --lex-paper:        #f9f3e3;  /* fond des cartes, contrôles */
    --lex-paper-strong: #e4d3b2;  /* titre, en-têtes actifs */
    --lex-ink:          #2b2620;  /* texte principal */
    --lex-muted:        #736657;  /* texte secondaire */
    --lex-border:       #c8b79a;  /* bordure douce */
    --lex-border-strong:#b49663;  /* bordure plus marquée */
    --lex-accent:       #8b5a2b;  /* petits accents (icônes, etc.) */
}

.lexique-wrapper,
.lexique-wrapper * {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
}

.lexique-wrapper {
    width: min(100%, var(--content-width));
    margin-inline: auto;

    padding: 0 var(--gap) var(--vspace);
    background: var(--lex-bg);      /* au lieu de #fff */
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    overflow: hidden;
}

/* ==========================================
   HEADER
   ========================================== */
.page-header {
  margin-block: 6px 14px;    /* ← moins d'espace au-dessus et en dessous */
  padding: 8px 18px;         /* ← un peu moins haut */

  background: var(--lex-paper-strong);
  border: 1px solid var(--lex-border-strong);
  border-radius: 6px;

  color: var(--lex-ink);
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  text-align: center;
}

.page-header h1 {
  margin: 0 0 4px 0;
  line-height: 1.2;
  font-family: "EB Garamond", serif;
  font-size: clamp(1.5rem, 1.2vw + 1.2rem, 2.2rem);
  color: currentColor;
}

.page-header h2 {
  margin: 0;
  font-family: "EB Garamond", serif;
  font-size: 1.05rem;   /* ← un tout petit peu plus petit */
  font-weight: 400;
  line-height: 1.25;    /* ← un peu plus serré */
  color: currentColor;
}

.page-header h3 {
  margin: 0;
  font-family: "EB Garamond", serif;
  font-size: 0.95rem;   /* ← idem, léger resserrage */
  font-weight: 400;
  line-height: 1.25;
  color: var(--lex-muted);
  font-style: italic;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

/* ==========================================
   CONTRÔLES
   ========================================== */

.controls {
    background: var(--lex-paper);
    padding: 8px 10px;          /* ← moins haut et moins large */
    margin-bottom: 6px;         /* ← petit resserrage sous le bloc */
    border: 1px solid var(--lex-border);
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

.alphabet-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;                   /* ← un peu moins d’espace entre lettres */
    justify-content: center;
    margin-bottom: 10px;        /* ← réduit la hauteur du bloc lettres */
}

.alpha-btn {
    padding: 4px 8px;           /* ← plus petit “carré” */
    border: 2px solid var(--primary);
    background: white;
    color: var(--primary);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;          /* ← lettres un peu plus petites */
    line-height: 1.1;
    transition: all 0.3s ease;
}

.alpha-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.alpha-btn.active {
    background: var(--primary);
    color: white;
}

.action-buttons {
    display: flex;
    gap: 8px;                   /* ← un peu moins d’espace entre eux */
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 7px 16px;          /* ← plus bas, plus étroit */
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;         /* ← texte un poil plus petit */
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #3a7bc8;
}

.btn-secondary {
    background: var(--text-muted);
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #3fa861;
}

/* ==========================================
   MODE QUIZ
   ========================================== */

.quiz-container {
    padding: 18px 0 24px;
    background: linear-gradient(135deg, #f3e2c5 0%, #f7e9cf 100%);
}

.quiz-card {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    max-width: 700px;
    margin: 0 auto;
}

.quiz-card h3 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 1.8rem;
}

.quiz-question {
    font-size: 1.3rem;
    line-height: 1.6;
    margin-bottom: 25px;
    padding: 20px;
    background: var(--bg-light);
    border-radius: 10px;
    border-left: 5px solid var(--primary);
}

.quiz-answer {
    margin: 25px 0;
    padding: 25px;
    background: linear-gradient(135deg, #50C878 0%, #7FD99F 100%);
    color: white;
    border-radius: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.quiz-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   LEXIQUE - ACCORDÉON
   ========================================== */

.lexique-container {
    padding: 0;
    margin-top: 16px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.lexique-card {
    background: var(--lex-paper);
    border: 1px solid var(--lex-border);
    border-radius: 8px;
    margin-bottom: 0;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.lexique-card:hover {
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    transform: translateY(-1px);
    border-color: var(--lex-border-strong);
}

.lexique-card.hidden {
    display: none;
}

.lexique-intro {
  margin: 4px 0 0 0;      /* petit espace au-dessus, rien en dessous */
  padding: 2px 0;         /* quasi pas de padding vertical */
  font-size: 0.9rem;      /* plus petit que le h3 (0.95rem) */
  line-height: 1.35;      /* moins “aéré” que 1.6 */
  color: var(--lex-ink);
}

.card-header {
    padding: 8px 10px;              /* ← moins haut, moins large */
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;                        /* ← un peu moins d’espace horizontal */
    background: #f3e7d4;
    transition: background 0.2s ease, color 0.2s ease;
    color: var(--lex-ink);
}

.card-header:hover {
    background: #ecddc5;
}

.card-header.active {
    background: var(--lex-paper-strong);
    color: var(--lex-ink);
}


.nature-badge {
    padding: 4px 8px;          /* au lieu de 6px 12px */
    border-radius: 14px;
    font-size: 0.8rem;         /* un peu plus petit */
    font-weight: 500;
    color: white;
    white-space: nowrap;
	text-shadow: 0 1px 1px rgba(0,0,0,0.25);
}

.nature-nom-m {
    background: var(--nom-masculin);
}

.nature-nom-f {
    background: var(--nom-feminin);
}

.nature-adj {
    background: var(--adjectif);
}

.nature-verbe {
    background: var(--verbe);
}

.card-title {
    flex: 1;
    font-size: 1.25rem;   /* ← un cran en dessous */
    font-weight: 600;     /* un peu moins gras, mais encore bien visible */
    line-height: 1.2;     /* évite que ça prenne trop de hauteur */
}

.expand-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.card-header.active .expand-icon {
    transform: rotate(180deg);
}

.card-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.card-content.active {
    max-height: 1000px;
}

.card-body {
    padding: 18px 20px;
    background: var(--lex-paper);
}

.etymologie {
    color: var(--lex-accent);
    font-style: italic;
    font-size: 1.12rem;
    font-weight: 500;
    margin-bottom: 14px;
    padding-left: 18px;
    border-left: 3px solid var(--lex-border-strong);
}

.etymologie::before {
    content: "Origine : ";
    font-style: normal;
    font-weight: 600;
    color: var(--lex-ink);
}

.definition {
    font-weight: 600;
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 10px;
    color: var(--lex-ink);
}

.exemple {
    font-style: italic;
    color: var(--lex-ink);
    padding: 12px 14px;
    background: #f2e8d7;
    border-radius: 6px;
    margin-bottom: 12px;
    font-family: Georgia, serif;
}


.exemple::before {
    content: "💡 ";
}

.meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.meta-line {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.meta-line strong {
    color: var(--lex-ink);
    font-size: 0.95rem;
    white-space: nowrap;
}

.meta-line:last-child {
    margin-bottom: 0;
}

.tag {
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    background: var(--bg-light);
    color: var(--text-muted);
}

.champ-tag {
    background: linear-gradient(135deg, #9B59B6 0%, #8E44AD 100%);
    color: white;
    font-weight: 600;
}

.derives-tag {
    background: linear-gradient(135deg, #28A745 0%, #3FB557 100%);
    color: white;
}

@media (min-width: 1024px) {
    .lexique-container {
        grid-template-columns: 1fr 1fr;  /* deux colonnes */
    }
}

/* ==========================================
   ICÔNES PAR THÈME
   ========================================== */

.theme-icon {
    font-size: 1.5rem;
    margin-right: 5px;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .page-header h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 0.95rem;
    }
    
    .alphabet-nav {
        gap: 5px;
    }
    
    .alpha-btn {
        padding: 6px 10px;
        font-size: 0.9rem;
    }
    
    .card-title {
        font-size: 1.2rem;
    }
    
    .card-body {
        padding: 15px;
    }
    
    .quiz-card {
        padding: 20px;
    }
    
    .quiz-question {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .alpha-btn {
        padding: 5px 8px;
        font-size: 0.85rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* ==========================================
   ANIMATIONS
   ========================================== */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lexique-card {
    animation: slideIn 0.3s ease;
}

/* ==========================================
   PRINT
   ========================================== */

@media print {
    body {
        background: white;
    }
    
    .controls,
    .quiz-container {
        display: none !important;
    }
    
    .card-header {
        background: white !important;
        color: black !important;
    }
    
    .card-content {
        max-height: none !important;
    }
}
