/*
Theme Name: City Library
Author: Амброзиев Олег
Description: A modern, responsive WordPress theme for a city library, based on a Tailwind CSS design reference.
Version: 1.2
Text Domain: city-library
*/

/* ============================================================
   RESET & GLOBAL
   ============================================================ */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ============================================================
   NEWS CARD COLORS — Mobile (overlay white) vs Desktop (theme)
   Consolidated from previously duplicated media queries
   ============================================================ */
@media (max-width: 1023px) {
    .news-card-title-link,
    .news-card-title-link *,
    .news-card-excerpt-text,
    .news-card-excerpt-text *,
    .news-card-link,
    .news-card-link *,
    .news-card-content-wrapper .lg\:hidden,
    .news-card-content-wrapper .lg\:hidden * {
        color: white !important;
        text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    }
    .news-card-content-wrapper,
    .news-card-content-wrapper p,
    .news-card-content-wrapper span,
    .news-card-content-wrapper a,
    .news-card-content-wrapper div {
        color: white !important;
    }
}

@media (min-width: 1024px) {
    .news-card-title-link {
        color: var(--title-color, #0f172a) !important;
        text-shadow: none;
    }
    .news-card-excerpt-text {
        color: var(--text-color, #334155) !important;
        text-shadow: none;
    }
    .news-card-excerpt-text p {
        color: inherit !important;
    }
    .news-card-link {
        color: var(--link-color, #0b7930) !important;
        text-shadow: none;
    }
}

.news-card-excerpt-text p {
    color: inherit !important;
}

/* ============================================================
   FIREFOX COMPATIBILITY — Using @supports instead of deprecated @-moz-document
   ============================================================ */
@supports (-moz-appearance: none) {
    .news-card-content-wrapper,
    .news-card-title-link,
    .news-card-excerpt-text,
    .news-card-link {
        visibility: visible !important;
        opacity: 1 !important;
        filter: none !important;
    }

    article.group,
    article.group .animate-on-scroll {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }

    article.group {
        overflow: hidden !important;
        isolation: isolate !important;
        background-clip: border-box !important;
        perspective: 1000px;
        transform-style: preserve-3d !important;
        backface-visibility: hidden !important;
    }

    .news-card-title-link,
    .news-card-excerpt-text,
    .news-card-link,
    .news-card-content-wrapper,
    .news-card-content-wrapper * {
        text-shadow: none !important;
        filter: none !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .news-card-image-container {
        z-index: 1 !important;
        transform: translate3d(0, 0, 0) !important;
    }
    .news-card-content-wrapper {
        z-index: 50 !important;
        position: relative !important;
        transform: translate3d(0, 0, 50px) !important;
        backface-visibility: visible !important;
        will-change: transform, opacity;
        pointer-events: auto !important;
    }

    .news-card-title-link,
    .news-card-excerpt-text,
    .news-card-link {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .line-clamp-3 {
        display: -webkit-box !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
    }
}

/* ============================================================
   SCROLL ANIMATIONS
   ============================================================ */
.animate-on-scroll {
    opacity: 0;
    will-change: opacity, transform, filter;
    transition-duration: 0.7s;
    transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
    transition-property: opacity, transform, filter;
}

.aos-fade-up { transform: translate3d(0, 30px, 0); }
.aos-fade-up.aos-animate { opacity: 1; transform: translate3d(0, 0, 0); }
.aos-fade-down { transform: translate3d(0, -30px, 0); }
.aos-fade-down.aos-animate { opacity: 1; transform: translate3d(0, 0, 0); }
.aos-fade-left { transform: translate3d(30px, 0, 0); }
.aos-fade-left.aos-animate { opacity: 1; transform: translate3d(0, 0, 0); }
.aos-fade-right { transform: translate3d(-30px, 0, 0); }
.aos-fade-right.aos-animate { opacity: 1; transform: translate3d(0, 0, 0); }
.aos-zoom-in { transform: scale(0.95); }
.aos-zoom-in.aos-animate { opacity: 1; transform: scale(1); }
.aos-zoom-out { transform: scale(1.05); }
.aos-zoom-out.aos-animate { opacity: 1; transform: scale(1); }
.aos-flip-up { transform: perspective(2500px) rotateX(100deg); }
.aos-flip-up.aos-animate { opacity: 1; transform: perspective(2500px) rotateX(0); }
.aos-slide-up { transform: translate3d(0, 80%, 0); }
.aos-slide-up.aos-animate { opacity: 1; transform: translate3d(0, 0, 0); transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1); }
.aos-blur-in { filter: blur(16px); transform: scale(1.1); }
.aos-blur-in.aos-animate { opacity: 1; filter: blur(0); transform: scale(1); }
.aos-rotate-in { transform: rotate(-12deg) scale(0.9); transform-origin: center; }
.aos-rotate-in.aos-animate { opacity: 1; transform: rotate(0) scale(1); }

.aos-stagger > .animate-on-scroll:nth-child(1) { transition-delay: 0s; }
.aos-stagger > .animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.aos-stagger > .animate-on-scroll:nth-child(3) { transition-delay: 0.2s; }
.aos-stagger > .animate-on-scroll:nth-child(4) { transition-delay: 0.3s; }
.aos-stagger > .animate-on-scroll:nth-child(5) { transition-delay: 0.4s; }
.aos-stagger > .animate-on-scroll:nth-child(6) { transition-delay: 0.5s; }
.aos-stagger > .animate-on-scroll:nth-child(7) { transition-delay: 0.6s; }
.aos-stagger > .animate-on-scroll:nth-child(8) { transition-delay: 0.7s; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translate3d(0, 40px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}
.animate-fade-in-up { animation-name: fadeInUp; animation-duration: 0.8s; animation-fill-mode: both; }
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

/* ============================================================
   BACKGROUND PATTERNS
   ============================================================ */
.bg-pattern-slate {
    background-image: url('data:image/svg+xml,%3Csvg width=%2752%27 height=%2726%27 viewBox=%270 0 52 26%27 xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cg fill=%27none%27 fill-rule=%27evenodd%27%3E%3Cg fill=%27%239C92AC%27 fill-opacity=%270.1%27%3E%3Cpath d=%27M10 10c0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6h2c0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4v2c-3.314 0-6-2.686-6-6 0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6zm25.464-1.95l8.486 8.486-1.414 1.414-8.486-8.486 1.414-1.414z%27 /%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
}
.bg-pattern-white {
    background-image: url('data:image/svg+xml,%3Csvg width=%2752%27 height=%2726%27 viewBox=%270 0 52 26%27 xmlns=%27http://www.w3.org/2000/svg%27%3E%3Cg fill=%27none%27 fill-rule=%27evenodd%27%3E%3Cg fill=%27%23ffffff%27 fill-opacity=%270.05%27%3E%3Cpath d=%27M10 10c0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6h2c0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4 3.314 0 6 2.686 6 6 0 2.21 1.79 4 4 4v2c-3.314 0-6-2.686-6-6 0-2.21-1.79-4-4-4-3.314 0-6-2.686-6-6zm25.464-1.95l8.486 8.486-1.414 1.414-8.486-8.486 1.414-1.414z%27 /%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.prose { max-width: 100%; }
.prose p, .prose li { line-height: 1.8; margin-bottom: 1.5rem; }
.prose ul, .prose ol { margin-bottom: 1.5rem; padding-left: 1.5rem; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin-top: 2.5rem; margin-bottom: 1.25rem; }
.prose img:not(.emoji) { margin-top: 2rem !important; margin-bottom: 2rem !important; }
img.emoji { display: inline !important; border: none !important; box-shadow: none !important; height: 1em !important; width: 1em !important; margin: 0 .07em !important; vertical-align: -0.1em !important; background: none !important; padding: 0 !important; border-radius: 0 !important; }
.prose blockquote { font-style: italic; margin-top: 2rem; margin-bottom: 2rem; border-left-width: 4px; border-left-color: var(--primary-color, #0b7930) !important; background-color: #f8fafc; padding: 1.5rem !important; border-radius: 0 1rem 1rem 0; }

/* Gutenberg Alignment */
.prose .alignwide { margin-left: -10vw; margin-right: -10vw; max-width: 120%; width: auto; }
.prose .alignfull { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); max-width: 100vw; width: 100vw; }
@media (max-width: 1023px) { .prose .alignwide, .prose .alignfull { margin-left: 0; margin-right: 0; max-width: 100%; width: 100%; } }
.prose .wp-block-image.alignwide, .prose .wp-block-gallery.alignwide { margin-left: calc(50% - 50vw + 10%); margin-right: calc(50% - 50vw + 10%); max-width: 80vw; width: 80vw; }
.prose .wp-block-image.alignfull, .prose .wp-block-gallery.alignfull { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); max-width: 100vw; width: 100vw; }
.prose img { height: auto !important; }
.prose figure { margin-left: 0; margin-right: 0; }
@media (min-width: 1024px) { .prose .wp-block-image.alignleft { float: left; margin-right: 2rem; margin-bottom: 1.5rem; } .prose .wp-block-image.alignright { float: right; margin-left: 2rem; margin-bottom: 1.5rem; } }
.prose ul { list-style-type: disc !important; padding-left: 1.5rem !important; }
.prose ol { list-style-type: decimal !important; padding-left: 1.5rem !important; }
.prose figure { margin-top: 2rem !important; margin-bottom: 2rem !important; }
.prose figcaption { text-align: center; font-size: 0.875rem; color: #64748b; margin-top: 0.75rem; }

/* ============================================================
   ENTRY CONTENT
   ============================================================ */
.entry-content p, .entry-content li, .news-content p, .news-content li { color: #334155; line-height: 1.85 !important; margin-bottom: 1.75rem !important; }
.entry-content > *, .news-content > * { margin-bottom: 1.75rem !important; }
.entry-content > *:last-child, .news-content > *:last-child { margin-bottom: 0 !important; }
.entry-content h1, .entry-content h2, .entry-content h3, .entry-content h4 { margin-top: 2rem; margin-bottom: 1rem; line-height: 1.3; }
.entry-content blockquote, .news-content blockquote { border-left: 6px solid var(--primary-color, #0b7930) !important; padding: 2.5rem 3rem !important; font-style: italic; color: #334155; margin: 3.5rem 0 !important; background-color: #f8fafc; border-radius: 0 2rem 2rem 0; font-size: 1.25rem; line-height: 1.75; position: relative; overflow: hidden; }
.entry-content blockquote::before, .news-content blockquote::before { content: '\201c'; position: absolute; top: -1rem; left: 1rem; font-size: 8rem; color: var(--primary-color, #0b7930); opacity: 0.1; font-family: serif; pointer-events: none; }
.entry-content ul, .entry-content ol { margin-bottom: 1.5rem; padding-left: 2rem; }
.entry-content ul { list-style-type: disc; }
.entry-content ol { list-style-type: decimal; }
.entry-content img, .news-content img, .entry-content iframe, .news-content iframe, .entry-content video, .news-content video { max-width: 100% !important; height: auto !important; border-radius: 0.75rem; box-sizing: border-box; }

/* LearningApps iframe — removed broken attr() CSS */
.entry-content iframe[src*="learningapps.org"] { min-height: 400px; }

.entry-content figure { max-width: 100% !important; margin-left: 0; margin-right: 0; margin-bottom: 1.5rem; }
.entry-content figure img { margin-bottom: 0.5rem; }
@media (min-width: 1024px) { .entry-content .wp-block-video, .entry-content video { max-width: 100% !important; width: auto; height: auto; } .entry-content .wp-block-video.aligncenter { margin-left: auto; margin-right: auto; display: block; text-align: center; } .entry-content .wp-block-video.aligncenter video { margin: 0 auto; } }
.entry-content { overflow-wrap: anywhere; word-break: break-word; hyphens: auto; max-width: 100%; }

/* AI Chat Prose */
#ai-chat-messages .prose p, #voice-ai-answer-text.prose p { margin-bottom: 0.5rem; }
#ai-chat-messages .prose p:last-child, #voice-ai-answer-text.prose p:last-child { margin-bottom: 0; }
#ai-chat-messages .prose a, #voice-ai-answer-text.prose a { color: var(--primary-color, #0b7930); text-decoration: underline; font-weight: 500; }
#ai-chat-messages .prose ul, #voice-ai-answer-text.prose ul { list-style-type: disc; margin-left: 1.25rem; margin-bottom: 0.5rem; }
#ai-chat-messages .prose ol, #voice-ai-answer-text.prose ol { list-style-type: decimal; margin-left: 1.25rem; margin-bottom: 0.5rem; }
#ai-chat-messages .prose li, #voice-ai-answer-text.prose li { margin-bottom: 0.25rem; }
#ai-chat-messages .prose img, #voice-ai-answer-text.prose img { width: 100%; border-radius: 0.75rem; margin-top: 0.5rem; margin-bottom: 0.5rem; border: 1px solid #e2e8f0; }

/* WordPress Alignment */
.aligncenter, .wp-block-image.aligncenter, .wp-block-video.aligncenter, .wp-block-embed.aligncenter, .news-content .aligncenter, .prose .aligncenter { display: block !important; margin-left: auto !important; margin-right: auto !important; clear: both; text-align: center; }
.alignleft, .wp-block-image.alignleft, .wp-block-video.alignleft, .wp-block-embed.alignleft, .news-content .alignleft { float: left; margin-right: 1.5rem !important; margin-bottom: 1.5rem !important; }
.alignright, .wp-block-image.alignright, .wp-block-video.alignright, .wp-block-embed.alignright, .news-content .alignright { float: right; margin-left: 1.5rem !important; margin-bottom: 1.5rem !important; }
@media (max-width: 640px) { .alignleft, .wp-block-image.alignleft, .wp-block-video.alignleft, .wp-block-embed.alignleft, .alignright, .wp-block-image.alignright, .wp-block-video.alignright, .wp-block-embed.alignright { float: none !important; margin-left: auto !important; margin-right: auto !important; display: block !important; width: 100% !important; text-align: center; } }
.alignnone { float: none; margin-bottom: 1.5rem !important; }
.wp-caption { max-width: 100%; }
.wp-caption-text { text-align: center; font-size: 0.875rem; color: #64748b; margin-top: 0.5rem; }
.entry-content pre, .entry-content code { white-space: pre-wrap; word-break: break-all; max-width: 100%; overflow-x: auto; }
.entry-content table { display: block; max-width: 100%; overflow-x: auto; white-space: normal; border-collapse: collapse; margin-bottom: 1.5rem; }
@media (min-width: 768px) { .entry-content table { display: table; width: 100%; } }
.entry-content th, .entry-content td { padding: 0.75rem; border: 1px solid #e2e8f0; text-align: left; }
.entry-content th { background-color: #f8fafc; font-weight: 700; }
h1, h2, h3, h4, h5, h6 { color: #0f172a; letter-spacing: -0.02em; }
.text-sm { line-height: 1.6; }

/* Block Editor Buttons */
.wp-block-button__link { background-color: var(--btn-bg, #0b7930) !important; color: var(--btn-text, #ffffff) !important; border-radius: 9999px; padding: 0.75rem 1.5rem; font-weight: 700; text-decoration: none; transition: all 0.3s ease; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06); display: inline-block; max-width: 100%; overflow-wrap: break-word; text-align: center; line-height: 1.25; }
.wp-block-button__link:hover { background-color: var(--btn-hover-bg, #096328) !important; color: var(--btn-hover-text, #ffffff) !important; transform: scale(1.05); }

/* Accessibility */
:focus-visible { outline: 2px solid var(--primary-color, #0b7930) !important; outline-offset: 2px !important; box-shadow: 0 0 0 4px rgba(11, 121, 48, 0.2) !important; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--primary-color, #0b7930) !important; outline-offset: 2px !important; }

/* Scrollbars */
.custom-scrollbar::-webkit-scrollbar { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background-color: rgba(156, 163, 175, 0.5); border-radius: 20px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background-color: rgba(107, 114, 128, 0.8); }
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* AI Sidebar */
#ai-chat-sidebar .ai-quick-action-btn { transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); }
#ai-chat-sidebar .ai-quick-action-btn:hover { transform: translateX(4px); }
#ai-chat-sidebar .ai-quick-action-btn:active { transform: scale(0.98); }
#ai-chat-messages .prose { max-width: none; color: #334155; }
#ai-chat-messages .prose h1, #ai-chat-messages .prose h2, #ai-chat-messages .prose h3 { color: #1e293b; font-weight: 700; margin-top: 1.5rem; margin-bottom: 0.75rem; }
#ai-chat-messages .prose strong { color: #0f172a; font-weight: 700; }
#ai-chat-messages .prose blockquote { border-left-color: #cbd5e1; background-color: #f1f5f9; font-style: normal; color: #475569; }

@keyframes pulse-soft { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.1); opacity: 0.8; } }
.ai-notification-dot { animation: pulse-soft 2s infinite; }

/* ============================================================
   AAA PRODUCTION ENHANCEMENTS
   ============================================================ */

/* Glassmorphism */
.glass { background: rgba(255,255,255,0.6); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,0.2); }
.glass-dark { background: rgba(15,23,42,0.6); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,0.1); }
.glass-strong { background: rgba(255,255,255,0.85); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border: 1px solid rgba(255,255,255,0.3); }

/* Premium Selection */
::selection { background: rgba(11, 121, 48, 0.2); color: #0f172a; }

/* Link Transitions */
a { transition: color 0.2s ease, background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease; }

/* Back to Top */
#back-to-top { opacity: 0; transform: translateY(20px); transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.2s ease; }
#back-to-top.show { opacity: 1; transform: translateY(0); }
@media (max-width: 640px) { #back-to-top { bottom: 6rem; right: 1rem; width: 3rem; height: 3rem; } }

/* Footer Responsiveness */
@media (max-width: 768px) { footer .max-w-\[80\%\] { max-width: 95% !important; } .footer-column { width: 100% !important; } }

/* New Footer Grid Layout */
.site-footer {
    padding: 4rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr;
    gap: 2rem;
    max-width: 90%;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.footer-logo .logo-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: inherit;
}

.footer-logo img {
    height: 36px;
    width: auto;
}

.footer-desc {
    font-size: 0.875rem;
    line-height: 1.6;
    opacity: 0.8;
}

.footer-social {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 0.75rem;
    background: rgba(255,255,255,0.1);
    transition: all 0.2s ease;
}

.footer-social a:hover {
    background: var(--color-primary, #0b7930);
    transform: translateY(-2px);
}

.footer-col {
    display: flex;
    flex-direction: column;
}

.footer-col h4 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.footer-links li {
    margin-bottom: 0.5rem;
    width: auto;
}

.footer-links a,
.footer-links span {
    font-size: 0.875rem;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    display: block;
    text-decoration: none;
    white-space: normal;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--color-primary, #0b7930);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    max-width: 90%;
    margin: 3rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.75rem;
    opacity: 0.7;
}

/* Footer Responsive */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 95%;
    }
}

@media (max-width: 768px) {
    .site-footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
        gap: 2rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
        max-width: 100%;
    }
}

/* Mobile Tap Targets */
@media (max-width: 640px) { button, a, input, select, textarea { cursor: pointer; } }

/* Image Loading */
img { transition: opacity 0.3s ease, transform 0.3s ease; }

/* Responsive Spacing */
@media (max-width: 640px) { .entry-content { padding-left: 1rem; padding-right: 1rem; font-size: 1.0625rem; } .prose { padding-left: 0.5rem; padding-right: 0.5rem; } .prose blockquote { margin-left: -0.5rem; margin-right: -0.5rem; border-radius: 0; padding: 1.5rem !important; } }

/* Card Equal Height */
.card-equal-height { display: flex; flex-direction: column; height: 100%; }
.card-equal-height .card-body { flex: 1; display: flex; flex-direction: column; }
.card-equal-height .card-body > :last-child { margin-top: auto; }

/* Premium Hover Lift */
.hover-lift { transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease; }
.hover-lift:hover { transform: translateY(-6px); box-shadow: 0 20px 50px rgba(0,0,0,0.12), 0 8px 20px rgba(0,0,0,0.06); }
.hover-lift:active { transform: translateY(-2px); }

/* Focus Ring */
.focus-ring { transition: outline 0.15s ease, outline-offset 0.15s ease; }

/* Remove Tap Highlight */
* { -webkit-tap-highlight-color: transparent; }

/* Swiper Caption */
.swiper-slide-active .slide-caption { animation: fadeInUp 0.6s ease forwards; }

/* Font Weights */
.font-thin { font-weight: 100; } .font-extralight { font-weight: 200; } .font-light { font-weight: 300; }
.font-normal { font-weight: 400; } .font-medium { font-weight: 500; } .font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; } .font-extrabold { font-weight: 800; } .font-black { font-weight: 900; }

/* ============================================================
   AAA DESIGN — Premium Additions
   ============================================================ */

/* Hero Parallax Depth Effect */
.hero-gradient { position: relative; }
.hero-gradient::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 120px; background: linear-gradient(to top, var(--bg-body, #f6f8f6), transparent); pointer-events: none; z-index: 5; }

/* Animated Gradient for 404 */
@keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
.text-gradient-animated { background: linear-gradient(270deg, var(--primary-color, #0b7930), #d4af37, #0ea5e9, var(--primary-color, #0b7930)); background-size: 300% 300%; -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; animation: gradientShift 6s ease infinite; }

/* Button Glow */
.btn-glow { position: relative; overflow: hidden; }
.btn-glow::before { content: ''; position: absolute; inset: -2px; background: linear-gradient(45deg, var(--primary-color, #0b7930), #d4af37, var(--primary-color, #0b7930)); border-radius: inherit; opacity: 0; transition: opacity 0.4s ease; z-index: -1; filter: blur(12px); }
.btn-glow:hover::before { opacity: 0.6; }

/* Post Navigation */
.post-navigation-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid #e2e8f0; }
.post-navigation-wrapper .nav-link { display: flex; flex-direction: column; padding: 1.5rem; background: #f8fafc; border-radius: 1rem; border: 1px solid #e2e8f0; transition: all 0.3s ease; text-decoration: none; color: inherit; }
.post-navigation-wrapper .nav-link:hover { background: #fff; border-color: var(--primary-color, #0b7930); box-shadow: 0 8px 25px rgba(0,0,0,0.08); transform: translateY(-2px); }
.post-navigation-wrapper .nav-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--primary-color, #0b7930); margin-bottom: 0.5rem; }
.post-navigation-wrapper .nav-title { font-size: 0.95rem; font-weight: 600; color: #1e293b; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-navigation-wrapper .nav-next { text-align: right; }
@media (max-width: 640px) { .post-navigation-wrapper { grid-template-columns: 1fr; } }

/* Breadcrumbs */
.breadcrumbs-wrapper { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; font-size: 0.8rem; color: #94a3b8; margin-bottom: 1.5rem; }
.breadcrumbs-wrapper a { color: #64748b; text-decoration: none; transition: color 0.2s ease; }
.breadcrumbs-wrapper a:hover { color: var(--primary-color, #0b7930); }
.breadcrumbs-wrapper .separator { color: #cbd5e1; }
.breadcrumbs-wrapper .current { color: #334155; font-weight: 600; }

/* Floating Shapes */
@keyframes float { 0%, 100% { transform: translateY(0px) rotate(0deg); } 33% { transform: translateY(-15px) rotate(2deg); } 66% { transform: translateY(-8px) rotate(-1deg); } }
.float-animation { animation: float 8s ease-in-out infinite; }
.float-animation-delayed { animation: float 8s ease-in-out 3s infinite; }

/* ============================================================
   MENU STYLES (Moved from header.php)
   ============================================================ */
.menu-style-underline a { position: relative; }
.menu-style-underline a::after { content: ''; position: absolute; bottom: -2px; left: 0; width: 0; height: 2px; background: currentColor; transition: width 0.3s; }
.menu-style-underline a:hover::after { width: 100%; }

.menu-style-pill a { padding: 0.5rem 1rem; border-radius: 9999px; transition: background 0.3s, color 0.3s; }
.menu-style-pill a:hover { background: var(--primary-color, #0b7930); color: white !important; }

.menu-style-bracket a::before { content: '['; opacity: 0; margin-right: 5px; transition: opacity 0.3s, transform 0.3s; transform: translateX(5px); }
.menu-style-bracket a::after { content: ']'; opacity: 0; margin-left: 5px; transition: opacity 0.3s, transform 0.3s; transform: translateX(-5px); }
.menu-style-bracket a:hover::before, .menu-style-bracket a:hover::after { opacity: 1; transform: translateX(0); }

.menu-style-bold a:hover { font-weight: 800; }

/* ============================================================
   PREMIUM MICRO-ANIMATIONS
   ============================================================ */
.news-card-image-container img {
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
article.group:hover .news-card-image-container img {
    transform: scale(1.05);
}
.premium-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.premium-hover:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.1), 0 10px 20px -5px rgba(0, 0, 0, 0.04);
}

/* ============================================================
   NEWS CARD WIDTH REDUCTION (10px total: 5px left + 5px right)
   ============================================================ */
.swiper-slide > article.group {
    margin-left: 5px;
    margin-right: 5px;
}

/* ============================================================
   PREMIUM DESIGN — Inspired by LitRes Reference
   ============================================================ */

/* Card Refined Shadows & Radius */
article.group {
    border-radius: 1.25rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.6);
}
article.group:hover {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.04);
}

/* Content Area Card */
.content-area {
    box-shadow: 0 8px 32px rgba(27, 58, 107, 0.08) !important;
    border: 1px solid rgba(226, 232, 240, 0.5) !important;
}

/* Featured Icon Badges (for section-important icons and similar) */
.icon-badge {
    width: 3.5rem;
    height: 3.5rem;
    background: linear-gradient(135deg, rgba(11, 121, 48, 0.08) 0%, rgba(11, 121, 48, 0.04) 100%);
    border-radius: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.icon-badge:hover {
    background: linear-gradient(135deg, rgba(11, 121, 48, 0.15) 0%, rgba(11, 121, 48, 0.08) 100%);
    transform: scale(1.05);
}

/* Input Fields — Refined */
.entry-content input[type="text"],
.entry-content input[type="email"],
.entry-content input[type="password"],
.entry-content input[type="search"],
.entry-content textarea,
.entry-content select {
    border: 1.5px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    background: #f7fafc;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
    width: 100%;
}
.entry-content input[type="text"]:focus,
.entry-content input[type="email"]:focus,
.entry-content input[type="password"]:focus,
.entry-content input[type="search"]:focus,
.entry-content textarea:focus,
.entry-content select:focus {
    border-color: var(--primary-color, #0b7930);
    box-shadow: 0 0 0 3px rgba(11, 121, 48, 0.1);
    background: #ffffff;
}

/* Submit Buttons — Orange Accent (from reference) */
.entry-content input[type="submit"],
.entry-content button[type="submit"] {
    background: linear-gradient(135deg, #FF6B00, #FF4500);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    padding: 0.875rem 2rem;
    font-weight: 700;
    font-size: 0.9375rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255, 107, 0, 0.35);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.entry-content input[type="submit"]:hover,
.entry-content button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 107, 0, 0.5);
}
.entry-content input[type="submit"]:active,
.entry-content button[type="submit"]:active {
    transform: translateY(0);
}

/* Section Headings — Refined Typography */
.content-area h2 {
    letter-spacing: -0.03em;
}

/* Footer Benefits Bar Style */
.benefits-bar {
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 1.25rem 2rem;
}
.benefits-bar .benefit-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.benefits-bar .benefit-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: linear-gradient(135deg, rgba(27, 58, 107, 0.08), rgba(27, 58, 107, 0.03));
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color, #0b7930);
}

/* Dashed Help Button Style (from reference) */
.help-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.375rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary-color, #0b7930);
    background: rgba(11, 121, 48, 0.04);
    border: 1.5px dashed rgba(11, 121, 48, 0.25);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}
.help-link:hover {
    background: rgba(11, 121, 48, 0.08);
    border-color: var(--primary-color, #0b7930);
    transform: translateY(-2px);
}

/* ============================================================
   GENERAL VISUAL & TYPOGRAPHY IMPROVEMENTS (PC & Mobile)
   ============================================================ */

/* Typography Optimization */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.15;
}

@media (max-width: 768px) {
    body {
        font-size: 15px; /* Slightly larger base text on mobile */
        line-height: 1.6;
    }
    
    h1 { font-size: 2.25rem !important; }
    h2 { font-size: 1.75rem !important; }
    h3 { font-size: 1.5rem !important; }
    
    /* Better Section Paddings for Mobile */
    section {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    .content-area {
        padding: 1.5rem !important;
        border-radius: 1.5rem !important;
    }
}

/* Back to Top Button Premium Design */
#back-to-top {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    color: var(--primary-color, #0b7930);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 90;
}

#back-to-top:hover {
    background: linear-gradient(135deg, var(--primary-color, #0b7930), #096026);
    color: #ffffff;
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 25px rgba(11, 121, 48, 0.3);
    border-color: transparent;
}

#back-to-top:active {
    transform: translateY(-2px) scale(0.95);
}

/* ============================================================
   HEADER & NAVIGATION
   ============================================================ */

/* Header logo area - smooth reveal on scroll */
#site-identity {
    transition: max-width 0.5s ease, opacity 0.5s ease, padding 0.5s ease;
}

/* Header scroll state - applied by JS */
body.scrolled #site-identity {
    max-width: 120px !important;
}

/* Menu item active state */
.current-menu-item > a,
.current_page_item > a,
.current-menu-ancestor > a {
    color: #0b7930 !important;
    background-color: #f0fdf4 !important;
}

/* Ensure header nav never wraps */
header nav ul {
    flex-wrap: nowrap !important;
}

/* Desktop nav: show (override hidden from Tailwind) */
@media (min-width: 1024px) and (orientation: landscape) {
    header nav {
        display: flex !important;
    }
}

/* Desktop dropdowns: pure CSS */
@media (min-width: 1024px) and (orientation: landscape) {
    header nav li {
        position: relative !important;
    }
    header nav .submenu {
        display: block !important;
        position: absolute !important;
        top: 100% !important;
        left: 50% !important;
        transform: translateX(-50%) translateY(4px) !important;
        min-width: 220px !important;
        background: #fff !important;
        box-shadow: 0 10px 40px rgba(0,0,0,0.12) !important;
        border-radius: 0.75rem !important;
        border: 1px solid #f1f5f9 !important;
        padding: 0.5rem !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease !important;
        z-index: 50 !important;
    }
    header nav li:hover > .submenu {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateX(-50%) translateY(0) !important;
    }
    /* Arrow rotation */
    header nav li.has-children > div > .material-symbols-outlined:last-child {
        transition: transform 0.2s ease !important;
    }
    header nav li.has-children:hover > div > .material-symbols-outlined:last-child {
        transform: rotate(180deg) !important;
    }
}

/* ============================================================
   ACCESSIBILITY MODE OVERRIDES
   ============================================================ */
/* Header: static position so expanded menu pushes content down */
body.a11y-active #masthead {
    position: static !important;
    display: block !important;
    height: auto !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
/* Show header nav on all screens in a11y mode */
body.a11y-active header nav {
    display: flex !important;
    position: static !important;
    width: 100% !important;
    overflow: visible !important;
}
body.a11y-active header nav ul {
    flex-wrap: wrap !important;
    display: flex !important;
    justify-content: flex-start !important;
    gap: 1rem !important;
}
body.a11y-active header nav li {
    position: static !important;
}
/* Inner flex container wraps */
body.a11y-active #masthead > div > div {
    flex-wrap: wrap !important;
    gap: 1rem !important;
}
/* Hide mobile menu toggle in a11y mode (nav is always visible) */
body.a11y-active .mobile-menu-toggle-btn {
    display: none !important;
}
/* Make all submenus flat and visible */
body.a11y-active header nav .submenu {
    display: block !important;
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    box-shadow: none !important;
    padding-left: 1rem !important;
    border-left: 2px solid var(--a11y-border, #000) !important;
    margin-top: 0.5rem !important;
    background: transparent !important;
    border-radius: 0 !important;
    min-width: 0 !important;
    width: 100% !important;
}
/* Arrow icon hiding */
body.a11y-active nav li.has-children > div > .material-symbols-outlined:last-child {
    display: none !important;
}
/* Ensure links are inline for proper wrapping */
body.a11y-active header nav li,
body.a11y-active header nav li > div {
    display: inline-flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
}
body.a11y-active header nav a {
    display: inline !important;
    padding: 0.25rem 0.5rem !important;
    background: transparent !important;
    border-radius: 0 !important;
}
body.a11y-active header nav a:hover {
    background: transparent !important;
}
/* Hide mobile overlay menu in a11y mode */
body.a11y-active #mobile-menu {
    display: none !important;
}

/* News cards on mobile: match afisha style */
@media (max-width: 639px) {
    .news-slider .swiper-slide article {
        aspect-ratio: 3 / 4 !important;
    }
}


