body { font-family: 'Crimson Pro', Georgia, serif; }

/* ---- HEADER ADJUSTMENTS ---- */
@media (min-width: 1024px) {
    header .max-w-\[2000px\] {
        height: 56px !important;
        padding-left: 3rem !important;
        padding-right: 3rem !important;
    }
    header svg {
        height: 32px !important;
    }
    header .font-display {
        font-size: 1rem !important;
        letter-spacing: 0.12em !important;
    }
}

/* ---- HERO GRID ---- */
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 380px; /* Forced height to keep catalog above fold */
    overflow: hidden;
    position: relative;
}

.hero-left {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 40px; /* Restored slight padding for breathing room around the large image */
    background-color: #321c03;
    height: 100%;
}

.hero-right {
    position: relative;
    overflow: hidden;
    border-left: 1px solid rgba(218, 191, 117, 0.2);
    background-color: #2a1602;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cube-texture {
    background-image:
            repeating-linear-gradient(0deg, transparent, transparent 19px, rgba(218,191,117,0.05) 20px),
            repeating-linear-gradient(90deg, transparent, transparent 19px, rgba(218,191,117,0.05) 20px);
    background-size: 20px 20px;
}

.noise-overlay {
    position: absolute; inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none; z-index: 1;
}

/* Featured Book Row */
.hero-book-row {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: clamp(20px, 4vw, 50px);
    width: 100%;
    height: 100%;
    max-width: 1200px;
}

