/* ==========================================================================
   1. VARIABLES & RESET
   ========================================================================== */
:root {
    --primary: #ff7e03; /* AALBC Orange */
    --secondary: #4a148c; /* Deep Purple */
    --dark: #1a1a1a;
    --light: #f8f9fa;
    --white: #ffffff;
    --gray: #6c757d;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --radius: 8px;
    --font-main: 'Open Sans', Helvetica, Arial, sans-serif;
    --font-serif: 'Georgia', 'Times New Roman', serif;
}

* { box-sizing: border-box; }

body {
    font-family: var(--font-main);
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

a { color: var(--secondary); text-decoration: none; transition: 0.3s; }
a:hover { color: var(--primary); }
img { max-width: 100%; height: auto; }

/* Hide legacy scroll arrow */
#return-to-top, .back-to-top, .scroll-up { display: none !important; }

/* ==========================================================================
   2. GLOBAL LAYOUT (GRID)
   ========================================================================== */
.container {
    max-width: 1260px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: grid;
    grid-template-columns: 1fr 300px; /* Main Content | Sidebar */
    gap: 30px;
}

@media (max-width: 900px) {
    .container { grid-template-columns: 1fr; } /* Stack vertically on mobile */
}

/* CARDS / WIDGETS */
.section-block, .widget {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid #eaeaea;
}

.widget h4 {
    margin-top: 0;
    color: var(--secondary);
    font-size: 1.2rem;
    font-family: var(--font-serif);
    border-bottom: 2px solid var(--light);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* ==========================================================================
   3. BUTTONS
   ========================================================================== */
.btn-main, a.buybutton, input[type="submit"][value*="Buy"] {
    background: var(--primary) !important;
    color: var(--white) !important;
    padding: 12px 25px !important;
    border-radius: 50px !important;
    font-weight: bold !important;
    display: inline-block !important;
    border: none !important;
    cursor: pointer !important;
    text-decoration: none !important;
    font-size: 1rem !important;
    box-shadow: var(--shadow) !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.btn-main:hover, a.buybutton:hover {
    background: #e66e00 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 126, 3, 0.3) !important;
}

/* ==========================================================================
   4. HEADER & NAVIGATION
   ========================================================================== */
header.site-header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 9999;
}

.nav-container {
    max-width: 1260px;
    margin: 0 auto;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

/* Logo */
.nav-logo { margin-right: 15px; flex-shrink: 0; display: flex; align-items: center; }
.nav-logo img { height: 50px; width: auto; display: block; transition: transform 0.2s; }
.nav-logo:hover img { transform: scale(1.02); }

/* Search Bar */
.header-search {
    display: flex;
    align-items: center;
    background: #f1f1f1;
    border-radius: 50px;
    padding: 5px 15px;
    width: 250px;
    margin-right: auto; /* Pushes Menu Right */
    flex-shrink: 0;
}
.header-search input { border: none; background: transparent; outline: none; padding: 0; font-size: 0.9rem; flex-grow: 1; color: #555; width: 100%; }
.header-search button { border: none; background: transparent; cursor: pointer; color: var(--secondary); font-size: 1.1rem; padding: 0 0 0 8px; }
.header-search button:hover { color: var(--primary); }

/* Menu */
.main-navigation { flex-shrink: 1; }
.main-navigation ul { display: flex; gap: 15px; list-style: none; padding: 0; margin: 0; align-items: center; }
.main-navigation a { text-decoration: none; color: var(--dark); font-weight: 600; font-size: 0.95rem; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.main-navigation a:hover, .main-navigation a:hover i { color: var(--primary); }
.main-navigation i { color: #666; transition: color 0.3s; }

/* Mobile Toggle */
.mobile-menu-toggle { display: none; font-size: 1.8rem; cursor: pointer; color: #333; margin-left: 15px; }

/* Mobile Responsive Nav */
@media (max-width: 1100px) {
    .nav-container { flex-wrap: wrap; justify-content: space-between; }
    .header-search { margin-right: 0; order: 2; width: 100%; margin-top: 10px; }
    .nav-logo { margin-right: 0; order: 1; }
    .mobile-menu-toggle { display: block; order: 1; }
    
    .main-navigation { display: none; width: 100%; order: 3; background: #fff; position: absolute; top: 100%; left: 0; box-shadow: var(--shadow); padding: 20px; border-top: 1px solid #eee; }
    .main-navigation.active { display: block; }
    .main-navigation ul { flex-direction: column; align-items: flex-start; gap: 15px; }
    .main-navigation li { width: 100%; border-bottom: 1px solid #f9f9f9; padding-bottom: 10px; }
}

@media (max-width: 480px) {
    .nav-logo img { height: 40px; }
}

/* ==========================================================================
   5. BOOK PAGE STYLES
   ========================================================================== */
.book-detail-grid { display: grid; grid-template-columns: 300px 1fr; gap: 30px; }
.book-cover-col { text-align: center; }
.book-cover-img { box-shadow: 0 8px 16px rgba(0,0,0,0.2); border-radius: 4px; margin-bottom: 15px; }
.book-title { font-family: var(--font-serif); font-size: 2.2rem; line-height: 1.2; margin-top: 0; color: var(--dark); }
.book-author { font-size: 1.2rem; color: var(--gray); margin-bottom: 1rem; }
.book-author a { border-bottom: 1px dotted var(--secondary); }

/* Social Share */
.social-share ul { display: flex; justify-content: center; gap: 15px; padding: 0; list-style: none; margin: 15px 0; }
.social-share i { font-size: 1.2rem; color: #555; }
.social-share i:hover { color: var(--primary); }

/* Similar Books / Categories */
.similar-books ul { padding-left: 20px; list-style: disc; margin-top: 10px; }
.similar-books li { margin-bottom: 5px; }
.similar-books a { color: var(--secondary); border-bottom: 1px dotted #ccc; }
.similar-books a:hover { color: var(--primary); border-bottom: 1px solid var(--primary); }

@media (max-width: 900px) {
    .book-detail-grid { grid-template-columns: 1fr; }
    .book-title, .book-author { text-align: center; }
}

/* ==========================================================================
   6. AUTHOR PAGE STYLES
   ========================================================================== */
.author-media { float: right; margin: 0 0 20px 20px; max-width: 300px; text-align: center; }
.author-photo { border-radius: 4px; box-shadow: var(--shadow); width: 100%; height: auto; }
.quote { font-size: 1.4rem; font-style: italic; color: #555; margin-bottom: 20px; border-left: 4px solid var(--primary); padding-left: 15px; }

/* Books Grid (Author Page) */
.books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 20px; margin-top: 20px; }
.book-card { text-align: center; transition: transform 0.2s; }
.book-card:hover { transform: translateY(-5px); }
.book-card img { width: 100%; height: auto; border-radius: 4px; box-shadow: var(--shadow); margin-bottom: 10px; max-height: 220px; object-fit: cover; }
.book-card h3 { font-size: 0.95rem; margin: 5px 0; line-height: 1.3; }

/* Accordions */
details { border: 1px solid #ddd; border-radius: 4px; margin-bottom: 10px; background: #fff; }
summary { background: #f9f9f9; padding: 15px; cursor: pointer; font-weight: bold; list-style: none; font-size: 1.1rem; }
summary:hover { color: var(--primary); }
summary:after { content: "+"; float: right; font-weight: bold; }
details[open] summary:after { content: "-"; }
.details-content { padding: 15px; }
.details-content ol { padding-left: 20px; margin: 0; }
.details-content li { margin-bottom: 8px; }

@media (max-width: 900px) {
    .author-media { float: none; margin: 0 auto 20px; max-width: 100%; }
}

/* ==========================================================================
   7. FOOTER
   ========================================================================== */
.site-footer {
    background-color: var(--dark);
    color: #bbb;
    padding: 50px 20px 20px;
    border-top: 4px solid var(--primary);
    margin-top: 40px;
}
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 30px; max-width: 1260px; margin: 0 auto; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(3, 1fr); } }

.footer-col h4 { color: var(--white); font-size: 1.1rem; margin-bottom: 20px; border-bottom: 1px solid #444; padding-bottom: 10px; font-family: var(--font-serif); }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: #ddd; transition: 0.2s; }
.footer-col a:hover { color: var(--primary); padding-left: 5px; }

.footer-social-icons { display: flex; gap: 15px; margin-bottom: 20px; }
.social-btn { display: flex; justify-content: center; align-items: center; width: 40px; height: 40px; background: #333; color: #fff !important; border-radius: 50%; transition: 0.3s; font-size: 1.2rem; }
.social-btn:hover { background: var(--primary); transform: translateY(-3px); }

.footer-bottom { text-align: center; margin-top: 50px; padding-top: 20px; border-top: 1px solid #333; font-size: 0.9rem; color: #888; }
.footer-bottom a { color: #aaa; }
.footer-bottom a:hover { color: var(--primary); }

/* ==========================================================================
   8. HOMEPAGE SPECIFIC
   ========================================================================== */
.hero {
    background: linear-gradient(135deg, #2c0e3a 0%, #000000 100%);
    color: var(--white);
    padding: 3rem 1rem;
    text-align: center;
}
.hero h1 { font-family: var(--font-serif); font-size: 2.2rem; margin-bottom: 1rem; }
.hero p { font-size: 1.1rem; margin-bottom: 1.5rem; opacity: 0.9; }

.card-split { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; }
.card-split img { border-radius: var(--radius); }
@media (max-width: 900px) { .card-split { grid-template-columns: 1fr; } }

/* Logo Grid (Homepage Footer Area) */
.logo-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 1rem; align-items: center; margin-top: 1rem; }
.logo-item { text-align: center; }
.logo-item img { max-height: 60px; width: auto; margin: 0 auto; filter: grayscale(100%); transition: all 0.3s ease; }
.logo-item:hover img { filter: grayscale(0%); transform: scale(1.05); }

/* Hover Zoom Effect */
.hover-scale img { transition: transform 0.3s ease, box-shadow 0.3s ease; display: block; }
.hover-scale:hover img { transform: scale(1.03); box-shadow: 0 8px 16px rgba(255, 126, 3, 0.2); }