/* =========================================================
   FONTS
========================================================= */
@font-face {
  font-family: Milonga;
  src: url('/Fonts/Serif/Milonga-Regular.ttf');
}
@font-face { font-family: Antiqua; src: url('Fonts/Serif/ModernAntiqua-Regular.ttf'); }
@font-face { font-family: Labrada; src: url('Fonts/Serif/Labrada-Medium.ttf'); }
@font-face { font-family: Caudex;  src: url('Fonts/Serif/Caudex-Regular.ttf'); }

/* =========================================================
   BASE / LAYOUT
========================================================= */
body {
    margin: 0;
    height: 100vh;
    font-family: "Caudex", serif;
    overflow: hidden;
    background: url('BKR/wall.jpg') fixed center repeat;
    background-size: 400px;
}

.viewport {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 5vh;
    box-sizing: border-box;
}

.state {
    display: flex;
    align-items: center;
    gap: 2vh;
    width: 100%;
    justify-content: flex-start;
}

.hidden { display: none; }

/* =========================================================
   NAVBAR
========================================================= */
.navbar {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 60px;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    z-index: 1000;
    overflow: hidden;
}

.navbar::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url('BKR/bookpatt1.png') center repeat;
    background-size: 700px;
    filter: hue-rotate(345deg) brightness(1.05) saturate(1.1);
    opacity: 0.8;
    z-index: -1;
}

.navbar a,
.songButton {
    color: #E6B081;
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: underline;
    padding: 4px 8px;
    background-color: rgba(230, 176, 129, 0.2);
    border-radius: 6px;
    transition: background-color 0.3s, color 0.3s;
    cursor: pointer;
    user-select: none;
}

.navbar a:hover,
.songButton:hover {
    color: #E6E381;
    background-color: rgba(230, 226, 129, 0.2);
}

.nav-links,
.nav-music {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* controlled spacing between bubbles */
}


.nav-music audio {
    width: 300px;
    height: 30px;
}

.nav-music audio::-webkit-media-controls-panel {
    background: url('BKR/Play1.png') center repeat;
    background-size: 300px;
    border-radius: 6px;
}

.nav-music audio::-webkit-media-controls-play-button,
.nav-music audio::-webkit-media-controls-volume-slider {
    filter: brightness(0) saturate(100%) invert(24%) sepia(15%)
            saturate(565%) hue-rotate(322deg)
            brightness(92%) contrast(88%);
}

/* =========================================================
   LIBRARY VIEW
========================================================= */
.library-state { justify-content: space-around; }

.book-cover {
    width: 38vh;
    height: 63vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    text-align: center;
    opacity: 0;
    transform: translateY(5px);
    animation: fadeInBook 0.5s forwards;
}

.book-cover:nth-child(1) { animation-delay: 0.05s; }
.book-cover:nth-child(2) { animation-delay: 0.15s; }
.book-cover:nth-child(3) { animation-delay: 0.25s; }

.book-cover:hover {
    transform: scale(1.04) translateY(-0.5vh);
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.book-cover:hover img { transform: scale(1.02); }

@keyframes fadeInBook {
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   COVER (FRONT / BACK)
========================================================= */
.cover {
    width: 45vh;
    height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
}

.cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cover-text {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.title,
.subtitle {
    font-family: "Milonga", serif;
    color: #D1A075;
    text-shadow: 0 0 5px #000;
}

.title { font-size: 2.2rem; }
.subtitle { font-size: 1.4rem; }

.back-text {
    position: absolute;
    bottom: 10%;
    left: 10%;
    right: 10%;
    text-align: center;
}
/* Back cover text at the top */
.top-cover-text {
    position: absolute;
    top: 20%;          /* moved lower */
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 90%;        /* constrain width */
}

/* Title styling (optional tweaks for back covers) */
.top-cover-text .title {
    font-size: 2rem;
    color: #D1A075;
    text-shadow: 0 0 5px #000;
}

/* Subtitle styling */
.top-cover-text .subtitle {
    font-size: 1.2rem;
    color: #D1A075;
    text-shadow: 0 0 3px #000;
    font-style: italic;
}

/* Update list bullets */
.top-cover-text .update-list {
    margin: 0.5rem 0 0 0;
    padding-left: 0;         /* remove left padding */
    list-style-position: inside; /* bullets stay inside the box */
    color: #E6B081;
    font-size: 1rem;
    text-align: center;      /* center bullets under title/subtitle */
    text-shadow: 1px 1px 0 #000;
}

/* =========================================================
   PAGES (CORE)
========================================================= */
.page {
    width: 45vh;
    height: 80vh;
    padding: 30px;
    box-sizing: border-box;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;

    opacity: 0;
    animation: fadeInPage 0.5s forwards;
    transition: transform 0.3s ease, opacity 0.5s ease;

    border: 6px double rgba(83,56,57,0.3);
    border-radius: 12px;
    box-shadow:
        0 8px 20px rgba(0,0,0,0.1),
        inset 0 0 10px rgba(0,0,0,0.05);
}

.page:nth-child(1) { animation-delay: 0.1s; }
.page:nth-child(2) { animation-delay: 0.2s; }
.page:nth-child(3) { animation-delay: 0.3s; }
.page:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInPage {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.book-state {
    justify-content: flex-start;
    padding-left: 1vh;   /* real breathing room */
    padding-right: 1vh;
    box-sizing: border-box;
}


.book-state .page:hover {
    transform: translateY(-2vh) scale(1.02);
}

.back-state {
    justify-content: center;
    align-items: center;
}

/* =========================================================
   PAGE OVERLAYS
========================================================= */
.page::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url('BKR/Texturelabs_Paper_332XL.jpg') repeat;
    opacity: 0.15;
    pointer-events: none;
    border-radius: 12px;
}

.page::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle,
        rgba(255,255,255,0) 70%,
        rgba(0,0,0,0.15) 100%);
    pointer-events: none;
    border-radius: 12px;
}

/* =========================================================
   PAGE TEXT
========================================================= */
.page h2,
.page p {
    font-family: 'Caudex', serif;
    color: #533839;
    font-weight: bold;
    text-shadow:
        1px 1px 0 #FFF,
       -1px 1px 0 #FFF,
        1px -1px 0 #FFF,
       -1px -1px 0 #FFF;
    z-index: 2;
}

.page h2 {
    font-size: 2.4rem;
    margin-bottom: 12px;
}

.page p {
    font-size: 1.2rem;
    line-height: 1.5;
}

/* =========================================================
   BACK PAGE
========================================================= */
.page.back-page {
    background: url('BKR/backpaper.png') center repeat;
    background-size: 800px;
}