.hero-book-cover {
    flex: 0 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.hero-book-cover img {
    display: block;
    width: auto;
    /* SCALE: Maximize within the 380px container while allowing for the 15px padding */
    height: 100%;
    max-height: 350px;
    object-fit: contain;
    border-radius: 2px;
    box-shadow: 20px 20px 50px rgba(0,0,0,0.6);
    border-right: 3px solid rgba(0,0,0,0.2);
    border-bottom: 3px solid rgba(0,0,0,0.2);
    transform: rotate(1deg);
    transition: transform 0.3s ease;
}

.hero-book-cover:hover img {
    transform: rotate(0deg) scale(1.02);
}

.hero-book-text {
    flex: 1;
    min-width: 0;
}

.hero-badge {
    display: inline-block;
    margin-bottom: 8px;
    padding: 3px 8px;
    border: 1px solid rgba(218,191,117,0.3);
    border-radius: 3px;
    color: #DABF75;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.hero-book-text h1 {
    font-family: 'Josefin Sans', sans-serif;
    color: #ffffff;
    font-size: clamp(1.4rem, 3vw, 2.8rem);
    font-weight: 700;
    line-height: 1.1;
    margin: 0 0 12px 0;
}

.hero-subtitle {
    font-family: 'Crimson Pro', Georgia, serif;
    color: rgba(218,191,117,0.95);
    font-size: clamp(1rem, 1.2vw, 1.35rem);
    font-style: italic;
    margin: 0 0 24px 0;
    line-height: 1.4;
    max-width: 550px;
}

.hero-cta {
    display: inline-block;
    background: #DABF75;
    color: #422504;
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding: 12px 40px;
    border-radius: 2px;
    text-decoration: none;
    box-shadow: 6px 6px 0 rgba(0,0,0,0.4);
    transition: all 0.2s;
}

.hero-cta:hover {
    background: #ffffff;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.3);
    transform: translate(2px, 2px);
}

/* Library Strip */
.lib-hook { padding: 15px 32px 10px; text-align: center; flex-shrink: 0; }
.lib-strip-container { flex: 1; display: flex; align-items: stretch; position: relative; padding: 0 40px 10px 20px; min-height: 0; }
.lib-strip {
    display: flex;
    gap: 8px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.lib-strip::-webkit-scrollbar { display: none; }

.lib-strip-tile {
    position: relative;
    flex: 0 0 40%;
    border-radius: 4px;
    overflow: hidden;
    display: block;
}
.lib-strip-tile img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.6); transition: all 0.5s; }
.lib-strip-tile:hover img { transform: scale(1.1); filter: brightness(0.8); }
.lib-strip-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.8), transparent 60%); }
.lib-strip-label {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    padding: 10px; z-index: 2; text-align: center;
}
.lib-strip-label span {
    font-size: clamp(12px, 1.1vw, 18px);
    line-height: 1.1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    color: #fff;
}
.lib-strip-peek {
    position: absolute; right: 0; top: 0; bottom: 10px; width: 40px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(to left, #2a1602 40%, transparent);
    z-index: 10; transition: background 0.3s;
}
.lib-strip-peek:hover { background: linear-gradient(to left, #422504 50%, transparent); }

.hero-lib-footer { padding: 10px 20px; text-align: center; }
.browse-btn {
    display: inline-block;
    background: #DABF75;
    color: #422504;
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.15em;
    padding: 12px 32px;
    border-radius: 2px;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    text-decoration: none;
}
.browse-btn:hover { background: #ffffff; color: #422504; transform: translateY(-2px); }

/* ---- EMAIL BAR ---- */
.email-bar {
    background-color: #DABF75;
    border-top: 1px solid #e7d6a5;
    border-bottom: 1px solid #c7a74a;
    position: relative;
    z-index: 20;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.email-bar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 24px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 32px;
}
.email-bar-label { text-align: right; }
.label-main {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    color: #422504;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.1em;
    margin: 0;
}
.label-sub {
    font-family: 'Crimson Pro', serif;
    font-style: italic;
    font-size: 12px;
    color: rgba(66, 37, 4, 0.7);
    margin: 1px 0 0 0;
}
.email-bar-form-wrap { width: 100%; max-width: 440px; }
.email-form { display: flex; gap: 8px; width: 100%; }
.email-input {
    flex: 1; min-width: 0; padding: 8px 14px; font-size: 13px;
    border: 1px solid rgba(66,37,4,0.1); background: #fdfbf7;
    color: #422504; border-radius: 2px; outline: none;
}
.email-input:focus { border-color: rgba(66,37,4,0.3); box-shadow: 0 0 0 3px rgba(66, 37, 4, 0.05); }
.email-submit {
    flex-shrink: 0; padding: 8px 20px; background: #422504; color: #DABF75;
    font-family: "Josefin Sans", sans-serif; font-weight: 700; font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.1em; border: none; border-radius: 2px;
    cursor: pointer; transition: all 0.2s;
}
.email-submit:hover { background: #000; color: #fff; }

/* ---- BOOK CATALOG ---- */
.filter-pill {
    padding: 8px 18px; font-family: 'Josefin Sans', sans-serif; font-size: 12px;
    font-weight: 700; border-radius: 99px; border: 1px solid rgba(66,37,4,0.2);
    background: transparent; color: rgba(66,37,4,0.6); transition: all 0.2s;
    cursor: pointer;
}
.filter-pill:hover { border-color: #422504; color: #422504; }
.filter-pill.active { background: #422504; color: #DABF75; border-color: #422504; }

.book-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 32px;
}
.book-card-cover { position: relative; padding-top: 152%; overflow: hidden; background: #eee; }
.book-card-cover img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.book-card:hover .book-card-cover img { transform: scale(1.05); }
.book-card:hover h3 { color: #DABF75; }

/* ---- RESPONSIVE ---- */

/* HANDLE MID-RANGE (Tablet/Small Laptops) */
@media (min-width: 769px) and (max-width: 1200px) {
    header .max-w-\[2000px\] {
        height: 64px !important; /* Increased breathing room for tablet header */
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
    .hero-left {
        padding: 20px 30px; /* More padding to prevent edge collisions */
    }
    .hero-book-row {
        gap: 25px; /* Increased gap from 15px to give text room */
        padding: 0 20px;
    }
    .hero-book-text h1 { font-size: 1.45rem; }
    .hero-subtitle { font-size: 0.85rem; margin-bottom: 18px; }
    .hero-book-cover img {
        height: auto;
        max-height: 270px; /* Reduced cover size on tablet to un-squash text */
    }
    .hero-cta {
        padding: 10px 25px;
        font-size: 11px;
    }
    .browse-btn {
        padding: 10px 24px;
        font-size: 10px;
    }
    .lib-strip-tile { flex: 0 0 45%; }
}

@media (max-width: 768px) {
    .hero-grid { grid-template-columns: 1fr; min-height: auto; max-height: none; }
    .hero-left { padding: 24px 24px; justify-content: center; align-items: center; } /* Reduced padding to save vertical space */
    .hero-book-row {
        flex-direction: column;
        text-align: center;
        gap: 16px; /* Tighter gap */
        align-items: center;
        justify-content: center;
        padding: 0;
        height: auto;
    }
    .hero-book-cover { flex: 0 0 auto; width: 100%; display: flex; justify-content: center; height: auto; }
    .hero-book-cover img {
        width: 140px; /* Greatly reduced image width */
        height: auto;
        max-height: 200px; /* Greatly reduced image height */
        transform: none;
        box-shadow: 0 10px 25px rgba(0,0,0,0.5);
        border: none;
        border-radius: 2px;
    }
    .hero-book-text { width: 100%; display: flex; flex-direction: column; align-items: center; }
    .hero-book-text h1 { font-size: 1.5rem; text-align: center; } /* Slightly smaller h1 */
    .hero-subtitle { font-size: 0.95rem; margin-bottom: 16px; text-align: center; }
    .hero-right { border-left: none; border-top: 1px solid rgba(218, 191, 117, 0.2); }
    .lib-strip-container { padding: 0 40px 12px 20px; }

    .email-bar-container { flex-direction: column; gap: 20px; padding: 24px 20px; }
    .email-bar-label { text-align: center; }
    .email-bar-form-wrap { max-width: 100%; }
    .email-form { flex-direction: column; }
    .email-submit { width: 100%; }

    .book-catalog-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
    .book-card-cover { padding-top: 150%; }
}

@media (max-width: 480px) {
    .hero-left { padding: 20px 20px; } /* Reduced padding */
    .hero-book-cover img {
        width: 110px; /* Even smaller for very small devices */
        max-height: 160px;
    }
    .lib-strip { overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; }
    .lib-strip-tile { flex: 0 0 66%; scroll-snap-align: start; }
    .lib-strip-label span { font-size: 18px; }
}