/* BNTIC - Burkina NTIC News
 * Styles personnalisés complémentaires
 */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bs-body-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--bs-secondary-bg);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bs-primary);
}

/* Selection color */
::selection {
    background: rgba(13, 110, 253, 0.3);
    color: inherit;
}

/* Image lazy loading fade */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* Card hover lift */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* Text gradient */
.text-gradient {
    background: linear-gradient(135deg, #0d6efd, #ff6b35);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glass morphism */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Animation fade in */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Stagger animation delays */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* Line clamp utilities */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Object fit */
.object-fit-cover {
    object-fit: cover;
}

/* Aspect ratios */
.ratio-3-2 {
    aspect-ratio: 3 / 2;
}

.ratio-4-3 {
    aspect-ratio: 4 / 3;
}

/* Print styles */
@media print {
    .no-print {
        display: none !important;
    }

    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible */
:focus-visible {
    outline: 3px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Custom badge sizes */
.badge-lg {
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

/* Video container */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Loading spinner */
.spinner-bntic {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bs-secondary-bg);
    border-top-color: var(--bs-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1060;
}

/* Reading progress bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #0d6efd, #ff6b35);
    z-index: 9999;
    transition: width 0.1s;
}

/* Category color borders */
.cat-border-left {
    border-left: 4px solid;
    padding-left: 1rem;
}

/* Sticky sidebar */
.sticky-sidebar {
    position: sticky;
    top: 90px;
}

/* Image zoom on hover */
.img-zoom {
    overflow: hidden;
}

.img-zoom img {
    transition: transform 0.5s ease;
}

.img-zoom:hover img {
    transform: scale(1.1);
}

/* Tooltip custom */
.custom-tooltip {
    position: relative;
}

.custom-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background: var(--bs-dark);
    color: white;
    font-size: 0.75rem;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.custom-tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 5px);
}

/* Share buttons */
.share-btn {
    transition: all 0.3s;
}

.share-btn:hover {
    transform: translateY(-3px);
}

/* Newsletter form */
.newsletter-form .form-control:focus {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

/* Article content typography */
.article-body p {
    margin-bottom: 1.5rem;
}

.article-body h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.article-body h3 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.article-body ul,
.article-body ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

.article-body blockquote {
    font-style: italic;
    border-left: 4px solid var(--bs-primary);
    padding-left: 1.5rem;
    margin: 2rem 0;
}

.article-body pre {
    background: var(--bs-dark);
    color: var(--bs-light);
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.article-body code {
    background: rgba(13, 110, 253, 0.1);
    color: var(--bs-primary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.article-body pre code {
    background: none;
    color: inherit;
    padding: 0;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2rem 0;
}

.article-body figure {
    margin: 2rem 0;
}

.article-body figcaption {
    text-align: center;
    font-size: 0.9rem;
    color: var(--bs-secondary);
    margin-top: 0.5rem;
}

.article-body table {
    width: 100%;
    margin: 2rem 0;
    border-collapse: collapse;
}

.article-body th,
.article-body td {
    padding: 0.75rem;
    border: 1px solid var(--bs-border-color);
}

.article-body th {
    background: var(--bs-secondary-bg);
    font-weight: 600;
}

/* Responsive typography */
@media (max-width: 768px) {
    .hero-title {
        font-size: 1.75rem !important;
    }

    .article-header-content h1 {
        font-size: 2rem !important;
    }

    .article-body {
        font-size: 1rem !important;
    }
}

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