/**
 * Testimonials Carousel — Amsterdam Hair Institute.
 * AHI palette (#001830 + #3e9c95). Portrait 9:16 video cards with glass stats,
 * teal accents and navy arrows/dots. Eyebrow is provided by the shared
 * DC_Eyebrow helper (rendered inside .tc-tag-wrapper).
 */

:root {
    --tc-primary:      #001830;
    --tc-primary-soft: #0a2a4a;
    --tc-accent:       #3e9c95;
    --tc-accent-dark:  #2e7f78;
    --tc-accent-soft:  rgba(62, 156, 149, 0.12);
    --tc-surface:      #ffffff;
    --tc-soft:         #f6f9f8;
    --tc-text:         #546070;
    --tc-text-light:   #f5f7f8;
    --tc-border:       rgba(15, 26, 43, 0.1);
    --tc-transition:   all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --tc-shadow-soft:
        0 6px 14px -8px rgba(0, 24, 48, 0.1),
        0 18px 34px -18px rgba(0, 24, 48, 0.14);
    --tc-shadow-heavy:
        0 14px 30px -12px rgba(0, 24, 48, 0.28),
        0 30px 60px -20px rgba(0, 24, 48, 0.4);
}

/* ─── Section & Container ─── */
.tc-section {
    position: relative;
    width: 100%;
    padding: 90px 0 100px;
    background-color: var(--tc-surface);
    overflow: hidden;
    font-family: 'DM Sans', 'Inter', system-ui, sans-serif;
}
.tc-container {
    width: 100%;
    max-width: 100%;
}

/* ─── Header ─── */
.tc-header {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
    padding: 0 20px;
}
.tc-tag-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 0;
}
/* Align the shared hair-seed eyebrow centred within the header */
.tc-tag-wrapper .dc-eyebrow { margin: 0 auto; }

.tc-title {
    margin: 22px 0 0;
    font-size: clamp(30px, 4.2vw, 46px);
    font-weight: 700;
    line-height: 1.14;
    color: var(--tc-primary);
    letter-spacing: -0.015em;
}
.tc-description {
    margin: 16px auto 0;
    max-width: 640px;
    font-size: 17px;
    line-height: 1.6;
    color: var(--tc-text);
}

/* ─── CTA Button (header) ─── */
.tc-cta-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}
.tc-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px 10px 10px;
    background-color: #001830;
    color: var(--tc-surface);
    text-decoration: none;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: 2px solid transparent;
    box-shadow: 0 14px 30px -10px rgba(0, 24, 48, 0.45);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.tc-cta-button:hover {
    background-color: #3e9c95;
    color: var(--tc-surface);
    transform: translateY(-2px);
    text-decoration: none;
    box-shadow: 0 18px 40px -10px rgba(62, 156, 149, 0.7);
}
.tc-cta-image {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.35);
}
.tc-cta-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tc-cta-text { white-space: nowrap; }

/* ─── Carousel wrapper ─── */
.tc-carousel-wrapper {
    position: relative;
    width: 100%;
    margin-top: 56px;
    overflow: visible;
}
.tc-carousel-track {
    display: flex;
    gap: 20px;
    cursor: grab;
    user-select: none;
    touch-action: pan-y;
    will-change: transform;
}
.tc-carousel-track.is-dragging { cursor: grabbing; }

/* ─── Card ─── */
.tc-card {
    flex-shrink: 0;
    width: 320px;
    min-width: 320px;
    border-radius: 26px;
    transition: opacity 0.45s ease, transform 0.45s ease;
}
.tc-card:not(.is-active) {
    opacity: 0.55;
    transform: scale(0.92);
}
.tc-card.is-active {
    opacity: 1;
    transform: scale(1);
}

/* Video / poster frame */
.tc-video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    border-radius: 28px;
    overflow: hidden;
    background-color: var(--tc-primary);
    box-shadow: var(--tc-shadow-heavy);
    isolation: isolate;
}
.tc-video-container::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 24, 48, 0) 55%, rgba(0, 24, 48, 0.55) 100%);
    pointer-events: none;
    z-index: 1;
}
.tc-video-wrapper {
    position: absolute;
    inset: 0;
    mask: linear-gradient(0deg, rgb(0, 0, 0) 82%, rgba(0, 0, 0, 0) 100%);
    -webkit-mask: linear-gradient(0deg, rgb(0, 0, 0) 82%, rgba(0, 0, 0, 0) 100%);
}
.tc-video-wrapper .tc-poster,
.tc-video-wrapper .tc-video,
.tc-video-wrapper .tc-youtube-slot {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.35s ease;
}
.tc-video-wrapper .tc-poster { z-index: 1; opacity: 1; }
.tc-video-wrapper .tc-video,
.tc-video-wrapper .tc-youtube-slot { z-index: 2; opacity: 0; pointer-events: none; }

/* Only the active slide reveals its video/iframe and plays */
.tc-card.is-active .tc-video-wrapper .tc-video,
.tc-card.is-active .tc-video-wrapper .tc-youtube-slot { opacity: 1; pointer-events: auto; }
.tc-card.is-active .tc-video-wrapper .tc-poster { opacity: 0; }

.tc-video-wrapper .tc-youtube-slot iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
}

