/* =========================
    RESET & BASE
   ========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: clamp(15px, 1.125vw + 12px, 18px);
    background-color: var(--bg-base);
    color: var(--text-main);
}

main {
    flex: 1;
}

/* =========================
    THEME TOGGLE
   ========================= */
#theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 1.25rem;
    z-index: 100;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

#theme-toggle:hover {
    border-color: var(--accent);
    transform: scale(1.1);
}

/* =========================
    DEBUG
   ========================= */
.debug-banner {
    background: linear-gradient(90deg, #b91c1c, var(--error-color));
    color: var(--text-main);
    text-align: center;
    padding: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* =========================
    HEADER
   ========================= */
header {
    position: relative;
    height: 260px;
    background: var(--bg-surface);
    overflow: hidden;
    border-bottom: 1px solid var(--border-light);
}

header img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.35;
    filter: contrast(1.05) saturate(1.1);
}

header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(13, 17, 23, 0.4), rgba(13, 17, 23, 0.95));
}

/* =========================
    CONTENT
   ========================= */
#probleme-connu {
    text-align: center;
    color:var(--error-color);
    margin-bottom: 2%;
}
.content {
    max-width: 90%;
    margin: -5rem auto 3rem auto;
    background: var(--bg-surface);
    padding: 2rem 2.5rem;
    border-radius: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), inset 0 1px 0 var(--shadow-message);
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

a {
    color: var(--accent);
    text-decoration: none;
}
.content h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.content h2 {
    color: var(--accent);
    margin: 2rem 0 1rem;
    font-size: 1rem;
    text-align: center;
}

.content p {
    margin-bottom: 0.6rem;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.content p strong {
    color: var(--text-main);
}

.lead-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 2rem;
}

.lead {
    color: var(--text-muted);
    font-size: 1.05rem;
    text-align: center;
    max-width: 600px;
    line-height: 1.7;
    margin: 0;
}

.lead strong {
    color: var(--accent);
}

.lead-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
}

