/* ============================================
   TORLYAI BLOG REDESIGN - ENHANCED STYLES
   ============================================

   Replace the <style> block in archive.php (lines 142-403)
   with these enhanced styles that better follow the
   TorlyAI Design System.

   Key Enhancements:
   - Glass-morphism category pills with gradients
   - Gradient border accents on hover
   - Featured post spotlight
   - Enhanced visual hierarchy
   - Better color integration (yellow/green/orange)
   ============================================ */

.archive-page,
.blog-index {
    padding: 0;
    background: var(--white);
    background-image:
        radial-gradient(at 30% 20%, hsla(60,100%,50%,0.25) 0px, transparent 50%),
        radial-gradient(at 70% 70%, hsla(108,100%,50%,0.2) 0px, transparent 50%),
        radial-gradient(at 50% 90%, hsla(30,100%,50%,0.15) 0px, transparent 50%);
    position: relative;
    overflow: hidden;
}

/* Animated blur orbs for visual interest */
.archive-page::before {
    content: '';
    position: fixed;
    top: -20%;
    right: -15%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle,
        hsla(108,100%,50%,0.15) 0%,
        hsla(60,100%,50%,0.1) 40%,
        transparent 70%);
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
    animation: floatOrb1 30s ease-in-out infinite;
    pointer-events: none;
}

.archive-page::after {
    content: '';
    position: fixed;
    bottom: -15%;
    left: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle,
        hsla(30,100%,50%,0.18) 0%,
        hsla(60,100%,50%,0.08) 40%,
        transparent 70%);
    border-radius: 50%;
    filter: blur(70px);
    z-index: 0;
    animation: floatOrb2 35s ease-in-out infinite;
    pointer-events: none;
}

@keyframes floatOrb1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-100px, 80px) scale(1.2); }
    66% { transform: translate(50px, -50px) scale(0.9); }
}

@keyframes floatOrb2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    40% { transform: translate(80px, -60px) scale(1.15); }
    80% { transform: translate(-50px, 40px) scale(0.85); }
}

/* ============================================
   ARCHIVE HEADER
   ============================================ */

.archive-header {
    text-align: center;
    margin-bottom: 4rem;
    padding: clamp(4rem, 8vw, 6rem) 0 clamp(2rem, 4vw, 3rem);
    position: relative;
    z-index: 1;
}

.archive-type {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--black);

    /* Glass-morphism with gradient */
    background: linear-gradient(135deg,
        hsla(60,100%,50%,0.3) 0%,
        hsla(108,100%,50%,0.3) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    margin-bottom: 1.5rem;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);

    animation: fadeInDown 0.6s ease-out;
}

.archive-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-primary);
    line-height: 0.95;
    letter-spacing: -0.02em;
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.archive-description {
    font-size: clamp(1rem, 2.5vw, 1.125rem);
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

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

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

/* ============================================
   BLOG GRID & CARDS
   ============================================ */

.archive-posts-container {
    padding-bottom: clamp(3rem, 6vw, 5rem);
    position: relative;
    z-index: 1;
}

.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }
}

@media (min-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Enhanced Blog Card with Gradient Border */
.blog-card {
    background: var(--white);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    opacity: 0;
    transform: translateY(20px);
    position: relative;
    border: 2px solid rgba(0, 0, 0, 0.05);
}

/* Gradient border effect on hover */
.blog-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg,
        var(--color-yellow) 0%,
        var(--color-green) 50%,
        var(--color-orange) 100%);
    border-radius: 1rem;
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.blog-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.blog-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.12),
        0 8px 16px rgba(0, 0, 0, 0.08),
        0 0 60px -15px rgba(255, 255, 0, 0.25);
    border-color: transparent;
}

.blog-card:hover::before {
    opacity: 1;
}

/* Thumbnail with overlay gradient */
.blog-thumbnail-link {
    display: block;
    overflow: hidden;
    position: relative;
}

.blog-thumbnail-link::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        transparent 0%,
        transparent 60%,
        rgba(0, 0, 0, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.blog-card:hover .blog-thumbnail-link::after {
    opacity: 1;
}

.blog-thumbnail {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.blog-card:hover .blog-thumbnail {
    transform: scale(1.08);
}

/* ============================================
   BLOG CONTENT
   ============================================ */

.blog-content {
    padding: 1.75rem;
}

.blog-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.blog-meta span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--text-tertiary);
    font-weight: 500;
    transition: color 0.2s ease;
}

.blog-meta svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

/* Date with orange accent */
.blog-date {
    color: hsl(30, 100%, 45%) !important;
}

.blog-card:hover .blog-date {
    color: var(--color-orange) !important;
}

