/* -------------------------------------------------------- */
/* main2.css – READ PAGE (CLEAN + READABLE + RESPONSIVE)     */
/* -------------------------------------------------------- */


/* ========================= */
/* MAIN                      */
/* ========================= */

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}


/* ========================= */
/* IMAGE PHP                 */
/* ========================= */

.main-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 20px auto;
    border-radius: 12px;

    box-shadow:
        0 6px 25px rgba(0,0,0,0.6),
        0 0 8px rgba(255,255,255,0.3);

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;

    transform: translateZ(0);
    backface-visibility: hidden;
}

.main-image:hover {
    transform: translateY(-5px) translateZ(0);

    box-shadow:
        0 10px 35px rgba(0,0,0,0.75),
        0 0 10px rgba(255,255,255,0.4);
}


/* ========================= */
/* CONTAINER LECTURE         */
/* ========================= */

.read-container {
    width: 100%;
    max-width: 800px;

    margin: 20px auto;
    padding: 25px;

    display: flex;
    flex-direction: column;
    gap: 15px;

    background: rgba(255,255,255,0.9);

    border-radius: 12px;

    box-shadow:
        0 6px 25px rgba(0,0,0,0.6),
        0 0 8px rgba(255,255,255,0.3);

    transform: translateZ(0);
    backface-visibility: hidden;
}


/* ========================= */
/* TITRE PAGE                */
/* ========================= */

.read-container h2 {
    text-align: center;
    margin-top: 0;
    color: #0055A4;
}


/* ========================= */
/* LISTE DES FICHIERS        */
/* ========================= */

.file-list {
    max-height: 680px;
    overflow-y: auto;

    padding: 10px;

    border: 1px solid #ddd;
    border-radius: 8px;

    background: white;
}

.file-list div {
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
}

.file-list div:hover {
    background: rgba(0,0,0,0.08);
}


/* ========================= */
/* ZONE DE LECTURE           */
/* ========================= */

.read-content {
    margin-top: 15px;
    padding: 20px;

    border-radius: 10px;

    background: rgba(255,255,255,0.95);

    box-shadow:
        inset 0 0 10px rgba(0,0,0,0.05);

    word-break: break-word;
}


/* ========================= */
/* TYPOGRAPHIE JSON          */
/* ========================= */

/* H2 */

.read-content h2 {
    font-size: 1.3em;
    font-weight: 800;
    text-align: center;

    color: #0055A4;

    margin: 18px 0 10px 0;
}


/* H3 */

.read-content h3 {
    font-size: 1.2em;
    font-weight: 700;
    text-align: left;

    color: #0077cc;

    margin: 16px 0 8px 0;
}


/* H4 */

.read-content h4 {
    font-size: 1.1em;
    font-weight: 700;
    text-align: left;

    margin: 14px 0 6px 0;
}


/* H5 */

.read-content h5 {
    font-size: 1em;
    font-weight: 600;
    text-align: left;

    margin: 12px 0 5px 0;
}


/* H6 */

.read-content h6 {
    font-size: 0.9em;
    font-weight: 600;
    text-align: left;

    margin: 10px 0 5px 0;
}


/* TEXTE */

.read-content p {
    font-size: 1.05em;
    line-height: 1.7;

    color: #111;

    margin-bottom: 12px;

    text-align: justify;

    white-space: pre-wrap;
}


/* ========================= */
/* HTML DANS JSON            */
/* ========================= */

.read-content img {
    max-width: 100%;
    border-radius: 8px;
    margin: 10px 0;
}

.read-content video,
.read-content iframe {
    width: 100%;
    max-height: 400px;
    border-radius: 8px;
    margin: 10px 0;
}

.read-content a {
    color: #0077cc;
    text-decoration: underline;
}

.read-content strong {
    font-weight: bold;
}

.read-content em {
    font-style: italic;
}


/* ========================= */
/* SCROLL CLEAN              */
/* ========================= */

.read-content::-webkit-scrollbar,
.file-list::-webkit-scrollbar {
    width: 6px;
}

.read-content::-webkit-scrollbar-thumb,
.file-list::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
}


/* ======================================================== */
/* ====================== RESPONSIVE ======================= */
/* ======================================================== */


/* -------- TABLET -------- */

@media (max-width: 1024px) {

    main {
        padding: 18px;
    }

    .read-container {
        max-width: 95%;
        padding: 20px;
    }

    .read-content {
        padding: 18px;
    }

    .read-content p {
        font-size: 1em;
    }
}


/* -------- MOBILE -------- */

@media (max-width: 768px) {

    main {
        padding: 15px;
    }

    .read-container {
        padding: 15px;
        gap: 12px;
    }

    .file-list {
        max-height: 180px;
    }

    .read-content {
        padding: 15px;
    }

    .read-content p {
        font-size: 0.95em;
        text-align: left;
    }
}


/* -------- SMALL MOBILE -------- */

@media (max-width: 480px) {

    .read-container {
        padding: 12px;
    }

    .read-content {
        padding: 12px;
    }

    .read-content p {
        font-size: 0.9em;
    }
}