/*
Theme Name: Kwekanyaw
Theme URI: https://library-kwekanyaw.online
Description: A modern digital library WordPress theme with beautiful book animations, custom fonts support, and dynamic content display. Perfect for Karen language libraries and book collections.
Author: Friday Mayrich
Author URI: https://library-kwekanyaw.online
Version: 2.0.0
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kwekanyaw
Tags: library, books, custom-fonts, book-animation, karen-language, digital-library, responsive, customizer, custom-post-types

Kwekanyaw - Digital Library Theme
A beautifully crafted WordPress theme for digital libraries and book collections.
Featuring 3D book animations, custom font support, and Karen language optimization.
*/

/* ============================================
   CSS Variables & Custom Properties
   ============================================ */
:root {
    /* Primary Colors */
    --kw-primary: #8B4513;
    --kw-primary-light: #A0522D;
    --kw-primary-dark: #654321;
    --kw-accent: #D2691E;
    --kw-accent-light: #E07B32;
    
    /* Secondary Colors */
    --kw-secondary: #2C3E50;
    --kw-secondary-light: #34495E;
    
    /* Background Colors */
    --kw-bg-wood: #8B5A2B;
    --kw-bg-shelf: #DEB887;
    --kw-bg-light: #FFF8F0;
    --kw-bg-dark: #1A1A2E;
    
    /* Text Colors */
    --kw-text: #333333;
    --kw-text-light: #666666;
    --kw-text-muted: #999999;
    --kw-text-white: #FFFFFF;
    
    /* Shadows */
    --kw-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --kw-shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
    --kw-shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
    --kw-shadow-book: 5px 5px 15px rgba(0, 0, 0, 0.3);
    
    /* Borders */
    --kw-radius-sm: 4px;
    --kw-radius-md: 8px;
    --kw-radius-lg: 12px;
    --kw-radius-xl: 20px;
    
    /* Typography */
    --kw-font-primary: 'Karen', 'Noto Sans Myanmar', 'Padauk', system-ui, -apple-system, sans-serif;
    --kw-font-heading: 'YanoneKaffeesatz', 'Segoe UI', Tahoma, sans-serif;
    --kw-font-custom: var(--kw-custom-font, var(--kw-font-primary));
    
    /* Spacing */
    --kw-space-xs: 0.25rem;
    --kw-space-sm: 0.5rem;
    --kw-space-md: 1rem;
    --kw-space-lg: 1.5rem;
    --kw-space-xl: 2rem;
    --kw-space-2xl: 3rem;
    
    /* Transitions */
    --kw-transition-fast: 0.15s ease;
    --kw-transition-normal: 0.3s ease;
    --kw-transition-slow: 0.5s ease;
    
    /* Container */
    --kw-container-width: 1200px;
    --kw-container-narrow: 960px;
}

/* ============================================
   Custom Font Face Declarations
   ============================================ */
@font-face {
    font-family: 'YanoneKaffeesatz';
    src: url('fonts/YanoneKaffeesatz-Regular-webfont.woff2') format('woff2'),
         url('fonts/YanoneKaffeesatz-Regular-webfont.woff') format('woff'),
         url('fonts/YanoneKaffeesatz-Regular-webfont.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Dynamic Custom Font - Will be replaced via Customizer */
@font-face {
    font-family: 'Karen';
    src: url('fonts/custom-font.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ============================================
   CSS Reset & Base Styles
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--kw-font-primary);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--kw-text);
    background: var(--kw-bg-dark);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--kw-font-heading);
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: var(--kw-space-md);
    color: var(--kw-secondary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: var(--kw-space-md);
}

a {
    color: var(--kw-accent);
    text-decoration: none;
    transition: color var(--kw-transition-fast);
}

a:hover, a:focus {
    color: var(--kw-accent-light);
}

/* ============================================
   Layout & Container
   ============================================ */
.kw-container {
    width: 100%;
    max-width: var(--kw-container-width);
    margin: 0 auto;
    padding: 0 var(--kw-space-md);
}

.kw-container--narrow {
    max-width: var(--kw-container-narrow);
}

#wrapper {
    background: linear-gradient(135deg, var(--kw-bg-dark) 0%, #16213E 100%);
    min-height: 100vh;
    padding: var(--kw-space-lg) 0;
}

#casing {
    max-width: var(--kw-container-width);
    margin: 0 auto;
    background: linear-gradient(180deg, #FFF8F0 0%, #F5E6D3 100%);
    border-radius: var(--kw-radius-lg);
    box-shadow: var(--kw-shadow-lg);
    overflow: hidden;
}

/* ============================================
   Header Styles
   ============================================ */
#masthead {
    max-width: var(--kw-container-width);
    margin: 0 auto;
}

