/**
 * SEO-related Styles
 * Breadcrumbs, Structured Elements, and SEO-friendly Components
 * Poetry Translated Platform
 */

/* ===================================
   BREADCRUMB NAVIGATION
   =================================== */
.breadcrumb-nav {
    padding: 15px 20px;
    background: rgba(16, 185, 129, 0.05);
    border-bottom: 1px solid rgba(16, 185, 129, 0.1);
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
    color: rgba(250, 250, 250, 0.7);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    padding: 0 10px;
    color: rgba(250, 250, 250, 0.4);
}

.breadcrumb-item a {
    color: var(--emerald-glow);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: var(--henna, #95472d);
    text-decoration: underline;
}

.breadcrumb-item span {
    color: rgba(250, 250, 250, 0.9);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .breadcrumb-nav {
        padding: 10px 15px;
    }

    .breadcrumb {
        font-size: 0.85rem;
    }

    .breadcrumb-item + .breadcrumb-item::before {
        padding: 0 5px;
    }
}

/* ===================================
   SEMANTIC HTML HELPERS
   =================================== */

/* Ensure main content is identifiable */
main {
    min-height: 60vh;
}

/* Hide schema.org metadata from visual display */
meta[itemprop] {
    display: none !important;
}

/* Structured data containers */
[itemscope] {
    /* Ensure structured data doesn't affect layout */
}

/* ===================================
   LOADING STATES FOR SEO
   =================================== */

/* Skeleton loading for images (better CLS) */
img.lazy {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.2) 50%, rgba(16, 185, 129, 0.1) 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

img.lazy.loaded {
    animation: none;
    background: none;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ===================================
   ACCESSIBILITY & SEO
   =================================== */

/* Skip to content link for screen readers */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--emerald-glow);
    color: #0A0A0A;
    padding: 8px 15px;
    text-decoration: none;
    z-index: 100000;
    font-weight: bold;
}

.skip-to-content:focus {
    top: 0;
}

/* Ensure proper heading hierarchy visibility */
h1, h2, h3, h4, h5, h6 {
    /* Makes headings more identifiable for SEO */
    margin-top: 1em;
    margin-bottom: 0.5em;
}

h1:first-child,
h2:first-child,
h3:first-child {
    margin-top: 0;
}

/* ===================================
   STRUCTURED DATA VISIBILITY
   =================================== */

/* JSON-LD scripts should be in head, but if in body, hide them */
script[type="application/ld+json"] {
    display: none !important;
}

/* ===================================
   PRINT STYLES FOR SEO
   =================================== */
@media print {
    .breadcrumb-nav {
        display: block;
        background: none;
        border: none;
        padding: 10px 0;
    }

    .breadcrumb-item a {
        color: #000;
        text-decoration: none;
    }

    .breadcrumb-item a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }

    /* Hide navigation, ads, etc */
    nav:not(.breadcrumb-nav),
    .footer,
    .share-modal,
    button {
        display: none !important;
    }

    /* Ensure content is readable */
    body {
        background: white;
        color: black;
    }

    /* Show full URLs for links */
    a::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
}

/* ===================================
   RICH SNIPPETS PREVIEW
   =================================== */

/* Visual hint for rich snippet elements */
[itemprop="name"],
[itemprop="author"],
[itemprop="description"] {
    /* Could add subtle indicators in dev mode */
}

/* ===================================
   MOBILE FIRST OPTIMIZATIONS
   =================================== */

/* Ensure touch targets are large enough (SEO + UX) */
a, button, input, select, textarea {
    min-height: 44px;
    min-width: 44px;
}

/* Readable font sizes on mobile */
@media (max-width: 768px) {
    body {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }
}

/* ===================================
   PERFORMANCE OPTIMIZATIONS
   =================================== */

/* Defer non-critical background images */
.bg-deferred {
    background-image: none !important;
}

.bg-deferred.loaded {
    /* Background will be set via JS */
}

/* Reduce motion for users who prefer it (accessibility + SEO) */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===================================
   CORE WEB VITALS OPTIMIZATIONS
   =================================== */

/* Prevent layout shift for images */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Reserve space for lazy-loaded images */
img[data-src] {
    aspect-ratio: attr(width) / attr(height);
}

/* Prevent font flash (FOUT) */
@font-face {
    font-family: 'HSN Naskh';
    src: url('../fonts/arfonts-hsn-naskh-farisi For POETRY/hsn-naskh-farisi.ttf') format('truetype');
    font-display: swap; /* Better CLS score */
}

/* ===================================
   DARK MODE CONSIDERATIONS
   =================================== */
@media (prefers-color-scheme: dark) {
    /* Site is already dark, but ensure consistency */
    :root {
        color-scheme: dark;
    }
}

/* ===================================
   HIGH CONTRAST MODE
   =================================== */
@media (prefers-contrast: high) {
    .breadcrumb-nav {
        border-bottom: 2px solid var(--emerald-glow);
    }

    .breadcrumb-item a {
        text-decoration: underline;
    }
}
