/* ===========================================================
   LIBRORUM VISOR
   Foglio di stile generale
   =========================================================== */

/* ===========================================================
   01. BASE
   =========================================================== */

/* -----------------------------------------------------------
   Reset
   ----------------------------------------------------------- */

body,
ul,
table,
form {
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* -----------------------------------------------------------
   Animazioni generali
   ----------------------------------------------------------- */

.animated {
    transition: margin-left .2s ease-in-out;
}

/* -----------------------------------------------------------
   Zoom del libro
   ----------------------------------------------------------- */

#book-zoom {
    -webkit-transition: -webkit-transform 1s;
    -moz-transition: -moz-transform 1s;
    -ms-transition: -ms-transform 1s;
    -o-transition: -o-transform 1s;
    transition: transform 1s;

    position: relative;
    width: 100%;
    height: calc(100% - 55px);
    overflow: hidden;

    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* -----------------------------------------------------------
   Canvas
   ----------------------------------------------------------- */

#canvas {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    overflow: hidden;
}

/* -----------------------------------------------------------
   Contenitore Editio
   ----------------------------------------------------------- */

.editio {
    position: relative;
}

/* -----------------------------------------------------------
   Prospettiva delle pagine
   ----------------------------------------------------------- */

.editio .page-wrapper {
    perspective: 2000px;
}

/* ===========================================================
   02. PAGINE E FOGLI
   =========================================================== */

/* -----------------------------------------------------------
   Pagina
   ----------------------------------------------------------- */

.editio .page {
    overflow: hidden;
    background: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, .2);
}

.page {
    position: relative;
    overflow: hidden;
}


/* -----------------------------------------------------------
   Foglio
   ----------------------------------------------------------- */

.editio .folium {
    width: 100%;
    height: 100%;
}

.folium {
    position: relative;
    overflow: hidden;
}

/* -----------------------------------------------------------
   Immagine della pagina
   ----------------------------------------------------------- */

.editio .folium img {
    display: block;
    width: 100%;
    height: 100%;
}

/* -----------------------------------------------------------
   Immagini Turn.js
   ----------------------------------------------------------- */

.tabula {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;

    user-select: none;
    pointer-events: none;
}

/* ===========================================================
   03. COPERTINE
   =========================================================== */

/* -----------------------------------------------------------
   Base delle copertine rigide
   ----------------------------------------------------------- */

.hard {
    background-color: white;
    box-shadow: none;
}


/*
   Frammento originario privo di blocco di dichiarazioni:

   .primaPallii
   .secundaPallii
   .tertiaPallii
   .quartaPallii

   Non viene eliminato perché appartiene al CSS originale,
   ma non produce alcuna regola effettiva.
*/

/* ===========================================================
   04. DORSO E PROFONDITÀ
   =========================================================== */

/* -----------------------------------------------------------
   Dorso
   ----------------------------------------------------------- */

.spina {
    transform: rotateY(-90deg);
    transform-origin: top right;
}

.editio .spina {
    position: absolute;

    top: 0;
    right: 100%;

    width: 20px;
    height: 100%;

    transform-origin: right center;
    transform: rotateY(-90deg);

    backface-visibility: hidden;

    z-index: 3;

    background:
        linear-gradient(
            to right,
            #222 0%,
            #555 20%,
            #888 45%,
            #555 70%,
            #222 100%
        );

    border-left:
        1px solid rgba(255, 255, 255, .20);

    border-right:
        1px solid rgba(0, 0, 0, .30);
}

/* -----------------------------------------------------------
   Profondità
   ----------------------------------------------------------- */

.editio .profunditas {
    position: absolute;

    top: 0;
    bottom: 0;

    width: 0;

    pointer-events: none;

    z-index: 2;

    background:
        linear-gradient(
            to right,
            #f7f7f7 0px,
            #d9d9d9 1px,
            #fdfdfd 2px,
            #d7d7d7 3px
        );
}

/* -----------------------------------------------------------
   Profondità della seconda copertina
   ----------------------------------------------------------- */

.editio .secundaPallii .profunditas {
    right: 100%;

    border-radius:
        4px 0 0 4px;

    box-shadow:
        inset -1px 0 rgba(255, 255, 255, .6),
        inset -4px 0 rgba(0, 0, 0, .08);
}

