/**
 * Hello Blog Grid - Main Styles
 * A beautiful, animated blog grid for Hello Elementor
 */

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
    --hbg-primary: #2563eb;
    --hbg-primary-rgb: 37, 99, 235;
    --hbg-text: #1e293b;
    --hbg-text-light: #64748b;
    --hbg-bg: #ffffff;
    --hbg-bg-alt: #f8fafc;
    --hbg-border: #e2e8f0;
    --hbg-radius: 16px;
    --hbg-radius-sm: 8px;
    --hbg-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.06);
    --hbg-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.08), 0 20px 40px rgba(0, 0, 0, 0.06);
    --hbg-transition: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --hbg-font-display: 'Fraunces', Georgia, serif;
    --hbg-font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ============================================
   Container
   ============================================ */
.hbg-main {
    padding: 60px 0 80px;
    background: var(--hbg-bg-alt);
    min-height: 60vh;
}

.hbg-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   Archive Header
   ============================================ */
.hbg-archive-header {
    text-align: center;
    margin-bottom: 60px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--hbg-border);
}

.hbg-archive-title {
    font-family: var(--hbg-font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 600;
    color: var(--hbg-text);
    margin: 0 0 12px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.hbg-archive-title span {
    color: var(--hbg-primary);
}

.hbg-archive-description {
    font-family: var(--hbg-font-body);
    font-size: 1.125rem;
    color: var(--hbg-text-light);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ============================================
   Grid Layout
   ============================================ */
.hbg-grid {
    display: grid;
    gap: 32px;
}

.hbg-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.hbg-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.hbg-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .hbg-cols-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .hbg-cols-3,
    .hbg-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hbg-grid {
        gap: 20px;
    }
}

@media (max-width: 560px) {
    .hbg-cols-2,
    .hbg-cols-3,
    .hbg-cols-4 {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Card Base Styles
   ============================================ */
.hbg-card {
    opacity: 0;
    will-change: transform, opacity;
}

.hbg-card.hbg-animated {
    opacity: 1;
}

.hbg-card-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--hbg-bg);
    border-radius: var(--hbg-radius);
    overflow: hidden;
    transition: transform var(--hbg-transition), box-shadow var(--hbg-transition);
}

.hbg-card-inner:hover {
    transform: translateY(-8px);
}

/* ============================================
   Card Image
   ============================================ */
.hbg-card-image {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
}

.hbg-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hbg-card-inner:hover .hbg-card-image img {
    transform: scale(1.08);
}

.hbg-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hbg-placeholder {
    color: var(--hbg-border);
}

/* ============================================
   Card Content
   ============================================ */
.hbg-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px;
}

/* ============================================
   Category Badge
   ============================================ */
.hbg-category {
    display: inline-block;
    font-family: var(--hbg-font-body);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--hbg-primary);
    background: rgba(var(--hbg-primary-rgb), 0.1);
    padding: 6px 12px;
    border-radius: 50px;
    margin-bottom: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.hbg-category:hover {
    background: var(--hbg-primary);
    color: #fff;
}

/* ============================================
   Card Title
   ============================================ */
.hbg-card-title {
    font-family: var(--hbg-font-display);
    font-size: 1.375rem;
    font-weight: 500;
    line-height: 1.35;
    margin: 0 0 12px;
    letter-spacing: -0.01em;
}

.hbg-card-title a {
    color: var(--hbg-text);
    text-decoration: none;
    transition: color 0.3s ease;
    background-image: linear-gradient(var(--hbg-primary), var(--hbg-primary));
    background-size: 0% 2px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 0.4s ease, color 0.3s ease;
}

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

/* ============================================
   Card Excerpt
   ============================================ */
.hbg-card-excerpt {
    font-family: var(--hbg-font-body);
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--hbg-text-light);
    margin-bottom: 20px;
    flex: 1;
}

/* ============================================
   Card Footer
   ============================================ */
.hbg-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--hbg-border);
}

/* ============================================
   Meta Info
   ============================================ */
.hbg-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.hbg-date {
    font-family: var(--hbg-font-body);
    font-size: 0.8125rem;
    color: var(--hbg-text-light);
}

/* ============================================
   Read More Link
   ============================================ */
.hbg-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--hbg-font-body);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--hbg-primary);
    text-decoration: none;
    transition: gap 0.3s ease;
    white-space: nowrap;
}

.hbg-read-more:hover {
    gap: 10px;
}

.hbg-read-more svg {
    transition: transform 0.3s ease;
}

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

/* ============================================
   STYLE: Elevated (Shadow)
   ============================================ */
.hbg-style-elevated .hbg-card-inner {
    box-shadow: var(--hbg-shadow);
}

.hbg-style-elevated .hbg-card-inner:hover {
    box-shadow: var(--hbg-shadow-hover);
}

/* ============================================
   STYLE: Bordered
   ============================================ */
.hbg-style-bordered .hbg-card-inner {
    border: 2px solid var(--hbg-border);
    box-shadow: none;
}

.hbg-style-bordered .hbg-card-inner:hover {
    border-color: var(--hbg-primary);
    box-shadow: 0 0 0 4px rgba(var(--hbg-primary-rgb), 0.1);
}

/* ============================================
   STYLE: Minimal
   ============================================ */
