/* presenter-responsive.css - Media queries pour responsive */
/* Version 60 */

/* ==================== TABLETTES (max-width: 1024px) ==================== */

@media (max-width: 1024px) {
    .thumbnails-panel {
        width: 150px;
    }
    
    .slide {
        width: 100%;
        max-width: 800px;
        height: auto;
        aspect-ratio: 16/9;
        padding: 2rem;
    }
    
    .editor-toolbar {
        padding: 0.6rem 1rem;
    }
    
    .editor-header {
        padding: 0.6rem 1rem;
    }
    
    .header-left h1 {
        font-size: 1.2rem;
    }
    
    .presentation-name-input {
        width: 15ch;
        min-width: unset;
    }
}

/* ==================== TABLETTES PORTRAIT (max-width: 768px) ==================== */

@media (max-width: 768px) {
    .editor-header {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .header-left {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .thumbnails-panel {
        width: 120px;
    }
    
    .slide {
        padding: 1.5rem;
    }
    
    .slide h1 {
        font-size: 2rem;
    }
    
    .slide h2 {
        font-size: 1.5rem;
    }
    
    .slide h3 {
        font-size: 1.2rem;
    }
    
    .slide p,
    .slide ul,
    .slide ol {
        font-size: 1rem;
    }
    
    .editor-toolbar {
        padding: 0.5rem;
        gap: 0.25rem;
    }
    
    .btn-tool {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .btn-icon {
        padding: 0.4rem 0.6rem;
        font-size: 1rem;
    }
    
    .btn-nav-icon {
        padding: 0.3rem 0.6rem;
        font-size: 1rem;
    }
    
    .slide-counter {
        min-width: 60px;
        font-size: 0.9rem;
    }
    
    .toolbar-separator {
        height: 25px;
    }
    
    .slide-columns {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .slide-blocks {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .presentation-name-input {
        min-width: 100%;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
    }
    
    .template-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* ==================== MOBILES (max-width: 480px) ==================== */

@media (max-width: 480px) {
    .thumbnails-panel {
        display: none;
    }
    
    .slide-preview {
        padding: 1rem;
    }
    
    .slide {
        width: 100%;
        padding: 1rem;
    }
    
    .slide h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .slide h2 {
        font-size: 1.2rem;
        margin-bottom: 0.75rem;
    }
    
    .slide h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .slide p,
    .slide ul,
    .slide ol {
        font-size: 0.9rem;
        line-height: 1.5;
    }
    
    .slide ul,
    .slide ol {
        margin-left: 1.5rem;
    }
    
    .header-left h1 {
        font-size: 1rem;
    }
    
    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .btn-tool {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .btn-icon {
        padding: 0.3rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .btn-nav-icon {
        padding: 0.25rem 0.5rem;
        font-size: 0.9rem;
    }
    
    .slide-counter {
        min-width: 50px;
        font-size: 0.85rem;
    }
    
    .toolbar-separator {
        display: none;
    }
    
    .code-section {
        max-height: 200px;
    }
    
    .markdown-editor {
        font-size: 0.8rem;
        min-height: 150px;
    }
    
    .style-menu,
    .theme-menu {
        max-width: 100%;
        left: auto;
        right: 0;
    }
    
    .style-option {
        padding: 0.75rem;
    }
    
    .style-icon {
        font-size: 1.5rem;
    }
    
    .style-info strong {
        font-size: 0.9rem;
    }
    
    .style-info small {
        font-size: 0.8rem;
    }
    
    .template-grid {
        grid-template-columns: 1fr;
    }
    
    .presentation-controls {
        bottom: 1rem;
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .btn-pres {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .presentation-progress {
        padding: 0 0.5rem;
        font-size: 0.9rem;
    }
}

/* ==================== MODE PAYSAGE MOBILE ==================== */

@media (max-width: 768px) and (orientation: landscape) {
    .slide-preview {
        padding: 0.5rem;
    }
    
    .slide {
        padding: 1rem;
    }
    
    .editor-toolbar {
        padding: 0.5rem;
    }
}

/* ==================== GRANDS ÉCRANS (min-width: 1920px) ==================== */

@media (min-width: 1920px) {
    .slide {
        width: 1280px;
        height: 720px;
        padding: 4rem;
    }
    
    .slide h1 {
        font-size: 3rem;
    }
    
    .slide h2 {
        font-size: 2.2rem;
    }
    
    .slide h3 {
        font-size: 1.8rem;
    }
    
    .slide p,
    .slide ul,
    .slide ol {
        font-size: 1.3rem;
    }
    
    .thumbnails-panel {
        width: 250px;
    }
    
    .thumbnail-preview {
        font-size: 0.75rem;
    }
}

/* ==================== IMPRESSION ==================== */

@media print {
    .editor-header,
    .editor-toolbar,
    .thumbnails-panel,
    .slide-controls,
    .code-section,
    .status-message,
    .presentation-controls {
        display: none !important;
    }
    
    .editor-container {
        height: auto;
    }
    
    .editor-main {
        display: block;
    }
    
    .slide {
        width: 100%;
        height: auto;
        box-shadow: none;
        page-break-after: always;
        margin-bottom: 2rem;
    }
    
    .slide-number {
        display: none;
    }
}

/* presenter overflow <=640px */
#btnPresenterOverflow { display: none; }
@media (max-width: 640px) {
    .mb-hide-sm { display: none !important; }
    #btnPresenterOverflow { display: inline-flex !important; align-items: center; justify-content: center; }
    #presenterMenubar .toolbar-separator { display: none !important; }
}

/* btn-txt hide on mobile */
@media (max-width: 640px) {
    .btn-txt { display: none; }
}

/* editor-header compact mobile */
@media (max-width: 768px) {
    /* annule le flex-direction:column du breakpoint 768px pour notre nouveau header */
    .editor-header {
        flex-direction: row !important;
        align-items: center !important;
    }
}
@media (max-width: 640px) {
    .editor-header {
        padding: 4px 8px !important;
        min-height: unset !important;
        flex-wrap: nowrap !important;
        overflow: visible !important;
        gap: 2px !important;
    }
    .editor-header .toolbar-separator {
        display: none !important;
    }
}



.slide-with-nav {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.slide-with-nav .slide-preview {
    flex: 1;
    min-height: 0;
}
/* ==================== BARRE NAV SLIDE ==================== */
.slide-nav-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    height: 46px;
    flex-shrink: 0;
    background: #e9ecef;
}
.slide-nav-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: #1a3a6b;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.slide-nav-btn:hover { background: #2a5abf; }
.slide-nav-btn:active { transform: scale(.92); }
.slide-nav-counter {
    font-size: .95rem;
    font-weight: 600;
    color: #444;
    min-width: 56px;
    text-align: center;
}

/* ==================== ÉCRAN FIXE SUR TABLETTE / SMARTPHONE (2026-11-17) ====================
   Comme sur ordinateur : l'en-tête reste en place, seules les zones de l'éditeur défilent.
   100vh dépasse la partie visible sur iOS/Android (barre d'adresse) → toute la page défilait
   et la 1re ligne de l'en-tête pouvait disparaître. dvh = hauteur visible.
   presenter_viewport.js ajuste en plus la hauteur et la position quand le clavier s'ouvre. */
html {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}
body {
    height: 100vh;
    height: 100dvh;
    overscroll-behavior: none;
}
html.pr-touch-viewport body {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
}
@media print {
    html { height: auto; overflow: visible; }
    html.pr-touch-viewport body,
    body { position: static !important; height: auto !important; }
}

/* ==================== BARRES D'OUTILS SOBRES, STYLE WRITER (2026-11-17) ====================
   Boutons transparents de 28 px, fond seulement au survol, barres claires et compactes.
   (Ligne 2 « .editor-header » : n'est PAS l'en-tête bleu #presenterHeader.) */
.editor-container .editor-header {
    background: #e8ecf5;
    color: #333;
    padding: 4px 10px;
    min-height: 38px;
    gap: 3px;
    box-shadow: none;
    border-bottom: 1px solid #c5cad8;
}
.editor-container .editor-toolbar {
    background: #f3f4f6;
    padding: 5px 10px;
    min-height: 40px;
    gap: 2px;
    border-bottom: 1px solid #d8dce4;
}
.editor-container .btn-tool,
.editor-container .btn-icon,
.editor-container .btn-nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    font-size: 13px;
    line-height: 1;
    color: #333;
    box-shadow: none;
    transform: none;
    transition: background .1s, border-color .1s;
}
.editor-container .btn-tool:hover,
.editor-container .btn-icon:hover,
.editor-container .btn-nav-icon:hover {
    background: #e2e5ea;
    border-color: #c5c9d0;
    transform: none;
}
.editor-container .btn-tool.active {
    background: #dce8ff;
    border-color: #aac0f0;
    color: #1a56db;
}
.editor-container .btn-tool img,
.editor-container .btn-icon img {
    width: 18px;
    height: 18px;
}
.editor-container select.btn-tool {
    height: 28px;
    padding: 0 8px;
    border: 1px solid #c5c9d0;
    background: #fff;
    font-size: 13px;
}
.editor-container .toolbar-separator {
    width: 1px;
    height: 20px;
    background: #c5c9d0;
    margin: 0 3px;
    align-self: center;
}
.editor-container .slide-counter {
    font-size: 13px;
    min-width: 48px;
}
/* Tactile : cibles un peu plus grandes, comme Writer */
@media (max-width: 768px) {
    .editor-container .btn-tool,
    .editor-container .btn-icon,
    .editor-container .btn-nav-icon {
        min-width: 36px;
        height: 36px;
        font-size: 15px;
    }
    .editor-container select.btn-tool { height: 36px; font-size: 14px; }
    .editor-container .editor-header,
    .editor-container .editor-toolbar { min-height: 44px; padding: 4px 8px; }
}
.editor-container .btn-tool,
.editor-container .btn-icon { white-space: nowrap; }

/* ==================== ÉDITEUR : DIAPOSITIVE EN HAUT (2026-11-26) ====================
   Jamais de grand vide gris au-dessus. Le centrage vertical en créait sur les écrans
   hauts, et le centrage flex rendait la partie débordante impossible à atteindre.
   Horizontalement, les marges « auto » centrent sans rien couper. */
.slide-with-nav .slide-preview {
    align-items: flex-start;
    justify-content: flex-start;
    padding: 12px;
}
.slide-with-nav .slide-preview > * {
    margin-left: auto;
    margin-right: auto;
}
