/* ================== Общие стили ================== */
body {
  font-family: 'Open Sans', sans-serif;
  background: black;
  color: Goldenrod;
  text-align: center;
  margin: 0;
  padding: 20px;
  box-sizing: border-box;
}

h1 {
  margin-bottom: -20px;
}

.frame {
  border: 3px solid Goldenrod;
  border-radius: 100px;
  padding: 30px;
  background-color: black;
  max-width: 1200px;
  margin: 0 auto;
}

/* ================== Биография ================== */
.manual-columns {
  display: flex;
  gap: 40px;
  margin: 20px 0;
}

.col {
  flex: 1;
}

.col p {
  text-align: justify;
  line-height: 1.6;
  margin: 0 0 16px 0;
  hyphens: auto;
}

.vertical-line {
  width: 2px;
  height: 280px;
  background-color: Goldenrod;
  align-self: center;
}

hr {
  border: none;
  height: 2px;
  background-color: Goldenrod;
  margin: 20px 0;
}

/* ================== Фотографии ================== */
.photo-grid {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.photo {
  width: calc((100% - 20px) / 3);
  max-width: 380px;
  height: 490px;
  object-fit: cover;
  border-radius: 15px;
}

.hidden-photo {
  display: none;
}

/* ================== Навигация и кнопки ================== */
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
  flex-wrap: wrap;
  gap: 15px;
}

.action-btn {
  background: none;
  border: 2px solid goldenrod;
  color: goldenrod;
  padding: 10px 16px;
  border-radius: 6px;
  font-family: 'Open Sans', sans-serif;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.action-btn i {
  display: inline-block;
  width: 18px;
  height: 18px;
  font-size: 16px;
  line-height: 18px;
  text-align: center;
  margin-right: 8px;
  vertical-align: middle;
  flex-shrink: 0;
}

.action-btn:hover {
  background-color: goldenrod;
  color: white;
}

@media (min-width: 849px) {
  .action-btn {
    flex: 0 0 calc(33.333% - 10px);  /* 3 кнопки в ряд */
    margin-bottom: 10px;
  }
  
  /* Убираем старые правила для 4-й и 5-й кнопки — теперь у нас 6 кнопок, все по 33% */
}
/* ================== Контентные блоки ================== */
.content-sections {
  margin-top: 20px;
}

.content-block,
.contact-links {
  margin-top: 16px;
  display: none;
  flex-direction: column;
  gap: 12px;
}

.content-block.visible,
.contact-links.visible {
  display: flex;
}

p {
  margin: 0 0 16px 0;
  line-height: 1.6;
  text-align: left;
}

/* ================== Статьи ================== */
#story1 p,
#story2 p,
#story3 p {
  text-align: justify;
  hyphens: auto;
  margin: 0 0 16px 0;
  line-height: 1.6;
}

/* Красная строка только в story2 и story3 */
#story2 p,
#story3 p {
  text-indent: 24px;
}

.story-subtitle {
  text-align: center;
  font-weight: 700;
  font-size: 1.2em;
  margin: 20px 0 20px;
  color: goldenrod;
}

/* ================== Стихи ================== */
.poem {
  text-align: left;
  font-style: italic;
  margin-left: 20px;
  font-family: Georgia, serif;
  white-space: pre-line;
  margin: 16px 0;
}

/* ================== Списки ================== */
ul {
  list-style: none;
  padding: 0;
}

ul li {
  margin: 8px 0;
}

/* ================== Ссылки ================== */
a {
  color: Goldenrod;
  text-decoration: none;
}

a:hover {
  color: white;
}

/* ================== Кнопки контактов ================== */
.tg-link,
.vk-link,
.contact-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;        
  padding: 10px 16px;
  border: 2px solid goldenrod;
  border-radius: 6px;
  text-align: center;
  text-decoration: none;
  font-family: 'Open Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: goldenrod;
  transition: all 0.3s;
  letter-spacing: 0.3px;
  box-sizing: border-box;
  margin: 4px 0;
  min-height: 50px;
}

.tg-link:hover,
.vk-link:hover,
.contact-links a:hover {
  background-color: goldenrod;
  color: white;
}

/* ================== Портфолио: десктоп ================== */
#portfolio h3 {
  margin-bottom: 16px;
}

