/* =============================================================
   360 before/after panorama viewer
   Loaded only on pages that carry one, via $page_head.
   Tokens mirror the Tailwind theme in css/tailwind.input.css.
   ============================================================= */

.rc-pano {
    --rc-pano-primary: #18A5E3;
    --rc-pano-dark: #1A1A1A;
    --rc-pano-radius: 40px;

    position: relative;
    max-width: 100%;
}

/* ---------- Stage ---------- */

.rc-pano__stage {
    position: relative;
    width: 100%;
    /* Square on phones: the overlaid controls eat a fixed ~110px, so a 4:3 box
       at 375px wide leaves too little of the driveway showing. */
    aspect-ratio: 1 / 1;
    min-height: 320px;
    max-height: 78vh;
    overflow: hidden;
    border-radius: var(--rc-pano-radius);
    background: var(--rc-pano-dark);
    box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.25), 0 10px 30px -15px rgba(0, 0, 0, 0.15);
    touch-action: none;             /* the canvas handles drag and pinch itself */
}

@media (min-width: 640px) {
    .rc-pano__stage {
        aspect-ratio: 4 / 3;
    }
}

@media (min-width: 768px) {
    .rc-pano__stage {
        aspect-ratio: 16 / 9;
        border-radius: 50px;
    }
}

.rc-pano__poster,
.rc-pano__viewport {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.rc-pano__poster {
    object-fit: cover;
    display: block;
}

/* Pannellum paints its own background; keep it on-brand while a texture
   streams in behind the low-resolution preview. */
.rc-pano__viewport .pnlm-container {
    background: var(--rc-pano-dark);
    border-radius: inherit;
}

/* The library's own chrome is switched off in config, but its load screen and
   error box still render - bring them into the site's type. */
.rc-pano__viewport .pnlm-load-box,
.rc-pano__viewport .pnlm-lbox {
    font-family: "Inter", system-ui, sans-serif;
}

/* ---------- Launch button ---------- */

.rc-pano__launch {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    width: 100%;
    border: 0;
    background: linear-gradient(to top, rgba(26, 26, 26, 0.75) 0%, rgba(26, 26, 26, 0.15) 55%, rgba(26, 26, 26, 0.35) 100%);
    color: #fff;
    cursor: pointer;
    transition: background 0.4s ease;
}

.rc-pano__launch:hover,
.rc-pano__launch:focus-visible {
    background: linear-gradient(to top, rgba(26, 26, 26, 0.85) 0%, rgba(26, 26, 26, 0.3) 55%, rgba(26, 26, 26, 0.5) 100%);
}

.rc-pano__launch-icon {
    display: grid;
    place-items: center;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--rc-pano-primary);
    box-shadow: 0 12px 40px rgba(24, 165, 227, 0.45);
    font-size: 1.9rem;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.rc-pano__launch:hover .rc-pano__launch-icon,
.rc-pano__launch:focus-visible .rc-pano__launch-icon {
    transform: scale(1.08);
}

.rc-pano__launch:active .rc-pano__launch-icon {
    transform: scale(0.95);
}

.rc-pano__launch-label {
    font-family: "Poppins", "Inter", system-ui, sans-serif;
    font-size: clamp(1.05rem, 0.9rem + 0.7vw, 1.4rem);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.rc-pano__launch-hint {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

@media (max-width: 480px) {
    .rc-pano__launch-icon {
        width: 68px;
        height: 68px;
        font-size: 1.5rem;
    }
}

/* ---------- Controls ---------- */

.rc-pano__controls {
    position: absolute;
    inset: auto 0 0 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: clamp(0.75rem, 2vw, 1.5rem);
    pointer-events: none;           /* let drags through the empty space */
}

.rc-pano__controls > * {
    pointer-events: auto;
}

.rc-pano__switch {
    display: inline-flex;
    padding: 4px;
    border-radius: 999px;
    background: rgba(26, 26, 26, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.rc-pano__switch-btn {
    min-height: 44px;
    padding: 0 clamp(1rem, 3vw, 1.75rem);
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    font-family: "Inter", system-ui, sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
}

.rc-pano__switch-btn:hover {
    color: #fff;
}

.rc-pano__switch-btn.is-active {
    background: var(--rc-pano-primary);
    color: #fff;
}

.rc-pano__tools {
    display: inline-flex;
    gap: 0.5rem;
}

.rc-pano__tool {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    background: rgba(26, 26, 26, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.rc-pano__tool:hover {
    background: var(--rc-pano-primary);
}

.rc-pano__tool:active {
    transform: scale(0.92);
}

.rc-pano__tool.is-active {
    background: var(--rc-pano-primary);
}

/* ---------- Caption + status ---------- */

.rc-pano__caption {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 1rem;
    margin-top: 1.25rem;
    font-size: 0.85rem;
    color: #4b5563;
}

.rc-pano__caption strong {
    font-weight: 800;
    color: var(--rc-pano-dark);
}

/* On a dark section the default caption colours fall to roughly 1.5:1. */
.rc-pano--on-dark .rc-pano__caption {
    color: rgba(255, 255, 255, 0.66);
}

.rc-pano--on-dark .rc-pano__caption strong {
    color: #fff;
}

.rc-pano--on-dark .rc-pano__fallback figcaption {
    color: var(--rc-pano-primary);
}

/* Announced to screen readers; the sighted equivalent is the caption. */
.rc-pano__status {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Focus ---------- */

.rc-pano__launch:focus-visible,
.rc-pano__switch-btn:focus-visible,
.rc-pano__tool:focus-visible,
.rc-pano__viewport:focus-visible {
    outline: 3px solid var(--rc-pano-primary);
    outline-offset: 3px;
}

.rc-pano__viewport:focus-visible {
    outline-offset: -3px;
}

/* ---------- Fullscreen ---------- */

.rc-pano__stage:fullscreen {
    aspect-ratio: auto;
    max-height: none;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
}

.rc-pano__stage:-webkit-full-screen {
    aspect-ratio: auto;
    max-height: none;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
}

/* ---------- States ---------- */

.rc-pano[data-pano-state="loading"] .rc-pano__launch-icon {
    animation: rc-pano-pulse 1.4s ease-in-out infinite;
}

@keyframes rc-pano-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.65; }
}

/* The still fallback pair, shown when WebGL is unavailable or the viewer
   fails to load. Hidden the rest of the time - including for screen readers,
   which get the same information from the figure captions. */
.rc-pano__fallback {
    display: none;
    margin-top: 1.5rem;
}

.rc-pano[data-pano-state="unsupported"] .rc-pano__fallback,
.rc-pano[data-pano-state="error"] .rc-pano__fallback {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .rc-pano[data-pano-state="unsupported"] .rc-pano__fallback,
    .rc-pano[data-pano-state="error"] .rc-pano__fallback {
        grid-template-columns: 1fr 1fr;
    }
}

.rc-pano__fallback img {
    width: 100%;
    height: auto;
    border-radius: 24px;
    display: block;
}

.rc-pano__fallback figcaption {
    margin-top: 0.6rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--rc-pano-primary);
}

@media (prefers-reduced-motion: reduce) {
    .rc-pano *,
    .rc-pano *::before,
    .rc-pano *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
