/**
 * Blog Hub Styles
 *
 * Organized hub page for course articles grouped by topic clusters.
 * Follows calculator hub pattern with text-only cards.
 *
 * @package Ryan_OConnell_Theme
 * @since 1.0.0
 */

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
    --blog-hub-primary: #2563eb;
    --blog-hub-primary-dark: #1e40af;
    --blog-hub-primary-light: #3b82f6;
    --blog-hub-gradient: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    --blog-hub-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    --blog-hub-shadow-hover: 0 10px 30px rgba(37, 99, 235, 0.15);
    --blog-hub-gray-50: #f9fafb;
    --blog-hub-gray-100: #f3f4f6;
    --blog-hub-gray-200: #e5e7eb;
    --blog-hub-gray-600: #4b5563;
    --blog-hub-gray-800: #1f2937;
}

/* ========================================
   HERO SECTION
   ======================================== */
.blog-hub-hero {
    position: relative;
    background: var(--blog-hub-gradient);
    padding: 80px 0;
    overflow: hidden;
    margin-bottom: 60px;
}

.blog-hub-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.1;
    background-image:
        repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0px, transparent 1px, transparent 50px, rgba(255,255,255,0.05) 51px),
        repeating-linear-gradient(0deg, rgba(255,255,255,0.05) 0px, transparent 1px, transparent 50px, rgba(255,255,255,0.05) 51px);
    animation: bgFlow 15s linear infinite;
}

@keyframes bgFlow {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.blog-hub-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.blog-hub-hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: white !important;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.blog-hub-hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 40px;
    line-height: 1.6;
}

/* ========================================
   SEARCH BAR
   ======================================== */
.blog-hub-search-wrap {
    position: relative;
    max-width: 600px;
    margin: 0 auto 30px;
}

.blog-hub-search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--blog-hub-gray-600);
    font-size: 1.1rem;
    pointer-events: none;
    z-index: 2;
}

.blog-hub-search-input {
    width: 100%;
    padding: 16px 50px 16px 50px;
    font-size: 1rem;
    border: 2px solid var(--blog-hub-gray-200);
    border-radius: 50px;
    background: white;
    transition: all 0.3s ease;
    box-shadow: var(--blog-hub-shadow);
}

.blog-hub-search-input:focus {
    outline: none;
    border-color: var(--blog-hub-primary);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.2);
}

.blog-hub-search-clear {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--blog-hub-gray-600);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 5px 10px;
    transition: color 0.3s ease;
    z-index: 2;
}

.blog-hub-search-clear:hover {
    color: var(--blog-hub-primary);
}

.blog-hub-search-clear.hidden {
    display: none;
}

/* ========================================
   CTA BUTTON
   ======================================== */
.blog-hub-cta-inline {
    margin-top: 30px;
}

.blog-hub-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: white;
    color: var(--blog-hub-primary);
    font-weight: 600;
    font-size: 1rem;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.blog-hub-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
    color: var(--blog-hub-primary-dark);
    text-decoration: none;
}

.blog-hub-cta-btn i {
    font-size: 1.1rem;
}

/* ========================================
   RESULTS BAR
   ======================================== */
.blog-hub-results-bar {
    padding: 20px 0;
    text-align: center;
    color: var(--blog-hub-gray-600);
    font-size: 1rem;
}

.blog-hub-results {
    margin: 0;
}

#visible-count {
    font-weight: 600;
    color: var(--blog-hub-primary);
}

/* ========================================
   CLUSTER SECTIONS
   ======================================== */
.blog-hub-cluster {
    margin-bottom: 60px;
}

.blog-hub-cluster--expanded {
    padding: 40px 0;
    background: var(--blog-hub-gray-50);
    border-radius: 16px;
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
}

.blog-hub-cluster-header {
    text-align: center;
    margin-bottom: 40px;
}

.blog-hub-cluster-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--blog-hub-gray-800);
    margin-bottom: 12px;
}

.blog-hub-cluster-count {
    font-weight: 400;
    font-size: 1.25rem;
    color: var(--blog-hub-gray-600);
}

.blog-hub-cluster-header p {
    font-size: 1.125rem;
    color: var(--blog-hub-gray-600);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ========================================
   CLUSTER FOOTER & VIEW ALL BUTTON
   ======================================== */
.blog-hub-cluster-footer {
    text-align: center;
    margin-top: 30px;
}

.blog-hub-view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: transparent;
    color: var(--blog-hub-primary);
    font-weight: 600;
    font-size: 1rem;
    border: 2px solid var(--blog-hub-primary);
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.blog-hub-view-all-btn:hover {
    background: var(--blog-hub-primary);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.blog-hub-view-all-btn i {
    transition: transform 0.3s ease;
}

.blog-hub-view-all-btn:hover i {
    transform: translateX(4px);
}

/* ========================================
   BACK LINK
   ======================================== */
.blog-hub-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--blog-hub-primary);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.blog-hub-back-link:hover {
    color: var(--blog-hub-primary-dark);
    text-decoration: none;
}

.blog-hub-back-link i {
    transition: transform 0.3s ease;
}

.blog-hub-back-link:hover i {
    transform: translateX(-4px);
}

/* ========================================
   CARD GRID
   ======================================== */
.blog-hub-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-bottom: 20px;
}

/* ========================================
   CARD COMPONENT
   ======================================== */
.blog-hub-card {
    background: white;
    border: 2px solid var(--blog-hub-gray-200);
    border-radius: 12px;
    transition: all 0.3s ease;
    opacity: 0;
    animation: fadeInUp 0.6s forwards;
    display: flex;
    flex-direction: column;
}

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

