* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #eae6df; /* Matches your booklet's warm linen backdrop */
    font-family: system-ui, -apple-system, sans-serif;
    color: #4a443c;
    min-height: 100vh;
    /*padding: 40px 20px;*/
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Centers the whole library vertically if it fits the screen */
}

header {
    text-align: center;
    /*margin-bottom: 50px;*/
    max-width: 600px;
}

header a, header a:visited, header a:hover, header a:active {
    text-decoration: none;
    color: inherit;
}

header h1 {
    font-family: 'Georgia', serif;
    font-size: 2.5rem;
    color: #2c251e;
    margin-bottom: 12px;
    font-weight: normal;
    letter-spacing: 0.5px;
}

header p {
    color: #7a7164;
    font-size: 1rem;
    line-height: 1.5;
}

/* Centered Library Container */
.library-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Forces cards to center perfectly when under the max limit */
    gap: 50px; /* Generous spacing between your two main volumes */
    width: 100%;
    max-width: 1100px;
    padding: 20px 0;
}

/* Interactive Book Card Wrapper */
.book-item {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 300px; /* Fixed ideal width for standalone presentation layout */
}

/* Soft Paper Cover Container */
.cover-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4; 
    background-color: #faf8f5;
    border-radius: 2px 6px 6px 2px;
    box-shadow: 0 8px 20px rgba(44, 37, 30, 0.08), 
                0 2px 5px rgba(44, 37, 30, 0.04);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Subtle vertical linear shadow on the left edge to simulate a book spine fold */
.cover-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 12px;
    height: 100%;
    /*background: linear-gradient(to right, rgba(0,0,0,0.08) 0%, rgba(0,0,0,0.03) 25%, rgba(0,0,0,0) 100%);*/
    border-radius: 2px 0 0 2px;
    z-index: 2;
}

.cover-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.section-wrapper {
    width: 100%;
}

.section-wrapper img {
    width: 100%;
    transition: transform 0.4s ease;
}

header img {
    width: 150px;
}

/* Elegant Hover Physics */
.book-item:hover .cover-wrapper{
    transform: translateY(-8px) scale(1.07);
    box-shadow: 0 16px 32px rgba(44, 37, 30, 0.15), 
                0 4px 10px rgba(44, 37, 30, 0.08);
    
    border-color: rgba(140, 131, 117, 0.3);
}

.book-item:hover img {
    transform: translateY(-8px) /*scale(1.07)*/;
    filter: drop-shadow(5px 5px 5px #222);
}

.book-item:hover .cover-wrapper img {
    transform: scale(1.01);
}

/* Typography Styling for Book Titles */
.book-info {
    margin-top: 16px;
    text-align: center;
    width: 100%;
}

.book-title {
    font-family: 'Georgia', serif;
    font-size: 1.1rem;
    color: #2c251e;
    margin-bottom: 4px;
    transition: color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-item:hover .book-title {
    color: #8c8375; 
}

.book-meta {
    font-size: 0.8rem;
    color: #8c8375;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Responsive Breakpoints */
@media (max-width: 600px) {
    .library-grid {
        gap: 30px;
    }
    .book-item {
        width: 180px; /* Slightly compact layout rules for mobile browsing */
    }
    header h1 {
        font-size: 2rem;
    }
}

.coming-soon {
    position: relative;
}

.coming-soon .message {
    display: none !important;
    position: absolute;
    z-index: 9999;
    color: white;
    font-weight: 900;
    font-size: 35px;
    background: rgba(0,0,0, 0.5);
    height: 100%;
    width: 100%;
    justify-content: center;
    align-items: center;
}

.coming-soon .message div {
    text-align: center;
    padding: 20px;
}

.coming-soon:hover .message {
    display: flex !important;
}

.youtube-link {
    position: relative;
}

.youtube-link .play-button {
    position: absolute;
    display: flex;
    z-index: 9999;
}

.youtube-link .play-button img {
    width: 50px;
    filter: grayscale(0.4);
    position: relative;
    top: -15px;
}

.youtube-link:hover .play-button img {
    filter: none;
}

.youtube-link .cover-wrapper {
    border-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    position: unset !important;
}

.youtube-link, .youtube-link .cover-wrapper, .youtube-link .cover-wrapper img {
    background: none !important;
}

.youtube-link img {
    object-fit: contain !important;
    box-shadow: none !important;
}

.youtube-link:hover .cover-wrapper {
    transform: translateY(-8px) scale(1.07);
    box-shadow: none !important;
    border-color: transparent !important;
    border: none !important;
    position: unset !important;
}

.youtube-link:hover .cover-wrapper img {
    box-shadow: none !important;
    filter: none !important;
}

.youtube-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 12px;
    height: 100%;
    background: none !important;
    border-radius: 2px 0 0 2px;
    z-index: 2;
}
.youtube-link .watch {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.youtube-link .watch img {
    margin-bottom: 8px;
}

.book-description {
    background: white;
    padding: 15px;
    margin: 5px 0px;
    border-radius: 8px;
}