/* Reset margin, padding, and box sizing for all elements */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

body.menu-open {
    overflow: hidden;
    touch-action: none;
}

/* Main page styling with modern animated gradient */
body {
    font-family: Arial, sans-serif;
    background: linear-gradient(-45deg, #e0f2fe, #fef9c3, #dcfce7, #ede9fe);
    background-size: 400% 400%;
    animation: gradientMove 14s ease infinite;
    color: #111827;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Animated gradient movement */
@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Links */
a {
    text-decoration: none;
    color: #111827;
}

/* Keep link text dark on hover too */
a:hover,
a:focus,
a:active {
    color: #111827;
}

/* Responsive images */
img {
    max-width: 100%;
    display: block;
}

/* Decorative wrapper */
.bg-decor {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

/* Shared decorative blurred circle style */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(95px);
    opacity: 0.22;
}

.b1 {
    width: 280px;
    height: 280px;
    background: #38bdf8;
    top: 70px;
    left: -80px;
}

.b2 {
    width: 320px;
    height: 320px;
    background: #22c55e;
    top: 35%;
    right: -90px;
}

.b3 {
    width: 260px;
    height: 260px;
    background: #8b5cf6;
    bottom: 20px;
    left: 24%;
}

/* Accessibility skip link hidden off screen */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
}

/* Show skip link when focused */
.skip-link:focus {
    left: 20px;
    top: 20px;
    background: #ffffff;
    color: #111827;
    padding: 10px 14px;
    border-radius: 8px;
    z-index: 9999;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}

/* Top announcement section */
.announcement-bar {
    background: linear-gradient(90deg, #38bdf8, #6366f1, #22c55e);
    color: #ffffff;
    padding: 14px 18px;
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    text-align: center;
    font-size: 1rem;
    font-weight: 700;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14);
}

.announcement-bar p {
    margin: 0;
    color: #ffffff;
    font-weight: 800;
}

.announcement-bar a {
    color: #111827;
    background: linear-gradient(135deg, #fef9c3, #ffffff);
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 800;
    display: inline-block;
    margin-left: 8px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
    transition: 0.3s ease;
}

.announcement-bar a:hover,
.announcement-bar a:focus {
    color: #111827;
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.16);
}

.badge {
    background: linear-gradient(135deg, #fde047, #facc15);
    color: #111827;
    border: 2px solid rgba(255, 255, 255, 0.28);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 900;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
    letter-spacing: 0.4px;
}

/* Sticky site header */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 10px;
    min-height: 100px;
    max-height: 150px;
}

/* Logo */
.logo {
    all: unset;
    display: block;
    cursor: pointer;
    flex-shrink: 0;
}

.logo img {
    display: block;
    width: 250px !important;
    height: 150px !important;
    object-fit: contain;
}

.logo,
.logo img,
.logo * {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
}

/* Desktop navigation wrapper */
.main-nav {
    display: flex;
    align-items: center;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    align-items: center;
}

.nav-links li a {
    color: #111827;
    font-weight: 600;
    transition: 0.3s ease;
}

.nav-links li a:hover,
.nav-links li a:focus {
    color: #111827;
    opacity: 0.82;
}

/* Mobile menu button */
.menu-toggle {
    display: none;
    width: 50px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(59, 130, 246, 0.22);
    flex-shrink: 0;
    position: relative;
    border: 3px solid rgba(255, 255, 255, 0.88);
    transition: 0.3s ease;
    overflow: hidden;
    appearance: none;
    -webkit-appearance: none;
}

.menu-toggle:hover,
.menu-toggle:focus {
    transform: scale(1.04);
    box-shadow: 0 16px 34px rgba(79, 70, 229, 0.25);
}

.menu-lines {
    position: relative;
    width: 22px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-lines span {
    position: absolute;
    left: 0;
    width: 22px;
    height: 3px;
    border-radius: 999px;
    background: #ffffff;
    transition: transform 0.3s ease, opacity 0.3s ease, top 0.3s ease, background 0.3s ease;
    transform-origin: center;
}

.menu-lines span:nth-child(1) {
    top: 0;
}

.menu-lines span:nth-child(2) {
    top: 7px;
}

.menu-lines span:nth-child(3) {
    top: 14px;
}

/* Turn 3 bars into X when menu is open */
body.menu-open .menu-lines span:nth-child(1) {
    top: 7px;
    transform: rotate(45deg);
    background: red;
}

body.menu-open .menu-lines span:nth-child(2) {
    opacity: 0;
}

body.menu-open .menu-lines span:nth-child(3) {
    top: 7px;
    transform: rotate(-45deg);
    background: red;
}

/* Mobile overlay */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1500;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Mobile sidebar */
.sidebar {
    position: fixed;
    top: 0;
    right: -320px;
    width: 300px;
    height: 100vh;
    background: linear-gradient(180deg, #ffffff, #f1f5f9);
    color: #111827;
    padding: 8px 10px;
    transition: right 0.35s ease;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.18);
    overflow-y: auto;
}

.sidebar.active {
    right: 0;
}

.close-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fde047, #facc15);
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    margin-left: auto;
    margin-bottom: 22px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
    border: none;
}

/* Compact sidebar menu */
.sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar ul li {
    margin: 0;
    padding: 0;
}

.sidebar ul li a {
    display: block;
    padding: 8px 8px;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.1;
    color: #111827;
    border-radius: 8px;
}

.sidebar ul li a * {
    margin: 0 !important;
    padding: 0 !important;
}

.sidebar ul li a:hover,
.sidebar ul li a:focus {
    background: rgba(0, 0, 0, 0.05);
    color: #111827;
}

.sidebar-social {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 16px;
    padding-bottom: 10px;
}

.sidebar-social a {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid rgba(17, 24, 39, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111827;
    font-size: 14px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.10);
    transition: 0.3s ease;
}

.sidebar-social a i {
    font-size: 14px;
    color: #111827;
    line-height: 1;
}

.sidebar-social a:hover,
.sidebar-social a:focus {
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    transform: translateY(-2px) scale(1.04);
}

.sidebar-social a:hover i,
.sidebar-social a:focus i {
    color: #ffffff;
}

/* Main content width control */
main {
    width: 100%;
}

.modern-section {
    padding: 40px 18px 70px;
}

.modern-card {
    max-width: 1320px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.60);
    border: 1px solid rgba(255, 255, 255, 0.40);
    border-radius: 28px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
    overflow: hidden;
    backdrop-filter: blur(18px);
}