#head {
    background: linear-gradient(135deg, var(--kw-primary) 0%, var(--kw-primary-dark) 100%);
    padding: var(--kw-space-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--kw-space-md);
    border-radius: var(--kw-radius-lg) var(--kw-radius-lg) 0 0;
    position: relative;
    overflow: hidden;
}

#head::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('images/wood-texture.png') repeat;
    opacity: 0.1;
    pointer-events: none;
}

#blogname {
    flex: 1;
    min-width: 200px;
}

#blogname h1 {
    font-size: 2rem;
    margin: 0;
    color: var(--kw-text-white);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

#blogname h1 a {
    color: inherit;
    transition: opacity var(--kw-transition-fast);
}

#blogname h1 a:hover {
    opacity: 0.9;
}

.site-logo {
    max-height: 80px;
    width: auto;
    transition: transform var(--kw-transition-normal);
}

.site-logo:hover {
    transform: scale(1.05);
}

/* Search Form */
#searchform {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--kw-radius-xl);
    padding: var(--kw-space-xs);
    backdrop-filter: blur(10px);
}

#searchform input[type="text"] {
    border: none;
    background: transparent;
    padding: var(--kw-space-sm) var(--kw-space-md);
    color: var(--kw-text-white);
    font-size: 0.9rem;
    width: 200px;
    outline: none;
}

#searchform input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

#searchform button {
    background: var(--kw-accent);
    border: none;
    border-radius: var(--kw-radius-xl);
    padding: var(--kw-space-sm) var(--kw-space-md);
    color: var(--kw-text-white);
    cursor: pointer;
    transition: background var(--kw-transition-fast);
}

#searchform button:hover {
    background: var(--kw-accent-light);
}

/* ============================================
   Navigation
   ============================================ */
#botmenu {
    background: linear-gradient(180deg, #2C2C2C 0%, #1A1A1A 100%);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

#submenu {
    max-width: var(--kw-container-width);
    margin: 0 auto;
    padding: 0 var(--kw-space-md);
}

#submenu ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

#submenu li {
    position: relative;
}

#submenu li a {
    display: block;
    padding: var(--kw-space-md) var(--kw-space-lg);
    color: #B0B0B0;
    font-weight: 500;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all var(--kw-transition-fast);
    border-bottom: 3px solid transparent;
}

#submenu li a:hover,
#submenu li.current-menu-item a,
#submenu li.current_page_item a {
    color: var(--kw-accent);
    border-bottom-color: var(--kw-accent);
    background: rgba(255, 255, 255, 0.05);
}

/* Dropdown Menu */
#submenu ul ul {
    position: absolute;
    top: 100%;
    left: 0;
    background: #2C2C2C;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--kw-transition-normal);
    box-shadow: var(--kw-shadow-lg);
    border-radius: 0 0 var(--kw-radius-md) var(--kw-radius-md);
    z-index: 1000;
    flex-direction: column;
}

#submenu li:hover > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#submenu ul ul li a {
    padding: var(--kw-space-sm) var(--kw-space-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-transform: none;
}

#submenu ul ul li:last-child a {
    border-bottom: none;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: var(--kw-accent);
    border: none;
    padding: var(--kw-space-sm) var(--kw-space-md);
    color: var(--kw-text-white);
    cursor: pointer;
    border-radius: var(--kw-radius-sm);
    font-size: 1rem;
}

/* ============================================
   Bookshelf & Book Display
   ============================================ */
