body {
  font-family: 'Comic Sans MS', cursive, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f5f5f5;
  color: #333333;
}

#topblock {
  background-color: #23153c; 
  padding: 10px;
  overflow: hidden;
}

#langbox {
  float: left;
}

#donntu {
  float: right;
}

#header {
  background-color: #6a55bf;
  color: #ffffff;
  padding: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between; /* Равномерное распределение элементов */
  gap: 20px; /* Расстояние между элементами */
  box-sizing: border-box;
}

#photomag {
  flex: 0 0 180px; /* Фиксированная ширина для фото */
  max-width: 100%; /* Масштабируемость при уменьшении окна */
  text-align: center; /* Центрируем содержимое */
}


#photomag img {
  width: 100%; /* Фото занимает всю ширину контейнера */
  height: auto; /* Сохраняем пропорции */
  border-radius: 15px;
  display: block; /* Убираем лишние отступы */
}

#headertext {
  flex: 1; /* Занимает оставшееся пространство */
  padding-left: 20px; /* Отступ между текстом и фото */
  max-width: calc(100% - 200px); /* Учитываем ширину фото */
  box-sizing: border-box; /* Для учета padding */
}

.hdr {
  margin: 0;
  text-align: left;
}

#menu {
  background-color: #6a55bf; 
  padding: 10px;
  box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.5);
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* Центрирование кнопок */
  gap: 10px; /* Пространство между кнопками */
}

#menu a {
  text-decoration: none;
  color: #ffffff;
  font-size: 16px;
  padding: 10px 15px;
  border: 2px solid #ffffff;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  transition: color 0.3s ease, background-color 0.3s ease;
  flex: 1 1 calc(33.33% - 20px); /* Адаптивная ширина кнопок */
  max-width: 200px; /* Максимальная ширина кнопок */
  text-align: center;
}

#menu a:hover {
  color: #674ed3;
  background-color: #ffffff60;
}

#menu a::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #8b7cce, transparent);
  transition: left 0.3s ease;
}

#menu a:hover::before {
  left: 100%;
}

#maintext {
  background-color: #ffffff;
  padding: 20px;
  margin: 40px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  text-align: justify;
  position: relative;
}

#maintext h1 {
  text-align: center;
  position: relative;
}

#maintext h1::after {
  content: "";
  display: block;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #6a55bf, transparent);
  position: absolute;
  bottom: -2px;
  transition: width 0.3s ease, opacity 0.3s ease;
  
  width: 0;
  opacity: 0;
}

#maintext h1:hover::after {
  
  width: 100%;
  opacity: 1;
}

#maintext a {
  color: #3498db;
  text-decoration: none;
  position: relative;
  transition: color 0.3s ease;
  display: inline-block;
}

#maintext a::after {
  content: "";
  display: block;
  width: 0;
  height: 2px;
  background: #3498db;
  position: absolute;
  bottom: -2px;
  left: 0;
  transition: width 0.3s ease;
}

#maintext a:hover {
  color: #e74c3c;
}

#maintext a:hover::after {
  width: 100%;
}

#menub {
  background-color: #6a55bf; 
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  margin-top: 20px;
  text-align: center;
}

.mitemb {
  display: inline-block;
  margin-right: 15px;
  text-decoration: none;
  color: #ffffff;
  font-size: 16px;
  padding: 8px 15px;
  border: 2px solid #ffffff;
  border-radius: 5px;
  transition: color 0.3s ease, border-color 0.3s ease;
  overflow: hidden;
}

.mitemb:hover {
  color: #8b7cce;
  border-color: #8b7cce;
}

h2 {
  font-size: 1.2em;
}

h3 {
  font-weight: normal;
}

#resume {
  border-collapse: collapse;
  width: 100%;
}

#resume tr {
  border-bottom: 1px solid #6a55bf; 
}

#resume td {
  padding: 10px;
}

#resume td.c1 {
  font-weight: bold;
}

#resume tr:last-child {
  border-bottom: none; 
}

.img { /*                 */
  margin: 15pt 0 30pt 0;
  text-align: center;
}

.hdr a {
  color: #ffdf00;
  text-decoration: none; /* Убираем подчеркивание */
  font-weight: inherit; /* Наследует толщину шрифта */
}

.hdr a:hover {
  color: #e74c3c; /* При наведении можно задать другой цвет */
  text-decoration: underline; /* Или вернуть подчеркивание на hover */
}

#donntu a {
  color: #ffffff; /* Белый цвет текста для контраста на темном фоне */
  text-decoration: none; /* Убираем подчеркивание */
  font-weight: bold; /* Делаем текст жирным для лучшей читаемости */
  transition: color 0.3s ease; /* Плавный переход для эффекта hover */
}

#donntu a:hover {
  color: #ffdf00; /* Желтый цвет при наведении */
  text-decoration: underline; /* Добавляем подчеркивание на hover */
}
.cat {
  color: purple;
}

@media (max-width: 768px) {
  #menu a {
    flex: 1 1 calc(50% - 20px); /* Кнопки становятся шире на малых экранах */
  }
}

@media (max-width: 480px) {
  #menu a {
    flex: 1 1 100%; /* Кнопки растягиваются на всю ширину */
  }
}

@media (max-width: 1200px) {
  #photomag {
    margin: 0 auto; /* Центрируем контейнер */
    padding: 0 10px; /* Добавляем отступы */
  }

  #photomag img {
    max-width: calc(100% - 20px); /* Учет отступов */
  }
}

@media (max-width: 768px) {
  #photomag {
    margin: 0 auto;
    padding: 0 5px;
  }

  #photomag img {
    max-width: calc(100% - 10px);
  }
}