/* =========================
   RESET
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

h1 {
    color: #000;
}
/* =========================
   BODY
========================= */

body {
    width: 100%;
    height: 100vh;

    overflow: hidden;

    background: #000;

    font-family: Georgia, "Times New Roman", serif;
}


/* =========================
   GIF DE FUNDO
========================= */

.background {
    position: fixed;

    inset: 0;

    width: 100%;
    height: 100%;

    background-image: url("../Images/sonhos/fundo.gif");

    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;

    z-index: -3;

    animation: backgroundAppear 2s ease;
}


/* =========================
   ESCURECIMENTO
========================= */

.background-overlay {
    position: fixed;

    inset: 0;

    background:
        radial-gradient(
            ellipse at center,
            rgba(0, 0, 0, 0.05),
            rgba(0, 0, 0, 0.55)
        );

    z-index: -2;

    pointer-events: none;
}


/* =========================
   ÁREA DO DIÁRIO
========================= */

.dream-journal {

    position: relative;

    width: 100%;
    height: 100vh;

    display: flex;

    align-items: center;
    justify-content: center;
}


/* =========================
   LIVRO
========================= */

.book {

    position: relative;

    width: min(92vw, 1200px);

    aspect-ratio: 1561 / 985;

    user-select: none;
}


/* =========================
   IMAGEM DO LIVRO
========================= */

.book-image {

    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    z-index: 1;
    filter:
        drop-shadow(0 25px 35px rgba(0, 0, 0, 0.45));
}


/* =========================
   PÁGINAS
========================= */

.page {

    position: absolute;

    z-index: 2;

    /*
        Impede que o texto saia da página.
    */

    overflow: hidden;

    color: #3d3025;
}


/*
    Página esquerda
*/

.page-left {

    /*
        Valores aproximados baseados
        na imagem do livro.
    */

    left: 9.5%;
    top: 8.5%;

    width: 40%;
    height: 82%;
}


/*
    Página direita
*/

.page-right {

    right: 8.5%;
    top: 8.5%;

    width: 40%;
    height: 82%;
}


/* =========================
   CONTEÚDO DAS PÁGINAS
========================= */

.page-content {

    width: 100%;
    height: 100%;

    padding: 8% 7%;

    overflow: hidden;
}


/* =========================
   DATA
========================= */

.date {

    margin-bottom: 18px;

    font-size: clamp(11px, 1vw, 15px);

    font-style: italic;

    opacity: 0.65;
}


/* =========================
   TÍTULO
========================= */

h1 {

    margin-bottom: 24px;

    font-size: clamp(22px, 2.2vw, 34px);

    font-weight: normal;

    line-height: 1.2;

    text-align: center;

    font-family:
        Georgia,
        "Times New Roman",
        serif;
}


/* =========================
   TEXTO DO SONHO
========================= */

.dream-text,
.dream-continuation {

    font-size: clamp(13px, 1.15vw, 18px);

    line-height: 1.8;

    text-align: justify;

    white-space: pre-line;
}


/* =========================
   NÚMERO DA PÁGINA
========================= */

.dream-number {

    position: absolute;

    bottom: 4%;
    right: 8%;

    font-size: 13px;

    opacity: 0.5;

    font-style: italic;
}


/* =========================
   BOTÕES
========================= */

.navigation {

    position: absolute;

    top: 50%;

    transform: translateY(-50%);

    width: 55px;
    height: 55px;

    border: none;

    border-radius: 50%;

    background: rgba(0, 0, 0, 0.35);

    color: white;

    font-family: Georgia, serif;

    font-size: 42px;

    line-height: 1;

    cursor: pointer;

    z-index: 10;

    backdrop-filter: blur(8px);

    transition:
        transform 0.3s ease,
        background 0.3s ease,
        opacity 0.3s ease;
}


.navigation:hover {

    background: rgba(255, 255, 255, 0.18);

    transform:
        translateY(-50%)
        scale(1.12);
}


.previous {
    left: 3%;
}


.next {
    right: 3%;
}


/* =========================
   ANIMAÇÃO
========================= */

.page-content {

    animation: pageAppear 0.6s ease;
}


@keyframes pageAppear {

    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


@keyframes backgroundAppear {

    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}


/* =========================
   TABLET
========================= */

@media (max-width: 900px) {

    .book {

        width: 96vw;
    }

    .page-left {

        left: 9%;
        width: 40%;
    }

    .page-right {

        right: 8%;
        width: 40%;
    }

    .page-content {

        padding: 7% 6%;
    }

    .navigation {

        width: 45px;
        height: 45px;

        font-size: 32px;
    }
}


/* =========================
   CELULAR
========================= */

@media (max-width: 600px) {

    body {
        overflow: auto;
    }

    .dream-journal {

        min-height: 100vh;

        height: auto;

        padding: 40px 0;
    }

    .book {

        width: 98vw;
    }

    .dream-text,
    .dream-continuation {

        font-size: 10px;

        line-height: 1.55;
    }

    h1 {

        font-size: 16px;

        margin-bottom: 12px;
    }

    .date {

        font-size: 9px;

        margin-bottom: 8px;
    }

    .navigation {

        width: 38px;
        height: 38px;

        font-size: 27px;
    }
}