/* ═══════════════════════════════════════════
   Practice Library — July Life Coach
   ═══════════════════════════════════════════ */

:root {
    --bg: #fafaf8;
    --bg-card: #ffffff;
    --text: #1c1c1c;
    --text-secondary: #4a4a4a;
    --text-muted: #737373;
    --border: rgba(0,0,0,0.06);
    --accent: #b08d57;
    --accent-light: rgba(176,141,87,0.08);
    --sage: #8fa38c;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.1);
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --max-w: 1100px;
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ═══ NAV ═══ */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    max-width: var(--max-w);
    margin: 0 auto;
    border-bottom: 1px solid var(--border);
}
.nav-brand {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); font-weight: 500; }

/* ═══ HERO ═══ */
.hero {
    text-align: center;
    padding: 5rem 2rem 3rem;
    max-width: 700px;
    margin: 0 auto;
}
.hero-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 1rem;
}
.hero h1 {
    font-family: var(--font-serif);
    font-size: 2.8rem;
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 1rem;
}
.hero-sub {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
}
.stat { text-align: center; }
.stat-num {
    display: block;
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 600;
    color: var(--accent);
}
.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ═══ CONTROLS ═══ */
.controls {
    max-width: var(--max-w);
    margin: 0 auto 2rem;
    padding: 0 2rem;
}
.search-container {
    position: relative;
    margin-bottom: 1rem;
}
.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
#searchInput {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: var(--font-sans);
    background: var(--bg-card);
    transition: border-color 0.2s;
    outline: none;
}
#searchInput:focus { border-color: var(--accent); }

.filter-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.filter-btn {
    padding: 8px 16px;
    border: 1.5px solid var(--border);
    border-radius: 100px;
    background: var(--bg-card);
    font-size: 0.82rem;
    font-family: var(--font-sans);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.filter-btn:hover { border-color: var(--accent); }
.filter-btn.active {
    background: var(--text);
    border-color: var(--text);
    color: white;
}
.filter-right { margin-left: auto; }
#sourceFilter {
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.82rem;
    font-family: var(--font-sans);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    outline: none;
}

/* ═══ THEME CARDS ═══ */
.themes-section {
    max-width: var(--max-w);
    margin: 0 auto 3rem;
    padding: 0 2rem;
}
.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}
.theme-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.theme-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}
.theme-card.selected {
    border-color: var(--accent);
    background: var(--accent-light);
}
.theme-icon { font-size: 2rem; }
.theme-info h3 {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 2px;
}
.theme-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ═══ CONTENT LIST ═══ */
.content-section {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 2rem 3rem;
}
.content-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.content-header h2 {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 400;
}
.content-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}
.content-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.content-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-card);
    cursor: pointer;
    transition: background 0.15s;
}
.content-item:hover { background: #f8f8f6; }
.content-item .ci-source {
    flex-shrink: 0;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    background: #f2f2f0;
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 2px;
    min-width: 64px;
    text-align: center;
}
.content-item .ci-source.substack { color: var(--accent); background: var(--accent-light); }
.content-item .ci-body { flex: 1; min-width: 0; }
.content-item h3 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 4px;
    line-height: 1.4;
}
.content-item .ci-preview {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.content-item .ci-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}
.content-item .ci-theme-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f2f2f0;
    color: var(--text-muted);
    margin-right: 8px;
}
.content-item .ci-lock {
    flex-shrink: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
    opacity: 0.4;
}

.load-more {
    text-align: center;
    margin-top: 2rem;
}
#loadMoreBtn {
    padding: 12px 40px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    font-size: 0.9rem;
    font-family: var(--font-sans);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s;
}
#loadMoreBtn:hover { border-color: var(--accent); color: var(--text); }

/* ═══ READING OVERLAY ═══ */
.reading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.reading-overlay.active { opacity: 1; pointer-events: all; }
.reading-panel {
    width: 100%;
    max-width: 680px;
    background: var(--bg);
    overflow-y: auto;
    padding: 3rem;
    position: relative;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.reading-overlay.active .reading-panel { transform: translateX(0); }
.reading-close {
    position: sticky;
    top: 0;
    float: right;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
    z-index: 10;
    line-height: 1;
}
.reading-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
}
.reading-title {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 2rem;
}
.reading-body {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--text-secondary);
    max-height: none;
    overflow: visible;
    position: relative;
}
.reading-body.blurred {
    max-height: 400px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}
.reading-body p { margin-bottom: 1.2rem; }

/* Reddit link */
.reading-reddit-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--accent);
    text-decoration: none;
    margin-bottom: 1.5rem;
    padding: 6px 12px;
    background: var(--accent-light);
    border-radius: 6px;
    transition: all 0.2s;
}
.reading-reddit-link:hover { background: rgba(176,141,87,0.15); }
.reading-reddit-link svg { flex-shrink: 0; }

