@font-face {
    font-family: 'Gothic';
    src: url('../resources/gothic.ttf') format('woff');
    font-weight: normal;
    font-style: normal;
}

.bg-light-purple {
    background-color: #faf1ff;
    height: auto;
}

:root {
    --bg-width: 0%;
}

.lead {
    font-size: 1.2rem;
    font-weight: 300;
}

/* General Styles */
.book-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

/* Book Image Styles */
.book-image {
    width: 70%;
    padding-top: 115.3%;
    margin: 5% auto;
    /* Center the element with responsive margins */
    background: url('../resources/cover.png') no-repeat center center/cover;
    box-shadow: 0 32px 32px rgba(0, 0, 0, 0.8);
    display: block;
    /* Ensure the element behaves like a block-level element for centering */
}

.book-image .hover-text {
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: top 0.5s ease, opacity 0.5s ease;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.book-image:hover .hover-text {
    top: 0;
    opacity: 1;
}

/* Hover Text Styles */
.hover-title {
    font-family: 'Gothic', sans-serif;
    font-size: 3rem;
    margin-bottom: 25px;
    /* Increased margin for more separation */
}

.hover-description {
    font-family: 'EB Garamond', serif;
    font-size: 1.1rem;
    text-align: left;
    width: 100%;
    padding: 0 20px;
}

/* Book Content Styles */
.book-content {
    max-width: 500px;
    padding: 20px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.book-content.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Highlight Styles */
.highlight {
    position: relative;
}

.highlight::before {
    content: "";
    position: absolute;
    width: var(--bg-width);
    height: 120%;
    background: rgb(251, 255, 41);
    z-index: -1;
    transition: width 1300ms ease-in-out;
}

/* Book Title Image Styles */
.book-title-image {
    max-width: 300px;
    height: auto;
    margin: 20px auto; /* Center the container itself */
    position: relative;
    display: flex; /* Use Flexbox to center the image */
    justify-content: center; /* Horizontally center the image */
    align-items: center; /* Vertically center the image */
    filter: invert(1) brightness(0);
}

.book-title-image img {
    display: none;
    /* Hide by default */
}

/* Show images on large screens (above 768px) */
@media (min-width: 768px) {
    .book-title-image img {
        display: block;
        width: 100%;
        /* Ensure it scales properly */
        max-width: 100%;
        height: auto;
    }
}

/* Buy Button Styles */
.buy-button {
    background-color: #007bff;
    color: white;
    padding: 15px 30px;
    border: none;
    text-decoration: none;
    font-size: 1.2rem;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.buy-button:hover {
    background-color: #0056b3;
    transform: scale(1.1);
}

/* Image Wrapper Styles */
.image-wrapper {
    height: 12rem;
    width: 12rem;
    border-radius: 6px;
    background-color: #ccc;
    display: flex;
    align-items: center;
    text-align: center;
    line-height: 1.6;
}

.image-wrapper img {
    height: auto;
    max-width: 100%;
}

/* Shine Effect Styles */
.shine {
    position: relative;
    overflow: hidden;
}

.shine::before {
    background: linear-gradient(to right, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.7) 100%);
    content: "";
    display: block;
    height: 100%;
    left: -75%;
    position: absolute;
    top: 0;
    transform: skewX(-25deg);
    width: 50%;
    z-index: 2;
}

.shine:hover::before,
.shine:focus::before {
    animation: shine 0.85s;
}

@keyframes shine {
    50% {
        left: 125%;
    }
}

/* Media Queries */

/* Adjust for mobile screens (max-width: 768px) */
@media (max-width: 768px) {
    .book-image {
        width: 80%;
        padding-top: 125.3%;
        max-width: none;
        margin: 5% 0% 0% 12%;
    }

    .book-image .hover-text {
        padding: 10px; /* Reduce padding for mobile */
    }

    .hover-title {
        font-size: 2rem; /* Reduce title size for mobile */
        margin-bottom: 10px; /* Reduce space between title and description */
    }

    .hover-description {
        font-size: 0.9rem; /* Reduce description size for mobile */
        padding: 0 10px; /* Reduce padding for mobile */
        text-align: center; /* Center text for better readability */
    }

    .lead {
        font-size: 1.4rem;
        font-weight: 300;
        /* margin: top right bottom left*/
        margin: 0% 4% 0% 4%;
    }

    .bg-light-purple {
        background-color: #faf1ff;
        overflow:hidden;
        height: auto;
    }
}

/* Adjust for tablet screens (min-width: 769px and max-width: 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .book-image {
        width: 100%;
        padding-top: 145.3%;
        max-width: none;
        margin: 50% 0% 0% 15%;
    }

    .hover-description {
        font-family: sans-serif;
        font-size: .5rem;
        text-align: left;
        width: 100%;
        margin: 50% 0% 0% 15%;
    }
}
