/* ══════════════════════════════════════════════════════════════════════════
   xrv-cf.css  —  "핵심기능" 섹션 공용 컴포넌트 (.xrv-cf*)
   값은 모두 기존 xrv-ov* CSS 변수를 참조합니다 (신규 hex 하드코딩 없음).
   라이트 모디파이어: .xrv-cf--light
   다크  모디파이어: .xrv-cf--dark  (미지정 시 기본 다크)
   ══════════════════════════════════════════════════════════════════════════ */

/* ── 라이트 스킨 변수 (xrv-ov--light 와 동일 값, 해당 요소 스코프로 재선언) ─ */
.xrv-cf--light {
    --cf-lt-ink:       #111827;
    --cf-lt-title:     #172033;
    --cf-lt-subtitle:  #237A6C;   /* WCAG AA 5.15:1 on #F7F8FA/white (#278879 원안 → 대비 강화) */
    --cf-lt-body:      #667085;
    --cf-lt-muted:     #64748B;
    --cf-lt-label:     #067F6F;
    --cf-lt-cta:       #6546C8;   /* 6.42:1 on white */
    --cf-lt-border:    #E5E7EB;
    --cf-lt-card:      #FFFFFF;
    --cf-lt-grad-end:  #0B8F7A;
    --cf-lt-grad-last: #6366F1;
    --cf-lt-accent:    #33E0C4;   /* eyebrow 선 색 (광량 충분한 배경이므로 그대로 사용) */
}