/* YouTube — no letterbox mask on the wrapper */
.tc-video-container--youtube .tc-video-wrapper {
    mask: none;
    -webkit-mask: none;
}

/* Profile chip */
.tc-profile {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    background: rgba(0, 24, 48, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.tc-profile-image {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.35);
}
.tc-profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tc-username {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--tc-text-light);
    letter-spacing: 0.01em;
}
.tc-verified {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--tc-accent);
}
.tc-verified svg { width: 100%; height: 100%; }
.tc-verified svg circle { fill: var(--tc-accent); }

/* ─── Stats / meta row ─── */
.tc-stats {
    list-style: none;
    padding: 0 4px;
    margin: 14px 0 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    justify-content: center;
    font-size: 12.5px;
    line-height: 1.35;
    color: var(--tc-primary);
}
.tc-stat-badge {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    white-space: normal;
    overflow: visible;
    box-shadow: none;
    max-width: 100%;
}
.tc-stat-badge + .tc-stat-badge::before {
    content: "·";
    color: var(--tc-accent);
    font-weight: 700;
    margin-right: 4px;
    opacity: 0.7;
}
.tc-stat-badge--primary {
    color: var(--tc-primary);
    font-weight: 700;
}
.tc-stat-badge--secondary {
    color: var(--tc-text);
    font-weight: 500;
}
.tc-stat-badge__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--tc-accent-dark);
}
.tc-stat-badge__icon svg { width: 100%; height: 100%; }
.tc-stat-badge--primary .tc-stat-badge__icon { color: var(--tc-accent); }
.tc-stat-badge__text {
    display: inline;
    overflow: visible;
    max-width: none;
}

/* ─── Navigation arrows ─── */
.tc-nav-arrows {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-100%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
    z-index: 10;
}
.tc-arrow {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 24, 48, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--tc-surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--tc-transition);
    pointer-events: auto;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.tc-arrow:hover {
    background: var(--tc-accent);
    border-color: var(--tc-accent);
    transform: scale(1.08);
    color: var(--tc-surface);
}
.tc-arrow:active { transform: scale(0.95); }
.tc-arrow svg { width: 22px; height: 22px; }

/* ─── Pagination dots ─── */
.tc-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    margin-top: 28px;
    padding: 6px 12px;
    background: rgba(0, 24, 48, 0.06);
    border: 1px solid rgba(62, 156, 149, 0.2);
    border-radius: 999px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}
.tc-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--tc-primary);
    border: none;
    padding: 0;
    margin: 0 5px;
    cursor: pointer;
    opacity: 0.25;
    transition: var(--tc-transition);
}
.tc-dot.active {
    opacity: 1;
    background: var(--tc-accent);
    transform: scale(1.2);
}
.tc-dot:hover { opacity: 0.65; }

/* ─── Responsive ─── */
@media (max-width: 1024px) {
    .tc-title { font-size: 36px; }
    .tc-description { font-size: 16px; }
    .tc-card { width: 280px; min-width: 280px; }
}
@media (max-width: 768px) {
    .tc-section { padding: 70px 0 80px; }
    .tc-title { font-size: 30px; }
    .tc-description { font-size: 15px; }
    .tc-card { width: 260px; min-width: 260px; }
    .tc-carousel-wrapper { margin-top: 40px; }
    .tc-nav-arrows { display: none; }
    .tc-stats { gap: 4px 8px; font-size: 11.5px; }
}
@media (max-width: 480px) {
    .tc-section { padding: 56px 0 66px; }
    .tc-title { font-size: 26px; }
    .tc-card { width: 240px; min-width: 240px; }
    .tc-video-container { border-radius: 24px; }
    .tc-profile-image { width: 28px; height: 28px; }
    .tc-username { font-size: 13px; }
    .tc-pagination { padding: 4px 8px; }
    .tc-dot { width: 8px; height: 8px; margin: 0 3px; }
}

/* Elementor editor compatibility */
.elementor-editor-active .tc-carousel-track {
    flex-wrap: wrap;
    justify-content: center;
}
.elementor-editor-active .tc-card {
    opacity: 1 !important;
    transform: scale(1) !important;
}

/* Animations */
@keyframes tc-fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.tc-section[data-animated="true"] .tc-header { animation: tc-fadeIn 0.6s ease forwards; }
.tc-section[data-animated="true"] .tc-carousel-wrapper {
    animation: tc-fadeIn 0.6s ease 0.2s forwards;
    opacity: 0;
}

/* Video play state */
.tc-card video { transition: opacity 0.3s ease; }
.tc-card:not(.is-active) video { opacity: 0.7; }

/* Print */
@media print {
    .tc-carousel-wrapper { overflow: visible; }
    .tc-carousel-track   { flex-wrap: wrap; justify-content: center; }
    .tc-card             { opacity: 1 !important; transform: none !important; break-inside: avoid; }
    .tc-nav-arrows,
    .tc-pagination       { display: none; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .tc-carousel-track,
    .tc-card,
    .tc-cta-button,
    .tc-stat-badge,
    .tc-arrow,
    .tc-dot { transition: none; }

    .tc-section[data-animated="true"] .tc-header,
    .tc-section[data-animated="true"] .tc-carousel-wrapper {
        animation: none;
        opacity: 1;
    }
}
