/* _detail.css 분할본 1/4 — 타임라인 피드 카드(오디오 플레이어 포함) (리팩토링 W-D6, 2026-10-23). 내용은 원본 1~621행 그대로, 로드 순서는 templates/includes/stories_css.html 참조. */
/* ========================================
   Feed Post — 타임라인 카드 (가로 2-column)
   날짜 컬럼 | 콘텐츠 컬럼
   ======================================== */

.feed-post {
    /* Figma: Diary [358x*] pad=20/16, gap=12, r=12, fill=#ffffff */
    position: relative;
    display: flex;
    gap: 0;
    background: var(--color-bg-primary);
    border-radius: var(--sh-radius-card);
    overflow: hidden;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* 우측 상단 ⋮ 메뉴 버튼 — 탭 타겟 44x44 보장 (Apple HIG) */
.feed-post__menu-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--color-text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.feed-post__menu-btn:hover,
.feed-post__menu-btn:focus-visible {
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    outline: none;
}

/* 날짜 컬럼 (왼쪽) — Figma Video Timestamp 46x44 + 카드 padding 20/16 */
.feed-post__date-col {
    flex: 0 0 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: var(--sh-card-pad-y) var(--spacing-xs);
    gap: 2px;
    position: relative;
}

/* 패딩 안쪽 구분선 (Figma: Divider 1px #efeff0) */
.feed-post__date-col::after {
    content: '';
    position: absolute;
    right: 0;
    top: var(--sh-card-pad-y);
    bottom: var(--sh-card-pad-y);
    width: 1px;
    background: var(--sh-color-divider);
}

.feed-post__date {
    /* Figma: Pretendard 600 16/24 #2f2f2f */
    font-size: var(--sh-fs-body);
    font-weight: 600;
    color: var(--sh-color-text-date);
    line-height: 1.2;
}

.feed-post__year {
    /* Figma: Pretendard 400 14/20 #aeaeae ls-0.1px */
    font-size: var(--sh-fs-caption);
    letter-spacing: var(--sh-ls-caption);
    color: var(--sh-color-text-lighter);
    line-height: 1.2;
}

/* 콘텐츠 영역 하단 "더 보기" 링크 — 카드 전체 클릭 대신 모든 타입 공통 상세 진입점
   Twitter/X, LinkedIn 등 보편 링크 톤인 하늘색(sky blue) 사용해 "눌러서 이동"을 명확히 신호화.
   content-col 은 flex column 이며 body 아래에 이 링크가 마지막 자식으로 붙는다. */
.feed-post__detail-link {
    align-self: flex-start;
    margin-top: var(--spacing-2xs);
    font-size: var(--sh-fs-micro);
    letter-spacing: var(--sh-ls-caption);
    color: #1da1f2;
    line-height: 1.2;
    text-decoration: none;
    padding: 2px 0;
    font-weight: 500;
}

.feed-post__detail-link:hover,
.feed-post__detail-link:focus {
    text-decoration: underline;
    color: #0c8de4;
}

/* 콘텐츠 컬럼 (오른쪽) — Figma: Video Content gap=16, 카드 padding 20/16 */
.feed-post__content-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    /* 우측 ⋮ 메뉴 버튼 공간 확보 — padding-right는 버튼 영역(36px) + 여백(8px) */
    padding: var(--sh-card-pad-y) 44px var(--sh-card-pad-y) var(--sh-card-pad-x);
}

/* 사용자 요청으로 truncate 제거 — 피드 본문 전체 노출. is-clamped 클래스도 마크업에서 제거됨. */

/* 미디어 영역 (사진/비디오 공통) — Figma: Video Image r=12 fill=#e2e2e2 */
.feed-post__media {
    position: relative;
    width: 100%;
    background: var(--sh-color-bg-media);
    overflow: hidden;
    border-radius: var(--sh-radius-card);
}

.feed-post__media img {
    width: 100%;
    display: block;
}

/* 사진 슬라이더 */
.feed-post__media--slider {
    position: relative;
}

