/*
Theme Name: ಅಪಾರ
Theme URI: https://apaar.in
Author: Vijay Rathod
Author URI: mailto:vijayrathod250@gmail.com
Description: ಅಪಾರ — ಲೇಖಕ ದರುಶನ ಅವರ ಅಧಿಕೃತ ಜಾಲತಾಣ. ಕನ್ನಡ ಪುಸ್ತಕಗಳ ಮಾರಾಟ ವೇದಿಕೆ.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: karnataka-kannada-books
*/

/* ==========================================
   DESIGN TOKENS & VARIABLE ROOTS
   ========================================== */
:root {
    /* Karnataka Flag Theme */
    --karnataka-red: #D92F0C;
    --karnataka-red-hover: #A72207;
    --karnataka-yellow: #FFD700;
    --karnataka-yellow-dark: #E6B500;
    
    /* Elegant Book Paper Colors */
    --bg-primary: #FCFAF5;       /* Warm parchment book paper */
    --bg-secondary: #F4F1E8;     /* Warm grey/paper shadow */
    --card-bg: #FFFFFF;
    --text-primary: #21201D;     /* Soft black ink */
    --text-secondary: #6B6861;   /* Medium grey ink */
    --border-color: #E6E2D8;
    
    /* Layout Tokens & Timings */
    --max-width: 1200px;
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    
    /* Shadows */
    --shadow-flat: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-hover: 0 16px 36px rgba(33,32,29,0.08);
}

/* Dark Mode Variables Override */
body.dark-theme {
    --bg-primary: #121210;       /* Dark charcoal paper */
    --bg-secondary: #1B1B18;     /* Slightly lighter charcoal */
    --card-bg: #181815;
    --text-primary: #ECEAE4;     /* Off-white printing ink */
    --text-secondary: #9B988E;   /* Medium grey printing ink */
    --border-color: #3D3B36;
    --shadow-flat: 0 4px 12px rgba(0,0,0,0.3);
    --shadow-hover: 0 16px 36px rgba(0,0,0,0.6);
}

/* ==========================================
   BASE STYLE SETTINGS
   ========================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Figtree', 'Noto Sans Kannada', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.4s, color 0.4s;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    color: var(--karnataka-red-hover);
}

input, button, textarea {
    font-family: inherit;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--karnataka-red);
}

/* ==========================================
   HEADER & STRUCTURE
   ========================================== */
.site-header {
    background: var(--card-bg);
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition);
}

.flag-banner {
    height: 4px;
    display: flex;
    width: 100%;
}
.flag-yellow { background: var(--karnataka-yellow); flex: 1; }
.flag-red { background: var(--karnataka-red); flex: 1; }

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.85rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.site-branding .logo-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    gap: 2px;
}
.brand-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.site-branding .site-description {
    display: block;
    text-align: center;
}
.archive-title {
    padding-bottom: 10px;
}

.site-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--karnataka-red);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.site-description { font-size: 0.7rem; color: var(--text-secondary); display: block; }

.theme-toggle {
    background: var(--bg-secondary);
    border: none;
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: var(--transition);
}
.theme-toggle:hover {
    background: var(--border-color);
}

/* ==========================================
   HERO / BANNER
   ========================================== */
.kannada-welcome {
    font-size: 1.1rem;
    color: var(--karnataka-red);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}
.hero-title {
    font-family: 'Oswald', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    letter-spacing: -0.5px;
}
.hero-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 1.5rem;
}
.cta-button {
    display: inline-block;
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 0.75rem 1.75rem;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: var(--border-radius-md);
    transition: var(--transition);
}
.cta-button:hover {
    background: var(--karnataka-red);
    color: #FFFFFF;
    transform: translateY(-1px);
}

/* ==========================================
   STORE CATALOG LAYOUT
   ========================================== */
.store-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}
.tab-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: var(--transition);
}
.tab-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}
.tab-btn.active {
    background: var(--text-primary);
    border-color: var(--text-primary);
    color: var(--bg-primary);
}

/* Catalog book grid listing */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 2.5rem 2rem;
}

/* ==========================================
   UNIQUE 3D BOOK COVER & CARD INTERACTION
   ========================================== */
.book-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: var(--transition);
    box-shadow: var(--shadow-flat);
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--karnataka-red);
}

.book-discount-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--karnataka-yellow);
    color: #1a1a17;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: var(--border-radius-sm);
    z-index: 10;
}