/* Markdown rendering in reading body */
.reading-body blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.75rem 1.25rem;
    margin: 1rem 0 1.2rem;
    color: var(--text-secondary);
    background: var(--accent-light);
    border-radius: 0 8px 8px 0;
    font-style: italic;
}
.reading-body ul, .reading-body ol {
    margin: 0.5rem 0 1.2rem 1.5rem;
    line-height: 1.8;
}
.reading-body li { margin-bottom: 0.3rem; }
.reading-body h3, .reading-body h4, .reading-body h5 {
    font-family: var(--font-serif);
    font-weight: 500;
    margin: 1.5rem 0 0.75rem;
    color: var(--text);
}
.reading-body h3 { font-size: 1.3rem; }
.reading-body h4 { font-size: 1.15rem; }
.reading-body h5 { font-size: 1.05rem; }
.reading-body a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.reading-body a:hover { opacity: 0.8; }
.reading-body strong { color: var(--text); font-weight: 600; }
.reading-body del { opacity: 0.5; }

/* Paywall */
.reading-paywall { display: none; margin-top: 1rem; }
.reading-paywall.visible { display: block; }
.paywall-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    text-align: center;
    color: white;
}
.paywall-card h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 0.75rem;
}
.paywall-card > p {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}
.paywall-options {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 2rem;
}
.paywall-btn {
    padding: 12px 28px;
    border: 1.5px solid rgba(255,255,255,0.25);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}
.paywall-btn:hover { border-color: white; background: rgba(255,255,255,0.08); }
.paywall-btn-primary {
    background: var(--accent);
    border-color: var(--accent);
}
.paywall-btn-primary:hover { opacity: 0.85; }
.paywall-save {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    opacity: 0.8;
    margin-top: 2px;
}
.paywall-unlock {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.5rem;
}
.paywall-unlock > p { font-size: 0.85rem; color: rgba(255,255,255,0.5); margin-bottom: 0.75rem; }
.unlock-row {
    display: flex;
    gap: 8px;
    max-width: 320px;
    margin: 0 auto;
}
#unlockInput {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
    color: white;
    font-size: 0.9rem;
    outline: none;
}
#unlockBtn {
    padding: 10px 20px;
    background: white;
    color: var(--text);
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
}
.unlock-error { color: #e74c3c !important; font-size: 0.8rem !important; margin-top: 0.5rem; }

/* ═══ CTA SECTION ═══ */
.cta-section {
    max-width: 700px;
    margin: 2rem auto 4rem;
    padding: 0 2rem;
}
.cta-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: var(--radius-lg);
    padding: 3rem;
    text-align: center;
    color: white;
}
.cta-card h2 {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 0.75rem;
}
.cta-card > p {
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
    line-height: 1.7;
    max-width: 480px;
    margin: 0 auto 2rem;
}
.cta-pricing {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.price-option { text-align: center; }
.price-amount {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 600;
}
.price-period { font-size: 0.9rem; color: rgba(255,255,255,0.6); }
.price-or { color: rgba(255,255,255,0.3); font-size: 0.85rem; }
.price-option-featured { position: relative; }
.price-badge {
    display: inline-block;
    background: var(--accent);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 8px;
    border-radius: 100px;
    margin-top: 4px;
}
.cta-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 1rem;
}
.cta-btn {
    padding: 14px 32px;
    border: 1.5px solid rgba(255,255,255,0.25);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}
.cta-btn:hover { border-color: white; background: rgba(255,255,255,0.08); }
.cta-btn-primary { background: var(--accent); border-color: var(--accent); }
.cta-btn-primary:hover { opacity: 0.85; }
.cta-note { font-size: 0.8rem; color: rgba(255,255,255,0.4); margin-top: 0.5rem; }

/* ═══ FOOTER ═══ */
.site-footer {
    text-align: center;
    padding: 3rem 2rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.8;
}
.footer-brand { font-weight: 600; color: var(--text); margin-bottom: 0.75rem; }
.footer-links { margin-bottom: 0.75rem; }
.footer-links a, .footer-legal a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 0.4rem;
}
.footer-links a:hover, .footer-legal a:hover { color: var(--text); }
.footer-legal { margin-bottom: 1rem; font-size: 0.8rem; }
.footer-copy { font-size: 0.8rem; }

/* ═══ MOBILE ═══ */
@media (max-width: 680px) {
    .top-nav { flex-direction: column; gap: 0.75rem; padding: 1rem; }
    .hero h1 { font-size: 2rem; }
    .hero-stats { gap: 1.5rem; }
    .themes-grid { grid-template-columns: 1fr 1fr; }
    .filter-row { gap: 6px; }
    .content-item { padding: 1rem; }
    .reading-panel { padding: 1.5rem; max-width: 100%; }
    .paywall-options { flex-direction: column; align-items: stretch; }
    .cta-pricing { flex-direction: column; gap: 0.5rem; }
    .cta-buttons { flex-direction: column; align-items: stretch; }
}
