/**
 * Treatment Cards — TikTok-style feed for Amsterdam Hair Institute.
 * Portrait 9:16 cards, video support in .ec-card__media, floating overlay
 * elements (badge, rating, live dot, caption). AHI palette #001830 + #3e9c95.
 */

.ec-section {
    --ec-primary: #001830;
    --ec-primary-soft: #0a2a4a;
    --ec-accent: #3e9c95;
    --ec-accent-dark: #2e7f78;
    --ec-accent-soft: rgba(62, 156, 149, 0.18);
    --ec-text-dark: #0f1a2b;
    --ec-text-muted: #546070;
    --ec-surface: #ffffff;
    --ec-soft: #f6f9f8;
    --ec-border: rgba(15, 26, 43, 0.08);

    position: relative;
    padding: 90px 24px 100px;
    background: var(--ec-surface);
    font-family: 'DM Sans', 'Inter', system-ui, sans-serif;
    color: var(--ec-text-dark);
    overflow: hidden;
}
.ec-section *,
.ec-section *::before,
.ec-section *::after { box-sizing: border-box; }

.ec-wrap { max-width: 1240px; margin: 0 auto; }

/* ─── Header ─── */
.ec-section .ec-header {
    text-align: center;
    margin-bottom: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.ec-section .ec-header .dc-eyebrow { margin-bottom: 14px; }
.ec-section .ec-title {
    font-family: "Times New Roman", Times, serif;
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--ec-text-dark);
    margin: 0 0 14px;
    max-width: 720px;
}
.ec-section .ec-description {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 16.5px;
    line-height: 1.6;
    color: var(--ec-text-muted);
    max-width: 640px;
    margin: 0;
}

/* ─── Feed grid ─── */
.ec-section .ec-grid {
    display: grid;
    gap: 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.ec-section .ec-grid--2 { grid-template-columns: repeat(2, 1fr); }
.ec-section .ec-grid--3 { grid-template-columns: repeat(3, 1fr); }
.ec-section .ec-grid--4 { grid-template-columns: repeat(4, 1fr); }

.ec-section .ec-card { list-style: none; margin: 0; padding: 0; }

.ec-section .ec-card__link {
    position: relative;
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
    border-radius: 24px;
    overflow: hidden;
    background: var(--ec-primary);
    transform: translateZ(0);
    transition:
        transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        box-shadow 0.5s ease;
    box-shadow:
        0 18px 40px -16px rgba(0, 24, 48, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}
.ec-section .ec-card__link:hover {
    transform: translateY(-6px) scale(1.012);
    box-shadow:
        0 32px 60px -20px rgba(0, 24, 48, 0.5),
        0 0 0 1px rgba(62, 156, 149, 0.35) inset;
}

/* Gradient border on hover (premium feel) */
.ec-section .ec-card__link::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(160deg, rgba(62,156,149,0) 0%, rgba(62,156,149,.55) 50%, rgba(62,156,149,0) 100%);
    -webkit-mask: linear-gradient(#000,#000) content-box, linear-gradient(#000,#000);
    -webkit-mask-composite: xor;
            mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
    z-index: 5;
}
.ec-section .ec-card__link:hover::before { opacity: 1; }

/* ─── Portrait media (TikTok 9/16) ─── */
.ec-section .ec-card__media {
    position: relative;
    margin: 0;
    aspect-ratio: 9 / 16;
    overflow: hidden;
    background: var(--ec-primary);
    isolation: isolate;
}
.ec-section .ec-card__media img,
.ec-section .ec-card__media .ec-card__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.ec-section .ec-card__link:hover .ec-card__media img,
.ec-section .ec-card__link:hover .ec-card__media .ec-card__video {
    transform: scale(1.05);
}

/* Bottom gradient for caption legibility */
.ec-section .ec-card__gradient {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(0, 24, 48, 0) 35%, rgba(0, 24, 48, 0.55) 70%, rgba(0, 24, 48, 0.92) 100%),
        linear-gradient(135deg, rgba(0, 24, 48, 0.2) 0%, transparent 55%);
    pointer-events: none;
    transition: background 0.35s ease;
}
.ec-section .ec-card__link:hover .ec-card__gradient {
    background:
        linear-gradient(180deg, rgba(0, 24, 48, 0.15) 25%, rgba(0, 24, 48, 0.65) 65%, rgba(0, 24, 48, 0.95) 100%),
        linear-gradient(135deg, rgba(62, 156, 149, 0.18) 0%, transparent 55%);
}

/* ─── Floating overlay elements ─── */
.ec-section .ec-card__float {
    position: absolute;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #ffffff;
    background: rgba(0, 24, 48, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    white-space: nowrap;
    animation: ec-float 4s ease-in-out infinite;
    transition: transform 0.35s ease, background-color 0.35s ease;
}
.ec-section .ec-card__float--tl { top: 14px; left: 14px; animation-delay: 0s; }
.ec-section .ec-card__float--tr { top: 14px; right: 14px; animation-delay: 0.8s; }
.ec-section .ec-card__float--bl { bottom: 14px; left: 14px; animation-delay: 1.4s; }
.ec-section .ec-card__float--br { bottom: 14px; right: 14px; animation-delay: 1.8s; }

@keyframes ec-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-4px); }
}

