/* ==========================================================================
   AdoServ II - Blog — styles (inspirés de YapapouaiyeHub)
   Design bento : Space Grotesk + Space Mono, fond crème, cartes blanches,
   accents néon, boutons pilule, bandeau défilant.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Space+Mono:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-pill: 999px;

    --transition-fast: 0.15s;
    --transition-medium: 0.25s;

    /* Palette professionnelle */
    --bg-color: #f7f7f4;
    --surface: #ffffff;
    --ink: #17181c;
    --ink-soft: #55585f;
    --ink-faint: #8b8e96;
    --line: #e7e6e1;
    --line-strong: #d5d4cd;

    /* Accents néon */
    --neon-yellow: #f5b301;
    --neon-green: #22a55c;
    --neon-orange: #ea6a1c;
    --neon-pink: #e14a8c;
    --neon-cyan: #0e8fd8;
    --neon-purple: #7c5cf0;
    --neon-red: #e34444;

    /* Ombres douces */
    --shadow-xs: 0 1px 2px rgba(23, 24, 28, 0.05);
    --shadow-sm: 0 1px 2px rgba(23, 24, 28, 0.05), 0 3px 10px rgba(23, 24, 28, 0.05);
    --shadow-md: 0 4px 8px rgba(23, 24, 28, 0.06), 0 10px 24px rgba(23, 24, 28, 0.08);
    --shadow-lg: 0 8px 16px rgba(23, 24, 28, 0.08), 0 20px 48px rgba(23, 24, 28, 0.12);

    --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-display);
    background-color: var(--bg-color);
    color: var(--ink);
    min-height: 100vh;
    padding: 24px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Focus accessibilité */
*:focus-visible {
    outline: 2px solid var(--neon-cyan);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: #cbcac4;
    border: 3px solid var(--bg-color);
    border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
    background: #a9a8a1;
}

/* ===== Bandeau défilant ===== */
.ticker {
    background: var(--ink);
    color: #ffffff;
    overflow: hidden;
    white-space: nowrap;
    padding: 12px 0;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    position: sticky;
    top: 0;
    z-index: 100;
    margin: -24px -24px 24px;
}
.ticker-content {
    display: inline-block;
    white-space: nowrap;
    padding-left: 100%;
    animation: ticker 35s linear infinite;
    will-change: transform;
}
@keyframes ticker {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

/* ===== Conteneur ===== */
.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 8px;
    position: relative;
    z-index: 1;
}

/* ===== Carte hero (logo) ===== */
.hero {
    background:
        radial-gradient(600px 200px at 85% -40%, rgba(245, 179, 1, 0.16), transparent 70%),
        radial-gradient(400px 180px at -10% 120%, rgba(14, 143, 216, 0.08), transparent 70%),
        var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 44px 28px 40px;
    text-align: center;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.hero h1 {
    font-size: clamp(2rem, 6vw, 3.4rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    text-transform: uppercase;
    line-height: 1.05;
    margin-bottom: 12px;
}

.hero .tagline {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--ink-soft);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    border-bottom: 2px solid var(--neon-yellow);
    padding-bottom: 6px;
    display: inline-block;
    margin-bottom: 0;
}

/* Lien discret vers l'administration */
.admin-corner {
    position: absolute;
    top: 18px;
    right: 24px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-faint);
    text-decoration: none;
    transition: color var(--transition-fast) ease;
}
.admin-corner:hover {
    color: var(--neon-cyan);
}

/* ===== Boutons pilule ===== */
.pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ink);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-pill);
    padding: 10px 22px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    cursor: pointer;
    transition: background var(--transition-fast) ease, transform var(--transition-fast) ease, border-color var(--transition-fast) ease;
}
.pill-btn:hover {
    background: var(--neon-cyan);
    transform: translateY(-2px);
}
.pill-btn:active {
    transform: translateY(0);
}

.pill-ghost {
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line-strong);
    box-shadow: var(--shadow-xs);
}
.pill-ghost:hover {
    background: var(--surface);
    border-color: var(--neon-yellow);
    color: var(--ink);
}

.pill-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ===== Titres de section (admin) ===== */
.section-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 6px;
}

/* ===== Cartes / articles ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 28px;
    margin-bottom: 24px;
}

.posts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

/* Premier article mis en avant (pleine largeur) */
.post:first-child {
    grid-column: 1 / -1;
}

