/**
 * SEO.CSS - SEO-focused styles and optimizations
 * Improves Core Web Vitals, accessibility, and search engine visibility
 */

/* ================================
   CORE WEB VITALS OPTIMIZATIONS
   ================================ */

/* Prevent layout shifts by reserving space for images */
.image-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Optimize largest contentful paint */
.hero-image,
.portfolio-item img {
    content-visibility: auto;
    contain-intrinsic-size: 800px 600px;
}

/* Prevent cumulative layout shift in portfolio grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    contain: layout style paint;
}

.portfolio-item {
    aspect-ratio: 4/3;
    contain: layout style;
}

/* ================================
   STRUCTURED DATA VISIBILITY
   ================================ */

/* Hidden but accessible breadcrumbs for SEO */
.seo-breadcrumbs {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.seo-breadcrumbs ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

.seo-breadcrumbs li {
    display: inline;
}

.seo-breadcrumbs li::after {
    content: " > ";
}

.seo-breadcrumbs li:last-child::after {
    content: "";
}

/* ================================
   SCHEMA.ORG MICRODATA STYLES
   ================================ */

/* Organization info styling */
.organization-info {
    display: none; /* Hidden but readable by search engines */
}

.contact-info[itemscope] {
    position: relative;
}

/* Business hours styling */
.opening-hours {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
}

/* ================================
   SEMANTIC HTML ENHANCEMENTS
   ================================ */

/* Article and section styling for better content structure */
article header {
    margin-bottom: 1.5rem;
}

article .meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* FAQ section styling for rich snippets and interactive functionality */
.faq-section {
    margin: 3rem 0;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(212, 175, 55, 0.3);
}

.faq-question {
    font-weight: 600;
    color: #e2e8f0;
    margin: 0;
    padding: 1.5rem 2rem;
    cursor: pointer;
    position: relative;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question:hover {
    color: #d4af37;
    background: rgba(212, 175, 55, 0.1);
}

.faq-question:focus {
    outline: 2px solid #d4af37;
    outline-offset: -2px;
}

.faq-toggle {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    background: rgba(212, 175, 55, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem !important;
    font-weight: bold !important;
    color: #d4af37 !important;
    transition: all 0.3s ease !important;
    margin-left: 1rem;
}

.faq-answer {
    color: #cbd5e0;
    line-height: 1.7;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease-out;
    padding: 0 2rem;
}

.faq-answer.open {
    padding: 0 2rem 1.5rem;
}

.faq-answer.open {
    max-height: 200px;
}

/* ================================
   LOCAL BUSINESS OPTIMIZATION
   ================================ */

/* Contact card with structured data */
.contact-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-card .business-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #d4af37;
    margin-bottom: 1rem;
}

.contact-card .address {
    color: #e2e8f0;
    margin-bottom: 0.5rem;
}

.contact-card .phone,
.contact-card .email {
    color: #90cdf4;
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-card .phone:hover,
.contact-card .email:hover {
    color: #d4af37;
}

/* ================================
   RICH SNIPPETS OPTIMIZATION
   ================================ */

/* Review/rating display */
.rating-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.stars {
    color: #d4af37;
    font-size: 1.2rem;
}

.rating-text {
    color: #666;
    font-size: 0.9rem;
}

/* Service pricing display */
.pricing-card {
    position: relative;
    overflow: hidden;
}

.pricing-card .price {
    font-size: 2rem;
    font-weight: 700;
    color: #d4af37;
}

.pricing-card .price-period {
    font-size: 0.9rem;
    color: #666;
}

/* ================================
   IMAGE SEO OPTIMIZATION
   ================================ */

/* Ensure all images have proper aspect ratios */
.portfolio-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 4/3;
}

/* Image caption styling for alt text visibility in dev */
.image-caption {
    font-size: 0.85rem;
    color: #666;
    text-align: center;
    margin-top: 0.5rem;
    font-style: italic;
}

/* ================================
   SOCIAL MEDIA OPTIMIZATION
   ================================ */

/* Social sharing buttons */
.social-share {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
}

.social-share-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.social-share-button.facebook {
    background-color: #1877f2;
    color: white;
}

.social-share-button.twitter {
    background-color: #1da1f2;
    color: white;
}

.social-share-button.linkedin {
    background-color: #0077b5;
    color: white;
}

.social-share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Social media links */

/* Svarta sociala medier-ikoner */
.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0,0,0,0.15);
    color: #111 !important;
}

