.section-page__container {
  display: flex;
  flex-direction: column;
  row-gap: 32px;
}

@media (max-width: 470px) {
  .section-page__container {
    row-gap: 16px;
  }
}

.section-page__entry {
  display: flex;
  flex-direction: column;
  background-color: var(--primary-color-2);
  border-radius: 8px;
  padding-left: 32px;
  padding-right: 32px;
  padding-top: 40px;
  padding-bottom: 40px;
  box-shadow: 0 0 10px var(--secondary-color-10);
}

@media (max-width: 470px) {
  .section-page__entry {
    border-radius: 0;
    padding-left: 16px;
    padding-right: 16px;
    padding-top: 0;
    padding-bottom: 0;
    box-shadow: none;
  }
}

.section-page__entry-title {
  font-family: 'Amagro';
  font-weight: 400;
  font-size: 20px;
  color: var(--secondary-color-6);
  margin-top: 0;
  margin-bottom: 16px;
}

@media (max-width: 680px) {
  .section-page__entry-title {
    font-size: 18px;
  }
} 

@media (max-width: 470px) {
  .section-page__entry-title {
    font-size: 16px;
  }
}

.section-page__entry-wrapper {
  margin-bottom: 16px;
}

.section-page__entry-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  font-size: 18px;
  color: var(--secondary-color-8);
  gap: 8px;
}

@media (max-width: 680px) {
  .section-page__entry-content {
    font-size: 16px;
  }
} 

@media (max-width: 470px) {
  .section-page__entry-content {
    font-size: 14px;
  }
}

.section-page__entry-content > * {
  grid-column: 1 / -1;
  margin: 0 !important;
}

.article-main__content h2:not(:first-child),
.article-main__content h3:not(:first-child),
.article-main__content h4:not(:first-child),
.article-main__content h5:not(:first-child),
.article-main__content h6:not(:first-child) {
  padding-top: 16px;
}

.section-page__entry-content h2 {
  font-weight: 500;
  font-size: 20px;
  border-bottom: 2px solid var(--secondary-color-8);
  padding-bottom: 8px;
}

.section-page__entry-content h3 {
  font-weight: 500;
  font-size: 18px;
}

.section-page__entry-content h4 {
  font-weight: 500;
  font-size: 16px;
}

.section-page__entry-content h5 {
  font-weight: 500;
  font-size: 14px;
}

.section-page__entry-content h6 {
  font-weight: 400;
  font-size: 14px;
  opacity: .8;
}

.section-page__entry-content h5,
.section-page__entry-content h6 {
  text-transform: uppercase;
}

.section-page__entry-content p:has(img + img),
.section-page__entry-content p:has(figure + figure) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}

.section-page__entry-content code {
  background-color: var(--common-main-color-2);
  padding: 0 4px;
}

.section-page__entry-content figure figcaption {
  font-weight: 400;
  font-size: 14px;
  font-style: italic;
  color: var(--color-brand-darkgray2);
}

.section-page__entry-content .video-container:nth-of-type(n+5),
.section-page__entry-content p > img:nth-child(n+5),
.section-page__entry-content figure:nth-child(n+5) {
  grid-column: 1 / -1;
  max-width: 100%;
}

.section-page__entry-content ul,
.section-page__entry-content ol {
  font-weight: 300;
  font-size: inherit;
  padding-left: 20px;
  margin-top: 0;
}

.section-page__entry-content ul li,
.section-page__entry-content ol li {
  font-weight: inherit;
}

.section-page__entry-content img,
.section-page__entry-content figure,
.section-page__entry-content .video-container {
  grid-column: auto;
  max-width: 100%;
  height: auto;
}

.section-page__entry-content figure {
  display: flex;
  flex-direction: column;
  justify-content: center;
  grid-column: 1 / -1;
  margin-left: 0;
  margin-right: 0;
  margin-top: 0;
  width: 100%;
  height: min-content;
}

.section-page__entry-content figure figcaption {
  text-align: center;
  font-weight: 300;
  font-size: inherit;
  font-style: italic;
  padding: 8px 0;
}

.section-page__entry-content img {
  box-sizing: border-box;
  border-color: 1px solid var(--color-brand-primary);
  margin: 0 auto;
  width: 100%;
  height: 100%;
  max-height: 400px;
  object-fit: cover;
  cursor: pointer;
}

