/**
 * SEO Enhancement CSS для FinHelp
 * Дополнительные стили для улучшения SEO показателей
 */

/* === КРИТИЧЕСКИЙ CSS ДЛЯ FOLD === */
/* Встроенные критические стили для улучшения LCP */

/* Оптимизация шрифтов для SEO */
.fonts-loading {
  visibility: hidden;
}

.fonts-loaded {
  visibility: visible;
}

/* Fallback системные шрифты до загрузки веб-шрифтов */
.fonts-loading body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* === STRUCTURED DATA СТИЛИ === */
/* Скрытые элементы для микроразметки */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Микроразметка для контактов */
.contact-schema {
  display: none;
}

/* === LAZY LOADING ОПТИМИЗАЦИЯ === */
img.lazy {
  opacity: 0;
  transition: opacity 0.3s;
}

img.lazy.loaded {
  opacity: 1;
}

/* Placeholder для изображений */
.img-placeholder {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 0.5rem;
}

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

/* === BREADCRUMBS SEO ОПТИМИЗАЦИЯ === */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0;
  font-size: 0.875rem;
}

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

.breadcrumbs a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.breadcrumbs-separator {
  color: var(--border);
  user-select: none;
}

.breadcrumbs span:last-child {
  color: var(--text);
  font-weight: 500;
}

/* === СЕМАНТИЧЕСКАЯ РАЗМЕТКА === */
/* Заголовки для SEO иерархии */
.seo-heading-primary {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text);
}

.seo-heading-secondary {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.seo-heading-tertiary {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 0.5rem;
  color: var(--text);
}

/* === SCHEMA.ORG МИКРОРАЗМЕТКА === */
/* Стили для элементов с микроразметкой */
[itemscope] {
  position: relative;
}

/* Визуальные подсказки для разработчиков (только в dev режиме) */
.dev-mode [itemscope]::before {
  content: attr(itemtype);
  position: absolute;
  top: -1.5rem;
  left: 0;
  background: var(--accent);
  color: white;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  z-index: 1000;
  white-space: nowrap;
  opacity: 0.8;
  pointer-events: none;
}

/* === FAQ СХЕМА === */
.faq-section {
  margin: 2rem 0;
}

.faq-item {
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.faq-question {
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text);
  cursor: pointer;
  padding: 1rem 0;
}

.faq-answer {
  color: var(--text-muted);
  line-height: 1.6;
  padding-bottom: 1rem;
}

/* === ЛОКАЛЬНЫЙ БИЗНЕС РАЗМЕТКА === */
.local-business-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin: 1rem 0;
}

.local-address {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.local-address-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 0.125rem;
}

.local-contact {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.local-contact-icon {
  width: 1rem;
  height: 1rem;
  color: var(--primary);
  flex-shrink: 0;
}

/* === ПРОИЗВОДИТЕЛЬНОСТЬ === */
/* Критические стили должны быть инлайн */
.critical-above-fold {
  contain: layout style paint;
}

/* Non-critical контент */
.below-fold {
  content-visibility: auto;
  contain-intrinsic-size: 1000px;
}

/* === АДАПТИВНЫЕ МЕДИА === */
/* Responsive изображения для Core Web Vitals */
.responsive-img {
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: cover;
  border-radius: 0.5rem;
}

/* Aspect ratio containers */
.aspect-video {
  aspect-ratio: 16 / 9;
}

.aspect-square {
  aspect-ratio: 1 / 1;
}

.aspect-golden {
  aspect-ratio: 1.618 / 1;
}

/* === ACCESSIBILITY ДЛЯ SEO === */
/* Skip links для навигации */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary);
  color: var(--surface);
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 1000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 6px;
}

/* Фокус-индикаторы */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

/* === RICH SNIPPETS СТИЛИ === */
.rich-snippet {
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  padding: 1.5rem;
  border-radius: 0.5rem;
  margin: 1.5rem 0;
}

.rich-snippet-title {
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.rich-snippet-content {
  color: var(--text-muted);
  line-height: 1.6;
}

/* Цены и предложения */
.price-snippet {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  font-weight: 600;
  color: var(--primary);
}

.price-snippet .currency {
  font-size: 0.875em;
  color: var(--text-muted);
}

.price-snippet .old-price {
  text-decoration: line-through;
  color: var(--text-muted);
  font-weight: 400;
}

/* === PERFORMANCE ОПТИМИЗАЦИЯ === */
/* Reduce motion для пользователей с accessibility настройками */
@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;
  }
}

/* === PRINT СТИЛИ ДЛЯ SEO === */
@media print {
  .no-print {
    display: none !important;
  }
  
  .print-only {
    display: block !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.4;
    color: #000;
    background: #fff;
  }
  
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 10pt;
    color: #666;
  }
  
  .breadcrumbs {
    font-size: 10pt;
    border-bottom: 1px solid #ccc;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
  }
}
