/**
 * Custom Post Type: Ca khó (Case Study) Styling
 * Bác sĩ Tăng Đức Cương - Flatsome Child Theme
 */

/* Container list */
.ca-kho-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
    width: 100%;
    max-width: 1240px;
    margin: 25px auto 40px;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Individual Card */
.ca-kho-card {
    background: #ffffff;
    border: 1px solid #eef2f5;
    border-radius: 24px;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(320px, 48%) 1fr;
    gap: 40px;
    padding: 28px 32px;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.025);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    box-sizing: border-box;
}

.ca-kho-card:hover {
    border-color: rgba(4, 137, 150, 0.35);
    box-shadow: 0 12px 35px rgba(4, 137, 150, 0.08);
}

/* Alternating Row (Even / Reverse) */
.ca-kho-card.ca-kho-card--reverse {
    grid-template-columns: 1fr minmax(320px, 48%);
}

.ca-kho-card.ca-kho-card--reverse .ca-kho-media-col {
    order: 2;
}

.ca-kho-card.ca-kho-card--reverse .ca-kho-content-col {
    order: 1;
}

/* Media Column */
.ca-kho-media-col {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ca-kho-media-wrap,
.ca-kho-video-card,
.ca-kho-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    background: #0d1a24;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

.ca-kho-thumb-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.ca-kho-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.ca-kho-media-wrap:hover .ca-kho-thumb,
.ca-kho-video-card:hover .ca-kho-thumb,
.ca-kho-image-wrap:hover .ca-kho-thumb {
    transform: scale(1.03);
}

.ca-kho-thumb--placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0c1e24 0%, #1a3844 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* YouTube Badge Top-Right */
.ca-kho-badge-yt {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ff0000;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 4px;
    z-index: 2;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    line-height: 1.4;
}

/* Play Button Center */
.ca-kho-play-btn,
.ca-kho-video-card .te-vc-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #048996;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 6px 20px rgba(4, 137, 150, 0.45);
    transition: transform 0.2s ease, background 0.2s ease;
}

.ca-kho-video-card:hover .te-vc-play,
.ca-kho-video-card:hover .ca-kho-play-btn {
    transform: translate(-50%, -50%) scale(1.1);
    background: #036b75;
}

.ca-kho-video-card .te-vc-play svg,
.ca-kho-play-btn svg {
    margin-left: 3px;
    pointer-events: none;
}

/* Duration Badge Bottom-Left */
.ca-kho-duration,
.ca-kho-video-card .te-vc-duration {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: monospace, sans-serif;
    pointer-events: none;
    line-height: 1.2;
}

/* Content Column */
.ca-kho-content-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.ca-kho-title {
    font-size: 23px;
    font-weight: 700;
    color: #0c1e24;
    line-height: 1.35;
    margin-top: 0;
    margin-bottom: 8px;
}

.ca-kho-title a {
    color: #0c1e24;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ca-kho-title a:hover {
    color: #048996;
}

.ca-kho-subtitle {
    font-size: 15px;
    font-weight: 600;
    color: #048996;
    margin-bottom: 14px;
    line-height: 1.45;
}

.ca-kho-desc {
    font-size: 15px;
    color: #3e494a;
    line-height: 1.68;
    margin-bottom: 18px;
}

.ca-kho-desc p {
    margin-bottom: 0;
}

.ca-kho-desc strong {
    color: #0c1e24;
    font-weight: 600;
}

/* Meta list: Date & Views */
.ca-kho-meta {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 22px;
    font-size: 14px;
    color: #6b7280;
    flex-wrap: wrap;
}

.ca-kho-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.ca-kho-meta-item svg {
    opacity: 0.65;
    color: #4b5563;
    flex-shrink: 0;
}

/* CTA Read More */
.ca-kho-actions {
    display: flex;
    align-items: center;
}

.ca-kho-btn-read {
    color: #048996;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.2s ease, color 0.2s ease;
}

.ca-kho-btn-read:hover {
    color: #025760;
    gap: 10px;
    text-decoration: underline;
}

/* Responsive Breakpoints */
@media (max-width: 960px) {
    .ca-kho-card,
    .ca-kho-card.ca-kho-card--reverse {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 22px;
    }

    .ca-kho-card.ca-kho-card--reverse .ca-kho-media-col {
        order: 1 !important;
    }

    .ca-kho-card.ca-kho-card--reverse .ca-kho-content-col {
        order: 2 !important;
    }

    .ca-kho-title {
        font-size: 21px;
    }

    .ca-kho-subtitle {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .ca-kho-desc {
        font-size: 14.5px;
        margin-bottom: 16px;
    }
}

@media (max-width: 549px) {
    .ca-kho-list {
        padding: 0 12px;
        gap: 20px;
    }

    .ca-kho-card {
        padding: 16px;
        border-radius: 18px;
    }

    .ca-kho-title {
        font-size: 18px;
        line-height: 1.35;
    }

    .ca-kho-meta {
        gap: 16px;
        font-size: 13px;
        margin-bottom: 16px;
    }

    .ca-kho-btn-read {
        font-size: 15px;
    }
}