/* === Портфолио: десктоп === */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);  /* 3 равные колонки */
  gap: 16px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.portfolio-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.portfolio-category {
  border: 2px solid goldenrod;
  background-color: rgba(184, 134, 11, 0.15);
  color: goldenrod;
  padding: 12px;
  font-weight: bold;
  text-align: center;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.portfolio-category i {
  font-size: 18px;
}

.portfolio-column a {
  border: 1px solid goldenrod;
  color: goldenrod;
  padding: 12px;
  text-align: center;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.3s;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portfolio-column a:hover {
  background-color: rgba(184, 134, 11, 0.25);
  color: white;
}

/* ================== Портфолио: мобильный аккордеон ================== */
.portfolio-mobile {
  display: none;
}

.portfolio-mobile-category {
  width: 100%;
  padding: 14px 16px;
  background: none;
  border: 2px solid goldenrod;
  color: goldenrod;
  font-family: 'Open Sans', sans-serif;  /* красивый шрифт */
  font-size: 15px;                       /* размер шрифта */
  font-weight: 600;                      /* жирность (600 = полужирный) */
  cursor: pointer;
  margin-bottom: 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s;
  text-transform: none;                  /* без заглавных букв */
  letter-spacing: 0.3px;                 /* расстояние между буквами */
}

.portfolio-mobile-category:hover {
  background: rgba(184, 134, 11, 0.15);
  color: white;
}

.portfolio-mobile-category i {
  font-size: 16px;
}

.portfolio-mobile-items {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.portfolio-mobile-items a {
  padding: 12px 16px;
  border: 1px solid goldenrod;
  color: goldenrod;
  text-decoration: none;
  text-align: center;
  font-family: 'Open Sans', sans-serif;  /* красивый шрифт */
  font-size: 14px;                       /* размер шрифта */
  font-weight: 500;                      /* жирность (500 = средний) */
  border-radius: 4px;
  transition: all 0.3s;
  display: block;
  letter-spacing: 0.2px;                 /* расстояние между буквами */
  line-height: 1.5;                      /* высота строки */
}

.portfolio-mobile-items a:hover {
  background: rgba(184, 134, 11, 0.2);
  color: white;
}

.portfolio-mobile-items.active {
  display: flex;
}

/* ================== "Интересное" ================== */
.interesting-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}

.interesting-btn {
  background: none;
  border: 2px solid goldenrod;
  color: goldenrod;
  padding: 12px 16px;
  border-radius: 6px;
  font-family: 'Open Sans', sans-serif;  /* красивый шрифт */
  font-size: 15px;                       /* размер шрифта */
  font-weight: 600;                      /* жирность */
  cursor: pointer;
  transition: all 0.3s;
  text-transform: none;                  /* без заглавных букв */
  letter-spacing: 0.3px;                 /* расстояние между буквами */
  margin-bottom: 8px;
}

.interesting-btn:hover {
  background: goldenrod;
  color: white;
}

.article {
  display: none;
  padding: 16px;
  background: rgba(184, 134, 11, 0.05);
  border-radius: 8px;
  text-align: left;
  margin-top: 12px;
}

.article.visible {
  display: block;
}

.article .article-description {
  text-align: center !important;
  font-style: italic;
  font-weight: 700;
  margin: 12px 0 20px;
  color: Goldenrod;
}

/* ================== Карусель ================== */
.carousel {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 20px 0;
  width: 100%;
  max-width: 1200px;
}

.carousel-track {
  position: relative;
  width: 320px;
  height: 427px; /* 320 × 4/3 */
  overflow: hidden;
  border-radius: 15px;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.carousel-slide.active {
  opacity: 1;
  z-index: 10;
}

.carousel-btn {
  background: rgba(184, 134, 11, 0.7);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-btn:hover {
  background: goldenrod;
}

/* ================== Спортивные достижения и факты ================== */
.achievements-grid,
.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.achievement-item,
.fact-item {
  background: rgba(184, 134, 11, 0.08);
  border: 1px solid goldenrod;
  border-radius: 8px;
  padding: 16px;
  text-align: left;
  transition: all 0.3s;
}

.achievement-item:hover,
.fact-item:hover {
  background: rgba(184, 134, 11, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.achievement-item h4,
.fact-item h4 {
  color: goldenrod;
  margin: 0 0 8px 0;
  font-size: 1.1em;
}

.achievement-item p,
.fact-item p {
  margin: 0;
  font-size: 0.95em;
  line-height: 1.5;
}

/* Адаптивность для блоков достижений и фактов */
@media (max-width: 600px) {
  .achievements-grid,
  .facts-grid {
    grid-template-columns: 1fr;
  }
}
/* ================== Адаптивность ================== */

@media (max-width: 971px) {
  .frame {
    border-radius: 30px;
    padding: 15px;
  }

  .desktop-view {
    display: none !important;
  }

    .achievement-item p,
  .fact-item p {
    text-align: justify;    /* Выравнивание по ширине */
    hyphens: auto;          /* Переносы слов */
  }
  
  .mobile-view {
    display: block;
  }

  .manual-columns {
    flex-direction: column;
    gap: 20px;
  }

    .portfolio-grid {
    grid-template-columns: 1fr;  /* 1 колонка на мобильных */
  }
  
  .vertical-line {
    display: none;
  }

  .action-bar {
    flex-direction: column;
    gap: 10px;
  }

  .action-btn {
    min-width: auto;
    width: 100%;
  }

  .interesting-nav {
    flex-direction: column;
  }

  .contact-links {
    align-items: center;
    width: 100%;
  }

.tg-link,
.vk-link,
.contact-links a {
  width: 100%;              /* Растягиваем на всю ширину */
  max-width: 100%;          /* Убираем ограничение 400px на мобильных */
  margin: 4px 0;
  padding: 10px 16px;       /* Как у .action-btn */
  border: 2px solid goldenrod;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Open Sans', sans-serif;
  color: goldenrod;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;         /* Как у основных кнопок */
  box-sizing: border-box;
  transition: all 0.3s;
}

.tg-link:hover,
.vk-link:hover,
.contact-links a:hover {
  background-color: goldenrod;
  color: white;
}

  .col p,
  #story1 p,
  #story2 p,
  #story3 p {
    text-align: justify;
    hyphens: auto;
  }

  #story2 p,
  #story3 p {
    text-indent: 24px;
  }

  .portfolio-mobile-category {
    font-size: 16px;
    font-weight: normal;
    padding: 8px 12px;
    border-width: 1px;
    border-radius: 6px;
    text-align: center;
    justify-content: center;
  }
}

/* Планшеты: карусель вместо сетки (600–1000px) */
@media (min-width: 600px) and (max-width: 1000px) {
  .photo-grid {
    display: none !important;
  }

  .carousel {
    display: flex;
  }
}

/* Малые экраны (<600px): сетка 2×2 */
@media (max-width: 600px) {
  .photo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .photo {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    max-height: 280px;
    object-fit: cover;
  }

  .hidden-photo {
    display: block !important;
  }
}