/* Perspective container for 3D cover effect */
.book-image-container {
    aspect-ratio: 2/3;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    overflow: visible; /* Required to allow 3D overflow pop out */
    position: relative;
    margin-bottom: 1.25rem;
    perspective: 800px; /* Prepares child rotation depth */
}

/* 3D Spine and Cover Rotation Styling */
.book-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px 6px 6px 2px;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s;
    transform-style: preserve-3d;
    transform-origin: left center; /* Hinges like a book spine opening */
}

.book-card:hover .book-image-container img {
    /* Rotates cover to reveal book depth */
    transform: rotateY(-24deg) rotateX(4deg) translateZ(8px);
    box-shadow: -8px 8px 18px rgba(0,0,0,0.22);
}

/* Simulated book pages block underneath cover */
.book-image-container::after {
    content: "";
    position: absolute;
    top: 2%;
    right: 2px;
    width: 12px;
    height: 96%;
    background: repeating-linear-gradient(to bottom, #fff, #fff 2px, #e2ded5 2px, #e2ded5 4px);
    border-radius: 0 4px 4px 0;
    z-index: -1;
    transition: var(--transition);
    transform: rotateY(-24deg) translateZ(-4px);
    transform-origin: left center;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
    opacity: 0;
}
.book-card:hover .book-image-container::after {
    opacity: 1;
}

.book-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.book-genre {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--karnataka-red);
    font-weight: 600;
    margin-bottom: 0.25rem;
    letter-spacing: 0.5px;
}
.book-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
    line-height: 1.3;
}
.book-author {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}
.book-rating {
    display: flex;
    gap: 2px;
    font-size: 0.8rem;
}
.star-filled { color: #FFB800; }

.book-pricing {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: baseline;
}
.price-original {
    font-size: 0.8rem;
    text-decoration: line-through;
    color: var(--text-secondary);
}
.price-current {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ==========================================
   WHATSAPP ORDER GREEN BUTTONS
   ========================================== */
.whatsapp-checkout-btn {
    background-color: #25D366;
    color: #FFFFFF !important;
    text-align: center;
    padding: 0.65rem 1rem;
    border: none;
    border-radius: var(--border-radius-md);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.15);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    outline: none;
}
.whatsapp-checkout-btn:hover {
    background-color: #20BA5A;
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.3);
    transform: translateY(-1px);
}

.whatsapp-order-btn {
    background-color: #25D366;
    color: #FFFFFF !important;
    border: none;
    padding: 0.85rem 1.5rem;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.2);
    transition: var(--transition);
    outline: none;
}
.whatsapp-order-btn:hover {
    background-color: #20BA5A;
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.35);
    transform: translateY(-2px);
}

/* ==========================================
   3D DETAIL PAGE SPIN ANIMATION
   ========================================== */
.book-3d-spine {
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.book-3d-wrapper:hover .book-3d-cover {
    transform: rotateY(-20deg) rotateX(5deg) translateZ(10px);
}
.book-card:hover .book-3d-spine,
.book-single-layout:hover .book-3d-spine {
    opacity: 1;
}

/* ==========================================
   FOOTER
   ========================================== */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 1.5rem 1.5rem;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 2.5rem;
}
@media (max-width: 768px) {
    .footer-container { grid-template-columns: 1fr; gap: 1.5rem; }
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.footer-contact-item a {
    color: var(--text-secondary);
}
.footer-contact-item a:hover {
    color: var(--karnataka-red);
}

.footer-flag-banner-sm {
    margin: 1rem auto 0;
    height: 2px;
    width: 60px;
    display: flex;
}

.footer-widget-title {
    font-family: 'Oswald', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.25rem;
}
.footer-widget-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--karnataka-red);
}

.footer-widget p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { color: var(--text-secondary); font-size: 0.85rem; }
.footer-links a:hover { color: var(--karnataka-red); padding-left: 2px; }

