.theme-rp-gallery {
  --rp-paper: var(--e-global-color-rppaper);
  --rp-soft: var(--e-global-color-rpsoft);
  --rp-paper-2: var(--rp-soft);
  --rp-ink: var(--e-global-color-text);
  --rp-ink-2: var(--e-global-color-rpink2);
  --rp-rust: var(--e-global-color-primary);
  --rp-marigold: var(--e-global-color-secondary);
  --rp-marigold-wash: var(--e-global-color-rpmwash);
  --rp-line: var(--e-global-color-rpline);
  --rp-radius: 14px;
  --rp-radius-s: 12px;
  --rp-radius-l: 20px;
  --rp-shadow:
    0 1px 2px rgba(58, 35, 22, 0.05), 0 10px 30px rgba(58, 35, 22, 0.08);
  --rp-f-display:
    "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --rp-f-body:
    "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --rp-display-weight: 500;
  --rp-step-3: clamp(1.9em, 1.55em + 1.8vw, 3em);
  color: var(--rp-ink);
  font-family: var(--rp-f-body);
  font-size: 18px;
  line-height: 1.55;
}

.theme-rp-gallery *,
.theme-rp-gallery *::before,
.theme-rp-gallery *::after {
  box-sizing: border-box;
}

.theme-rp-gallery [hidden] {
  display: none !important;
}

.theme-rp-gallery .rp-tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--rp-line);
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-wrap: nowrap !important;
}

.theme-rp-gallery .rp-tablist a {
  padding: 12px 18px;
  margin-bottom: -1px;
  border-bottom: 3px solid transparent;
  color: var(--rp-rust);
  font-weight: 700;
  text-decoration: none;
}

.theme-rp-gallery .rp-tablist a[aria-selected="true"] {
  color: var(--rp-rust);
  border-color: var(--rp-marigold);
}

.theme-rp-gallery .rp-tablist a:focus-visible,
.theme-rp-gallery button:focus-visible,
.theme-rp-gallery a:focus-visible {
  outline: 3px solid var(--rp-marigold);
  outline-offset: 3px;
}

.theme-rp-gallery .rp-tabpanel {
  min-width: 0;
}

.theme-rp-gallery .rp-shelf {
  margin-bottom: 32px;
}

.theme-rp-gallery .rp-subhead {
  display: flex;
  align-items: baseline;
  /* justify-content: space-between; */
  justify-content: start;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.theme-rp-gallery .rp-subhead h3,
.theme-rp-gallery .rp-chant-group h3,
.theme-rp-gallery .rp-pubhead {
  margin: 0 0 12px;
  color: var(--rp-rust);
  font-family: var(--rp-f-display);
  font-size: clamp(1.2em, 1.12em + 0.4vw, 1.45em);
  font-weight: 500;
  line-height: 1.2;
}

.theme-rp-gallery .rp-chant-group h3 {
  font-size: clamp(1.45em, 1.28em + 0.9vw, 2em);
  text-transform: uppercase;
}

.theme-rp-gallery .rp-pubhead {
  font-size: clamp(1.45em, 1.28em + 0.9vw, 2em);
  margin-bottom: 16px;
  text-transform: uppercase;
}

.theme-rp-gallery .rp-note {
  margin: 0 0 12px;
  color: var(--rp-ink-2);
  font-size: 0.9em;
}

.theme-rp-gallery .rp-vgrid {
  display: grid;
  gap: 16px;
}

.theme-rp-gallery .rp-shelf-film .rp-vgrid {
  grid-template-columns: 1fr;
}

@media (min-width: 760px) {
  .theme-rp-gallery .rp-shelf-film .rp-vgrid {
    grid-template-columns: 1fr 1fr;
  }

  .theme-rp-gallery .rp-shelf-film .rp-vgrid.rp-odd > :first-child {
    grid-column: 1 / -1;
  }
}

.theme-rp-gallery .rp-shelf-reel .rp-vgrid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

@media (max-width: 640px) {
  .theme-rp-gallery .rp-shelf-reel .rp-vgrid {
    grid-auto-flow: column;
    grid-auto-columns: 62%;
    grid-template-columns: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .theme-rp-gallery .rp-shelf-reel .rp-vcard {
    scroll-snap-align: start;
  }
}

.theme-rp-gallery .rp-vcard {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: var(--rp-radius);
  aspect-ratio: 16 / 9;
  background: #2e1d12;
  color: #fff;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.theme-rp-gallery .rp-shelf-reel .rp-vcard {
  aspect-ratio: 4 / 5;
}

.theme-rp-gallery .rp-vcard img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s;
}

.theme-rp-gallery .rp-vcard:hover img {
  transform: scale(1.04);
}

.theme-rp-gallery .rp-vcard::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(20, 12, 6, 0.75));
  content: "";
}

