/* =====================================================
   SEO & Accessibility Enhancements
   Masarat Al Diyar - Additional Styles
   ===================================================== */

/* Breadcrumb Navigation */
.breadcrumb-nav {
    padding: 20px 0;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    color: var(--text-muted);
}

.breadcrumb li:not(:last-child)::after {
    content: '/';
    margin: 0 8px;
    color: var(--text-lighter);
}

.breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb li:last-child {
    color: var(--primary-color);
    font-weight: 500;
}

/* Skip to Content Link (Accessibility) */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100000;
    border-radius: 0 0 4px 0;
}

.skip-to-content:focus {
    top: 0;
}

/* Improved Focus Styles for Accessibility */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Screen Reader Only Text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Lazy Loading Images - Fade In Effect */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

img[loading="lazy"].loaded,
img[loading="lazy"]:not([data-src]) {
    opacity: 1;
}

/* Responsive Images */
img {
    height: auto;
    max-width: 100%;
}

/* Improve CLS - Reserve Space for Images */
img[width][height] {
    height: auto;
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .back-to-top,
    .beta-alert,
    .btn,
    .hero-scroll {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    a {
        text-decoration: underline;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
}

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

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0052a3;
        --text-color: #000;
        --bg-color: #fff;
        --border-color: #000;
    }
}

/* Dark Mode Support (Future Enhancement) */
@media (prefers-color-scheme: dark) {
    /* Uncomment when ready to implement dark mode
    :root {
        --primary-color: #3399ff;
        --text-color: #e0e0e0;
        --bg-color: #1a1a1a;
        --bg-light: #2a2a2a;
        --border-color: #404040;
    }
    */
}

/* Mobile Breadcrumb Optimization */
@media (max-width: 768px) {
    .breadcrumb-nav {
        padding: 15px 0;
    }
    
    .breadcrumb {
        font-size: 0.85rem;
    }
    
    .breadcrumb li:not(:last-child)::after {
        margin: 0 6px;
    }
}

/* Performance: Will-Change for Animated Elements */
.navbar,
.back-to-top,
.hero-scroll {
    will-change: transform;
}

/* Optimize Font Rendering */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Prevent Layout Shift on Scroll */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* Improve Touch Targets (Accessibility) */
@media (hover: none) and (pointer: coarse) {
    a,
    button,
    .btn,
    .nav-menu a {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}
