﻿/*
Theme Name: Ambedkar Digital Library
Theme URI: https://library.brambedkar.in
Author: Vibe Coding
Description: Premium, scholarly, ultra-readable theme for Dr. B. R. Ambedkar & Gautam Buddha Digital Library.
Version: 1.2.0
Text Domain: ambedkar-library
*/

:root {
    --primary-navy: #0A192F;
    --navy-surface: #112240;
    --navy-light: #233554;
    --royal-blue: #1D4ED8;
    --royal-blue-hover: #1E40AF;
    --accent-gold: #D97706;
    --gold-light: #FDE68A;
    --gold-subtle: #FFFBEB;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #64748B;
    --bg-page: #F8FAFC;
    --bg-card: #FFFFFF;
    --border-subtle: #E2E8F0;
    --border-focus: #3B82F6;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(15,23,42,0.06);
    --shadow-lg: 0 10px 25px -5px rgba(15,23,42,0.08), 0 8px 10px -6px rgba(15,23,42,0.05);
    --shadow-hover: 0 20px 30px -10px rgba(15,23,42,0.12), 0 10px 15px -5px rgba(15,23,42,0.07);
    --font-heading: 'Cinzel', serif, system-ui;
    --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --font-reading: 'Merriweather', Georgia, serif;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
    background-color: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

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

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

/* Header & Navbar */
.site-header {
    background: rgba(10, 25, 47, 0.96);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(217, 119, 6, 0.25);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-emblem {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1E40AF, #0A192F);
    border: 2px solid var(--accent-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-gold);
    font-size: 20px;
    box-shadow: 0 0 15px rgba(217, 119, 6, 0.3);
}

.brand-titles h1 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.brand-titles p {
    font-size: 12px;
    color: #94A3B8;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 500;
}

.nav-links {
    display: flex;
    gap: 28px;
    align-items: center;
}

.nav-links a {
    color: #CBD5E1;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 0;
    position: relative;
}

.nav-links a:hover, .nav-links a.active {
    color: #FFFFFF;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--accent-gold);
    transition: var(--transition);
}

.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}

.header-cta {
    background: linear-gradient(135deg, var(--accent-gold), #B45309);
    color: #FFFFFF !important;
    padding: 8px 18px !important;
    border-radius: var(--radius-sm);
    font-weight: 600 !important;
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.25);
}

.header-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(217, 119, 6, 0.35);
}

/* Hero Section */
.hero-section {
    background: radial-gradient(circle at 50% 0%, #172A45 0%, #0A192F 100%);
    color: #FFFFFF;
    padding: 80px 0 70px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 30%, rgba(29, 78, 216, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(217, 119, 6, 0.15);
    border: 1px solid rgba(217, 119, 6, 0.4);
    color: var(--gold-light);
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 24px;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 46px;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 18px;
    color: #FFFFFF;
}

.hero-title span {
    background: linear-gradient(135deg, #FDE68A 0%, #F59E0B 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 18px;
    color: #CBD5E1;
    max-width: 720px;
    margin: 0 auto 36px;
    font-weight: 400;
}

.hero-quote {
    font-family: var(--font-reading);
    font-style: italic;
    font-size: 15px;
    color: #94A3B8;
    margin-bottom: 40px;
}

/* Search Bar in Hero */
.search-wrapper {
    max-width: 680px;
    margin: 0 auto;
    position: relative;
}

.search-input-box {
    display: flex;
    align-items: center;
    background: #FFFFFF;
    border-radius: 40px;
    padding: 8px 12px 8px 24px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
    border: 2px solid transparent;
    transition: var(--transition);
}

.search-input-box:focus-within {
    border-color: var(--accent-gold);
    box-shadow: 0 15px 40px rgba(217, 119, 6, 0.3);
}

.search-input-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    color: var(--text-primary);
    font-family: var(--font-body);
}

.search-input-box input::placeholder {
    color: #94A3B8;
}

.search-btn {
    background: var(--primary-navy);
    color: #FFFFFF;
    border: none;
    border-radius: 30px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.search-btn:hover {
    background: var(--royal-blue);
}

/* Stats Ribbon */
.stats-ribbon {
    background: #FFFFFF;
    border-bottom: 1px solid var(--border-subtle);
    padding: 24px 0;
    box-shadow: var(--shadow-sm);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    text-align: center;
    gap: 20px;
}

.stat-item h3 {
    font-family: var(--font-heading);
    font-size: 28px;
    color: var(--primary-navy);
    font-weight: 700;
}

.stat-item p {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Library Section */
.library-section {
    padding: 60px 0 90px;
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 20px;
}

.section-titles h2 {
    font-family: var(--font-heading);
    font-size: 30px;
    color: var(--primary-navy);
    margin-bottom: 6px;
}

.section-titles p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* Filter Pills */
.filter-pills-wrapper {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 36px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.filter-pill {
    padding: 9px 20px;
    border-radius: 30px;
    background: #FFFFFF;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.filter-pill:hover {
    border-color: var(--royal-blue);
    color: var(--royal-blue);
    background: #EFF6FF;
}

.filter-pill.active {
    background: var(--primary-navy);
    color: #FFFFFF;
    border-color: var(--primary-navy);
    box-shadow: 0 4px 10px rgba(10, 25, 47, 0.15);
}

/* Book Grid & Cards */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
}

.book-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
}

.book-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: #CBD5E1;
}

.book-cover-area {
    height: 240px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}

.book-spine-effect {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 8px;
    background: linear-gradient(to right, rgba(0,0,0,0.5), transparent);
}

.book-cover-mockup {
    width: 140px;
    height: 195px;
    background: #FAF5FF;
    border-radius: 4px;
    box-shadow: 4px 8px 20px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px 12px;
    border-left: 3px solid var(--accent-gold);
    position: relative;
    transition: var(--transition);
}

.book-card:hover .book-cover-mockup {
    transform: scale(1.04) rotate(-1deg);
}

.cover-tag {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--accent-gold);
    text-transform: uppercase;
}

.cover-title {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    color: #1E293B;
    line-height: 1.3;
}

.cover-author {
    font-size: 10px;
    color: #64748B;
    font-weight: 600;
}

.language-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
}

