/* Flux's default accent. :where() keeps it at zero specificity, so an app's
   theme sets it from its own palette (spa: custom_purple.css) whichever
   stylesheet loads first. */
:where(:root) {
    --flux-primary-color: rgba(140, 70, 210, 1);
}

/* Core Flux Styles */
.flux-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
}


.flux-carousel--scroll::-webkit-scrollbar {
    display: none;
}

.flux-card {
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    
    transition: transform 0.15s ease-out;
    will-change: transform;
    z-index: 1;
    flex: 0 0 auto;
    position: relative;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    background-color: rgb(147, 147, 147);
}

.flux-carousel--reorderable .reorder-item {
    position: absolute !important;
    top: 0;
    left: 0;
    flex: none ;
}

.flux-card.flux-dragging {
    z-index: 9999;
    cursor: grabbing;
    transition: none;
}

.flux-card.flux-animating {
    z-index: 5000 !important;
}

.flux-card:hover:not(.flux-dragging) {
    transform: scale(1.01);
}

.flux-handle {
    position: absolute;
    cursor: grab;
    touch-action: none; /* a drag from the handle moves the card, in any direction */
    pointer-events: all;
    z-index: 10;
    transition: background 0.2s ease;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 8px;
    right: 8px;
}

.flux-handle:hover {
    background: rgba(210, 210, 210, 0.4);
    
}

.flux-handle::before {
    content: '⋮⋮';
    font-size: 16px;
    letter-spacing: 2px;
    color: white;
}

.flux-card.flux-dragging .flux-handle {
    cursor: grabbing;
}

.flux-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    border: 3px dashed var(--flux-primary-color);
    border-radius: 8px;
    background: color-mix(in srgb, var(--flux-primary-color) 8%, transparent);
    pointer-events: none;
    transition: transform 0.15s ease;
    z-index: 0;
}

/* RowReorderer: a <tbody>.flux-rows. The dragged row is positioned against the
   tbody, so it must be the containing block; and its placeholder is a real row
   that holds the gap - not the absolutely placed box .flux-placeholder is for
   cards. (These lived only in one page's stylesheet, campaigns.css, so table
   reordering anywhere else worked only after that page had been visited.) */
.flux-rows {
    position: relative;
}

