.riyadh-plate {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  isolation: isolate;
  background: #181818;
  color: #ececec;
}

.riyadh-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  container-type: size;
  touch-action: pan-y pinch-zoom;
}

.riyadh-photo-plane {
  position: absolute;
  width: max(100cqw, 125cqh);
  aspect-ratio: 5 / 4;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
}

.riyadh-print {
  position: absolute;
  inset: 0;
  transform: translate(var(--plate-pan-x, 0px), var(--plate-pan-y, 0px)) scale(1.028);
  transform-origin: 50% 50%;
}

.portrait-city .riyadh-print img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  animation: none;
}

.riyadh-mark {
  position: absolute;
  width: .57rem;
  height: .57rem;
  border-radius: 100%;
  border: 1px solid #ededed;
  box-shadow: 0 0 0 1px #202020a8;
  pointer-events: none;
  opacity: 0;
}

.riyadh-mark::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  width: 1rem;
  border-top: 1px solid #ededed;
}

.mark-kingdom { top: 22.6%; left: 67.4%; }
.mark-faisaliah { top: 40.4%; left: 31.5%; }

.riyadh-rules {
  --rule: #efefef88;
  position: absolute;
  inset: 1rem;
  border: 1px solid #efefef25;
  pointer-events: none;
  background:
    repeating-linear-gradient(to right, var(--rule) 0 1px, transparent 1px 12px) top left / 40% 4px no-repeat,
    repeating-linear-gradient(to top, var(--rule) 0 1px, transparent 1px 12px) bottom right / 4px 27% no-repeat;
  transform: translate(var(--rule-pan-x, 0px), var(--rule-pan-y, 0px));
}

.riyadh-original {
  position: absolute;
  inset-inline-start: 1rem;
  inset-block-end: 1rem;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 2.75rem;
  padding: .38rem .7rem;
  background: #181818ef;
  border: 1px solid #b5b5b58f;
  color: #f6f6f6;
  text-decoration: none;
  font-size: .79rem;
}

.riyadh-tools:not([hidden]) {
  display: flex;
  flex: none;
  gap: 2px;
  justify-content: space-evenly;
  padding: .18rem .25rem;
  background: #181818;
  border-top: 1px solid #888888;
}

.riyadh-tools button {
  position: relative;
  min-height: 44px;
  flex: 1 1 auto;
  white-space: normal;
  padding: .3rem .25rem;
  border: 0;
  border-radius: 0;
  color: #e3e3e3;
  background: transparent;
  font: inherit;
  font-size: .78rem;
  cursor: pointer;
}

.riyadh-tools button[aria-pressed=true] {
  color: #f6f6f6;
  background: #282828;
  box-shadow: inset 0 -2px #c5c5c5;
}

.riyadh-plate :is(a,button):focus-visible {
  outline: 2px solid #f6f6f6;
  outline-offset: -3px;
}

.riyadh-plate[data-view=kingdom] .riyadh-print {
  transform: translate(-27%, 15%) scale(1.75);
}

.riyadh-plate[data-view=faisaliah] .riyadh-print {
  transform: translate(28%, 10%) scale(1.75);
}

.riyadh-plate[data-view=kingdom] .mark-kingdom,
.riyadh-plate[data-view=faisaliah] .mark-faisaliah {
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .riyadh-print { transition: transform .48s cubic-bezier(.2, .74, .25, 1); }
  .riyadh-mark { transition: opacity .24s ease; }
  .riyadh-rules { transition: transform .25s ease-out; }
}

@media (hover: hover) {
  .riyadh-tools button:hover, .riyadh-original:hover { color: #fff; background: #2e2e2e; }
}

@media print {
  .riyadh-rules, .riyadh-original, .riyadh-tools { display: none !important; }
  .riyadh-print { transform: none !important; }
}