.bookshelf-container {
    padding: var(--kw-space-xl);
    background: linear-gradient(180deg, #E8D5B7 0%, #D4C4A8 100%);
    position: relative;
    min-height: 400px;
}

#home-content {
    padding: var(--kw-space-xl);
    background: linear-gradient(180deg, #E8D5B7 0%, #D4C4A8 100%);
    position: relative;
}

#shelf, .books-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 30px;
    padding: 20px 0;
    margin: 0;
}

/* Individual Book Box */
.box {
    perspective: 1000px;
    position: relative;
    display: flex;
    justify-content: center;
}

.postim {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
    cursor: pointer;
    width: 160px;
}

.postim:hover {
    transform: rotateY(-10deg) translateZ(10px);
}

/* Book Cover Image */
.book-cover-image,
.postim img {
    width: 160px;
    height: 240px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 
        4px 4px 10px rgba(0, 0, 0, 0.3),
        0 0 3px rgba(0, 0, 0, 0.2);
    display: block;
}

.book-cover-image.placeholder {
    background: linear-gradient(135deg, #8B4513 0%, #654321 100%);
}

/* Book Link */
.book-link {
    display: block;
    text-decoration: none;
}

/* Book Spine Effect */
.postim::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 5%;
    width: 12px;
    height: 90%;
    background: linear-gradient(90deg, #5D4037 0%, #8B4513 100%);
    transform: rotateY(90deg);
    transform-origin: right center;
    border-radius: 2px 0 0 2px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.postim:hover::before {
    opacity: 1;
}

/* Book Title Overlay */
.btitle {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    padding: 40px 10px 10px;
    border-radius: 0 0 4px 4px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.postim:hover .btitle {
    opacity: 1;
    transform: translateY(0);
}

.btitle h2 {
    font-size: 0.85rem;
    margin: 0;
    color: #fff;
    line-height: 1.3;
    font-weight: 600;
}

.btitle h2 a {
    color: inherit;
    text-decoration: none;
}

/* Book Author */
.inwriter {
    display: block;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 4px;
    font-style: italic;
}

/* Book Rating Badge */
.book-rating-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 8px;
    border-radius: 4px;
}

.book-rating-badge .star-rating {
    font-size: 0.75rem;
}

.book-rating-badge .star-rating .star {
    color: #FFD700;
}

/* Different Book Sizes */
.box.size-small .postim {
    width: 130px;
}

.box.size-small .book-cover-image,
.box.size-small .postim img {
    width: 130px;
    height: 195px;
}

.box.size-large .postim {
    width: 190px;
}

.box.size-large .book-cover-image,
.box.size-large .postim img {
    width: 190px;
    height: 285px;
}

.box.size-featured {
    grid-column: span 2;
}

.box.size-featured .postim {
    width: 280px;
}

.box.size-featured .book-cover-image,
.box.size-featured .postim img {
    width: 280px;
    height: 200px;
    object-fit: cover;
}

/* Clear float */
.clear {
    clear: both;
}

/* ============================================
   Book Detail Page (Single)
   ============================================ */
#content {
    padding: var(--kw-space-xl);
    background: var(--kw-bg-light);
}

/* Single Book Layout */
.book-single {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.book-header {
    margin-bottom: 30px;
    border-bottom: 3px solid var(--kw-accent, #D2691E);
    padding-bottom: 20px;
}

.book-header .book-title {
    font-size: 2rem;
    color: var(--kw-primary, #8B4513);
    margin: 0 0 10px;
}

.book-header .book-author-name {
    color: #666;
    font-size: 1.1rem;
    font-style: italic;
    margin: 0;
}

.book-content-wrapper {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
}

@media (max-width: 768px) {
    .book-content-wrapper {
        grid-template-columns: 1fr;
    }
}

.book-cover-section {
    text-align: center;
}

.book-cover-large {
    margin-bottom: 20px;
}

.book-cover-large img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.book-rating {
    margin: 15px 0;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 8px;
}

.book-rating .rating-label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
}

/* Star Rating */
.star-rating {
    display: inline-flex;
    gap: 2px;
}

.star-rating .star {
    font-size: 1.2rem;
    color: #ddd;
}

.star-rating .star.filled {
    color: #FFD700;
}

/* Download Button */
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--kw-primary, #8B4513) 0%, var(--kw-accent, #D2691E) 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.4);
    color: white;
}

.download-btn .download-icon {
    font-size: 1.2rem;
}

/* Book Details Section */
.book-details-section {
    min-width: 0;
}

.book-meta-box {
    background: linear-gradient(135deg, #FFF5E6 0%, #FFE4CC 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    border-left: 4px solid var(--kw-accent, #D2691E);
}

.book-meta-box h3 {
    margin: 0 0 20px;
    color: var(--kw-primary, #8B4513);
    font-size: 1.2rem;
}

.book-meta-table {
    width: 100%;
    border-collapse: collapse;
}

.book-meta-table tr {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.book-meta-table tr:last-child {
    border-bottom: none;
}

.book-meta-table th,
.book-meta-table td {
    padding: 10px 5px;
    text-align: left;
}

.book-meta-table th {
    width: 120px;
    color: var(--kw-primary, #8B4513);
    font-weight: 600;
}

.book-meta-table td a {
    color: var(--kw-accent, #D2691E);
}

/* Reading Time */
.reading-time {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 0.9rem;
    color: #666;
}

/* Book Description */
.book-description {
    margin-bottom: 30px;
}

.book-description h3 {
    color: var(--kw-primary, #8B4513);
    margin: 0 0 15px;
    font-size: 1.2rem;
}

.book-description p {
    line-height: 1.8;
    color: #444;
}

/* Social Share */
.social-share {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-top: 1px solid #eee;
}

.social-share .share-label {
    font-weight: 600;
    color: #666;
}

.social-share .share-btn {
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    color: white;
    font-size: 0.85rem;
    transition: opacity 0.3s;
}

.social-share .share-btn:hover {
    opacity: 0.85;
}

.social-share .share-btn.facebook {
    background: #3b5998;
}

.social-share .share-btn.twitter {
    background: #1da1f2;
}

/* Related Books */
.related-books {
    margin-top: 40px;
    padding: 30px;
    background: #f9f6f2;
    border-radius: 12px;
}

.related-books h2 {
    color: var(--kw-primary, #8B4513);
    margin: 0 0 25px;
    font-size: 1.5rem;
}

.related-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 25px;
}

.related-book-item {
    text-align: center;
}

.related-book-item a {
    text-decoration: none;
    color: inherit;
}

.related-book-item img {
    width: 120px;
    height: 180px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.related-book-item:hover img {
    transform: translateY(-5px);
}

.related-book-item h4 {
    margin: 10px 0 0;
    font-size: 0.9rem;
    color: #333;
}

/* Legacy styles for compatibility */
.post {
    background: white;
    border-radius: var(--kw-radius-lg);
    padding: var(--kw-space-xl);
    box-shadow: var(--kw-shadow-md);
    margin-bottom: var(--kw-space-xl);
}

.title h2 {
    font-size: 2rem;
    color: var(--kw-primary);
    border-bottom: 3px solid var(--kw-accent);
    padding-bottom: var(--kw-space-sm);
    margin-bottom: var(--kw-space-lg);
}

.title h2 a {
    color: inherit;
}

/* Review Box */
.revbox {
    display: flex;
    flex-wrap: wrap;
    gap: var(--kw-space-lg);
    background: linear-gradient(135deg, #FFF5E6 0%, #FFE4CC 100%);
    padding: var(--kw-space-lg);
    border-radius: var(--kw-radius-md);
    margin-bottom: var(--kw-space-xl);
    border-left: 4px solid var(--kw-accent);
}

.revleft {
    flex: 1;
    min-width: 200px;
}

.revleft span {
    display: block;
    margin-bottom: var(--kw-space-sm);
    color: var(--kw-text-light);
}

.revleft span strong {
    color: var(--kw-primary);
}

.revright {
    text-align: center;
    min-width: 150px;
}

.ratehead {
    display: block;
    font-size: 0.85rem;
    color: var(--kw-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--kw-space-sm);
}

/* Star Rating */
.ratebg {
    display: inline-block;
    background: #E0E0E0;
    border-radius: var(--kw-radius-sm);
    padding: var(--kw-space-xs) var(--kw-space-sm);
}

.rstar {
    display: inline-block;
    width: 100px;
    height: 20px;
    background: url('images/stars-empty.svg') repeat-x;
    position: relative;
}

.rstar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: url('images/stars-filled.svg') repeat-x;
}

.rate-1::before { width: 20%; }
.rate-2::before { width: 40%; }
.rate-3::before { width: 60%; }
.rate-4::before { width: 80%; }
.rate-5::before { width: 100%; }

/* Entry Content */
.entry {
    font-size: 1.05rem;
    line-height: 1.8;
}

.entry p {
    margin-bottom: var(--kw-space-lg);
}

.bookimg {
    float: left;
    margin: 0 var(--kw-space-xl) var(--kw-space-lg) 0;
    border-radius: var(--kw-radius-md);
    box-shadow: var(--kw-shadow-lg);
    max-width: 250px;
    height: auto;
    transition: transform var(--kw-transition-normal);
}

.bookimg:hover {
    transform: scale(1.02);
}

/* Post Meta */
.postmeta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--kw-space-lg);
    padding-top: var(--kw-space-lg);
    margin-top: var(--kw-space-xl);
    border-top: 1px solid #E0E0E0;
    font-size: 0.9rem;
    color: var(--kw-text-muted);
}

.postmeta span {
    display: flex;
    align-items: center;
    gap: var(--kw-space-sm);
}

.postmeta span::before {
    content: '';
    width: 18px;
    height: 18px;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.6;
}

.author::before { background-image: url('images/icon-user.svg'); }
.clock::before { background-image: url('images/icon-clock.svg'); }
.comm::before { background-image: url('images/icon-comment.svg'); }

/* ============================================
   Sidebar
   ============================================ */
#sidebar {
    padding: var(--kw-space-xl);
    background: var(--kw-bg-light);
}

.sidebox {
    list-style: none;
    background: white;
    border-radius: var(--kw-radius-md);
    padding: var(--kw-space-lg);
    margin-bottom: var(--kw-space-lg);
    box-shadow: var(--kw-shadow-sm);
}

.sidetitl {
    font-size: 1.1rem;
    color: var(--kw-primary);
    padding-bottom: var(--kw-space-sm);
    margin-bottom: var(--kw-space-md);
    border-bottom: 2px solid var(--kw-accent);
}

.sidebox ul {
    list-style: none;
}

.sidebox ul li {
    padding: var(--kw-space-sm) 0;
    border-bottom: 1px solid #F0F0F0;
}

.sidebox ul li:last-child {
    border-bottom: none;
}

.sidebox ul li a {
    color: var(--kw-text);
    transition: all var(--kw-transition-fast);
}

.sidebox ul li a:hover {
    color: var(--kw-accent);
    padding-left: var(--kw-space-sm);
}

/* ============================================
   Footer
   ============================================ */
.bottomcover {
    background: linear-gradient(180deg, #1A1A2E 0%, #0F0F1A 100%);
    padding: var(--kw-space-2xl) 0 var(--kw-space-lg);
}

#bottom {
    max-width: var(--kw-container-width);
    margin: 0 auto;
    padding: 0 var(--kw-space-md);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--kw-space-xl);
}

.botwid {
    list-style: none;
    color: #B0B0B0;
}

.botwid a {
    color: #B0B0B0;
    transition: color var(--kw-transition-fast);
}

.botwid a:hover {
    color: var(--kw-accent);
}

h3.bothead {
    color: white;
    font-size: 1.1rem;
    padding-bottom: var(--kw-space-sm);
    margin-bottom: var(--kw-space-md);
    border-bottom: 2px solid var(--kw-accent);
}

.botwid ul {
    list-style: none;
}

.botwid ul li {
    padding: var(--kw-space-sm) 0;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.1);
}

#footer {
    background: #0A0A14;
    padding: var(--kw-space-lg) 0;
    text-align: center;
}

.fcred {
    color: #666;
    font-size: 0.9rem;
}

.fcred a {
    color: #888;
}

.fcred a:hover {
    color: var(--kw-accent);
}

/* ============================================
   Comments Section
   ============================================ */
#commentsbox {
    margin-top: var(--kw-space-2xl);
}

h3#comments {
    background: linear-gradient(135deg, var(--kw-accent) 0%, var(--kw-primary) 100%);
    color: white;
    padding: var(--kw-space-md) var(--kw-space-lg);
    border-radius: var(--kw-radius-md);
    font-size: 1.2rem;
    margin-bottom: var(--kw-space-lg);
}

.commentlist {
    list-style: none;
}

.commentlist li {
    background: white;
    padding: var(--kw-space-lg);
    margin-bottom: var(--kw-space-md);
    border-radius: var(--kw-radius-md);
    box-shadow: var(--kw-shadow-sm);
    border-left: 4px solid var(--kw-accent);
}

.comment-author {
    display: flex;
    align-items: center;
    gap: var(--kw-space-md);
    margin-bottom: var(--kw-space-sm);
}

.comment-author .avatar {
    border-radius: 50%;
    box-shadow: var(--kw-shadow-sm);
}

.comment-author .fn {
    font-weight: 600;
    color: var(--kw-primary);
}

.comment-meta {
    font-size: 0.85rem;
    color: var(--kw-text-muted);
    margin-bottom: var(--kw-space-sm);
}

.reply a {
    background: var(--kw-accent);
    color: white;
    padding: var(--kw-space-xs) var(--kw-space-md);
    border-radius: var(--kw-radius-sm);
    font-size: 0.85rem;
    transition: background var(--kw-transition-fast);
}

.reply a:hover {
    background: var(--kw-accent-light);
}

/* Comment Form */
#respond {
    background: white;
    padding: var(--kw-space-xl);
    border-radius: var(--kw-radius-md);
    box-shadow: var(--kw-shadow-sm);
}