/* -----------------------------------------------------------
   Profondità della terza copertina
   ----------------------------------------------------------- */

.editio .tertiaPallii .profunditas {
    left: 100%;

    border-radius:
        0 4px 4px 0;

    box-shadow:
        inset 1px 0 rgba(255, 255, 255, .6),
        inset 4px 0 rgba(0, 0, 0, .08);
}

/* -----------------------------------------------------------
   Gradiente di profondità delle pagine
   ----------------------------------------------------------- */

.editio .even {
    background:
        linear-gradient(
            left,
            #fff 95%,
            #dadada 100%
        );
}

.editio .odd {
    background:
        linear-gradient(
            right,
            #fff 95%,
            #cacaca 100%
        );
}

/* ===========================================================
   05. OMBRE
   =========================================================== */

/* -----------------------------------------------------------
   Ombra generale Turn.js
   ----------------------------------------------------------- */

.editio .shadow {
    transition: box-shadow .5s;
    box-shadow: 0 0 10px #999;
}

/* -----------------------------------------------------------
   Ombra interna lato rilegatura
   Pagine dispari
   ----------------------------------------------------------- */

.editio .odd .folium {
    position: relative;
}

.editio .odd .folium::before {
    content: "";

    position: absolute;

    top: 0;
    left: 0;

    width: var(--umbra-rilegatura, 24px);
    height: 100%;

    pointer-events: none;

    z-index: 10;

    background:
        linear-gradient(
            to right,
            rgba(0, 0, 0, .18) 0%,
            rgba(0, 0, 0, .10) 35%,
            rgba(0, 0, 0, .04) 70%,
            rgba(0, 0, 0, 0) 100%
        );
}

/* ===========================================================
   RILEGATURA FISSA
   =========================================================== /

.editio .even .folium::before {
    content: "";
    position: absolute;

    top: 0;
    bottom: 0;
    right: 0;

    width: 8px;

    transform: translateX(-50%);

    pointer-events: none;
    z-index: 1000;

    background: linear-gradient(
        to right,
        rgba(0,0,0,0),
        rgba(0,0,0,0.12),
        rgba(0,0,0,0.28),
        rgba(0,0,0,0.12),
        rgba(0,0,0,0)
    );
}
/* -----------------------------------------------------------
   Ombra interna lato rilegatura
   Pagine pari
   ----------------------------------------------------------- /

.editio .even .folium {
    position: relative;
}

.editio .even .folium::before {
    content: "";

    position: absolute;

    top: 0;
    right: 0;

    width: var(--umbra-rilegatura, 24px);
    height: 100%;

    pointer-events: none;

    z-index: 10;

    background:
        linear-gradient(
            to left,
            rgba(0, 0, 0, .18) 0%,
            rgba(0, 0, 0, .10) 35%,
            rgba(0, 0, 0, .04) 70%,
            rgba(0, 0, 0, 0) 100%
        );
}

/* ===========================================================
   06. TURN.JS
   =========================================================== */

/* -----------------------------------------------------------
   Libro
   ----------------------------------------------------------- */

.volumen {
    position: absolute;

    transition:
        transform .35s ease;
}


/*
.volumen.pallium-apertum {
    transform:
        translateX(25%);
}
*/

/* -----------------------------------------------------------
   Wrapper delle pagine
   ----------------------------------------------------------- */

.page-wrapper {
    position: relative;

    transition:
        transform .35s ease;
}

/* -----------------------------------------------------------
   Copertina aperta
   ----------------------------------------------------------- */

.page-wrapper.pallium-apertum {
    transform: translateX(50%);
}

/* -----------------------------------------------------------
   Elementi Turn.js
   ----------------------------------------------------------- */

.turn-page-wrapper,
.turn-page {
    width: 100%;
    height: 100%;
}

/* -----------------------------------------------------------
   Wrapper visivo del foglio
   ----------------------------------------------------------- */

.folium {
    position: relative;

    width: 100%;
    height: 100%;

    overflow: hidden;

    background: #ffffff;

    box-shadow:
        0 0 18px rgba(0, 0, 0, .22);
}

/* ===========================================================
   07. CONTENITORI DEL VIEWER
   =========================================================== */

/* -----------------------------------------------------------
   Root del viewer
   ----------------------------------------------------------- */