.hbg-style-minimal .hbg-card-inner {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

.hbg-style-minimal .hbg-card-image {
    border-radius: var(--hbg-radius);
}

.hbg-style-minimal .hbg-card-content {
    padding: 20px 0;
}

.hbg-style-minimal .hbg-card-footer {
    border-top: none;
    padding-top: 0;
}

.hbg-style-minimal .hbg-card-inner:hover {
    transform: none;
}

.hbg-style-minimal .hbg-card-inner:hover .hbg-card-image img {
    transform: scale(1.04);
}

/* ============================================
   STYLE: Overlay
   ============================================ */
.hbg-style-overlay .hbg-card-inner {
    position: relative;
}

.hbg-style-overlay .hbg-card-image {
    aspect-ratio: 4 / 5;
}

.hbg-style-overlay .hbg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.4) 40%,
        rgba(0, 0, 0, 0.1) 70%,
        transparent 100%
    );
    transition: opacity 0.4s ease;
}

.hbg-style-overlay .hbg-card-inner:hover .hbg-overlay {
    opacity: 0.9;
}

.hbg-style-overlay .hbg-content-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 24px;
    z-index: 2;
}

.hbg-style-overlay .hbg-category {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    backdrop-filter: blur(8px);
}

.hbg-style-overlay .hbg-category:hover {
    background: #fff;
    color: var(--hbg-text);
}

.hbg-style-overlay .hbg-card-title a {
    color: #fff;
    background-image: linear-gradient(#fff, #fff);
}

.hbg-style-overlay .hbg-card-title a:hover {
    color: #fff;
}

.hbg-style-overlay .hbg-card-excerpt {
    color: rgba(255, 255, 255, 0.8);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hbg-style-overlay .hbg-card-footer {
    border-top-color: rgba(255, 255, 255, 0.2);
}

.hbg-style-overlay .hbg-date {
    color: rgba(255, 255, 255, 0.7);
}

.hbg-style-overlay .hbg-read-more {
    color: #fff;
}

/* ============================================
   Animations
   ============================================ */

/* Fade Up */
.hbg-card[data-animation="fade-up"] {
    transform: translateY(40px);
}

.hbg-card[data-animation="fade-up"].hbg-animated {
    animation: hbgFadeUp 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: var(--animation-delay);
}

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

/* Fade In */
.hbg-card[data-animation="fade-in"] {
    transform: none;
}

.hbg-card[data-animation="fade-in"].hbg-animated {
    animation: hbgFadeIn 0.6s ease forwards;
    animation-delay: var(--animation-delay);
}

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

/* Scale */
.hbg-card[data-animation="scale"] {
    transform: scale(0.9);
}

.hbg-card[data-animation="scale"].hbg-animated {
    animation: hbgScale 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: var(--animation-delay);
}

@keyframes hbgScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Slide Up */
.hbg-card[data-animation="slide-up"] {
    transform: translateY(60px);
}

.hbg-card[data-animation="slide-up"].hbg-animated {
    animation: hbgSlideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: var(--animation-delay);
}

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

/* No Animation */
.hbg-card[data-animation="none"] {
    opacity: 1;
    transform: none;
}

/* ============================================
   Pagination
   ============================================ */
.hbg-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--hbg-border);
}

.hbg-pagination a,
.hbg-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 16px;
    font-family: var(--hbg-font-body);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--hbg-text);
    background: var(--hbg-bg);
    border: 1px solid var(--hbg-border);
    border-radius: var(--hbg-radius-sm);
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 8px;
}

.hbg-pagination a:hover {
    border-color: var(--hbg-primary);
    color: var(--hbg-primary);
    background: rgba(var(--hbg-primary-rgb), 0.05);
}

.hbg-pagination .current {
    background: var(--hbg-primary);
    color: #fff;
    border-color: var(--hbg-primary);
}

.hbg-pagination .dots {
    background: transparent;
    border: none;
    min-width: auto;
    padding: 0 8px;
}

.hbg-pagination .prev,
.hbg-pagination .next {
    padding: 0 20px;
}

/* ============================================
   No Posts Found
   ============================================ */
.hbg-no-posts {
    text-align: center;
    padding: 80px 20px;
    background: var(--hbg-bg);
    border-radius: var(--hbg-radius);
    border: 2px dashed var(--hbg-border);
}

.hbg-no-posts-icon {
    color: var(--hbg-border);
    margin-bottom: 24px;
}

.hbg-no-posts h2 {
    font-family: var(--hbg-font-display);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--hbg-text);
    margin: 0 0 12px;
}

.hbg-no-posts p {
    font-family: var(--hbg-font-body);
    font-size: 1rem;
    color: var(--hbg-text-light);
    margin: 0 0 24px;
}

.hbg-no-posts .search-form {
    display: flex;
    justify-content: center;
    gap: 8px;
    max-width: 400px;
    margin: 0 auto;
}

.hbg-no-posts .search-field {
    flex: 1;
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid var(--hbg-border);
    border-radius: var(--hbg-radius-sm);
    outline: none;
    transition: border-color 0.3s ease;
}

.hbg-no-posts .search-field:focus {
    border-color: var(--hbg-primary);
}

.hbg-no-posts .search-submit {
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: var(--hbg-primary);
    border: none;
    border-radius: var(--hbg-radius-sm);
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.hbg-no-posts .search-submit:hover {
    background: color-mix(in srgb, var(--hbg-primary) 85%, black);
    transform: translateY(-2px);
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .hbg-card {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }
    
    .hbg-card-inner,
    .hbg-card-image img,
    .hbg-read-more svg {
        transition: none !important;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .hbg-main {
        background: #fff;
        padding: 0;
    }
    
    .hbg-card {
        opacity: 1 !important;
        transform: none !important;
        break-inside: avoid;
    }
    
    .hbg-card-inner {
        box-shadow: none !important;
        border: 1px solid #ddd;
    }
    
    .hbg-pagination {
        display: none;
    }
}