#respond h3 {
    color: var(--kw-primary);
    margin-bottom: var(--kw-space-lg);
}

#commentform input[type="text"],
#commentform input[type="email"],
#commentform input[type="url"],
#commentform textarea {
    width: 100%;
    padding: var(--kw-space-md);
    border: 2px solid #E0E0E0;
    border-radius: var(--kw-radius-md);
    font-size: 1rem;
    transition: border-color var(--kw-transition-fast);
}

#commentform input:focus,
#commentform textarea:focus {
    outline: none;
    border-color: var(--kw-accent);
}

#commentform textarea {
    min-height: 150px;
    resize: vertical;
}

#commentform label {
    display: block;
    margin-bottom: var(--kw-space-sm);
    color: var(--kw-text);
    font-weight: 500;
}

#commentform .form-submit input {
    background: var(--kw-accent);
    color: white;
    border: none;
    padding: var(--kw-space-md) var(--kw-space-xl);
    border-radius: var(--kw-radius-md);
    cursor: pointer;
    font-size: 1rem;
    transition: background var(--kw-transition-fast);
}

#commentform .form-submit input:hover {
    background: var(--kw-accent-light);
}

/* ============================================
   Pagination
   ============================================ */
#pnavigation {
    text-align: center;
    padding: var(--kw-space-xl) 0;
}