.book-details {
    padding: 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.book-author-meta {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.book-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-navy);
    line-height: 1.35;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-excerpt {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 18px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-meta-footer {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
    margin-bottom: 18px;
}

.book-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-read {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 12px;
    background: #EFF6FF;
    color: var(--royal-blue);
    border: 1px solid #BFDBFE;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-read:hover {
    background: var(--royal-blue);
    color: #FFFFFF;
    border-color: var(--royal-blue);
}

.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 12px;
    background: var(--primary-navy);
    color: #FFFFFF;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-download:hover {
    background: var(--royal-blue-hover);
    box-shadow: 0 4px 10px rgba(29, 78, 216, 0.25);
}

/* In-Browser PDF Reader Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 25, 47, 0.85);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-window {
    background: #FFFFFF;
    width: 95%;
    max-width: 1000px;
    height: 90vh;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    border: 1px solid #CBD5E1;
}

.modal-header {
    background: var(--primary-navy);
    color: #FFFFFF;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 600;
    max-width: 70%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-modal-close {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition);
}

.btn-modal-close:hover {
    background: #EF4444;
}

.modal-body {
    flex: 1;
    background: #E2E8F0;
    position: relative;
}

.modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Callout Section */
.callout-section {
    background: linear-gradient(135deg, #0A192F, #1E293B);
    color: #FFFFFF;
    padding: 70px 0;
    text-align: center;
    border-top: 2px solid var(--accent-gold);
}

.callout-content {
    max-width: 760px;
    margin: 0 auto;
}

.callout-content h2 {
    font-family: var(--font-heading);
    font-size: 32px;
    margin-bottom: 16px;
    color: #FFFFFF;
}

.callout-content p {
    font-size: 16px;
    color: #CBD5E1;
    margin-bottom: 28px;
    line-height: 1.7;
}

/* Footer */
.site-footer {
    background: #060D1A;
    color: #94A3B8;
    padding: 60px 0 30px;
    font-size: 14px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 50px;
}

.footer-col h4 {
    color: #FFFFFF;
    font-family: var(--font-heading);
    font-size: 16px;
    margin-bottom: 18px;
    letter-spacing: 0.5px;
}

.footer-col p {
    line-height: 1.7;
    margin-bottom: 16px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a:hover {
    color: var(--gold-light);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 24px;
    text-align: center;
    font-size: 13px;
    color: #64748B;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .footer-grid {
        grid-template-columns: 1fr;
    }
    .hero-title {
        font-size: 34px;
    }
}

@media (max-width: 600px) {
    .header-inner {
        flex-direction: column;
        gap: 14px;
        text-align: center;
    }
    .hero-title {
        font-size: 28px;
    }
    .book-grid {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .modal-window {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }
}
