/* Crown Photo Viewer 1.0.0 (2026-11-06). Crown's navy, gold and red; Archivo from the site's own stylesheet. */

/* On the page: photos that open get a zoom cursor, a focus ring and a small expand badge in the corner. */
.cpv-zoomable { cursor: zoom-in; -webkit-tap-highlight-color: transparent; }
.cpv-zoomable:focus { outline: none; }
.cpv-zoomable:focus-visible { outline: 3px solid #f2c14e; outline-offset: 3px; }
.cpv-badge {
  position: absolute; top: 12px; right: 12px; z-index: 3; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; pointer-events: none;
  background: rgba(18, 29, 66, .58); -webkit-backdrop-filter: blur(8px) saturate(1.3); backdrop-filter: blur(8px) saturate(1.3);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .38), 0 8px 18px -8px rgba(8, 14, 36, .65);
  opacity: 0; transform: scale(.86); transition: opacity .25s ease, transform .3s cubic-bezier(.2, .8, .2, 1);
}
.cpv-badge svg { width: 18px; height: 18px; display: block; }
@media (hover: hover) {
  .cpv-host:hover > .cpv-badge, .cpv-host:focus-within > .cpv-badge { opacity: 1; transform: none; }
}
@media (hover: none) {
  .cpv-badge { opacity: .94; transform: none; width: 34px; height: 34px; top: 10px; right: 10px; }
  .cpv-badge svg { width: 16px; height: 16px; }
}

/* The viewer: a full-screen native dialog (focus stays inside, Esc closes). */
dialog.cpv {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: transparent; color: #fff; overflow: hidden; overscroll-behavior: contain; touch-action: none;
  font-family: "Archivo", "Archivo Body Fallback", Arial, system-ui, sans-serif; -webkit-font-smoothing: antialiased;
}
dialog.cpv::backdrop { background: transparent; }
dialog.cpv .cpv-veil {
  position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 50% 42%, rgba(22, 34, 74, .95) 0%, rgba(8, 12, 30, .975) 70%);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .32s ease;
}
dialog.cpv.is-open .cpv-veil { opacity: 1; }
dialog.cpv .cpv-area { position: absolute; inset: 78px 96px 112px; pointer-events: none; }
dialog.cpv .cpv-frame {
  position: absolute; left: 0; top: 0; overflow: hidden; border-radius: 10px;
  background: #0d1430 center / cover no-repeat;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .07), 0 2px 6px rgba(0, 0, 0, .3), 0 40px 90px -30px rgba(0, 0, 0, .85);
  will-change: transform; touch-action: none; user-select: none; -webkit-user-select: none;
}
dialog.cpv .cpv-frame.can-zoom { cursor: zoom-in; }
dialog.cpv.is-zoomed .cpv-frame { cursor: zoom-out; border-radius: 0; box-shadow: none; }
dialog.cpv .cpv-img {
  display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; opacity: 0; transition: opacity .28s ease;
  -webkit-user-drag: none; pointer-events: none;
}
dialog.cpv .cpv-img.is-loaded { opacity: 1; }