.wp-pagenavi {
    display: inline-flex;
    gap: var(--kw-space-sm);
}

.wp-pagenavi a,
.wp-pagenavi span {
    display: inline-block;
    padding: var(--kw-space-sm) var(--kw-space-md);
    background: white;
    border-radius: var(--kw-radius-md);
    color: var(--kw-text);
    box-shadow: var(--kw-shadow-sm);
    transition: all var(--kw-transition-fast);
}

.wp-pagenavi a:hover {
    background: var(--kw-accent);
    color: white;
}

.wp-pagenavi span.current {
    background: var(--kw-accent);
    color: white;
}

/* ============================================
   404 Page
   ============================================ */
.error-404 {
    text-align: center;
    padding: var(--kw-space-2xl);
}

.error-404 h1 {
    font-size: 8rem;
    color: var(--kw-accent);
    text-shadow: 4px 4px 0 var(--kw-primary);
    margin-bottom: var(--kw-space-md);
}

.error-404 p {
    font-size: 1.2rem;
    color: var(--kw-text-light);
    margin-bottom: var(--kw-space-xl);
}

.error-404 .search-form {
    max-width: 400px;
    margin: 0 auto;
}

/* ============================================
   Utilities
   ============================================ */
.clearfix::after {
    content: '';
    display: table;
    clear: both;
}