/* Badge pill (technique name) */
.ec-section .ec-card__badge {
    background: rgba(62, 156, 149, 0.85);
    border-color: rgba(255, 255, 255, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
}

/* Rating with star */
.ec-section .ec-card__rating svg {
    width: 14px;
    height: 14px;
    color: #ffd46b;
    margin-right: 2px;
}

/* Live indicator for video cards */
.ec-section .ec-card__live {
    background: rgba(236, 72, 72, 0.72);
    border-color: rgba(255, 255, 255, 0.28);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 10.5px;
}
.ec-section .ec-card__live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6);
    animation: ec-live-pulse 1.6s ease-in-out infinite;
}
@keyframes ec-live-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,.55); opacity: 1; }
    50%      { box-shadow: 0 0 0 6px rgba(255,255,255,0); opacity: .7; }
}

/* ─── Caption (title + subtitle + CTA) ─── */
.ec-section .ec-card__caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 22px 20px 22px;
    color: #ffffff;
    text-align: left;
}
.ec-section .ec-card__title {
    font-family: "Times New Roman", Times, serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    color: #ffffff;
    margin: 0 0 6px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.ec-section .ec-card__subtitle {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 13.5px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ec-section .ec-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    background: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}
.ec-section .ec-card__cta svg { width: 13px; height: 13px; transition: transform 0.3s ease; }
.ec-section .ec-card__link:hover .ec-card__cta {
    background: #ffffff;
    color: var(--ec-primary);
    border-color: #ffffff;
    transform: translateX(2px);
    box-shadow: 0 6px 18px -6px rgba(62, 156, 149, 0.6);
}
.ec-section .ec-card__link:hover .ec-card__cta svg { transform: translateX(3px); }

/* ─── CTA row ─── */
.ec-section .ec-cta {
    display: flex;
    justify-content: center;
    margin-top: 44px;
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
    .ec-section { padding: 80px 22px 90px; }
    .ec-section .ec-grid--4 { grid-template-columns: repeat(3, 1fr); }
    .ec-section .ec-grid--3 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
    .ec-section .ec-grid--4,
    .ec-section .ec-grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .ec-section { padding: 70px 20px 80px; }
    .ec-section .ec-grid { gap: 18px; }
    .ec-section .ec-grid--2,
    .ec-section .ec-grid--3,
    .ec-section .ec-grid--4 { grid-template-columns: repeat(2, 1fr); }
    .ec-section .ec-card__title { font-size: 21px; }
    .ec-section .ec-card__caption { padding: 18px 16px; }
}
@media (max-width: 560px) {
    .ec-section { padding: 56px 16px 64px; }
    .ec-section .ec-grid { gap: 14px; }
    .ec-section .ec-grid--2,
    .ec-section .ec-grid--3,
    .ec-section .ec-grid--4 {
        grid-template-columns: 1fr;
        scroll-snap-type: x mandatory;
    }
    .ec-section .ec-card__title { font-size: 20px; }
    .ec-section .ec-card__caption { padding: 18px 16px; }
    .ec-section .ec-card__float { font-size: 11px; padding: 5px 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .ec-section .ec-card__link,
    .ec-section .ec-card__media img,
    .ec-section .ec-card__media .ec-card__video,
    .ec-section .ec-card__float,
    .ec-section .ec-card__live-dot { animation: none; transition: none; }
}
