﻿/* Карточка материала/публикации */

.lavrus-material-card {
  padding: 0 0 30px;
  display: flex;
  width: 100%;
  flex: 0 0 100%;
  flex-direction: column;
  text-align: center;
  position: relative;
  border-radius: 23px;
  max-height: 90vh;
  transition: all 0.3s ease;
}

.lavrus-material-card[hidden] {
  display: none;
}

.lavrus-material-card:hover {
  background-color: var(--lavrus-tretyakov-ru-white);
  box-shadow: 0 4px 40px 0 rgba(0, 0, 0, 0.25);
}

.lavrus-material-card__link {
  position: relative;
  z-index: 0;
  display: flex;
  height: 100%;
  flex-direction: column;
  color: var(--lavrus-tretyakov-ru-black);
  text-decoration: none;
}

.lavrus-material-card__image-wrapper {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 10px;
  order: 0;
  flex-grow: 0;
  margin-bottom: 20px;
  background-color: var(--color-grey-95);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.lavrus-material-card__image {
  position: absolute;
  inset: 0;
  display: block;
  border: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  border-radius: inherit;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.lavrus-material-card__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  padding: 0 5px 0;
}

.lavrus-material-card__type,
.lavrus-material-card__date {
  font-family: var(--second-family);
  font-weight: 400;
  font-size: 13px;
  line-height: 100%;
  text-align: center;
}

.lavrus-material-card__type {
  margin-top: 20px;
  color: var(--lavrus-tretyakov-ru-dove-gray);
}

.lavrus-material-card__title {
  margin-top: 15px;
  font-size: 28px;
  font-weight: 400;
  line-height: 28px;
}

.lavrus-material-card__title-italic {
  display: inline;
  font-family: var(--font3);
  font-style: italic;
  font-weight: 400;
  font-size: 28px;
  line-height: 100%;
  text-align: center;
  color: var(--lavrus-tretyakov-ru-mine-shaft);
}

.lavrus-material-card__title-accent {
  margin-top: 6px;
  font-family: var(--second-family);
  font-weight: 800;
  font-size: 20px;
  line-height: 110%;
  text-decoration: underline;
  text-decoration-skip-ink: none;
  text-align: center;
  color: var(--lavrus-tretyakov-ru-black);
}

.lavrus-material-card:hover .lavrus-material-card__title-accent {
  text-decoration: none;
}

.lavrus-material-card__date {
  margin-top: 20px;
  color: var(--lavrus-tretyakov-ru-dusty-gray);
}

.lavrus-material-card__more {
  display: flex;
  padding-top: 32px;
  justify-content: center;
  align-items: center;
  gap: 11px;
  margin-top: auto;
  color: var(--lavrus-tretyakov-ru-black);
  font-family: var(--second-family);
  font-weight: 400;
  font-size: 15px;
  line-height: 100%;
}

.lavrus-material-card__more-txt {
  color: var(--lavrus-tretyakov-ru-black);
  font-family: var(--second-family);
  font-weight: 400;
  font-size: 15px;
  line-height: 100%;
}

.lavrus-material-card__more-icon {
  display: inline-block;
  height: 10px;
  width: 25px;
  flex: 0 0 auto;
}

.lavrus-material-card__favorite {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  display: flex;
  width: 32px;
  height: 30px;
  padding: 0;
  border: 0;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  cursor: pointer;
  pointer-events: auto;
  opacity: 0;
  transition: all 0.3s ease;
}

.lavrus-material-card__favorite::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--lavrus-tretyakov-ru-white);
  clip-path: path(
    "M26.5 19.5L15.5 27.5L7.5 20.5L1.5 10.5V5L6 1.5H10.5L14 6.5L16.5 8L21 1.5H26.5L30 6.5V10.5L26.5 19.5Z"
  );
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.lavrus-material-card__favorite-icon {
  position: relative;
  z-index: 1;
  display: block;
  width: 32px;
  height: 30px;
  filter: brightness(0) invert(1);
}

.lavrus-material-card__favorite:focus-visible::after {
  opacity: 1;
}

.lavrus-material-card__favorite[aria-pressed="true"]::after {
  opacity: 1;
  background-color: var(--lavrus-tretyakov-ru-affair);
  clip-path: path(
    "M23.88 0C20.06 0 16.87 2.85 16 6.69C15.13 2.85 11.94 0 8.12 0C3.64 0 0 3.92 0 8.77C0 21.24 16 30 16 30C16 30 32 21.24 32 8.77C32 3.92 28.36 0 23.88 0Z"
  );
}

.lavrus-material-card__favorite[aria-pressed="true"]
  .lavrus-material-card__favorite-icon {
  opacity: 0;
}

.lavrus-material-card__favorite:focus-visible,
.lavrus-material-card__favorite[aria-pressed="true"] {
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .lavrus-material-card__favorite:hover::after {
    opacity: 1;
  }

  .lavrus-material-card:hover .lavrus-material-card__favorite {
    opacity: 1;
  }

  .lavrus-material-card__favorite[aria-pressed="true"]:hover::after {
    background-color: var(--lavrus-tretyakov-ru-affair);
  }
}

@media (max-width: 1279px) {
  .lavrus-material-card__title {
    font-size: 24px;
    line-height: 1.05;
  }

  .lavrus-material-card__title-accent {
    font-size: 18px;
    line-height: 1.15;
  }
}

@media (max-width: 1023px) {
  .lavrus-material-card__title {
    font-size: 28px;
    line-height: 28px;
  }

  .lavrus-material-card__title-accent {
    font-size: 20px;
    line-height: 22px;
  }
}

@media (max-width: 768px) {
  .lavrus-material-card__image-wrapper {
    max-height: 52vh;
  }
}

@media (max-width: 767px) {
  .lavrus-material-card__favorite {
    top: 12px;
    right: 12px;
    opacity: 1;
  }
}

@media (max-width: 579px) {
  .lavrus-material-card__image-wrapper {
    max-height: 45vh;
  }

  .lavrus-material-card__content {
    padding: 0 5px 0;
  }

  .lavrus-material-card__more {
    padding-top: 20px;
  }
}
