/* =====================================================
   Dr. Ibrahim Wada - Academic Website Styles
   ===================================================== */

:root {
    --primary: #1a3a5c;
    --primary-light: #2c5282;
    --primary-dark: #0f2940;
    --accent: #c9a227;
    --accent-light: #e0bc3e;
    --bg-light: #f4f6f9;
    --bg-card: #ffffff;
    --text-dark: #1a1a2e;
    --text-muted: #6c757d;
    --text-light: #f8f9fa;
    --border-color: #dee2e6;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 20px rgba(0,0,0,0.12);
    --radius: 10px;
    --transition: all 0.3s ease;
    --font-sans: 'Poppins', sans-serif;
    --font-serif: 'Merriweather', Georgia, serif;
    --heading-font: var(--font-sans);
    --font-size: 16px;
    --primary-rgb: 26, 58, 92;
    --accent-ink: #ffffff;
}

html {
    font-size: var(--font-size);
}

/* ---- Base ---- */
body {
    font-family: var(--font-sans);
    color: var(--text-dark);
    background-color: var(--bg-light);
    line-height: 1.7;
}

h1, h2, h3, h4, h5, h6, .brand-name, .footer-title {
    font-family: var(--heading-font);
    font-weight: 600;
    color: var(--primary);
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent);
}

.text-light-muted { color: rgba(255,255,255,0.75); }

/* ---- Top Bar ---- */
.top-bar {
    background: var(--primary-dark);
    color: var(--text-light);
    font-size: 0.85rem;
}

.top-bar a:hover {
    color: var(--accent-light);
}

/* ---- Navbar ---- */
.navbar {
    padding: 0.75rem 0;
    transition: var(--transition);
}

.brand-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.brand-name {
    font-weight: 600;
    color: var(--primary);
    font-size: 1.15rem;
    line-height: 1.2;
}

.brand-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.navbar-nav .nav-link {
    font-weight: 500;
    color: var(--text-dark);
    padding: 0.5rem 0.85rem;
    border-radius: 5px;
    margin: 0 2px;
    transition: var(--transition);
}

.navbar-nav .nav-link:hover {
    color: var(--primary);
    background-color: rgba(var(--primary-rgb), 0.08);
}

.navbar-nav .nav-link.active {
    color: var(--primary);
    background-color: rgba(var(--primary-rgb), 0.1);
    font-weight: 600;
}

/* ---- Hero Section ---- */
.hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    color: #fff;
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: rgba(255,255,255,0.03);
    border-radius: 50%;
}

.hero-avatar {
    width: 180px;
    height: 180px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: 700;
    color: #fff;
    margin: 0 auto 1.5rem;
    box-shadow: 0 0 0 8px rgba(255,255,255,0.1), 0 8px 32px rgba(0,0,0,0.3);
}

.hero h1 {
    color: #fff;
    font-size: 2.5rem;
    font-weight: 700;
}

.hero .hero-title-accent {
    color: var(--accent-light);
}

.hero .lead {
    color: rgba(255,255,255,0.85);
    font-size: 1.15rem;
}

.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0.35rem 1rem;
    border-radius: 30px;
    font-size: 0.85rem;
    margin: 0.25rem;
    color: #fff;
}

/* ---- Section Headers ---- */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2rem;
    position: relative;
    display: inline-block;
    padding-bottom: 0.5rem;
}

.section-header h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

.section-header p {
    color: var(--text-muted);
    max-width: 600px;
    margin: 1rem auto 0;
}

/* ---- Cards ---- */
.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    background: var(--bg-card);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.card-body { padding: 1.5rem; }

.card-title {
    font-weight: 600;
    color: var(--primary);
}

/* ---- Stat Cards (Home) ---- */
.stat-card {
    text-align: center;
    padding: 2rem 1.5rem;
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---- Timeline ---- */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary), var(--primary-light), var(--accent));
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 0.5rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--bg-light);
    box-shadow: 0 0 0 2px var(--accent);
    margin-left: -5px;
}

