/* SPDX-License-Identifier: GPL-2.0-or-later */
.ugphoto { --ugphoto-ink: currentColor; --ugphoto-muted: currentColor; width: 100%; max-width: 100%; padding: clamp(12px, 2vw, 24px); box-sizing: border-box; color: inherit; background: transparent; isolation: isolate; }
.ugphoto *, .ugphoto-dialog * { box-sizing: border-box; }
.ugphoto .ugphoto__heading { margin: 0 0 20px; padding: 0; font-family: inherit; font-size: clamp(24px, 3.5vw, 42px); font-weight: 600; line-height: 1.2; text-align: center; color: var(--ugphoto-ink); overflow-wrap: anywhere; }
.ugphoto .ugphoto__stage { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); gap: 16px; width: 100%; max-width: 760px; margin: 0 auto; }
.ugphoto .ugphoto__card { position: relative; display: block; min-width: 0; width: 100%; aspect-ratio: 1; margin: 0; padding: 0; border: 6px solid #ec670d; border-radius: 50%; overflow: hidden; text-decoration: none; color: #fff; background: #555; box-shadow: 0 2px 12px #0003; }
.ugphoto .ugphoto__card > img { display: block; width: 100%; height: 100%; max-width: none; margin: 0; padding: 0; border: 0; object-fit: cover; }
.ugphoto .ugphoto__card:focus-visible { outline: 3px solid #156fab; outline-offset: 3px; }
.ugphoto .ugphoto__zoom { position: absolute; right: 10%; top: 10%; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #111b; color: #fff; font: 23px/1 sans-serif; }
.ugphoto .ugphoto__caption { position: absolute; inset: auto 0 0; padding: 32px 18px 18px; background: linear-gradient(transparent, #000c); color: #fff; font-size: 14px; line-height: 1.4; text-align: center; overflow-wrap: anywhere; }
/* The ring is enabled only after its positions have been calculated. */
.ugphoto[data-ugphoto-ring] .ugphoto__stage { display: block; position: relative; aspect-ratio: 1; }
.ugphoto[data-ugphoto-ring] .ugphoto__card { position: absolute; left: var(--ugphoto-x, 50%); top: var(--ugphoto-y, 50%); width: var(--ugphoto-thumb, 44px); height: var(--ugphoto-thumb, 44px); aspect-ratio: auto; transform: translate(-50%, -50%); border-width: 6px; z-index: 1; transition: left .32s ease, top .32s ease, width .32s ease, height .32s ease, border-radius .32s ease; }
.ugphoto[data-ugphoto-ring] .ugphoto__card:hover, .ugphoto[data-ugphoto-ring] .ugphoto__card:focus-visible { z-index: 3; }
.ugphoto[data-ugphoto-ring] .ugphoto__card--active { left: 50%; top: 50%; width: var(--ugphoto-main, 50%); height: var(--ugphoto-main, 50%); border: 0; border-radius: 12px; z-index: 2; }
/* Only the photo is desaturated; its orange frame keeps its colour. */
.ugphoto[data-ugphoto-ring] .ugphoto__card > img { filter: grayscale(1); transition: filter .25s ease; }
.ugphoto[data-ugphoto-ring] .ugphoto__card:hover > img,
.ugphoto[data-ugphoto-ring] .ugphoto__card:focus-visible > img,
.ugphoto[data-ugphoto-ring] .ugphoto__card--active > img { filter: none; }
.ugphoto[data-ugphoto-ring] .ugphoto__caption, .ugphoto[data-ugphoto-ring] .ugphoto__zoom { display: none; }
.ugphoto[data-ugphoto-ring] .ugphoto__card--active .ugphoto__zoom { display: grid; right: 10px; top: 10px; }
.ugphoto .ugphoto__controls { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 12px 0 0; }
.ugphoto .ugphoto__button { appearance: none; display: grid; place-items: center; width: 44px; min-width: 44px; height: 44px; margin: 0; padding: 0; border: 2px solid #ec670d; border-radius: 50%; color: #ec670d; background: transparent; font: inherit; box-shadow: none; cursor: pointer; }
.ugphoto .ugphoto__button:hover { background: #ec670d18; color: #ec670d; }
.ugphoto .ugphoto__button:focus-visible { outline: 3px solid #156fab; outline-offset: 3px; }
.ugphoto .ugphoto__button > svg { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ugphoto .ugphoto__selection { margin: 14px 0 0; padding: 0; color: var(--ugphoto-ink); font-size: 16px; line-height: 1.5; text-align: center; overflow-wrap: anywhere; }
.ugphoto .ugphoto__hint { margin: 16px 0 0; padding: 0; color: var(--ugphoto-muted); font-size: 13px; line-height: 1.5; text-align: center; }
.ugphoto [hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .ugphoto[data-ugphoto-ring] .ugphoto__card, .ugphoto[data-ugphoto-ring] .ugphoto__card > img { transition: none; } }
.ugphoto-dialog { box-sizing: border-box; border: 0; border-radius: 3px; padding: 14px 18px 18px; width: min(1120px, 94vw); max-width: 94vw; max-height: 94dvh; margin: auto; background: #141615; color: #f8f8f6; box-shadow: 0 24px 100px #0008; overflow: auto; font-family: system-ui, sans-serif; }
.ugphoto-dialog:not([open]) { display: none; }
.ugphoto-dialog::backdrop { background: #080a09e8; }
.ugphoto-dialog .ugphoto-dialog__bar { display: flex; align-items: center; justify-content: space-between; min-height: 44px; gap: 16px; }
.ugphoto-dialog .ugphoto-dialog__counter { color: #d4d6d3; font-size: 14px; }
.ugphoto-dialog .ugphoto-dialog__button { appearance: none; display: grid; place-items: center; flex-shrink: 0; min-width: 44px; width: 44px; height: 44px; padding: 0; border: 1px solid #fff4; border-radius: 50%; margin: 0; color: #fff; background: #252826; font: 30px/1 system-ui, sans-serif; cursor: pointer; box-shadow: none; text-transform: none; }
.ugphoto-dialog .ugphoto-dialog__button[hidden], .ugphoto-dialog [hidden] { display: none; }
.ugphoto-dialog .ugphoto-dialog__button:hover { background: #454a46; }
.ugphoto-dialog .ugphoto-dialog__button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.ugphoto-dialog .ugphoto-dialog__stage { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 12px; min-height: 150px; margin: 12px 0; }
.ugphoto-dialog .ugphoto-dialog__image { grid-column: 2; grid-row: 1; display: block; max-width: 100%; width: 100%; height: min(70dvh, 800px); object-fit: contain; margin: 0; border: 0; padding: 0; background: transparent; }
.ugphoto-dialog .ugphoto-dialog__prev { grid-column: 1; grid-row: 1; }
.ugphoto-dialog .ugphoto-dialog__next { grid-column: 3; grid-row: 1; }
.ugphoto-dialog .ugphoto-dialog__caption, .ugphoto-dialog .ugphoto-dialog__error { margin: 8px 0 0; color: #e1e4de; font-size: 15px; line-height: 1.5; text-align: center; overflow-wrap: anywhere; }
.ugphoto-dialog .ugphoto-dialog__error { color: #ffd0bf; }
@media (max-width: 600px) {
  .ugphoto-dialog { width: 96vw; max-width: 96vw; padding: 10px; }
  .ugphoto-dialog .ugphoto-dialog__stage { grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 4px; }
  .ugphoto-dialog .ugphoto-dialog__image { grid-column: 1 / -1; height: 65dvh; }
  .ugphoto-dialog .ugphoto-dialog__button { z-index: 1; background: #181c19c9; }
}