/* ── 섹션 래퍼 ────────────────────────────────────────────────────────────── */
.xrv-cf {
    padding: 54px var(--mha-sec-x, 60px) 108px;
    background: #0a0c12;                                    /* 다크 기본 */
    scroll-margin-top: calc(var(--header-height, 45px) + 46px);
    position: relative;
}
.xrv-cf--light {
    background: var(--section-bg-light, #F7F8FA);
    border-bottom: 1px solid var(--border-light, #E5E7EB); /* §1 섹션 하단 구분선 */
}

.xrv-cf__inner {
    max-width: var(--mha-wrap-max, 1450px);
    margin: 0 auto;
}

/* ── 섹션 헤더 ───────────────────────────────────────────────────────────── */
.xrv-cf__head {
    text-align: center;
    margin-bottom: 56px;
}

/* eyebrow (──  라벨  ──) */
.xrv-cf__eyebrow {
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium, 500);
    letter-spacing: .16em;
    text-transform: uppercase;
    color: #33E0C4;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
}
.xrv-cf--light .xrv-cf__eyebrow {
    color: var(--cf-lt-label);
}
.xrv-cf__eyebrow::before,
.xrv-cf__eyebrow::after {
    content: '';
    display: block;
    width: 24px;
    height: 1px;
    flex-shrink: 0;
}
.xrv-cf__eyebrow::before {
    background: linear-gradient(90deg, transparent, #33E0C4);
}
.xrv-cf__eyebrow::after {
    background: linear-gradient(90deg, #33E0C4, transparent);
}
.xrv-cf--light .xrv-cf__eyebrow::before {
    background: linear-gradient(90deg, transparent, var(--cf-lt-label));
}
.xrv-cf--light .xrv-cf__eyebrow::after {
    background: linear-gradient(90deg, var(--cf-lt-label), transparent);
}

/* H2 제목 */
.xrv-cf__title {
    font-family: var(--font-family);
    font-size: var(--typo-overview-title-size, clamp(1.75rem, 3.6vw, 2.6rem));
    font-weight: var(--typo-overview-title-weight, 700);
    letter-spacing: var(--typo-overview-title-letter-spacing, -0.02em);
    line-height: var(--typo-overview-title-line-height, 1.25);
    color: #eef0f6;
    margin: 0 0 20px;
    word-break: keep-all;
    overflow-wrap: break-word;
}
.xrv-cf--light .xrv-cf__title {
    color: var(--cf-lt-ink);
}

/* 2행 강조 (그라디언트 텍스트) */
.xrv-cf__accent {
    display: block;
    background: linear-gradient(112deg, #33E0C4 0%, #7C5CFF 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}
.xrv-cf--light .xrv-cf__accent {
    background: linear-gradient(112deg, var(--cf-lt-grad-end) 0%, var(--cf-lt-grad-last) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 소개문 */
.xrv-cf__intro {
    font-family: var(--font-family);
    font-size: var(--typo-overview-desc-size, clamp(.95rem, 1.8vw, 1.125rem));
    font-weight: var(--typo-overview-desc-weight, 400);
    line-height: var(--typo-overview-desc-line-height, 1.7);
    color: rgba(238, 240, 246, .72);
    max-width: 68ch;
    margin: 16px auto; /* 위: h2 아래 여백 / 아래: 버튼 위 여백 */
    word-break: keep-all;
    overflow-wrap: break-word;
}
.xrv-cf--light .xrv-cf__intro {
    color: var(--cf-lt-body);
}

/* ── 소개문 접기 컨트롤 (button / aria-expanded) ─────────────────────────────
   기본 상태: 접힘 (JS 로드 시 .xrv-cf__intro--collapsed 추가, button[hidden] 해제).
   JS 비활성화: button[hidden] 유지 → intro 전체 노출 (SEO · Googlebot 완전 노출).
   라벨 상수: _core_features.html 의 _CF_FOLD_LABEL 변수 (한 곳만 관리).
   ─────────────────────────────────────────────────────────────────────────── */

/* JS 로드 후 접힘 */
.xrv-cf__intro--collapsed { display: none; }

/* 소개문 펼침 시 페이드인 */
.xrv-cf__intro:not(.xrv-cf__intro--collapsed) {
    animation: xrv-cf-fold-in .15s ease both;
}
@keyframes xrv-cf-fold-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* 버튼 (xrv-ov__desc-toggle 동일 설계) */
.xrv-cf__fold-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: .85rem;
    font-weight: 600;
    color: #33E0C4;
    padding: 0;
    border: none;
    background: none;
    user-select: none;
}
.xrv-cf__fold-btn:focus-visible {
    outline: 2px solid #33E0C4;
    outline-offset: 3px;
}

/* 레이블 교체: 접힘="핵심 기능 살펴보기" / 펼침="접기" — CSS 제어 */
.xrv-cf__fold-label--open                                         { display: none; }
.xrv-cf__fold-btn[aria-expanded="true"] .xrv-cf__fold-label       { display: none; }
.xrv-cf__fold-btn[aria-expanded="true"] .xrv-cf__fold-label--open { display: inline; }

/* 쉐브론 아이콘: 펼침 시 180° 회전 */
.xrv-cf__fold-icon {
    flex-shrink: 0;
    display: inline-flex;
    transition: transform .3s ease;
}
.xrv-cf__fold-btn[aria-expanded="true"] .xrv-cf__fold-icon {
    transform: rotate(180deg);
}

/* 라이트 스킨 */
.xrv-cf--light .xrv-cf__fold-btn {
    color: var(--cf-lt-label);
}
.xrv-cf--light .xrv-cf__fold-btn:focus-visible {
    outline-color: var(--cf-lt-label);
}

/* 인쇄 — 접힌 상태라도 소개문 출력 */
@media print {
    .xrv-cf__intro { display: block !important; }
}

/* ── 카드 목록 (지그재그 행) ─────────────────────────────────────────────── */
.xrv-cf__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: clamp(64px, 6vw, 96px);  /* 행 간격 64~96px */
    counter-reset: cf-card;
}

/* 행: 텍스트 좌(45%) / 미디어 우(55%) — 홀수 */
.xrv-cf__row {
    display: grid;
    grid-template-columns: minmax(min(360px, 100%), .9fr) minmax(0, 1.1fr);
    column-gap: clamp(40px, 3.5vw, 56px);
    align-items: stretch;
}
/* 짝수(reverse) 행: 트랙도 반전하여 미디어가 항상 1.1fr(넓은) 트랙에 들어오도록 함.
   order 만 바꾸면 미디어가 좁은(.9fr) 트랙에 배정되는 결함 방지. */
.xrv-cf__row--reverse {
    grid-template-columns: minmax(0, 1.1fr) minmax(min(360px, 100%), .9fr);
}
.xrv-cf__row--reverse .xrv-cf__text  { order: 2; }
.xrv-cf__row--reverse .xrv-cf__media { order: 1; }

/* 미디어 없는 카드: 단일 열 중앙 정렬 */
.xrv-cf__row--no-media {
    grid-template-columns: 1fr;
    max-width: 720px;
    margin-inline: auto;
}

/* ── 텍스트 열 ────────────────────────────────────────────────────────────── */
.xrv-cf__text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 번호 라벨 (CORE TECHNOLOGY 01) */
.xrv-cf__no {
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semi, 600);
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(238, 240, 246, .40);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    user-select: none;
}
.xrv-cf--light .xrv-cf__no {
    color: var(--cf-lt-muted);
}
.xrv-cf__no::before {
    content: '';
    display: block;
    width: 20px;
    height: 1px;
    background: currentColor;
    flex-shrink: 0;
}

/* H3 카드 제목 — 공개 안전망: 데스크톱 1줄, 모바일 2줄 (§3-4) */
.xrv-cf__card-title {
    font-family: var(--font-family);
    font-size: clamp(28px, 2.2vw, 34px);   /* max 34px: H2 max 48px 대비 70.8% ≤ 85% ✓ */
    font-weight: 700;
    line-height: 1.35;                      /* 2줄 제목 가독성 (45% 텍스트 열) */
    letter-spacing: -0.035em;
    color: #eef0f6;
    margin: 0 0 8px;
    word-break: keep-all;
    overflow-wrap: break-word;
    /* line-clamp: title 1줄 — text-wrap:balance 제거(clamp와 충돌, §3-4) */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--xrv-cf-lines-title, 1);
    line-clamp: var(--xrv-cf-lines-title, 1);
    overflow: hidden;
}
.xrv-cf--light .xrv-cf__card-title {
    color: var(--cf-lt-title);
}

/* 태그라인 — 공개 안전망: 데스크톱 2줄, 모바일 3줄 (§3-4) */
.xrv-cf__tagline {
    font-family: var(--font-family);
    font-size: clamp(18px, 1.4vw, 21px);
    font-weight: 600;
    line-height: 1.5;
    color: #33E0C4;
    margin: 0 0 16px;
    word-break: keep-all;
    /* text-wrap:balance 제거(line-clamp와 충돌) */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--xrv-cf-lines-tagline, 2);
    line-clamp: var(--xrv-cf-lines-tagline, 2);
    overflow: hidden;
}
.xrv-cf--light .xrv-cf__tagline {
    color: var(--cf-lt-subtitle);
}

/* 설명 — 공개 안전망: 데스크톱 3줄, 모바일 4줄 (§3-4) */
.xrv-cf__desc {
    font-family: var(--font-family);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.8;
    color: rgba(238, 240, 246, .72);
    margin: 0 0 20px;
    word-break: keep-all;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--xrv-cf-lines-desc, 3);
    line-clamp: var(--xrv-cf-lines-desc, 3);
    overflow: hidden;
}
.xrv-cf--light .xrv-cf__desc {
    color: var(--cf-lt-body);
}

/* 체크리스트 */
.xrv-cf__checks {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.xrv-cf__check-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    color: rgba(238, 240, 246, .80);
    word-break: keep-all;
}
.xrv-cf--light .xrv-cf__check-item {
    color: var(--cf-lt-body);
}
.xrv-cf__check-icon {
    flex-shrink: 0;
    margin-top: .15em;
    width: 16px;
    height: 16px;
    color: #33E0C4;
}
.xrv-cf--light .xrv-cf__check-icon {
    color: var(--cf-lt-subtitle);
}

/* CTA 상세보기 링크 */
.xrv-cf__detail-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-top: 24px;
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: var(--font-weight-semi, 600);
    color: #9B72FF;                         /* 다크: ~5.8:1 on #0a0c12 */
    text-decoration: none;
    word-break: keep-all;
}
.xrv-cf--light .xrv-cf__detail-link {
    color: var(--cf-lt-cta);               /* #6546C8 — 6.42:1 on white */
}
.xrv-cf__detail-link:visited {
    color: #9B72FF;
}
.xrv-cf--light .xrv-cf__detail-link:visited {
    color: var(--cf-lt-cta);
}
.xrv-cf__detail-link:hover,
.xrv-cf__detail-link:focus-visible {
    text-decoration: underline;
}
.xrv-cf__detail-link:focus-visible {
    outline: 2px solid #9B72FF;
    outline-offset: 3px;
    border-radius: 2px;
}
.xrv-cf--light .xrv-cf__detail-link:focus-visible {
    outline-color: var(--cf-lt-cta);
}