.timeline-period {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.timeline-institution {
    font-weight: 600;
    color: var(--primary);
    font-size: 1.1rem;
}

.timeline-content {
    margin-top: 0.5rem;
    color: var(--text-dark);
}

/* ---- Publication Items ---- */
.pub-item {
    border-left: 4px solid var(--primary);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    background: #fff;
    border-radius: 0 var(--radius) var(--radius) 0;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.pub-item:hover {
    border-left-color: var(--accent);
    box-shadow: var(--shadow-lg);
}

.pub-type-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pub-type-journal_article { background: #e3f2fd; color: #1565c0; }
.pub-type-book { background: #f3e5f5; color: #7b1fa2; }
.pub-type-conference_paper { background: #e8f5e9; color: #2e7d32; }
.pub-type-unpublished { background: #fff3e0; color: #e65100; }

.pub-year {
    font-weight: 700;
    color: var(--accent);
}

.pub-authors {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.pub-title {
    font-weight: 600;
    color: var(--primary);
}

.pub-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ---- Project Cards ---- */
.project-card {
    height: 100%;
}

.project-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    margin-bottom: 1rem;
}

/* ---- Skill Cards ---- */
.skill-card {
    height: 100%;
    border-left: 4px solid var(--accent);
}

.skill-category {
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.skill-competency {
    color: var(--text-dark);
    font-size: 0.9rem;
}

/* ---- Certifications ---- */
.cert-badge {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 0.75rem;
    transition: var(--transition);
}

.cert-badge:hover {
    box-shadow: var(--shadow-lg);
}

.cert-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ---- Footer ---- */
.footer {
    background: var(--primary-dark);
    color: var(--text-light);
}

.footer-title {
    color: var(--accent-light);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent-light);
    padding-left: 5px;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: #fff;
    margin-right: 0.5rem;
    transition: var(--transition);
}

.social-icon:hover {
    background: var(--accent);
    color: #fff;
}

.footer-bottom {
    background: rgba(0,0,0,0.2);
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
}

/* ---- Page Banner ---- */
.page-banner {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    padding: 3.5rem 0 2.5rem;
    text-align: center;
}

.page-banner h1 {
    color: #fff;
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.page-banner p {
    color: rgba(255,255,255,0.8);
    margin: 0;
}

.breadcrumb-custom {
    background: transparent;
    justify-content: center;
    margin-top: 1rem;
}

.breadcrumb-custom a {
    color: rgba(255,255,255,0.7);
}

.breadcrumb-custom .active {
    color: var(--accent-light);
}

.breadcrumb-custom .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(255,255,255,0.4);
}

/* ---- Contact Form ---- */
.contact-form-card {
    padding: 2rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb), 0.15);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    font-weight: 500;
    padding: 0.6rem 1.75rem;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-accent {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-ink);
    font-weight: 500;
}

.btn-accent:hover {
    background: var(--accent-light);
    border-color: var(--accent-light);
    color: var(--accent-ink);
}

/* ---- Info Box ---- */
.info-box {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.info-box h4 {
    color: var(--primary);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

/* ---- Research Interest Cards ---- */
.interest-card {
    text-align: center;
    padding: 1.5rem 1rem;
    height: 100%;
}

.interest-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    margin: 0 auto 0.75rem;
}

/* ---- Tables ---- */
.table-custom {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table-custom thead {
    background: var(--primary);
    color: #fff;
}

.table-custom thead th {
    font-weight: 500;
    border: none;
    padding: 1rem;
}

.table-custom tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
}

.table-custom tbody tr:hover {
    background-color: rgba(26, 58, 92, 0.04);
}

/* ---- Admin Panel ---- */
.admin-sidebar {
    background: var(--primary-dark);
    min-height: 100vh;
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    padding: 0;
    z-index: 1000;
}

.admin-sidebar .sidebar-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.admin-sidebar .sidebar-header h5 {
    color: #fff;
    margin: 0;
}

.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.7);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition);
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.admin-sidebar .nav-link i {
    width: 20px;
    text-align: center;
}

.admin-content {
    margin-left: 280px;
    padding: 1rem 2rem;
    width: calc(100% - 280px);
}

.admin-topbar {
    background: #fff;
    padding: 1rem 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border-radius: var(--radius);
}

.admin-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.admin-stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.admin-stat-card:hover {
    box-shadow: var(--shadow-lg);
}

.admin-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
}

.admin-login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.admin-login-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

.admin-login-card h3 {
    color: var(--primary);
    text-align: center;
    margin-bottom: 0.5rem;
}

.admin-login-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: #fff;
    margin: 0 auto 1rem;
}

/* ---- Badges ---- */
.badge-unread {
    background: var(--accent);
    color: #fff;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

/* ---- Alerts ---- */
.alert {
    border: none;
    border-radius: var(--radius);
}

.alert-success { background: #d4edda; color: #155724; }
.alert-danger { background: #f8d7da; color: #721c24; }
.alert-info { background: #d1ecf1; color: #0c5460; }

/* ---- Search/Filter Bar ---- */
.filter-bar {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-bottom: 2rem;
}

/* ---- Top bar clusters (keep phone numbers on one line) ---- */
.top-bar-cluster {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.85rem;
    justify-content: center;
}
.top-bar-cluster a {
    white-space: nowrap;
}
@media (min-width: 768px) {
    .top-bar-cluster.text-md-start { justify-content: flex-start; }
    .top-bar-cluster.text-md-end { justify-content: flex-end; }
}

/* ---- Smart reading ---- */
.reading-root {
    --reading-scale: 1;
}
.reading-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 0.55rem 0.75rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    position: sticky;
    top: 76px;
    z-index: 20;
    box-shadow: var(--shadow);
}
.reading-toolbar-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-left: 0.4rem;
}
.reading-toolbar-actions {
    display: flex;
    gap: 0.35rem;
}
.reading-btn {
    border: 1px solid var(--border-color);
    background: #fff;
    color: var(--primary);
    border-radius: 999px;
    min-width: 44px;
    min-height: 36px;
    padding: 0.2rem 0.75rem;
    font-weight: 600;
    font-size: 0.9rem;
}
.reading-btn:hover,
.reading-btn[aria-pressed="true"] {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.reading-prose,
.article-body.reading-prose {
    font-family: var(--font-serif);
    font-size: calc(1.05rem * var(--reading-scale));
    line-height: 1.85;
    color: var(--text-dark);
}
.reading-paragraph {
    margin-bottom: 1rem;
    line-height: 1.85;
}
.autobio-section {
    scroll-margin-top: 9rem;
}
body.reading-focus {
    background: #f6f1e7;
}
body.reading-focus .top-bar,
body.reading-focus .page-banner,
body.reading-focus footer,
body.reading-focus .cta-section,
body.reading-focus .autobio-nav .info-box:first-child {
    display: none !important;
}
body.reading-focus .reading-prose {
    max-width: 40rem;
}
body.reading-focus .reading-toolbar {
    top: 72px;
    background: #fbf8f1;
}

/* ---- Responsive ---- */
@media (max-width: 991px) {
    .navbar-nav {
        margin-top: 1rem;
    }
    .navbar-nav .nav-link {
        padding: 0.65rem 0.75rem;
    }
    .navbar-expand-lg .navbar-nav .dropdown-menu {
        position: fixed !important;
        inset: auto 0.75rem calc(0.75rem + env(safe-area-inset-bottom, 0px)) 0.75rem;
        width: auto;
        max-height: min(70vh, calc(100dvh - 7.5rem));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 1050;
        margin: 0;
        border: 0;
        border-radius: 0.9rem;
        box-shadow: 0 12px 40px rgba(15, 41, 64, 0.22);
        background: #fff;
        padding: 0.4rem;
    }
    .navbar-expand-lg .navbar-nav .dropdown-item {
        padding: 0.75rem 0.85rem;
        border-radius: 0.6rem;
        white-space: normal;
    }
    .navbar-expand-lg .navbar-nav .dropdown-item:hover,
    .navbar-expand-lg .navbar-nav .dropdown-item:focus,
    .navbar-expand-lg .navbar-nav .dropdown-item.active {
        background: rgba(var(--primary-rgb), 0.1);
        color: var(--primary);
    }
    .autobio-nav {
        position: sticky;
        top: 72px;
        z-index: 15;
        background: var(--bg-light);
        margin-bottom: 0.5rem;
    }
    .autobio-nav .info-box:first-child {
        display: none;
    }
    .autobio-nav .info-box {
        margin-bottom: 0.75rem;
        padding: 0.75rem;
    }
    .autobio-nav .nav {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 0.4rem;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
    }
    .autobio-nav .nav-item {
        flex: 0 0 auto;
    }
    .autobio-nav .nav-link {
        white-space: nowrap;
        margin-bottom: 0;
        min-height: 44px;
        background: #fff;
        border: 1px solid var(--border-color);
        font-size: 0.85rem;
    }
    .reading-toolbar {
        position: static;
    }
    .autobio-section {
        scroll-margin-top: 11.5rem;
    }
}

@media (max-width: 576px) {
    .hero { padding: 2.5rem 0 2rem; }
    .hero h1 { font-size: 1.75rem; }
    .hero .lead { font-size: 1rem; }
    .hero-photo, .hero-avatar { width: 150px; height: 150px; }
    .section-header h2 { font-size: 1.5rem; }
    .section-padding { padding: 2.25rem 0; }
    .stat-number { font-size: 2rem; }
    .page-banner { padding: 2rem 0 1.5rem; }
    .page-banner h1 { font-size: 1.5rem; }
    .page-banner p { font-size: 0.95rem; }
    .admin-login-card { padding: 1.5rem; }
    .cta-section { padding: 2.25rem 0; }
    .cta-section h2 { font-size: 1.45rem; }
    .cta-section p { font-size: 1rem; padding: 0 0.5rem; }
    .cta-btn { width: 100%; justify-content: center; }
    .resource-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .resource-download-btn { align-self: stretch; justify-content: center; }
    .pub-item, .cv-document { overflow-wrap: break-word; }
    .cv-document { padding: 1.1rem !important; }
    .filter-bar { padding: 1rem; }
    .autobio-content::first-letter { font-size: 2.1rem; }
    .autobio-title { font-size: 1.25rem; }
    .footer-bottom { font-size: 0.78rem; padding-left: 0.5rem; padding-right: 0.5rem; }
    .scroll-top { right: 1rem; bottom: 1rem; }
}

/* ---- Loading Spinner ---- */
.spinner-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ---- Scroll to Top ---- */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
    z-index: 998;
    border: none;
}

.scroll-top.visible {
    opacity: 1;
}

.scroll-top:hover {
    background: var(--primary-dark);
    color: var(--accent-light);
}

/* ---- Utility ---- */
.section-padding { padding: 4rem 0; }
.bg-white-section { background: #fff; }
.text-primary-custom { color: var(--primary) !important; }
.text-accent-custom { color: var(--accent) !important; }
.bg-primary-custom { background: var(--primary) !important; }
.bg-accent-custom { background: var(--accent) !important; }

/* ---- Author Photo (Navbar + Sidebar) ---- */
.brand-photo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.hero-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1.5rem;
    border: 6px solid rgba(255,255,255,0.2);
    box-shadow: 0 0 0 10px rgba(255,255,255,0.05), 0 8px 32px rgba(0,0,0,0.3);
    display: block;
}

/* ---- CTA Section ---- */
.cta-section {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    padding: 3.5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: rgba(255,255,255,0.03);
    border-radius: 50%;
}

.cta-section h2 {
    color: #fff;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.cta-section p {
    color: rgba(255,255,255,0.85);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    text-decoration: none;
}

.cta-btn-primary {
    background: var(--accent);
    color: #fff;
}

.cta-btn-primary:hover {
    background: var(--accent-light);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201,162,39,0.4);
}

.cta-btn-outline {
    border: 2px solid rgba(255,255,255,0.3);
    color: #fff;
}

.cta-btn-outline:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
    transform: translateY(-2px);
}

/* ---- Autobiography ---- */
.autobio-section {
    margin-bottom: 3rem;
}

.autobio-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--accent);
}