.footer-bottom {
    max-width: var(--max-width);
    margin: 2.5rem auto 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
@media (max-width: 768px) {
    .footer-widget { text-align: center; }
    .footer-widget-title::after { left: 50%; transform: translateX(-50%); }
    .footer-socials { justify-content: center; }
    .footer-contact-item { justify-content: center; }
}
/* ==========================================
   FALLBACK INDEX / BLOG LOOP
   ========================================== */
.main-content-area {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}
.post-header { margin-bottom: 1.5rem; }
.post-meta-info { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.25rem; }
.post-body { font-size: 1.05rem; line-height: 1.7; color: var(--text-primary); }
.post-body p { margin-bottom: 1.25rem; }
.post-body h2 { margin: 1.75rem 0 0.75rem; font-family: 'Oswald', sans-serif; color: var(--text-primary); }

/* ==========================================
   HEADER SOCIALS & FLOATING WHATSAPP CTA
   ========================================== */
.header-socials {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.social-header-link {
    font-size: 1.25rem;
    padding: 0.25rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.social-header-link:hover {
    transform: translateY(-2px);
    opacity: 0.8;
}

.floating-whatsapp-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background-color: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    z-index: 999;
    transition: var(--transition);
    text-decoration: none;
}

.floating-whatsapp-btn:hover {
    transform: scale(1.1);
    background-color: #20BA5A;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.55);
}

@media (max-width: 600px) {
    .header-socials {
        display: none;
    }
    .hero-slider {
        height: 320px;
    }
    .slide-content {
        padding: 0.5rem 1.25rem 1.5rem;
    }
    .slide-content .hero-title {
        font-size: 1.6rem;
    }
    .slider-nav {
        display: none;
    }
    .slider-dots {
        bottom: 0.75rem;
    }
}

/* ==========================================
   HEADER NAVIGATION MENU
   ========================================== */
.header-navigation {
    margin-left: auto;
    margin-right: 1.5rem;
}
.header-menu-list {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}
.header-menu-list a {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: var(--transition);
}
.header-menu-list a:hover {
    color: var(--karnataka-red);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.25rem;
    align-items: center;
    justify-content: center;
    margin-left: 0.75rem;
    transition: var(--transition);
}
.mobile-menu-toggle:hover {
    color: var(--karnataka-red);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    .header-navigation {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border-color);
        padding: 1.5rem;
        z-index: 100;
        box-shadow: 0 6px 16px rgba(0,0,0,0.1);
    }
    .header-navigation.open {
        display: block;
    }
    .header-menu-list {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
}

/* ==========================================
   HERO SLIDER (SLIDESHOW)
   ========================================== */
.hero-slider {
    position: relative;
    width: 100%;
    height: 380px;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
}
.slider-container {
    width: 100%;
    height: 100%;
    position: relative;
}
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 0;
    z-index: 1;
    transition: opacity 0.8s ease-in-out;
}
.slide.active {
    opacity: 1;
    z-index: 2;
}
.slide-content {
    max-width: 720px;
    padding: 0 2.5rem;
    margin: 0 auto;
}
.slide-content .kannada-welcome {
    margin-bottom: 0.75rem;
}
.slide-content .hero-title {
    margin-top: 0.5rem;
    margin-bottom: 1.25rem;
    line-height: 1.3;
    padding-bottom: 9px;
}
.slide-content .hero-subtitle {
    margin: 0 auto 2rem;
    line-height: 1.65;
}
.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(33, 32, 29, 0.05);
    color: var(--text-primary);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}
.slider-nav:hover {
    background: var(--text-primary);
    color: var(--bg-primary);
}
.prev-slide { left: 1rem; }
.next-slide { right: 1rem; }

.slider-dots {
    position: absolute;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}
.slider-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(33, 32, 29, 0.2);
    cursor: pointer;
    transition: var(--transition);
}
.slider-dots .dot.active {
    background: var(--karnataka-red);
    width: 18px;
    border-radius: 4px;
}

body.dark-theme .slider-dots .dot {
    background: rgba(255, 255, 255, 0.3);
}

body.dark-theme .slider-dots .dot.active {
    background: var(--karnataka-yellow);
}




/* ==========================================================================
   APPLE LIQUID GLASS ENGINE OVERRIDES (PRESERVES LAYOUT - LAYERS GLASS OVER IT)
   ========================================================================== */

/* 1. Base Glass Definitions with Variable Blurs */
.site-header {
    background: linear-gradient(135deg, rgba(252, 250, 245, 0.72), rgba(244, 241, 232, 0.62)), url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.025'/%3E%3C/svg%3E") !important;
    backdrop-filter: blur(20px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(190%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.45), 0 4px 30px rgba(33, 32, 29, 0.02) !important;
    will-change: backdrop-filter, transform;
}

body.dark-theme .site-header {
    background: linear-gradient(135deg, rgba(24, 24, 21, 0.75), rgba(18, 18, 15, 0.65)), url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.025'/%3E%3C/svg%3E") !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.15), 0 8px 32px rgba(0, 0, 0, 0.3) !important;
}

/* Primary Refracting Content Panels (25px Blur Glass Plane) */
.book-card, .hero-slider, .site-footer {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)), url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E") !important;
    backdrop-filter: blur(25px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    border-top-color: rgba(255, 255, 255, 0.55) !important;
    border-bottom-color: rgba(255, 255, 255, 0.05) !important;
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.45), 0 12px 36px rgba(0, 0, 0, 0.03) !important;
    will-change: backdrop-filter, transform;
}

