/**
 * Design Hostinity : violet #9a5bff, fond très sombre, Inter (titres et texte),
 * JetBrains Mono (code). Polices chargées via <link> dans layout_header.php.
 */

:root {
    --primary: #9a5bff;
    --primary-light: #c4a0ff;
    --primary-dark: #7c3fe8;
    --font-family: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
    --bg: #0a0a0d;
    --bg-soft: #15151b;
    --bg-elevated: #1a1a22;
    --border: rgba(255, 255, 255, 0.09);
    --text: #e6e6ec;
    --muted: #9a9aa8;
    --green: #1fd89a;
    --amber: #f59e0b;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--font-family);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}
a { color: var(--primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-family); font-weight: 800; letter-spacing: -0.02em; }

/* Scrollbar moderne et violette */
* { scrollbar-width: thin; scrollbar-color: var(--primary) var(--bg-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 999px; border: 2px solid var(--bg-soft); }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* Navbar */
.site-navbar {
    display: flex; align-items: center; gap: 1.5rem;
    padding: 0.9rem 1.5rem; border-bottom: 1px solid rgba(154,91,255,0.18);
    position: sticky; top: 0; background: rgba(16,16,20,0.92); backdrop-filter: blur(10px); z-index: 10;
    box-shadow: 0 1px 0 rgba(154,91,255,0.08);
}
.site-brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.1rem; color: var(--text); flex-shrink: 0; font-family: var(--font-family); }
.site-brand img { height: 28px; }
.site-brand:hover { text-decoration: none; }
.site-search { flex: 1; max-width: 420px; }
.site-search input { width: 100%; padding: .5rem .8rem; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text); font-family: var(--font-family); }
.site-navlinks { display: flex; gap: 1.2rem; margin-left: auto; font-size: .92rem; }
.site-navlinks a { color: var(--text); }
.site-navlinks a:hover { color: var(--primary-light); }
.mobile-nav-toggle { display: none; background: none; border: none; font-size: 1.3rem; color: var(--text); cursor: pointer; }

.lang-switcher { position: relative; }
.lang-switcher__btn { background: var(--bg-soft); border: 1px solid var(--border); color: var(--text); padding: .35rem .7rem; border-radius: 6px; font-size: .85rem; cursor: pointer; }
.lang-switcher__btn:hover { border-color: var(--primary); }
.lang-switcher__menu { display: none; position: absolute; top: calc(100% + 6px); right: 0; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 8px; padding: .4rem; min-width: 160px; box-shadow: 0 10px 30px rgba(0,0,0,.4); z-index: 20; }
.lang-switcher__menu.open { display: block; }
.lang-switcher__menu a { display: block; padding: .4rem .6rem; border-radius: 6px; color: var(--text); font-size: .85rem; }
.lang-switcher__menu a:hover { background: rgba(154,91,255,0.1); text-decoration: none; }
.lang-switcher__menu a.active { color: var(--primary-light); font-weight: 600; }

/* Bandeau promo (comme sur hostinity.fr / yorkhost) */
.promo-banner {
    display: flex; align-items: center; gap: 16px;
    background: var(--bg-soft); border: 1px solid var(--border); border-left: 3px solid var(--primary);
    border-radius: 10px; padding: 14px 20px; margin: 0 0 1.5rem;
}
.promo-banner__icon {
    flex-shrink: 0; width: 36px; height: 36px; border-radius: 8px;
    background: rgba(154,91,255,0.14); display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.promo-banner__text { flex: 1; font-weight: 600; font-size: 14.5px; }
.promo-banner__link { flex-shrink: 0; color: var(--primary-light); font-weight: 700; font-size: 14px; white-space: nowrap; }

/* Body layout */
.site-body { display: flex; width: 100%; align-items: flex-start; }
.site-sidebar {
    width: 260px; flex-shrink: 0; padding: 1.5rem 1rem;
    background: linear-gradient(180deg, rgba(154,91,255,0.04), transparent 200px);
    position: sticky; top: 62px; align-self: flex-start;
    max-height: calc(100vh - 62px); overflow-y: auto;
}
.sidebar-home { margin-bottom: 1rem; }
.sidebar-group { margin-bottom: .3rem; }
.sidebar-cat { display: flex; align-items: center; justify-content: space-between; gap: .4rem; border-radius: 6px; font-weight: 600; font-size: .92rem; font-family: var(--font-family); }
.sidebar-cat__link { flex: 1; display: block; padding: .45rem .6rem; color: var(--text); }
.sidebar-cat:hover { background: rgba(154,91,255,0.08); }
.sidebar-cat:hover .sidebar-cat__link { text-decoration: none; }
.sidebar-cat.active { color: var(--primary-light); background: rgba(154,91,255,0.06); }
.sidebar-home.active { background: none; }
.sidebar-cat.active .sidebar-cat__link { color: var(--primary-light); }
.sidebar-toggle { background: none; border: none; cursor: pointer; padding: .45rem .6rem; display: flex; align-items: center; color: inherit; }
.sidebar-chevron { flex-shrink: 0; color: var(--muted); transition: transform .15s ease; }
.sidebar-chevron.open { color: var(--primary-light); transform: rotate(180deg); }
.sidebar-articles { list-style: none; margin: .2rem 0 .6rem; padding-left: .8rem; border-left: 2px solid var(--border); display: none; }
.sidebar-articles.open { display: block; }
.sidebar-articles li a { display: block; padding: .3rem .5rem; font-size: .88rem; color: var(--muted); border-radius: 4px; }
.sidebar-articles li a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.sidebar-articles li a.active { color: var(--primary-light); font-weight: 600; }

.site-content { flex: 1; padding: 2rem 3rem; min-width: 0; max-width: 1200px; margin: 0 auto; }

/* Sommaire "Sur cette page" (à droite, sur les articles) */
.site-toc {
    width: 240px; flex-shrink: 0; padding: 2rem 1.5rem 2rem 0;
    position: sticky; top: 62px; align-self: flex-start;
    max-height: calc(100vh - 62px); overflow-y: auto;
}
.site-toc__title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--primary-light); margin-bottom: .8rem; }
.site-toc ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.site-toc li { margin: 0; }
.site-toc li a { display: block; padding: .3rem .8rem; font-size: .85rem; color: var(--muted); border-left: 2px solid transparent; margin-left: -2px; }
.site-toc li a:hover { color: var(--text); text-decoration: none; border-left-color: var(--primary); }
.site-toc li.toc-level-3 a { padding-left: 1.4rem; font-size: .8rem; }