.autobio-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    flex-shrink: 0;
}

.autobio-title {
    font-size: 1.5rem;
    margin: 0;
}

.autobio-content {
    line-height: 1.9;
    color: var(--text-dark);
    font-size: 1.02rem;
}

.autobio-nav {
    position: sticky;
    top: 100px;
}

.autobio-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-dark);
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    margin-bottom: 0.25rem;
    transition: var(--transition);
}

.autobio-nav .nav-link:hover,
.autobio-nav .nav-link.active {
    background: rgba(26,58,92,0.08);
    color: var(--primary);
    font-weight: 500;
}

.autobio-nav .nav-link i {
    color: var(--accent);
    width: 20px;
}

/* ---- Resource Cards ---- */
.resource-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
    transition: var(--transition);
    border-left: 4px solid var(--primary);
}

.resource-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-left-color: var(--accent);
}

.resource-icon-lg {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    flex-shrink: 0;
}

.resource-info {
    flex-grow-1;
}

.resource-title {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.resource-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.resource-type-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.resource-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.2rem;
    background: var(--accent);
    color: #fff;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.85rem;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.resource-download-btn:hover {
    background: var(--accent-light);
    color: #fff;
    transform: scale(1.05);
}

.resource-stats {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ---- Upload Form (Admin) ---- */
.upload-form-card {
    padding: 2rem;
}

.file-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}
.text-primary-custom { color: var(--primary) !important; }
.text-accent-custom { color: var(--accent) !important; }
.bg-primary-custom { background: var(--primary) !important; }
.bg-accent-custom { background: var(--accent) !important; }

