/* Color Palette & Font Variables */
:root {
    --natural-beige: #f4f1e0;
    --sky-blue: #a6d8d0;
    --forest-green: #37524d;
    --earth-tone: #a68674;
}

/* Base Styles */
body {
    background-color: var(--natural-beige);
    color: var(--forest-green);
    font-family: 'Lato', sans-serif;
}

.antialiased {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Header & Navigation */
.main-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 0.75rem 1rem;
    background-color: var(--forest-green);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Add shadow for depth */
}

@media (min-width: 768px) {
    .main-header {
        padding: 1rem 2rem;
    }
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 1.875rem;
    line-height: 2.25rem;
    color: var(--natural-beige);
    font-family: 'Merriweather', serif;
    font-weight: 700;
}

@media (min-width: 768px) {
    .site-title {
        font-size: 3rem;
        line-height: 1;
    }
}

.nav-link {
    color: var(--natural-beige);
    transition-property: color;
    transition-duration: 300ms;
}

.nav-link:hover {
    color: var(--sky-blue);
}

/* Navigation List */
.nav-list {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 1.125rem;
}

@media (min-width: 768px) {
    .nav-list {
        gap: 2rem;
    }
}

/* Hero Section */
.hero-section {
    position: relative;
    color: var(--natural-beige);
    text-align: center;
    padding-top: 18rem;
    padding-bottom: 18rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom-left-radius: 1.5rem;
    border-bottom-right-radius: 1.5rem;
    overflow: hidden;
    background-image: url('img/heroimgplaceholder.png');
    background-size: cover;
    background-position: center center; /* Adjust the position if needed */
}

@media (min-width: 768px) {
    .hero-section {
        padding-top: 20rem;
        padding-bottom: 20rem;
    }
}

.hero-content {
    padding-left: 1rem;
    padding-right: 1rem;
}

.hero-title {
    font-size: 2.25rem;
    line-height: 2.5rem;
    font-weight: 700;
    font-family: 'Merriweather', serif;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 3.75rem;
        line-height: 1;
    }
}

.hero-subtitle {
    margin-top: 1rem;
    font-size: 1.25rem;
    line-height: 1.75rem;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
    font-weight: 300;
}

@media (min-width: 768px) {
    .hero-subtitle {
        font-size: 1.5rem;
        line-height: 2rem;
    }
}

.btn-amazon {
    margin-top: 2rem;
    display: inline-block;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    background-color: var(--earth-tone);
    color: var(--natural-beige);
    font-weight: 600;
    transition: background-color 300ms, transform 300ms;
}

.btn-amazon:hover {
    background-color: #7b5f50;
    transform: translateY(-2px);
}

/* Book Details Section */
.book-details-section {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

@media (min-width: 768px) {
    .book-details-section {
        padding-top: 6rem;
        padding-bottom: 6rem;
    }
}

.book-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    align-items: center;
}

@media (min-width: 1024px) {
    .book-details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.book-cover-image {
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 24rem;
    margin-left: auto;
    margin-right: auto;
    cursor: pointer;
}

.book-info-title {
    font-size: 1.875rem;
    line-height: 2.25rem;
    font-weight: 700;
    font-family: 'Merriweather', serif;
}

@media (min-width: 768px) {
    .book-info-title {
        font-size: 2.25rem;
        line-height: 2.5rem;
    }
}

.book-description {
    margin-top: 1rem;
    font-size: 1.125rem;
    line-height: 1.75rem;
    max-width: 28rem;
}

.book-buy-buttons {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Carousel Styles */
.book-cover {
    /* This div is now a container for the carousel */
    max-width: 24rem; /* Match the original max-width of the image */
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 1024px) {
    .book-cover {
        max-width: 28rem; /* Increased from 24rem for desktop */
    }
}

.carousel-container {
    position: relative;
    border-radius: 0.5rem; /* Match original image radius */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* Match original shadow */
    transition: transform 300ms ease-in-out;
}

.carousel-container:hover {
    transform: scale(1.05);
}

.carousel-viewport {
    overflow: hidden;
    border-radius: 0.5rem; /* Ensure images inside are clipped */
}

.carousel-track {
    display: flex;
    transition: transform 500ms ease-in-out;
}

.carousel-slide {
    flex: 0 0 100%;
    min-width: 100%;
}

.carousel-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(55, 82, 77, 0.7); /* Semi-transparent forest-green */
    border: none;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--natural-beige);
    transition: background-color 300ms;
    z-index: 10;
}

.carousel-button:hover {
    background-color: var(--forest-green);
}

.carousel-button svg {
    width: 1.5rem;
    height: 1.5rem;
}

