/**
 * SOS Serrurier Express - 2025 Advanced Interlinking Widget Styles
 * Responsive grid layout with optimized hover effects and SEO-friendly design
 */

/* ==========================================================================
   MAIN INTERLINKING WIDGET CONTAINER
   ========================================================================== */

.serrurier-interlinking-widget {
    padding: 3rem 0;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    position: relative;
    overflow: hidden;
}

.serrurier-interlinking-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(239, 68, 68, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(239, 68, 68, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.serrurier-interlinking-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   HEADER SECTION
   ========================================================================== */

.serrurier-interlinking-header {
    text-align: center;
    margin-bottom: 2rem;
}

.serrurier-interlinking-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.serrurier-interlinking-title svg {
    width: 1.5rem;
    height: 1.5rem;
    color: #dc2626;
    transition: transform 0.3s ease;
}

.serrurier-interlinking-widget:hover .serrurier-interlinking-title svg {
    transform: translateX(3px);
}

.serrurier-interlinking-description {
    color: #6b7280;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================================================
   RESPONSIVE GRID SYSTEM
   ========================================================================== */

.serrurier-interlinking-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, 1fr);
    transition: all 0.3s ease;
}

/* Tablet Layout */
@media (min-width: 640px) {
    .serrurier-interlinking-container {
        padding: 0 1.5rem;
    }

    .serrurier-interlinking-grid {
        gap: 1.25rem;
        grid-template-columns: repeat(3, 1fr);
    }

    .serrurier-interlinking-title {
        font-size: 1.75rem;
    }
}

/* Desktop Layout */
@media (min-width: 768px) {
    .serrurier-interlinking-widget {
        padding: 4rem 0;
    }

    .serrurier-interlinking-container {
        padding: 0 2rem;
    }

    .serrurier-interlinking-grid {
        gap: 1.5rem;
        grid-template-columns: repeat(4, 1fr);
    }

    .serrurier-interlinking-header {
        margin-bottom: 2.5rem;
    }

    .serrurier-interlinking-title {
        font-size: 2rem;
    }
}

/* Large Desktop Layout */
@media (min-width: 1024px) {
    .serrurier-interlinking-container {
        padding: 0 2.5rem;
    }

    .serrurier-interlinking-grid {
        gap: 1.75rem;
    }
}

/* ==========================================================================
   INDIVIDUAL LINK CARDS
   ========================================================================== */

.serrurier-link-card {
    display: block;
    padding: 1rem;
    background: #ffffff;
    border-radius: 0.75rem;
    box-shadow:
        0 1px 3px 0 rgba(0, 0, 0, 0.1),
        0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    group: card;
}

.serrurier-link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #dc2626, #ef4444);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.serrurier-link-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 10px 25px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: #fca5a5;
}

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

.serrurier-link-card:active {
    transform: translateY(0);
}

/* ==========================================================================
   CARD CONTENT LAYOUT
   ========================================================================== */

.serrurier-link-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.serrurier-link-icon {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fef2f2;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.serrurier-link-icon svg {
    width: 1.25rem;
    height: 1.25rem;
    color: #dc2626;
    transition: all 0.3s ease;
}

.serrurier-link-card:hover .serrurier-link-icon {
    background: #dc2626;
    transform: scale(1.05);
}

.serrurier-link-card:hover .serrurier-link-icon svg {
    color: #ffffff;
    transform: scale(1.1);
}

.serrurier-link-text {
    flex: 1;
    min-width: 0;
}

.serrurier-link-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.4;
    margin: 0;
    transition: color 0.3s ease;

    /* Text truncation for long commune names */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.serrurier-link-card:hover .serrurier-link-title {
    color: #dc2626;
}

/* ==========================================================================
   PRIORITY INDICATORS (VISUAL HIERARCHY)
   ========================================================================== */

.serrurier-link-card[data-priority="tier_1_hub"] {
    border-color: #fca5a5;
    background: linear-gradient(135deg, #ffffff 0%, #fef7f7 100%);
}

.serrurier-link-card[data-priority="paris_hub"] {
    border-color: #dc2626;
    background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
    box-shadow:
        0 4px 6px -1px rgba(220, 38, 38, 0.1),
        0 2px 4px -1px rgba(220, 38, 38, 0.06);
}

.serrurier-link-card[data-priority="paris_hub"] .serrurier-link-icon {
    background: #dc2626;
}

.serrurier-link-card[data-priority="paris_hub"] .serrurier-link-icon svg {
    color: #ffffff;
}

.serrurier-link-card[data-priority="same_department"] {
    border-color: #d1d5db;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
}

/* ==========================================================================
   MOBILE OPTIMIZATIONS
   ========================================================================== */

@media (max-width: 640px) {
    .serrurier-interlinking-widget {
        padding: 2rem 0;
    }

    .serrurier-interlinking-container {
        padding: 0 1rem;
    }

    .serrurier-interlinking-title {
        font-size: 1.25rem;
        flex-direction: column;
        gap: 0.25rem;
    }

    .serrurier-interlinking-description {
        font-size: 0.875rem;
    }

    .serrurier-link-card {
        padding: 0.875rem;
    }

    .serrurier-link-content {
        gap: 0.5rem;
    }

    .serrurier-link-icon {
        width: 2rem;
        height: 2rem;
    }

    .serrurier-link-icon svg {
        width: 1rem;
        height: 1rem;
    }

    .serrurier-link-title {
        font-size: 0.8125rem;
    }
}

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

.serrurier-link-card:focus {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

.serrurier-link-card:focus:not(:focus-visible) {
    outline: none;
}

@media (prefers-reduced-motion: reduce) {
    .serrurier-link-card,
    .serrurier-link-icon,
    .serrurier-link-icon svg,
    .serrurier-interlinking-title svg {
        transition: none;
    }
}

/* ==========================================================================
   HIGH CONTRAST MODE SUPPORT
   ========================================================================== */

@media (prefers-contrast: high) {
    .serrurier-link-card {
        border-color: #000000;
    }

    .serrurier-link-title {
        color: #000000;
    }

    .serrurier-link-card:hover .serrurier-link-title {
        color: #dc2626;
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .serrurier-interlinking-widget {
        background: none;
        padding: 1rem 0;
    }

    .serrurier-link-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000000;
    }

    .serrurier-link-card:hover {
        transform: none;
        box-shadow: none;
    }
}