/* ============================================
   CFO54.ru - Responsive Styles
   Mobile-First подход с адаптивностью
   ============================================ */

/* ============================================
   Base (Mobile) Styles - до 767px
   ============================================ */

/* Базовые стили уже определены в main.css как mobile-first */

/* ============================================
   Tablet Styles - 768px и выше
   ============================================ */

@media (min-width: 768px) {
  
  /* Typography */
  h1 {
    font-size: var(--text-5xl);
  }
  
  h2 {
    font-size: var(--text-4xl);
  }
  
  h3 {
    font-size: var(--text-3xl);
  }
  
  /* Layout */
  .container {
    padding: 0 var(--space-xl);
  }
  
  section {
    padding: var(--space-4xl) 0;
  }
  
  /* Grid System */
  .grid {
    gap: var(--space-xl);
  }
  
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Cards */
  .card {
    padding: var(--space-2xl);
  }
  
  /* Buttons */
  .btn-large {
    padding: 18px 36px;
    font-size: var(--text-xl);
  }
  
  /* Article */
  .article-content {
    font-size: var(--text-lg);
  }
  
  /* Interactive Elements */
  .interactive-element {
    padding: var(--space-2xl);
  }
}

/* ============================================
   Desktop Styles - 1024px и выше
   ============================================ */

@media (min-width: 1024px) {
  
  /* Typography */
  h1 {
    font-size: 3.5rem;
  }
  
  /* Grid System */
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
  
  /* Layout */
  .container {
    padding: 0 var(--space-2xl);
  }
  
  /* Two-column layout for article with sidebar */
  .article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--space-3xl);
  }
  
  /* Hover effects only on desktop */
  .card:hover {
    transform: translateY(-8px);
  }
  
  .related-articles a:hover {
    transform: translateX(8px);
  }
}

/* ============================================
   Large Desktop - 1200px и выше
   ============================================ */

@media (min-width: 1200px) {
  
  /* Container max-width already set in main.css */
  
  /* Larger spacing for big screens */
  section {
    padding: var(--space-4xl) 0;
  }
  
  .grid {
    gap: var(--space-2xl);
  }
}

/* ============================================
   Mobile-Specific Styles - до 767px
   ============================================ */

@media (max-width: 767px) {
  
  /* Typography adjustments */
  h1 {
    font-size: var(--text-3xl);
  }
  
  h2 {
    font-size: var(--text-2xl);
  }
  
  h3 {
    font-size: var(--text-xl);
  }
  
  /* Reduce spacing on mobile */
  section {
    padding: var(--space-2xl) 0;
  }
  
  .container {
    padding: 0 var(--space-md);
  }
  
  /* Stack grid items */
  .grid,
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
  
  /* Cards */
  .card {
    padding: var(--space-lg);
  }
  
  /* Buttons full-width on mobile */
  .btn-mobile-full {
    width: 100%;
    display: block;
  }
  
  /* Interactive elements */
  .interactive-element {
    padding: var(--space-lg);
  }
  
  /* Article meta */
  .meta {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }
  
  /* Reduce card hover effect on mobile */
  .card:hover {
    transform: translateY(-2px);
  }
  
  /* Quiz options */
  .quiz-option {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--text-sm);
  }
  
  /* Calculator inputs */
  .calc-input-group input {
    font-size: var(--text-base);
  }
}

/* ============================================
   Small Mobile - до 375px
   ============================================ */

@media (max-width: 375px) {
  
  /* Further reduce typography */
  h1 {
    font-size: var(--text-2xl);
  }
  
  h2 {
    font-size: var(--text-xl);
  }
  
  /* Tighter spacing */
  .container {
    padding: 0 var(--space-sm);
  }
  
  section {
    padding: var(--space-xl) 0;
  }
  
  .card {
    padding: var(--space-md);
  }
  
  /* Smaller buttons */
  .btn {
    padding: 10px 20px;
    font-size: var(--text-sm);
  }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
  
  /* Hide non-essential elements */
  .no-print,
  nav,
  .hamburger,
  .partner-block,
  .related-articles,
  .interactive-element {
    display: none !important;
  }
  
  /* Optimize for print */
  body {
    font-size: 12pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }
  
  a {
    color: #000;
    text-decoration: underline;
  }
  
  /* Show URLs after links */
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }
  
  /* Page breaks */
  h1, h2, h3 {
    page-break-after: avoid;
  }
  
  img {
    max-width: 100% !important;
  }
  
  /* Remove shadows and transitions */
  * {
    box-shadow: none !important;
    transition: none !important;
  }
}