.blog-hub-card:hover {
    transform: translateY(-5px);
    border-color: var(--blog-hub-primary);
    box-shadow: var(--blog-hub-shadow-hover);
}

.blog-hub-card-image {
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
}

.blog-hub-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-hub-card:hover .blog-hub-card-img {
    transform: scale(1.05);
}

.blog-hub-card.hidden {
    display: none;
}

.blog-hub-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-hub-card-link:hover {
    text-decoration: none;
}

.blog-hub-card-body {
    padding: 24px;
    flex: 1;
}

.blog-hub-card-badge {
    display: inline-block;
    padding: 6px 14px;
    background: var(--blog-hub-gradient);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.blog-hub-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--blog-hub-gray-800);
    margin-bottom: 12px;
    line-height: 1.4;
}

.blog-hub-card-excerpt {
    font-size: 0.9375rem;
    color: var(--blog-hub-gray-600);
    line-height: 1.6;
    margin-bottom: 0;
}

.blog-hub-card-footer {
    padding: 0 24px 24px;
    display: flex;
    align-items: center;
}

.blog-hub-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--blog-hub-primary);
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.3s ease;
}

.blog-hub-card:hover .blog-hub-btn {
    color: var(--blog-hub-primary-dark);
    gap: 12px;
}

.blog-hub-btn i {
    transition: transform 0.3s ease;
}

.blog-hub-card:hover .blog-hub-btn i {
    transform: translateX(4px);
}

/* ========================================
   EMPTY STATE
   ======================================== */
.blog-hub-empty-state {
    text-align: center;
    padding: 80px 20px;
}

.blog-hub-empty-state.hidden {
    display: none;
}

.blog-hub-empty-state i {
    font-size: 4rem;
    color: var(--blog-hub-gray-200);
    margin-bottom: 20px;
}

.blog-hub-empty-state h3 {
    font-size: 1.5rem;
    color: var(--blog-hub-gray-800);
    margin-bottom: 10px;
}

.blog-hub-empty-state p {
    font-size: 1rem;
    color: var(--blog-hub-gray-600);
}

/* ========================================
   FOOTER CTA
   ======================================== */
.blog-hub-footer-cta {
    text-align: center;
    padding: 60px 20px;
    background: var(--blog-hub-gray-50);
    border-radius: 16px;
    margin-top: 40px;
}

.blog-hub-footer-cta h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--blog-hub-gray-800);
    margin-bottom: 20px;
}

.blog-hub-footer-cta p {
    font-size: 1.125rem;
    color: var(--blog-hub-gray-600);
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.blog-hub-footer-cta .blog-hub-cta-btn {
    background: var(--blog-hub-gradient);
    color: white;
}

.blog-hub-footer-cta .blog-hub-cta-btn:hover {
    background: var(--blog-hub-primary-dark);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablet (768px - 991px) */
@media (max-width: 991px) {
    .blog-hub-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }

    .blog-hub-hero-title {
        font-size: 2.5rem;
    }

    .blog-hub-hero-subtitle {
        font-size: 1.125rem;
    }

    .blog-hub-cluster-header h2 {
        font-size: 1.75rem;
    }

    .blog-hub-cluster-header p {
        font-size: 1rem;
    }
}

/* Mobile (< 768px) */
@media (max-width: 768px) {
    .blog-hub-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .blog-hub-hero {
        padding: 60px 0;
    }

    .blog-hub-hero-title {
        font-size: 2rem;
    }

    .blog-hub-hero-subtitle {
        font-size: 1rem;
    }

    .blog-hub-search-wrap {
        max-width: 100%;
    }

    .blog-hub-cluster-header h2 {
        font-size: 1.5rem;
    }

    .blog-hub-cluster-count {
        font-size: 1rem;
    }

    .blog-hub-cluster-header p {
        font-size: 0.9375rem;
    }

    .blog-hub-card-title {
        font-size: 1.125rem;
    }

    .blog-hub-footer-cta h2 {
        font-size: 1.5rem;
    }

    .blog-hub-footer-cta p {
        font-size: 1rem;
    }

    .blog-hub-view-all-btn {
        padding: 12px 24px;
        font-size: 0.9375rem;
    }

    .blog-hub-cluster--expanded {
        margin-left: -15px;
        margin-right: -15px;
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Small Mobile (< 576px) */
@media (max-width: 576px) {
    .blog-hub-hero {
        padding: 40px 0;
    }

    .blog-hub-hero-title {
        font-size: 1.75rem;
    }

    .blog-hub-search-input {
        padding: 14px 45px 14px 45px;
        font-size: 0.9375rem;
    }

    .blog-hub-card-body {
        padding: 20px;
    }

    .blog-hub-card-footer {
        padding: 0 20px 20px;
    }

    .blog-hub-cta-btn {
        padding: 12px 28px;
        font-size: 0.9375rem;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
.blog-hub-search-input:focus,
.blog-hub-cta-btn:focus,
.blog-hub-card-link:focus {
    outline: 2px solid var(--blog-hub-primary);
    outline-offset: 2px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .blog-hub-card,
    .blog-hub-cta-btn,
    .blog-hub-btn,
    .blog-hub-search-input {
        animation: none;
        transition: none;
    }

    .blog-hub-card:hover,
    .blog-hub-cta-btn:hover {
        transform: none;
    }

    .blog-hub-hero-bg {
        animation: none;
    }
}