/* ── 솔루션 링크 목록 (핵심기능 카드 CTA — solutions_json 있을 때) ─────────────
   레이아웃: "솔루션" 레이블 + 쉼표 구분 링크 인라인 목록.
   solutions_json 없을 때는 기존 .xrv-cf__detail-link CTA 폴백.                */
.xrv-cf__solutions {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 6px;
    margin-top: 24px;
}

.xrv-cf__solutions-label {
    font-family: var(--font-family);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: rgba(238, 240, 246, .45);
    flex-shrink: 0;
    padding-right: 4px;
}
.xrv-cf--light .xrv-cf__solutions-label {
    color: var(--cf-lt-muted);
}

.xrv-cf__solutions-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}

/* 첫 항목 이후에 쉼표 구분자 삽입 */
.xrv-cf__solutions-item + .xrv-cf__solutions-item::before {
    content: ',\00a0';          /* 쉼표 + no-break space */
    font-family: var(--font-family);
    font-size: 15px;
    color: rgba(238, 240, 246, .45);
    user-select: none;
}
.xrv-cf--light .xrv-cf__solutions-item + .xrv-cf__solutions-item::before {
    color: var(--cf-lt-muted);
}

.xrv-cf__solutions-item {
    display: inline-flex;
    align-items: center;
}