body.dark-theme .book-card, body.dark-theme .hero-slider, body.dark-theme .site-footer {
    background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01)), url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E") !important;
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.15), 0 16px 40px rgba(0, 0, 0, 0.35) !important;
}

/* Outer/Inner Concentric Geometry overrides on Cards and Grid elements */
.book-card {
    border-radius: var(--border-radius-lg) !important;
    padding: 1.25rem !important; /* Outer padding */
}
.book-image-container {
    border-radius: var(--border-radius-md) !important; /* Concentric Inner */
}
.book-image-container img {
    border-radius: var(--border-radius-sm) !important; /* Sub-inner */
}

/* Floating Abstract Background Blobs to refract under the glass pane */
.glass-bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.22;
    mix-blend-mode: multiply;
    animation: floatBlob 24s infinite alternate ease-in-out;
    will-change: transform;
}

body.dark-theme .blob {
    opacity: 0.15;
    mix-blend-mode: screen;
    filter: blur(160px);
}

.blob-1 {
    width: 650px;
    height: 650px;
    background: var(--karnataka-red);
    top: -12%;
    left: -12%;
    animation-delay: 0s;
}

.blob-2 {
    width: 550px;
    height: 550px;
    background: var(--karnataka-yellow);
    bottom: -8%;
    right: -8%;
    animation-delay: 5s;
}

.blob-3 {
    width: 450px;
    height: 450px;
    background: #007AFF; /* Subtle Royal Blue refract accent */
    top: 45%;
    left: 55%;
    transform: translate(-50%, -50%);
    animation-delay: 10s;
}

@keyframes floatBlob {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 60px) scale(1.18); }
}

/* Transient Glass Elements (40px Blur Glass Plane) */
@media (max-width: 768px) {
    .header-navigation {
        background: linear-gradient(135deg, rgba(252, 250, 245, 0.85), rgba(244, 241, 232, 0.75)), url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E") !important;
        backdrop-filter: blur(30px) saturate(200%) !important;
        -webkit-backdrop-filter: blur(30px) saturate(200%) !important;
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
        border-top-color: rgba(255, 255, 255, 0.6) !important;
        box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.5), 0 20px 50px rgba(0, 0, 0, 0.08) !important;
        border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg) !important;
        transform-origin: top center;
        transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
        will-change: backdrop-filter, transform;
    }
    
    body.dark-theme .header-navigation {
        background: linear-gradient(135deg, rgba(24, 24, 21, 0.92), rgba(18, 18, 15, 0.82)), url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E") !important;
        border-color: rgba(255, 255, 255, 0.08) !important;
        border-top-color: rgba(255, 255, 255, 0.15) !important;
        box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.1), 0 20px 50px rgba(0, 0, 0, 0.5) !important;
    }
}

/* Social Header Links, Footer Socials, and Control Buttons */
.social-header-link,
.footer-socials a,
.theme-toggle,
.mobile-menu-toggle {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05)), url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E") !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    border-top-color: rgba(255, 255, 255, 0.5) !important;
    border-bottom-color: rgba(255, 255, 255, 0.05) !important;
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.35), 0 4px 10px rgba(0, 0, 0, 0.02) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1) !important;
    will-change: backdrop-filter, transform;
}

body.dark-theme .social-header-link,
body.dark-theme .footer-socials a,
body.dark-theme .theme-toggle,
body.dark-theme .mobile-menu-toggle {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01)), url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E") !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
    border-top-color: rgba(255, 255, 255, 0.18) !important;
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.15), 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

.theme-toggle:hover,
.mobile-menu-toggle:hover {
    transform: scale(1.12) translateY(-2px) !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.12)) !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.6), 0 10px 20px rgba(0, 0, 0, 0.06) !important;
    color: var(--karnataka-red) !important;
}

body.dark-theme .theme-toggle:hover,
body.dark-theme .mobile-menu-toggle:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.3), 0 10px 20px rgba(0, 0, 0, 0.35) !important;
    color: var(--karnataka-yellow) !important;
}

/* Instagram Platform Hover Color */
.social-header-link[aria-label="Instagram"]:hover,
.footer-socials a[aria-label="Instagram"]:hover {
    transform: scale(1.12) translateY(-2px) !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.12)) !important;
    color: #E1306C !important;
    border-color: rgba(225, 48, 108, 0.45) !important;
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.6), 0 10px 20px rgba(225, 48, 108, 0.15) !important;
}

