:root {
    --primary-red: #c92127;
    --dark-text: #0f1111;
    --light-text: #565959;
    --border-color: #ddd;
    --bg-light: #f5f5f5;
    --link-blue: #007185;
    --hover-blue: #c7511f;
    --white: #ffffff;
    --font-family: 'Inter', sans-serif;
    --star-gold: #ffa41c;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 140px;
}

body {
    font-family: var(--font-family);
    color: var(--dark-text);
    line-height: 1.5;
    background-color: var(--white);
    -webkit-font-smoothing: antialiased;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

a {
    color: var(--link-blue);
    text-decoration: none;
}

a:hover {
    color: var(--hover-blue);
    text-decoration: underline;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.border-bottom {
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: var(--dark-text);
}

/* Hero Banner */
.hero-banner {
    width: 100%;
    overflow: hidden;
    line-height: 0;
    background-color: #f0f0f0;
}

.hero-banner-wrapper {
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
}

.hero-banner-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 600px;
}

/* Header */
.header {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0 0 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    flex-direction: column;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 20px;
}

.logo-box {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.author-name {
    font-size: 24px;
    font-weight: 700;
}

.author-tagline {
    font-size: 14px;
    color: var(--light-text);
    font-weight: 500;
    line-height: 1.2;
}

.follow-btn {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 5px 15px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 500;
    color: var(--dark-text);
    align-self: flex-start;
}

.follow-btn:hover {
    background-color: #f7fafa;
}

.header-nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--light-text);
    font-weight: 600;
    font-size: 14px;
    padding-bottom: 10px;
    position: relative;
    text-transform: uppercase;
}

.nav-link:hover {
    color: var(--dark-text);
    text-decoration: none;
}

.nav-link.active {
    color: #008296;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #008296;
}

/* About & Popular */
.about-popular {
    padding: 30px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: stretch;
}

.content-card {
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 4px;
}

.about-card {
    display: flex;
    flex-direction: column;
    padding-top: 10px;
    min-height: 236px;
}

.about-text {
    font-size: 14px;
    margin-bottom: 20px;
    color: #333;
}

#about-more {
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 600px;
    overflow: hidden;
}

#about-more[hidden] {
    max-height: 550px;
    opacity: 0;
}

.read-more {
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.popular-card {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.popular-card .buy-amazon-btn {
    align-self: flex-start;
}

.about-section {
    display: flex;
    flex-direction: column;
}

.popular-section {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: 0;
}

.extra-popular {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
    margin-top: 0;
}

.extra-popular.visible {
    max-height: 500px;
    opacity: 1;
    margin-top: 15px;
}

@media (max-width: 768px) {
    .popular-section {
        gap: 0;
    }

    .extra-popular.visible {
        margin-top: 12px;
        max-height: 600px;
    }
}

.popular-link {
    display: flex;
    gap: 20px;
    color: var(--dark-text);
}

.popular-link:hover {
    text-decoration: none;
}

.popular-link:hover .book-title {
    color: var(--hover-blue);
    text-decoration: underline;
}

.popular-image img {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 100px;
}

.popular-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.book-title {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
}

.book-format {
    font-size: 13px;
    color: var(--light-text);
    font-weight: 700;
}

.book-price {
    font-size: 18px;
    font-weight: 500;
}

.cents {
    font-size: 12px;
    vertical-align: top;
    position: relative;
    top: 2px;
}

.buy-amazon-btn {
    display: inline-block;
    background-color: #043374;
    color: #ffffff;
    padding: 8px 15px;
    border-radius: 20px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #032554;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    cursor: pointer;
}

.buy-amazon-btn:hover {
    background-color: #032554;
    border-color: #021a3b;
    text-decoration: none;
    color: #ffffff;
}

/* Hover Overlay Styles (Option 1) */
.hover-overlay-container {
    position: relative;
    overflow: hidden;
    display: block;
}

.hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: 4px; /* Matches cover */
}

.hover-overlay-container:hover .hover-overlay {
    opacity: 1;
}

/* Full Card Link & Hint Text (Option 3) */
.full-card-link {
    text-decoration: none !important;
    display: block;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.full-card-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.08);
}

.card-hint-text {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #043374;
    margin-top: 15px;
    transition: color 0.2s ease;
}

.full-card-link:hover .card-hint-text,
.popular-link:hover .card-hint-text {
    color: #032554;
    text-decoration: underline;
}

/* Shop by Series */
.shop-by-series {
    padding: 30px 20px;
}

.main-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 30px;
}

.series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 40px;
    min-height: 350px;
}

.series-carousel .carousel-track {
    gap: 24px;
}

.series-item-column {
    min-width: 300px;
    max-width: 300px;
}

.series-item-column .series-card {
    width: 100%;
}

.series-card {
    display: flex;
    flex-direction: column;
    color: var(--dark-text);
}