.rp-shelf-film .rp-vgrid button.rp-vcard:first-child {
  grid-column: 1 / -1;
}

.theme-rp-gallery .rp-noimg {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--rp-paper-2);
  color: var(--rp-ink-2);
  font-size: 0.9em;
}

.theme-rp-gallery .rp-vt {
  position: absolute;
  z-index: 1;
  right: 16px;
  bottom: 14px;
  left: 16px;
  font-weight: 700;
  font-size: 1em;
}

.theme-rp-gallery .rp-sample {
  position: absolute;
  z-index: 1;
  top: 10px;
  left: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #3a2316;
  font-size: 0.75em;
  font-weight: 800;
  text-transform: uppercase;
}

.theme-rp-gallery .rp-play {
  position: relative;
  display: inline-block;
  flex: none;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #fff;
}

.theme-rp-gallery .rp-vcard .rp-play {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.theme-rp-gallery .rp-shelf-reel .rp-play {
  width: 50px;
  height: 50px;
}

.theme-rp-gallery .rp-play::after {
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  border-width: 9px 0 9px 15px;
  border-style: solid;
  border-color: transparent transparent transparent var(--rp-rust);
  content: "";
}

.theme-rp-gallery .rp-chants {
  display: grid;
  gap: 28px;
}

@media (min-width: 900px) {
  .theme-rp-gallery .rp-chants {
    grid-template-columns: 1fr 1fr;
  }
}

.theme-rp-gallery .rp-chant {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
  padding: 12px 14px;
  border: 1px solid var(--rp-line);
  border-radius: var(--rp-radius-s);
}

.theme-rp-gallery .rp-chant-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: clamp(1em, 0.98em + 0.2vw, 1.1em);
}

.theme-rp-gallery .rp-chant-top a {
  color: var(--rp-rust);
  font-weight: 700;
  font-size: 0.8em;
  text-decoration: underline;
}

.theme-rp-gallery .rp-chant audio {
  width: 100%;
  height: 40px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .theme-rp-gallery .rp-chant audio {
    color-scheme: dark;
  }
}

html[data-theme="dark"] .theme-rp-gallery .rp-chant audio {
  color-scheme: dark;
}

.theme-rp-gallery .rp-pubs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 32px;
}

@media (min-width: 760px) {
  .theme-rp-gallery .rp-pubs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.theme-rp-gallery .rp-pub {
  display: grid;
  gap: 8px;
  color: var(--rp-ink);
  text-decoration: none;
}

.theme-rp-gallery .rp-pub-cover {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 198 / 300;
  border-radius: 8px;
  background: linear-gradient(160deg, #e9a266, #8e4214);
}

.theme-rp-gallery .rp-pub-cover::before {
  position: absolute;
  inset: auto 12px 12px;
  color: #fff;
  font-family: var(--rp-f-display);
  font-size: 1.05em;
  content: attr(data-title);
}

.theme-rp-gallery .rp-pub-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.theme-rp-gallery .rp-pics {
  columns: 2 160px;
  column-gap: 12px;
}

@media (min-width: 760px) {
  .theme-rp-gallery .rp-pics {
    columns: 3 220px;
  }
}

.theme-rp-gallery .rp-pic {
  position: relative;
  display: block;
  overflow: hidden;
  margin-bottom: 12px;
  border-radius: var(--rp-radius-s);
  break-inside: avoid;
}

.theme-rp-gallery .rp-pic-placeholder {
  aspect-ratio: 4 / 3;
  background: var(--rp-paper-2);
}

.theme-rp-gallery .rp-pic img {
  display: block;
  width: 100%;
  height: auto;
}

.theme-rp-gallery .rp-pic span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  width: fit-content;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(27, 20, 16, 0.78);
  color: #fff;
  font-size: 0.78em;
  font-weight: 700;
}

.theme-rp-gallery .rp-medialib {
  margin-top: 24px;
}

.theme-rp-gallery .rp-link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--rp-rust);
  font-weight: 700;
  font-size: 1.1em;
  line-height: 1.65;
  text-decoration: none;

  &:hover {
    color: var(--rp-rust) !important;
  }
}

