/* Color Palette & Font Variables */
:root {
    --natural-beige: #f4f1e0;
    --sky-blue: #a6d8d0;
    --forest-green: #37524d;
    --earth-tone: #a68674;
}

/* Minimal preflight reset after Tailwind removal */
*,
::before,
::after {
    box-sizing: border-box;
    border-width: 0;
    border-style: solid;
    border-color: currentColor;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: inherit;
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

img,
svg,
video {
    display: block;
    max-width: 100%;
}

/* Base Styles */
body {
    margin: 0;
    padding: 0;
    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: center;
    align-items: center;
}

@media (min-width: 768px) {
    .nav-container {
        justify-content: space-between;
    }
}

.site-title {
    margin: 0;
    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: none;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 1.125rem;
}

@media (min-width: 768px) {
    .nav-list {
        display: flex;
        gap: 2rem;
    }
}

/* Hero Section */
.hero-section {
    position: relative;
    color: var(--natural-beige);
    text-align: center;
    padding-top: 9rem;
    padding-bottom: 9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-image: url('/assets/images/heroimgplaceholder.png');
    background-size: cover;
    background-position: center center; /* Adjust the position if needed */
}

.hero-overlay-content {
    padding-left: 1rem;
    padding-right: 1rem;
    text-align: center;
}

.hero-overlay-title {
    margin: 0;
    color: #ffffff;
    font-family: 'Cherry Cream Soda', cursive;
    font-size: 3.5rem;
    line-height: 1.2;
    font-weight: 700;
    text-shadow: 0 8px 20px rgba(0, 0, 0, 1);
    opacity: 0;
    transform: translateY(26px);
    animation: heroFadeUp 900ms ease-out forwards;
}

@keyframes heroFadeUp {
    from {
        opacity: 0;
        transform: translateY(26px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.trailer-launch {
    display: block;
    color: inherit;
    text-decoration: none;
    background: linear-gradient(160deg, rgba(166, 216, 208, 0.32), rgba(244, 241, 224, 0.95));
    border: 1px solid rgba(55, 82, 77, 0.15);
    border-radius: 1.5rem;
    padding: 1.25rem;
    box-shadow: 0 18px 45px rgba(55, 82, 77, 0.12);
    transition: transform 300ms ease, box-shadow 300ms ease;
}

.trailer-launch:hover {
    box-shadow: 0 22px 55px rgba(55, 82, 77, 0.18);
}

.book-trailer-launch {
    margin-bottom: 1.5rem;
}

.trailer-kicker,
.author-kicker {
    display: inline-block;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 1rem;
    font-weight: 700;
}

.trailer-kicker {
    color: var(--earth-tone);
}

.trailer-poster-wrap {
    position: relative;
    margin-top: 1rem;
    overflow: hidden;
    border-radius: 1rem;
}

.trailer-poster-image {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.trailer-play-button {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: 4.75rem;
    height: 4.75rem;
    border-radius: 50%;
    background-color: rgba(244, 241, 224, 0.92);
    color: var(--forest-green);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.trailer-play-button svg {
    width: 2rem;
    height: 2rem;
    margin-left: 0.2rem;
}

.trailer-card-copy {
    padding-top: 1.25rem;
}

.trailer-card-title {
    font-family: 'Merriweather', serif;
    font-weight: 700;
}

.trailer-card-title {
    font-size: 1.8rem;
    line-height: 1.2;
}

.trailer-card-text {
    margin-top: 0.85rem;
    font-size: 1.05rem;
    line-height: 1.7;
}

.trailer-modal {
    width: min(96vw, 1280px);
    background-color: #050607;
    border-radius: 1rem;
    overflow: hidden;
}

.trailer-modal-video {
    width: 100%;
    display: block;
    background-color: #000;
}

.fancybox__container {
    --fancybox-bg: rgba(3, 4, 5, 0.96);
    --fancybox-color: #f4f1e0;
}

.fancybox__toolbar {
    background: rgba(3, 4, 5, 0.65);
}

@media (min-width: 768px) {
    .hero-section {
        padding-top: 20rem;
        padding-bottom: 20rem;
    }

    .hero-overlay-title {
        font-size: 3rem;
    }
}

@media (min-width: 1200px) {
    .hero-overlay-title {
        font-size: 3.6rem;
    }
}

.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;
}

/* 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 */
    transition: transform 300ms ease-in-out;
}

.carousel-container:hover {
    transform: none;
}

.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%;
    text-align: center;
}

.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: #1b2b28;
    color: var(--natural-beige);
    padding-top: 4rem;
    padding-bottom: 4rem;
}

@media (min-width: 768px) {
    .author-section {
        padding-top: 6rem;
        padding-bottom: 6rem;
    }
}

.author-content {
    text-align: center;
}

.author-layout {
    display: grid;
    gap: 2.5rem;
    align-items: center;
}

@media (min-width: 1024px) {
    .author-layout {
        grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
        gap: 4rem;
    }
}

.author-copy {
    text-align: left;
    order: 2;
}

.author-photo-card--single {
    max-width: 480px;
    width: 100%;
    justify-self: center;
    order: 1;
}

.author-kicker {
    color: var(--sky-blue);
}

.author-title {
    margin-top: 0.75rem;
    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: 42rem;
}

@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: none;
}

.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: #392a0a;
    text-align: center;
    color: #ffffff;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.footer-content {
    padding-left: 1rem;
    padding-right: 1rem;
}

.dev-credit {
    margin-top: 0.5rem;
    font-size: 0.875rem; /* 14px */
}

.dev-credit a {
    color: #ffffff;
    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;
    }
}

.author-photo-card {
    margin: 0;
    background-color: rgba(244, 241, 224, 0.12);
    padding: 0.75rem;
    border-radius: 1.25rem;
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.18);
}

.author-photo-image {
    width: 100%;
    display: block;
    border-radius: 0.9rem;
    object-fit: cover;
}

.back-to-top {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1200;
    border: none;
    border-radius: 9999px;
    background-color: var(--forest-green);
    color: var(--natural-beige);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.9rem 1.15rem;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 250ms ease, transform 250ms ease, visibility 250ms ease;
    cursor: pointer;
}

.back-to-top:hover {
    background-color: #2d433e;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (min-width: 768px) {
    .back-to-top {
        right: 1.5rem;
        bottom: 1.5rem;
    }
}