/* ==========================================================================
   Alexei Boronnikov — Portfolio
   components.css — works list, project panel, back-to-top, links
   ========================================================================== */

/* --------------------------------------------------------------------------
   Works list (home page)
   -------------------------------------------------------------------------- */

.work {
  --work-fg: #ffffff;
}

.work--green {
  background: #5aba49;
  --work-fg: #ffffff;
}

.work--yellow {
  background: #ffc300;
  --work-fg: #000000;
}

.work--white {
  background: #ffffff;
  --work-fg: #23a0d0;
}

.work--dark {
  background: #252525;
  --work-fg: #ffffff;
}

.work--cream {
  background: #f1f0ec;
  --work-fg: #000000;
}

.work__title {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.4;
  letter-spacing: 1px;
  text-align: center;
  color: var(--work-fg);
}

.work__text {
  color: var(--work-fg);
  text-align: center;
}

.work__text p {
  max-width: 800px;
  margin: 0 auto 20px;
}

.work__link {
  font-weight: 600;
  transition: opacity 0.25s var(--ease);
}

.work__link:hover {
  opacity: 0.6;
}

/* --------------------------------------------------------------------------
   Project panel — the list of case studies, shown as an overlay and as a
   footer section on every project page
   -------------------------------------------------------------------------- */

.project-panel {
  background: #ffffff;
}

.project-panel__head {
  position: relative;
  padding-block: 32px;
}

.project-panel__title {
  font-size: 28px;
  line-height: 40px;
  color: #000000;
}

.project-panel__close {
  position: absolute;
  top: 32px;
  right: 0;
  width: 40px;
  height: 40px;
  padding: 10px;
  color: #000000;
}

.project-panel__close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
}

.project-panel__close:hover {
  opacity: 0.5;
}

.project-panel__thumbs {
  display: grid;
  grid-template-columns: repeat(5, 170px);
  gap: 30px;
  justify-content: start;
}

@media (max-width: 1199px) {
  .project-panel__thumbs {
    grid-template-columns: repeat(5, 140px);
    gap: 20px;
  }
}

@media (max-width: 979px) {
  .project-panel__thumbs {
    grid-template-columns: repeat(5, 104px);
    gap: 20px;
  }
}

@media (max-width: 767px) {
  .project-panel__thumbs {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px 5%;
  }
}

.project-panel__thumb {
  text-align: center;
}

.project-panel__thumb img {
  width: 100%;
  height: auto;
  transition: opacity 0.25s var(--ease);
}

.project-panel__thumb:hover img {
  opacity: 0.5;
}

.project-panel__thumb h3 {
  margin: 5px 0 0;
  font-size: 13px;
  line-height: 18px;
  color: #000000;
  text-align: center;
}

.project-panel__thumb h3 span {
  color: #888888;
  font-size: 12px;
}

/* Overlay variant */
.project-panel--overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s;
}

body.panel-open .project-panel--overlay {
  opacity: 1;
  visibility: visible;
}

body.panel-open {
  overflow: hidden;
}

/* Footer variant */
.project-panel--footer {
  padding-block: 32px;
}

/* --------------------------------------------------------------------------
   Back to top
   -------------------------------------------------------------------------- */

.to-top {
  position: fixed;
  right: 40px;
  bottom: 40px;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
}

.to-top button {
  display: inline-block;
  padding: 10px;
  cursor: pointer;
}

.to-top svg {
  width: 53px;
  height: 20px;
  fill: var(--to-top-fg, #b2b2b2);
  transition: transform 0.2s var(--ease);
}

.to-top button:hover svg {
  transform: scale(1.15);
}

@media (max-width: 767px) {
  .to-top {
    right: 16px;
    bottom: 16px;
  }
}

/* --------------------------------------------------------------------------
   Links
   -------------------------------------------------------------------------- */

.text-link {
  color: #1573dd;
  transition: color 0.25s var(--ease);
}

.text-link:hover {
  color: #000000;
}
