/* Shared styles that Tailwind utilities don't cover. Colours mirror the
   tailwind.config tokens in templates/base.html. */

:focus-visible {
    outline: 2px solid #7A2E2E;
    outline-offset: 2px;
}

/* Skeleton shimmer, used by the loading view and behind covers */
.shimmer {
    background: linear-gradient(90deg, #E6DFD2 0%, #F3EEE6 50%, #E6DFD2 100%);
    background-size: 200% 100%;
    animation: shimmer 1.6s ease-in-out infinite;
}
@keyframes shimmer {
    from { background-position: 100% 0; }
    to { background-position: -100% 0; }
}

/* Small spinner inside submit buttons */
.spinner {
    width: 1rem;
    height: 1rem;
    border-radius: 9999px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Loading status line cross-fade */
.loading-status {
    transition: opacity 250ms ease;
}
.loading-status.is-fading {
    opacity: 0;
}

/* ---- Spotlight results ---- */

/* Page-wide wash from the active cover, cross-faded */
.wash img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(80px) saturate(1.4);
    transform: scale(1.3);
    opacity: 0;
    transition: opacity 700ms ease;
}
.wash img.is-active {
    opacity: 0.35;
}

/* 90% paper over the wash: even a pure black cover only darkens the panel
   background to ~#F1EFE9, keeping all panel text above 7:1 contrast */
.text-panel {
    background: rgba(250, 247, 242, 0.9);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    backdrop-filter: blur(24px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 30px 60px -30px rgba(28, 25, 23, 0.35);
}

/* Cover flow. --cw is the active cover width; everything else scales from it */
.flow {
    --cw: min(180px, 44vw);
    position: relative;
    width: 100%;
    height: calc(var(--cw) * 1.5);
    perspective: 1600px;
    touch-action: pan-y;
}
@media (min-width: 640px) {
    .flow { --cw: 200px; }
}
@media (min-width: 1024px) {
    .flow { --cw: min(280px, 36vh); }
}
.flow-item {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--cw);
    aspect-ratio: 2 / 3;
    border-radius: 3px;
    transition: transform 650ms cubic-bezier(.2, .7, .2, 1), filter 650ms;
    -webkit-box-reflect: below 6px linear-gradient(transparent 70%, rgba(255, 255, 255, 0.25));
}
button.flow-item {
    cursor: pointer;
    -webkit-user-select: none;
    user-select: none;
}
.flow-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(28, 25, 23, 0.15), 0 30px 60px -20px rgba(28, 25, 23, 0.55);
}
.flow-item[data-pos="0"]  { transform: translate(-50%, -50%); z-index: 3; }
.flow-item[data-pos="-1"] { transform: translate(-142%, -50%) translateZ(-260px) rotateY(45deg); z-index: 2; filter: brightness(.85); }
.flow-item[data-pos="1"]  { transform: translate(42%, -50%) translateZ(-260px) rotateY(-45deg); z-index: 2; filter: brightness(.85); }

.flow-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    border: 1px solid rgba(28, 25, 23, 0.15);
    background: rgba(255, 255, 255, 0.7);
    color: #1C1917;
    transition: border-color 150ms, color 150ms;
}
.flow-arrow:hover {
    border-color: #7A2E2E;
    color: #7A2E2E;
}
.flow-dot {
    height: 0.375rem;
    width: 0.375rem;
    border-radius: 9999px;
    background: rgba(28, 25, 23, 0.2);
    transition: width 300ms, background-color 300ms;
}
.flow-dot.is-active {
    width: 1.5rem;
    background: #7A2E2E;
}

/* Slide change: fade the outgoing details, then swap */
.slide {
    transition: opacity 250ms ease, transform 250ms ease;
}
.slide.is-leaving {
    opacity: 0;
    transform: translateY(8px);
}

/* Covers stay hidden until loaded so the shimmer shows through */
.cover-image {
    opacity: 0;
    transition: opacity 300ms ease;
}
.cover-image.is-loaded {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .shimmer,
    .spinner {
        animation: none;
    }
    .loading-status,
    .cover-image,
    .wash img,
    .flow-item,
    .flow-dot,
    .slide {
        transition: none;
    }
}