/* ---- Reading Progress ---- */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    z-index: 2000;
    background: transparent;
}
.reading-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.1s linear;
}

/* ---- Autobiography drop cap ---- */
.autobio-content::first-letter {
    font-size: 3.2rem;
    font-weight: 700;
    float: left;
    line-height: 1;
    margin-right: 0.6rem;
    color: var(--primary);
}

/* Admin layout stability & responsiveness */
.admin-sidebar {
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}
.admin-main, .admin-content-body {
    overflow-x: hidden;
}

/* Clean wrapping in admin tables */
.admin-main table td, .admin-main table th,
.admin-content table td, .admin-content table th {
    white-space: normal;
    word-break: break-word;
}

.scholar-id {
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    font-weight: 600;
}

body.hero-centered .hero .row {
    justify-content: center;
    text-align: center;
}
body.hero-centered .hero .d-flex {
    justify-content: center;
}
body.hero-centered .hero-media,
body.hero-centered .hero-copy {
    flex: 0 0 100%;
    width: 100%;
    max-width: 760px;
}
body.hero-text .hero-media {
    display: none !important;
}
body.hero-text .hero-copy {
    flex: 0 0 100%;
    width: 100%;
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
}
body.measure-narrow .container {
    max-width: 920px;
}
body.measure-wide .container {
    max-width: 1280px;
}
body.density-compact {
    line-height: 1.55;
}
body.density-compact .section-padding {
    padding: 2.4rem 0;
}
body.density-compact .hero {
    padding: 2.5rem 0 2rem;
}
body.density-compact .page-banner {
    padding: 2.2rem 0 1.6rem;
}
body.density-compact .card-body {
    padding: 1rem;
}

