:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg: #f8fafc;
    --text: #0f172a;
    --text-muted: #6b7280;
    --card-bg: #ffffff;
    --border: #e5e7eb;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; transition: 0.2s; }
a:hover { color: var(--primary-hover); }

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

/* Modern Header */
.olp-header { 
    background: var(--header-bg, var(--card-bg)); 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); 
    padding: 20px 0; 
    border-bottom: 3px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.logo a { 
    font-size: 1.8rem; 
    font-weight: 800; 
    color: var(--primary);
    letter-spacing: -0.5px;
}
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 20px;
}
.main-nav a {
    color: var(--text);
    font-weight: 500;
}
.main-nav a:hover {
    color: var(--primary);
}

/* Grids */
.section-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    padding-bottom: 0;
    border-bottom: none;
}

/* Flex Container for Ad sidebar */
.section-flex-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}
.section-main-content {
    flex: 1;
}
.section-sidebar {
    width: 300px;
    flex-shrink: 0;
    margin-top: 104px; /* Align with content */
}

/* 4 Cols and 5 Cols Grids */
.olp-book-grid { 
    display: grid; 
    gap: 20px; 
}
.grid-4-cols {
    grid-template-columns: repeat(4, 1fr);
}
.grid-5-cols {
    grid-template-columns: repeat(5, 1fr);
}

/* Book Card */
.olp-book-card { 
    background: var(--header-bg, var(--card-bg)); 
    padding: 0; 
    border-radius: 8px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    text-align: center; 
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.olp-book-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

/* Fixed Image Thumbnails */
.olp-book-card img, .placeholder-cover { 
    width: 100%; 
    height: auto; 
    aspect-ratio: 2/3;
    object-fit: contain; /* Shows full image without cropping */
    background: #f8fafc;
    border-radius: 0; 
    margin-bottom: 0;
}

.placeholder-cover { 
    background: #e5e7eb; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: #9ca3af; 
    font-weight: 500;
}

.olp-book-card h3 {
    font-size: 0.85rem;
    margin: 12px 10px;
    line-height: 1.4;
    font-weight: 500;
    color: var(--text);
}

.btn-read-sm { 
    display: block; 
    margin: 0 10px 10px 10px;
    padding: 8px; 
    background: var(--primary); 
    color: white; 
    border-radius: 6px; 
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
}
.btn-read-sm:hover { color: white; background: var(--primary-hover); }

/* Categories Grid */
.olp-category-grid {
    display: grid;
    gap: 20px;
}
.olp-category-card {
    background: var(--header-bg, var(--card-bg));
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    text-align: center;
    transition: transform 0.2s;
}
.olp-category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}
.category-image {
    width: 100%;
    height: 160px;
    background-size: cover;
    background-position: center;
    background-color: var(--border);
}
.olp-category-card h3 {
    padding: 15px;
    margin: 0;
    font-size: 1.1rem;
}

/* Single Book Layer 1 */
.book-single-page { padding: 60px 20px; }
.olp-book-info-layout { display: flex; gap: 40px; }
.book-cover-col { flex: 0 0 350px; }
.book-cover-col img { 
    width: 100%; 
    height: auto; 
    border-radius: 12px; 
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04); 
}
.book-details-col h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-top: 0;
}
.book-meta {
    font-size: 1.1rem;
    color: var(--text-muted);
}
.book-excerpt {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text);
    margin: 30px 0;
}

.placeholder-cover.large { height: 500px; }

.btn-read-full { 
    display: inline-block; 
    padding: 18px 36px; 
    background: var(--primary); 
    color: white; 
    border-radius: 8px; 
    font-size: 1.25rem; 
    font-weight: bold; 
    transition: background 0.2s; 
    box-shadow: 0 4px 6px -1px rgba(29,78,216,0.4);
}
.btn-read-full:hover { 
    background: var(--primary-hover); 
    color: white;
}

/* Ad Containers */
.olp-ad-container {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.ad-300x250 {
    width: 300px;
    height: 250px;
}

/* Responsive */
@media(max-width: 1024px) {
    .grid-4-cols, .grid-5-cols { grid-template-columns: repeat(3, 1fr); }
    .section-flex-container { flex-direction: column; }
    .section-sidebar { width: 100%; margin-top: 20px; display: flex; justify-content: center; }
}
@media(max-width: 768px) {
    .olp-book-info-layout { flex-direction: column; }
    .book-cover-col { flex: 0 0 auto; max-width: 300px; margin: 0 auto; }
    .grid-4-cols, .grid-5-cols { 
        grid-template-columns: repeat(3, 1fr); 
        gap: 10px; 
    }
    
    /* Small book card styles for mobile */
    .olp-book-card h3 {
    font-size: 0.85rem;
    margin: 12px 10px;
    line-height: 1.4;
    font-weight: 500;
    color: var(--text);
}
    .btn-read-sm {
        display: none; /* Hide read button on mobile to save space */
    }
    
    /* Mobile category card sizing */
    .category-image { height: 100px; }
    .olp-category-card h3 { font-size: 0.8rem; padding: 8px; }
    
    /* Smaller headers for mobile */
    .section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin: 0 0 15px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
    .section-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    padding-bottom: 0;
    border-bottom: none;
}
}
@media(max-width: 480px) {
    .grid-4-cols, .grid-5-cols { grid-template-columns: repeat(3, 1fr); }
}

