/**
 * Semantic Internal Linking - Block Styles
 * Mobile-first responsive design with Tailwind-inspired utilities
 */

/* ========================================
   BASE BLOCK STYLES (Default/Simple)
   ======================================== */

.semantic-links-block {
    border: 1px solid #e5e7eb;
    padding: 1.25rem;
    margin: 1.875rem 0;
    background: #f9fafb;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.semantic-links-block:hover {
    border-color: #d1d5db;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.semantic-links-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 1rem 0;
    line-height: 1.5;
    letter-spacing: -0.01em;
}

.semantic-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.semantic-links-list li {
    margin: 0;
    transition: transform 0.2s ease;
}

.semantic-links-list li:hover {
    transform: translateX(4px);
}

.semantic-links-list a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    line-height: 1.6;
    transition: color 0.2s ease;
    display: inline-block;
}

.semantic-links-list a:hover {
    color: #1e40af;
    text-decoration: underline;
}

.semantic-links-list a:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 2px;
}

/* ========================================
   CARD STYLE VARIATION
   ======================================== */

.semantic-links-block--card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.semantic-links-block--card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
    border-color: #3b82f6;
}

.semantic-links-block--card .semantic-links-title {
    font-size: 1.25rem;
    color: #0f172a;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 1rem;
}

.semantic-links-block--card .semantic-links-list {
    gap: 1rem;
}

.semantic-links-block--card .semantic-links-list li {
    padding-left: 1.25rem;
    position: relative;
}

.semantic-links-block--card .semantic-links-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #3b82f6;
    font-weight: 600;
    transition: transform 0.2s ease;
}

.semantic-links-block--card .semantic-links-list li:hover::before {
    transform: translateX(4px);
}

/* ========================================
   INLINE STYLE VARIATION
   ======================================== */

.semantic-links-block--inline {
    background: transparent;
    border: none;
    padding: 1rem 0;
    margin: 1.5rem 0;
}

.semantic-links-block--inline .semantic-links-title {
    display: inline;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-right: 0.75rem;
}

.semantic-links-block--inline .semantic-links-list {
    display: inline;
    flex-direction: row;
    gap: 0;
}

.semantic-links-block--inline .semantic-links-list li {
    display: inline;
    margin: 0;
}

.semantic-links-block--inline .semantic-links-list li:hover {
    transform: none;
}

.semantic-links-block--inline .semantic-links-list li::after {
    content: ", ";
    color: #6b7280;
}

.semantic-links-block--inline .semantic-links-list li:last-child::after {
    content: "";
}

.semantic-links-block--inline .semantic-links-list a {
    font-weight: 500;
    font-size: 0.9375rem;
}

/* ========================================
   NUMBERED STYLE VARIATION
   ======================================== */

.semantic-links-block--numbered {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    padding: 1.5rem;
    border-radius: 0.75rem;
}

.semantic-links-block--numbered .semantic-links-title {
    font-size: 1.25rem;
    color: #0c4a6e;
    margin-bottom: 1.25rem;
}

.semantic-links-block--numbered .semantic-links-list {
    counter-reset: semantic-counter;
    gap: 1rem;
}

.semantic-links-block--numbered .semantic-links-list li {
    counter-increment: semantic-counter;
    padding-left: 2.5rem;
    position: relative;
}

.semantic-links-block--numbered .semantic-links-list li::before {
    content: counter(semantic-counter);
    position: absolute;
    left: 0;
    top: 0;
    background: #0ea5e9;
    color: #ffffff;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    box-shadow: 0 2px 4px rgba(14, 165, 233, 0.3);
}

.semantic-links-block--numbered .semantic-links-list a {
    color: #075985;
    font-weight: 500;
}

.semantic-links-block--numbered .semantic-links-list a:hover {
    color: #0c4a6e;
}

/* ========================================
   MINIMAL STYLE VARIATION
   ======================================== */

.semantic-links-block--minimal {
    background: transparent;
    border: none;
    border-left: 3px solid #3b82f6;
    padding: 0.5rem 0 0.5rem 1rem;
    margin: 1.5rem 0;
}