.series-card:hover {
    text-decoration: none;
}

.series-card:hover .series-title {
    color: var(--hover-blue);
    text-decoration: underline;
}

/* Stacked Books Effect */
.series-stack {
    position: relative;
    height: 250px;
    /* Base height for the card stack area */
    margin-bottom: 20px;
    display: flex;
    align-items: flex-end;
}

.series-stack-image {
    align-items: center;
}

.series-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.stack-book {
    position: absolute;
    bottom: 0;
    width: 140px;
    aspect-ratio: 2/3;
    background-color: var(--primary-red);
    box-shadow: -2px 0px 8px rgba(0, 0, 0, 0.2);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    /* Book cover styling */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px;
    color: white;
    text-align: center;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.stack-book::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.1) 0%, transparent 60%),
        radial-gradient(circle at 0% 100%, rgba(0, 0, 0, 0.1) 0%, transparent 60%);
    z-index: 1;
}

.stack-cover-author {
    font-size: 8px;
    z-index: 2;
}

.stack-cover-title {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    z-index: 2;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Base stack positions (dynamically generated or statically set) */
.stack-1 {
    left: 0;
    z-index: 1;
    transform: scale(0.85);
    transform-origin: bottom left;
    opacity: 0.9;
}

.stack-2 {
    left: 30px;
    z-index: 2;
    transform: scale(0.92);
    transform-origin: bottom left;
    opacity: 0.95;
}

.stack-3 {
    left: 60px;
    z-index: 3;
    transform: scale(1);
    transform-origin: bottom left;
}

.series-card:hover .stack-3 {
    transform: scale(1.03);
}

/* Only 2 books in stack */
.stack-only-2 .stack-1 {
    left: 0px;
    z-index: 1;
    transform: scale(0.92);
}

.stack-only-2 .stack-2 {
    left: 70px;
    z-index: 2;
    transform: scale(1);
}

.series-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 5px;
    text-align: center;
}

.series-count {
    font-size: 14px;
    color: var(--light-text);
    text-align: center;
}


/* Carousels common */
.top-titles .carousel-track {
    min-height: 350px;
}

.recommendations .carousel-track {
    min-height: 200px;
}

.top-titles,
.recommendations {
    padding: 30px 20px;
}

.carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 50px;
}

.carousel-track-wrapper {
    overflow: hidden;
    width: 100%;
}

.carousel-track {
    display: flex;
    gap: 15px;
    transition: transform 0.3s ease;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.carousel-btn:hover {
    background-color: #f7fafa;
}

.prev-btn {
    left: 0;
}

.next-btn {
    right: 0;
}

/* Book Item Styles */
.book-item-column {
    display: flex;
    flex-direction: column;
    min-width: 220px;
    max-width: 220px;
    gap: 10px;
}

.book-item-column .buy-amazon-btn {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 8px;
    font-size: 12px;
}

.book-card {
    display: flex;
    flex-direction: column;
    color: var(--dark-text);
}

.book-card:hover {
    text-decoration: none;
}

.book-card:hover .book-card-title {
    color: var(--hover-blue);
    text-decoration: underline;
}

.book-cover {
    width: 100%;
    aspect-ratio: 2/3;
    background-color: var(--primary-red);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    margin-bottom: 12px;
    border-radius: 2px;
    /* Red cover styles */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 15px;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Add wave pattern to book covers */
.book-cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.1) 0%, transparent 60%),
        radial-gradient(circle at 0% 100%, rgba(0, 0, 0, 0.1) 0%, transparent 60%);
    z-index: 1;
}

.book-cover.has-image {
    padding: 0;
    background-color: transparent;
}

.book-cover.has-image::before {
    content: none;
}

.book-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
}

.cover-author {
    font-size: 10px;
    z-index: 2;
}

.cover-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    z-index: 2;
}

.book-card-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 5px;
}

.book-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--link-blue);
    margin-bottom: 5px;
}

.stars {
    color: var(--star-gold);
    font-size: 14px;
}

.book-grid-price {
    font-size: 16px;
    font-weight: 500;
}

/* All Books section */
.all-books {
    padding: 30px 20px;
}

.books-intro {
    margin-bottom: 25px;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.books-intro p {
    font-size: 15px;
    color: var(--dark-text);
    line-height: 1.6;
    margin-bottom: 8px;
}

.books-intro-cta {
    color: var(--primary-red) !important;
    font-weight: 700;
    font-size: 15px !important;
}

/* Series Tabs */
.series-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.series-tab {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    color: var(--dark-text);
    transition: all 0.2s ease;
    font-family: var(--font-family);
}

.series-tab:hover {
    background-color: #f7fafa;
    border-color: var(--link-blue);
}

.series-tab.active-tab {
    background-color: var(--primary-red);
    color: var(--white);
    border-color: var(--primary-red);
}

/* Book List Layout (AccountingTools style) */
.books-list {
    display: flex;
    flex-direction: column;
    gap: 35px;
    min-height: 600px;
}

.book-list-item {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.book-list-item:hover {
    text-decoration: none;
}

.book-list-cover {
    flex-shrink: 0;
    width: 140px;
    aspect-ratio: 2/3;
    background-color: var(--primary-red);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 12px;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-list-cover:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.book-list-cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.12) 0%, transparent 60%),
        radial-gradient(circle at 0% 100%, rgba(0, 0, 0, 0.08) 0%, transparent 60%);
    z-index: 1;
}