@media (max-width: 1200px) {
    .site-toc { display: none; }
}
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary-light); }
.breadcrumb-home { display: flex; align-items: center; }
.breadcrumb-sep { color: var(--muted); flex-shrink: 0; opacity: .8; }
.breadcrumb-current { background: var(--bg-soft); border: 1px solid var(--border); color: var(--text); padding: .15rem .7rem; border-radius: 999px; }
.lead { color: var(--muted); font-size: 1.05rem; }
.section-title { margin-top: 2.5rem; }

/* Grille de catégories (accueil) — façon cartes hostinity.fr */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.category-card {
    display: block; padding: 1.3rem; border: 1px solid var(--border); border-radius: 12px;
    color: var(--text); background: var(--bg-soft); position: relative; overflow: hidden;
    transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.category-card::before {
    content: ''; position: absolute; top: 0; left: 0; bottom: 0; width: 3px;
    background: linear-gradient(180deg, var(--primary-light), var(--primary-dark));
    transform: scaleY(0); transform-origin: top; transition: transform .25s ease;
}
.category-card:hover { border-color: rgba(154,91,255,0.4); text-decoration: none; transform: translateY(-3px); box-shadow: 0 10px 32px rgba(154,91,255,0.14); }
.category-card:hover::before { transform: scaleY(1); }
.category-card h3 { margin: 0 0 .4rem; font-size: 1.05rem; font-family: var(--font-family); }
.category-card p { margin: 0 0 .6rem; font-size: .88rem; color: var(--muted); }
.category-count { font-size: .78rem; color: var(--primary-light); font-weight: 700; }

/* Liste d'articles (page catégorie) */
.article-list { display: flex; flex-direction: column; gap: .6rem; }
.article-card { display: flex; flex-direction: column; padding: .9rem 1.1rem; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: var(--bg-soft); }
.article-card:hover { border-color: var(--primary); text-decoration: none; }

/* Contenu d'article : voir assets/css/article-content.css (partagé avec l'aperçu admin) */
.site-content > h1:first-of-type {
    background: linear-gradient(135deg, #c4a0ff 0%, var(--primary) 50%, #7c3fe8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Widget "cet article vous a-t-il été utile ?" */
.article-feedback {
    max-width: 1200px; margin: 2rem auto 0; padding: 1.2rem 1.5rem;
    background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px;
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.article-feedback__question { font-weight: 600; }
.feedback-btn {
    background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text);
    padding: .45rem 1rem; border-radius: 6px; font-size: .9rem; cursor: pointer;
}
.feedback-btn:hover:not(:disabled) { border-color: var(--primary); }
.feedback-btn:disabled { opacity: .5; cursor: default; }
.feedback-btn span { opacity: .7; margin-left: .2rem; }
.article-feedback__thanks { color: var(--green); font-weight: 600; font-size: .9rem; }

/* Formulaire de demande (tuto, etc.) */
.tuto-request-form { max-width: 560px; }
.tuto-request-form label { display: block; margin: 1.2rem 0 .4rem; font-weight: 600; font-size: .9rem; }
.tuto-request-form input, .tuto-request-form select, .tuto-request-form textarea {
    width: 100%; padding: .6rem .8rem; border-radius: 6px; border: 1px solid var(--border);
    background: var(--bg-soft); color: var(--text); font-family: var(--font-family); font-size: .92rem;
}
.tuto-request-form textarea { resize: vertical; }
.form-actions { margin-top: 1.5rem; }
.btn-submit {
    background: var(--primary); color: #fff; border: none; padding: .7rem 1.6rem;
    border-radius: 8px; font-weight: 700; font-size: .95rem; cursor: pointer;
}
.btn-submit:hover { background: var(--primary-dark); }

/* Footer */
.site-footer { padding: 1.5rem; text-align: center; color: var(--muted); font-size: .85rem; margin-top: 2rem; }
.footer-links { display: flex; justify-content: center; gap: 1.2rem; margin-bottom: .5rem; }
.footer-links a:hover { color: var(--primary-light); }

@media (max-width: 900px) {
    .site-navlinks { display: none; }
    .mobile-nav-toggle { display: block; }
    .site-body { flex-direction: column; }
    .site-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); display: none; }
    .site-sidebar.open { display: block; }
    .site-content { padding: 1.5rem; }
    .promo-banner { margin-left: 1rem; margin-right: 1rem; flex-wrap: wrap; }
}