#receptaculumVisoris {
    position: relative;
    width: 100%;
    height: 100%;

    display: flex;
    flex-direction: column;
    
    background: rgba(0, 0, 0, .92);
}

#claudeVisorem {
    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 10000;

    width: 40px;
    height: 40px;

    border: 0;
    border-radius: 50%;

    background: rgba(0, 0, 0, .55);
    color: #fff;

    font-size: 30px;
    line-height: 36px;

    cursor: pointer;
}

#claudeVisorem:hover {
    background: rgba(0, 0, 0, .8);
}

/* -----------------------------------------------------------
   Toolbar
   ----------------------------------------------------------- */

#asserInstrumentorumVoluminis {
    flex: 0 0 auto;

    height: 56px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 10px;
}

/* -----------------------------------------------------------
   Corpo del viewer
   ----------------------------------------------------------- */

#corpusVoluminis {
    flex: 1;

    position: relative;

    overflow: hidden;
}

#corpusVoluminis,
#canvas,
#book-zoom,
.volumen {
    touch-action: none;
}

/* -----------------------------------------------------------
   Viewport Turn.js
   ----------------------------------------------------------- */

#prospectus {
    position: absolute;

    inset: 0;

    overflow: hidden;
}

/* -----------------------------------------------------------
   Trasformazione del volume
   ----------------------------------------------------------- */

/* -----------------------------------------------------------
   Trasformazione del volume
   ----------------------------------------------------------- */

#volumenTransform {
    position: absolute;
    left: 50%;
    top: 50%;
    transform-origin: center center;
    transform: translate(-50%, -50%);
}

/* -----------------------------------------------------------
   Contenitore del volume
   ----------------------------------------------------------- */

#receptaculumVoluminis {
    position: relative;
}

/* ===========================================================
   PANNELLO DI CONTROLLO DEL VISORE
   =========================================================== */

#QuadrumNavigationisVisoris {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;

    z-index: 200020;

    pointer-events: none;
}

#QuadrumNavigationisVisoris button {
    position: relative;
    z-index: 200021;

    pointer-events: auto;
}

/* ===========================================================
   PANNELLO REGIMINA (interno al visore, ogni orientamento)
   =========================================================== */
.regimenLineaPositio {
    display: flex;
    align-items: center;
    gap: 8px;
}
.regimenLineaPositio #indicatorTabulaLecta {
    flex: 0 0 auto;
    min-width: 1.6em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.regimenLineaPositio #cursorPositionisTabulae {
    flex: 1 1 auto;
    min-width: 0;   /* essenziale: senza questo un <input range> non si restringe dentro un flex item */
}
.regimenLineaPositio #plsActioPausaAudii {
    flex: 0 0 auto;
}

#listaQuadriNavigationis {
    position: fixed;
    top: 50px;
    left: var(--regimina-sinistra, 0px);
    width: 85%;
    max-width: 220px;
    height: 100%;
    z-index: 200010;

    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;

    background: #000000;
    box-shadow: 2px 0 12px rgba(0,0,0,.25);

    transform: translateX(-100%);
    transition: transform 300ms ease;
}

#listaQuadriNavigationis.apertum {
    transform: translateX(0);
}

/* Gli strumenti, impilati uno sotto l'altro */
#quadrumRegiminumAudii {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
}

/* Velo opzionale: tocco fuori dal pannello per chiuderlo */
#velumRegiminumVisoris {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 200000;
}

#velumRegiminumVisoris.visibile {
    display: block;
}

/* ===========================================================
   08. HOTSPOT / LAMINAE
   =========================================================== */

/* -----------------------------------------------------------
   Contenitore delle laminae
   ----------------------------------------------------------- */

.laminae {
    position: absolute;

    inset: 0;

    pointer-events: none;
}

/* -----------------------------------------------------------
   Hotspot
   ----------------------------------------------------------- */

.lamina {
    position: absolute;

    box-sizing: border-box;

    border: 0 dashed #aa0;
    border-radius: 8px;

    background:
        rgba(255, 230, 0, .10);

    cursor: pointer;

    pointer-events: auto;

    z-index: 9999;

    transition:
        background-color .20s ease,
        transform .15s ease,
        box-shadow .20s ease;
}

/* -----------------------------------------------------------
   Hotspot al passaggio del mouse
   ----------------------------------------------------------- */

