/* Reset & Base */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Roboto', sans-serif;
    background-color: #121212; /* Very dark grey */
    color: #e0e0e0;
    line-height: 1.6;
}
h1, h2, h3 { font-family: 'Cinzel', serif; color: #fff; }
a { text-decoration: none; color: inherit; }

/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 5%;
    background-color: #000;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid #333;
}
.logo { font-size: 1.5rem; font-weight: bold; letter-spacing: 2px; }
.nav-links { list-style: none; display: flex; }
.nav-links li { margin-left: 30px; }
.nav-links a:hover { color: #e50914; transition: 0.3s; }

/* Carousel / Hero */
.carousel-container {
    position: relative;
    height: 80vh; /* Takes up 80% of the screen height */
    overflow: hidden;
}
.slide {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}
.slide.active { opacity: 1; }
.slide-content {
    text-align: center;
    z-index: 2;
    max-width: 800px;
    padding: 20px;
}
.slide-content h1 { font-size: 4rem; text-shadow: 2px 2px 10px #000; margin-bottom: 10px; }
.slide-content h2 { font-size: 1.5rem; margin-bottom: 30px; color: #ccc; font-style: italic; }

/* Buttons */
.btn-main {
    padding: 15px 40px;
    background-color: #e50914; /* Blood Red */
    color: white;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s;
}
.btn-main:hover { background-color: #b2060f; }

/* Book Grid */
.section-pad { padding: 60px 20px; }
.section-title { text-align: center; font-size: 2.5rem; margin-bottom: 50px; border-bottom: 2px solid #e50914; display: inline-block; padding-bottom: 10px; }
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}
.book-card {
    background: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s;
    text-align: center;
    padding-bottom: 20px;
}
.book-card:hover { transform: translateY(-10px); }
.book-card img { width: 100%; height: auto; display: block; }
.card-info { padding: 20px; }
.btn-small {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 20px;
    border: 1px solid #e50914;
    color: #e50914;
    border-radius: 4px;
}
.btn-small:hover { background: #e50914; color: white; }

/* About & Contact */
.container { max-width: 1000px; margin: 0 auto; }
.container-narrow { max-width: 600px; margin: 0 auto; }
.about-content { display: flex; gap: 40px; align-items: center; }
.author-img-placeholder {
    width: 200px; height: 200px; background: #333; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.contact-form input, .contact-form textarea {
    width: 100%; padding: 15px; margin-bottom: 15px;
    background: #333; border: none; color: white;
    font-family: inherit;
}

.author-img {
    width: 200px;
    height: 200px;
    object-fit: cover; /* This ensures the photo doesn't stretch if it's not a perfect square */
    border-radius: 50%; /* Makes it a circle. Remove this line if you want a square. */
    border: 3px solid #e50914; /* Red border to match your theme */
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

footer { text-align: center; padding: 20px; background: #000; color: #666; font-size: 0.9rem; }
.prev, .next { cursor: pointer; position: absolute; top: 50%; padding: 16px; color: white; font-weight: bold; font-size: 18px; user-select: none; background-color: rgba(0,0,0,0.5); border: none; }
.next { right: 0; }
.prev { left: 0; }

/* --- Mobile Responsive Fixes --- */
@media (max-width: 768px) {
    .about-content {
        flex-direction: column; /* Stacks the image on top of the text */
        text-align: center;     /* Centers the image */
    }

    .author-img {
        margin-bottom: 25px;    /* Adds breathing room between face and text */
    }

    .slide-content h1 {
        font-size: 2.5rem;      /* Makes the big carousel text smaller on mobile so it fits */
    }

    .nav-links {
        /* Optional: This improves the menu on small screens if you haven't added JS for the burger menu yet */
        flex-direction: column;
        text-align: center;
    }
}

/* --- Hamburger Menu Styles --- */
.burger {
    display: none; /* Hidden on desktop */
    cursor: pointer;
}

.burger div {
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 5px;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    body {
        overflow-x: hidden; /* Prevents side-scrolling when menu is open */
    }

    .burger {
        display: block; /* Show burger on mobile */
        z-index: 2000; /* Ensure it sits on top of the menu */
    }

    .nav-links {
        position: fixed;
        right: 0px;
        height: 100vh;
        top: 0vh; /* Start at the very top */
        background-color: #121212; /* Match your dark theme */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center; /* Centers items vertically */
        width: 60%; /* Menu takes up 60% of the screen */
        transform: translateX(100%); /* Hides it off-screen to the right */
        transition: transform 0.5s ease-in;
        z-index: 1500;
        border-left: 2px solid #e50914; /* Nice red border accent */
        box-shadow: -5px 0 15px rgba(0,0,0,0.5);
    }

    .nav-links li {
        opacity: 0; /* Hidden initially for fade-in effect */
        margin: 30px 0; /* Spacing between links */
    }

    /* The class JavaScript will add to show the menu */
    .nav-active {
        transform: translateX(0%);
    }

    /* Animation classes for the Burger turning into an X */
    .toggle .line1 {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    .toggle .line2 {
        opacity: 0;
    }
    .toggle .line3 {
        transform: rotate(45deg) translate(-5px, -6px);
    }
    
    /* Animation for the links fading in */
    @keyframes navLinkFade {
        from { opacity: 0; transform: translateX(50px); }
        to { opacity: 1; transform: translateX(0px); }
    }
}

/* --- Read More / Expand Logic --- */
.desc-truncate {
    display: -webkit-box;
    -webkit-line-clamp: 4; /* Shows exactly 4 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 10px;
    min-height: 4.5em; /* Ensures boxes are roughly same height even if text is short */
}

.desc-full {
    display: block; /* Removes the line clamp restriction */
    -webkit-line-clamp: unset;
}

.read-more-btn {
    background: none;
    border: none;
    color: #00ff41; /* Mutant Green */
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
    padding: 0;
    margin-bottom: 15px;
    font-weight: bold;
    text-transform: uppercase;
}

.read-more-btn:hover {
    color: #fff;
    text-shadow: 0 0 5px #00ff41;
}