.modern-inner {
    padding: 35px 24px 40px;
}

/* Animated colorful title */
.modern-title {
    font-size: 2.35rem;
    text-align: center;
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
    line-height: 1.3;
}

.modern-title span {
    display: inline-block;
    font-weight: 900;
    text-transform: uppercase;
    animation: titleBounce 2.6s ease-in-out infinite, titleGlow 2.2s ease-in-out infinite, titleFloat 4.2s ease-in-out infinite;
    will-change: transform, filter, opacity;
}

.modern-title .space {
    width: 16px;
}

.modern-title span:nth-child(1) { color: #ff4d6d; animation-delay: 0s; }
.modern-title span:nth-child(2) { color: #f97316; animation-delay: 0.06s; }
.modern-title span:nth-child(3) { color: #facc15; animation-delay: 0.12s; }
.modern-title span:nth-child(4) { color: #22c55e; animation-delay: 0.18s; }
.modern-title span:nth-child(5) { color: #06b6d4; animation-delay: 0.24s; }
.modern-title span:nth-child(6) { color: #3b82f6; animation-delay: 0.30s; }
.modern-title span:nth-child(7) { color: #8b5cf6; animation-delay: 0.36s; }
.modern-title span:nth-child(8) { color: #ec4899; animation-delay: 0.42s; }
.modern-title span:nth-child(9) { color: #ef4444; animation-delay: 0.48s; }
.modern-title span:nth-child(10) { color: #f59e0b; animation-delay: 0.54s; }
.modern-title span:nth-child(11) { color: #84cc16; animation-delay: 0.60s; }
.modern-title span:nth-child(12) { color: #14b8a6; animation-delay: 0.66s; }
.modern-title span:nth-child(13) { color: #0ea5e9; animation-delay: 0.72s; }
.modern-title span:nth-child(14) { color: #6366f1; animation-delay: 0.78s; }
.modern-title span:nth-child(15) { color: #d946ef; animation-delay: 0.84s; }
.modern-title span:nth-child(16) { color: #fb7185; animation-delay: 0.90s; }
.modern-title span:nth-child(17) { color: #f97316; animation-delay: 0.96s; }

@keyframes titleBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    25% { transform: translateY(-6px) scale(1.04); }
    50% { transform: translateY(0) scale(1); }
    75% { transform: translateY(3px) scale(0.98); }
}

@keyframes titleGlow {
    0%, 100% { text-shadow: 0 0 8px rgba(255,255,255,0.18), 0 0 0 rgba(255,255,255,0); }
    50% { text-shadow: 0 0 14px rgba(255,255,255,0.65), 0 0 28px rgba(255,255,255,0.28); }
}

@keyframes titleFloat {
    0%, 100% { filter: saturate(1); opacity: 1; }
    50% { filter: saturate(1.25); opacity: 0.96; }
}

.modern-sub {
    text-align: center;
    max-width: 850px;
    margin: 0 auto 24px;
    color: #111827;
    font-size: 1.05rem;
}

/* Translate wrapper */
.translate-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

/* Lower height translate box */
#google_translate_element {
    background: rgba(255, 255, 255, 0.96);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid rgba(17, 24, 39, 0.10);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    width: min(100%, 560px);
    min-height: 40px;
    overflow: hidden;
}

#google_translate_element .goog-te-gadget {
    width: 100%;
    color: #111827 !important;
    font-size: 0.88rem !important;
    line-height: 1.1 !important;
}

#google_translate_element .goog-te-gadget-simple {
    width: 100% !important;
    border: none !important;
    background: transparent !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 4px 8px !important;
    border-radius: 10px !important;
    min-height: 30px !important;
}

#google_translate_element .goog-te-gadget-icon {
    display: none !important;
}

.skiptranslate iframe {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
}

/* Search and filter area */
.library-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 26px;
    background: rgba(255, 255, 255, 0.70);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 16px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.search-box {
    flex: 1 1 320px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 14px 16px 14px 46px;
    border-radius: 14px;
    border: 1px solid rgba(17, 24, 39, 0.12);
    font-size: 1rem;
    outline: none;
    background: rgba(255, 255, 255, 0.96);
    color: #111827;
}

.search-box input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.16);
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-btn {
    border: none;
    background: linear-gradient(135deg, #e0f2fe, #fef9c3);
    color: #111827;
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s ease;
}

.filter-btn:hover,
.filter-btn:focus,
.filter-btn.active {
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    color: #ffffff;
}

/* Books grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 18px;
}

.book-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 365px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.book-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(59, 130, 246, 0.18);
}

.book-image {
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, #e0f2fe, #fef9c3);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f1f5f9;
}

.book-content {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.book-category {
    display: inline-block;
    align-self: flex-start;
    font-size: 0.74rem;
    font-weight: 700;
    color: #111827;
    background: linear-gradient(135deg, #fef9c3, #dcfce7);
    padding: 5px 9px;
    border-radius: 999px;
    margin-bottom: 10px;
}

.book-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
    line-height: 1.35;
    min-height: 44px;
}

.book-author {
    color: #334155;
    font-size: 0.88rem;
    margin-bottom: 8px;
}

.book-desc {
    color: #475569;
    font-size: 0.88rem;
    margin-bottom: 14px;
    flex-grow: 1;
    min-height: 72px;
    line-height: 1.5;
}

.book-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.book-actions a {
    width: 100%;
    text-align: center;
    padding: 10px 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.88rem;
    transition: 0.3s ease;
}

.btn-read {
    background: linear-gradient(135deg, #22c55e, #38bdf8);
    color: #ffffff;
}

.btn-read:hover,
.btn-read:focus {
    background: linear-gradient(135deg, #16a34a, #2563eb);
    color: #ffffff;
}

.highlight {
    background: #fde047;
    color: #111827;
    padding: 1px 4px;
    border-radius: 4px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.no-results {
    display: none;
    text-align: center;
    padding: 35px 20px 10px;
    color: #111827;
    font-size: 1rem;
    font-weight: 700;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #ffffff;
    padding: 45px 20px 28px;
    margin-top: 40px;
    backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-menu {
    max-width: 1150px;
    margin: 0 auto 28px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
}

.footer-menu .column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-menu a {
    color: #ffffff;
    transition: 0.3s ease;
    font-weight: 600;
}

.footer-menu a:hover,
.footer-menu a:focus {
    color: #ffffff;
    opacity: 0.82;
}

/* Footer social icons */
.footer-social {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.footer-social a {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111827;
    font-size: 14px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
    transition: 0.3s ease;
}

.footer-social a i {
    font-size: 14px;
    color: #111827;
    line-height: 1 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-social a:hover,
.footer-social a:focus {
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    transform: translateY(-3px) scale(1.06);
}

.footer-social a:hover i,
.footer-social a:focus i {
    color: #ffffff;
}

footer p {
    text-align: center;
    color: #e2e8f0;
    font-size: 0.95rem;
}

/* Go to top button */
#goTopBtn {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    color: #ffffff;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.22);
    display: none;
    z-index: 999;
}

#goTopBtn:hover,
#goTopBtn:focus {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #ffffff;
}

/* Tablet and below */
@media (max-width: 992px) {
    .main-nav {
        display: none;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .modern-title {
        font-size: 1.95rem;
    }
}

/* Medium screens */
@media (max-width: 768px) {
    .modern-section {
        padding: 24px 12px 50px;
    }

    .modern-inner {
        padding: 24px 16px 28px;
    }

    .modern-title {
        font-size: 1.65rem;
    }

    .modern-title .space {
        width: 12px;
    }

    .modern-sub {
        font-size: 0.98rem;
    }

    .library-controls {
        align-items: stretch;
    }

    .book-card {
        min-height: 345px;
    }

    .book-image {
        height: 150px;
    }

    #google_translate_element {
        width: 100%;
    }

    .nav-menu,
    .mobile-menu,
    .sidebar-menu {
        color: #111827 !important;
    }

    .nav-menu *,
    .mobile-menu *,
    .sidebar-menu * {
        color: #111827 !important;
    }

    .nav-menu a:hover,
    .mobile-menu a:hover,
    .sidebar-menu a:hover {
        color: #111827 !important;
    }
}

/* Small phones */
@media (max-width: 520px) {
    .announcement-bar {
        font-size: 0.88rem;
        padding: 12px 12px;
    }

    .announcement-bar a {
        margin-left: 0;
        margin-top: 8px;
    }

    .logo img {
        width: 250px !important;
        height: 150px !important;
    }

    header {
        padding: 5px;
    }

    .menu-toggle {
        width: 50px;
        height: 40px;
        padding: 0;
    }

    .menu-lines {
        width: 23px;
        height: 18px;
    }

    .menu-lines span {
        width: 23px;
    }

    .menu-lines span:nth-child(1) {
        top: 0;
    }

    .menu-lines span:nth-child(2) {
        top: 7px;
    }

    .menu-lines span:nth-child(3) {
        top: 14px;
    }

    body.menu-open .menu-lines span:nth-child(1),
    body.menu-open .menu-lines span:nth-child(3) {
        top: 7px;
    }

    .books-grid {
        grid-template-columns: 1fr;
    }

    .book-image {
        height: 170px;
    }

    .book-title,
    .book-desc {
        min-height: auto;
    }

    .sidebar-social a,
    .footer-social a {
        width: 30px;
        height: 30px;
    }

    .sidebar-social a i,
    .footer-social a i {
        font-size: 12px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Books imported 2026-10-24: cinematic presentation and LCP safeguards */
.book-card{min-width:0;contain:layout style;transition:transform .18s ease,box-shadow .18s ease}
.book-card:hover{transform:translateY(-3px);box-shadow:0 14px 30px rgba(27,54,91,.14)}
.book-cover-img{display:block;width:100%;height:auto;aspect-ratio:600/850;object-fit:cover;border-radius:12px}
.book-card .coming-soon{pointer-events:none;opacity:.68}
.books-origin-note{text-align:center;font-size:.8rem;color:#516078}
@media (prefers-reduced-motion:reduce){.book-card{transition:none}.book-card:hover{transform:none}}


/* Global book metrics: always inside book card's lower edge */
.book-card{display:flex!important;flex-direction:column!important;min-width:0}
.book-card .book-content{display:flex;flex-direction:column;flex:1;min-width:0}
.book-card .etg-book-metrics{margin-top:auto!important;padding:12px 0 3px;border-top:1px solid rgba(43,70,105,.22);display:flex;flex-wrap:wrap;gap:8px;width:100%}
.book-card .etg-metric{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;min-width:0;background:#f6f9ff;color:#1c3658;border:1px solid #c8d8eb;border-radius:999px;padding:6px 11px;font-size:.78rem;font-weight:750;font-variant-numeric:tabular-nums}
.book-card .etg-metric-icon{color:#286fa2;font-size:1rem}
body.night .book-card .etg-book-metrics, .night .book-card .etg-book-metrics{border-top-color:#657795}
body.night .book-card .etg-metric,.night .book-card .etg-metric{background:#fff;color:#1d3454;border-color:#acc0d4}
@media(max-width:420px){.book-card .etg-book-metrics{gap:5px}.book-card .etg-metric{font-size:.73rem;padding:5px 8px}}


/* Books navigation panel repair, responsive and independent of legacy theme */
#sidebar.sidebar{inset:0 auto 0 0!important;left:0!important;right:auto!important;box-sizing:border-box!important;width:min(340px,90vw)!important;max-width:100vw!important;height:100dvh!important;max-height:100dvh!important;padding:18px 16px max(20px,env(safe-area-inset-bottom))!important;overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior:contain!important;transform:translate3d(-105%,0,0)!important;transition:transform .22s ease!important;visibility:hidden!important;pointer-events:none!important;z-index:2200!important;background:linear-gradient(145deg,#fafcff,#edf3fa)!important;color:#15263b!important;direction:ltr!important}
#sidebar.sidebar.active{transform:translate3d(0,0,0)!important;visibility:visible!important;pointer-events:auto!important}
#sidebar .close-btn{flex:none!important;position:sticky;top:0;z-index:2;margin:0 0 14px auto!important;background:#e4effd!important;border:1px solid #b2c9e3!important;color:#173c65!important}
#sidebar ul{padding:0!important;margin:0!important;list-style:none!important;display:grid!important;gap:4px!important;width:100%!important}
#sidebar ul li,#sidebar ul li a{min-width:0!important;max-width:100%!important;overflow-wrap:anywhere!important}
#sidebar ul li a{display:block!important;text-align:start!important;padding:11px 13px!important;border-radius:12px!important;font-size:clamp(.88rem,2.8vw,1rem)!important;line-height:1.35!important;background:transparent!important;color:#213d59!important}
#sidebar ul li a:hover,#sidebar ul li a:focus-visible{background:#d9eafa!important;color:#112f55!important;outline-offset:1px}
#sidebar .sidebar-social{margin-top:16px!important;gap:8px!important}
#sidebar .sidebar-social a{flex:none!important;color:#24496d!important}
#sidebar-overlay.sidebar-overlay{position:fixed!important;inset:0!important;z-index:2100!important;background:#0a173588!important}
body.menu-open{overflow:hidden!important}
html[dir="rtl"] #sidebar.sidebar{inset:0 0 0 auto!important;left:auto!important;right:0!important;direction:rtl!important;transform:translate3d(105%,0,0)!important}
html[dir="rtl"] #sidebar.sidebar.active{transform:translate3d(0,0,0)!important}
html[dir="rtl"] #sidebar .close-btn{margin:0 auto 14px 0!important}
@media(prefers-reduced-motion:reduce){#sidebar.sidebar{transition:none!important}}

/* 2026 accessibility + responsive translator + read cards refinement */
html,body{max-width:100%;overflow-x:clip}
*,*::before,*::after{box-sizing:border-box}
img,svg,video,canvas{max-width:100%;height:auto}
#etg-translate-control,.etg-translate-control{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:9px 13px;border-radius:14px;background:linear-gradient(130deg,#eef6ff,#f5f0ff);border:1px solid #bdd0ea;margin:9px auto;max-width:min(100%,1190px);color:#1c355c}
.etg-translate-control label{font-size:.81rem;font-weight:800;color:#26486b}
#etgLanguage{appearance:auto;min-width:170px;max-width:100%;padding:9px 12px;border-radius:11px;background:#fff;color:#1b3552;border:1px solid #8eabc9;font:inherit}
#google_translate_element{position:absolute!important;left:-200vw!important;top:auto!important;width:1px!important;height:1px!important;overflow:hidden!important;pointer-events:none}
.goog-te-banner-frame,.goog-te-banner-frame.skiptranslate{display:none!important}body{top:0!important}
#sidebar{max-width:min(90vw,350px)!important;height:100dvh!important;overflow-y:auto!important;overscroll-behavior:contain!important}
#sidebar-overlay{inset:0!important}
.book-card{min-width:0;overflow:hidden}
.book-card img{object-fit:contain;aspect-ratio:3/4;width:100%;height:auto}
.book-card .view-counter,.book-card .reading-counter,.book-card .book-metrics,.book-card .metrics{font-size:.73rem!important;line-height:1.3!important}
.book-card a[class*="read"],.book-card a[class*="button"],.book-card .read-btn{border-radius:999px!important;background:linear-gradient(122deg,#357ad8,#7d70dc)!important;color:#fff!important;font-weight:800!important;text-decoration:none!important;box-shadow:0 3px 10px #234f9030;transition:transform .18s ease,box-shadow .18s ease}
.book-card a[class*="read"]:hover,.book-card a[class*="button"]:hover,.book-card .read-btn:hover{transform:translateY(-2px);box-shadow:0 7px 20px #234f9040}
.unavailable-book{cursor:not-allowed!important;background:#e4e9f0!important;color:#3a526b!important;box-shadow:none!important;pointer-events:none}
html[dir="rtl"] .book-card{text-align:right}
html[dir="rtl"] .etg-translate-control{direction:rtl}
body.night .etg-translate-control{background:#1f304b;color:#f4f8ff;border-color:#6e85aa}
body.night .etg-translate-control label{color:#fff}
body.night #etgLanguage{background:white;color:#16324e}
@media(max-width:720px){.etg-translate-control{width:calc(100% - 24px)}.etg-translate-control label{width:100%}#etgLanguage{width:100%}main,.container,.books-grid{max-width:100%}}
@media(prefers-reduced-motion:reduce){.book-card a[class*="read"]{transition:none!important;transform:none!important}}

/* Universal 4-column grid, no masonry or shifted third-row cards */
.books-grid{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;align-items:stretch!important;grid-auto-flow:row!important;gap:18px!important}.books-grid>.book-card{position:static!important;transform:none;min-width:0;width:auto!important;max-width:none!important;margin:0!important;break-inside:avoid}.books-grid>.book-card[hidden]{display:none!important}
.book-content{min-width:0}.book-card .btn-read{min-height:45px!important;padding:12px 20px!important;margin:8px 0!important;white-space:normal!important;text-align:center}
.etg-book-pages{margin:24px 0;display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px;padding:10px}.etg-book-pages button,.etg-filter-extra button{min-width:42px;min-height:42px;padding:8px 13px;border-radius:12px;border:1px solid #99aac5;background:linear-gradient(125deg,#b5dafa,#d7d0ff);color:#183d63;cursor:pointer;font-weight:800}.etg-book-pages button[aria-current=page]{background:#345fb9;color:white}.etg-book-pages button:disabled{opacity:.4}.etg-filter-extra{text-align:center}.etg-placeholder-art{min-height:170px;display:grid;place-items:center;background:linear-gradient(135deg,#bed5f8,#d6c3fa,#f5edf9);font-size:3rem;font-weight:900;color:#5371a2;border-radius:14px}.etg-future-book{opacity:.82}.etg-unavailable{display:inline-block;background:#f2f4f8;color:#40516a;border-radius:10px;padding:10px 14px}.etg-reader-translate{margin:14px auto;padding:12px;border:1px solid #abbcd4;border-radius:14px;background:#eaf2fd;display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap;color:#243b61}.etg-reader-translate select{padding:9px 14px;border-radius:10px;max-width:100%;color:#183953;background:white}.skiptranslate iframe,.goog-te-banner-frame{max-width:100vw}.goog-te-gadget{font-size:12px}html,body{overflow-x:clip;max-width:100%}html[dir=rtl] .books-grid,html[dir=rtl] .book-content{direction:rtl;text-align:right}
@media(max-width:1050px){.books-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}}@media(max-width:760px){.books-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}@media(max-width:460px){.books-grid{grid-template-columns:minmax(0,1fr)!important}}

/* Unified fixes: readable connected Persian, compact language selector, proper card hiding. */
html[lang|="fa"],html[lang|="ar"],html[lang|="ur"],html[lang|="he"] {letter-spacing:normal!important;word-spacing:normal;font-family:Tahoma,"Noto Naskh Arabic","Noto Sans Arabic",Arial,sans-serif!important;}
html[dir="rtl"] h1,html[dir="rtl"] h2,html[dir="rtl"] h3,html[dir="rtl"] p,html[dir="rtl"] a,html[dir="rtl"] button,html[dir="rtl"] span,html[dir="rtl"] label {letter-spacing:normal!important;text-transform:none!important;unicode-bidi:plaintext;}
html[dir="rtl"] .books-grid,html[dir="rtl"] .books-grid .book-card{direction:rtl;text-align:start;}
html[dir="rtl"] .books-grid{grid-auto-flow:row!important;}
html[dir="ltr"] .books-grid,html[dir="ltr"] .books-grid .book-card{direction:ltr;}
.etg-translate-control{display:flex!important;align-items:center;gap:7px;flex-wrap:wrap;padding:6px 9px!important;max-width:100%;min-height:0!important}
.etg-translate-control label{font-size:.72rem!important;line-height:1.2}
.etg-translate-control select,#etgLanguage{min-height:34px!important;max-width:170px;width:auto!important;font-size:.8rem!important;padding:5px 9px!important;direction:ltr}
#google_translate_element,.etg-google-engine{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%)!important}
.books-grid{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;grid-auto-flow:row!important;align-items:stretch;gap:16px;}
.books-grid .book-card{min-width:0;max-width:100%;grid-column:auto!important;grid-row:auto!important}
.books-grid .book-card[hidden]{display:none!important}
.book-card .read-book-btn, .books-grid a.read-book-btn{display:inline-flex!important;align-items:center;justify-content:center;gap:7px;min-height:44px;padding:12px 20px!important;border-radius:14px!important;background:linear-gradient(115deg,#526cce,#43a8d4)!important;color:#fff!important;text-decoration:none!important;font-weight:800!important;line-height:1.3;white-space:normal;text-align:center}
.book-card .read-book-btn:hover,.book-card .read-book-btn:focus-visible{background:linear-gradient(115deg,#3548a9,#237ca9)!important;color:white!important}
html,body{max-width:100%;overflow-x:clip}
@media(max-width:1000px){.books-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}}
@media(max-width:720px){.books-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}}
@media(max-width:480px){.books-grid{grid-template-columns:minmax(0,1fr)!important}}

/* Six-page catalogue + consistent clickable reading buttons */
.books-grid{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;align-items:stretch}
.book-card{min-width:0;display:flex;flex-direction:column;overflow:hidden}
.book-card .book-content{flex:1;display:flex;flex-direction:column;min-width:0}
.book-card .book-actions{margin-top:auto;padding:14px 0 10px;width:100%;display:flex;align-items:center}
.book-card .btn-read,.book-card .read-book-btn{box-sizing:border-box!important;min-height:45px!important;display:inline-flex!important;align-items:center;justify-content:center;text-align:center;padding:12px 20px!important;border-radius:12px!important;text-decoration:none!important;color:#fff!important;background:linear-gradient(115deg,#376bd5,#7663db,#318da9)!important;border:1px solid #4667b4!important;font-weight:800!important;line-height:1.25!important;white-space:normal!important;max-width:100%;box-shadow:0 3px 10px #182c5b24}
.book-card a.btn-read:hover,.book-card a.btn-read:focus-visible{background:linear-gradient(115deg,#2148ac,#6650c4,#216c93)!important;outline:2px solid #ffdb75;outline-offset:2px}
.book-card .btn-read.unavailable{opacity:.72!important;background:linear-gradient(115deg,#64748b,#94a3b8)!important;border-color:#8793a4!important;cursor:default;pointer-events:none}
.book-card[hidden]{display:none!important}
.placeholder-cover{aspect-ratio:3/4;min-height:0!important;display:grid!important;place-items:center;background:linear-gradient(135deg,#6aadd9,#e6edf5 56%,#b4a6e8)!important}
.placeholder-cover-title{font-size:clamp(.85rem,2vw,1.3rem);font-weight:850;letter-spacing:.05em;color:#234566;background:#ffffffb8;border-radius:12px;padding:12px}
.etg-book-pages{display:flex;justify-content:center;align-items:center;gap:8px;flex-wrap:wrap;margin:24px 0 38px;padding:10px}
.etg-book-pages button{min-width:41px;min-height:42px;border-radius:11px;border:1px solid #b0c5de;background:linear-gradient(115deg,#e4efff,#d5dbfa);color:#1b3765;font-weight:800;cursor:pointer}
.etg-book-pages button[aria-current=page]{background:linear-gradient(115deg,#3e7cdb,#8c62d9);color:#fff}
.etg-book-pages button:disabled{opacity:.5;cursor:default}
html,body{max-width:100%;overflow-x:clip}
@media(max-width:950px){.books-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:670px){.books-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.book-card .btn-read{padding:11px!important}}
@media(max-width:380px){.books-grid{grid-template-columns:1fr}}

/* Fix RTL typography and horizontal overflow, including Google translated text */
html,body{width:100%;max-width:100%;overflow-x:clip}
*,*::before,*::after{box-sizing:border-box}
main,.books-grid,.book-card,.book-content,.hero,.container,header,footer,nav{min-width:0;max-width:100%}
img,svg,iframe,video{max-width:100%;height:auto}
pre,code{white-space:pre-wrap;overflow-wrap:anywhere}
h1,h2,h3,p,a,button,span{overflow-wrap:break-word}
html[dir=rtl] body,html[dir=rtl] main{direction:rtl}
html[dir=rtl] h1,html[dir=rtl] h2,html[dir=rtl] h3,html[dir=rtl] p{
 letter-spacing:normal!important;word-spacing:normal!important;
 font-family:Tahoma,'Noto Naskh Arabic','Noto Sans Arabic',Arial,sans-serif!important;
 font-variant-ligatures:normal!important;word-break:normal!important;text-transform:none!important;
}
html[dir=rtl] .books-grid{text-align:start;direction:rtl}
html[dir=ltr] .books-grid{direction:ltr}
html[dir=rtl] input,html[dir=rtl] select{text-align:right}
.goog-te-banner-frame,.skiptranslate iframe{max-width:100%!important}
.etg-google-engine{position:absolute!important;left:-9999px!important;width:1px!important;height:1px!important;overflow:hidden!important}
@media(max-width:750px){.books-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}body,main{overflow-x:clip!important}}
@media(max-width:410px){.books-grid{grid-template-columns:minmax(0,1fr)!important}.book-card{width:100%!important}}
