/* Love Guide — Master Directory Stylesheet */
/* Design standards match the Advanced Body Language chapter */

/* ===== CSS Variables ===== */
:root {
    --primary-color: #7B2D4E;
    --secondary-color: #5BA3C9;
    --accent-color: #E8A020;
    --text-color: #333;
    --text-light: #666;
    --background: #ffffff;
    --background-alt: #f8f6f7;
    --border-color: #e0d8db;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 6px 24px rgba(0, 0, 0, 0.18);

    --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-heading: 'Georgia', 'Times New Roman', serif;

    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    --border-radius: 8px;
    --max-width: 960px;
}

/* ===== Base Styles ===== */
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    line-height: 1.7;
    color: var(--text-color);
    background: var(--background);
    margin: 0;
    padding: 0;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: 1.3;
    color: var(--primary-color);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
}

h1 {
    font-size: 2.5rem;
    margin-top: 0;
}

h2 {
    font-size: 1.9rem;
    border-bottom: 3px solid var(--secondary-color);
    padding-bottom: var(--spacing-xs);
    margin-top: var(--spacing-xl);
}

h3 {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-top: 0;
    margin-bottom: var(--spacing-xs);
}

p {
    margin: var(--spacing-sm) 0;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}

a:hover {
    border-bottom-color: var(--primary-color);
}

/* ===== Header ===== */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #4a1a30 50%, #3a2a60 100%);
    color: white;
    padding: var(--spacing-xl) 0;
    text-align: center;
    box-shadow: var(--shadow);
}

header h1 {
    color: white;
    margin: 0;
    font-size: 2.5rem;
}

header .subtitle {
    font-size: 1.3rem;
    margin: var(--spacing-sm) 0;
    font-style: italic;
    color: rgba(255, 255, 255, 0.92);
}

header .byline {
    font-size: 0.95rem;
    opacity: 0.85;
    margin: var(--spacing-xs) 0 0 0;
    color: rgba(255, 255, 255, 0.85);
}

/* ===== Navigation ===== */
nav {
    background: var(--background-alt);
    border-bottom: 2px solid var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

nav li {
    margin: 0;
}

nav a {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-color);
    border: none;
    font-size: 0.85rem;
    transition: background 0.3s, color 0.3s;
}

nav a:hover {
    background: var(--primary-color);
    color: white;
}

/* ===== Main Content ===== */
main {
    padding: var(--spacing-xl) var(--spacing-md);
}

/* ===== Intro Section ===== */
.intro {
    max-width: 700px;
    margin: 0 auto var(--spacing-xl);
    text-align: center;
}

.intro p {
    font-size: 1.05rem;
    color: var(--text-light);
}

/* ===== Category Sections ===== */
.category {
    margin-bottom: var(--spacing-xl);
}

.category-description {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: var(--spacing-md);
    font-style: italic;
}

/* ===== Chapter Grid ===== */
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

/* ===== Chapter Cards ===== */
.chapter-card {
    background: white;
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--secondary-color);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    box-shadow: var(--shadow);
    transition: transform 0.25s, box-shadow 0.25s, border-top-color 0.25s;
    display: flex;
    flex-direction: column;
}

.chapter-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-top-color: var(--primary-color);
}

.chapter-card h3 {
    color: var(--primary-color);
    font-size: 1.05rem;
    margin-bottom: var(--spacing-xs);
    line-height: 1.4;
}

.chapter-card p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    margin: 0 0 var(--spacing-sm) 0;
    flex-grow: 1;
}

.chapter-card .card-link {
    display: inline-block;
    color: var(--secondary-color);
    font-size: 0.9rem;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    margin-top: auto;
}

.chapter-card .card-link:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.chapter-card .card-link::after {
    content: ' →';
}

/* ===== Free Sample Badge ===== */
.chapter-card--free {
    border-top-color: var(--accent-color);
    position: relative;
}

.free-sample-badge {
    display: inline-block;
    background: var(--accent-color);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.2em 0.65em;
    border-radius: 3px;
    margin-bottom: var(--spacing-xs);
    text-transform: uppercase;
}

/* ===== Purchase Link ===== */
.chapter-card .card-link--purchase {
    color: var(--text-light);
    font-style: italic;
}

.chapter-card .card-link--purchase::after {
    content: '';
}

/* ===== Pull Quote ===== */
.pull-quote {
    font-size: 1.25rem;
    font-style: italic;
    color: var(--primary-color);
    border-left: 4px solid var(--accent-color);
    padding: var(--spacing-md) var(--spacing-lg);
    margin: var(--spacing-lg) auto;
    background: var(--background-alt);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    max-width: 700px;
    text-align: center;
}

/* ===== Footer ===== */
footer {
    background: var(--background-alt);
    border-top: 2px solid var(--primary-color);
    padding: var(--spacing-xl) 0;
    margin-top: var(--spacing-xl);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
}

footer p {
    margin: var(--spacing-sm) 0;
}

footer a {
    color: var(--primary-color);
}

/* ===== Responsive Design ===== */

/* Tablet */
@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    header h1 {
        font-size: 2rem;
    }

    header .subtitle {
        font-size: 1.1rem;
    }

    nav ul {
        flex-direction: column;
    }

    nav a {
        padding: var(--spacing-sm);
        text-align: center;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.6rem;
    }

    .chapter-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

/* Mobile */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    header {
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    header h1 {
        font-size: 1.75rem;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }

    main {
        padding: var(--spacing-lg) var(--spacing-sm);
    }

    .chapter-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Print Styles ===== */
@media print {
    header {
        background: white !important;
        color: black !important;
        box-shadow: none;
    }

    header h1,
    header .subtitle,
    header .byline {
        color: black !important;
    }

    nav {
        display: none;
    }

    .chapter-card {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }

    a {
        color: black;
        text-decoration: underline;
        border-bottom: none;
    }

    footer {
        border-top: 1px solid black;
    }

    h2, h3 {
        page-break-after: avoid;
    }
}

/* ===== Dark Mode ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #d47fa0;
        --secondary-color: #7fc4e8;
        --accent-color: #f0b840;
        --text-color: #e0e0e0;
        --text-light: #b0b0b0;
        --background: #1a1a1a;
        --background-alt: #2a2020;
        --border-color: #4a3a3e;
    }

    header {
        background: linear-gradient(135deg, #3a0f1e 0%, #1a0a14 50%, #0d0820 100%);
    }

    .chapter-card {
        background: #252020;
    }
}