.xrv-cf__solutions-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-family: var(--font-family);
    font-size: 15px;
    font-weight: var(--font-weight-semi, 600);
    color: #9B72FF;
    text-decoration: none;
    word-break: keep-all;
}
.xrv-cf--light .xrv-cf__solutions-link {
    color: var(--cf-lt-cta);
}
.xrv-cf__solutions-link:visited {
    color: #9B72FF;
}
.xrv-cf--light .xrv-cf__solutions-link:visited {
    color: var(--cf-lt-cta);
}
.xrv-cf__solutions-link:hover,
.xrv-cf__solutions-link:focus-visible {
    text-decoration: underline;
}
.xrv-cf__solutions-link:focus-visible {
    outline: 2px solid #9B72FF;
    outline-offset: 3px;
    border-radius: 2px;
}
.xrv-cf--light .xrv-cf__solutions-link:focus-visible {
    outline-color: var(--cf-lt-cta);
}
/* 외부 링크 ↗ 표시 */
.xrv-cf__solutions-link[target="_blank"]::after {
    content: '\00a0↗';
    font-size: .78em;
    opacity: .60;
}

/* ── 미디어 열 ────────────────────────────────────────────────────────────── */
.xrv-cf__media {
    border-radius: 14px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16 / 9;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .24);
    /* 포스터 없을 때 그라디언트 폴백 (검은 화면 방지) */
    background: linear-gradient(135deg, #0D1B2A 0%, #111827 60%, #0a0c12 100%);
    align-self: center;
}
.xrv-cf--light .xrv-cf__media {
    box-shadow: 0 8px 32px rgba(0, 0, 0, .08);
    background: linear-gradient(135deg, #111827 0%, #1a2840 60%, #0D1B2A 100%);
}

.xrv-cf__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    /* 이미지 저장 억제 — 우클릭 "이미지 저장" 제거, iOS 길게 누르기 시트 제거 */
    pointer-events: none;       /* 우클릭 타깃이 래퍼로 올라가 "이미지 저장" 항목 미표시 */
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    user-select: none;
}

