/* Showcase — "Restaurants nutzen es bereits" landing marquee.
   Public CSS for the showcase module. Loaded only by landing.php. */

.showcase-section {
    display: grid;
    gap: 18px;
}

.showcase-section__header {
    display: grid;
    gap: 6px;
    text-align: center;
}

.showcase-section__eyebrow {
    margin: 0;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted-color);
}

.showcase-section__title {
    margin: 0 0 6px;
    font-size: 1.5rem;
}

.showcase-section__intro {
    margin: 0 auto 4px;
    max-width: 640px;
    color: var(--muted-color);
}

.showcase-section__counter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 4px auto 0;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(var(--primary-rgb), 0.10);
    /* Orange-on-orange-tint text: use the WCAG-AA derivative so the counter
       is readable. The pill background stays in --primary (decorative). */
    color: var(--primary-on-light);
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
}

.showcase-section__counter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.18);
    animation: showcase-pulse 1.8s ease-in-out infinite;
}

@keyframes showcase-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}

/* Marquee viewport — transparent so it sits naturally on the page.
   touch-action: pan-y lets the page keep scrolling vertically; horizontal
   gestures are taken over by the JS engine. */
.showcase-marquee {
    position: relative;
    overflow: hidden;
    padding: 12px 0;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 56px, #000 calc(100% - 56px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 56px, #000 calc(100% - 56px), transparent 100%);
}

.showcase-marquee.is-dragging,
.showcase-marquee.is-dragging .showcase-card {
    cursor: grabbing;
}

.showcase-marquee.is-dragging img {
    pointer-events: none;
    -webkit-user-drag: none;
}

/* Track — the JS engine owns the transform on this element via
   requestAnimationFrame. No CSS animation here: a CSS keyframe and JS
   transforms cannot share the same property without seams during handoff. */
.showcase-marquee__track {
    display: flex;
    gap: 18px;
    width: max-content;
    will-change: transform;
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
}

/* Reduced-motion: engine stays off; fall back to native horizontal scroll. */
@media (prefers-reduced-motion: reduce) {
    .showcase-marquee {
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        cursor: auto;
        touch-action: pan-x pan-y;
    }
    .showcase-marquee__track {
        will-change: auto;
        transform: none;
    }
    .showcase-card { scroll-snap-align: start; }
}

/* Card — vertical layout: the logo gets a wide, prominent stage at the top
   so any aspect ratio (wide wordmark, square icon, tall emblem) reads cleanly.
   Text sits centered below. */
.showcase-card {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    width: 200px;
    padding: 18px 14px 16px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease, background 200ms ease;
}

.showcase-card:hover,
.showcase-card:focus-visible {
    transform: translateY(-2px);
    border-color: rgba(var(--text-rgb), calc(var(--border-alpha) + 0.08));
    background: var(--surface);
    box-shadow: 0 12px 28px -14px rgba(var(--text-rgb), 0.35);
    outline: none;
}

/* Logo stage — large square with transparent background so logos designed
   for either light OR dark surfaces both render correctly against the dark
   card. Generous padding + object-fit: contain prevents any cropping
   regardless of source aspect ratio. */
.showcase-card__logo {
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2a2f3a;
    border-radius: 14px;
    padding: 8px;
    box-sizing: border-box;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

.showcase-card__logo img {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    object-fit: contain;
    object-position: center;
}

.showcase-card__logo-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(var(--primary-rgb), 0.14);
    color: var(--primary);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 1.6rem;
    text-transform: uppercase;
}

.showcase-card__body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
    min-width: 0;
    text-align: center;
}

.showcase-card__name {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-strong);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.showcase-card__meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1;
}

.showcase-card__live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.18);
    flex: 0 0 6px;
}

/* States */
.showcase-marquee__loading,
.showcase-marquee__empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--muted-color);
    font-size: 0.92rem;
}

/* Mobile tuning */
@media (max-width: 600px) {
    .showcase-section { gap: 14px; }
    .showcase-section__title { font-size: 1.25rem; }
    .showcase-section__intro { font-size: 0.92rem; }
    .showcase-marquee {
        padding: 16px 0;
        -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
        mask-image: linear-gradient(90deg, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
    }
    .showcase-marquee__track { gap: 12px; }
    .showcase-card {
        width: 168px;
        gap: 18px;
        padding: 14px 12px 12px;
    }
    .showcase-card__logo { width: 90px; height: 90px; padding: 6px; border-radius: 12px; }
    .showcase-card__logo-placeholder { width: 56px; height: 56px; font-size: 1.3rem; }
    .showcase-card__name { font-size: 0.88rem; }
    .showcase-card__meta { font-size: 0.72rem; }
}

/* Tablet refinement */
@media (min-width: 601px) and (max-width: 1024px) {
    .showcase-card { width: 188px; }
    .showcase-card__logo { width: 100px; height: 100px; padding: 6px; }
}

/* RTL: keep visual scroll direction (right→left) consistent — the marquee
   still flows in the same direction regardless of document direction, since
   the animation moves the track on the X axis directly. The viewport and
   track are pinned to LTR so the flex track anchors to the left edge and
   extends rightward; otherwise an RTL flex track anchors to the right and
   the negative translateX would slide it off-screen with nothing wrapping
   in from the right. Card content stays RTL for correct text rendering. */
html[dir='rtl'] .showcase-marquee,
html[dir='rtl'] .showcase-marquee__track {
    direction: ltr;
}
html[dir='rtl'] .showcase-card {
    direction: rtl;
}
html[dir='rtl'] .showcase-card__name,
html[dir='rtl'] .showcase-card__meta {
    text-align: right;
}