.theme-rp-gallery .rp-link-arrow::after {
  display: block;
  width: 18px;
  height: 10px;
  flex: none;
  background: var(--rp-marigold);
  content: "";
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 10'%3E%3Cpath d='M0 5h16M12 1l4 4-4 4' fill='none' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E")
    no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 10'%3E%3Cpath d='M0 5h16M12 1l4 4-4 4' fill='none' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E")
    no-repeat center / contain;
  transition: transform 0.15s;
}

.theme-rp-gallery .rp-link-arrow:hover::after {
  transform: translateX(3px);
}

.rp-pub {
  .rp-link-arrow {
    font-size: 0.8em;
    &::after {
      content: none;
    }
  }

  &:hover {
    strong {
      color: var(--e-global-color-primary) !important;
    }
  }
}

.theme-rp-gallery .theme-rp-gallery-sheet {
  --bs-offcanvas-width: 100vw;
  --bs-offcanvas-bg: var(--rp-paper);
  --bs-offcanvas-color: var(--rp-ink);
  --bs-offcanvas-border-color: var(--rp-line);
  width: 100vw;
  max-width: 100vw;
  border: 0;
  background: var(--rp-paper);
  box-shadow: var(--rp-shadow);
  color: var(--rp-ink);
  font-family: var(--rp-f-body);
  z-index: 99999;
}

.theme-rp-gallery .theme-rp-gallery-sheet.offcanvas-end {
  transform: translateX(100%);
}

.theme-rp-gallery .theme-rp-gallery-sheet.offcanvas-end.showing,
.theme-rp-gallery .theme-rp-gallery-sheet.offcanvas-end.show:not(.hiding) {
  transform: none;
}

.theme-rp-gallery .sheet-top {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--rp-line);
  background: var(--rp-paper);
}

.theme-rp-gallery .rp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--e-global-color-rpsoft);
  color: var(--rp-rust);
  font-size: 0.8em;
  font-weight: 600;
  line-height: 1.65;
}

.theme-rp-gallery .rp-x {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--rp-line);
  border-radius: 50%;
  background: transparent;
  color: var(--rp-ink);
  cursor: pointer;
}

.theme-rp-gallery .rp-x svg {
  width: 16px;
  height: 16px;
}

.theme-rp-gallery .sheet-body {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 24px;
}

.theme-rp-gallery .vplay {
  display: grid;
  gap: 14px;
  width: 100%;
  max-width: 1000px;
  margin-inline: auto;
}

.theme-rp-gallery .vplay.is-v {
  grid-template-columns: minmax(0, 1fr);
}

.theme-rp-gallery .vplay .frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  border-radius: var(--rp-radius);
  background: #000;
}

.theme-rp-gallery .vplay .frame.f169 {
  aspect-ratio: 16 / 9;
}

.theme-rp-gallery .vplay .frame.f45 {
  width: min(100%, calc((100dvh - 200px) * 0.8));
  max-width: 520px;
  aspect-ratio: 4 / 5;
  justify-self: center;
}