.feed-post__slides {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.feed-post__slides::-webkit-scrollbar {
    display: none;
}

.feed-post__slide {
    flex: 0 0 100%;
    width: 100%;
    scroll-snap-align: start;
}

.feed-post__slide img {
    width: 100%;
    display: block;
}

/* 슬라이드 카운트 뱃지 (1/5) — Figma: pad=2/10 gap=10 r=999 fill=#000@0.5, text Pretendard 400 12/16 #fff */
.feed-post__slide-count {
    /* Figma: Pretendard 400 12/16 ls-0.1px */
    position: absolute;
    bottom: var(--spacing-sm);
    right: var(--spacing-sm);
    background: rgba(0, 0, 0, 0.5);
    color: var(--color-text-inverse);
    font-size: var(--sh-fs-micro);
    line-height: var(--sh-lh-micro);
    letter-spacing: var(--sh-ls-caption);
    font-variant-numeric: tabular-nums;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    pointer-events: none;
}

/* Video in feed — Figma: r=12 */
/* 피드·뷰어 공통 영상 칸: 기본 16:9 + 담기(contain). 기록 상세는 아래 [data-video-fit="detail"] 가 원래 비율로(11-20). */
.feed-post__video {
    position: relative;
    background: var(--color-black);
    cursor: pointer;
    overflow: hidden;
    border-radius: var(--sh-radius-card);
    aspect-ratio: 16 / 9;
}

/* 기록 상세(11-20 명세 3-1): 원래 비율(서버 크기 → --sk-media-ratio, 모르면 16:9 로 시작해 js/video-ratio.js 가 맞춤) · 화면 높이 80% 까지 · 담기 */
.feed-detail__media.feed-post__video[data-video-fit="detail"] {
    width: 100%;
    max-height: 80vh;
    aspect-ratio: var(--sk-media-ratio, 16 / 9);
}

.feed-post__video video {
    width: 100%;
    height: 100%;
    display: block;
    /* 원본 비율 보존 — 세로 영상은 좌우 검정 띠로 표시되어 사용자가 세로 영상임을 인지 가능.
       원본 비율 회수는 풀스크린 모달(object-fit: contain)에서 동일하게 보장. */
    object-fit: contain;
}

.feed-post__video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.feed-post__video-overlay.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.feed-post__video-play {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    transition: transform 0.15s;
}

.feed-post__video-play svg {
    width: 100%;
    height: 100%;
    display: block;
}

.feed-post__video-overlay:hover .feed-post__video-play {
    transform: scale(1.08);
}

/* 처리 중/실패 영상 플레이스홀더 (재생 전 단계) */
.feed-post__video--processing,
.feed-post__video--failed {
    cursor: default;
    background: var(--color-bg-secondary);
}

.feed-post__video-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-md);
    text-align: center;
    color: var(--color-text-secondary);
}

.feed-post__video-placeholder p {
    margin: 0;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--color-text-primary);
}

.feed-post__video-placeholder small {
    font-size: var(--font-size-xs);
    color: var(--color-text-secondary);
}

/* Phosphor 아이콘 크기 (i.ph 요소) */
.feed-post__video-placeholder-icon {
    font-size: 32px;
    line-height: 1;
    color: var(--color-text-secondary);
}

/* 처리 중: 스피너 회전 (components.css 의 btn-spin keyframe 재사용) */
.feed-post__video-spinner {
    font-size: 32px;
    line-height: 1;
    color: var(--color-progress);
    animation: btn-spin 1s linear infinite;
}

/* 실패 카드: 재시도/삭제 액션 행 */
.feed-post__video-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-xs);
}

/* Early-Play 인코딩 중 알림 배지 (좌상단, 본인 소유 + 인코딩 진행 중일 때만 노출) */
.feed-post__video-encoding-notice {
    position: absolute;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.55);
    color: var(--color-white);
    font-size: var(--font-size-xs);
    line-height: 1.3;
    border-radius: 999px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    pointer-events: none;
    z-index: 2;
    max-width: calc(100% - var(--spacing-md));
}

.feed-post__video-encoding-notice i {
    font-size: 14px;
    line-height: 1;
    color: var(--color-white);
}

.feed-post__video-encoding-notice span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 풀스크린(Fullscreen API) 진입 시에도 배지가 video 위에 함께 떠 있도록 보장 */
.feed-post__video--encoding {
    position: relative;
}

/* Audio in feed — Figma: pad=8/26/8/10 gap=8 r=12 fill=#e8e8e8 */
.feed-post__audio {
    padding: var(--spacing-xs) 26px var(--spacing-xs) 10px;
    background: var(--sh-color-bg-top-zone);
    border-radius: var(--sh-radius-card);
}

/* ---- 기본 audio-player--feed (레거시 호환 유지) ---- */
.audio-player--feed {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    border-radius: 0;
}

.audio-player--feed .audio-player__play {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--color-black-normal);
    color: var(--color-text-inverse);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 16px;
}

.audio-player--feed .audio-player__play:hover {
    background: var(--color-black-light);
}

