.c-portfolio__wrapper {
  margin: auto;
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  flex-direction: row;
}

.c-portfolio__container {
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -webkit-flex-direction: column;
  -moz-box-orient: vertical;
  -moz-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  position: relative;
}

.c-portfolio {
  padding: 40px 0;
  position: relative;
}

.c-portfolio__item {
  cursor: zoom-in;
}

.c-portfolio__notice {
  display: flex;
  background-color: #ffffff;
  border: 1px solid #E6E7E9;
  border-radius: 32px;
  align-items: center;
  padding: 24px 32px;
  justify-content: space-between;
  position: relative;
}

.c-portfolio__notice--text {
  padding-right: 80px;
  max-width: 720px;
}

@media (max-width: 1200px) { 
  .c-portfolio__notice--text {
    max-width: 100%;
  }
}

@media (max-width: 1080px) { 
  .c-portfolio__notice { 
    flex-direction: column;  
    align-items: center;
    padding: 24px 48px;
  }
  .c-portfolio__notice--text {
    padding-right: 0;
    padding-bottom: 24px;
    text-align: center;
  }
}

.c-portfolio__menu--sticky {
  position: -webkit-sticky;
  position: sticky;
  top: 48px;
  background-color: #f4f5f8;
  border-radius: 32px;
  padding: 24px 28px;
  width: 320px;
}

.c-portfolio__menu--list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.c-portfolio__menu--list a {
  display: inline-block;
  border-bottom: 1px dotted #262728;
  text-decoration: none; 
  width: fit-content;
}

.c-portfolio__photos {
  display: flex;
  flex-direction: column;
  padding-left: 80px;
  gap: 40px; 
  margin-bottom: 40px;
}

.c-portfolio__section .l-title {
  text-align: left;
}

/* ========================== */
/*       СЕТКА И КАРТИНКИ     */
/* ========================== */

.c-portfolio__row {
  display: flex;
  flex-wrap: wrap; 
  gap: 32px;
  margin-top: 24px;
  box-sizing: border-box;
}

/* Контейнер под квадрат */
.c-portfolio__item {
  position: relative;
  width: calc((100% - 2 * 32px) / 3); /* 3 колонки */
  overflow: hidden;
  box-sizing: border-box;
  cursor: zoom-in;
}

/* трюк с ::before — делает блок квадратным */
.c-portfolio__item::before {
  content: "";
  display: block;
  padding-top: 100%; /* высота = ширина → квадрат */
}

/* Картинка */
.c-portfolio__item img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* --- адаптив --- */

/* На планшете — 2 в ряд */
@media (max-width: 800px) {
  .c-portfolio__item {
    width: calc(50% - 8px);
  }
}

/* На телефоне — 1 в ряд */
@media (max-width: 480px) {
  .c-portfolio__item {
    width: 100%;
  }
}

/* ========================== */

@media (max-width: 1240px) {
  .c-portfolio__photos {
    padding-left: 40px;
  }
  .c-portfolio__menu--sticky {
    top: 24px;
  }
}

@media (max-width: 800px) {
  .c-portfolio__menu--sticky .l-title {
    display: none;
  }
  .c-portfolio__menu--list {
    overflow-x: auto;
    white-space: nowrap;
  }

  .c-portfolio__menu--list::-webkit-scrollbar {
    display: none;
  }
  .c-portfolio__menu--list {
    -ms-overflow-style: none;  /* IE */
    scrollbar-width: none;     /* Firefox */
  }

  .c-portfolio__menu--list {
    margin-top: 0;
    flex-direction: row;
    gap: 8px;
    margin-left: -16px;
    padding: 0 16px;
  }

  .c-portfolio__menu--list a {
    text-decoration: none; 
    border: none;
    background: #f4f5f8;
    border-radius: 16px;
    padding: 0 12px;
    height: 32px;
    display: flex;
    align-items: center;
  }

  .c-portfolio {
    padding: 24px 0;
  }
  .c-portfolio__menu--sticky {
    position: static;
    top: 0;
    width: calc(100% + 16px);
    padding: 0;
    background: transparent;
    border-radius: 0;
  }
  .c-portfolio__wrapper {
    flex-direction: column;
  }
  .c-portfolio__menu {
    margin-bottom: 20px;
  }
  .c-portfolio__photos {
    padding-left: 0;
    margin-bottom: 24px;
  }
  .c-portfolio__row {
    gap: 16px;
  }
  .c-portfolio__notice--text {
    padding-bottom: 20px;
  }
}

@media (max-width: 480px) { 
  .c-portfolio__notice .l-button.yellow, 
  .c-portfolio__notice a { 
    min-width: 100%;
  }
  .c-portfolio__notice { 
    padding: 24px;
  }
}

@media (max-width: 320px) {
  .c-portfolio__item {
    width: 100%; 
  }
}