.social-link i {
    font-size: 1.2rem;
    color: #111 !important;
    transition: color 0.3s ease;
}

.social-link:hover,
.social-link:focus {
    background: #111;
    color: #fff !important;
    border-color: #111;
    outline: none;
}

.social-link:hover i,
.social-link:focus i {
    color: #fff !important;
}

/* ================================
   PERFORMANCE OPTIMIZATIONS
   ================================ */

/* Critical CSS above the fold */
.above-fold {
    contain: layout style paint;
}

/* Lazy loading states */
.lazy-image {
    transition: opacity 0.3s ease;
    opacity: 0;
}

.lazy-image.loaded {
    opacity: 1;
}

/* Reduce paint area for animations */
.animated-element {
    will-change: transform;
    transform: translateZ(0);
}

/* ================================
   ACCESSIBILITY & SEO HARMONY
   ================================ */

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

/* Focus visible for keyboard navigation and accessibility */
.portfolio-item:focus-visible,
.cta-button:focus-visible {
    outline: 3px solid #d4af37;
    outline-offset: 2px;
}

/* ================================
   MOBILE-FIRST SEO
   ================================ */

/* Mobile-optimized typography for better readability */
@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero h1 {
        font-size: 2.5rem;
        line-height: 1.1;
    }
    
    /* Optimize tap targets for mobile */
    .portfolio-item,
    .cta-button {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Mobile FAQ styling */
    .faq-question {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
    
    .faq-answer {
        padding: 0 1.5rem;
    }
    
    .faq-answer.open {
        padding: 0 1.5rem 1rem;
    }
    
    .faq-toggle {
        width: 25px;
        height: 25px;
        font-size: 1rem !important;
        margin-left: 0.5rem;
    }
}

/* ================================
   PRINT STYLES FOR SEO
   ================================ */

@media print {
    .portfolio-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .contact-info {
        display: block !important;
    }
    
    .hero {
        height: auto;
    }
    
    /* Ensure URLs are visible in print */
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 0.8rem;
        color: #666;
    }
}

/* ================================
   DARK MODE SEO CONSIDERATIONS
   ================================ */

@media (prefers-color-scheme: dark) {
    .image-placeholder {
        background: linear-gradient(90deg, #2d2d2d 25%, #3d3d3d 50%, #2d2d2d 75%);
    }
    
    .faq-question {
        color: #e2e8f0;
    }
    
    .faq-answer {
        color: #cbd5e0;
    }
}

/* ================================
   REDUCED MOTION FOR ACCESSIBILITY
   ================================ */

@media (prefers-reduced-motion: reduce) {
    .animated-element,
    .loading,
    .portfolio-item {
        animation: none !important;
        transition: none !important;
    }
}

/* ================================
   ADVANCED SEO PERFORMANCE OPTIMIZATIONS
   ================================ */

/* Hero image optimering för LCP (Largest Contentful Paint) */
.hero-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-background-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    /* Optimera för Core Web Vitals */
    content-visibility: auto;
    contain-intrinsic-size: 1920px 1080px;
}

/* Hero local info styling */
.hero-local-info {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
    font-weight: 500;
}

.location-text {
    color: #d4af37;
    font-weight: 600;
}

