/* ===== FIRST MOBILE STYLES ===== */
/* Базовые стили для мобильных устройств (mobile first) */

/* Общие стили для блога */
.blog--style {
  background: #ffffff;
}

.blog-wrapper {
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
}

.blog-wrapper h1,
.blog-wrapper h2,
.blog-wrapper h3,
.blog-wrapper h4 {
  scroll-margin-top: 100px;
}

.blog-wrapper a {
  font-size: 16px;
  font-weight: 700;
}

/* ===== ГАЛЕРЕЯ (mobile first) ===== */
.gallery {
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 12px;
  margin: 24px 0 30px 0;
}

.gallery img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 2px solid #26856a8b;
  transition: transform 0.3s ease;
}

.gallery img:active {
  transform: scale(1.02);
}

/* ===== СОДЕРЖАНИЕ (mobile first) ===== */
.toc {
  background: #a7e1cfba;
  padding: 12px;
  margin-bottom: 1.5em;
  border-radius: 8px;
  border: 1px solid fuchsia;
}

.toc a {
  font-size: 14px;
  font-weight: 400;
  color: #1a3c32;
  text-decoration: none;
}

.toc a:active {
  color: #26856a;
  text-decoration: underline;
}

.toc strong {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
}

.toc ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.toc ul li {
  margin-bottom: 2px;
}

/* ===== СПИСКИ (mobile first) ===== */
.blog-wrapper ul,
.blog-wrapper ol {
  padding-left: 20px;
  line-height: 1.5;
}

.blog-wrapper li {
  margin-bottom: 6px;
  padding-left: 4px;
  font-size: 15px;
}

.blog-wrapper ul li {
  list-style-type: disc;
  color: #333;
}

.blog-wrapper ol li {
  list-style-type: decimal;
  color: #333;
}

.blog-wrapper li strong {
  color: #2c3e50;
}

/* ===== ЗАГОЛОВКИ (mobile first) ===== */
.blog-wrapper h1 {
  font-size: 28px;
  margin-bottom: 0.5em;
  color: #1a3c32;
  line-height: 1.3;
  word-break: break-word;
}

.blog-wrapper h2 {
  font-size: 24px;
  margin: 1.2em 0 0.5em 0;
  color: #26856a;
  border-bottom: 2px solid #e6f2ef;
  padding-bottom: 8px;
}

.blog-wrapper h3 {
  font-size: 20px;
  margin: 0.8em 0 0.5em 0;
  color: #2c3e50;
}

.blog-wrapper h4 {
  font-size: 18px;
  margin: 0.6em 0 0.4em 0;
  color: #2c3e50;
}

.blog-wrapper p {
  line-height: 1.6;
  margin-bottom: 1em;
  color: #333;
  font-size: 16px;
}

/* Дата и автор */
.blog-wrapper small {
  display: block;
  margin-bottom: 1.2em;
  color: #666;
  font-size: 13px;
}

/* ===== СЕТКА БЛОГА (mobile first) ===== */
.blog-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 16px 0;
}

.blog-card {
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease-in-out;
  background: white;
}

.blog-card:active {
  border: 1px solid fuchsia;
}

.blog-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-image {
  height: 180px;
  overflow: hidden;
  position: relative;
  background: #f5f5f5;
  flex-shrink: 0;
}

.blog-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-image.placeholder {
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: #008b649e;
}

.blog-content {
  padding: 16px;
  flex-grow: 1;
}

.blog-title {
  margin: 0 0 8px 0;
  font-size: 18px;
  line-height: 1.4;
  color: #333;
  font-weight: 700;
}

.blog-date {
  color: #666;
  font-size: 12px;
  margin-bottom: 8px;
  display: block;
}

.blog-desc {
  color: #555;
  line-height: 1.5;
  margin: 0;
  font-size: 14px;
}

