/* ============================================
   THE WEEKEND EARNER - EBOOK DESIGN SYSTEM
   Strict A4 Portrait Layout (210mm x 297mm)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800&family=Outfit:wght@300;400;600&display=swap');

:root {
    /* Brand Colors */
    --primary-teal: #387677;
    --primary-terracotta: #D98565;
    --accent-yellow: #F2A52E;

    /* Backgrounds */
    --bg-cream: #FCF9F6;
    --bg-white: #FFFFFF;
    --bg-light-grey: #F5F5F3;

    /* Text Colors */
    --text-dark: #2C3E50;
    --text-body: #444444;
    --text-light: #666666;
    --text-muted: #888888;

    /* Typography */
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Outfit', sans-serif;

    /* A4 Dimensions - CORE PROTECTION */
    --page-width: 210mm;
    --page-height: 297mm;
    --margin-outer: 25mm;
    /* Generous margins */

    /* Spacing Units */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2.5rem;
    --spacing-xl: 4rem;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 12pt;
    /* Reduced for professional A4 fit */
}

body {
    font-family: var(--font-body);
    color: var(--text-body);
    background-color: #f0f0f0;
    line-height: 1.65;
    /* Standard spacious reading line height */
}

/* ============================================
   A4 PAGE CONTAINER
   ============================================ */
.page {
    width: var(--page-width);
    height: var(--page-height);
    margin: 40px auto;
    padding: var(--margin-outer);
    background: var(--bg-white);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    page-break-after: always;
    overflow: hidden;
    /* Prevent content spillover */
}

.page-cream {
    background: var(--bg-cream);
}

.page-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
    padding-bottom: 20mm;
    /* Safety buffer for page numbers */
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    color: var(--text-dark);
    line-height: 1.25;
    margin-bottom: var(--spacing-sm);
}

h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-teal);
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-teal);
}

h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

p {
    margin-bottom: var(--spacing-sm);
    font-size: 1rem;
}

/* ============================================
   COMPONENTS
   ============================================ */
.chapter-header {
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    border-bottom: 4px solid var(--primary-teal);
    /* Thicker brand line */
    padding-bottom: var(--spacing-md);
}

.chapter-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary-terracotta);
    background: var(--bg-light-grey);
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.chapter-title {
    font-size: 1.8rem;
    margin-top: 0.5rem;
}

.callout {
    background: var(--bg-cream);
    padding: var(--spacing-md);
    border-left: 5px solid var(--primary-terracotta);
    margin: var(--spacing-md) 0;
    border-radius: 4px;
}

.highlight-box {
    background: #fdf6f2;
    padding: var(--spacing-md);
    border: 1px solid rgba(217, 133, 101, 0.2);
    border-radius: 8px;
    margin: var(--spacing-md) 0;
}

.service-card {
    padding: var(--spacing-md);
    border: 1px solid var(--bg-light-grey);
    border-radius: 8px;
    margin-bottom: var(--spacing-sm);
}

.steps-list {
    list-style: none;
    counter-reset: steps;
}

.steps-list li {
    counter-increment: steps;
    position: relative;
    padding-left: 3rem;
    margin-bottom: var(--spacing-md);
}

.steps-list li::before {
    content: counter(steps);
    position: absolute;
    left: 0;
    width: 2rem;
    height: 2rem;
    background: var(--primary-teal);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* ============================================
   PAGE NUMBERS
   ============================================ */
.page-number {
    position: absolute;
    bottom: 8mm;
    width: 100%;
    left: 0;
    text-align: center;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* ============================================
   COVER & DIVIDERS
   ============================================ */
.cover-logo {
    position: absolute;
    top: 20mm;
    left: 20mm;
    width: 150px;
    /* Proportional logo size */
    height: auto;
}

/* ============================================
   COVER & DIVIDERS
   ============================================ */
.page-cover {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: var(--bg-white);
}

.cover-image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
    margin: 40px 0;
    padding: 0 20px;
}

.cover-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--bg-light-grey);
}

.brand-dot {
    width: 14px;
    height: 14px;
    background: var(--primary-terracotta);
    border-radius: 50%;
    margin-bottom: 2rem;
}

.section-divider {
    background: var(--primary-teal);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.section-divider h1,
.section-divider .section-label,
.section-divider .section-subtitle {
    color: white;
}

.section-label {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: var(--spacing-sm);
}

/* ============================================
   PRINT / PDF EXPORT
   ============================================ */
@media print {
    body {
        background: white;
    }

    .page {
        margin: 0;
        box-shadow: none;
        border: none;
    }

    @page {
        size: A4 portrait;
        margin: 0;
    }
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center {
    text-align: center;
}

.text-teal {
    color: var(--primary-teal);
}

.text-terracotta {
    color: var(--primary-terracotta);
}

.mt-auto {
    margin-top: auto;
}

.flex-grow {
    flex-grow: 1;
}

.no-bullets {
    list-style: none;
    margin-left: 0;
}