/* Uni Gest — compléments à Bootstrap 5 (aucun style inline : compatible CSP). */

.skip-link {
    position: absolute;
    left: 1rem;
    top: 0.5rem;
    z-index: 1080;
    padding: 0.5rem 1rem;
    background: #fff;
    border: 2px solid var(--bs-primary);
    border-radius: 0.25rem;
}

main:focus {
    outline: none;
}

/* Cibles tactiles confortables sur téléphone. */
@media (max-width: 575.98px) {
    .btn-sm {
        padding: 0.375rem 0.6rem;
    }
}

.table td,
.table th {
    vertical-align: middle;
}

[hidden] {
    display: none !important;
}

/* Texte multiligne saisi par l'utilisateur (sans style en ligne : CSP stricte). */
.text-preline { white-space: pre-line; }

/* Photos du matériel */
/* contain : la photo entière est réduite dans le cadre, jamais rognée. */
.photo-thumb { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: var(--bs-tertiary-bg); }
.photo-cell { width: 56px; }
.photo-mini { display: block; width: 48px; height: 48px; object-fit: contain; background: var(--bs-tertiary-bg); }

/* Menu latéral de l'Administrateur (offcanvas sous 992 px, colonne fixe au-delà) */
@media (min-width: 992px) {
    .sidebar { width: 15rem; flex-shrink: 0; background: var(--bs-tertiary-bg); }
    .sidebar .offcanvas-body { position: sticky; top: 0; padding: 1.25rem 1rem; }
}
.sidebar-heading { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--bs-secondary-color); margin: 1.5rem 0 .5rem .75rem; }
.min-w-0 { min-width: 0; }

/* Catalogue en cartes */
/* Catalogue en cartes : photo plus basse que large, pour voir davantage de fiches à l'écran */
/* Largeur fixe des cartes : autant de colonnes que l'écran en contient, sans étirer les cartes. */
.material-grid { display: grid; grid-template-columns: repeat(auto-fill, 10.5rem); gap: .5rem; }
@media (max-width: 575.98px) { .material-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.material-card .photo-thumb { aspect-ratio: auto; height: 6.5rem; }
.material-card .card-title { font-size: .9rem; }
.photo-placeholder { display: flex; align-items: center; justify-content: center; color: var(--bs-secondary-color); font-size: .875rem; }
.material-card .card-title a::after { z-index: 1; }

/* Journal d'audit : détails JSON lisibles sans déborder */
.audit-details { white-space: pre-wrap; word-break: break-word; max-width: 32rem; font-size: .8rem; }

/* Impression : seul le contenu principal (sans menu, bandeau ni filtres) */
@media print {
    .sidebar, .navbar, .d-print-none, form[role="search"] { display: none !important; }
    a[href]::after { content: none; }
}

/* Les éléments masqués (.visually-hidden, en position absolue) restent confinés dans la zone
   défilante du tableau : sinon ils élargissent toute la page sur téléphone. */
.table-responsive { position: relative; }

/* Logo du bandeau (Administration › Apparence) : hauteur fixe, largeur proportionnelle. */
.app-header { min-height: 5.5rem; padding-top: .5rem; padding-bottom: .5rem; }
.app-header .navbar-brand { font-size: 1.4rem; }
.navbar-logo { height: 76px; width: auto; max-width: 320px; object-fit: contain; }
@media (max-width: 575.98px) {
    .app-header { min-height: 3.5rem; }
    .navbar-logo { display: none; }
}

/* Liens vers chaque bibliothèque (Administrateur, plusieurs bibliothèques) */
/* Bandeau en trois zones : la zone centrale (logo au centre, nom ou liens des bibliothèques) est centrée sur l'écran. */
@media (min-width: 768px) {
    .header-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; column-gap: 1rem; }
}
.header-libraries .nav-link { border-radius: .375rem; font-size: .9rem; }
/* Une seule bibliothèque (ou compte rattaché à une bibliothèque) : son nom au centre, plus grand que le nom de l'application */
.header-library-name { font-size: 1.6rem; font-weight: 700; color: var(--bs-navbar-brand-color); min-width: 0; max-width: 50vw; text-align: center; padding: 0; }
@media (max-width: 991.98px) { .header-library-name { font-size: 1.25rem; } }
.header-libraries .nav-link.active { background: rgba(127, 127, 127, .25); }


/* Fiche matériel : largeur limitée et centrée, pour ne pas étirer les cadres sur grand écran. */
.material-sheet { max-width: 70rem; margin-inline: auto; }

/* Apparence : case du code hexadécimal à côté du carré de couleur */
.color-hex { width: 6.5rem; }
