/* =========================================================================
   responsive.css — Biblio3 Manager
   Adaptations mobile et tablette (breakpoint 768px).
   ========================================================================= */

/* ---- Hamburger button (hidden on desktop) ------------------------------ */
#hamburger {
    display: none;
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 200;
    font-size: 1.2rem;
    background: var(--color-bg);
    border: 2px solid var(--color-border);
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
    font-family: var(--font);
}

#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
}

/* ---- Mobile layout (≤ 768px) ------------------------------------------ */
@media (max-width: 768px) {

    body { flex-direction: column; }

    /* Hamburger visible */
    #hamburger { display: flex; align-items: center; justify-content: center; }

    /* Sidebar becomes an off-canvas drawer */
    #sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 240px;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        background: var(--color-bg);
        border-right: 2px solid var(--color-border);
    }

    #sidebar.open          { transform: translateX(0); }
    #sidebar-overlay.open  { display: block; }

    /* Main: full width, leave space for hamburger */
    #main {
        padding: 3.5rem 0.75rem 0.75rem;
        overflow: auto;
    }

    /* Tab bar: smaller text, allow scroll */
    #tab-bar { overflow-x: auto; flex-wrap: nowrap; }
    .tab-btn  { font-size: 0.65rem; padding: 0.35rem 0.55rem; white-space: nowrap; }

    /* Table: horizontal scroll */
    .table-wrapper { overflow-x: auto; }

    /* Pagination: fewer buttons, same min-size */
    .page-btn { min-width: 36px; min-height: 44px; font-size: 0.7rem; }

    /* Filiation cycles: stack vertically */
    .cycle-item { flex-direction: column; align-items: flex-start; }

    /* Form grid: single column */
    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-grid label { font-weight: bold; }

    /* Trash rows: stack */
    .trash-row { flex-direction: column; align-items: flex-start; }
}

/* ---- Tablette (769–1024px) -------------------------------------------- */
@media (min-width: 769px) and (max-width: 1024px) {

    :root { --sidebar-width: 170px; }

    .tab-btn  { font-size: 0.68rem; padding: 0.38rem 0.6rem; }
    .form-grid { grid-template-columns: 160px 1fr; }
}