.book-list-cover.has-image {
    padding: 0;
    background-color: transparent;
}

.book-list-cover.has-image::before {
    content: none;
}

.book-list-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 3px;
}

.book-list-cover .cover-author {
    font-size: 9px;
    z-index: 2;
}

.book-list-cover .cover-title {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    z-index: 2;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.book-list-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.book-list-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--dark-text);
    line-height: 1.3;
}

.book-list-title a {
    color: var(--dark-text);
}

.book-list-title a:hover {
    color: var(--hover-blue);
}

.book-list-description {
    font-size: 14px;
    color: #333;
    line-height: 1.7;
}

.book-list-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.book-list-meta .book-rating {
    margin-bottom: 0;
}

.book-list-meta .book-grid-price {
    font-size: 16px;
    font-weight: 600;
}

.book-list-meta .book-format {
    font-weight: 500;
}


/* Recommendations Carousel */
.rec-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.page-indicator {
    font-size: 14px;
    color: var(--light-text);
}

.rec-card {
    min-width: 340px;
    max-width: 340px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    background-color: var(--white);
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.rec-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--hover-blue);
}

.rec-question {
    font-style: italic;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: -4px;
}

.rec-content {
    display: flex;
    gap: 10px;
}

.rec-cover {
    width: 66px;
    height: 100px;
    background-color: var(--primary-red);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    /* Mini cover styles */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.rec-cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
}

.rec-cover-title {
    font-size: 9px;
    font-weight: 700;
    line-height: 1.1;
    z-index: 2;
}

.rec-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.rec-details .buy-amazon-btn {
    margin-top: auto;
    align-self: flex-start;
}

.rec-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
}

.rec-author {
    font-size: 13px;
    color: var(--light-text);
}

.rec-quote {
    font-size: 13px;
    line-height: 1.4;
    color: #444;
    margin: 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* Footer */
.footer {
    background-color: var(--white);
    padding: 40px 0;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
}

.footer-top {
    margin-bottom: 20px;
}

.footer-logo {
    font-size: 24px;
    font-weight: 700;
    color: #003366;
    margin-bottom: 10px;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.footer-bottom p {
    font-size: 13px;
    color: var(--light-text);
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    font-size: 13px;
    font-weight: 500;
}

.social-links {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.social-icon {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--light-text);
    background-color: #f7fafa;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.social-icon:hover {
    background-color: var(--white);
    color: var(--dark-text);
    border-color: var(--link-blue);
    text-decoration: none;
}

.social-icon svg {
    width: 16px;
    height: 16px;
}

/* Responsive */
@media (max-width: 1024px) {
    .container {
        max-width: 95%;
    }

    .rec-card {
        min-width: 320px;
        max-width: 320px;
    }
}

@media (max-width: 768px) {
    .header-left {
        gap: 15px;
        margin-bottom: 10px;
    }

    .logo-box {
        width: 60px;
        height: 60px;
    }

    .logo-image {
        max-width: 60px;
    }

    .author-info h1 {
        font-size: 24px;
    }

    .author-info .author-tagline {
        font-size: 13px;
    }

    .about-popular {
        grid-template-columns: 1fr;
    }

    .carousel-container {
        padding: 0 40px;
    }

    .prev-btn {
        left: 0;
    }

    .next-btn {
        right: 0;
    }

    .header-nav {
        overflow-x: auto;
        padding-bottom: 5px;
    }

    .series-tabs {
        gap: 8px;
    }

    .series-tab {
        padding: 6px 14px;
        font-size: 13px;
    }

    .book-list-item {
        flex-direction: column;
        gap: 15px;
    }

    .book-list-cover {
        width: 120px;
    }

    .series-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }

    .rec-card {
        min-width: 300px;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .header-left {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .logo-box {
        margin: 0 auto;
    }

    .author-info h1 {
        font-size: 20px;
    }

    .author-info .author-tagline {
        font-size: 12px;
    }

    .section-title {
        font-size: 18px;
    }

    .carousel-btn {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }

    .rec-card {
        min-width: 270px;
        max-width: 270px;
        padding: 10px;
    }

    .rec-cover {
        width: 50px;
        height: 75px;
    }

    .rec-title {
        font-size: 13px;
    }

    .rec-quote {
        font-size: 12px;
    }
}