.lamina:hover {
    background:
        rgba(255, 165, 0, .45);

    transform:
        scale(1.02);

    box-shadow:
        0 0 8px rgba(255, 165, 0, .35);
}

/* ===========================================================
   09. SALTI / INDICATORI DI PAGINA
   =========================================================== */

.gradusFolii {
    position: absolute;

    inset: 0;

    pointer-events: none;
}

/* ===========================================================
   10. LOADER
   =========================================================== */

.editio .loader {
    position: absolute;

    background:
        url("../pics/loader.gif")
        center center
        no-repeat;
}

/* ===========================================================
   11. ZOOM
   =========================================================== */

.zoom-pic {
    position: absolute;

    inset: 0;

    background:
        rgba(0, 0, 0, .2);

    z-index: 999;
}

.zoom-pic img {
    box-shadow:
        0 0 20px #999;
}

/* ===========================================================
   12. SLIDER MINIATURE
   =========================================================== */

#asserFluxus {
    position: absolute;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    width: 80%;
    z-index: 999;
}

#cursorFluxus {
    width: 80%;
    margin: auto;

    height: 8px;

    background: rgba(255, 255, 255, 0.20);

    border: 1px solid rgba(255, 255, 255, 0.60);

    border-radius: 8px;

    box-shadow:
        0 0 5px rgba(0, 0, 0, 0.90);
}

/* Parte dello slider già percorsa */

#cursorFluxus .ui-slider-range {
    height: 100%;

    background: rgba(255, 255, 255, 0.70);

    border-radius: 8px;
}

/* Handle */

#cursorFluxus .ui-slider-handle {
    width: 22px;
    height: 22px;

    margin-left: -11px;
    margin-top: -8px;

    background: #ffffff;

    border: 2px solid #111111;
    border-radius: 50%;

    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.75),
        0 2px 7px rgba(0, 0, 0, 0.90);

    cursor: grab;
}

/* Handle mentre viene trascinato */

#cursorFluxus .ui-slider-handle:active {
    cursor: grabbing;
}

/* ===========================================================
   13. MINIATURA DELLA VISTA
   =========================================================== */

/* -----------------------------------------------------------
   Area di anteprima
   ----------------------------------------------------------- */

.turnjs-slider .thumbnail > .preview-content {
    margin:5px;
    background:white;
    width:calc(90% - 0px);
    height:calc(90% - 0px);
    box-sizing:border-box;
    overflow:hidden;
}

.turnjs-slider .thumbnail.miniatura-unica > .preview-content {
    width:calc(85% - 0px);
}

/* -----------------------------------------------------------
   Contenitore miniatura
   ----------------------------------------------------------- */

.editio-miniatura{
    position:relative;
    width:100%;
    height:100%;
    display:flex;
    overflow:hidden;
    margin:0;
    background:transparent;
}

/* -----------------------------------------------------------
   Singola pagina della miniatura
   ----------------------------------------------------------- */

.editio-mini-tabula {
    flex: 1 1 0;

    overflow: hidden;

    margin: 0 !important;

    background: transparent !important;
}

/* -----------------------------------------------------------
   Elemento unico della miniatura
   ----------------------------------------------------------- */

.editio-mini-tabula .unica {
    width: 100%;

    flex: none;
}

/* -----------------------------------------------------------
   Immagine della miniatura
   ----------------------------------------------------------- */

.editio-mini-tabula img {
    width: auto;
    height: 100%;

    display: block;

    object-fit: cover;
}

/* -----------------------------------------------------------
   Numero della pagina nella miniatura
   ----------------------------------------------------------- */

.editio-mini-numerus {
    position: absolute;

    right: 4px;
    bottom: 4px;

    width: auto;
    height: auto;

    margin: 0;
    padding: 2px 5px;

    background:
        rgba(0, 0, 0, .65);

    color: white;

    line-height: 1;

    display: inline-block;

    font-size: 11px;
    font-family: Arial, sans-serif;

    border-radius: 3px;

    pointer-events: none;
}

/* ===========================================================
   14. OVERLAY
   =========================================================== */

#miniaturarumQuadrum,
#informationumQuadrum,
#navigationisQuadrum,
#sarcinatorVisoris,
#sarcinatorEditionis {
    position: absolute;

    inset: 0;

    display: none;
}

/* ===========================================================
   15. AUDIO
   =========================================================== */

#audioVoluminis {
    display: none;
}