/* ============================================
   The Database Migration Field Guide Series
   Landing Page Styles
   ============================================ */

:root {
    /* DevSidekick blue palette — no white backgrounds */
    --color-bg: #E3F2FD;              /* Light Blue — page background */
    --color-header: #4A90E2;          /* Medium Blue — header, footer, primary */
    --color-header-hover: #2C5AA0;    /* Dark Blue — hover states, accents */
    --color-section-dark: #4A90E2;    /* Medium Blue — hero/feature sections */
    --color-section-mid: #d0e8fc;     /* Slightly darker light blue — alternating sections */
    --color-card: #ffffff;            /* White cards on blue background for contrast */
    --color-accent: #4A90E2;          /* Medium Blue — buttons, links */
    --color-accent-hover: #2C5AA0;    /* Dark Blue — button hover */
    --color-accent-light: #2196F3;    /* Info blue — highlights, secondary links */
    --color-text: #1a2a3a;            /* Dark navy — primary text */
    --color-text-secondary: #4a5e73;  /* Muted dark — secondary text */
    --color-text-on-blue: #ffffff;    /* White text on blue backgrounds */
    --color-border: #b8d4f0;          /* Light blue-gray border */
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    --font-mono: "Courier New", Courier, monospace;
    --max-width: 1200px;
    --radius: 8px;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    font-size: 16px;
}

a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--color-accent-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* ============================================
   Header
   ============================================ */

.site-header {
    background-color: var(--color-header);
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text-on-blue);
}

.site-logo span {
    color: var(--color-text-on-blue);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: #ffffff;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-text-on-blue);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
    background-color: var(--color-section-dark);
    padding: 5rem 1.5rem;
    text-align: center;
}

.hero-inner {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: var(--color-text-on-blue);
}

.hero .tagline {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.hero .pitch {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 650px;
    margin: 0 auto;
}

/* ============================================
   Book Grid
   ============================================ */

.book-grid-section {
    background-color: var(--color-bg);
    padding: 4rem 1.5rem;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    text-align: center;
    color: var(--color-text-secondary);
    margin-bottom: 3rem;
    font-size: 1.05rem;
}

.book-grid {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.book-card {
    background-color: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.book-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.15);
}

.book-card .book-number {
    font-size: 0.85rem;
    color: var(--color-accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.book-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    color: var(--color-text);
}

.book-card .book-desc {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    flex-grow: 1;
    margin-bottom: 1.25rem;
}

.badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-available {
    background-color: #1a5c3a;
    color: #6ee7a0;
}

.badge-coming {
    background-color: #3d3215;
    color: #f0c040;
}

.book-card .card-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--color-accent);
    font-weight: 500;
    font-size: 0.95rem;
}

.book-card .card-link:hover {
    color: var(--color-accent-hover);
}

/* ============================================
   About Section
   ============================================ */

.about-section {
    background-color: var(--color-section-mid);
    padding: 4rem 1.5rem;
}

.about-inner {
    max-width: 800px;
    margin: 0 auto;
}

.about-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

.about-section p {
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

/* ============================================
   Footer
   ============================================ */

.site-footer {
    background-color: var(--color-header);
    border-top: none;
    padding: 2rem 1.5rem;
    text-align: center;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.footer-links {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-copy {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

/* ============================================
   Book Page — Hero
   ============================================ */

.book-hero {
    background-color: var(--color-section-dark);
    padding: 4rem 1.5rem;
}

.book-hero-inner {
    max-width: 800px;
    margin: 0 auto;
}

.book-hero .book-series-tag {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.book-hero h1 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    color: var(--color-text-on-blue);
}

.book-hero .subtitle {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.5rem;
}

.book-hero .author {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.book-hero .price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-on-blue);
    margin-bottom: 1.5rem;
}

.book-hero .coming-soon-notice {
    font-size: 1.1rem;
    color: #ffd54f;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* ============================================
   Book Page — Content Sections
   ============================================ */

.book-section {
    padding: 3.5rem 1.5rem;
}

.book-section:nth-child(odd) {
    background-color: var(--color-bg);
}

.book-section:nth-child(even) {
    background-color: var(--color-section-mid);
}

.book-section-inner {
    max-width: 800px;
    margin: 0 auto;
}

.book-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}

.book-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    margin-top: 1.5rem;
}

.book-section p {
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    font-size: 1.02rem;
}

.book-section ul,
.book-section ol {
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.book-section li {
    margin-bottom: 0.5rem;
}

/* Chapter outline list */
.chapter-list {
    list-style: none;
    padding-left: 0;
}

.chapter-list li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 1rem;
}

.chapter-list .part-heading {
    color: var(--color-accent);
    font-weight: 700;
    font-size: 1.05rem;
    margin-top: 1rem;
    border-bottom: none;
    padding-bottom: 0;
}

/* Excerpt styling */
.excerpt {
    background-color: var(--color-card);
    border-left: 4px solid var(--color-accent);
    padding: 2rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.excerpt p {
    color: var(--color-text);
    font-size: 1rem;
    line-height: 1.8;
}

.excerpt p:last-child {
    margin-bottom: 0;
}

/* ============================================
   Buttons
   ============================================ */

.btn {
    display: inline-block;
    padding: 0.85rem 2rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    transition: background-color 0.2s, transform 0.1s;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--color-accent);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--color-accent-hover);
    color: #fff;
    transform: translateY(-1px);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--color-accent);
    color: var(--color-accent);
}

.btn-outline:hover {
    background-color: var(--color-accent);
    color: #fff;
}

/* ============================================
   Other Books Section
   ============================================ */

.other-books-section {
    background-color: var(--color-section-mid);
    padding: 3.5rem 1.5rem;
}

.other-books-section h2 {
    text-align: center;
    font-size: 1.75rem;
    margin-bottom: 2rem;
}

.other-books-grid {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.other-book-card {
    background-color: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.other-book-card:hover {
    border-color: var(--color-accent);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.12);
}

.other-book-card h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--color-text);
}

.other-book-card .book-number {
    font-size: 0.8rem;
    color: var(--color-accent);
    font-weight: 600;
}

/* ============================================
   Stripe Buy Button
   ============================================ */

.buy-button-wrapper {
    margin: 1.5rem 0;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--color-header);
        flex-direction: column;
        padding: 1rem 1.5rem;
        gap: 1rem;
        border-bottom: none;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .nav-links.open {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero .tagline {
        font-size: 1.05rem;
    }

    .book-grid {
        grid-template-columns: 1fr;
    }

    .book-hero h1 {
        font-size: 1.75rem;
    }

    .other-books-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .header-inner {
        padding: 0.75rem 1rem;
    }

    .hero {
        padding: 3rem 1rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .book-grid-section,
    .about-section,
    .book-section {
        padding: 2.5rem 1rem;
    }
}