.lead-tag {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    border: 1px solid transparent;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.lead-tag--axum  { background: rgba(94, 186, 255, 0.12); border-color: rgba(94, 186, 255, 0.4);  color: #5ebaff; }
.lead-tag--orm   { background: rgba(100, 220, 160, 0.12); border-color: rgba(100, 220, 160, 0.4); color: #64dca0; }
.lead-tag--tpl   { background: rgba(255, 180, 80, 0.12);  border-color: rgba(255, 180, 80, 0.4);  color: #ffb450; }
.lead-tag--rt    { background: rgba(180, 120, 255, 0.12); border-color: rgba(180, 120, 255, 0.4); color: #b478ff; }
.lead-tag--sec   { background: rgba(255, 100, 100, 0.12); border-color: rgba(255, 100, 100, 0.4); color: #ff6464; }
.lead-tag--admin { background: rgba(94, 186, 255, 0.08);  border-color: rgba(94, 186, 255, 0.25); color: #7ecfff; }

/* =========================
    MESSAGES
   ========================= */
.flash-messages {
    margin: 0.5rem;
}

[class^="message-"] {
    margin-top: 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.7rem;
    background: var(--bg-surface);
    box-shadow: inset 0 1px 0 var(--shadow-message);
}

.message-Error {
    color: var(--msg-error-text, #fecaca);
    border-left: 4px solid var(--error-color);
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.15), var(--bg-surface) 40%);
}

.message-Success {
    color: var(--msg-success-text, #bbf7d0);
    border-left: 4px solid var(--success-color);
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.15), var(--bg-surface) 40%);
}

.message-Info {
    color: var(--msg-info-text, #bfdbfe);
    border-left: 4px solid var(--accent);
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.15), var(--bg-surface) 40%);
}

.message-Warning {
    color: var(--msg-warning-text, #fde68a);
    border-left: 4px solid var(--accent-warning);
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.15), var(--bg-surface) 40%);
}

/* =========================
    FOOTER
   ========================= */
footer {
    background: var(--bg-base);
    border-top: 1px solid var(--border-light);
    padding: 1.5rem 1rem;
    text-align: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 0;
}

footer a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 0.8rem;
    font-size: 0.9rem;
    transition: color 0.2s ease;
    white-space: nowrap;
}

footer a:hover {
    color: var(--accent);
}

footer p {
    margin-top: 0.8rem;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.footer-rgpd {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-style: italic;
    margin-top: 0.6rem;
}

/* =========================
    ROADMAP
   ========================= */
.roadmap-section {
    margin-top: 2rem;
    margin-bottom: 2.5rem;
    width: 100%;
}

.roadmap-intro {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 1rem;
    margin-bottom: 2%;
}

.roadmap-heading {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.roadmap-active  { color: var(--accent); }
.roadmap-planned { color: var(--accent-warning); }
.roadmap-future  { color: var(--text-muted); }

.roadmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.roadmap-card {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.roadmap-card h3 {
    font-size: 0.95rem;
    color: var(--text-main);
    margin: 0;
}

.roadmap-card p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
}

.roadmap-card code {
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.78rem;
    color: var(--accent);
}

/* Badges de catégorie sur les cards */
.card-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.1rem 0.5rem;
    border-radius: 0.4rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-right: 0.3rem;
}

.card-badge--fix      { background: #1f4a2a; color: #4ade80; }
.card-badge--feature  { background: #1e3a5f; color: #60a5fa; }
.card-badge--ajouté   { background: #1e3a5f; color: #60a5fa; }
.card-badge--roadmap  { background: #3b2f6e; color: #c4b5fd; }
.card-badge--bug      { background: #4a1f1f; color: #f87171; }
.card-badge--manquant { background: #3d2f10; color: #fbbf24; }
.card-badge--default  { background: var(--bg-surface); color: var(--text-muted); }

/* =========================
    INDEX — STACK GRID
   ========================= */
.stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    width: 100%;
    margin-bottom: 1rem;
}

.stack-card {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.stack-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
}

/* =========================
    INDEX — DEMO CARDS
   ========================= */
.demo-sections {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    align-items: flex-start;
    justify-content: center;
    min-width: 100%;
}

.demo-section {
    flex: 1;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    padding: 1.25rem 1.5rem 1.5rem;
    margin-bottom: 3%;

}

.demo-section h2 {
    margin: 0 0 1rem;
}

.demo-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    width: 100%;
}

.feature-card {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    text-decoration: none;
    color: var(--text-main);
    transition: border-color 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.feature-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.feature-card h3 {
    color: var(--accent);
    font-size: 1rem;
    margin: 0;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin: 0;
    text-align: center;
}

.feature-card--disabled {
    cursor: default;
    opacity: 0.75;
}

.feature-card--disabled:hover {
    border-color: var(--border);
    transform: none;
}

.feature-card-admin {
    border-color: var(--accent-warning);
}

.feature-card-admin h3 {
    color: var(--accent-warning);
    text-align: center;
}

.feature-card-admin:hover {
    border-color: #fbbf24;
}

.admin-credentials {
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    color: var(--accent-warning);
    background: rgba(245, 158, 11, 0.1);
    border-radius: 0.4rem;
    padding: 0.3rem 0.6rem;
    width: fit-content;
    align-self: center;
}

.cred-sep {
    color: var(--text-dim);
}

/* =========================
    CONTAINER
   ========================= */
.container {
    width: 95%;
    max-width: 1500px;
    margin: 1.5rem auto;
}

.container > h1 {
    color: var(--accent);
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* =========================
    BLOG DETAIL
   ========================= */
.blog-detail {
    width: 100%;
    margin-bottom: 2rem;
}

.blog-detail-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.blog-detail-header h1 {
    color: var(--accent);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.blog-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.blog-detail-meta a {
    color: var(--text-muted);
    text-decoration: none;
}

.blog-detail-meta a:hover {
    color: var(--accent);
}

.blog-detail-summary blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.75rem 1.25rem;
    margin: 1rem 0 1.5rem;
    color: var(--text-muted);
    font-style: italic;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 0 0.5rem 0.5rem 0;
}

.blog-detail-content {
    color: var(--text-main);
    line-height: 1.8;
    font-size: 0.95rem;
}

.blog-detail-nav {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* =========================
    BOUTONS
   ========================= */
.btn {
    display: inline-block;
    padding: 0.7rem 1.2rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-indigo));
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 0.4rem 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
}

/* =========================
    BLOG & CONTRIBUTIONS
   ========================= */
.contribution-link {
    color: var(--text-main);
    text-decoration: none;
}

.blog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
    width: 100%;
}

.blog-card {
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: border-color 0.2s ease;
}

.blog-card:hover {
    border-color: var(--accent);
}

.blog-card-title {
    font-size: 1rem;
    color: var(--accent);
    margin: 0;
}

.blog-card-title a {
    color: inherit;
    text-decoration: none;
}

.blog-card-meta {
    font-size: 0.78rem;
    color: var(--text-dim);
}

.blog-card-summary {
    font-size: 0.85rem;
    color: var(--text-muted);
    flex: 1;
}

.blog-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.blog-card-link {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-decoration: none;
}

.blog-card-link:hover {
    color: var(--accent);
}

.empty-state {
    width: 100%;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.back-link {
    margin-top: 2rem;
    text-align: center;
}

.back-link a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link a:hover {
    color: var(--accent);
}

/* =========================
    RESPONSIVE
   ========================= */
/* Tablette (≤ 1024px) */
@media (max-width: 1024px) {
    header { height: 210px; }
    header img { opacity: 0.55; }
    header::after {
        background: linear-gradient(to bottom, rgba(13, 17, 23, 0.15), rgba(13, 17, 23, 0.88));
    }
    .content {
        margin: -2.5rem auto 2rem;
        padding: 1.5rem;
        border-radius: 1rem;
    }
    .content h1 { font-size: 1.6rem; }
    .content p  { font-size: 0.9rem; }
    footer a { margin: 0 0.5rem; font-size: 0.85rem; }
}

/* Footer burger button — caché sur desktop */
.footer-burger {
    display: none;
}

/* Overlay nav (mobile) */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 198;
}
.nav-overlay.active { display: block; }

/* Header interne du panel nav */
.footer-links-header {
    display: none;
}

/* Mobile (≤ 600px) */
@media (max-width: 600px) {
    header { height: 150px; }
    header img { opacity: 0.65; }
    header::after {
        background: linear-gradient(to bottom, rgba(13, 17, 23, 0.05), rgba(13, 17, 23, 0.80));
    }
    .debug-banner { font-size: 0.85rem; padding: 0.4rem; }
    .content { margin: -1.5rem 0.75rem 1.5rem; border-radius: 0.75rem; }
    .content h1 { font-size: 1.4rem; margin-bottom: 0.75rem; }
    .content p  { font-size: 0.85rem; margin-bottom: 0.5rem; }
    [class^="message-"] { font-size: 0.85rem; padding: 0.6rem 0.8rem; }
    footer { padding: 1rem 0.5rem; }
    footer p { margin-top: 0.6rem; font-size: 0.75rem; }

    /* Bouton burger — barre pleine largeur en haut du footer */
    .footer-burger {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
        width: calc(100% + 1rem);
        margin: -1rem -0.5rem 0.75rem;
        background: none;
        border: none;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
        color: var(--text-muted);
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
        cursor: pointer;
        transition: background 0.2s, color 0.2s;
    }

    .footer-burger:hover {
        border-color: var(--accent);
        color: var(--accent);
    }

    /* Panel slide depuis la droite */
    .footer-links {
        position: fixed;
        top: 0;
        right: 0;
        height: 100%;
        width: 200px;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 200;
        background: var(--bg-surface);
        border-left: 1px solid var(--border);
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: stretch;
        gap: 0;
        overflow-y: auto;
    }

    .footer-links.open {
        transform: translateX(0);
    }

    /* Header interne du panel */
    .footer-links-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1rem;
        border-bottom: 1px solid var(--border);
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--text-muted);
        flex-shrink: 0;
    }

    .footer-links-close {
        background: none;
        border: none;
        color: var(--text-muted);
        cursor: pointer;
        font-size: 1rem;
        padding: 0.25rem;
        line-height: 1;
    }

    .footer-links-close:hover { color: var(--text-primary); }

    /* Liens dans le panel */
    footer a {
        margin: 0;
        font-size: 0.9rem;
        padding: 0.65rem 1rem;
        border-bottom: 1px solid var(--border-light);
    }

    .footer-links a:last-child {
        border-bottom: none;
    }
}

/* Petit mobile (≤ 360px) */
@media (max-width: 360px) {
    .content h1 { font-size: 1rem; }
    .content     { padding: 0.75rem; }
}


/* summary cliquable */
.demo-section summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* supprime le chevron natif */
.demo-section summary::-webkit-details-marker {
    display: none;
}

/* flèche */
.demo-section summary::after {
    content: "▸";
    font-size: 0.9rem;
    transition: transform 0.2s ease;
}

/* rotation quand ouvert */
.demo-section details[open] summary::after {
    transform: rotate(90deg);
}