.section-page__entry-content figure img {
  width: fit-content;
}

.section-page__entry-content a {
  background-color: transparent;
  color: var(--primary-color-1);
  transition: background-color .1s, color .1s;
  word-wrap: break-word;
}

.section-page__entry-content a:hover {
  color: var(--primary-color-1);
}

.section-page__entry-content a:focus,
.section-page__entry-content a:active {
  background-color: var(--primary-color-1);
  color: var(--primary-color-2);
}

.section-page__entry-content a:focus {
  outline: 0;
}

.section-page__entry-content blockquote {
  background-color: var(--primary-color-1);
  color: var(--primary-color-2);
  border-left: 4px dashed var(--secondary-color-8);
  padding-left: 16px;
  padding-right: 40px;
  padding-top: 32px;
  padding-bottom: 16px;
}

.section-page__entry-content blockquote p {
  font-size: 14px !important;
}

.section-page__entry-content blockquote > *:last-child {
  margin-bottom: 0 !important;
}

.section-page__entry-content video {
  max-width: 100%;
}

.section-page__entry-content table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--color-brand-darkgray);
  color: var(--color-neutral-white);
  font-size: 0.9rem;
  border: 1px solid var(--color-brand-primary);
}

.section-page__entry-content table thead {
  display: none;
}

.section-page__entry-content table tbody tr {
  display: block;
}

.section-page__entry-content table td {
  display: block;
  padding: 0.5rem 0;
  text-align: center;
  position: relative;
  border-bottom: 1px solid var(--color-brand-primary);
}

/* Добавляем названия колонок перед данными */
.section-page__entry-content table td::before {
  content: attr(data-label);
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 600;
  color: var(--secondary-color-6);
  text-align: left;
}

/* Для десктопной версии */
@media (min-width: 768px) {
  .section-page__entry-content table thead {
    display: table-header-group;
    background-color: var(--secondary-color-6);
    color: var(--primary-color-2);
  }
  
  .section-page__entry-content table tbody tr {
    display: table-row;
    margin-bottom: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
  }
  
  .section-page__entry-content table td {
    display: table-cell;
    padding: 0.8rem;
    text-align: left;
  }
  
  .section-page__entry-content table td::before {
    display: none;
  }
  
  .section-page__entry-content table tbody tr:nth-child(even) {
    background-color: var(--secondary-color-3);
  }
  
  .section-page__entry-content table th {
    padding: 1rem;
    font-weight: 500;
  }
}

/* Улучшенная читаемость на мобильных */
@media (max-width: 767px) {
  .section-page__entry-content table {
    font-size: 0.85rem;
  }
  
  .section-page__entry-content table tbody tr {
    border: 1px solid var(--primary-color-1);
    padding: 0.8rem;
  }

  .section-page__entry-content table tbody tr:not(:last-child) {
    margin-bottom: 8px;
  }
  
  .section-page__entry-content table td {
    padding: 0.6rem 0;
  }
  
  .section-page__entry-content table td::before {
    font-size: 0.8rem;
    width: 45%;
  }
}

p {
  height: fit-content;
}

p > code {
  display: block;
  color: var(--secondary-color-8);
  padding-left: 10px;
  border-left: 4px dashed var(--primary-color-3);
}

p > code::before {
  display: block;
  background-color: var(--secondary-color-3);
  text-transform: uppercase;
  color: var(--primary-color-2);
  content: 'code';
  padding: 5px 10px;
  margin-bottom: 10px;
}

.section-page__entry-content form {
  display: grid;
  justify-content: center;
  row-gap: 8px;
}

.section-page__entry-content form > * {
  max-width: 400px;
}

.section-page__entry-content form input,
.section-page__entry-content form textarea {
  border-color: var(--color-neutral-light) !important;
  width: 100%;
}

.section-page__entry-content form input[type="button"]
.section-page__entry-content form input[type="submit"],
.section-page__entry-content form input[type="reset"] {
  background-color: var(--primary-color-1);
  color: var(--primary-color-2);
  border: 0;
  width: fit-content;
}

.section-page__entry-content form input[type="button"]:hover,
.section-page__entry-content form input[type="submit"]:hover,
.section-page__entry-content form input[type="reset"]:hover,
.section-page__entry-content form input[type="button"]:focus,
.section-page__entry-content form input[type="submit"]:focus,
.section-page__entry-content form input[type="reset"]:focus {
  background-color: var(--primary-color-1);
  color: var(--primary-color-2);
  border: 0;
  width: fit-content;
}

