/* ============================================================
   ClassContentList — Apple editorial card (text-focused)
   No thumbnail. Emphasize order number, headline, description.
   Ocean-blue accents to match the ClassDetails hero.
   ============================================================ */

:root {
    --ccl-blue: #0071e3;
    --ccl-blue-bright: #2997ff;
    --ccl-link: #0066cc;
    --ccl-ocean: #0a2540;
    --ccl-surface: #f5f5f7;
    --ccl-surface-2: #fafafc;
    --ccl-hairline: rgba(10, 37, 74, 0.08);
}

.ccl {
    max-width: 1200px;
    margin: 0 auto;
    font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: #1d1d1f;
    letter-spacing: -0.374px;
}

.ccl *,
.ccl *::before,
.ccl *::after {
    box-sizing: border-box;
}

/* ---------- Header ---------- */
.ccl-head {
    text-align: center;
    margin-bottom: clamp(36px, 5vw, 60px);
    padding: 0 12px;
}

.ccl-title {
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: clamp(32px, 4.4vw, 44px);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: #1d1d1f;
    margin: 0 0 12px;
    text-wrap: balance;
}

.ccl-count {
    font-weight: 400;
    color: var(--ccl-link);
    margin-left: 8px;
    font-feature-settings: "tnum" 1;
}

.ccl-subtitle {
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: clamp(17px, 1.8vw, 21px);
    font-weight: 400;
    line-height: 1.33;
    letter-spacing: 0.011em;
    color: rgba(0, 0, 0, 0.6);
    margin: 0 auto;
    max-width: 640px;
    text-wrap: pretty;
}

/* ---------- Empty state ---------- */
.ccl-empty {
    text-align: center;
    background: var(--ccl-surface);
    border-radius: 20px;
    padding: clamp(56px, 8vw, 88px) 24px;
}

.ccl-empty-title {
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.17;
    letter-spacing: -0.015em;
    color: #1d1d1f;
    margin: 0 0 8px;
}

.ccl-empty-msg {
    font-size: 17px;
    color: rgba(0, 0, 0, 0.6);
    line-height: 1.47;
    margin: 0;
}

/* ---------- Grid ---------- */
.ccl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: clamp(16px, 2vw, 24px);
}

/* ---------- Card — editorial, text-first ---------- */
.ccl-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--ccl-surface);
    border-radius: 20px;
    padding: 32px 30px 26px;
    min-height: 280px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    isolation: isolate;
    transition:
        transform 0.38s cubic-bezier(0.25, 1, 0.5, 1),
        box-shadow 0.38s cubic-bezier(0.25, 1, 0.5, 1),
        background-color 0.3s ease;
}

/* Hairline top accent — reveals on hover */
.ccl-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        transparent 0%,
        var(--ccl-blue-bright) 20%,
        var(--ccl-blue) 50%,
        var(--ccl-blue-bright) 80%,
        transparent 100%);
    transform: scaleX(0.2);
    transform-origin: center;
    opacity: 0;
    transition: transform 0.38s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
}

/* Ambient radial glow — appears on hover behind content */
.ccl-card::after {
    content: "";
    position: absolute;
    left: -10%;
    right: -10%;
    bottom: -60%;
    height: 120%;
    background: radial-gradient(ellipse at 50% 100%,
        rgba(0, 113, 227, 0.06) 0%,
        rgba(0, 113, 227, 0) 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
    pointer-events: none;
}

.ccl-card:hover {
    transform: translateY(-6px);
    background: #ffffff;
    box-shadow:
        0 2px 4px rgba(10, 37, 74, 0.06),
        0 28px 60px -24px rgba(0, 113, 227, 0.28);
}

.ccl-card:hover::before {
    transform: scaleX(1);
    opacity: 1;
}

.ccl-card:hover::after {
    opacity: 1;
}

.ccl-card:focus-visible {
    outline: 2px solid var(--ccl-blue);
    outline-offset: 3px;
}

.ccl-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0;
}

/* ---------- Index row (order number + hairline) ---------- */
.ccl-index {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.ccl-order {
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.12em;
    color: var(--ccl-blue);
    font-feature-settings: "tnum" 1;
}

.ccl-accent {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg,
        rgba(0, 113, 227, 0.32) 0%,
        rgba(0, 113, 227, 0.08) 60%,
        transparent 100%);
    transition: background 0.3s ease;
}

.ccl-card:hover .ccl-accent {
    background: linear-gradient(90deg,
        rgba(0, 113, 227, 0.55) 0%,
        rgba(0, 113, 227, 0.15) 70%,
        transparent 100%);
}

/* ---------- Content-type badge (Đồ thị tri thức / Bài viết) ---------- */
.ccl-type {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 4px 10px;
    border-radius: 980px;
    white-space: nowrap;
}

.ccl-type::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.ccl-type.is-kg {
    background: rgba(0, 113, 227, 0.10);
    color: var(--ccl-blue);
}

.ccl-type.is-article {
    background: rgba(48, 209, 88, 0.14);
    color: #1f7a3a;
}

/* ---------- Headline — the star of the card ---------- */
.ccl-headline {
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
    font-size: clamp(20px, 2vw, 24px);
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: -0.015em;
    color: #1d1d1f;
    margin: 0 0 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-wrap: balance;
    transition: color 0.22s ease;
}

.ccl-card:hover .ccl-headline {
    color: var(--ccl-ocean);
}

/* ---------- Teaser — readable, generous ---------- */
.ccl-teaser {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.53;
    letter-spacing: -0.24px;
    color: rgba(0, 0, 0, 0.66);
    margin: 0 0 22px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    text-wrap: pretty;
}

/* ---------- Meta row ---------- */
.ccl-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    line-height: 1.33;
    letter-spacing: -0.12px;
    padding-top: 16px;
    margin-bottom: 16px;
    border-top: 1px solid var(--ccl-hairline);
}

.ccl-date {
    color: rgba(0, 0, 0, 0.48);
    font-weight: 400;
    font-feature-settings: "tnum" 1;
}

.ccl-status {
    font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 980px;
    white-space: nowrap;
}

.ccl-status.status-1 {
    background: rgba(48, 209, 88, 0.14);
    color: #1f7a3a;
}

.ccl-status.status-0 {
    background: rgba(255, 159, 10, 0.16);
    color: #8a4a00;
}

.ccl-status.status-2 {
    background: rgba(10, 37, 74, 0.08);
    color: rgba(10, 37, 74, 0.6);
}

/* ---------- CTA — signature Apple inline link with animated arrow ---------- */
.ccl-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: "SF Pro Text", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.43;
    letter-spacing: -0.224px;
    color: var(--ccl-link);
    align-self: flex-start;
    transition: gap 0.22s ease, color 0.22s ease;
}

.ccl-cta-arrow {
    font-weight: 400;
    display: inline-block;
    transition: transform 0.22s ease;
    line-height: 1;
}

.ccl-card:hover .ccl-cta {
    color: var(--ccl-blue);
    gap: 10px;
}

.ccl-card:hover .ccl-cta-arrow {
    transform: translateX(3px);
}

/* ---------- Responsive ---------- */
@media (max-width: 734px) {
    .ccl-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .ccl-card {
        padding: 26px 22px 22px;
        min-height: 240px;
    }

    .ccl-headline {
        font-size: 19px;
    }

    .ccl-teaser {
        -webkit-line-clamp: 3;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ccl-card,
    .ccl-card::before,
    .ccl-card::after,
    .ccl-headline,
    .ccl-cta,
    .ccl-cta-arrow,
    .ccl-accent {
        transition: none;
    }

    .ccl-card:hover {
        transform: none;
    }
}