.clear {
    clear: both;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bookPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.animate-slide-up {
    animation: slideUp 0.6s ease forwards;
}

/* ============================================
   Responsive Design
   ============================================ */
@media screen and (max-width: 1024px) {
    :root {
        --kw-container-width: 95%;
    }
    
    #shelf {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: var(--kw-space-lg);
    }
    
    .bookcover {
        width: 130px;
        height: 190px;
    }
}

@media screen and (max-width: 768px) {
    html {
        font-size: 15px;
    }
    
    #head {
        flex-direction: column;
        text-align: center;
    }
    
    #blogname {
        width: 100%;
        text-align: center;
    }
    
    #searchform {
        width: 100%;
        justify-content: center;
    }
    
    #searchform input[type="text"] {
        width: 100%;
        max-width: 250px;
    }
    
    .menu-toggle {
        display: block;
        width: 100%;
        margin: var(--kw-space-sm) 0;
    }
    
    #submenu {
        display: none;
    }
    
    #submenu.active {
        display: block;
    }
    
    #submenu ul {
        flex-direction: column;
    }
    
    #submenu ul ul {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.1);
    }
    
    #shelf {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: var(--kw-space-md);
    }
    
    .bookcover {
        width: 110px;
        height: 160px;
    }
    
    .box.size-featured {
        grid-column: span 1;
    }
    
    .bookimg {
        float: none;
        display: block;
        margin: 0 auto var(--kw-space-lg);
        max-width: 200px;
    }
    
    .revbox {
        flex-direction: column;
    }
    
    .postmeta {
        flex-direction: column;
        gap: var(--kw-space-sm);
    }
}

