/* ============================================================
   Readr - African Creative Ecosystem
   Main Stylesheet
   ============================================================ */

:root {
    --navy: #0c1428;
    --navy-2: #1a2744;
    --navy-3: #2d1b4e;
    --brand: #059669;
    --brand-dark: #047857;
    --brand-darker: #065f46;
    --brand-light: #d1fae5;
    --brand-lighter: #ecfdf5;
    --brand-hover: #10b981;
    --accent: #dc2626;
    --accent-dark: #b91c1c;
    --accent-light: #fee2e2;
    --accent-lighter: #fef2f2;
    --teal: #dc2626;
    --danger: #e11d48;
    --success: #10b981;
    --warning: #f59e0b;
    --text: #1f2937;
    --muted: #6b7280;
    --border: #e5e7eb;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,.06);
    --shadow-lg: 0 12px 28px rgba(0,0,0,.09);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    line-height: 1.6;
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; transition: color .2s; }
a:hover { color: #047857; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

h1, h2, h3, h4 { color: var(--navy); line-height: 1.25; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .7rem 1.5rem; border-radius: 10px; font-weight: 600; font-size: .92rem;
    border: 1.5px solid transparent; transition: all .22s; text-align: center; line-height: 1.2;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: #047857; color: #fff; box-shadow: 0 6px 18px rgba(5,150,105,.35); }
.btn-outline { border-color: #d1d5db; color: var(--navy); background: #fff; }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }
.btn-outline-light { border-color: rgba(255,255,255,.6); color: #fff; background: transparent; }
.btn-outline-light:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,.1); }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: #f3f4f6; }
.btn-sm { padding: .5rem 1rem; font-size: .83rem; border-radius: 8px; }
.btn-lg { padding: .95rem 2rem; font-size: 1rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #be123c; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; color: #fff; }

/* ===== Header ===== */
.site-header {
    background: #fff; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 1000; box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.header-inner { display: flex; align-items: center; gap: 1.5rem; height: 72px; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; }
.brand-mark {
    width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--brand), #34d399);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-family: 'Playfair Display', serif; font-size: 1.4rem; font-weight: 800;
}
.brand-name { font-size: 1.25rem; color: var(--navy); letter-spacing: -.3px; }
.main-nav { display: flex; gap: .4rem; margin-left: 1.5rem; flex: 1; }
.main-nav a {
    padding: .55rem .9rem; border-radius: 8px; color: #374151; font-size: .9rem; font-weight: 500;
}
.main-nav a:hover { background: #f3f4f6; color: var(--navy); }
.main-nav a.active { background: rgba(5,150,105,.1); color: var(--brand); font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: .4rem; margin-left: auto; }
.icon-btn {
    position: relative; width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #4b5563; font-size: 1rem; transition: all .2s; background: transparent;
}
.icon-btn:hover { background: #f3f4f6; color: var(--navy); }
.icon-btn .badge {
    position: absolute; top: 2px; right: 2px; background: var(--danger); color: #fff;
    font-size: .62rem; font-weight: 700; min-width: 17px; height: 17px;
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    padding: 0 4px; border: 2px solid #fff;
}
.user-menu { position: relative; margin-left: .4rem; }
.user-btn {
    display: flex; align-items: center; gap: .5rem; padding: .35rem .6rem;
    border-radius: 100px; border: 1.5px solid var(--border); background: #fff;
    font-weight: 600; font-size: .85rem; color: var(--navy); transition: all .2s;
}
.user-btn:hover { border-color: var(--brand); }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.user-dropdown {
    display: none; position: absolute; right: 0; top: calc(100% + 10px);
    background: #fff; border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.15);
    border: 1px solid var(--border); min-width: 230px; padding: .5rem; z-index: 1001;
}
.user-dropdown.open { display: block; }
.user-dropdown a {
    display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem;
    border-radius: 8px; color: #374151; font-size: .88rem; font-weight: 500;
}
.user-dropdown a:hover { background: #f8fafc; color: var(--brand); }
.user-dropdown hr { border: none; border-top: 1px solid var(--border); margin: .4rem 0; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.4rem; color: var(--navy); margin-left: auto; }

/* ===== Alerts ===== */
.alert {
    display: flex; align-items: center; gap: .6rem; padding: .9rem 1.1rem;
    border-radius: 10px; font-size: .9rem; font-weight: 500; margin-bottom: 1rem;
    border: 1px solid transparent;
}
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.alert-warning { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert-icon { font-weight: 700; }
.alert-close { margin-left: auto; background: none; border: none; font-size: 1.1rem; color: inherit; opacity: .5; }
.alert-close:hover { opacity: 1; }

/* ===== Sections ===== */
.section { padding: 4.5rem 0; }
.section-alt { background: var(--bg-alt); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.section-head h2 { font-family: 'Playfair Display', serif; font-size: 2.1rem; font-weight: 800; margin-bottom: .3rem; }
.section-head p { color: var(--muted); }
.section-head a { color: var(--brand); font-weight: 600; font-size: .92rem; }
.section-title { font-family: 'Playfair Display', serif; font-size: 2.3rem; font-weight: 800; margin-bottom: .8rem; }
.eyebrow {
    display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 1.5px; color: var(--brand); margin-bottom: .6rem;
}

.split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: center; }
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ===== Cards ===== */
.card {
    background: #fff; border: 1px solid #eee; border-radius: var(--radius);
    overflow: hidden; transition: all .25s; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #e2e2e2; }
.card-cover { position: relative; aspect-ratio: 3/4; background: linear-gradient(135deg, #f3f4f6, #e5e7eb); overflow: hidden; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 1rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card-tag { font-size: .68rem; text-transform: uppercase; letter-spacing: 1px; color: var(--brand); font-weight: 700; }
.card-title { font-weight: 700; font-size: .98rem; line-height: 1.35; }
.card-title a { color: #111827; }
.card-title a:hover { color: var(--brand); }
.card-meta { display: flex; align-items: center; gap: .5rem; font-size: .78rem; color: var(--muted); flex-wrap: wrap; }
.card-footer {
    margin-top: auto; padding-top: .5rem; border-top: 1px solid #f3f4f6;
    display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: #9ca3af;
}

/* ===== Empty state ===== */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state i { font-size: 2.5rem; color: #d1d5db; margin-bottom: 1rem; display: block; }
.empty-state p { margin-bottom: 1.2rem; }

/* ===== Forms ===== */
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .4rem; color: #374151; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: .75rem 1rem; border: 1.5px solid var(--border);
    border-radius: 10px; font-size: .95rem; transition: border-color .2s; background: #fff;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(5,150,105,.12);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-hint { font-size: .78rem; color: var(--muted); margin-top: .3rem; }
textarea { resize: vertical; min-height: 120px; }
.checkbox-row { display: flex; align-items: flex-start; gap: .6rem; font-size: .85rem; color: #4b5563; }
.checkbox-row input { margin-top: .2rem; }

/* ===== Panels ===== */
.panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid #f3f4f6; }
.panel-head { padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.panel-head h3 { font-size: 1.1rem; font-weight: 700; }
.panel-head a { font-size: .82rem; font-weight: 600; }
.panel-body { padding: 1.4rem; }
.feed-list { display: flex; flex-direction: column; }
.feed-item { display: flex; align-items: center; gap: 1rem; padding: .85rem 1.4rem; border-bottom: 1px solid #f9fafb; transition: background .2s; }
.feed-item:hover { background: #f8fafc; }
.feed-item:last-child { border-bottom: none; }
.feed-content { flex: 1; display: flex; flex-direction: column; gap: .15rem; }
.feed-content b { color: var(--navy); font-size: .92rem; }
.feed-content span { color: var(--muted); font-size: .78rem; }

/* ===== Feature list ===== */
.feature-list { display: flex; flex-direction: column; gap: 1rem; margin: 1.5rem 0; }
.feature-item { display: flex; gap: .8rem; align-items: flex-start; }
.feature-item i { color: var(--success); font-size: 1.2rem; margin-top: .2rem; }
.feature-item b { display: block; color: var(--navy); font-size: .95rem; }
.feature-item span { color: var(--muted); font-size: .85rem; }

/* ===== CTA band ===== */
.cta-band { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-3) 100%); color: #fff; padding: 4.5rem 0; text-align: center; }
.cta-band h2 { font-family: 'Playfair Display', serif; font-size: 2.3rem; color: #fff; margin-bottom: .6rem; }
.cta-band p { color: rgba(255,255,255,.75); max-width: 560px; margin: 0 auto 2rem; }
.cta-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ===== Stats ===== */
.stat h3 { font-size: 2rem; font-weight: 800; color: var(--brand-light); }
.stat p { color: rgba(255,255,255,.65); font-size: .85rem; text-transform: uppercase; letter-spacing: 1.5px; }

/* ===== Badges ===== */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .7rem; border-radius: 100px; font-size: .75rem; font-weight: 600; }
.badge-success { background: #ecfdf5; color: #065f46; }
.badge-warning { background: #fffbeb; color: #92400e; }
.badge-danger { background: #fef2f2; color: #991b1b; }
.badge-muted { background: #f3f4f6; color: #4b5563; }

.price-tag { font-weight: 700; color: #047857; }
.free-tag { font-weight: 600; color: var(--success); }

/* ===== Stars ===== */
.stars { color: #f59e0b; font-size: .9rem; letter-spacing: 1px; }
.star.filled, .star.half { color: #f59e0b; }
.star { color: #d1d5db; }

/* ===== Pagination ===== */
.pagination { display: flex; gap: .4rem; justify-content: center; margin: 2.5rem 0; flex-wrap: wrap; }
.page-link {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 38px; height: 38px; padding: 0 .7rem; border-radius: 8px;
    border: 1.5px solid var(--border); color: #374151; font-size: .88rem; font-weight: 600;
}
.page-link:hover { border-color: var(--brand); color: var(--brand); }
.page-link.current { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ===== Auth ===== */
.auth-wrap { min-height: 70vh; display: flex; align-items: center; justify-content: center; padding: 4rem 0; }
.auth-card { width: 100%; max-width: 480px; background: #fff; border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,.08); padding: 2.5rem; border: 1px solid var(--border); }
.auth-card h1 { font-family: 'Playfair Display', serif; font-size: 1.8rem; text-align: center; margin-bottom: .4rem; }
.auth-card .sub { text-align: center; color: var(--muted); margin-bottom: 2rem; }
.auth-alt { text-align: center; margin-top: 1.5rem; font-size: .9rem; color: var(--muted); }
.auth-alt a { color: var(--brand); font-weight: 600; }
.auth-btn { width: 100%; margin-top: .5rem; }
.role-select { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1.2rem; }
.role-option { position: relative; }
.role-option input { position: absolute; opacity: 0; }
.role-option label {
    display: flex; flex-direction: column; align-items: center; gap: .35rem;
    padding: .9rem .6rem; border: 1.5px solid var(--border); border-radius: 12px;
    cursor: pointer; font-size: .8rem; font-weight: 600; color: #374151; transition: all .2s; text-align: center;
}
.role-option label i { font-size: 1.3rem; color: #9ca3af; }
.role-option input:checked + label { border-color: var(--brand); background: rgba(5,150,105,.06); color: var(--brand); }
.role-option input:checked + label i { color: var(--brand); }

/* ===== Search ===== */
.search-bar-big { display: flex; gap: .6rem; max-width: 620px; margin-top: 1.5rem; }
.search-bar-big input {
    flex: 1; padding: .85rem 1.2rem; border-radius: 12px; border: 2px solid transparent;
    font-size: .98rem; outline: none; transition: border-color .2s; background: #fff;
}
.search-bar-big input:focus { border-color: var(--brand); }

/* ===== Footer ===== */
.site-footer { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 60%, var(--navy-3) 100%); color: rgba(255,255,255,.8); padding: 4rem 0 2rem; margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2.5rem; }
.footer-brand .brand-name { color: #fff; }
.footer-brand p { font-size: .85rem; margin-top: .5rem; line-height: 1.6; }
.footer-brand .footer-desc { color: rgba(255,255,255,.55); font-size: .8rem; }
.footer-col h4 { color: #fff; font-size: .95rem; margin-bottom: 1rem; }
.footer-col a { display: block; color: rgba(255,255,255,.65); font-size: .85rem; padding: .3rem 0; }
.footer-col a:hover { color: var(--brand-light); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 1.5rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: .85rem; }
.footer-social { display: flex; gap: .6rem; }
.footer-social a {
    width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.1);
    display: flex; align-items: center; justify-content: center; color: #fff; font-size: .85rem;
}
.footer-social a:hover { background: var(--brand); color: #fff; }

/* ===== Tables ===== */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th { text-align: left; padding: .7rem .9rem; background: #f9fafb; color: #374151; font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .7rem .9rem; border-bottom: 1px solid #f3f4f6; vertical-align: middle; }
.table tr:hover td { background: #fafbfc; }
.table .actions { display: flex; gap: .4rem; }

/* ===== Dashboard ===== */
.dash-grid { display: grid; grid-template-columns: 240px 1fr; gap: 2rem; padding: 2.5rem 0; }
.dash-sidebar { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; height: fit-content; position: sticky; top: 90px; }
.dash-sidebar a {
    display: flex; align-items: center; gap: .7rem; padding: .65rem .8rem; border-radius: 8px;
    color: #374151; font-size: .88rem; font-weight: 500; transition: all .15s;
}
.dash-sidebar a:hover { background: #f8fafc; color: var(--brand); }
.dash-sidebar a.active { background: rgba(5,150,105,.1); color: var(--brand); font-weight: 600; }
.dash-main { min-width: 0; }
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; }
.stat-card .sc-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; margin-bottom: .8rem; }
.stat-card h3 { font-size: 1.6rem; font-weight: 800; margin-bottom: .2rem; }
.stat-card p { color: var(--muted); font-size: .8rem; }

/* ===== Reader cards ===== */
.reader-card { text-align: center; }
.reader-head { display: flex; align-items: center; gap: .8rem; padding: 1rem; border-bottom: 1px solid #f3f4f6; text-align: left; }
.reader-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.reader-head b { color: var(--navy); font-size: .92rem; display: block; }
.reader-head span { color: var(--muted); font-size: .78rem; }
.verified { color: var(--brand); }
.reader-body { padding: 1rem; display: flex; flex-direction: column; gap: .45rem; font-size: .83rem; color: #4b5563; }
.reader-cta { padding: 0 1rem 1rem; }

/* ===== Misc ===== */
.muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }
.inline-form { display: inline; }
.pill-tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1.5rem 0 2rem; }
.pill { padding: .45rem 1rem; border-radius: 100px; border: 1.5px solid var(--border); font-size: .83rem; font-weight: 600; color: #4b5563; transition: all .2s; }
.pill:hover, .pill.active { border-color: var(--brand); color: var(--brand); background: rgba(5,150,105,.06); }
.avatar-lg { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }
.avatar-md { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.avatar-sm { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }

/* ===== Page hero ===== */
.page-hero {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 55%, var(--navy-3) 100%);
    color: #fff; padding: 3.5rem 0; position: relative; overflow: hidden;
}
.page-hero h1 { font-family: 'Playfair Display', serif; font-size: 2.4rem; color: #fff; margin-bottom: .4rem; }
.page-hero p { color: rgba(255,255,255,.75); max-width: 640px; }
.page-hero::after {
    content: ''; position: absolute; top: -60%; right: -10%; width: 480px; height: 480px;
    background: radial-gradient(circle, rgba(5,150,105,.2) 0%, transparent 60%); border-radius: 50%;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
    .main-nav { display: none; }
    .nav-toggle { display: block; }
    .main-nav.open { display: flex; flex-direction: column; position: absolute; top: 72px; left: 0; right: 0; background: #fff; padding: 1rem; border-bottom: 1px solid var(--border); box-shadow: 0 20px 40px rgba(0,0,0,.1); }
    .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .split, .dash-grid { grid-template-columns: 1fr; }
    .dash-sidebar { position: static; display: flex; overflow-x: auto; gap: .2rem; padding: .6rem; }
    .dash-sidebar a { white-space: nowrap; }
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 576px) {
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .hero-cta, .cta-buttons { flex-direction: column; }
    .form-row { grid-template-columns: 1fr; }
    .stat-cards { grid-template-columns: 1fr 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .header-inner { height: 64px; }
    .user-name { display: none; }
    .section { padding: 3rem 0; }
}
/* Afrofuturism / indigenous-language shelves */
.shelf-section { margin: 2.5rem 0; }
.shelf-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.shelf-head h2 { font-family: 'Playfair Display', serif; font-size: 1.6rem; color: #111827; margin: 0; }
.shelf-sub { font-size: .85rem; color: #6b7280; }