.audio-player--feed .audio-player__play:active {
    transform: scale(0.95);
}

.audio-player--feed .audio-player__track {
    flex: 1;
    min-width: 0;
}

.audio-player--feed .audio-player__progress {
    width: 100%;
    height: 6px;
    background: var(--color-grey-normal);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.audio-player--feed .audio-player__progress-fill {
    height: 100%;
    background: var(--color-black-normal);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
}

.audio-player--feed .audio-player__time {
    margin-top: var(--spacing-2xs);
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

.audio-player--feed .audio-player__current::after {
    content: ' / ';
}

/* ---- Waveform 스타일 오디오 플레이어 (audio-player--wave) ---- */
.audio-player--wave {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.audio-player--wave .audio-player__play {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    background: none;
    color: var(--sh-color-text-strong, #2F2F2F);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.audio-player--wave .audio-player__play:hover {
    opacity: 0.85;
}

.audio-player--wave .audio-player__play:active {
    transform: scale(0.95);
}

/* 재생/일시정지 아이콘 토글 (CSS 기반) */
.audio-player__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.audio-player__icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.audio-player .audio-player__icon--pause { display: none; }
.audio-player.is-playing .audio-player__icon--play { display: none; }
.audio-player.is-playing .audio-player__icon--pause { display: flex; }

/* 파형 컨테이너 */
.audio-player__waveform {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 2px;
    height: 32px;
    cursor: pointer;
}

/* 파형 바 (JS로 생성) — Figma: 2px wide #7f7f7f, 재생 전 muted */
.audio-player__bar {
    width: 2px;
    border-radius: 2px;
    background: var(--sh-color-text-muted);
    transition: background 0.1s linear;
    flex-shrink: 0;
    opacity: 0.45;
}

.audio-player__bar.is-played {
    background: var(--sh-color-text-muted);
    opacity: 1;
}

/* 재생 시간 — Figma: Pretendard 400 16/22 #606060 */
.audio-player--wave .audio-player__duration {
    font-size: var(--sh-fs-body);
    color: var(--sh-color-text-body);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex: 0 0 auto;
    text-align: right;
}

/* Body / text content — Figma: Video Text Container gap=4, 미디어와 gap=16 */
.feed-post__body {
    padding: var(--spacing-md) 0 0;
}

.feed-post[data-feed-type="text"] .feed-post__body,
.feed-post[data-feed-type="qa"] .feed-post__body {
    padding-top: 0;
}

.feed-post__title {
    /* Figma: Pretendard 500 16/24 #141414 (전역 Pretendard 상속) */
    font-size: var(--sh-fs-body);
    line-height: var(--sh-lh-body);
    font-weight: 500;
    color: var(--sh-color-text-primary);
    margin: 0 0 var(--spacing-2xs);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feed-post__content {
    /* Figma: Pretendard 400 14/20 #606060 ls-0.1px (전역 Pretendard 상속) */
    font-size: var(--sh-fs-caption);
    line-height: var(--sh-lh-caption);
    letter-spacing: var(--sh-ls-caption);
    color: var(--sh-color-text-body);
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 무한 스크롤 로딩 */
.feed-timeline__sentinel {
    display: flex;
    justify-content: center;
    padding: var(--spacing-lg) 0;
}

.feed-timeline__loader {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary-normal);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Draft count notice */
/* Draft Snackbar — 하단 고정 다크 토스트 */
.draft-snackbar {
    position: fixed;
    bottom: var(--spacing-xl);
    left: var(--spacing-md);
    right: var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--color-black-normal);
    border-radius: var(--radius-lg);
    z-index: 100;
    animation: snackbar-slide-up 0.3s ease-out;
}

.draft-snackbar__text {
    font-size: var(--font-size-sm);
    color: var(--color-white);
    flex: 1;
    min-width: 0;
}

.draft-snackbar__cta {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-white);
    text-decoration: underline;
    text-underline-offset: 2px;
    white-space: nowrap;
    flex-shrink: 0;
}

@keyframes snackbar-slide-up {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 레거시 호환 — 미사용 시 제거 가능 */
.story-home__draft-notice {
    display: none;
}

.story-home__draft-notice-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    flex: 1;
    min-width: 0;
}

.story-home__draft-notice-content i {
    color: var(--color-light-blue);
    flex-shrink: 0;
}


.story-profile-summary__btn .menu-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.story-home__actions .btn .menu-icon {
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

/* 레거시 — draft-snackbar로 대체됨 */
.story-home__draft-notice-link {
    display: none;
}
