/**
 * Binggerr Main CSS
 * Additional main styles beyond style.css
 */

/* =====================================================
   ADDITIONAL MAIN STYLES
   ===================================================== */

/* Header scrolled state */
.site-header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Body loaded state */
body.loaded {
    opacity: 1;
}

/* Image loaded state */
img.loaded {
    opacity: 1;
}

img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Mobile menu open state */
body.menu-open {
    overflow: hidden;
}

/* Submenu styles */
.menu-item.has-submenu {
    position: relative;
}

.submenu-toggle {
    display: none;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
}

.sub-menu,
.children {
    display: none;
}

.menu-item.submenu-open > .sub-menu,
.menu-item.submenu-open > .children {
    display: block;
}

/* Hero section gradient overlay */
.hero-card-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
    pointer-events: none;
}

/* Article card image overlay */
.article-card-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent);
    pointer-events: none;
}

/* Trending card hover */
.trending-card:hover .trending-card-number {
    transform: scale(1.1);
}

.trending-card-number {
    display: inline-block;
    transition: transform 0.2s ease;
}

/* Popular post hover effect */
.popular-post-item {
    transition: transform 0.2s ease;
}

.popular-post-item:hover {
    transform: translateX(4px);
}

.popular-post-title a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Category badge animation */
.category-badge {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.article-card:hover .category-badge {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Pagination hover */
.pagination a:hover {
    transform: translateY(-2px);
}

.pagination .current {
    cursor: default;
}

.pagination .current:hover {
    transform: none;
}

/* Single post reading progress */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--binggerr-primary), var(--binggerr-accent));
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Post tags hover */
.post-tags a {
    transition: all 0.2s ease;
}

.post-tags a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Post navigation hover */
.post-navigation a {
    transition: all 0.2s ease;
}

.post-navigation a:hover {
    background: var(--binggerr-surface-2);
    border-radius: var(--radius-md);
}

.nav-title {
    display: block;
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Comment styles */
.comment {
    transition: border-color 0.2s ease;
}

.comment:hover {
    border-color: var(--binggerr-border-light);
}

.comment-respond {
    transition: box-shadow 0.2s ease;
}

.comment-respond:focus-within {
    box-shadow: 0 0 0 2px var(--binggerr-primary);
}

/* Search widget focus */
.search-widget input:focus {
    border-color: var(--binggerr-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Newsletter form states */
.newsletter-widget input:focus {
    border-color: var(--binggerr-primary);
    outline: none;
}

.newsletter-widget button {
    transition: all 0.2s ease;
}

.newsletter-widget button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Social links hover */
.social-links-list a {
    transition: all 0.2s ease;
}

.social-links-list a:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Footer hover effects */
.footer-col a {
    transition: all 0.2s ease;
    display: inline-block;
}

.footer-col a:hover {
    transform: translateX(4px);
}

/* Footer social hover */
.footer-socials a {
    transition: all 0.2s ease;
}

.footer-socials a:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

/* Error 404 animation */
.error-404 h1 {
    animation: fadeInUp 0.6s ease;
}

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

/* Archive header animation */
.archive-header,
.search-header {
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Article card animation - staggered */
.articles-grid .article-card {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.articles-grid .article-card:nth-child(1) { animation-delay: 0.1s; }
.articles-grid .article-card:nth-child(2) { animation-delay: 0.15s; }
.articles-grid .article-card:nth-child(3) { animation-delay: 0.2s; }
.articles-grid .article-card:nth-child(4) { animation-delay: 0.25s; }
.articles-grid .article-card:nth-child(5) { animation-delay: 0.3s; }
.articles-grid .article-card:nth-child(6) { animation-delay: 0.35s; }

/* Related posts animation */
.related-posts-grid .article-card {
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.related-posts-grid .article-card:nth-child(1) { animation-delay: 0.1s; }
.related-posts-grid .article-card:nth-child(2) { animation-delay: 0.2s; }
.related-posts-grid .article-card:nth-child(3) { animation-delay: 0.3s; }

/* Trending cards animation */
.trending-grid .trending-card {
    opacity: 0;
    animation: fadeInUp 0.4s ease forwards;
}

.trending-grid .trending-card:nth-child(1) { animation-delay: 0.05s; }
.trending-grid .trending-card:nth-child(2) { animation-delay: 0.1s; }
.trending-grid .trending-card:nth-child(3) { animation-delay: 0.15s; }
.trending-grid .trending-card:nth-child(4) { animation-delay: 0.2s; }

/* Focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--binggerr-primary);
    outline-offset: 2px;
}

/* Custom selection */
::selection {
    background: var(--binggerr-primary);
    color: white;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --binggerr-border: rgba(255, 255, 255, 0.2);
        --binggerr-border-light: rgba(255, 255, 255, 0.3);
    }

    .article-card,
    .hero-card,
    .trending-card,
    .sidebar-widget {
        border-width: 2px;
    }
}