/* detail.css – Book detail page and the friends' notes beside it */

.pv .tog .btn {
  padding: 3px 12px;
}
.bgcover {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  opacity: var(--bgo);
  filter: blur(10px);
  transform: scale(1.06);
}
.detail {
  --dw: min(290px, calc((100vh - var(--hh) - 200px) * 0.6667));
  display: grid;
  grid-template-columns: var(--dw) 1fr;
  gap: 36px;
  margin-top: 10px;
  height: calc(100vh - var(--hh) - 110px);
  min-height: 380px;
}
.dl {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.dl .tog {
  gap: 5px;
}
.dr {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.tt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
}
.tt h2 {
  flex: 0 1 auto;
}
.tiers {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.tg {
  border: 1px solid var(--edge);
  background: none;
  border-radius: 5px;
  min-width: 26px;
  padding: 0 8px;
  font-size: 12px;
  color: var(--mute);
}
.tg:hover {
  color: var(--ink);
}
.txt {
  flex: 1;
  min-height: 0;
  overflow: auto;
  font: 17px/1.75 var(--serif);
  color: var(--txt);
  white-space: pre-wrap;
  max-width: 80ch;
  margin-top: 4px;
  outline: none;
  padding-right: 8px;
}
.txt:empty::before {
  content: attr(data-ph);
  color: var(--faint);
}
.rf {
  margin-top: 12px;
  max-width: 80ch;
  width: 100%;
  resize: none;
  border: 0;
  border-top: 1px solid var(--edge);
  background: transparent;
  padding: 8px 0 0;
  font: 14px/1.5 var(--sans);
  max-height: 30vh;
  outline: none;
  overflow: auto;
}
.rf::placeholder {
  color: var(--faint);
}
.detail .cover {
  box-shadow:
    inset 4px 0 0 rgba(0, 0, 0, 0.2),
    0 8px 28px var(--cs2);
}
.detail h2 {
  font: 700 34px/1.1 var(--serif);
}
.by {
  font: italic 500 16px var(--serif);
  color: var(--mute);
  margin: 4px 0 14px;
}
.sec {
  border-top: 1px solid var(--edge);
  padding: 12px 0 14px;
}
.sec h3 {
  font-size: 14px;
  margin-bottom: 8px;
}
.sec textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  border: 1px solid var(--edge);
  border-radius: 6px;
  padding: 1px 12px;
  font: 14px/28px var(--sans);
  background:
    repeating-linear-gradient(
        transparent 0,
        transparent 27px,
        var(--line) 27px,
        var(--line) 28px
      )
      local,
    rgba(18, 18, 18, 0.6);
}
.subj:empty {
  display: none;
}
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin: 2px 0 12px;
}
.stats div {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.stats b {
  font-size: 15px;
  font-weight: 600;
}
.stats span {
  font-size: 11px;
  color: var(--mute);
}
@media (max-width: 760px) {
  .detail {
    grid-template-columns: 1fr;
    gap: 16px;
    height: auto;
    --dw: 180px;
  }
  .dl {
    max-width: 180px;
  }
  .txt {
    overflow: visible;
  }
  .detail h2 {
    font-size: 28px;
  }
}
.detail.hasfr {
  grid-template-columns: var(--dw) minmax(0, 1fr) minmax(240px, 320px);
}
.byfr {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--mute);
  margin: 2px 0 4px;
}
.byfr svg {
  flex: none;
}
.frc {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-self: start;
  max-height: 100%;
  overflow: auto;
  min-width: 0;
}
.fr h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fr h3 svg {
  color: var(--mute);
  flex: none;
}
.fr {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  align-self: start;
  max-height: 100%;
  overflow: auto;
}
.fr h3 {
  font: 700 16px var(--serif);
  margin-bottom: 12px;
}
.fri {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.fri:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.frh {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.fst {
  font-size: 11px;
  color: var(--mute);
  border: 1px solid var(--edge);
  border-radius: 99px;
  padding: 0 8px;
}
.fri p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}
@media (max-width: 1100px) {
  .detail.hasfr {
    grid-template-columns: var(--dw) minmax(0, 1fr);
  }
  .detail.hasfr .frc {
    grid-column: 1/-1;
  }
}
@media (max-width: 760px) {
  .detail.hasfr {
    grid-template-columns: 1fr;
  }
}