/* Top bar: count on the left, zoom and close on the right */
dialog.cpv .cpv-top {
  position: absolute; top: 0; left: 0; right: 0; height: 78px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px 0 30px; pointer-events: none;
}
dialog.cpv .cpv-top > * { pointer-events: auto; }
dialog.cpv .cpv-count { margin: 0; font-weight: 700; font-size: .95rem; letter-spacing: .06em; color: #f2c14e; font-variant-numeric: tabular-nums; }
dialog.cpv .cpv-count .cpv-of { color: rgba(255, 255, 255, .5); }
dialog.cpv .cpv-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
dialog.cpv .cpv-tools { display: flex; gap: 10px; }

/* Buttons (the dialog.cpv prefix beats the theme's and Elementor's button styles) */
dialog.cpv button.cpv-btn {
  appearance: none; -webkit-appearance: none; margin: 0; padding: 0; border: 0; min-height: 0; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; font: inherit; line-height: 1; text-transform: none; letter-spacing: 0;
  background: rgba(255, 255, 255, .08); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2), 0 10px 24px -14px rgba(0, 0, 0, .8);
  cursor: pointer; transition: background-color .2s ease, box-shadow .2s ease, transform .2s cubic-bezier(.2, .8, .2, 1), opacity .25s ease;
}
dialog.cpv button.cpv-btn:hover { color: #fff; background: rgba(255, 255, 255, .17); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .42), 0 12px 26px -14px rgba(0, 0, 0, .85); }
dialog.cpv button.cpv-btn:active { transform: scale(.94); }
dialog.cpv button.cpv-btn:focus { outline: none; }
dialog.cpv button.cpv-btn:focus-visible { outline: 3px solid #f2c14e; outline-offset: 3px; }
dialog.cpv button.cpv-btn[hidden] { display: none; }
dialog.cpv button.cpv-btn svg { width: 22px; height: 22px; display: block; }
dialog.cpv button.cpv-nav { position: absolute; top: 50%; width: 54px; height: 54px; margin-top: -27px; }
dialog.cpv button.cpv-prev { left: 24px; }
dialog.cpv button.cpv-next { right: 24px; }
dialog.cpv button.cpv-nav svg { width: 26px; height: 26px; }

/* Caption: a short label (Before, After, Garage) in a red pill, then the photo's description */
dialog.cpv .cpv-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; min-height: 112px; padding: 16px 120px 28px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; pointer-events: none;
}
dialog.cpv .cpv-label {
  padding: 5px 13px 4px; border-radius: 999px; background: #b42318; color: #fff; font-weight: 700; font-size: .74rem;
  letter-spacing: .1em; text-transform: uppercase; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}
dialog.cpv .cpv-label:empty { display: none; }
dialog.cpv .cpv-cap { margin: 0; max-width: 60ch; color: #e6e9f2; font-size: 1rem; line-height: 1.5; text-wrap: balance; }

/* Zoomed in: the photo takes the whole screen and the chrome steps back */
dialog.cpv.is-zoomed .cpv-bottom, dialog.cpv.is-zoomed .cpv-nav, dialog.cpv.is-zoomed .cpv-count { opacity: 0; pointer-events: none; }
dialog.cpv.is-zoomed .cpv-top { background: linear-gradient(180deg, rgba(8, 12, 30, .55), rgba(8, 12, 30, 0)); }

/* Loading: a gold ring, only when the full-size file takes a moment */
dialog.cpv .cpv-spin {
  position: absolute; left: 50%; top: 50%; width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .16); border-top-color: #f2c14e; opacity: 0; pointer-events: none;
  transition: opacity .2s ease; animation: cpv-spin .8s linear infinite;
}
dialog.cpv.is-loading .cpv-spin { opacity: 1; }
@keyframes cpv-spin { to { transform: rotate(360deg); } }

/* Phones: arrows move down beside the caption, and the photo gets nearly the full width */
@media (max-width: 640px) {
  dialog.cpv .cpv-area { inset: 66px 10px 132px; }
  dialog.cpv .cpv-top { height: 66px; padding: 0 12px 0 20px; }
  dialog.cpv button.cpv-btn { width: 44px; height: 44px; }
  dialog.cpv button.cpv-nav { top: auto; bottom: 24px; margin: 0; width: 48px; height: 48px; }
  dialog.cpv button.cpv-prev { left: 12px; }
  dialog.cpv button.cpv-next { right: 12px; }
  dialog.cpv .cpv-bottom { min-height: 132px; padding: 12px 70px 22px; gap: 8px; }
  dialog.cpv .cpv-cap { font-size: .94rem; }
}

@media (prefers-reduced-motion: reduce) {
  .cpv-badge, dialog.cpv .cpv-veil, dialog.cpv .cpv-img, dialog.cpv button.cpv-btn { transition: none; }
  dialog.cpv .cpv-spin { animation-duration: 2s; }
}