/* Category pill with glass-morphism */
.blog-category {
    background: linear-gradient(135deg,
        hsla(108,100%,50%,0.15) 0%,
        hsla(60,100%,50%,0.15) 100%) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid rgba(102, 255, 0, 0.2);
    color: hsl(108, 80%, 35%) !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

.blog-card:hover .blog-category {
    background: linear-gradient(135deg,
        hsla(108,100%,50%,0.25) 0%,
        hsla(60,100%,50%,0.25) 100%) !important;
    border-color: var(--color-green);
    color: var(--color-chat-green) !important;
    box-shadow: 0 2px 8px rgba(102, 255, 0, 0.15);
}

.blog-title {
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.25;
    color: var(--text-primary);
}

.blog-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    background-image: linear-gradient(135deg,
        var(--color-green),
        var(--color-chat-green));
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: left bottom;
}

.blog-card:hover .blog-title a {
    color: var(--color-chat-green);
    background-size: 100% 2px;
}

.blog-excerpt {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.25rem;
    font-size: clamp(0.9375rem, 1.5vw, 1rem);
}

/* Read More with gradient hover effect */
.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    background: transparent;
    border: 2px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.read-more svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.blog-card:hover .read-more {
    gap: 0.625rem;
    background: var(--color-chat-green);
    color: var(--white);
    border-color: var(--color-chat-green);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transform: translateX(4px);
}

.blog-card:hover .read-more svg {
    transform: translateX(4px);
}

/* ============================================
   PAGINATION
   ============================================ */

.blog-pagination {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 4rem;
}

.blog-pagination .nav-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.blog-pagination a,
.blog-pagination span {
    min-width: 44px;
    height: 44px;
    padding: 0 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;

    /* Glass-morphism */
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 9999px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translateZ(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.blog-pagination a:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: scale(1.08) translateZ(0);
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.12),
        0 0 30px rgba(255, 255, 0, 0.15);
    border-color: var(--color-yellow);
}

.blog-pagination .current {
    background: linear-gradient(135deg,
        var(--color-yellow) 0%,
        var(--color-green) 100%);
    color: var(--black);
    border-color: transparent;
    box-shadow:
        0 4px 12px rgba(255, 255, 0, 0.25),
        0 2px 8px rgba(102, 255, 0, 0.2);
    font-weight: 700;
}

/* Previous/Next buttons */
.blog-pagination .prev,
.blog-pagination .next {
    padding: 0 1.5rem;
}

/* ============================================
   NO POSTS STATE
   ============================================ */

.no-posts {
    text-align: center;
    padding: 6rem 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.no-posts h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.no-posts p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.125rem;
    line-height: 1.6;
}

.no-posts .btn-primary {
    /* Glass-morphism CTA */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);

    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 9999px;
    padding: 1rem 2.5rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.0625rem;
    display: inline-flex;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translateZ(0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* Glow effect on hover */
.no-posts .btn-primary::before {
    content: '';
    position: absolute;
    inset: -3px;
    background: linear-gradient(135deg, var(--color-yellow), var(--color-green));
    border-radius: 9999px;
    filter: blur(20px);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
}

.no-posts .btn-primary:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: scale(1.05) translateZ(0);
    box-shadow:
        0 12px 32px rgba(0, 0, 0, 0.15),
        0 0 40px rgba(255, 255, 0, 0.2);
}

.no-posts .btn-primary:hover::before {
    opacity: 0.6;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .archive-page,
.blog-index {
        background-image:
            radial-gradient(at 50% 30%, hsla(60,100%,50%,0.18) 0px, transparent 50%),
            radial-gradient(at 80% 70%, hsla(108,100%,50%,0.15) 0px, transparent 50%);
    }

    .archive-page::before,
    .archive-page::after {
        display: none; /* Remove blur orbs on mobile for performance */
    }

    .blog-content {
        padding: 1.5rem;
    }

    .blog-card {
        margin-bottom: 0.5rem;
    }

    .blog-thumbnail {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .blog-grid {
        gap: 1.5rem;
    }

    .archive-type {
        font-size: 0.75rem;
        padding: 0.375rem 1rem;
    }

    .blog-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .blog-pagination .nav-links {
        gap: 0.5rem;
    }

    .blog-pagination a,
    .blog-pagination span {
        min-width: 40px;
        height: 40px;
        font-size: 0.875rem;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

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

    .archive-page::before,
    .archive-page::after {
        animation: none;
    }
}

/* Focus states for keyboard navigation */
.blog-card:focus-within {
    outline: 3px solid var(--color-chat-green);
    outline-offset: 4px;
}

.read-more:focus-visible,
.blog-pagination a:focus-visible {
    outline: 3px solid var(--color-chat-green);
    outline-offset: 4px;
    border-radius: 9999px;
}
