/* Schede MiniDoc: riquadro della locandina e del player con la stessa altezza. */
.doc-card {
  --doc-media-max-height: min(293px, 42dvh);
  width: min(520px, calc(100vw - 72px));
  max-width: 100%;
  max-height: min(560px, 72dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.doc-card__head {
  min-height: 36px;
  /* Spazio per la X del popup, ancorata a destra anche in arabo. */
  padding-right: 38px;
  margin-bottom: .6rem;
}

.doc-card__title {
  font-size: 1.1rem;
  line-height: 1.25;
}

.leaflet-popup.doc-pop .doc-card .doc-lang {
  position: relative;
  display: block !important;
  margin: .35rem 0 .6rem;
}

.doc-card .doc-lang-toggle {
  display: flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  gap: .4rem;
  padding: .5rem .75rem;
  border: 1px solid #fff4;
  border-radius: .55rem;
  background: var(--gm-palette-menu, #1e293b);
  color: #fff;
  cursor: pointer;
  list-style: none;
}

.doc-card .doc-lang-toggle::-webkit-details-marker {
  display: none;
}

.doc-lang[open] .doc-lang-chevron {
  transform: rotate(180deg);
}

.doc-lang:not([open]) > .doc-lang-options {
  display: none;
}

.doc-lang-options {
  position: absolute;
  inset-block-start: calc(100% + .35rem);
  inset-inline-start: 0;
  z-index: 10;
  box-sizing: border-box;
  display: grid;
  width: min(100%, 14rem);
  gap: .25rem;
  max-height: min(13rem, var(--doc-media-max-height), calc((100vw - 72px) * .5625));
  padding: .3rem;
  overflow-y: auto;
  border: 1px solid #fff4;
  border-radius: .55rem;
  background: var(--gm-palette-menu, #1e293b);
  box-shadow: 0 8px 20px #0008;
}

.doc-card .doc-lang-btn {
  display: flex;
  justify-content: space-between;
  gap: .6rem;
  min-height: 34px;
  padding: .4rem .65rem;
  border: 1px solid transparent;
  border-radius: .35rem;
  font-size: .9rem;
  text-align: start;
  opacity: 1;
}

.doc-card .doc-lang-btn:hover {
  background: var(--gm-palette-hover, #334155);
}

.doc-card .doc-lang-btn[aria-pressed="true"] {
  border-color: #e9bf73;
  background: #3d3427;
}

.doc-lang-check {
  visibility: hidden;
  color: #e9bf73;
}

.doc-lang-btn[aria-pressed="true"] .doc-lang-check {
  visibility: visible;
}

.doc-card .doc-lang-toggle:focus-visible,
.doc-card .doc-lang-btn:focus-visible {
  outline: 2px solid #e9bf73;
  outline-offset: -2px;
}

.doc-card .doc-poster,
.doc-card .doc-yt-embed {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: var(--doc-media-max-height);
  margin: 0;
  border-radius: .65rem;
}

.doc-card .doc-poster {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  padding: 0;
  border: 1px solid #b0925b;
  background: #505050;
  color: #fff;
  cursor: pointer;
}

.doc-card .doc-poster:hover {
  background: #5a5a5a;
}

.doc-card .doc-poster:disabled {
  cursor: wait;
}

.doc-card .doc-poster:focus-visible {
  outline: 2px solid #e9bf73;
  outline-offset: 2px;
}

.doc-card .doc-poster::after {
  content: none;
}

.doc-card .doc-poster img {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.doc-poster__play {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  max-width: calc(100% - 24px);
  padding: .62rem 1rem;
  border: 1px solid #fff8;
  border-radius: 999px;
  background: #161616ed;
  color: #fff;
  font: 700 1rem/1.25 system-ui, sans-serif;
  overflow-wrap: anywhere;
}

.doc-card__media > [role="status"]:empty {
  display: none;
}

.doc-card__desc {
  margin-top: .65rem;
  max-height: 7.5em;
  padding-inline-end: .4rem;
  overflow-y: auto;
  scrollbar-width: thin;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.doc-card .doc-card__foot {
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .1rem .1rem .25rem;
}

.doc-card .doc-share {
  min-height: 36px;
  padding-inline: .8rem;
  border-color: #e9bf73;
  background: #3d3427;
  color: #fff;
}

.doc-card .doc-share:hover {
  background: #53432a;
}

.doc-card .doc-share:focus-visible,
.doc-card__desc:focus-visible {
  outline: 2px solid #e9bf73;
  outline-offset: -2px;
}

.doc-share-status {
  color: #f1d39f;
  font-size: .8rem;
}

.doc-share-status:empty {
  display: none;
}

@media (max-width: 768px) {
  .doc-card {
    --doc-media-max-height: 34dvh;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .doc-card {
    --doc-media-max-height: 32dvh;
    max-height: 64dvh;
  }
}