.blog-figure,
.blog-video,
.blog-audio,
.blog-chart {
    margin: 1.5rem 0;
}
.blog-figure img,
.blog-video video,
.blog-inline,
.article-body img {
    max-width: 100%;
    height: auto;
}
.blog-figure img,
.blog-video video {
    display: block;
    margin: 0 auto;
    border-radius: 6px;
}
.blog-figure figcaption,
.blog-video figcaption,
.blog-audio figcaption,
.blog-chart figcaption {
    margin-top: 0.55rem;
    text-align: center;
    font-family: var(--font-sans, Poppins, sans-serif);
    font-size: 0.92rem;
    color: var(--text-muted, #5c6b7a);
}
.blog-video-frame {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #0d1b2a;
    border-radius: 6px;
    overflow: hidden;
}
.blog-video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
.blog-audio audio {
    width: 100%;
}
.media-card {
    background: #fff;
    border-radius: 0.9rem;
    padding: 1.15rem 1.25rem 1.25rem;
    box-shadow: 0 8px 24px rgba(15, 41, 64, 0.06);
    margin-bottom: 1.25rem;
}
.media-card video,
.media-card audio {
    display: block;
    width: 100%;
    border-radius: 0.6rem;
    background: #0d1b2a;
}
.media-kind {
    letter-spacing: 0.04em;
}
.blog-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 1.25rem 0;
}
.blog-chart .blog-table-wrap {
    margin-top: 0.75rem;
}
.blog-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-sans, Poppins, sans-serif);
    font-size: 0.95rem;
    line-height: 1.45;
}
.blog-table th,
.blog-table td {
    border: 1px solid var(--border-color, #d7dee6);
    padding: 0.55rem 0.7rem;
    text-align: left;
    vertical-align: top;
}
.blog-table th {
    background: var(--primary, #1a3a5c);
    color: #fff;
    font-weight: 600;
}
.blog-chart-svg {
    width: 100%;
    height: auto;
    display: block;
}
.blog-chart-pie {
    max-width: 280px;
    margin: 0 auto;
}
.blog-chart-axis {
    stroke: #c5d0db;
    stroke-width: 1;
}
.blog-chart-label {
    fill: #334155;
    font-size: 12px;
    font-family: Poppins, sans-serif;
}
.blog-card-image {
    width: 100%;
    max-height: 240px;
    object-fit: cover;
}
.blog-share {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}
.blog-comment {
    padding: 0.85rem 0;
    border-top: 1px solid var(--border-color, #d7dee6);
}
.affiliate-note {
    max-width: 46rem;
    margin-bottom: 1.5rem;
}
.blog-honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.app-bar {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 1080;
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: #0f2940;
    color: #fff;
    border-radius: 0.75rem;
}
.app-bar p {
    margin: 0;
    font-size: 0.95rem;
}
.app-bar div {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Installed phone app: same pages as the site, kept clear of the status bar and home indicator. */
@media (display-mode: standalone) {
    .top-bar {
        padding-top: calc(0.5rem + env(safe-area-inset-top, 0px));
    }
    .footer-bottom {
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    }
    .scroll-top {
        right: calc(1rem + env(safe-area-inset-right, 0px));
        bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    }
    .app-bar {
        left: calc(1rem + env(safe-area-inset-left, 0px));
        right: calc(1rem + env(safe-area-inset-right, 0px));
        bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    }
    .reading-progress {
        top: env(safe-area-inset-top, 0px);
    }
}
html.app-standalone .top-bar {
    padding-top: calc(0.5rem + env(safe-area-inset-top, 0px));
}
html.app-standalone .footer-bottom {
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
}
html.app-standalone .scroll-top {
    right: calc(1rem + env(safe-area-inset-right, 0px));
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

