/* presenter-slides.css - Styles des slides, layouts, thumbnails */
/* Version 51 - Ajout template fullscreen-text */

/* ==================== IMAGES MULTIPLES CÔTE À CÔTE ==================== */

.marp-images-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin: 1rem 0;
}

.marp-width-image {
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ==================== LAYOUTS MARP : IMAGE GAUCHE/DROITE ==================== */

/* Layout : Image GAUCHE + Texte DROITE */
.slide.marp-layout-bg-left {
    display: grid;
    grid-template-columns: var(--bg-width, 40%) 1fr;
    gap: 0;
    padding: 0;
    align-items: stretch;
}

.marp-bg-left {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 100%;
}

/* Layout : Image DROITE + Texte GAUCHE */
.slide.marp-layout-bg-right {
    display: grid;
    grid-template-columns: 1fr var(--bg-width, 40%);
    gap: 0;
    padding: 0;
    align-items: stretch;
}

.marp-bg-right {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 100%;
    order: 2; /* Force l'image à droite visuellement */
}

.marp-center-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 50% ;
}

/* Wrapper de contenu (texte) */
.marp-content-wrapper {
    padding: 2rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.slide.marp-layout-bg-right .marp-content-wrapper {
    order: 1; /* Force le texte à gauche visuellement */
}

/* ======================================================= */

/* Layout : 2 IMAGES EN BAS (40% hauteur) + TEXTE EN HAUT (60%) */
.slide.marp-layout-images-bottom {
    display: grid;
    grid-template-rows: 1fr 40%;
    gap: 0;
    padding: 0;
    align-items: stretch;
}

.slide.marp-layout-images-bottom .marp-images-row {
    width: 100%;
    height: 100%;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr; /* 50% + 50% = toute la largeur */
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    grid-row: 2;
}

.slide.marp-layout-images-bottom .marp-images-row img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Remplit l'espace */
    border-radius: 8px;
}

.slide.marp-layout-images-bottom .marp-content-wrapper {
    padding: 2rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    grid-row: 1;
}

/* ==================== SLIDE DE BASE ==================== */

.slide {
    width: 960px;
    height: 540px;
    background: white;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 3rem;
    position: relative;
    overflow: auto;
}

/* ==================== TITRES DES SLIDES ==================== */

.slide h1 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--title-color, #007bff);
}

/* Layouts spécifiques où le titre reste à gauche */
.layout-title-2cols h1,
.layout-title-3cols h1,
.layout-title-4blocks h1 {
    text-align: left;
}

.slide h2 {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
    color: var(--subtitle-color, #0056b3);
    text-align: left;
}

.slide h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--text-color, #333);
    text-align: left;
}

.slide p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    color: var(--text-color, #333);
}

.slide ul,
.slide ol {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-left: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color, #333);
}

.slide img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem auto;
}