.section-page__entry-content form .input-container__label > p {
  font-size: 12px !important;
}

.section-page__entry-content form .select-imitation__droped-list {
  padding-left: 0 !important;
}

.section-page__entry-content form label {
  text-transform: uppercase;
  font-weight: 600;
  font-size: 14px;
}

.section-page__entry-content .form__input-description {
  font-weight: 300;
  font-size: 14px;
  color: var(--color-neutral-white);
}

.section-page__entry-content .form__input-container:not(:last-child) {
  margin-bottom: 16px;
}

.section-page__entry-content .form__label_is-required::after {
  content: '*';
  color: red;
  padding-left: 8px;
}

.section-page__locales {
  display: flex;
  border-radius: 8px;
  border: 1px solid var(--primary-color-1);
  padding: 8px 16px;
  margin-bottom: 16px;
}

@media (max-width: 400px) {
  .section-page__locales {
    flex-direction: column;
  }
}

.section-page__locales-label {
  display: flex;
  align-items: center;
  font-weight: 400;
  font-size: 14px;
  color: var(--secondary-color-8);
  margin-right: 8px;
  opacity: .4;
}

@media (max-width: 400px) {
  .section-page__locales-label {
    margin-bottom: 8px;
  }
}

.section-page__locales-label::after {
  font-size: 14px;
  content: ':';
}

.section-page__locales .entry-locales {
  display: flex;
  flex-wrap: wrap;
  list-style-type: none;
  font-style: italic;
  font-size: 12px;
  padding-left: 0;
  margin: 0;
}

.section-page__locales .entry-locales__item {
  display: flex;
  align-items: center;
}

.section-page__locales .entry-locales__item:not(:last-child) {
  margin-right: 8px;
}

.section-page__locales .entry-locales__locale-icon {
  margin-right: 5px;
}

.section-page__locales .entry-locales__link {
  text-decoration: none;
  color: var(--secondary-color-8);
  transition: color .1s;
}

.section-page__locales .entry-locales__link:hover,
.section-page__locales .entry-locales__link:focus {
  text-decoration: underline;
  color: var(--primary-color-1);
}

.section-page__locales .entry-locales__link:active {
  color: var(--primary-color-1);
}

.section-page__metadata {
  display: flex;
  background-color: var(--primary-color-1);
  list-style-type: none;
  font-size: 12px;
  color: var(--primary-color-2);
  border-radius: 8px;
  padding: 8px 16px;
  margin-top: 0;
  margin-bottom: 20px;
}

@media (max-width: 680px) {
  .section-page__metadata {
    flex-direction: column;
  }

  .section-page__metadata .metadata__item:not(:last-child) {
    margin-bottom: 5px;
  }
}

@media (min-width: 681px) {
  .section-page__metadata .metadata__item:not(:last-child)::after {
    content: '|';
    margin-left: 5px;
    margin-right: 5px;
  }
}

.section-page__metadata .metadata__label {
  font-weight: 700;
}

.section-page__metadata .metadata__label::after {
  font-weight: 500;
  content: ':';
  margin-right: 5px;
}

.section-page__previous-section {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--primary-color-1);
  padding: 16px;
}

.previous-section__title {
  text-transform: uppercase;
  font-size: 16px;
  color: var(--secondary-color-8);
  margin-top: 0;
  margin-bottom: 20px;
}

.previous-section__entry-title {
  text-transform: uppercase;
  font-size: 16px;
  color: var(--secondary-color-8);
  margin-top: 0;
  margin-bottom: 10px;
}

.previous-section__entry-description {
  font-size: 14px;
  color: var(--secondary-color-8);
  margin-bottom: 10px;
}

.previous-section__entry-link {
  background-color: transparent;
  text-decoration: none;
  color: var(--primary-color-1);
  width: fit-content;
  transition: background-color .1s, color .1s;
}

.previous-section__entry-link:hover {
  color: var(--secondary-color-8);
}

.previous-section__entry-link:focus,
.previous-section__entry-link:active {
  background-color: var(--primary-color-1);
  color: var(--primary-color-2);
  outline: 0;
}

.article-main__previous-section > .previous-section__entry-link {
  align-self: flex-end;
  font-size: 14px;
}