/* Modern, Responsive Stylesheet for Meeting People Authentically Guide */

/* ===== CSS Variables for Easy Theming ===== */
:root {
    --primary-color: #C45E2A;
    --secondary-color: #4A7C59;
    --accent-color: #F4C842;
    --text-color: #333;
    --text-light: #666;
    --background: #ffffff;
    --background-alt: #f8f6f3;
    --border-color: #e0d8d0;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);

    --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: 800px;
}

/* ===== 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: 2rem;
    border-bottom: 3px solid var(--secondary-color);
    padding-bottom: var(--spacing-xs);
    margin-top: var(--spacing-xl);
}

h3 {
    font-size: 1.5rem;
    color: var(--secondary-color);
}

h4 {
    font-size: 1.25rem;
}

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%, #8B3A1A 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.9;
    margin: var(--spacing-xs) 0 0 0;
}

/* ===== Navigation ===== */
nav {
    background: var(--background-alt);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

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.9rem;
    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);
}

.chapter {
    margin-bottom: var(--spacing-xl);
}

/* ===== Pull Quotes ===== */
.pull-quote {
    font-size: 1.3rem;
    font-style: italic;
    color: var(--secondary-color);
    border-left: 4px solid var(--accent-color);
    padding: var(--spacing-md) var(--spacing-lg);
    margin: var(--spacing-lg) 0;
    background: var(--background-alt);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.pull-quote em {
    font-style: normal;
    font-weight: bold;
    color: var(--primary-color);
}

/* ===== Key Insights & Sidebars ===== */
.key-insight {
    background: linear-gradient(to right, #e8f5e9, #f1f8f4);
    border-left: 5px solid var(--secondary-color);
    padding: var(--spacing-md);
    margin: var(--spacing-lg) 0;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.key-insight.warning {
    background: linear-gradient(to right, #fef3e8, #fef8f1);
    border-left-color: var(--primary-color);
}

.key-insight h3,
.key-insight h4 {
    margin-top: 0;
    color: var(--primary-color);
}

.key-insight.warning h3,
.key-insight.warning h4 {
    color: var(--primary-color);
}

.key-insight ul,
.key-insight ol {
    margin-bottom: 0;
}

.sidebar {
    background: var(--background-alt);
    border: 2px solid var(--border-color);
    border-top: 4px solid var(--accent-color);
    padding: var(--spacing-md);
    margin: var(--spacing-lg) 0;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.sidebar h4 {
    margin-top: 0;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: var(--spacing-xs);
}

.sidebar p {
    margin: var(--spacing-sm) 0;
}

.sidebar p:last-child {
    margin-bottom: 0;
}

/* ===== Relationship Type Cards ===== */
.relationship-type {
    background: white;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--secondary-color);
    padding: var(--spacing-md);
    margin: var(--spacing-md) 0;
    border-radius: var(--border-radius);
    transition: transform 0.3s, box-shadow 0.3s;
}

.relationship-type:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-hover);
}

.relationship-type h4 {
    margin-top: 0;
    color: var(--secondary-color);
}

/* ===== Self-Reflection Box ===== */
.self-reflection {
    background: linear-gradient(135deg, #fff8e8 0%, #fef3dc 100%);
    border: 2px dashed var(--accent-color);
    padding: var(--spacing-md);
    margin: var(--spacing-lg) 0;
    border-radius: var(--border-radius);
}

.self-reflection h4 {
    margin-top: 0;
    color: var(--primary-color);
}

/* ===== Examples ===== */
.example {
    background: #f9f6f2;
    border-left: 3px solid var(--primary-color);
    padding: var(--spacing-md);
    margin: var(--spacing-md) 0;
    border-radius: var(--border-radius);
    font-family: var(--font-main);
}

.example p {
    margin: var(--spacing-xs) 0;
}

.example strong {
    color: var(--primary-color);
}

/* ===== Lists ===== */
ul, ol {
    padding-left: var(--spacing-lg);
}

li {
    margin: var(--spacing-xs) 0;
}

li strong {
    color: var(--primary-color);
}

/* ===== References / Footnotes ===== */
.footnotes {
    border-top: 2px solid var(--border-color);
    padding-top: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.references {
    font-size: 0.9rem;
    line-height: 1.6;
}

.references li {
    margin: var(--spacing-sm) 0;
    padding-left: var(--spacing-xs);
}

sup a {
    font-size: 0.75em;
    color: var(--primary-color);
    text-decoration: none;
    vertical-align: super;
    border-bottom: none;
}

sup a:hover {
    text-decoration: underline;
}

/* ===== Footer ===== */
footer {
    background: var(--background-alt);
    border-top: 1px solid var(--border-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;
}

/* ===== 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.75rem;
    }

    h3 {
        font-size: 1.35rem;
    }

    .pull-quote {
        font-size: 1.15rem;
        padding: var(--spacing-sm) var(--spacing-md);
    }
}

/* 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);
    }

    .pull-quote {
        font-size: 1rem;
        padding: var(--spacing-sm);
    }

    .key-insight,
    .sidebar,
    .relationship-type,
    .self-reflection,
    .example {
        padding: var(--spacing-sm);
    }

    nav a {
        padding: 0.75rem;
    }
}

/* ===== Print Styles ===== */
@media print {
    header {
        background: white;
        color: black;
        box-shadow: none;
    }

    header h1,
    header .subtitle,
    header .byline {
        color: black;
    }

    nav {
        display: none;
    }

    .pull-quote,
    .key-insight,
    .sidebar,
    .relationship-type,
    .self-reflection,
    .example {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }

    a {
        color: black;
        text-decoration: underline;
    }

    footer {
        border-top: 1px solid black;
    }

    h2, h3 {
        page-break-after: avoid;
    }
}

/* ===== Accessibility Enhancements ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #7a2800;
        --secondary-color: #1a4a2a;
        --text-color: #000;
        --background: #fff;
        --border-color: #000;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-color: #e08050;
        --secondary-color: #74b08a;
        --accent-color: #f8d870;
        --text-color: #e0e0e0;
        --text-light: #b0b0b0;
        --background: #1a1a1a;
        --background-alt: #2a2520;
        --border-color: #3d3530;
        --shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
        --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.5);
    }

    header {
        background: linear-gradient(135deg, #6a2e10 0%, #4a1c06 100%);
    }

    .key-insight {
        background: linear-gradient(to right, #1b3a1e, #243a30);
        border-left-color: var(--secondary-color);
    }

    .key-insight.warning {
        background: linear-gradient(to right, #3a2418, #3a2e20);
        border-left-color: var(--primary-color);
    }

    .pull-quote {
        background: #2a2520;
    }

    .relationship-type {
        background: #2a2520;
    }

    .example {
        background: #2a2520;
    }

    .self-reflection {
        background: linear-gradient(135deg, #2a2415, #2a2010);
    }

    .sidebar {
        background: #2a2520;
    }
}

/* ===== Focus Styles for Keyboard Navigation ===== */
a:focus,
button:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* ===== Utility Classes ===== */
.text-center {
    text-align: center;
}

.mb-0 {
    margin-bottom: 0;
}

.mt-0 {
    margin-top: 0;
}
