@media (orientation: landscape)  {
    body {
        font-family: 'Arial', sans-serif;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        min-height: 100vh;
    }

    .header {
        text-align: center;
        padding: 20px;
    }

    .logo {
        max-width: 200px;
        height: auto;
    }

    .content {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        padding: 20px;
    }

    .qrcode {
        margin-bottom: 20px;
        width: 200px;
        height: 200px;
    }

    .message {
        font-size: 24px;
        color: #333;
        max-width: 600px;
        margin: 0 auto;
    }

    .mobile-content {
        display: none;
        padding: 20px;
        text-align: center;
    }
}
/* Media query pour mobile */
@media (orientation: portrait)  {
    body{
        margin:unset;
        width:100%;
        height:100%;
        background: black;
    }
    .content {
        display: none;
    }
    
    .mobile-content {
        flex: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        color: #333;
        flex-direction: column;
        height: auto;
    }


   .header {
        background: white;
        display: flex;
        align-items: center;
        justify-content: center; /* Centre les éléments horizontalement */
        position: fixed; /* Nécessaire pour positionner l'image de gauche */
        padding: 5px;
        top:0px;
        width:100%;
        box-shadow: 0px 5px 5px 5px rgba(255, 255, 255, 1);
        z-index:999;
    }

    .back {
        position: absolute;
        left: 0; /* Colle l'image tout à gauche */
        cursor: pointer;
        max-width: 64px; /* Ajuste la taille si nécessaire */
    }

    .logo {
        max-width: 200px; /* Ajuste la taille si nécessaire */
    }

    .filters {
        background: white;
        position: fixed;
        top:70px;
        display: flex;
        overflow-x: auto;
        padding: 5px;
        gap: 5px;
        width:99%;
        margin-right: 5px;
        margin-left: 5px;
        box-shadow: 0px 5px 5px 5px rgba(255, 255, 255, 1);
        z-index:9000;
    }
    .search-container {
        background: white;
        position: fixed;
        top:115px;
        display: flex;
        overflow-x: auto;
        padding: 5px;
        padding-top: 10px;
        gap: 5px;
        width:auto;
        margin-right: auto;
        margin-left: auto;
        box-shadow: 0px 5px 5px 5px rgba(255, 255, 255, 1);
        z-index:10000;
    }

    #searchBtn {
        background: white;
        padding: 5px;
        cursor: pointer;
        border: unset;
        border-radius: 5px;
        box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
        transition: box-shadow 0.2s ease-in-out;
        font-size:11px;
        font-weight: bold;
    }

    #searchBtn:hover {
        background: #02693A;
        color: white;
        border: none;
        box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.7);
    }

    .filter {
        background: white;
        padding: 5px;
        cursor: pointer;
        border: unset;
        border-radius: 5px;
        box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.2);
        transition: box-shadow 0.2s ease-in-out;
        font-size:11px;
        font-weight: bold;
    }

    .filter.active {
        background: #02693A;
        color: white;
        border: none;
        box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.7);
    }

    .library {
        position: fixed;
        top:120px;
        flex-grow: 1;
        padding: 10px;
        height: calc(100% - 200px);
        overflow-x:auto;
        padding-top:50px;
        width: 90%; /* Assure que la grille prend toute la largeur */
    }

    .grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); /* Augmenter la largeur min */
        gap: 10px; /* Espacement entre les cartes */
        width: 100%; /* Assure que la grille prend toute la largeur */
    }

    .card {
        background: rgba(64,64,64,1);
        color:white;
        font-size: 12px;
        padding: 10px;
        text-align: center;
        border-radius: 10px;
        box-shadow: 0px 2px 5px rgba(255, 255, 255, 0.1);
        transition: all 0.2s ease-in-out;
    }

    .card:hover {
        box-shadow: 0px 5px 0px 0px rgba(255, 255, 255, 0.2);
        transform: translateY(-5px);
    }

    .thumbnail {
        width: 100px; /* Adapter à la taille de la carte */
        height: 100px; /* Ajustement dynamique */
        aspect-ratio: 1; /* Garde une forme carrée */
        background: lightgray;
        border-radius: 10px;
        margin: auto;
    }

    .thumbnail img{
        border-radius: 10px;
        width: 100px; /* Adapter à la taille de la carte */
        height: 100px; /* Ajustement dynamique */
    }
    .footer {
        display: flex;
        justify-content: space-around;
        padding: 10px;
        background: #e3d3f5;
    }

    .nav {
        background: none;
        border: none;
        font-size: 16px;
        cursor: pointer;
    }

    .nav.active {
        color: purple;
    }

    /* Conteneur principal */
    .main-content {
        width: 90%;
        margin-top: 80px;
        color:white;
    }
    /* Partie image + texte */
    .header-content {
        display: flex;
        align-items: center; /* Aligne l'image et le texte horizontalement */
        gap: 15px;
        width: 100%;
    }

    /* Style de l'image */
    .image-placeholder {
        width: 100px;
        height: 100px;
        background: #c4c4c4;
        border-radius: 10px;
        flex-shrink: 0; /* Empêche l'image de rétrécir */
    }
    /* Style de l'image */
    .image-placeholder img{
        width: 100px;
        height: 100px;
        border-radius: 10px;
    }

    /* Conteneur du texte */
    .text-content {
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    /* Style du titre */
    .text-content h2 {
        margin: 0;
        font-size: 20px;
    }

    /* Style du sous-titre */
    .text-content .sub-text {
        color: gray;
        font-size: 14px;
        margin: 5px 0;
    }

    /* Description en dessous */
    .description-container {
        margin: 10px;
        flex-direction: column;
        gap: 10px;
        border-radius: 5px;
        background: rgba(64,64,64,1);

    }

    .description {
        font-size: 14px;
        color: white;
        margin: 5px;
        padding: 5px;
    }

    h2 {
        margin: 10px 0;
    }

    /* Section Title */
    .related-section {
        width: 90%;
        height: 90%;
        margin-bottom: 50px;
    }

    .section-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-weight: bold;
        font-size: 16px;
    }

    .arrow {
        font-size: 20px;
    }

    /* Related Cards */
    .related-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    /* Related Cards */
    .related-title {
        width:100%;
        text-align:center;
        border-bottom:1px solid rgba(255,255,255,0.5);
    }
    /* Related Cards */
    .related-block {
        display: flex;
        align-items: center;
    }
    .Lire{
        text-align: right;
        width:100%;
    }
    .related-card {
        display: flex;
        flex-direction: column;
        color: white;
        background: rgba(64,64,64,1);
        padding: 10px;
        border-radius: 10px;
        box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
        align-items: center;
        transition: all 0.3s ease;
        overflow: hidden; /* Assure que la transition fonctionne bien */
    }

    .image-placeholder.small {
        width: 50px;
        height: 50px;
        margin-right: 15px;
    }
    .image-placeholder.small img{
        width: 50px;
        height: 50px;
    }

    .related-info {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        position: relative;
    }
    .related-info p {
        display: -webkit-box;
        -webkit-line-clamp: 4; /* Nombre de lignes */
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        transition: all 0.3s ease;
    }


    .related-info b {
        align-self: flex-end; /* Aligne à droite */
        cursor: pointer; /* Pour montrer que c'est cliquable */
    }

    /* Classe pour afficher tout le texte */
    .expanded {
        display: block !important; /* Affiche tout */
        -webkit-line-clamp: none !important;
    }
    h4 {
        margin: 0;
    }

    p {
        margin: 5px 0;
    }
    .meta-info {
        display: flex;
        justify-content: space-between;
        font-size: 12px;
    }
    .carousel-container {
        position: relative;
        width: 80%;
        max-width: 600px;
        margin: auto;
        overflow: hidden;
        border-radius: 10px;
        box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    }

    .carousel {
        display: flex;
        transition: transform 0.4s ease-in-out;
    }

    .carousel img {
        width: 100%;
        flex-shrink: 0;
        object-fit: cover;
    }

    .btn {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(0,0,0,0.5);
        color: white;
        border: none;
        padding: 10px;
        cursor: pointer;
        border-radius: 5px;
        z-index: 10;
    }

    .prev { left: 10px; }
    .next { right: 10px; }

}