.flux-rows > tr.flux-dragging {
    background: var(--bs-body-bg, #fff);
    box-shadow: var(--bs-box-shadow-lg, 0 1rem 3rem rgba(0, 0, 0, 0.175));
    opacity: 0.9;
}

.flux-rows > tr.flux-dragging > td {
    background: var(--bs-secondary-bg, #e9ecef);
}

.flux-rows > tr.flux-placeholder {
    position: static;
    visibility: visible;
    border: 0;
    border-radius: 0;
    background: var(--bs-body-bg, #fff);
    transform: none;
}

.flux-rows > tr.flux-placeholder > td {
    padding: 16px;
}

.flux-card.flux-card--responsive {
    width: 100%;
    aspect-ratio: 1 / 1;
    font-size: 14px;
}

/* Skeleton: a placeholder drawn in the first paint (a card, or any part of
   one: an avatar, a line of text), sized by the same classes as the real
   thing and replaced by it once the data is in.
   The shimmer is its own layer (::before), so a page's styles (a reset
   background, padding) can't hide it. --flux-skeleton-inset and
   --flux-skeleton-radius line it up with the real shape; the colours follow
   Bootstrap's theme (light and dark) when it's present. */
.flux-skeleton {
    position: relative;
}

.flux-skeleton:not(.flux-loaded) {
    color: transparent;
    pointer-events: none;
}

.flux-skeleton::before {
    content: '';
    position: absolute;
    inset: var(--flux-skeleton-inset, 0);
    border-radius: var(--flux-skeleton-radius, 8px);
    pointer-events: none;
    background: linear-gradient(90deg,
        var(--bs-secondary-bg, #e9ecef) 25%,
        var(--bs-tertiary-bg, #f4f5f7) 37%,
        var(--bs-secondary-bg, #e9ecef) 63%) 0 0 / 400% 100%;
    animation: flux-skeleton-shimmer 1.4s ease infinite;
}

/* Images in a skeleton (utils.js watchImages): an <img class="flux-fade">
   stays hidden until it loads, then the skeleton gets .flux-loaded and the
   shimmer and the image cross-fade. The shimmer pauses once it's hidden. */
.flux-skeleton .flux-fade {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.flux-skeleton.flux-loaded .flux-fade {
    opacity: 1;
}

.flux-skeleton.flux-loaded::before {
    opacity: 0;
    animation-play-state: paused; /* freeze, not reset: no jump mid-fade, no cost after */
    transition: opacity 0.3s ease;
}

/* already loaded when it appeared (cached): shown at once, no cross-fade */
.flux-skeleton.flux-cached .flux-fade,
.flux-skeleton.flux-cached::before {
    transition: none;
}

/* a placeholder dots row only reserves space; the Scroller adopts it */
.flux-page-controls.flux-skeleton::before {
    content: none;
}

@keyframes flux-skeleton-shimmer {
    from { background-position: 100% 0; }
    to { background-position: 0 0; }
}


@media (prefers-reduced-motion: reduce) {
    .flux-skeleton::before { animation: none; }
    .flux-skeleton .flux-fade,
    .flux-skeleton.flux-loaded::before { transition: none; }
}

/* prevent transitions on the elem and its children */
.flux-no-transition, .flux-no-transition * {
  transition: none !important;
}


/* Arrow navigation */
.flux-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: var(--flux-primary-color);
    border: none;
    cursor: pointer;
    padding: 0.4em;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 300ms ease;
    z-index: 10000;
    color: white;
    height: 2.3em;
    width: 2.3em;
    box-shadow: none;
    border-radius: 50%;
}

.flux-arrow:hover:not(:disabled) {
    opacity: 0.8;
}

.flux-arrow:disabled {
    cursor: not-allowed;
    opacity: 0;
    pointer-events: none;
}

.flux-arrow svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: currentColor;
    color: white;
}

.flux-arrow-left {
    left: 0;
    transform: translateY(-50%) scaleX(-1);
}

.flux-arrow-right {
    right: 0;
    transform: translateY(-50%);
}

.flux-scroller-wrapper {
    position: relative;
    display: inline-block;
    /* off the text baseline: an inline-block on it gets the line's descender
       gap below (~4px), which moved whatever follows when a skeleton gave way */
    vertical-align: top;
    width: 100%;
    /* The browser keeps vertical page scrolling and pinch-zoom; horizontal
       swipes come to the Scroller's touch handlers, which pick the axis
       themselves. (`none` blocked scrolling the page from anywhere on it.) */
    touch-action: pan-y pinch-zoom;
}

.flux-scroller {
    overflow: hidden;
    position: relative;
}

.flux-track {
    display: flex;
    will-change: transform;
}

/* Controls */
.flux-page-controls {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    user-select: none;  /* ✨ Prevent selection of entire controls */
}

/* Pagination */
.flux-pagination {
    display: flex;
    justify-content: center;
    align-items:center;
    gap: 8px;
    min-height: 10px; /* the dots' height, so an empty or placeholder row is the real row's size */
}

.flux-page-indicator.hidden {
    visibility: hidden; 
}

.flux-page-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: var(--bs-gray-500);
    padding: 0;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    user-select: none;
}

.flux-page-indicator:hover:not(.flux-active) {
    background: var(--bs-gray-400);
}

.flux-page-indicator.flux-active {
    background: var(--flux-primary-color);
    transform: scale(1.2);
}


.flux-grid-point {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.4);
    pointer-events: none;
    z-index: 0;
    user-select:none;
}


/*
// GridDisplayLayout.css
*/

.flux-grid-display {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols, 5), 1fr);
  grid-template-rows: repeat(var(--grid-rows, auto-fill), 1fr);
  gap: var(--grid-gap, 14px);
  grid-auto-flow: dense;
}

.flux-grid-display .flux-card {
  grid-column: span var(--col-span, 1);
  grid-row: span var(--row-span, 1);
  aspect-ratio: var(--aspect-ratio, 1);
  overflow: hidden;
}




/* Arrow Buttons Container */
.flux-gallery-arrows {
    display: flex;
    gap: 10px;
    user-select: none;  /* ✨ Prevent selection */
}

.flux-gallery-arrow {
    padding: 8px 12px;
    background: var(--flux-primary-color, #8c46d2);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: opacity 0.2s, background 0.2s;
    user-select: none;  /* ✨ Prevent selection */
}

.flux-gallery-arrow:hover:not(:disabled) {
    opacity: 0.8;
}

.flux-gallery-arrow:disabled,
.flux-gallery-arrow--disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