/* Hero description med SEO-fokus */
.hero-description {
    font-size: 1.25rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-description strong {
    color: #d4af37;
    font-weight: 600;
}

.hero-description em {
    color: #90cdf4;
    font-style: normal;
    font-weight: 500;
}

/* Hero breadcrumb (dold men SEO-vänlig) */
.hero-breadcrumb {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Förbättrad CTA button styling för högre CTR */
.cta-button {
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.cta-button:hover::before {
    left: 100%;
}

/* ================================
   LOCAL SEO ENHANCEMENTS
   ================================ */

/* Contact cards med bättre local business info */
.contact-card[itemscope] {
    position: relative;
    padding: 2rem;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1.5rem;
}

.contact-card h3 {
    color: #d4af37;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.contact-card i {
    color: #90cdf4;
    margin-right: 0.75rem;
    font-size: 1.2rem;
}

/* Opening hours styling för structured data */
.opening-hours {
    line-height: 1.8;
}

.opening-hours [itemprop="openingHours"] {
    display: block;
    color: #e2e8f0;
    font-weight: 500;
}

/* ================================
   ENHANCED IMAGE SEO
   ================================ */

/* Portfolio images med bättre SEO attribut */
.portfolio-item img[loading="lazy"] {
    transition: opacity 0.3s ease;
}

.portfolio-item img[loading="lazy"]:not([src]) {
    opacity: 0;
}

/* Image caption för SEO och accessibility */
.portfolio-item .image-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 2rem 1rem 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.portfolio-item:hover .image-caption {
    transform: translateY(0);
}

/* ================================
   SOCIAL PROOF OPTIMIZATION
   ================================ */

/* Testimonials för social proof och SEO */
.testimonial-card[itemscope] {
    position: relative;
    padding: 2rem;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(212, 175, 55, 0.2);
    margin-bottom: 2rem;
}

.testimonial-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.testimonial-stars {
    color: #d4af37;
    font-size: 1.1rem;
}

.testimonial-text {
    font-style: italic;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    color: #e2e8f0;
}

.testimonial-author {
    font-weight: 600;
    color: #d4af37;
}

.testimonial-type {
    color: #90cdf4;
    font-size: 0.9rem;
}

/* ================================
   CALL-TO-ACTION OPTIMIZATION
   ================================ */

/* Enhanced CTA buttons för bättre conversion */
.cta-button.primary {
    background: linear-gradient(135deg, #d4af37, #f1c40f);
    box-shadow: 0 8px 32px rgba(212, 175, 55, 0.3);
    border: 2px solid transparent;
}

.cta-button.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(212, 175, 55, 0.4);
    background: linear-gradient(135deg, #f1c40f, #d4af37);
}

.cta-button.secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.cta-button.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #d4af37;
    transform: translateY(-2px);
}

/* ================================
   MOBILE-FIRST SEO OPTIMIZATIONS
   ================================ */

@media (max-width: 768px) {
    /* Mobile hero optimering */
    .hero-description {
        font-size: 1.1rem;
        padding: 0 1rem;
    }
    
    .hero-local-info {
        font-size: 0.85rem;
        text-align: center;
    }
    
    /* Mobile contact cards */
    .contact-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    /* Mobile CTA buttons */
    .cta-button {
        padding: 1rem 1.5rem;
        font-size: 0.95rem;
        width: 100%;
        margin-bottom: 1rem;
    }
    
    /* Mobile portfolio optimering */
    .portfolio-item {
        margin-bottom: 1.5rem;
    }
    
    .portfolio-item .image-caption {
        position: static;
        transform: none;
        background: rgba(0,0,0,0.9);
        margin-top: -5px;
        border-radius: 0 0 15px 15px;
    }
}

/* ================================
   ACCESSIBILITY & SEO HARMONY
   ================================ */

/* Focus indicators för keyboard navigation */
.cta-button:focus-visible,
.portfolio-item:focus-visible,
.contact-card:focus-visible {
    outline: 3px solid #d4af37;
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(212, 175, 55, 0.2);
}

/* Skip links för accessibility och SEO */
.skip-link:focus {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: #d4af37;
    color: #000;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* ================================
   PERFORMANCE OPTIMIZATIONS
   ================================ */

/* Lazy loading animations */
.lazy-load-fade {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.lazy-load-fade.loaded {
    opacity: 1;
}

/* Reduce motion för accessibility */
@media (prefers-reduced-motion: reduce) {
    .cta-button,
    .portfolio-item img,
    .lazy-load-fade,
    .hero-background-image {
        transition: none !important;
        animation: none !important;
    }
    
    .cta-button::before {
        display: none;
    }
}

/* ================================
   PRINT STYLES FÖR SEO
   ================================ */

@media print {
    /* Visa kontaktinfo tydligt i print */
    .hero-local-info,
    .contact-card,
    .organization-info {
        display: block !important;
        position: static !important;
        color: #000 !important;
        background: #fff !important;
    }
    
    /* Dölj onödiga element i print */
    .floating-elements,
    .particles-canvas,
    .scroll-indicator,
    .cta-button {
        display: none !important;
    }
    
    /* Optimera text för print */
    .hero h1 {
        color: #000 !important;
        font-size: 2rem !important;
    }
    
    .hero-description {
        color: #333 !important;
        font-size: 1rem !important;
    }
}