.carousel-button--left {
    left: 0.5rem;
}

.carousel-button--right {
    right: 0.5rem;
}

/* Carousel Pagination Dots */
.carousel-nav {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.75rem;
    z-index: 10;
}

.carousel-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background-color: rgba(244, 241, 224, 0.5); /* Semi-transparent natural-beige */
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background-color 300ms, transform 300ms;
}

.carousel-dot:hover,
.carousel-dot.current-slide {
    background-color: var(--natural-beige);
    transform: scale(1.2);
}

.core-messages {
    margin-top: 2rem;
}

.core-messages-title {
    font-size: 1.5rem;
    line-height: 2rem;
    font-weight: 600;
    font-family: 'Merriweather', serif;
}

.core-messages-list {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.core-message-item {
    display: flex;
    align-items: flex-start;
}

.core-message-item .icon {
    margin-right: 0.75rem;
    width: 1.5rem;
    height: 1.5rem;
    display: inline-block;
    color: var(--forest-green);
}

.core-message-item strong {
    color: var(--forest-green);
}

/* Author Section */
.author-section {
    background-color: var(--forest-green);
    color: var(--natural-beige);
    padding-top: 4rem;
    padding-bottom: 4rem;
    border-top-left-radius: 1.5rem;
    border-top-right-radius: 1.5rem;
}

@media (min-width: 768px) {
    .author-section {
        padding-top: 6rem;
        padding-bottom: 6rem;
    }
}

.author-content {
    text-align: center;
}

.author-title {
    font-size: 1.875rem;
    line-height: 2.25rem;
    font-weight: 700;
    font-family: 'Merriweather', serif;
}

@media (min-width: 768px) {
    .author-title {
        font-size: 2.25rem;
        line-height: 2.5rem;
    }
}

.author-bio {
    margin-top: 2rem;
    font-size: 1.125rem;
    line-height: 1.75rem;
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 768px) {
    .author-bio {
        font-size: 1.25rem;
        line-height: 1.75rem;
    }
}

/* Upcoming Titles Section */
.upcoming-section {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

@media (min-width: 768px) {
    .upcoming-section {
        padding-top: 6rem;
        padding-bottom: 6rem;
    }
}

.upcoming-content {
    text-align: center;
}

.upcoming-title {
    font-size: 1.875rem;
    line-height: 2.25rem;
    font-weight: 700;
    font-family: 'Merriweather', serif;
}

@media (min-width: 768px) {
    .upcoming-title {
        font-size: 2.25rem;
        line-height: 2.5rem;
    }
}

.upcoming-grid {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
}

@media (min-width: 640px) {
    .upcoming-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .upcoming-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.upcoming-card {
    padding: 1.5rem;
    background-color: var(--natural-beige);
    border-width: 1px;
    border-color: var(--forest-green);
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition-property: transform;
    transition-duration: 300ms;
}

.upcoming-card:hover {
    transform: scale(1.05);
}

.upcoming-card-title {
    font-size: 1.25rem;
    line-height: 1.75rem;
    font-weight: 600;
    font-family: 'Merriweather', serif;
}

.upcoming-card-subtitle {
    margin-top: 0.5rem;
    color: var(--earth-tone);
    font-size: 0.875rem;
    line-height: 1.25rem;
}

/* Footer */
.main-footer {
    background-color: var(--sky-blue);
    text-align: center;
    color: var(--forest-green);
    padding-top: 2rem;
    padding-bottom: 2rem;
    border-top-left-radius: 1.5rem;
    border-top-right-radius: 1.5rem;
}

.footer-content {
    padding-left: 1rem;
    padding-right: 1rem;
}

.dev-credit {
    margin-top: 0.5rem;
    font-size: 0.875rem; /* 14px */
}

.dev-credit a {
    color: var(--forest-green);
    text-decoration: none;
}

.dev-credit a:hover {
    text-decoration: underline;
}

/* Lightbox Styles */
.lightbox {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex; /* Shown when active */
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 80%;
    max-height: 85vh;
    border-radius: 0.5rem;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
}

/* Lightbox Navigation */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(55, 82, 77, 0.7);
    border: none;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--natural-beige);
    transition: background-color 300ms;
    z-index: 1001; /* Above lightbox background */
}

.lightbox-nav:hover {
    background-color: var(--forest-green);
}

.lightbox-nav svg {
    width: 1.5rem;
    height: 1.5rem;
}

.lightbox-nav--prev {
    left: 1rem;
}

.lightbox-nav--next {
    right: 1rem;
}

@media (min-width: 768px) {
    .lightbox-nav--prev {
        left: 2rem;
    }
    .lightbox-nav--next {
        right: 2rem;
    }
}