body {
    font-family: Arial, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #f5f5f5;
}

header {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 10px;
    margin-bottom: 20px;
}

/* Галерея 4 в ряд */
.gallery {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.gallery img {
    width: 100%;
    max-width: 280px; /* 4 фото в ряд с отступами */
    height: 200px;
    object-fit: cover; /* Обрезает фото без искажений */
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.gallery img:hover {
    transform: scale(1.03);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

section {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

footer {
    text-align: center;
    padding: 20px;
    color: #666;
}
.my-photo {
    width: 700px;
    border-radius: 50%;
    display: block;
    margin: 30px auto;
    border: 1px solid #333;
}
/* Стили для контейнера кнопок */
.buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

/* Стили для самих кнопок */
.button {
    display: inline-block;
    padding: 12px 24px;
    background: #9b59b6;
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: bold;
    font-size: 18px;
    transition: all 0.3s ease;
    border: 2px solid #9b59b6;
    min-width: 150px;
    text-align: center;
}

/* Цвет второй кнопки */
.button:nth-child(2) {
    background: #9b59b6;
    border-color: #9b59b6;
}

/* Эффект при наведении */
.button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    background: white;
    color: #4a6fa5;
}

.button:nth-child(2):hover {
    background: white;
    color: #ff6b6b;
}
/* Стили для блога */
/* ОСНОВНОЙ КОНТЕЙНЕР СТАТЬИ - фото слева, текст справа */
.blog-post {
    display: flex;
    align-items: flex-start; /* Выравнивание по верху */
    gap: 40px; /* Больше расстояние между фото и текстом */
    background: white;
    padding: 30px;
    margin-bottom: 40px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    min-height: 280px; /* Минимальная высота статьи */
}

.blog-post:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* ФОТО СЛЕВА - УВЕЛИЧЕННОЕ */
.blog-image {
    flex-shrink: 0; /* Не сжимается */
    width: 350px; /* ШИРИНА ФОТО УВЕЛИЧЕНА */
    height: 250px; /* ВЫСОТА ФОТО УВЕЛИЧЕНА */
    overflow: hidden;
    border-radius: 12px;
    position: relative;
}

.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Заполняет контейнер без искажений */
    transition: transform 0.5s ease;
}

.blog-post:hover .blog-image img {
    transform: scale(1.08); /* Эффект увеличения при наведении */
}

/* ТЕКСТ СПРАВА - занимает оставшееся место */
.blog-content {
    flex: 1; /* Растягивается на всё доступное пространство */
    padding: 10px 0; /* Отступы сверху и снизу */
}

.blog-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 24px; /* Увеличили заголовок */
    line-height: 1.3;
}

.date {
    color: #7f8c8d;
    font-size: 15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.blog-content p {
    color: #34495e;
    line-height: 1.7; /* Увеличили межстрочный интервал */
    font-size: 16px;
    margin-bottom: 25px;
}

/* Кнопка "Читать дальше" */
.read-more {
    display: inline-block;
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    padding: 10px 20px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e1e8f0;
    transition: all 0.3s ease;
}

.read-more:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
    transform: translateX(5px);
}

.date {
    color: #666;
    font-size: 14px;
    margin: 5px 0 15px;
}

/* Стили для проектов */
.project {
    background: white;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    border-left: 5px solid #ff6b6b;
}

.project h3 {
    margin-top: 0;
}
@media (max-width: 600px) {
    .buttons {
        flex-direction: column;
        align-items: center;
    }
    .button {
        width: 90%;
        max-width: 300px;
    }
}
/* Для планшетов */
@media (max-width: 1024px) {
    .gallery img {
        max-width: 220px;
        height: 180px;
    }
}

/* Для телефонов (3 в ряд) */
@media (max-width: 768px) {
    .gallery-row {
        gap: 10px;
    }
    .gallery img {
        max-width: calc(33.333% - 10px); /* 3 в ряд */
        height: 150px;
    }
}

/* Для маленьких телефонов (2 в ряд) */
@media (max-width: 480px) {
    .gallery img {
        max-width: calc(50% - 10px); /* 2 в ряд */
        height: 130px;
    }

}
/* Мобильная адаптация - ТОЛЬКО для экранов меньше 768px */
@media screen and (max-width: 768px) {
  /* ===== ГЛАВНАЯ СТРАНИЦА (index.html) ===== */
  
  /* Овальное фото */
  .my-photo {
    max-width: 300px !important;
    width: 70% !important;
    height: auto !important;
    margin: 20px auto !important;
    display: block !important;
    border-radius: 50% !important;
  }
  
  /* Заголовок главной */
  header h1 {
    font-size: 24px !important;
    text-align: center !important;
    margin-top: 20px !important;
  }
  
  /* Подзаголовок главной */
  header p {
    font-size: 16px !important;
    text-align: center !important;
  }
  
  /* Кнопки на главной */
  .buttons {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
    margin-top: 20px !important;
  }
  
  .button {
    width: 80% !important;
    max-width: 300px !important;
    text-align: center !important;
    padding: 12px !important;
    font-size: 16px !important;
  }
  
   /* ===== СТРАНИЦА БЛОГА (blog.html) ===== */
  
  /* Блок статьи - меняем структуру для мобильных */
  .blog-post {
    display: flex !important;
    flex-direction: column !important;
    margin: 20px auto !important;
    padding: 15px !important;
    max-width: 95% !important;
  }
  
  /* Контейнер для фото - ставим ПЕРВЫМ */
  .blog-image {
    order: 1 !important;
    width: 100% !important;
    margin-bottom: 15px !important;
  }
  
  /* Фото в блоге */
  .blog-image img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 12px !important;
    margin: 0 auto !important;
    display: block !important;
  }
  
  /* Контейнер для текста - ставим ВТОРЫМ */
  .blog-content {
    order: 2 !important;
    width: 100% !important;
    padding: 0 10px !important;
  }
  
  /* Заголовок статьи */
  .blog-content h3 {
    font-size: 22px !important;
    margin: 10px 0 !important;
    text-align: center !important;
  }
  
  /* Дата статьи */
  .blog-content .date {
    font-size: 14px !important;
    color: #666 !important;
    text-align: center !important;
    margin: 5px 0 15px 0 !important;
  }
  
  /* Текст статьи */
  .blog-content p {
    font-size: 16px !important;
    line-height: 1.6 !important;
    margin: 15px 0 !important;
    text-align: justify !important;
  }
  
  /* Кнопка "Читать дальше" */
  .read-more {
    display: block !important;
    text-align: center !important;
    margin: 20px auto !important;
    padding: 12px 24px !important;
    background: #2c3e50 !important;
    color: white !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    max-width: 200px !important;
  }
  
  /* Заголовок страницы блога */
  header h1 {
    font-size: 28px !important;
    text-align: center !important;
    margin: 20px 0 !important;
  }
  
  /* Кнопка "На главную" в блоге */
  header .button {
    display: block !important;
    margin: 10px auto !important;
    max-width: 200px !important;
    text-align: center !important;
  }
  
  /* ===== ОБЩИЕ СТИЛИ ДЛЯ ВСЕХ СТРАНИЦ ===== */
  
  /* Все остальные изображения */
  img:not(.my-photo) {
    max-width: 100% !important;
    height: auto !important;
  }
  
  /* Контейнеры */
  main, section, article {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
}