@media screen and (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    #home-content {
        padding: var(--kw-space-md);
    }
    
    #content {
        padding: var(--kw-space-md);
    }
    
    .post {
        padding: var(--kw-space-lg);
    }
    
    #shelf {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .bookcover {
        width: 100%;
        height: auto;
        aspect-ratio: 2/3;
    }
    
    .title h2 {
        font-size: 1.5rem;
    }
    
    .error-404 h1 {
        font-size: 5rem;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    #botmenu,
    #sidebar,
    #searchform,
    .bottomcover,
    #footer,
    .postmeta {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .post {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
}

/* ============================================
   WordPress Core Styles
   ============================================ */
.wp-caption {
    max-width: 100%;
    background: #F5F5F5;
    padding: var(--kw-space-sm);
    border-radius: var(--kw-radius-sm);
    text-align: center;
}

.wp-caption img {
    max-width: 100%;
    height: auto;
}

.wp-caption-text {
    font-size: 0.85rem;
    color: var(--kw-text-muted);
    margin-top: var(--kw-space-sm);
}

.alignleft {
    float: left;
    margin: 0 var(--kw-space-lg) var(--kw-space-lg) 0;
}

.alignright {
    float: right;
    margin: 0 0 var(--kw-space-lg) var(--kw-space-lg);
}

.aligncenter {
    display: block;
    margin: var(--kw-space-lg) auto;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--kw-space-sm);
}

.gallery-item {
    margin: 0;
}

.gallery-icon img {
    width: 100%;
    height: auto;
    border-radius: var(--kw-radius-sm);
}

/* Sticky Post */
.sticky {
    border-left: 4px solid var(--kw-accent);
    background: linear-gradient(90deg, rgba(210, 105, 30, 0.05) 0%, transparent 100%);
}

/* Page Links */
.page-links {
    margin: var(--kw-space-lg) 0;
    padding: var(--kw-space-md);
    background: #F5F5F5;
    border-radius: var(--kw-radius-md);
}

.page-links a {
    display: inline-block;
    padding: var(--kw-space-xs) var(--kw-space-sm);
    background: var(--kw-accent);
    color: white;
    border-radius: var(--kw-radius-sm);
    margin: 0 var(--kw-space-xs);
}

/* ============================================
   Custom Karen Font Support
   ============================================ */
.karen-text,
.kw-karen-font {
    font-family: var(--kw-font-custom);
}

/* Karen-specific typography adjustments */
[lang="ksw"],
[lang="kar"] {
    font-family: var(--kw-font-custom);
    line-height: 1.8;
    font-size: 1.1em;
}
