/* ============================================================
   triplog.css — 블록 에디터 + 뷰어 공통
   어복 (xn--pn3bz3n.com)
   ============================================================ */

/* ── 공통 변수 ─────────────────────────────────────────────── */
:root {
    --tl-orange:    #f59e0b;
    --tl-slate:     #0f172a;
    --tl-slate2:    #334155;
    --tl-slate3:    #64748b;
    --tl-border:    #e2e8f0;
    --tl-radius:    12px;
    --tl-bar-h:     62px;
}

/* ══════════════════════════════════════════════════════════════
   1. WRITE PAGE — 블록 에디터
   ══════════════════════════════════════════════════════════════ */

/* 스코프 */
#triplog-write-wrap {
    min-height: 100vh;
    background: #fff;
}

/* ── 페이지 상단 헤더 ─────────────────────────────────────── */
.tl-page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px 12px 14px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.tl-back-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 20px;
    flex-shrink: 0;
    transition: background 0.15s;
}
.tl-back-btn:hover { background: rgba(255,255,255,0.22); }
.tl-page-header-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
}
.tl-page-header-info i { font-size: 17px; color: var(--tl-orange); }
.tl-page-header-info span { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }

/* 헤더 저장 버튼 */
.tl-header-save-btn {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 5px;
    height: 34px;
    padding: 0 14px 0 10px;
    border-radius: 980px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    border: none;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(245,158,11,0.4);
    transition: opacity 0.15s;
    letter-spacing: -0.01em;
    flex-shrink: 0;
}
.tl-header-save-btn i { font-size: 16px; }
.tl-header-save-btn:hover { opacity: .88; }
.tl-header-save-btn:disabled { background: #94a3b8; box-shadow: none; cursor: not-allowed; }

/* 제목 입력 */
.tl-title-area {
    background: #fff;
    border-bottom: 2px solid var(--tl-orange);
    padding: 16px 18px 14px;
}
.tl-title-area-hint {
    font-size: 10px;
    font-weight: 800;
    color: var(--tl-orange);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 6px;
    opacity: 0.8;
}
.tl-title-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 19px;
    font-weight: 700;
    color: var(--tl-slate);
    background: transparent;
    line-height: 1.45;
}
.tl-title-input::placeholder { color: #b0bec5; font-weight: 400; font-size: 17px; }

/* 대표이미지 미리보기 바 — 썸네일 별★ 버튼으로 대체되어 숨김 */
.tl-thumb-bar { display: none !important; }

/* 블록 컨테이너 */
#tl-blocks {
    padding: 14px 14px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 블록 공통 */
.tl-block {
    background: #fff;
    border: 1.5px solid var(--tl-border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(15,23,42,0.06);
    transition: box-shadow .15s;
}
.tl-block:focus-within { border-color: #bfdbfe; box-shadow: 0 0 0 3px rgba(59,130,246,.08); }

/* 블록 헤더 */
.tl-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px 7px;
    border-bottom: 1px solid #f1f5f9;
    background: #fafbfc;
    gap: 6px;
}
.tl-block-type-icon {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 5px;
}
.tl-block-type-icon i { font-size: 15px; }
.tl-block-actions { display: flex; align-items: center; gap: 4px; }
.tl-drag-handle {
    font-size: 17px;
    color: #cbd5e1;
    cursor: grab;
    padding: 2px 4px;
    touch-action: none;
}
.tl-drag-handle:active { cursor: grabbing; color: #94a3b8; }

/* 텍스트 블록 */
.tl-text-input {
    min-height: 80px;
    padding: 10px 12px;
    font-size: 16px; /* 16px 미만이면 iOS Safari 자동 줌인 발생 */
    line-height: 1.7;
    color: var(--tl-slate);
    outline: none;
    word-break: keep-all;
    touch-action: manipulation; /* iOS 더블탭 줌 방지 */
}
.tl-text-input:empty::before {
    content: attr(placeholder);
    color: #94a3b8;
    pointer-events: none;
}
.tl-text-input b { font-weight: 700; }
.tl-text-input em { font-style: italic; }
.tl-text-input a { color: var(--tl-orange); text-decoration: underline; }

/* 텍스트 서식 버튼 */
.tl-btn-format {
    width: 28px;
    height: 28px;
    border: 1px solid var(--tl-border);
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    color: var(--tl-slate2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tl-btn-format:active { background: #f1f5f9; }

/* 삭제 버튼 */
.tl-btn-del {
    width: 28px;
    height: 28px;
    border: 1px solid #fecaca;
    border-radius: 6px;
    background: #fff5f5;
    font-size: 14px;
    color: #ef4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 사진 블록 — 그리드 2열 (88px→비율 기반 큰 카드) */
.tl-photos-wrap { padding: 10px 10px 6px; }
.tl-photos-strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
@media (min-width: 520px) {
    .tl-photos-strip { grid-template-columns: repeat(3, 1fr); }
}

/* 사진 카드 */
.tl-file-card {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 11px;
    position: relative;
    overflow: hidden;
    background: #f1f5f9;
    border: 1.5px solid var(--tl-border);
    transition: border-color .15s;
}
.tl-file-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.tl-file-card.loading { border-style: dashed; border-color: #bfdbfe; }
.tl-file-card.error  { border-color: #fecaca; background: #fff5f5; }

/* 로딩 링 */
.tl-file-loading {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.tl-progress-ring svg { width: 48px; height: 48px; }
.tl-pr-bar { transition: stroke-dasharray 0.2s ease; }
.tl-pct { font-size: 12px; color: #fff; font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,.4); }

/* 오류 카드 */
.tl-file-error {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
}
.tl-file-error i { font-size: 28px; color: #ef4444; }
.tl-file-error span { font-size: 12px; color: #ef4444; text-align: center; line-height: 1.3; }

/* 대표이미지 별 버튼 */
.tl-thumb-star {
    position: absolute;
    top: 6px;
    left: 6px;
    height: 26px;
    min-width: 26px;
    padding: 0 8px 0 6px;
    border-radius: 13px;
    background: rgba(255,255,255,0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 13px;
    color: #94a3b8;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
/* 비활성: 26×26 원형 (라벨 없음) */
.tl-thumb-star:not(.active) {
    padding: 0;
    width: 26px;
    border-radius: 50%;
}
.tl-thumb-star:not(.active) .tl-star-label { display: none; }
/* 활성: 오렌지 pill */
.tl-thumb-star.active { padding: 0 8px 0 6px; border-radius: 13px; background: rgba(245,158,11,0.95); color: #fff; }
.tl-thumb-star i { font-size: 13px; flex-shrink: 0; }
.tl-star-label { font-size: 11px; font-weight: 700; line-height: 1; }

/* 이미지 회전 버튼 — pill형 (아이콘 + 90°) */
.tl-rotate-btn {
    position: absolute;
    bottom: 6px;
    right: 6px;
    height: 24px;
    padding: 0 7px 0 5px;
    border-radius: 12px;
    background: rgba(255,255,255,0.92);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #475569;
    transition: background 0.15s, color 0.15s;
    box-shadow: 0 1px 4px rgba(0,0,0,.18);
    z-index: 2;
    white-space: nowrap;
}
.tl-rotate-btn i { font-size: 13px; flex-shrink: 0; }
.tl-rot-label { font-size: 10px; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.tl-rotate-btn:hover { background: rgba(59,130,246,0.92); color: #fff; }

/* SortableJS 드래그 고스트 */
.tl-card-ghost {
    opacity: 0.45;
    border: 2px dashed #f59e0b !important;
    background: #fef9c3 !important;
}
/* 드래그 커서 힌트 */
.tl-file-card[data-photo-id] { cursor: grab; }
.tl-file-card[data-photo-id]:active { cursor: grabbing; }

/* 영상 썸네일 재생 오버레이 */
.tl-video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.28);
    border-radius: inherit;
    pointer-events: none;
}
.tl-video-overlay i {
    font-size: 30px;
    color: #fff;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
}

/* 영상 카드 (썸네일 없을 때 기본) */
.tl-video-preview {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #f59e0b;
}
.tl-video-preview i { font-size: 36px; }
.tl-video-preview span { font-size: 12px; font-weight: 600; color: #94a3b8; }

/* 색상 버튼 + 팔레트 */
.tl-color-pick-wrap {
    position: relative;
}
.tl-btn-color {
    width: 28px;
    height: 28px;
    border: 1px solid var(--tl-border);
    border-radius: 6px;
    background: #fff;
    font-size: 15px;
    color: var(--tl-slate2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.tl-btn-color:active { background: #f1f5f9; }
.tl-color-palette {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--tl-border);
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(15,23,42,0.12);
    z-index: 100;
    width: 136px;
}
.tl-color-swatch {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    transition: transform 0.12s;
}
.tl-color-swatch:hover { transform: scale(1.2); }

/* 파일 삭제 버튼 */
.tl-file-del {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    padding: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,.2);
    transition: background .15s;
}
.tl-file-del:hover { background: rgba(220,38,38,0.85); }

/* 사진 추가 버튼 (grid 셀) */
.tl-add-photo-card {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 11px;
    border: 2px dashed #cbd5e1;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    min-height: 80px;
}
.tl-add-photo-card:hover { border-color: #93c5fd; background: #eff6ff; }
.tl-add-photo-card i { font-size: 28px; color: #94a3b8; transition: color .15s; }
.tl-add-photo-card:hover i { color: #3b82f6; }
.tl-add-photo-card span { font-size: 12px; color: #94a3b8; font-weight: 500; }

/* 사진 블록 내 추가 버튼 (헤더) */
.tl-btn-add-photo {
    height: 28px;
    padding: 0 10px;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    background: #eff6ff;
    font-size: 12px;
    color: #1d4ed8;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 3px;
    font-weight: 500;
}

/* 유튜브 블록 */
.tl-yt-wrap { padding: 10px 12px; }
.tl-yt-input {
    width: 100%;
    height: 40px;
    border: 1px solid var(--tl-border);
    border-radius: 8px;
    padding: 0 12px;
    font-size: 16px;
    color: var(--tl-slate);
    outline: none;
    background: #f8fafc;
    margin-bottom: 10px;
}
.tl-yt-input:focus { border-color: var(--tl-orange); background: #fff; }
.tl-yt-preview { border-radius: 8px; overflow: hidden; background: #f1f5f9; min-height: 60px; }
.tl-yt-thumb-wrap { position: relative; }
.tl-yt-thumb { width: 100%; display: block; }
.tl-yt-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: rgba(255,255,255,0.9);
    pointer-events: none;
}
.tl-yt-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px;
    color: #94a3b8;
}
.tl-yt-empty i { font-size: 28px; }
.tl-yt-empty span { font-size: 12px; text-align: center; }

/* 블록 사이 추가 버튼 */
.tl-between-add {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 4px;
}
.tl-between-line { flex: 1; height: 1px; background: var(--tl-border); }
.tl-btn-between-add {
    border: 1px solid var(--tl-border);
    border-radius: 14px;
    background: #fff;
    padding: 4px 12px;
    font-size: 11.5px;
    color: var(--tl-slate3);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.tl-btn-between-add i { font-size: 14px; }
/* "닫기" 상태 */
.tl-btn-between-add.is-close {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* 빈 상태 */
.tl-empty-hint {
    text-align: center;
    padding: 32px 20px;
    color: #94a3b8;
}
.tl-empty-hint i { font-size: 40px; display: block; margin-bottom: 10px; }
.tl-empty-hint p { font-size: 13px; line-height: 1.6; }

/* 하단 액션바 — 제거됨 (저장버튼은 헤더로 이동) */
.tl-action-bar { display: none !important; }

/* 인라인 미니 피커 */
.tl-inline-picker {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    background: #f8fafc;
    border-top: 1px dashed #e2e8f0;
    border-bottom: 1px dashed #e2e8f0;
    animation: tl-picker-in 0.15s ease;
}
@keyframes tl-picker-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.tl-ip-btn {
    flex: 1;
    height: 38px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    font-size: 12.5px;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-weight: 600;
    transition: background 0.12s;
}
.tl-ip-btn i { font-size: 16px; }
.tl-ip-btn:active { transform: scale(0.95); }
.tl-ip-btn.photo   { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.tl-ip-btn.youtube { border-color: #fecaca; background: #fff5f5; color: #dc2626; }

/* ── 임시저장 드래프트 패널 (다중 목록) ──────────────────── */
#tl-draft-panel {
    position: fixed;
    top: 100px;
    right: 24px;
    width: 264px;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 8px 28px rgba(15,23,42,0.13);
    z-index: 200;
    overflow: hidden;
    animation: tlDpIn 0.24s cubic-bezier(.22,1,.36,1);
}
#tl-draft-panel.tlw-dp-hide {
    animation: tlDpOut 0.24s cubic-bezier(.22,1,.36,1) forwards;
}
@keyframes tlDpIn  { from { opacity:0; transform:translateX(18px); } to { opacity:1; transform:translateX(0); } }
@keyframes tlDpOut { from { opacity:1; transform:translateX(0); }   to { opacity:0; transform:translateX(18px); } }

.tlw-dp-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 12px 10px;
    border-bottom: 1px solid #1e3a5f;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
}
.tlw-dp-badge {
    width: 26px; height: 26px;
    border-radius: 7px;
    background: rgba(245,158,11,0.22);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.tlw-dp-badge i { font-size: 14px; color: #f59e0b; }
.tlw-dp-heading {
    flex: 1;
    font-size: 12.5px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 5px;
}
.tlw-dp-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px; height: 18px;
    border-radius: 9px;
    background: #f59e0b;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 0 4px;
}
.tlw-dp-close {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.14);
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #cbd5e1;
    font-size: 14px;
    transition: background 0.15s;
    flex-shrink: 0;
}
.tlw-dp-close:hover { background: rgba(239,68,68,0.7); color: #fff; }

/* 드래프트 목록 */
.tlw-dp-list {
    max-height: 380px;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.tlw-dp-list-item {
    padding: 11px 13px 12px;
    border-bottom: 1px solid #f1f5f9;
}
.tlw-dp-list-item:last-child { border-bottom: none; }
.tlw-dp-item-title {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.35;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tlw-dp-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-bottom: 9px;
}
.tlw-dp-meta span {
    font-size: 10.5px;
    color: #94a3b8;
    line-height: 1.4;
}
.tlw-dp-actions { display: flex; gap: 5px; }
.tlw-dp-btn-load, .tlw-dp-btn-del {
    flex: 1;
    height: 30px;
    border-radius: 7px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 11.5px;
    font-weight: 600;
    transition: all 0.15s;
}
.tlw-dp-btn-load { background: linear-gradient(135deg,#0f172a,#1e3a5f); color: #fff; }
.tlw-dp-btn-load:hover { opacity: 0.88; }
.tlw-dp-btn-load i { font-size: 12px; }
.tlw-dp-btn-del { background: #fff5f5; color: #dc2626; border: 1px solid #fecaca; }
.tlw-dp-btn-del:hover { background: #fee2e2; }
.tlw-dp-btn-del i { font-size: 12px; }

/* 모바일: 화면 하단 슬라이드업 */
@media (max-width: 768px) {
    #tl-draft-panel {
        position: fixed;
        top: auto;
        bottom: max(12px, env(safe-area-inset-bottom));
        right: 12px;
        left: 12px;
        width: auto;
        border-radius: 14px;
        animation: tlDpInMo 0.26s cubic-bezier(.22,1,.36,1);
    }
    #tl-draft-panel.tlw-dp-hide {
        animation: tlDpOutMo 0.24s cubic-bezier(.22,1,.36,1) forwards;
    }
    .tlw-dp-list { max-height: 260px; }
    @keyframes tlDpInMo  { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:translateY(0); } }
    @keyframes tlDpOutMo { from { opacity:1; transform:translateY(0); }   to { opacity:0; transform:translateY(16px); } }
}

/* 사이드바 오버레이 활성 시 임시저장 패널 숨김 */
/* JS(triplog_editor.js)의 MutationObserver로 제어 — CSS는 백업용 */
#responsive-overlay.active { /* 사이드바 열림 상태 indicator */ }
body.tl-sidebar-open #tl-draft-panel { display: none !important; }

/* 업로드 상태 */
.tl-upload-status {
    font-size: 11px;
    color: var(--tl-slate3);
    text-align: center;
    padding: 4px 12px 0;
}

/* 모바일 write 공통 (CLAUDE.md 패턴) */
@media (max-width: 768px) {
    #triplog-write-wrap {
        padding-top: 64px !important;
        padding-block-start: 64px !important;
        padding-bottom: max(env(safe-area-inset-bottom), 24px) !important;
    }
    .tlw-write-active footer { display: none !important; }
    .tlw-write-active .kakao-custom-btn { display: none !important; }
    .tlw-write-active #eb-seo-signature-box { display: none !important; }
}

/* PC: max-width 제한 + 상단 여백 */
@media (min-width: 769px) {
    #triplog-write-wrap {
        padding-top: 28px;
    }
    #tl-write-container {
        max-width: 880px;
        margin: 0 auto;
    }
    .tl-page-header {
        border-radius: 14px 14px 0 0;
        box-shadow: 0 2px 12px rgba(15,23,42,0.12);
    }
}


/* ══════════════════════════════════════════════════════════════
   2. VIEW PAGE — 블록 뷰어
   ══════════════════════════════════════════════════════════════ */

#triplog-view-scope {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 0 40px;
}

/* 뷰 헤더 */
.tl-view-head {
    padding: 20px 16px 16px;
    border-bottom: 1px solid var(--tl-border);
}
.tl-view-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--tl-slate);
    line-height: 1.4;
    margin-bottom: 10px;
    word-break: keep-all;
}
.tl-view-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    color: var(--tl-slate3);
    flex-wrap: wrap;
}
.tl-view-meta .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}
.tl-view-meta .nick { font-weight: 600; color: var(--tl-slate2); }
.tl-view-meta .sep { color: #cbd5e1; }
.tl-view-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
}
.tl-view-action-btn {
    height: 30px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid var(--tl-border);
    background: #f8fafc;
    font-size: 12px;
    color: var(--tl-slate3);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}
.tl-view-action-btn.share { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }

/* 블록 렌더 */
.tl-view-blocks {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 텍스트 블록 뷰 */
.tlv-text {
    font-size: 15.5px;
    line-height: 1.8;
    color: var(--tl-slate2);
    word-break: keep-all;
}
.tlv-text b { font-weight: 700; }
.tlv-text em { font-style: italic; }
.tlv-text a { color: var(--tl-orange); text-decoration: underline; }

/* 사진 블록 뷰 — memfish 통일: 세로 스택 전체폭 */
.tlv-photos {
    margin: 0;
}
.tlv-photos-strip {
    display: flex;
    flex-direction: column;   /* 수평→수직 스택 */
    gap: 10px;
    overflow: hidden;          /* 수평 스크롤 제거 */
    padding: 0;
}
.tlv-photos-strip::-webkit-scrollbar { display: none; }
.tlv-photo-item {
    width: 100%;               /* 전체폭 */
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}
.tlv-photo-item img {
    display: block;
    width: 100%;               /* 전체폭 */
    height: auto;              /* 자연 비율 */
    max-height: 680px;         /* 세로 긴 이미지 제한 */
    object-fit: contain;
    background: transparent;
}
/* 단일 사진도 동일 */
.tlv-photos.single .tlv-photo-item img {
    height: auto;
    width: 100%;
    max-width: 100%;
}
.tlv-photos.single { margin: 0; }

/* 유튜브 블록 뷰 — Facade */
.tlv-youtube {
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    background: #000;
    cursor: pointer;
}
.tlv-yt-facade-img {
    width: 100%;
    display: block;
    aspect-ratio: 16/9;
    object-fit: cover;
    opacity: 0.85;
}
.tlv-yt-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 60px;
    color: rgba(255,255,255,0.9);
    pointer-events: none;
}
.tlv-yt-label {
    position: absolute;
    bottom: 8px;
    left: 10px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 11px;
    border-radius: 4px;
    padding: 2px 8px;
}
.tlv-youtube .tlv-yt-iframe-wrap {
    position: relative;
    padding-top: 56.25%;
}
.tlv-youtube .tlv-yt-iframe-wrap iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

/* ── 라이트박스 ─────────────────────────────────────────────── */
#tl-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
#tl-lightbox.open { display: flex; }
#tl-lb-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
}
#tl-lb-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tl-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
#tl-lb-prev { left: 12px; }
#tl-lb-next { right: 12px; }
#tl-lb-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    color: rgba(255,255,255,0.7);
}

/* ── LIST PAGE ─────────────────────────────────────────────── */
#triplog-list-scope { padding: 0 0 40px; overflow-x: hidden; }

.tl-list-head {
    padding: 16px 16px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.tl-list-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--tl-slate);
}
.tl-write-btn {
    height: 36px;
    padding: 0 14px;
    border-radius: 10px;
    background: #0f172a;
    color: #fff;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}

.tl-list-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 0 12px;
}

.tl-card {
    background: #fff;
    border: 1px solid var(--tl-border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    display: block;
    min-width: 0;
}
.tl-card-thumb {
    aspect-ratio: 4/3;
    background: #f1f5f9;
    overflow: hidden;
    position: relative;
}
.tl-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.tl-card-thumb-empty {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tl-card-thumb-empty i { font-size: 32px; color: #cbd5e1; }
.tl-card-body { padding: 10px 10px 8px; }
.tl-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--tl-slate);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
    word-break: keep-all;
}
.tl-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--tl-slate3);
}
.tl-card-nick { font-weight: 500; }
.tl-card-stats {
    display: flex;
    gap: 7px;
}
.tl-card-stats span { display: flex; align-items: center; gap: 2px; }
.tl-card-stats i { font-size: 11px; }

@media (max-width: 380px) {
    .tl-list-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 8px; }
    .tl-card-body { padding: 8px; }
}
@media (min-width: 768px) {
    .tl-list-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 900px; margin: 0 auto; }
}

/* 빈 목록 */
.tl-list-empty {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}
.tl-list-empty i { font-size: 48px; display: block; margin-bottom: 12px; }
.tl-list-empty p { font-size: 14px; }

/* [CSS-1] 모바일 뷰/리스트 상단 패딩 (트랩 #1 대응) */
@media (max-width: 768px) {
    #triplog-view-wrap {
        padding-top: 64px !important;
        padding-block-start: 64px !important;
    }
    #triplog-list-wrap {
        padding-top: 64px !important;
        padding-block-start: 64px !important;
    }
}
