/**
 * Legal Cross Links Component - Premium 2026 Edition
 * 
 * Modern "Documenti Correlati" grid with:
 * - Glassmorphism effects
 * - Smooth hover animations
 * - Icon micro-interactions
 * - Ultra dark mode support
 */

/* ============================================
   Container Styling
   ============================================ */
.legal-cross-links {
    margin: 0;
    padding: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 4vw, 2.5rem);
    border-radius: 24px;
    background: linear-gradient(
        135deg,
        rgba(12, 35, 64, 0.04) 0%,
        rgba(212, 175, 55, 0.06) 50%,
        rgba(12, 35, 64, 0.04) 100%
    );
    border: 1px solid rgba(212, 175, 55, 0.15);
    position: relative;
    overflow: hidden;
}

/* Subtle background pattern */
.legal-cross-links::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(212, 175, 55, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(12, 35, 64, 0.08) 0%, transparent 50%);
    opacity: 0.8;
    pointer-events: none;
}

/* Decorative accent line */
.legal-cross-links::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
    border-radius: 2px;
}

/* ============================================
   Header Styling
   ============================================ */
.legal-cross-links__title,
.legal-cross-links__subtitle,
.legal-cross-links__grid {
    position: relative;
    z-index: 1;
}

.legal-cross-links__title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: #1a1d20;
    margin: 0 0 0.5rem 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.legal-cross-links__title i {
    color: #d4af37;
    font-size: 1.25em;
    animation: linkPulse 2s ease-in-out infinite;
}

@keyframes linkPulse {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.legal-cross-links__subtitle {
    text-align: center;
    color: #64748b;
    margin: 0 0 2.5rem;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

/* ============================================
   Grid Layout
   ============================================ */
.legal-cross-links__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

/* ============================================
   Card Styling
   ============================================ */
.legal-cross-link-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 1.5rem;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    min-height: 160px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.06),
        0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Card hover effect */
.legal-cross-link-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 20px 40px rgba(12, 35, 64, 0.15),
        0 8px 20px rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.4);
    background: #ffffff;
}

/* Card accent gradient on hover */
.legal-cross-link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0c2340, #d4af37);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.legal-cross-link-card:hover::before {
    transform: scaleX(1);
}

/* ============================================
   Card Icon
   ============================================ */
.legal-cross-link-card__icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    font-size: 1.5rem;
    color: #0c2340;
    background: linear-gradient(135deg, rgba(12, 35, 64, 0.08) 0%, rgba(212, 175, 55, 0.12) 100%);
    transition: all 0.4s ease;
    flex-shrink: 0;
}

.legal-cross-link-card:hover .legal-cross-link-card__icon {
    background: linear-gradient(135deg, #0c2340 0%, #1a3a5a 100%);
    color: #d4af37;
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 8px 20px rgba(12, 35, 64, 0.25);
}

/* ============================================
   Card Content
   ============================================ */
.legal-cross-link-card__title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.0625rem;
    font-weight: 600;
    color: #1a1d20;
    margin: 0.25rem 0 0;
    transition: color 0.3s ease;
}

.legal-cross-link-card:hover .legal-cross-link-card__title {
    color: #0c2340;
}

.legal-cross-link-card__description {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
    flex-grow: 1;
}

/* ============================================
   Arrow Icon
   ============================================ */
.legal-cross-link-card__arrow {
    font-size: 1rem;
    color: #0c2340;
    margin-top: auto;
    align-self: flex-end;
    opacity: 0.5;
    transition: all 0.3s ease;
    transform: translateX(0);
}

.legal-cross-link-card:hover .legal-cross-link-card__arrow {
    opacity: 1;
    transform: translateX(4px);
    color: #d4af37;
}

/* ============================================
   ULTRA DARK MODE
   ============================================ */
[data-theme="dark"] .legal-cross-links {
    background: linear-gradient(
        135deg,
        rgba(15, 23, 42, 0.95) 0%,
        rgba(20, 30, 50, 0.9) 50%,
        rgba(15, 23, 42, 0.95) 100%
    );
    border-color: rgba(212, 175, 55, 0.2);
    box-shadow: 
        0 0 60px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .legal-cross-links::before {
    background-image:
        radial-gradient(circle at 10% 20%, rgba(212, 175, 55, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.06) 0%, transparent 50%);
}

[data-theme="dark"] .legal-cross-links__title {
    color: #f1f5f9;
}

[data-theme="dark"] .legal-cross-links__subtitle {
    color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .legal-cross-link-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .legal-cross-link-card:hover {
    background: rgba(30, 41, 59, 0.95);
    border-color: rgba(212, 175, 55, 0.4);
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(212, 175, 55, 0.1);
}

[data-theme="dark"] .legal-cross-link-card__icon {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(212, 175, 55, 0.05) 100%);
    color: #d4af37;
}

[data-theme="dark"] .legal-cross-link-card:hover .legal-cross-link-card__icon {
    background: linear-gradient(135deg, #d4af37 0%, #e9d38b 100%);
    color: #0c2340;
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
}

[data-theme="dark"] .legal-cross-link-card__title {
    color: #f1f5f9;
}

[data-theme="dark"] .legal-cross-link-card:hover .legal-cross-link-card__title {
    color: #d4af37;
}

[data-theme="dark"] .legal-cross-link-card__description {
    color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .legal-cross-link-card__arrow {
    color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .legal-cross-link-card:hover .legal-cross-link-card__arrow {
    color: #d4af37;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .legal-cross-links {
        padding: 2rem 1.25rem;
        border-radius: 20px;
    }

    .legal-cross-links__grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .legal-cross-link-card {
        min-height: auto;
        padding: 1.25rem;
        flex-direction: row;
        align-items: center;
    }

    .legal-cross-link-card__icon {
        width: 44px;
        height: 44px;
        font-size: 1.25rem;
        border-radius: 12px;
    }

    .legal-cross-link-card__content {
        flex: 1;
    }

    .legal-cross-link-card__title {
        font-size: 1rem;
    }

    .legal-cross-link-card__description {
        font-size: 0.8125rem;
        display: none;
    }

    .legal-cross-link-card__arrow {
        position: static;
        margin-top: 0;
        margin-left: auto;
    }
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .legal-cross-link-card,
    .legal-cross-link-card__icon,
    .legal-cross-link-card__arrow,
    .legal-cross-links__title i {
        transition: none;
        animation: none;
    }

    .legal-cross-link-card:hover {
        transform: none;
    }
}