.slide blockquote {
    border-left: 4px solid var(--primary-color, #007bff);
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: #666;
}

.slide code {
    background: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9em;
}

/* ==================== LAYOUTS ==================== */

.layout-title-center {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.layout-title-center h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.layout-title-center h2 {
    font-size: 2rem;
    font-weight: 400;
    text-align: center;
}

/* ==================== COLONNES ==================== */

.slide-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.slide-column {
    background: var(--bg-columns, #f8f9fa);
    padding: 1.5rem;
    border-radius: 8px;
}

.slide-column h3 {
    margin-top: 0;
}

/* ==================== BLOCS 2x2 ==================== */

.slide-blocks {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.slide-block {
    background: var(--bg-columns, #f8f9fa);
    padding: 1.5rem;
    border-radius: 8px;
}

.slide-block h3 {
    margin-top: 0;
}

/* ==================== NUMÉRO DE SLIDE ==================== */

.slide-number {
    position: absolute;
    bottom: 1rem;
    right: 1.5rem;
    font-size: 0.9rem;
    color: #999;
}

/* ==================== THUMBNAILS ==================== */

.thumbnail {
    margin-bottom: 1rem;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: all 0.2s;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.thumbnail:hover {
    border-color: var(--primary-color);
    transform: scale(1.02);
}

.thumbnail.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0,123,255,0.25);
}

.thumbnail-preview {
    width: 100%;
    aspect-ratio: 16/9;
    background: white;
    border-radius: 2px;
    overflow: hidden;
    padding: 0.5rem;
    font-size: 0.65rem;
}

.thumbnail-preview h1 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.thumbnail-preview h2 {
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

.thumbnail-preview h3 {
    font-size: 0.65rem;
    margin-bottom: 0.2rem;
}

.thumbnail-preview p,
.thumbnail-preview li {
    font-size: 0.55rem;
    line-height: 1.2;
}

.thumbnail-preview ul,
.thumbnail-preview ol {
    padding-left: 1rem;
    margin: 0.2rem 0;
}

.thumbnail-number {
    padding: 0.25rem;
    text-align: center;
    font-size: 0.75rem;
    color: #666;
    background: #f8f9fa;
}

/* ==================== DRAG & DROP ==================== */

.thumbnail[draggable="true"] {
    cursor: move;
}

.thumbnail.dragging {
    opacity: 0.4;
}


/* ==================== LAYOUT IMAGE + TEXTE HORIZONTAL ==================== */

/* Colonnes égales par défaut */
.slide-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    height: 100%;
}

.slide-column {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Images dans colonnes - taille optimale */
.slide-column img {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Texte dans colonnes */
.slide-column p,
.slide-column ul,
.slide-column ol {
    font-size: 1.1rem;
    line-height: 1.6;
}

.slide-column ul,
.slide-column ol {
    padding-left: 1.5rem;
}

.slide-column li {
    margin-bottom: 0.5rem;
}

/* ==================== TEMPLATE 6 : IMAGE PLEIN ÉCRAN + TEXTE PAR-DESSUS ==================== */

/* Template image plein écran avec texte centré (style livre enfant) */
.slide.fullscreen-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.slide.fullscreen-text h1,
.slide.fullscreen-text h2,
.slide.fullscreen-text p {
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 2rem 3rem;
    border-radius: 15px;
    margin: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 80%;
    z-index: 10;
}

.slide.fullscreen-text h1 {
    font-size: 3em;
    font-weight: bold;
    color: #333;
    text-shadow: 1px 1px 3px rgba(255, 255, 255, 0.8);
    margin-bottom: 1rem;
}

.slide.fullscreen-text h2 {
    font-size: 2em;
    color: #555;
    margin-bottom: 0.75rem;
}

.slide.fullscreen-text p {
    font-size: 1.4em;
    color: #666;
    line-height: 1.8;
}

/* Variante avec fond sombre pour texte blanc */
.slide.fullscreen-text.dark-overlay h1,
.slide.fullscreen-text.dark-overlay h2,
.slide.fullscreen-text.dark-overlay p {
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
}

/* Animation d'apparition douce */
.slide.fullscreen-text h1,
.slide.fullscreen-text h2,
.slide.fullscreen-text p {
    animation: fadeInScale 0.8s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Support pour les images de fond avec balise img en mode background */
.slide.fullscreen-text img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    margin: 0;
}

/* ==================== LAYOUT IMAGE CENTRÉE EN HAUT ==================== */

/* Layout : IMAGE EN HAUT (40% hauteur, pleine largeur) + TEXTE BAS (60%) */
.slide.marp-layout-center-top {
    display: grid;
    grid-template-rows: 40% 1fr; /* 40% image, 60% texte */
    gap: 0;
    padding: 0;
    align-items: stretch;
}

.slide.marp-layout-center-top .marp-center-image {
    width: 100% !important;
    height: 100%;
    max-height: none !important;
    object-fit: cover;
    margin: 0 !important;
    border-radius: 0;
    grid-row: 1; /* Force l'image en haut */
}

.slide.marp-layout-center-top .marp-content-wrapper {
    padding: 2rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    grid-row: 2; /* Force le texte en bas */
}

/* ------------------------------------------------------- */

/* ==================== LAYOUTS MARP : IMAGE HAUT / BAS ==================== */

/* Layout : Image HAUT (pleine largeur) + Texte BAS */
.slide.marp-layout-bg-top {
    display: grid;
    grid-template-rows: var(--bg-height, 45%) 1fr;
    gap: 0;
    padding: 0;
    align-items: stretch;
}

.marp-bg-top {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    height: 100%;
}

/* Layout : Image BAS (pleine largeur) + Texte HAUT */
.slide.marp-layout-bg-bottom {
    display: grid;
    grid-template-rows: 1fr var(--bg-height, 45%);
    gap: 0;
    padding: 0;
    align-items: stretch;
}

.marp-bg-bottom {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
    height: 100%;
    order: 2; /* Force l'image en bas visuellement */
}

.slide.marp-layout-bg-bottom .marp-content-wrapper {
    order: 1; /* Force le texte en haut visuellement */
}

/* ------------------------------------------------------- */


/* Responsive pour template fullscreen */
@media (max-width: 768px) {
    .slide.fullscreen-text h1 {
        font-size: 2em;
        padding: 1.5rem 2rem;
    }
    
    .slide.fullscreen-text h2 {
        font-size: 1.5em;
        padding: 1.25rem 1.75rem;
    }
    
    .slide.fullscreen-text p {
        font-size: 1.1em;
        padding: 1rem 1.5rem;
    }
    
    .slide.fullscreen-text h1,
    .slide.fullscreen-text h2,
    .slide.fullscreen-text p {
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .slide.fullscreen-text h1 {
        font-size: 1.5em;
        padding: 1rem 1.5rem;
    }
    
    .slide.fullscreen-text h2 {
        font-size: 1.2em;
        padding: 0.875rem 1.25rem;
    }
    
    .slide.fullscreen-text p {
        font-size: 1em;
        padding: 0.75rem 1rem;
    }
    
    .slide.fullscreen-text h1,
    .slide.fullscreen-text h2,
    .slide.fullscreen-text p {
        max-width: 95%;
        margin: 1rem;
    }
}



/* ==================== TRANSITIONS DE SLIDES (ajout 2026-09-09) ==================== */
/* Classe posée sur .slide au moment du rendu par le JS de navigation.
   Utilisé par : éditeur (mode Présenter), presenter_view.php. */

@keyframes prst-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes prst-slide-fwd {
    from { opacity: 0; transform: translateX(6%); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes prst-slide-bwd {
    from { opacity: 0; transform: translateX(-6%); }
    to   { opacity: 1; transform: translateX(0); }
}

.slide.prst-fade      { animation: prst-fade 0.8s ease both; }
.slide.prst-slide-fwd { animation: prst-slide-fwd 0.7s cubic-bezier(.2,.7,.2,1) both; }
.slide.prst-slide-bwd { animation: prst-slide-bwd 0.7s cubic-bezier(.2,.7,.2,1) both; }

@media (prefers-reduced-motion: reduce) {
    .slide.prst-fade,
    .slide.prst-slide-fwd,
    .slide.prst-slide-bwd { animation: prst-fade 0.15s ease both; }
}

/* Mode « point par point » : fragments masqués révélés au clic (prstCollectFragments). */
.slide.prst-reveal .prst-frag {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}
.slide.prst-reveal .prst-frag.prst-frag-shown {
    opacity: 1;
    transform: none;
}
@media (prefers-reduced-motion: reduce) {
    .slide.prst-reveal .prst-frag { transition: opacity 0.15s ease; transform: none; }
}