.semantic-links-block--minimal .semantic-links-title {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.semantic-links-block--minimal .semantic-links-list {
    gap: 0.5rem;
}

.semantic-links-block--minimal .semantic-links-list a {
    font-size: 0.9375rem;
    font-weight: 400;
}

/* ========================================
   GRADIENT STYLE VARIATION
   ======================================== */

.semantic-links-block--gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px -5px rgba(102, 126, 234, 0.3);
}

.semantic-links-block--gradient .semantic-links-title {
    color: #ffffff;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.semantic-links-block--gradient .semantic-links-list a {
    color: #ffffff;
    font-weight: 500;
    opacity: 0.9;
}

.semantic-links-block--gradient .semantic-links-list a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ========================================
   LOADING STATE
   ======================================== */

.semantic-links-block--loading {
    position: relative;
    min-height: 200px;
    opacity: 0.6;
    pointer-events: none;
}

.semantic-links-block--loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2rem;
    height: 2rem;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: semantic-spin 0.8s linear infinite;
}

@keyframes semantic-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ========================================
   EMPTY STATE
   ======================================== */

.semantic-links-block--empty {
    background: #fef3c7;
    border: 1px dashed #f59e0b;
    padding: 2rem;
    text-align: center;
}

.semantic-links-block--empty .semantic-links-title {
    color: #92400e;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.semantic-links-block--empty .semantic-links-empty-message {
    color: #78350f;
    font-size: 0.875rem;
    font-weight: 400;
}

/* ========================================
   ERROR STATE
   ======================================== */

.semantic-links-block--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 1.5rem;
}

.semantic-links-block--error .semantic-links-title {
    color: #991b1b;
    margin-bottom: 0.5rem;
}

.semantic-links-block--error .semantic-links-error-message {
    color: #7f1d1d;
    font-size: 0.875rem;
    font-weight: 400;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Tablet (640px+) */
@media (min-width: 640px) {
    .semantic-links-block {
        padding: 1.5rem;
        margin: 2rem 0;
    }

    .semantic-links-title {
        font-size: 1.25rem;
    }

    .semantic-links-list {
        gap: 0.875rem;
    }

    .semantic-links-list a {
        font-size: 1rem;
    }

    .semantic-links-block--card {
        padding: 2rem;
    }

    .semantic-links-block--inline .semantic-links-title {
        font-size: 1.125rem;
    }
}

/* Desktop (768px+) */
@media (min-width: 768px) {
    .semantic-links-block {
        padding: 2rem;
        margin: 2.5rem 0;
    }

    .semantic-links-title {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
    }

    .semantic-links-list {
        gap: 1rem;
    }

    .semantic-links-block--card .semantic-links-title {
        font-size: 1.5rem;
    }

    .semantic-links-block--numbered .semantic-links-list li {
        padding-left: 3rem;
    }

    .semantic-links-block--numbered .semantic-links-list li::before {
        width: 2rem;
        height: 2rem;
        font-size: 1rem;
    }
}

/* Large Desktop (1024px+) */
@media (min-width: 1024px) {
    .semantic-links-block:hover {
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    }

    .semantic-links-list li:hover {
        transform: translateX(6px);
    }
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */

@media (prefers-color-scheme: dark) {
    .semantic-links-block {
        background: #1f2937;
        border-color: #374151;
    }

    .semantic-links-title {
        color: #f9fafb;
    }

    .semantic-links-list a {
        color: #60a5fa;
    }

    .semantic-links-list a:hover {
        color: #93c5fd;
    }

    .semantic-links-block--card {
        background: #111827;
        border-color: #374151;
    }

    .semantic-links-block--card .semantic-links-title {
        color: #f9fafb;
        border-bottom-color: #374151;
    }

    .semantic-links-block--numbered {
        background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
        border-color: #3b82f6;
    }

    .semantic-links-block--numbered .semantic-links-title {
        color: #dbeafe;
    }

    .semantic-links-block--numbered .semantic-links-list a {
        color: #bfdbfe;
    }
}

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

.semantic-links-block:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.semantic-links-list a:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 4px;
    border-radius: 4px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .semantic-links-block,
    .semantic-links-list li,
    .semantic-links-list a,
    .semantic-links-block--loading::after {
        transition: none;
        animation: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .semantic-links-block {
        border-width: 2px;
        border-color: #000000;
    }

    .semantic-links-list a {
        text-decoration: underline;
        font-weight: 600;
    }
}