/* Pagination */
.pagination { margin: 40px 0; display: flex; justify-content: center; gap: 10px; }
.pagination .page-numbers { padding: 8px 16px; border: 1px solid var(--border); border-radius: 6px; color: var(--text); background: var(--header-bg, var(--card-bg)); font-weight: 500; }
.pagination .page-numbers.current, .pagination .page-numbers:hover { background: var(--primary); color: white; border-color: var(--primary); }

/* Section Headers (Homepage updates) */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin: 0 0 15px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.section-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text);
    padding-bottom: 0;
    border-bottom: none;
}
.view-all-link { font-weight: 600; color: var(--primary); font-size: 1rem; }
.view-all-link:hover { text-decoration: underline; color: var(--primary-hover); }


/* Empty Ads Handling */
.olp-ad-container { border: none !important; background: transparent !important; }
.olp-ad-container.has-ad { background: #f8fafc !important; border: 1px dashed #cbd5e1 !important; display: flex; align-items: center; justify-content: center; }


/* Modern Dark Footer Grid */
.olp-footer-modern {
    background-color: var(--footer-bg, #383838);
    color: #ffffff;
    padding: 30px 0 20px;
    margin-top: 40px;
}
.footer-top-grid, .footer-bottom-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.footer-grid-menu, .footer-grid-menu-bottom {
    display: contents;
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-grid-menu li, .footer-grid-menu-bottom li {
    margin-bottom: 10px;
}
.footer-grid-menu li a, .footer-grid-menu-bottom li a, .footer-back-to-top {
    color: #ffffff;
    text-decoration: none;
    font-size: 1.05rem;
    position: relative;
    padding-bottom: 0;
    border-bottom: none;
    transition: 0.2s;
    display: inline-block;
}
.footer-grid-menu li a:hover, .footer-grid-menu-bottom li a:hover, .footer-back-to-top:hover {
    
    opacity: 0.8;
}
.footer-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.15);
    margin: 15px 0 20px;
}
.footer-back-to-top-wrapper {
    grid-column: 4;
}
.footer-keywords {
    margin: 15px 0 10px; 
    color: rgba(255, 255, 255, 0.6); 
    font-size: 0.9rem; 
    text-align: center;
    line-height: 1.5;
}
.footer-copyright {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    margin-top: 20px;
}




@media(max-width: 768px) {
    .book-cover-col {
        max-width: 180px; 
    }
    .book-details-col h1 {
        font-size: 1.5rem;
        text-align: center;
    }
    .book-meta {
        text-align: center;
        justify-content: center;
    }
    .book-actions {
        justify-content: center;
    }
}

/* Site Framed Layout */
body.site-framed {
    background-color: var(--frame-bg, #e2e8f0);
    padding: 40px 20px;
}
body.site-framed .olp-site-wrapper {
    max-width: 1240px;
    margin: 0 auto;
    background-color: var(--bg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.1);
}
@media (max-width: 768px) {
    body.site-framed {
        padding: 0;
    }
    body.site-framed .olp-site-wrapper {
        border-radius: 0;
        border: none;
        box-shadow: none;
    }
}

/* Home Page Content Sections 3D Box */
.olp-home .olp-section {
    padding: 0;
    margin: 0 0 30px 0;
}



/* New Grid Layouts for Homepage */
.grid-6-cols {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}
.grid-3-cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Category Rows Container */
.olp-category-rows-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 0 0 30px 0;
}
.olp-category-rows-container .olp-section {
    margin: 0;
}

@media (max-width: 1024px) {
    .grid-6-cols { grid-template-columns: repeat(4, 1fr); }
    .grid-3-cols { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .grid-6-cols, .grid-3-cols { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .olp-category-rows-container { grid-template-columns: 1fr; gap: 20px; margin: 0 0 20px 0; }
}
/* Book Card Font Scaling for 6 cols */
.olp-book-card h3 {
    font-size: 0.85rem;
    margin: 12px 10px;
    line-height: 1.4;
    font-weight: 500;
    color: var(--text);
}
.btn-read-sm {
    font-size: 0.8rem;
    padding: 6px;
}

.card-author { font-size: 0.8rem; color: #64748b; font-weight: 400; }

/* Added margin to top of home page */
.olp-home { padding-top: 40px; }

/* Hero Section Styles */
.olp-hero-section {
    background-color: #555b41;
    color: #ffffff;
    text-align: center;
    padding: 40px 20px;
}
.olp-hero-section .hero-inner {
    max-width: 800px;
    margin: 0 auto;
}
.olp-hero-section .hero-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 2.8rem;
    font-weight: 500;
    margin: 0 0 15px 0;
    line-height: 1.2;
}
.olp-hero-section .hero-desc {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 1.1rem;
    margin: 0 0 30px 0;
    font-weight: 400;
}
.olp-hero-section .hero-search-wrap {
    background: #ffffff;
    padding: 0;
    max-width: 700px;
    margin: 0 auto;
    border: none;
    border-radius: 2px;
}
.hero-search-placeholder {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: #555;
    font-size: 0.8rem;
}
.hero-search-placeholder .enhanced-by {
    margin-right: 15px;
    font-family: sans-serif;
}
.hero-search-placeholder .search-box {
    flex-grow: 1;
    height: 24px;
}

/* Hero Nav Bar Styles */
.olp-hero-nav-bar {
    background-color: #f8f6f0;
    border-bottom: 1px solid #e2dfd5;
    padding: 12px 0;
}
.hero-nav-inner {
    background: #ffffff;
    padding: 5px 20px;
    display: inline-block;
}
.hero-nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}
.hero-nav-menu li {
    display: flex;
    align-items: center;
}
.hero-nav-menu li a {
    color: #2563eb;
    font-size: 0.9rem;
    font-weight: 400;
    padding: 0 8px;
}
.hero-nav-menu li a:hover {
    text-decoration: underline;
    color: #1d4ed8;
}
.hero-nav-menu li:not(:last-child)::after {
    content: "·";
    color: #64748b;
    font-weight: bold;
    display: inline-block;
}

/* Remove sticky top from main header to match the image behavior if it scrolls */
.olp-header {
    position: relative;
    z-index: 100;
}

@media (max-width: 768px) {
    .olp-hero-section .hero-title {
        font-size: 1.8rem;
    }
}
@media (max-width: 480px) {
    .olp-hero-section .hero-title {
        font-size: 1.25rem; /* Small enough for one line */
    }
    .olp-hero-section {
        padding: 25px 15px;
    }
    .olp-hero-nav-bar {
        padding: 10px;
    }
    .hero-nav-inner {
        padding: 5px;
        width: 100%;
    }
    .hero-nav-menu li a {
        font-size: 0.8rem;
    }
}


/* Live Search Styles */
.search-box-input {
    flex-grow: 1;
    height: 28px;
    border: none;
    background: transparent;
    outline: none;
    font-size: 1rem;
    color: #333;
}
.live-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 0 0 4px 4px;
    z-index: 1000;
    max-height: 350px;
    overflow-y: auto;
    text-align: left;
    color: #333;
}
.live-search-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #f1f1f1;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}
.live-search-item:hover {
    background: #f8fafc;
}
.live-search-item img {
    width: 40px;
    height: 60px;
    object-fit: cover;
    margin-right: 15px;
    border-radius: 4px;
}
.live-search-item-info h4 {
    margin: 0 0 5px 0;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.2;
}
.live-search-item-info span {
    font-size: 0.8rem;
    color: #64748b;
}
.live-search-no-results {
    padding: 15px;
    color: #64748b;
    font-size: 0.9rem;
    text-align: center;
}

/* Footer inline menu */
.footer-custom-inline-menu li:not(:last-child)::after {
    content: "·";
    color: rgba(255, 255, 255, 0.5);
    font-weight: bold;
    display: inline-block;
}
.footer-custom-inline-menu li a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* Mobile Book Actions centering */
@media (max-width: 768px) {
    .book-actions {
        text-align: center;
    }
    .book-actions .btn-read-full {
        display: inline-block;
        margin: 0 auto;
    }
}

/* Footer 4-column menu styles */
.footer-col-menu li a:hover {
    
    opacity: 0.8;
}

/* Modern Footer Link Base */
.footer-col-menu li, .footer-grid-menu-bottom li {
    margin-bottom: 10px;
}
.footer-col-link, .footer-grid-menu-bottom li a, .footer-back-to-top {
    color: #ffffff;
    text-decoration: none;
    font-size: 1.05rem;
    position: relative;
    padding-bottom: 0;
    border-bottom: none;
    transition: 0.2s;
    display: inline-block;
}
.footer-col-link:hover {
    
    opacity: 0.8;
}

/* Mobile 4-Column Footer Overrides */
@media(max-width: 768px) {
    .footer-top-grid, .footer-bottom-grid {
        gap: 5px; /* Tighter gap on mobile */
    }
    .footer-col-link, .footer-grid-menu-bottom li a, .footer-back-to-top {
        font-size: 0.75rem; /* Smaller font to fit 4 columns */
        padding-bottom: 1px;
    }
    .footer-col-menu li, .footer-grid-menu-bottom li {
        margin-bottom: 6px;
    }
}
