/*
 * AMS Testimonials — horizontal carousel of portrait (9:16) student video cards
 * + Vimeo lightbox.
 *
 * Brand alignment with ams-hello-child tokens (burgundy + cream + Mulish).
 * Falls back to hard-coded values when loaded standalone.
 */

.ams-testimonials {
    padding-block: clamp(20px, 4vw, 48px) clamp(48px, 7vw, 88px);
    background: var(--ams-cream, #FAF7F2);
    font-family: var(--ams-font-sans, "Mulish", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
    color: var(--ams-gray-900, #1A1715);
}

.ams-testimonials__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 24px);
}

.ams-testimonials__header {
    text-align: center;
    margin-bottom: clamp(28px, 4vw, 48px);
}

.ams-testimonials__eyebrow {
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ams-burgundy-500, #8B0030);
    font-weight: 700;
    margin: 0 0 10px;
}

.ams-testimonials__title {
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.15;
    font-weight: 700;
    margin: 0;
    color: var(--ams-gray-900, #1A1715);
}

/* ---------- Track ---------- */

.ams-testimonials__track-wrap {
    position: relative;
}

.ams-testimonials__track {
    list-style: none;
    margin: 0;
    padding: 12px 4px;
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    /* safe center: kartice se centrirajo, ko jih vse hkrati pridejo na zaslon (npr. 3);
       če pa jih je toliko da overflow-ajo, "safe" preskoči center in obdrži scroll-start
       (sicer prvi item zleti levo izven viewporta). */
    justify-content: safe center;
}
.ams-testimonials__track::-webkit-scrollbar { display: none; }

.ams-testimonials__card-wrap {
    flex: 0 0 auto;
    scroll-snap-align: start;
}

/* ---------- Card ---------- */

button.ams-testimonials__card,
.ams-testimonials__card {
    appearance: none;
    -webkit-appearance: none;
    display: block;
    width: 280px;
    aspect-ratio: 9 / 16;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background: var(--ams-gray-900, #1A1715);
    box-shadow: 0 8px 24px rgba(26, 23, 21, 0.16);
    border: 0;
    padding: 0;
    margin: 0;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    color: #fff;
    font-family: inherit;
    text-align: left;
}
.ams-testimonials__card:hover,
.ams-testimonials__card:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px rgba(26, 23, 21, 0.22);
    outline: none;
}
.ams-testimonials__card:focus-visible {
    outline: 3px solid var(--ams-burgundy-500, #8B0030);
    outline-offset: 4px;
}

.ams-testimonials__poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center; /* slika centred v kvadratu */
    display: block;
    transition: transform 0.5s cubic-bezier(.2,.8,.2,1);
}
.ams-testimonials__card:hover .ams-testimonials__poster {
    transform: scale(1.04);
}
.ams-testimonials__poster--placeholder {
    background: linear-gradient(135deg, #67000C 0%, #8B0030 100%);
}

.ams-testimonials__play {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    background: rgba(139, 0, 48, 0.92);
    color: #fff;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0,0,0,0.32);
    transition: background 0.15s ease, transform 0.15s ease;
}
.ams-testimonials__play svg { margin-left: 3px; }
.ams-testimonials__card:hover .ams-testimonials__play {
    background: var(--ams-burgundy-500, #8B0030);
    transform: translate(-50%, -50%) scale(1.06);
}

.ams-testimonials__overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: 16px 18px 18px;
    background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.55) 60%, transparent 100%);
    color: #fff;
    display: block;
}
.ams-testimonials__name {
    display: block;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.2;
    letter-spacing: 0.01em;
    margin-bottom: 2px;
}
.ams-testimonials__meta {
    display: block;
    font-size: 12px;
    opacity: 0.82;
    letter-spacing: 0.02em;
}

/* ---------- Arrows (desktop only) ---------- */

button.ams-testimonials__arrow,
.ams-testimonials__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: #fff;
    color: var(--ams-gray-900, #1A1715);
    border: 1px solid var(--ams-gray-100, #EDE9E3);
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(26, 23, 21, 0.14);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2;
    padding: 0;
    transition: background 0.15s, color 0.15s, transform 0.15s;
}
.ams-testimonials__arrow:hover,
.ams-testimonials__arrow:focus-visible {
    background: var(--ams-burgundy-500, #8B0030);
    color: #fff;
    transform: translateY(-50%) scale(1.05);
    outline: none;
}
.ams-testimonials__arrow:disabled {
    opacity: 0.32;
    cursor: not-allowed;
    transform: translateY(-50%);
}
.ams-testimonials__arrow--prev { left: -8px; }
.ams-testimonials__arrow--next { right: -8px; }

@media (min-width: 900px) {
    .ams-testimonials__arrow { display: inline-flex; }
}

/* ---------- Mobile ---------- */

@media (max-width: 768px) {
    button.ams-testimonials__card,
    .ams-testimonials__card { width: 75vw; max-width: 320px; }
    .ams-testimonials__track {
        gap: 14px;
        padding-inline: clamp(16px, 4vw, 24px);
        margin-inline: calc(-1 * clamp(16px, 4vw, 24px));
    }
    .ams-testimonials__play { width: 56px; height: 56px; }
}

/* ---------- Lightbox ---------- */

.ams-testimonials-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.ams-testimonials-lightbox[aria-hidden="false"] {
    display: flex;
    animation: amst-fade .18s ease-out;
}
@keyframes amst-fade { from { opacity: 0 } to { opacity: 1 } }

.ams-testimonials-lightbox__shell {
    position: relative;
    width: auto;
    height: min(92vh, calc((100vw - 48px) * 16 / 9));
    aspect-ratio: 9 / 16;
    max-width: calc(100vw - 48px);
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,0.55);
    animation: amst-pop .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes amst-pop { from { opacity: 0; transform: scale(.96) } to { opacity: 1; transform: scale(1) } }

.ams-testimonials-lightbox__player,
.ams-testimonials-lightbox__player iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #000;
}

.ams-testimonials-lightbox__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: background 0.15s ease;
}
.ams-testimonials-lightbox__close:hover,
.ams-testimonials-lightbox__close:focus-visible {
    background: var(--ams-burgundy-500, #8B0030);
    outline: none;
}

/* Print: hide carousel + lightbox */
@media print {
    .ams-testimonials,
    .ams-testimonials-lightbox { display: none !important; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    .ams-testimonials__card,
    .ams-testimonials__poster,
    .ams-testimonials__arrow,
    .ams-testimonials-lightbox,
    .ams-testimonials-lightbox__shell { transition: none; animation: none; }
}
