/**
 * Elementor Articles Grid Widget CSS
 * Styles for the articles grid Elementor widget
 */

/* Base Articles Grid Styles */
.elementor-articles-grid-widget {
    margin: 0;
    padding: 0;
}

.elementor-section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--e-global-color-primary, #2c3e50);
    position: relative;
    font-weight: 700;
    line-height: 1.3;
}

.elementor-section-title::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    background: var(--e-global-color-accent, #ff6f61);
    margin: 1rem auto 0;
    border-radius: 2px;
}

/* Articles Grid Container */
.articles-grid {
    display: grid;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Column Variations */
.articles-grid[data-columns="1"] {
    grid-template-columns: 1fr;
}

.articles-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.articles-grid[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.articles-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

/* Individual Article Card */
.article-card {
    background: #ffffff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    position: relative;
    overflow: hidden;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border-left-color: var(--e-global-color-primary, #6b5b95);
}

.article-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(
        90deg,
        var(--e-global-color-primary, #6b5b95),
        var(--e-global-color-accent, #ff6f61)
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Article Title */
.article-title {
    margin: 0 0 1rem 0;
    font-size: 1.3rem;
    line-height: 1.3;
}

.article-title a {
    color: var(--e-global-color-primary, #2c3e50);
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
    font-weight: 600;
}

.article-title a:hover {
    color: var(--e-global-color-accent, #ff6f61);
}

/* Article Excerpt */
.article-excerpt {
    color: #7f8c8d;
    margin: 0 0 1rem 0;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Entity Tags */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1rem 0;
    align-items: center;
}

.tag {
    background: #f8f9fa;
    color: #6b5b95;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Entity Type Specific Colors */
.tag-chakra {
    background: #ff6f61;
    color: white;
}

.tag-chakra:hover {
    background: #ff5a50;
}

.tag-intention {
    background: #88b0d3;
    color: white;
}

.tag-intention:hover {
    background: #7da5c8;
}

.tag-astrology {
    background: #ffb347;
    color: white;
}

.tag-astrology:hover {
    background: #ffa735;
}

.tag-category {
    background: #98d8c8;
    color: white;
}

.tag-category:hover {
    background: #8dd0be;
}

/* Read More Link */
.read-more {
    color: var(--e-global-color-primary, #6b5b95);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.read-more:hover {
    color: var(--e-global-color-accent, #ff6f61);
    gap: 0.75rem;
}

.read-more::after {
    content: "";
    transition: all 0.3s ease;
}

/* Entity Action Links */
.entity-links {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.5) 0%,
        rgba(249, 250, 251, 0.8) 100%
    );
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    position: relative;
}

.entity-links::before {
    content: "";
    position: absolute;
    top: -1px;
    left: 20px;
    right: 20px;
    height: 3px;
    background: linear-gradient(
        90deg,
        var(--e-global-color-primary, #6b5b95),
        var(--e-global-color-accent, #ff6f61)
    );
    border-radius: 2px 2px 0 0;
}

.entity-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.entity-label {
    font-size: 0.8rem;
    color: #7f8c8d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 0.5rem;
    min-width: 60px;
}

.entity-action-link {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    background: rgba(107, 91, 149, 0.08);
    color: var(--e-global-color-primary, #6b5b95);
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(107, 91, 149, 0.15);
    position: relative;
    overflow: hidden;
}

.entity-action-link::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.5s ease;
}

.entity-action-link:hover::before {
    left: 100%;
}

.entity-action-link:hover {
    background: var(--e-global-color-primary, #6b5b95);
    color: white;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(107, 91, 149, 0.35);
    border-color: var(--e-global-color-primary, #6b5b95);
}

.entity-action-link:active {
    transform: translateY(0) scale(0.98);
}

.entity-action-product_chakras {
    background: rgba(255, 111, 97, 0.08);
    border-color: rgba(255, 111, 97, 0.15);
    color: #ff6f61;
}

.entity-action-product_chakras:hover {
    background: #ff6f61;
    color: white;
    box-shadow: 0 4px 12px rgba(255, 111, 97, 0.35);
    border-color: #ff6f61;
}

.entity-action-product_vertus {
    background: rgba(136, 176, 211, 0.08);
    border-color: rgba(136, 176, 211, 0.15);
    color: #88b0d3;
}

.entity-action-product_vertus:hover {
    background: #88b0d3;
    color: white;
    box-shadow: 0 4px 12px rgba(136, 176, 211, 0.35);
    border-color: #88b0d3;
}

.entity-action-product_astrology {
    background: rgba(255, 179, 71, 0.08);
    border-color: rgba(255, 179, 71, 0.15);
    color: #ffb347;
}

.entity-action-product_astrology:hover {
    background: #ffb347;
    color: white;
    box-shadow: 0 4px 12px rgba(255, 179, 71, 0.35);
    border-color: #ffb347;
}

.entity-action-search {
    background: rgba(127, 140, 141, 0.08);
    border-color: rgba(127, 140, 141, 0.15);
    color: #7f8c8d;
}

.entity-action-search:hover {
    background: #7f8c8d;
    color: white;
    box-shadow: 0 4px 12px rgba(127, 140, 141, 0.35);
    border-color: #7f8c8d;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .entity-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .entity-label {
        margin-right: 0;
        margin-bottom: 0.25rem;
    }

    .entity-action-link {
        padding: 0.4rem 0.9rem;
        font-size: 0.8rem;
    }
}

/* Animation for entity links */
.entity-action-link {
    animation: entityLinkFadeIn 0.6s ease-out forwards;
    opacity: 0;
}

.entity-action-link:nth-child(1) {
    animation-delay: 0.1s;
}
.entity-action-link:nth-child(2) {
    animation-delay: 0.2s;
}
.entity-action-link:nth-child(3) {
    animation-delay: 0.3s;
}

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

/* Archive Link */
.archive-link {
    text-align: center;
    margin-top: 2rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1.5;
    text-align: center;
}

.btn-primary {
    background: var(--e-global-color-primary, #6b5b95);
    color: white;
    border-color: var(--e-global-color-primary, #6b5b95);
}

.btn-primary:hover {
    background: transparent;
    color: var(--e-global-color-primary, #6b5b95);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: transparent;
    color: var(--e-global-color-primary, #6b5b95);
    border-color: var(--e-global-color-primary, #6b5b95);
}

.btn-secondary:hover {
    background: var(--e-global-color-primary, #6b5b95);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Load More Container */
.load-more-container {
    text-align: center;
    margin-top: 2rem;
}

.load-more-btn {
    background: var(--e-global-color-primary, #6b5b95);
    color: white;
    border: 2px solid var(--e-global-color-primary, #6b5b95);
    padding: 0.75rem 2rem;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.load-more-btn:hover:not(:disabled) {
    background: transparent;
    color: var(--e-global-color-primary, #6b5b95);
    transform: translateY(-2px);
}

.load-more-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* No Articles Message */
.no-articles {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 2rem;
    background: #f8f9fa;
    border-radius: 8px;
    color: #7f8c8d;
    font-style: italic;
    border: 2px dashed #e1e8ed;
}

.no-articles p {
    margin: 0;
    font-size: 1.1rem;
}

/* Loading State */
.article-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.article-card.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--e-global-color-primary, #6b5b95);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

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

/* Stagger Animation */
.article-card.stagger-animation {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.article-card.stagger-animation.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .articles-grid[data-columns="4"] {
        grid-template-columns: repeat(3, 1fr);
    }

    .elementor-section-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    .articles-grid[data-columns="3"],
    .articles-grid[data-columns="4"] {
        grid-template-columns: repeat(2, 1fr);
    }

    .elementor-section-title {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    .article-card {
        padding: 1.25rem;
    }

    .article-title {
        font-size: 1.2rem;
    }

    .article-excerpt {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .articles-grid[data-columns="2"],
    .articles-grid[data-columns="3"],
    .articles-grid[data-columns="4"] {
        grid-template-columns: 1fr;
    }

    .elementor-section-title {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }

    .article-card {
        padding: 1rem;
    }

    .article-title {
        font-size: 1.1rem;
    }

    .article-tags {
        gap: 0.4rem;
    }

    .tag {
        font-size: 0.8rem;
        padding: 0.2rem 0.6rem;
    }

    .archive-link,
    .load-more-container {
        margin-top: 1.5rem;
    }
}

/* Elementor Editor Specific Styles */
.elementor-editor .articles-grid {
    min-height: 200px;
}

.elementor-editor .article-card {
    position: relative;
}

.elementor-editor .article-card::after {
    content: "Article Card";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
    font-size: 0.9rem;
    pointer-events: none;
    opacity: 0.7;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .article-card {
        background: #2c3e50;
        color: #ecf0f1;
    }

    .article-excerpt {
        color: #bdc3c7;
    }

    .no-articles {
        background: #34495e;
        color: #bdc3c7;
        border-color: #2c3e50;
    }
}

/* Print Styles */
@media print {
    .articles-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .article-card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .load-more-container,
    .archive-link {
        display: none;
    }

    .tag {
        background: #f0f0f0 !important;
        color: black !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .article-card {
        border: 2px solid currentColor;
    }

    .tag {
        border: 1px solid currentColor;
    }

    .article-title a {
        text-decoration: underline;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .article-card,
    .tag,
    .read-more,
    .btn,
    .load-more-btn {
        transition: none;
        animation: none;
    }

    .article-card:hover {
        transform: none;
    }
}

/* Focus States for Accessibility */
.article-card:focus-within {
    outline: 2px solid var(--e-global-color-primary, #6b5b95);
    outline-offset: 2px;
}

.tag:focus,
.read-more:focus,
.btn:focus,
.load-more-btn:focus {
    outline: 2px solid var(--e-global-color-primary, #6b5b95);
    outline-offset: 2px;
}

/* Elementor Responsive Controls Compatibility */
.elementor-widget-container .articles-grid {
    gap: var(--grid-gap, 2rem);
}
