/* ============================================
   CHEEKY MEAD — DOCUMENT STYLES
   Warm, readable long-form document layout
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500&family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

/* ── RESET & VARIABLES ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --gold: #D4A843;
    --gold-bright: #E8B84B;
    --gold-light: rgba(212, 168, 67, 0.10);
    --gold-glow: rgba(232, 184, 75, 0.20);
    --charcoal: #2D2926;
    --cream: #FDF8F0;
    --white: #FFFFFF;
    --text: #2D2926;
    --text-body: #3D3936;
    --muted: #6B6B6B;
    --border: #E8E0D4;
    --sidebar-width: 280px;
    --toolbar-height: 56px;
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    color: var(--text-body);
    background: var(--cream);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   LAYOUT: sidebar + main
   ============================================ */
.doc-layout {
    display: flex;
    min-height: 100vh;
}

/* ── SIDEBAR ── */
.doc-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--white);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-brand {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--charcoal);
    letter-spacing: 2px;
    text-decoration: none;
    display: block;
    margin-bottom: 0.2rem;
}

.sidebar-subtitle {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
}

.sidebar-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    margin-top: 0.75rem;
    transition: color 0.2s;
}

.sidebar-back:hover {
    color: var(--gold);
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
    overflow-y: auto;
}

.sidebar-section {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 1rem 1.25rem 0.4rem;
}

.sidebar-nav a {
    display: block;
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-body);
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.sidebar-nav a:hover {
    color: var(--gold);
    background: var(--gold-light);
    border-left-color: var(--gold);
}

.sidebar-nav a.active {
    color: var(--gold);
    background: var(--gold-light);
    border-left-color: var(--gold);
    font-weight: 600;
}

/* ── MAIN ── */
.doc-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ── TOOLBAR ── */
.doc-toolbar {
    position: sticky;
    top: 0;
    z-index: 150;
    height: var(--toolbar-height);
    background: rgba(253, 248, 240, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.toolbar-title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--charcoal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--charcoal);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-download:hover {
    border-color: var(--gold);
    color: var(--gold);
    box-shadow: 0 2px 8px var(--gold-glow);
}

/* ── HAMBURGER (mobile) ── */
.doc-hamburger {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 300;
    width: 40px;
    height: 40px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: border-color 0.2s;
}

.doc-hamburger:hover {
    border-color: var(--gold);
}

.doc-hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--charcoal);
    border-radius: 2px;
    transition: 0.3s;
}

.doc-hamburger span + span {
    margin-top: 4px;
}

/* ── OVERLAY (mobile backdrop) ── */
.doc-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45, 41, 38, 0.4);
    z-index: 190;
    backdrop-filter: blur(4px);
}

.doc-overlay.visible {
    display: block;
}

/* ============================================
   CONTENT TYPOGRAPHY
   ============================================ */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2.5rem 2rem 5rem;
}

/* Headings */
h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 800;
    color: var(--charcoal);
    line-height: 1.15;
    margin-bottom: 1.5rem;
    margin-top: 2rem;
}

h2 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: var(--charcoal);
    line-height: 1.2;
    margin-top: 3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gold-light);
}

h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--charcoal);
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

h4 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--charcoal);
    line-height: 1.35;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Body text */
p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-body);
    margin-bottom: 1.25rem;
}

strong {
    font-weight: 700;
    color: var(--charcoal);
}

em {
    font-style: italic;
}

/* Links */
a {
    color: var(--gold);
    text-decoration: underline;
    text-decoration-color: rgba(212, 168, 67, 0.3);
    text-underline-offset: 2px;
    transition: all 0.2s;
}

a:hover {
    color: var(--gold-bright);
    text-decoration-color: var(--gold-bright);
}

/* Horizontal rules */
hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 2.5rem 0;
}

/* ── LISTS ── */
ul, ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

li {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-body);
    margin-bottom: 0.4rem;
}

li::marker {
    color: var(--gold);
}

ul ul, ol ol, ul ol, ol ul {
    margin-top: 0.3rem;
    margin-bottom: 0.3rem;
}

/* ── BLOCKQUOTES ── */
blockquote {
    background: linear-gradient(135deg, rgba(253,248,240,0.7), rgba(212,168,67,0.06));
    border-left: 4px solid var(--gold);
    border-radius: 0 12px 12px 0;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
}

blockquote p {
    font-size: 1rem;
    color: var(--charcoal);
    line-height: 1.7;
    margin-bottom: 0;
}

blockquote p + p {
    margin-top: 0.75rem;
}

/* ── TABLES ── */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.92rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

thead {
    background: var(--charcoal);
}

thead th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--gold-bright);
    border-bottom: 2px solid var(--gold);
}

tbody tr {
    background: var(--white);
    transition: background 0.15s;
}

tbody tr:nth-child(even) {
    background: rgba(253, 248, 240, 0.5);
}

tbody tr:hover {
    background: var(--gold-light);
}