/* ============================================
   Accessibility - Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .reveal {
    opacity: 1;
    transform: none;
  }
  
  .card:hover,
  .btn:hover {
    transform: none;
  }
}

/* ============================================
   High Contrast Mode
   ============================================ */

@media (prefers-contrast: high) {
  
  :root {
    --primary-color: #0000ff;
    --text-primary: #000000;
    --background: #ffffff;
    --border: #000000;
  }
  
  .btn {
    border: 2px solid currentColor;
  }
  
  a {
    text-decoration: underline;
  }
}

/* ============================================
   Dark Mode Support (Optional)
   ============================================ */

@media (prefers-color-scheme: dark) {
  
  /* Uncomment to enable dark mode */
  /*
  :root {
    --background: #1a1a1a;
    --surface: #2d2d2d;
    --surface-dark: #3d3d3d;
    --text-primary: #f5f5f5;
    --text-secondary: #b0b0b0;
    --text-muted: #808080;
    --border: #404040;
  }
  
  .card {
    background: var(--surface);
  }
  
  input,
  textarea,
  select {
    background-color: var(--surface);
    color: var(--text-primary);
    border-color: var(--border);
  }
  */
}

/* ============================================
   Landscape Orientation (Mobile)
   ============================================ */

@media (max-width: 767px) and (orientation: landscape) {
  
  /* Reduce vertical spacing in landscape */
  section {
    padding: var(--space-xl) 0;
  }
  
  h1 {
    font-size: var(--text-2xl);
  }
  
  h2 {
    font-size: var(--text-xl);
  }
}

/* ============================================
   Landing Page Responsive Styles
   ============================================ */

/* Hero Section */
@media (min-width: 768px) {
  .hero-content {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
  }
  
  .hero-text {
    text-align: left;
  }
  
  .hero-subtitle {
    margin-left: 0;
    margin-right: 0;
  }
}

@media (max-width: 767px) {
  .hero {
    padding: var(--space-3xl) 0 var(--space-2xl);
  }
  
  .hero h1 {
    font-size: var(--text-3xl);
  }
  
  .hero-subtitle {
    font-size: var(--text-base);
  }
}

/* Why Section */
@media (min-width: 768px) {
  .why-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .why-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Infographic Section */
@media (max-width: 767px) {
  .cycle-infographic {
    max-height: 400px;
  }
  
  .cycle-description {
    gap: var(--space-md);
  }
  
  .cycle-step {
    padding: var(--space-md);
  }
}

@media (min-width: 768px) {
  .cycle-description {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Silos Section */
@media (min-width: 768px) {
  .silos-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .silos-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .silos-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 767px) {
  .silo-card {
    padding: var(--space-xl);
  }
  
  .silo-icon {
    font-size: 40px;
  }
  
  .silo-card h3 {
    font-size: var(--text-xl);
  }
}

/* Calculator Section */
@media (min-width: 768px) {
  .calculator-content {
    grid-template-columns: 1fr 1.2fr;
  }
}

@media (max-width: 767px) {
  .calculator-info,
  .calculator-form {
    padding: var(--space-xl);
  }
  
  .calculator-info h3 {
    font-size: var(--text-xl);
  }
  
  .result-value {
    font-size: var(--text-xl);
  }
}

/* Articles Section */
@media (min-width: 768px) {
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
  }
}

@media (min-width: 1024px) {
  .articles-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 767px) {
  .article-image {
    height: 200px;
  }
  
  .article-content {
    padding: var(--space-lg);
  }
  
  .article-card h3 {
    font-size: var(--text-lg);
  }
}
