/* =============================================
   ARBRES.CSS
   Requereix plantilla.css com a base.
   ============================================= */

/* ——— LAYOUT PRINCIPAL ——— */
.cos_interior {
    display: flex;
    gap: clamp(20px, 2.5vw, 40px);
    height: 100%;
    overflow: hidden;
    padding-top: clamp(14px, 2.5vh, 30px);
}

/* ——— ESQUERRA ——— */
.esquerra {
    flex: 1;
    align-self: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: clamp(10px, 1.5vh, 18px) clamp(6px, 1vh, 10px);
    margin: clamp(10px, 1.8vh, 20px) 0;
    max-height: 90vh;
    border: 1px solid #e5e0d8;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.15);
}

.caixa_texte {
    font-size: clamp(0.78rem, 0.82vw, 0.92rem);
    line-height: 1.6;
    color: #555;
    background: #fdfcfb;
    padding: clamp(10px, 1.2vh, 15px);
    border: 1px solid #e5e0d8;
    border-radius: 4px;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.15);
    overflow-y: auto;
    flex: none;
    min-height: 4vh;
    max-height: 40vh;
}

.titol_interior {
    font-size: clamp(0.86rem, 0.94vw, 1.01rem);
    font-weight: bold;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #000000;
    text-align: center;
    padding: 10px;
    background: #f7f1eb;
    border: 1px solid #e5e0d8;
    border-radius: 4px;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.15);
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    margin-top: 0;
    margin-bottom: 8px;
}

.descripcio_autor {
    text-align: justify;
    text-indent: 1.5em;
}

.autor {
    text-align: right;
    font-style: italic;
    color: #7a5c3a;
    margin-top: 12px;
}

/* ——— BOTONS ——— */
.panell_botons {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: auto;
    margin-bottom: clamp(10px, 1.5vh, 20px);
}

.fila_boto {
    display: flex;
}

.fila_boto a {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(6px, 0.8vh, 8px) 10px;
    border: 1px solid #d5c9b8;
    border-radius: 4px;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.15);
    background-color: #f0ece6;
    color: #555;
    text-decoration: none;
    font-size: clamp(0.70rem, 0.72vw, 0.80rem);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: all 0.25s ease;
}

.fila_boto a:hover {
    background-color: #e5ddd4;
    border-color: #b8ac9e;
    color: #333;
}

/* ——— DRETA ——— */
.dreta {
    flex: 3;
    height: 100%;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ——— TEXT DRETA ——— */
.text-dreta {
    padding: clamp(16px, 2.5vh, 32px) clamp(20px, 3vw, 48px);
    overflow-y: auto;
    height: 100%;
    font-size: clamp(0.82rem, 0.88vw, 0.98rem);
    line-height: 1.8;
    color: #444;
    text-align: justify;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e0d8;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.15);
}

.text-titol {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(2rem, 2.4vw, 2.6rem);
    font-weight: normal;
    color: #4a3828;
    text-align: center;
    margin-bottom: 1.2em;
    padding-bottom: 0.5em;
    border-bottom: 1px solid #e0d8cc;
}

.text-dreta p {
    text-indent: 1.5em;
    margin-bottom: 0.8em;
}

.text-dreta .autor {
    text-indent: 0;
    text-align: right;
    font-style: italic;
    color: #7a5c3a;
    margin-top: 20px;
}

.text-subtitol {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(0.88rem, 1vw, 1.05rem);
    font-weight: normal;
    color: #4a3828;
    margin: 1.5em 0 0.8em;
    padding-top: 1em;
    border-top: 1px solid #e0d8cc;
}

.zones-taula {
    width: 100%;
    border-collapse: collapse;
    margin: 0.8em 0 1em;
    font-size: 0.88em;
    color: #555;
}

.zones-taula td {
    padding: 3px 10px 3px 0;
    vertical-align: top;
}

.zones-taula td:first-child {
    white-space: nowrap;
    font-style: italic;
}

.zones-taula td:nth-child(2) {
    white-space: nowrap;
    font-weight: bold;
    padding-right: 16px;
}

.nota {
    font-size: 0.82em;
    color: #999;
    font-style: italic;
    text-indent: 0 !important;
    margin-top: 8px;
}

.fila_boto a.actiu {
    background-color: #5d2e0a;
    color: #fff;
    border-color: #5d2e0a;
}

/* ——— DOCUMENT JPG ——— */
.pagines-doc {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 8px;
}

.pagines-doc img {
    width: 100%;
    border: 1px solid #d5c9b8;
    outline: 2px solid #e5e0d8;
    box-shadow: 8px 12px 8px rgba(0,0,0,0.3);
    cursor: zoom-in;
}

/* ——— VISOR ZOOM ——— */
.visor-zoom {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.visor-zoom.visible { display: flex; }

.visor-zoom-imatge {
    width: 90vw;
    height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: grab;
}

.visor-zoom-imatge img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center center;
    user-select: none;
    pointer-events: none;
}

.visor-zoom-hint {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.1rem;
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.08em;
    pointer-events: none;
}

/* ——— FOTO PORTADA ——— */
.rs-foto {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: clamp(12px, 2vh, 24px) 0;
}

.rs-foto img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: white;
    padding: 4px;
    border: 8px solid white;
    outline: 1px solid #c9b99a;
}

/* ——— RESPONSIVE ——— */
@media (max-width: 768px) {
    .cos_interior {
        flex-direction: column;
        height: auto;
        overflow: visible;
        padding: 20px 0;
    }

    .esquerra {
        overflow: visible;
    }

    .caixa_texte {
        overflow: visible;
        flex: none;
        font-size: 1rem;
    }

    .dreta {
        height: auto;
        overflow: visible;
        min-height: 50vw;
    }
}