tbody td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-body);
    line-height: 1.5;
}

/* ── CODE BLOCKS ── */
code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.88em;
    background: rgba(212, 168, 67, 0.08);
    color: var(--charcoal);
    padding: 0.15em 0.4em;
    border-radius: 4px;
}

pre {
    background: var(--charcoal);
    color: #E8E0D4;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.88rem;
    line-height: 1.6;
}

pre code {
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
}

/* ── KEY STAT CALLOUT ── */
.key-stat {
    background: linear-gradient(135deg, var(--white), rgba(253,248,240,0.8));
    border: 1px solid rgba(212, 168, 67, 0.2);
    border-left: 4px solid var(--gold);
    border-radius: 0 12px 12px 0;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
}

.key-stat .stat-value {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--gold);
    line-height: 1.2;
}

.key-stat .stat-label {
    font-size: 0.9rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

/* ── IMAGES ── */
img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1.5rem 0;
}

/* ── CARDS (for content sections) ── */
.doc-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    margin: 1.5rem 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.03);
}

/* ============================================
   RESPONSIVE: Sidebar collapses on mobile
   ============================================ */
@media (max-width: 900px) {
    .doc-sidebar {
        transform: translateX(-100%);
    }

    .doc-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    }

    .doc-main {
        margin-left: 0;
    }

    .doc-hamburger {
        display: flex;
    }

    .doc-toolbar {
        padding-left: 3.5rem;
    }

    .container {
        padding: 2rem 1.25rem 4rem;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    table {
        font-size: 0.82rem;
    }

    thead th, tbody td {
        padding: 0.5rem 0.7rem;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 1.5rem 1rem 3rem;
    }

    p, li {
        font-size: 0.95rem;
    }

    .toolbar-title {
        font-size: 0.82rem;
    }
}

/* ---- PREMIUM CONSULTING COMPONENTS ---- */

.pull-quote {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-style: italic;
    color: #D4A843;
    border-left: 4px solid #D4A843;
    padding: 1.5rem 2rem;
    margin: 2.5rem 0;
    background: linear-gradient(135deg, rgba(212, 168, 67, 0.05), rgba(232, 184, 75, 0.03));
    border-radius: 0 8px 8px 0;
    line-height: 1.5;
    position: relative;
}
.pull-quote::before {
    content: '\201C';
    font-size: 4rem;
    color: rgba(212, 168, 67, 0.2);
    position: absolute;
    top: -0.5rem;
    left: 0.5rem;
    font-family: 'Playfair Display', serif;
}

.key-insight {
    background: linear-gradient(135deg, #2D2926, #3D3936);
    color: #FDF8F0;
    padding: 2rem 2.5rem;
    border-radius: 12px;
    margin: 2.5rem 0;
    border-left: 4px solid #D4A843;
    position: relative;
}
.key-insight::before {
    content: '💡 KEY INSIGHT';
    display: block;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #D4A843;
    margin-bottom: 0.75rem;
}
.key-insight p { color: #FDF8F0; margin: 0; }

.stat-callout {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    margin: 2rem 0;
    background: #FFFFFF;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.stat-callout .stat-number {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: #D4A843;
    white-space: nowrap;
    line-height: 1;
}
.stat-callout .stat-label { font-size: 1.05rem; color: #6B6B6B; line-height: 1.5; }

.framework-box {
    border: 2px solid #D4A843;
    border-radius: 12px;
    padding: 2rem;
    margin: 2.5rem 0;
    background: rgba(212, 168, 67, 0.03);
}
.framework-box h4 {
    font-family: 'Playfair Display', serif;
    color: #2D2926;
    font-size: 1.3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(212, 168, 67, 0.3);
}

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #D4A843, #E8B84B);
    z-index: 10000;
    transition: width 0.1s linear;
}

.section-divider {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #D4A843, #E8B84B);
    margin: 3rem auto;
    border-radius: 2px;
}

@media (max-width: 768px) {
    .pull-quote { font-size: 1.2rem; padding: 1rem 1.5rem; }
    .stat-callout { flex-direction: column; text-align: center; gap: 0.75rem; }
    .stat-callout .stat-number { font-size: 2.5rem; }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .doc-sidebar,
    .doc-toolbar,
    .doc-hamburger,
    .doc-overlay {
        display: none !important;
    }

    .doc-main {
        margin-left: 0 !important;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    body {
        background: white;
        color: black;
        font-size: 11pt;
    }

    h1 { font-size: 24pt; }
    h2 { font-size: 18pt; border-bottom-color: #ccc; }
    h3 { font-size: 14pt; }

    a { color: black; text-decoration: none; }

    blockquote {
        border-left-color: #999;
        background: #f5f5f5;
    }

    table {
        box-shadow: none;
    }

    thead {
        background: #333;
    }

    pre {
        background: #f0f0f0;
        color: #333;
        border: 1px solid #ccc;
    }
}
