/* ── Wiki Mia — Styles personnalisés ── */

:root {
    --accent: #0f766e;
    --accent-hover: #0d5f59;
    --accent-light: #ccfbf1;
    --accent-subtle: #f0fdfa;
    --border: #e2e8f0;
    --text-muted: #64748b;
}

/* ── Base ── */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ── Navbar ── */

.navbar-accent {
    background-color: var(--accent);
}

.navbar-accent .navbar-brand {
    color: #fff;
    font-weight: 600;
}

.navbar-accent .nav-link {
    color: rgba(255, 255, 255, 0.85);
}

.navbar-accent .nav-link:hover,
.navbar-accent .nav-link:focus {
    color: #fff;
}

.navbar-accent .nav-link.active {
    color: #fff;
    font-weight: 600;
}

.navbar-accent .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.4);
}

.navbar-accent .navbar-toggler-icon {
    filter: invert(1);
}

/* ── Boutons ── */

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

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
}

.btn-primary:active {
    background-color: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
}

.btn-outline-primary {
    color: var(--accent);
    border-color: var(--accent);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ── Liens ── */

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

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

/* ── Zones tactiles minimales 44×44px ── */

.btn,
.nav-link,
.form-control,
.form-select,
.page-link {
    min-height: 44px;
}

.nav-link {
    padding: 0.75rem 1rem;
}

/* ── Cartes ── */

.card {
    border-color: var(--border);
    border-radius: 0.5rem;
}

/* ── Footer ── */

.footer {
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ── Pagination ── */

.page-link {
    color: var(--accent);
}

.page-item.active .page-link {
    background-color: var(--accent);
    border-color: var(--accent);
}

/* ── Formulaire de connexion ── */

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.25);
}

/* ── Section notes ── */

.note-section {
    background-color: var(--accent-subtle);
    border-left: 4px solid var(--accent);
    padding: 1rem;
    border-radius: 0.25rem;
}

.note-section textarea {
    font-size: 0.9375rem;
}

/* ── Posts ── */

.post-content {
    overflow-wrap: break-word;
    word-break: break-word;
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.25rem;
}

.post-content blockquote {
    border-left: 3px solid var(--border);
    padding-left: 1rem;
    margin-left: 0;
    color: var(--text-muted);
}

.post-content pre,
.post-content code {
    font-size: 0.875rem;
}

.post-content pre {
    background-color: #f8fafc;
    padding: 0.75rem;
    border-radius: 0.25rem;
    overflow-x: auto;
}

/* ── Recherche — surlignage ── */

mark {
    background-color: #fef08a;
    padding: 0.1em 0.2em;
    border-radius: 0.15rem;
}

/* ── Barre de progression crawl ── */

.progress-bar.bg-accent {
    background-color: var(--accent) !important;
}

/* ── Diagnostic ── */

.bg-outline-dtc {
    background-color: #fff;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.bg-outline-dtc:hover {
    background-color: #fef2f2;
    color: #991b1b;
}

.bg-outline-can {
    background-color: #fff;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
}

.bg-outline-can:hover {
    background-color: #eff6ff;
    color: #1e40af;
}

.bg-outline-sym {
    background-color: #fff;
    color: var(--accent);
    border: 1px solid var(--accent-light);
}

.bg-outline-sym:hover {
    background-color: var(--accent-subtle);
    color: var(--accent-hover);
}

.diag-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.cas-card .card-header {
    cursor: pointer;
}

.cas-card .card-header:hover {
    background-color: var(--accent-subtle);
}

/* ── Galerie photos ── */

.galerie-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
}

.galerie-vignette {
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 0.375rem;
    background-color: #f1f5f9;
    border: 1px solid var(--border);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.galerie-vignette:hover,
.galerie-vignette:focus {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
    border-color: var(--accent);
}

.galerie-vignette img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-pleine-page {
    text-align: center;
    background-color: #0f172a;
    border-radius: 0.5rem;
    padding: 0.5rem;
    cursor: zoom-in;
}

.photo-pleine-page img {
    max-width: 100%;
    max-height: 80vh;
    height: auto;
    border-radius: 0.25rem;
}

.photo-pleine-page.zoom {
    cursor: zoom-out;
    overflow: auto;
}

.photo-pleine-page.zoom img {
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
}

/* ── Fichiers (liste téléchargeable) ── */

.fichier-icone {
    display: inline-block;
    margin-right: 0.25rem;
    font-size: 1.1em;
    transform: translateY(-1px);
}

/* ── Modale d'aperçu ── */

#modaleApercu .modal-dialog {
    height: 90vh;
}

#modaleApercu .modal-content {
    height: 100%;
}

#modaleApercu .modal-body {
    overflow: hidden;
    background-color: #1e293b;
}

#modaleApercuIframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

@media (max-width: 575.98px) {
    #modaleApercu .modal-dialog {
        margin: 0.5rem;
        height: calc(100vh - 1rem);
    }
}

/* ── Utilitaires ── */

.text-accent {
    color: var(--accent);
}

.bg-accent-subtle {
    background-color: var(--accent-subtle);
}
