/* MiniAnnuaire - css/site.css */
/* Infini'click 2026 */

/* Variables */
:root {
    --blue:      #1b76ff;
    --blue-d:    #1560d4;
    --text:      #444444;
    --bg:        #ffffff;
    --white:     #ffffff;
    --border:    #dddddd;
    --muted:     #888888;
    --radius:    6px;
    --sidebar-w: 260px;
    --header-h:  52px;
    --logo-p1:   #444444;
    --logo-p2:   #1b76ff;
    --shadow:    0 1px 4px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    height: 100%;
    font-family: 'Trebuchet MS', Arial, sans-serif;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* Layout grille */
#content {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-rows: var(--header-h) 1fr;
    height: 100vh;
    overflow: hidden;
}

/* Header */
#header {
    grid-column: 1 / -1;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    z-index: 10;
}
.site-logo {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -.3px;
    text-decoration: none;
}
.site-logo .logo-p1 { color: var(--logo-p1); }
.site-logo .logo-p2 { color: var(--logo-p2); }
.header-right {
    margin-left: auto;
    font-size: 12px;
    color: var(--muted);
}
.header-right a { color: var(--muted); }
.header-right a:hover { color: var(--text); text-decoration: none; }

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}
.hamburger span {
    display: block;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
}

/* Overlay */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 199;
}
.overlay.open { display: block; }

/* Sidebar */
#sidebar {
    background: var(--white);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    overflow-x: hidden;
    grid-row: 2;
    grid-column: 1;
    display: flex;
    flex-direction: column;
}
.sidebar-title {
    font-size: 9.5px;
    font-weight: 700;
    color: var(--white);
    background: var(--blue);
    padding: 10px;
    letter-spacing: .12em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}
.sidebar-nav ul { list-style: none; }
.sidebar-nav ul li a {
    display: flex;
    align-items: center;
    padding: 9px 12px;
    font-size: 13px;
    color: var(--muted);
    transition: color .15s, background .15s;
    text-decoration: none;
}
.sidebar-nav ul li a:hover {
    color: var(--text);
    background: var(--bg);
    text-decoration: none;
}

/* Zone principale */
#page {
    grid-row: 2;
    grid-column: 2;
    overflow-y: auto;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--bg);
}

/* Card */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}
h1 { font-size: 24px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
h2 { font-size: 20px; font-weight: 500; color: var(--text); margin-bottom: 5px; }
h3 { font-size: 16px; font-weight: 500; color: var(--text); margin-bottom: 5px; }
ul, li {margin: 0 0 0 30px; padding: 0}
ul {margin: 6px}

/* Liste sites */
.liste {
    padding: 0 0 18px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 18px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.liste:last-child { border-bottom: none; margin-bottom: 0; }
.vignette {
    flex-shrink: 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    width: 120px;
    height: 90px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--muted);
    text-align: center;
    overflow: hidden;
}
.vignette img { width: 100%; height: 100%; object-fit: cover; }
.texte { flex: 1; }
.texte .site-titre {
    font-size: 15px;
    font-weight: 600;
    color: var(--blue);
    display: block;
    margin-bottom: 3px;
}
.texte .site-lien {
    font-size: 12px;
    color: var(--muted);
    display: block;
    margin-bottom: 6px;
}

/* Cards accueil */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.card-site {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--white);
    box-shadow: var(--shadow);
}
.card-vignette {
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--muted);
}
.card-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}
.card-titre {
    font-size: 14px;
    font-weight: 600;
    color: var(--blue);
    line-height: 1.3;
}
.card-titre:hover { text-decoration: underline; }
.card-texte {
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
    flex: 1;
}

/* Pager */
#pager { margin: 16px 0 0; text-align: center; }
#pager ul { display: inline-flex; gap: 4px; list-style: none; }
#pager ul li a,
#pager ul li.encours {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
    color: var(--text);
    background: var(--white);
    text-decoration: none;
}
#pager ul li a:hover { background: var(--bg); }
#pager ul li.encours { background: var(--blue); border-color: var(--blue); color: var(--white); }

/* Formulaire */
.input, .textarea, .select {
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    color: var(--text);
    background: var(--white);
    padding: 8px 10px;
    width: 100%;
}
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--blue); }
.bouton {
    background: var(--blue);
    border: 1px solid var(--blue);
    border-radius: 4px;
    padding: 8px 18px;
    font-size: 13px;
    color: var(--white);
    cursor: pointer;
}
.bouton:hover { background: var(--blue-d); border-color: var(--blue-d); }
.erreur { color: #cc0000; font-size: 13px; margin-bottom: 10px; }
.modif-ok { color: #2d7a2d; font-size: 13px; margin-bottom: 10px; }

/* Responsive */
@media (max-width: 768px) {
    .hamburger { display: flex; }
    .sidebar-close { display: block; }
    .header-right { display: none; }
    #header { padding: 0 12px; }

    #content {
        grid-template-columns: 1fr;
        grid-template-rows: var(--header-h) 1fr;
    }

    #sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 260px;
        height: 100vh;
        overflow-y: auto;
        z-index: 200;
        border-right: 1px solid var(--border);
        transition: left .25s ease;
        grid-row: unset;
        grid-column: unset;
    }
    #sidebar.open { left: 0; }

    #page { padding: 16px; grid-column: 1; grid-row: 2; }
    .cards-grid { grid-template-columns: repeat(2, 1fr); }
    .liste { flex-direction: column; }
    .vignette { width: 100%; height: 160px; }
}

@media (max-width: 480px) {
    .cards-grid { grid-template-columns: 1fr; }
}
