/*
Theme Name: Astra-chld Propaganda automatic SEO
Theme URI: https://webagency.by/
Template: astra
Version: 5.0
Description: Автоматизированная SEO-оптимизированная дочерняя тема WEB агентства Propaganda с расширенной мобильной оптимизацией
Author: Propaganda Digital Agency
Author URI: https://webagency.by/
Text Domain: astra-child-seo
*/

/* ==================== BASE STYLES ==================== */
/* Наследуем все стили родительской темы Astra */
@import url('../astra/style.css');

/* ==================== AUTOMATIC SEO OPTIMIZATIONS ==================== */
/* Критический CSS для мобильных устройств */
@media (max-width: 768px) {
    /* Touch optimization for mobile */
    button, 
    a,
    input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Optimize images for mobile */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Improve readability on mobile */
    body {
        -webkit-font-smoothing: antialiased;
        text-rendering: optimizeLegibility;
        line-height: 1.6;
    }
    
    /* Better tap targets for iOS */
    .menu-toggle,
    input[type="submit"] {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Prevent zoom on input focus for iOS */
    input[type="text"],
    input[type="tel"],
    input[type="email"],
    textarea {
        font-size: 16px;
    }
}

/* ==================== ANDROID SPECIFIC OPTIMIZATIONS ==================== */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    /* Smooth scrolling for Android */
    body {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Better rendering for Android */
    * {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* ==================== IOS SPECIFIC OPTIMIZATIONS ==================== */
@supports (-webkit-touch-callout: none) {
    /* iOS specific fixes */
    .site-container {
        -webkit-transform: translateZ(0);
    }
    
    /* Prevent elastic scrolling on non-scrollable areas */
    body {
        overscroll-behavior-y: none;
    }
}

/* ==================== AUTOMATIC CONTENT STYLES ==================== */
.automatic-generated-faq {
    background: #f8f9fa;
    border-left: 4px solid #d62a1e;
    padding: 20px;
    margin: 30px 0;
    border-radius: 0 8px 8px 0;
}

.automatic-generated-faq h3 {
    color: #d62a1e;
    margin-top: 0;
}

.faq-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.faq-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.faq-item h4 {
    color: #333;
    margin: 0 0 10px 0;
    font-size: 16px;
}

.faq-item p {
    margin: 0;
    color: #666;
    line-height: 1.5;
}

/* ==================== PERFORMANCE OPTIMIZATIONS ==================== */
/* Lazy loading enhancements */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* ==================== CORE WEB VITALS OPTIMIZATIONS ==================== */
/* CLS (Cumulative Layout Shift) Prevention */
.image-container,
.video-container,
.ads-container {
    aspect-ratio: 16 / 9;
    width: 100%;
}

.responsive-image {
    width: 100%;
    height: auto;
    display: block;
}

/* LCP (Largest Contentful Paint) Optimization */
.lcp-element {
    content-visibility: auto;
    contain-intrinsic-size: 400px;
}

/* INP (Interaction to Next Paint) Optimization */
button, a, input {
    touch-action: manipulation;
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .automatic-generated-faq {
        display: none !important;
    }
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
    .automatic-generated-faq {
        border-left: 4px solid #000;
    }
}

/* ==================== DARK MODE SUPPORT ==================== */
@media (prefers-color-scheme: dark) {
    .automatic-generated-faq {
        background: #2d2d2d;
        color: #ffffff;
        border-left-color: #d62a1e;
    }
    
    .faq-item {
        border-bottom-color: #444;
    }
    
    .faq-item h4 {
        color: #ffffff;
    }
    
    .faq-item p {
        color: #cccccc;
    }
}

/* ==================== SCHEMA VISUAL ENHANCEMENTS ==================== */
.schema-rich-snippet {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    background: #f8f9fa;
}

.schema-rating {
    color: #ffc107;
    font-weight: bold;
}

/* ==================== LCP IMAGE OPTIMIZATION ==================== */
.hero-image,
.wp-post-image,
.featured-image {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Ensure LCP image is prioritized */
img[data-lcp] {
    fetchpriority: high;
}

/* ==================== WOOCOMMERCE COMPATIBILITY ==================== */
.woocommerce .astra-shop-summary-wrap {
    padding: 15px;
}

.woocommerce .star-rating {
    color: #d62a1e;
}

.woocommerce .price {
    color: #d62a1e;
    font-weight: bold;
}

/* ==================== YOAST SEO COMPATIBILITY ==================== */
.breadcrumbs {
    font-size: 14px;
    margin: 10px 0;
}

.breadcrumbs a {
    color: #d62a1e;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}