/* Twitter/X Platform Hover Color */
.social-header-link[aria-label="Twitter/X"]:hover,
.footer-socials a[aria-label="Twitter/X"]:hover {
    transform: scale(1.12) translateY(-2px) !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.12)) !important;
    color: #1DA1F2 !important;
    border-color: rgba(29, 161, 242, 0.45) !important;
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.6), 0 10px 20px rgba(29, 161, 242, 0.15) !important;
}

/* YouTube Platform Hover Color */
.social-header-link[aria-label="YouTube"]:hover,
.footer-socials a[aria-label="YouTube"]:hover {
    transform: scale(1.12) translateY(-2px) !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.12)) !important;
    color: #FF0000 !important;
    border-color: rgba(255, 0, 0, 0.45) !important;
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.6), 0 10px 20px rgba(255, 0, 0, 0.15) !important;
}

/* Dark mode platform color support (keeps vibrant contrast) */
body.dark-theme .social-header-link[aria-label="Instagram"]:hover,
body.dark-theme .footer-socials a[aria-label="Instagram"]:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)) !important;
    border-color: rgba(225, 48, 108, 0.35) !important;
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.2), 0 10px 20px rgba(225, 48, 108, 0.3) !important;
}

body.dark-theme .social-header-link[aria-label="Twitter/X"]:hover,
body.dark-theme .footer-socials a[aria-label="Twitter/X"]:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)) !important;
    border-color: rgba(29, 161, 242, 0.35) !important;
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.2), 0 10px 20px rgba(29, 161, 242, 0.3) !important;
}

body.dark-theme .social-header-link[aria-label="YouTube"]:hover,
body.dark-theme .footer-socials a[aria-label="YouTube"]:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)) !important;
    border-color: rgba(255, 0, 0, 0.35) !important;
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.2), 0 10px 20px rgba(255, 0, 0, 0.3) !important;
}

/* Fix mobile toggle display override on desktop */
.mobile-menu-toggle {
    display: none !important;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: inline-flex !important;
    }
}

/* Floating WhatsApp button specs */
.floating-whatsapp-btn {
    background-color: #25D366 !important;
    background-image: linear-gradient(135deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 100%), url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E") !important;
    border: 1px solid rgba(255, 255, 255, 0.38) !important;
    border-top-color: rgba(255, 255, 255, 0.6) !important;
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.45), 0 10px 25px rgba(37, 211, 102, 0.35) !important;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.floating-whatsapp-btn:hover {
    transform: scale(1.15) translateY(-4px) !important;
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.6), 0 16px 36px rgba(37, 211, 102, 0.5) !important;
}

/* Adaptive Typography Vibrancy */
.site-title, .hero-title, .archive-title, .entry-title {
    background: linear-gradient(to right, var(--text-primary), var(--text-secondary)) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* Context-Aware Fluidity & Morph States */
.header-menu-list a, .tab-btn {
    position: relative;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.header-menu-list a::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--karnataka-red);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
body.dark-theme .header-menu-list a::after {
    background: var(--karnataka-yellow);
}
.header-menu-list a:hover::after,
.header-menu-list a.active::after {
    width: 80%;
}
.tab-btn:hover {
    transform: scale(1.04);
}
.tab-btn.active {
    box-shadow: 0 8px 24px rgba(33, 32, 29, 0.12);
}

/* Accessibility Fallback - swaps for solid fallback at runtime */
@media (max-width: 820px) {
    .book-single-layout > div {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    .product-cover-column {
        max-width: 250px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .contact-grid-layout {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
}

@media (prefers-reduced-transparency: reduce) {
    .site-header,
    .header-navigation,
    .book-card,
    .hero-slider,
    .site-footer,
    .social-header-link,
    .footer-socials a,
    .theme-toggle,
    .mobile-menu-toggle {
        background: #FCFAF5 !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        box-shadow: none !important;
        border: 1px solid #E6E2D8 !important;
    }
    
    body.dark-theme .site-header,
    body.dark-theme .header-navigation,
    body.dark-theme .book-card,
    body.dark-theme .hero-slider,
    body.dark-theme .site-footer,
    body.dark-theme .social-header-link,
    body.dark-theme .footer-socials a,
    body.dark-theme .theme-toggle,
    body.dark-theme .mobile-menu-toggle {
        background: #121210 !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        box-shadow: none !important;
        border: 1px solid #2B2A26 !important;
    }
    
    .blob {
        display: none !important;
    }
}
