/* Карточка места, избранное, оценки и комментарии. */

/* Карточка выбранного места поверх карты; на телефоне открывается над нижней навигацией. */
.detail {
  position: absolute;
  top: 78px;
  right: 20px;
  width: 325px;
  max-height: calc(100% - 110px);
  overflow: auto;
  background: var(--panel);
  border-radius: 18px;
  box-shadow: 0 14px 45px #0003;
  border: 1px solid var(--line);

  @media (max-width: 760px) {
    position: fixed;
    top: 72px;
    left: 10px;
    right: 10px;
    width: auto;
    max-height: calc(100dvh - 90px);
    z-index: 30;
  }

  @media (min-width: 761px) {
    width: 360px;
  }

  :where([data-layout="mobile"]) & {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    border-radius: 24px 24px 0 0;
    z-index: 50;
    bottom: var(--m-nav) !important;
    max-height: calc(100dvh - var(--m-nav) - 80px) !important;
  }
}

.detail img {
  width: 100%;
  height: 165px;
  object-fit: cover;

  @media (max-width: 760px) {
    height: 170px;
  }
}

/* Содержимое карточки под фотографией: описание, действия, оценки и комментарии. */
.detail .body {
  padding: 20px;

  :where([data-layout="mobile"]) & {
    padding: 22px;
  }
}

.detail h2 {
  font-size: 23px;
  margin: 0 30px 9px 0;
  line-height: 1.2;
  letter-spacing: -0.5px;

  @media (max-width: 760px) {
    margin-right: 35px;
  }

  @media (min-width: 761px) {
    font-size: 25px;
  }
}

.detail p {
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0;

  @media (min-width: 761px) {
    font-size: 14px;
    line-height: 1.6;
  }

  :where([data-layout="mobile"]) & {
    font-size: 14px;
  }
}

.detail h3 {
  font-size: 14px;
  margin: 23px 0 10px;

  @media (min-width: 761px) {
    font-size: 16px;
  }
}

.tag {
  display: inline-block;
  padding: 4px 8px;
  background: var(--soft);
  font-size: 10px;
  border-radius: 7px;
  margin: 3px 4px 0 0;

  @media (min-width: 761px) {
    font-size: 12px;
  }

  :where(body.dark) & {
    border-color: #424242;
  }
}

.fact {
  display: inline-block;
  padding: 4px 8px;
  background: var(--soft);
  font-size: 10px;
  border-radius: 7px;
  margin: 3px 4px 0 0;

  @media (min-width: 761px) {
    font-size: 12px;
  }
}

#favorite {
  width: 100%;
  margin-top: 15px;
  font-size: 12px;

  @media (max-width: 760px) {
    min-height: 48px;
    font-size: 13px;
  }

  @media (min-width: 761px) {
    font-size: 14px;
    min-height: 46px;
  }

  :where([data-layout="mobile"]) & {
    min-height: 46px;
  }

  &.favoriteAdd {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: var(--onaccent);
  }

  &.favoriteRemove {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--ink);
  }

  &.favoriteRemove:hover {
    background: var(--accent-soft);
  }
}

.detail .editrow {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.editrow button {
  flex: 1;
  font-size: 10px;
  padding: 8px;
  background: var(--soft);
  border-radius: 7px;
  min-width: 100px;

  @media (max-width: 760px) {
    min-height: 44px;
    font-size: 11px;
  }

  @media (min-width: 761px) {
    font-size: 12px;
    min-height: 40px;
  }

  :where([data-layout="mobile"]) & {
    min-height: 46px;
  }
}

.voting {
  display: flex;
  gap: 6px;
}

.voting button {
  font-size: 10px;
  padding: 8px 10px;
  background: var(--soft);
  border-radius: 7px;

  @media (max-width: 760px) {
    min-height: 44px;
    font-size: 11px;
  }

  @media (min-width: 761px) {
    font-size: 12px;
    min-height: 41px;
  }
}

.detail textarea {
  min-height: 65px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 9px;
  padding: 11px;
  width: 100%;
  font-size: 12px;

  @media (min-width: 761px) {
    font-size: 14px;
  }
}

.detail .quiet {
  padding: 8px 12px;

  @media (max-width: 760px) {
    min-height: 44px;
  }

  :where([data-layout="mobile"]) & {
    min-height: 46px;
  }
}

.freshbadge {
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px;
  padding: 5px 9px;
  margin-top: 15px;
  background: var(--soft);
  font-weight: 650;

  @media (min-width: 761px) {
    font-size: 12px;
  }
}

.freshbadge.current {
  background: var(--accent-soft);
}

.freshbadge.current:before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.freshbadge.expired {
  color: var(--muted);
}

.detail .freshdate {
  margin: 7px 0 12px;
  font-size: 10px;

  @media (min-width: 761px) {
    font-size: 12px;
  }
}

.detail .close {

  @media (max-width: 760px) {
    width: 40px;
    height: 40px;
    font-size: 23px;
  }

  :where([data-layout="mobile"]) & {
    width: 40px;
    height: 40px;
  }
}

.detail button:disabled {
  opacity: 0.55;
  cursor: default;
}

body.dark .freshbadge.current {
  background: #303030;
}

.detail .detailGallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
}

.detail .detailGallery.single {
  grid-template-columns: 1fr;
}

.detail .detailGallery img {
  width: 100%;
  height: 125px;
  object-fit: cover;
  display: block;

  @media (max-width: 760px) {
    height: 110px;
  }
}

.detail .detailGallery.single img {
  height: 165px;
}

.placeComment {
  margin: 12px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.placeComment p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 6px 0;
}

.deleteComment {
  padding: 6px 0;
  font-size: 12px;
  color: var(--muted);
  text-decoration: underline;
}

#sharePlaceBtn {
  margin-top: 10px;
  width: 100%;
}

#deletePlaceBtn {
  margin-top: 8px;
  width: 100%;
  color: #e95e63;
  background: transparent;
  border: 1px solid #e95e63;
}