/* ===== ПАГИНАЦИЯ (mobile first) ===== */
.pagination {
  text-align: center;
  margin: 30px 0 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.pagination ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.pagination li {
  flex: 0 0 auto;
}

.pagination a {
  display: block;
  padding: 8px 12px;
  min-width: 36px;
  text-decoration: none;
  color: #26856a;
  border: 1px solid #ddd;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

.pagination a:active {
  background: #26856a8c;
  color: #fff;
  border-color: #26856a;
}

.pagination li.active a {
  background: #26856a;
  color: #fff;
  border-color: #26856a;
  pointer-events: none;
}

.pagination li span {
  display: block;
  padding: 8px 8px;
  color: #666;
  font-size: 14px;
}

/* ===== REPAIR BLOCK (mobile first) ===== */
.repair-block {
  margin-top: 32px;
  padding: 20px 16px;
  background: linear-gradient(135deg, #f0f9f5 0%, #e6f2ef 100%);
  border: 2px solid #cce8df;
  border-radius: 12px;
  text-align: center;
}

.repair-block h3 {
  margin-top: 0;
  font-size: 20px;
  color: #1a3c32;
  margin-bottom: 12px;
}

.repair-phone {
  font-size: 18px;
  margin: 12px 0;
}

.repair-phone a {
  font-weight: 700;
  text-decoration: none;
  color: #26856a;
  font-size: 22px;
  display: inline-block;
  padding: 8px 0;
}

.repair-phone a:active {
  color: #1a3c32;
  text-decoration: underline;
}

.repair-note {
  font-size: 12px;
  color: #666;
  margin-top: 12px;
  font-style: italic;
}

/* ===== ПЛАНШЕТЫ (min-width: 480px) ===== */
@media (min-width: 480px) {
  .blog-wrapper {
    padding: 0 20px;
  }
  
  .blog-title {
    font-size: 20px;
  }
  
  .blog-desc {
    font-size: 15px;
  }
  
  .blog-image {
    height: 200px;
  }
  
  .blog-wrapper h1 {
    font-size: 32px;
  }
  
  .blog-wrapper h2 {
    font-size: 28px;
  }
  
  .blog-wrapper h3 {
    font-size: 24px;
  }
  
  .repair-phone a {
    font-size: 24px;
  }
}

/* ===== ДЕСКТОП (min-width: 768px) ===== */
@media (min-width: 768px) {
  .blog-wrapper {
    max-width: 700px;
    padding: 0;
  }
  
  .blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin: 32px 0;
  }
  
  .blog-card {
    transition: all 0.2s ease-in-out;
  }
  
  .blog-card:hover {
    border: 1px solid fuchsia;
    transform: translateY(-2px);
  }
  
  .blog-card:active {
    transform: translateY(0);
  }
  
  .blog-image {
    height: 200px;
  }
  
  .blog-image.placeholder {
    font-size: 56px;
  }
  
  .gallery {
    gap: 8px;
    margin: 30px 0 35px 0;
  }
  
  .gallery img:hover {
    transform: scale(1.02);
  }
  
  .gallery img:active {
    transform: scale(1.02);
  }
  
  .toc a:hover {
    color: #26856a;
    text-decoration: underline;
  }
  
  .pagination a:hover {
    background: #26856a8c;
    color: #fff;
    border-color: #26856a;
  }
  
  .repair-phone a:hover {
    color: #1a3c32;
    text-decoration: underline;
  }
  
  .blog-wrapper ul,
  .blog-wrapper ol {
    padding-left: 30px;
  }
  
  .blog-wrapper li {
    margin-bottom: 8px;
    padding-left: 5px;
  }
}

/* ===== БОЛЬШИЕ ЭКРАНЫ (min-width: 1024px) ===== */
@media (min-width: 1024px) {
  .blog-grid {
    gap: 32px;
  }
  
  .blog-image {
    height: 220px;
  }
  
  .blog-title {
    font-size: 22px;
  }
}

/* ===== ДОПОЛНИТЕЛЬНЫЕ УЛУЧШЕНИЯ ДЛЯ МОБИЛЬНЫХ ===== */
@media (max-width: 480px) {
  .pagination ul {
    gap: 4px;
  }
  
  .pagination a {
    padding: 6px 10px;
    font-size: 13px;
    min-width: 32px;
  }
  
  .pagination li span {
    padding: 6px 6px;
  }
  
  .toc {
    padding: 10px;
  }
  
  .toc a {
    font-size: 13px;
  }
  
  .repair-block {
    padding: 16px;
  }
  
  .repair-block h3 {
    font-size: 18px;
  }
  
  .blog-wrapper p {
    font-size: 15px;
  }
}

/* Доступность: увеличение области касания на мобильных */
@media (max-width: 768px) {
  .blog-link,
  .pagination a,
  .repair-phone a,
  .toc a {
    cursor: pointer;
  }
  
  .blog-card:active {
    background-color: #fafafa;
  }
}