.post {
    --accent: var(--neon-yellow);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-medium) ease, box-shadow var(--transition-medium) ease, border-color var(--transition-medium) ease;
    will-change: transform;
}
.post:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--line-strong);
}
.post::after {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    right: -50px;
    top: -50px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 16%, transparent) 55%, transparent 75%);
    pointer-events: none;
}

.post-title {
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 8px;
    padding-right: 60px;
}

.post-date {
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-soft);
    display: inline-block;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 4px;
    margin-bottom: 16px;
}

.post-content {
    position: relative;
    z-index: 1;
}

/* Aperçu tronqué avec « Lire la suite » */
.post-content.clamped {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post.expanded .post-content.clamped {
    display: block;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
    overflow: visible;
}

.post-toggle {
    margin-top: 18px;
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--ink-soft);
    border-radius: var(--radius-pill);
    padding: 7px 18px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: border-color var(--transition-fast) ease, color var(--transition-fast) ease;
}
.post-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.post-content h2,
.post-content h3,
.post-content h4 {
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.25;
    margin: 1.4em 0 0.45em;
}
.post-content h2 { font-size: 1.3rem; }
.post-content h3 { font-size: 1.15rem; }
.post-content h4 { font-size: 1.02rem; }

.post-content p {
    margin: 0 0 1em;
}

.post-content ul {
    margin: 0 0 1em;
    padding-left: 1.4em;
}

.post-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.post-content a:hover {
    text-decoration-thickness: 2px;
}

.post-content blockquote {
    margin: 0 0 1em;
    padding: 4px 0 4px 16px;
    border-left: 3px solid var(--accent);
    font-family: var(--font-mono);
    font-size: 0.92rem;
    color: var(--ink-soft);
}

.post-content code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: var(--bg-color);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 1px 5px;
}

/* ===== État vide / erreur ===== */
.empty {
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ink-faint);
    padding: 48px 0;
}
.empty a {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.error {
    color: var(--neon-red);
}

.muted {
    color: var(--ink-soft);
    font-size: 0.82rem;
    font-weight: 400;
}

/* ===== Formulaires ===== */
form label {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ink-soft);
    margin: 18px 0 6px;
}

input[type="text"],
input[type="password"],
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 0.98rem;
    transition: border-color var(--transition-fast) ease, box-shadow var(--transition-fast) ease;
}
textarea {
    resize: vertical;
    min-height: 140px;
    line-height: 1.5;
}
input:focus,
textarea:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 3px rgba(14, 143, 216, 0.15);
}

/* Bouton fantôme (modifier, annuler) */
.btn-ghost {
    background: transparent;
    border: 1px solid var(--line-strong);
    color: var(--ink);
    border-radius: var(--radius-pill);
    padding: 6px 16px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color var(--transition-fast) ease, color var(--transition-fast) ease, transform var(--transition-fast) ease;
}
.btn-ghost:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    transform: translateY(-1px);
}

/* Bouton de danger (supprimer) */
.btn-danger {
    background: transparent;
    border: 1px solid var(--neon-red);
    color: var(--neon-red);
    border-radius: var(--radius-pill);
    padding: 6px 16px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--transition-fast) ease, color var(--transition-fast) ease, transform var(--transition-fast) ease;
}
.btn-danger:hover {
    background: var(--neon-red);
    color: #ffffff;
    transform: translateY(-1px);
}

/* Actions de formulaire */
.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
}

/* ===== Liste d'articles (admin) ===== */
.admin-post-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.admin-posts {
    list-style: none;
    margin: 16px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.admin-post {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--bg-color);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    transition: border-color var(--transition-fast) ease, box-shadow var(--transition-fast) ease;
}
.admin-post:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-xs);
}
.admin-post strong {
    font-weight: 600;
    overflow-wrap: anywhere;
}
.admin-post .muted {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ===== Pied de page ===== */
footer {
    max-width: 860px;
    margin: 48px auto 0;
    text-align: center;
    padding: 28px 0 20px;
    color: var(--ink-soft);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    border-top: 1px solid var(--line);
}
footer a {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }
    .ticker {
        margin: -12px -12px 16px;
    }
    .hero {
        padding: 32px 20px 28px;
    }
    .posts {
        grid-template-columns: 1fr;
    }
    .admin-corner {
        position: static;
        display: inline-block;
        margin-bottom: 16px;
    }
    .post,
    .card {
        padding: 22px;
    }
    .admin-post {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ===== Mouvement réduit ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