/* 영상 래퍼 */
.xrv-cf__video-wrap {
    width: 100%;
    height: 100%;
    position: relative;
    display: block;
}
.xrv-cf__poster {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    /* 포스터 이미지 저장 억제 */
    pointer-events: none;
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    user-select: none;
}
/* JS가 동적으로 생성하는 <video>의 인라인 style(object-fit:cover) 재정의 */
.xrv-cf__video-wrap video {
    object-fit: contain !important;
}
/* 포스터 없음 폴백 <video> 미리보기 — hidden 속성으로 JS가 숨김 */
.xrv-cf__poster--preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* 재생 버튼 */
.xrv-cf__play-btn {
    position: absolute;
    inset: 0;
    width: 64px;
    height: 64px;
    margin: auto;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .75);
    background: rgba(0, 0, 0, .42);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background .2s ease, transform .18s ease;
    min-width: 44px;
    min-height: 44px;
}
.xrv-cf__play-btn:hover,
.xrv-cf__play-btn:focus-visible {
    background: rgba(0, 0, 0, .62);
    transform: scale(1.08);
}
.xrv-cf__play-btn:focus-visible {
    outline: 2px solid #33E0C4;
    outline-offset: 4px;
}
.xrv-cf--light .xrv-cf__play-btn:focus-visible {
    outline-color: var(--cf-lt-label);
}

/* 미디어 칩 라벨 (좌하단) */
.xrv-cf__chip {
    position: absolute;
    bottom: 14px;
    left: 14px;
    font-family: var(--font-family);
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .52);
    color: rgba(255, 255, 255, .88);
    backdrop-filter: blur(6px);
    pointer-events: none;
    user-select: none;
}

/* ── 줄 수 클램프 CSS 변수 (데스크톱 기본 / 모바일 +1줄 오버라이드) ─────────
   관리자 저장 한도는 데스크톱 기준. 모바일에서는 같은 문구가 더 길게 줄바꿈되므로
   +1줄 여유를 준다 (D1). 실제 말줄임은 관리자가 한도 초과 상태로 저장한 경우에만
   발생하며, 정상 운영에서는 발생하지 않아야 한다.           ── */
:root {
    --xrv-cf-lines-title:   1;   /* 데스크톱 */
    --xrv-cf-lines-tagline: 2;
    --xrv-cf-lines-desc:    3;
}
@media (max-width: 768px) {
    :root {
        --xrv-cf-lines-title:   2;   /* 모바일 +1 */
        --xrv-cf-lines-tagline: 3;
        --xrv-cf-lines-desc:    4;
    }
}

/* ── 반응형 ───────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .xrv-cf__row {
        grid-template-columns: 1fr;
        gap: 24px;          /* 텍스트-미디어 수직 간격 */
    }
    /* 모바일: reverse order 초기화 — DOM 순서(텍스트→미디어) 그대로
       grid-template-columns:1fr 은 위 .xrv-cf__row 규칙이 후위(later cascade)이므로 별도 불필요 */
    .xrv-cf__row--reverse .xrv-cf__text,
    .xrv-cf__row--reverse .xrv-cf__media {
        order: 0;
    }
    /* 카드 간 간격 (clamp min=64px이 모바일에서도 충족되므로 별도 override 불필요) */
}

@media (max-width: 768px) {
    .xrv-cf {
        padding: 48px var(--mha-sec-x, 24px) 72px;
    }
    .xrv-cf__head {
        margin-bottom: 40px;
    }
}

@media (max-width: 480px) {
    .xrv-cf__list {
        gap: 40px;
    }
    .xrv-cf__row {
        gap: 20px;
    }
}

/* ── prefers-reduced-motion ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .xrv-cf__play-btn {
        transition: none;
    }
    .xrv-cf__fold-icon { transition: none; }
    .xrv-cf__intro:not(.xrv-cf__intro--collapsed) { animation: none; }
}

/* ── 고대비 모드 ─────────────────────────────────────────────────────────── */
@media (forced-colors: active) {
    .xrv-cf__play-btn {
        border: 2px solid ButtonText;
        background: ButtonFace;
        color: ButtonText;
        forced-color-adjust: auto;
    }
    .xrv-cf__accent {
        -webkit-text-fill-color: unset;
        background: none;
        color: Highlight;
    }
}