.theme-rp-gallery .vplay .frame video,
.theme-rp-gallery .vplay .frame img,
.theme-rp-gallery .vposter {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.theme-rp-gallery .vplay .frame video,
.theme-rp-gallery .vplay .frame img {
  object-fit: contain;
  background: #000;
}

.theme-rp-gallery .vplaybtn {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s;
}

.theme-rp-gallery .vplaybtn::after {
  position: absolute;
  top: 19px;
  left: 24px;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 17px solid var(--rp-rust);
  content: "";
}

.theme-rp-gallery .vposter:hover .vplaybtn {
  transform: scale(1.08);
}

.theme-rp-gallery .vmeta {
  display: grid;
  justify-items: start;
  gap: 12px;
}

.theme-rp-gallery .vmeta h2,
.theme-rp-gallery .rp-gallery-lightbox h2 {
  margin: 0;
  color: var(--rp-rust);
  font-family: var(--rp-f-display);
  font-size: var(--rp-step-3);
  font-weight: var(--rp-display-weight);
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-transform: uppercase;
  text-wrap: balance;
}

.theme-rp-gallery .rp-gallery-lightbox h2 {
  font-size: clamp(1.2em, 1.12em + 0.4vw, 1.45em);
}

.theme-rp-gallery .vmeta .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border: 1px solid var(--rp-marigold);
  border-radius: 999px;
  background: var(--rp-marigold);
  color: #2a1607;
  font-family: var(--rp-f-body);
  font-size: 0.95em;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
}

.theme-rp-gallery .rp-gallery-lightbox {
  display: grid;
  justify-items: center;
  gap: 18px;
}

.theme-rp-gallery .rp-gallery-lightbox > img {
  max-width: 100%;
  max-height: 72dvh;
  border-radius: var(--rp-radius-s);
  object-fit: contain;
}

.theme-rp-gallery .rp-lb-nav {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  width: 100%;
  align-items: center;
}

.theme-rp-gallery .rp-lb-nav button {
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid var(--rp-line);
  border-radius: 50%;
  background: var(--rp-marigold-wash);
  color: var(--rp-rust);
  cursor: pointer;
  font-size: 1.3em;
  span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -65%);
  }
}

@media (min-width: 900px) {
  .theme-rp-gallery .vplay.is-v {
    grid-template-columns: auto minmax(240px, 340px);
    align-items: center;
    justify-content: center;
    gap: 32px;
  }

  .theme-rp-gallery .vplay.is-v .frame.f45 {
    width: min(calc((100dvh - 160px) * 0.8), 520px);
  }
}

@media (max-width: 640px) {
  .theme-rp-gallery .theme-rp-gallery-sheet.offcanvas-end {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    max-height: 92dvh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
  }

  .theme-rp-gallery .theme-rp-gallery-sheet.offcanvas-end.showing,
  .theme-rp-gallery .theme-rp-gallery-sheet.offcanvas-end.show:not(.hiding) {
    transform: none;
  }

  .theme-rp-gallery .sheet-top {
    padding: 12px 20px;
  }

  .theme-rp-gallery .sheet-body {
    padding: 20px;
  }
}

/* .theme-rp-gallery .rp-pending {
  display: block;
  margin: 0;
  padding: 0;
  color: var(--rp-ink-2);
  font-size: 1.1em;
  font-weight: 400;
  line-height: 1.65;
} */

.theme-rp-gallery .rp-pending {
  display: block;
  margin: 0;
  padding: 0;
  color: var(--rp-ink-2);
  font-size: 1.1em;
  font-weight: 400;
  line-height: 1.65;
  color: var(--e-global-color-primary);
  padding: 4px 10px 4px 10px;
  background-color: var(--e-global-color-rpmwash);
  border-style: dashed;
  border-width: 1px 1px 1px 1px;
  border-color: var(--e-global-color-accent);
  border-radius: 6px 6px 6px 6px;
}

@media (prefers-reduced-motion: reduce) {
  .theme-rp-gallery *,
  .theme-rp-gallery *::before,
  .theme-rp-gallery *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
