/* Thư viện ảnh — mockup/Thu Vien.dc.html (máy tính); di động tự dựng theo phong cách các mockup Mobile. Tiền tố .tv- */
.t-gallery [hidden] { display: none !important; }

/* ---------- Hero ---------- */
.tv-hero-body { padding-bottom: 56px; }
.tv-hero-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.tv-h1 { margin-top: 12px; font-size: clamp(38px, 6vw, 56px); }
.tv-lead { max-width: 520px; line-height: 1.65; }
.tv-stats { display: flex; }
.tv-stats > div { padding: 0 22px; }
.tv-stats > div:first-child { padding-left: 0; }
.tv-stats > div + div { border-left: 1px solid rgba(255, 255, 255, .18); }
.tv-stats b { display: block; font-family: var(--t-display); font-weight: 700; font-size: 34px; line-height: 1; color: #fff; }
.tv-stats span { font-size: 12px; color: var(--t-hero-muted); }

/* ---------- Khung nội dung ---------- */
.tv-wrap { max-width: 1280px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 48px) 80px; box-sizing: border-box; display: flex; flex-direction: column; gap: 32px; }

/* ---------- Bộ lọc ---------- */
.tv-filter { position: sticky; top: var(--t-hdr, 96px); transition: top .3s ease; z-index: 20; margin-top: -26px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 18px; background: rgba(255, 255, 255, .95); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 12px 30px rgba(19, 48, 90, .12); border: 1px solid var(--t-line); }
.tv-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.tv-chip { display: flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid #d3e0e6; background: #fff; color: var(--t-navy); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.tv-chip span { font-size: 11px; opacity: .65; }
.tv-chip:hover { border-color: var(--t-navy); }
.tv-chip.on { background: var(--t-navy); color: #fff; border-color: var(--t-navy); }
.tv-sort { font-size: 13px; color: var(--t-muted); }

/* ---------- Album mới nhất ---------- */
.tv-feature { position: relative; display: flex; align-items: flex-end; min-height: 420px; border: none; border-radius: 26px; overflow: hidden; background: var(--t-dark); padding: 0; cursor: pointer; text-align: left; box-shadow: 0 16px 40px rgba(19, 48, 90, .16); width: 100%; }
.t-gallery:not([data-type="all"]) .tv-feature { display: none; }
.tv-feature img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .7s ease; }
.tv-feature:hover img { transform: scale(1.03); }
.tv-feature-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14, 42, 60, 0) 35%, rgba(14, 42, 60, .9) 100%); }
.tv-feature-body { position: relative; padding: 28px; color: #fff; display: flex; flex-direction: column; gap: 10px; }
.tv-tags { display: flex; gap: 6px; }
.tv-tag-new { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--t-green); }
.tv-tag-glass { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .18); }
.tv-feature-t { font-family: var(--t-display); font-weight: 700; font-size: clamp(28px, 5vw, 44px); line-height: 1; }
.tv-feature-m { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--t-hero-text); }
.tv-ic { display: flex; align-items: center; gap: 6px; }

/* ---------- Nhóm theo năm + lưới ---------- */
.tv-year { display: flex; flex-direction: column; gap: 16px; }
.tv-year-hd { display: flex; align-items: center; gap: 14px; }
.tv-year-hd h2 { margin: 0; font-family: var(--t-display); font-weight: 700; font-size: 34px; line-height: 1; }
.tv-year-hd i { flex: 1; height: 1px; background: #d3e0e6; }
.tv-year-cnt { font-size: 13px; color: var(--t-muted); }
.tv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 18px; }
.tv-card { display: flex; flex-direction: column; border: none; background: #fff; border-radius: 20px; overflow: hidden; padding: 0; cursor: pointer; text-align: left; color: var(--t-navy); box-shadow: 0 6px 22px rgba(19, 48, 90, .07); transition: box-shadow .2s, transform .2s; }
.tv-card:hover { box-shadow: 0 14px 32px rgba(19, 48, 90, .15); transform: translateY(-2px); }
.tv-card-img { position: relative; display: block; aspect-ratio: 4 / 3; background: #dfe9ec; overflow: hidden; }
.tv-card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.tv-card:hover .tv-card-img img { transform: scale(1.05); }
.tv-type { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; color: #fff; background: var(--t-grey); }
.tv-card-img .tv-type { position: absolute; top: 12px; left: 12px; }
.tv-c-race { background: #e5534b; }
.tv-c-training { background: var(--t-teal); }
.tv-c-social { background: #5b6fa8; }
.tv-c-khac { background: var(--t-grey); }
.tv-count { position: absolute; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: rgba(14, 42, 60, .8); color: #fff; }
.tv-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.tv-card-date { font-size: 12px; color: var(--t-muted); }
.tv-card-t { font-family: var(--t-display); font-weight: 700; font-size: 21px; line-height: 1.1; }
.tv-card-d { font-size: 13px; line-height: 1.55; color: var(--t-text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.tv-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.tv-empty i, .tv-empty svg { width: 56px; height: 56px; color: #c6d5dc; }
.tv-empty h3 { margin: 6px 0 0; font-size: 24px; color: var(--t-navy); }
.tv-empty p { margin: 0; }

/* ---------- Xem nhanh album ---------- */
.tv-pv { position: fixed; inset: 0; z-index: 95; display: flex; align-items: center; justify-content: center; padding: 24px; }
.tv-pv-veil { position: absolute; inset: 0; background: rgba(8, 20, 32, .82); }
.tv-pv-box { position: relative; width: 100%; max-width: 880px; border-radius: 22px; overflow: hidden; background: var(--t-dark); color: #fff; box-shadow: 0 30px 70px rgba(0, 0, 0, .45); }
.tv-pv-img { position: relative; aspect-ratio: 16 / 9; background: #13305a center/cover no-repeat; }
.tv-pv-x, .tv-pv-nav { position: absolute; border: none; border-radius: 50%; background: rgba(14, 42, 60, .7); color: #fff; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; }
.tv-pv-x { top: 14px; right: 14px; width: 40px; height: 40px; }
.tv-pv-nav { top: 50%; transform: translateY(-50%); width: 44px; height: 44px; font-size: 24px; }
.tv-pv-nav.prev { left: 14px; }
.tv-pv-nav.next { right: 14px; }
.tv-pv-x:hover, .tv-pv-nav:hover { background: rgba(14, 42, 60, .92); }
.tv-pv-foot { padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.tv-pv-info { min-width: 0; flex: 1 1 320px; }
.tv-pv-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-size: 12px; color: var(--t-hero-muted); }
.tv-pv-meta .tv-type { padding: 3px 9px; }
.tv-pv-t { font-family: var(--t-display); font-weight: 700; font-size: 28px; line-height: 1.05; }
.tv-pv-d { font-size: 13px; color: var(--t-hero-text); margin-top: 4px; white-space: pre-line; max-height: 6.2em; overflow: auto; }
.tv-pv-all { min-height: 44px; padding: 0 20px; font-size: 14px; }
.tv-pv-all:disabled { opacity: .5; cursor: default; }

/* ---------- Xem tất cả ảnh ---------- */
.tv-full { position: fixed; inset: 0; z-index: 99; display: flex; flex-direction: column; background: #fff; }
.tv-full-hd { display: flex; align-items: center; gap: 14px; padding: 10px 20px; background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid #e3ebef; box-shadow: 0 4px 16px rgba(19, 48, 90, .06); }
/* Nút Quay lại đặc, dễ thấy (trước: chữ «Đóng» xám nhạt ở tận góc phải) */
.tv-full-back { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 16px 0 12px; border: none; border-radius: 999px; background: var(--t-navy); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
.tv-full-back:hover { background: #1d3f73; }
.tv-full-tt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tv-full-tt h2 { margin: 0; font-family: var(--t-display) !important; font-size: 22px; font-weight: 700; line-height: 1.1 !important; color: var(--t-navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tv-full-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--t-muted); white-space: nowrap; overflow: hidden; }
.tv-full-meta .tv-type { position: static; flex: none; font-size: 11px; padding: 2px 8px; }
.tv-full-meta b { color: var(--t-teal); font-weight: 700; }
.tv-full-nav { flex: none; display: flex; align-items: center; gap: 6px; }
.tv-full-nav button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid #d3e0e6; background: #fff; color: var(--t-navy); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.tv-full-nav button:hover { border-color: var(--t-teal); color: var(--t-teal); }
.tv-full-nav button.x { background: #eef3f6; border-color: #eef3f6; }
.tv-full-desc { max-width: 1280px; margin: 14px auto 0; padding: 0 16px; box-sizing: border-box; font-size: 14px; line-height: 1.6; color: var(--t-text-2); }
.tv-full-none { padding: 60px 16px; text-align: center; color: var(--t-muted); width: 100%; }
.tv-full-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; background: var(--t-bg); }
/* Lưới so le xếp bằng JS (gallery.js xepLuoi): các cột flex, ô có sẵn đúng tỉ lệ → không nhảy */
.tv-masonry { max-width: 1280px; margin: 0 auto; padding: 16px; box-sizing: border-box; display: flex; align-items: flex-start; gap: 12px; position: relative; }
.tv-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.tv-moc { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; pointer-events: none; }
.tv-ph { border-radius: 10px; overflow: hidden; background: #e3ebef; cursor: zoom-in; animation: tvFade .3s ease both; }
.tv-ph img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.tv-ph:hover img { transform: scale(1.03); }
@keyframes tvFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Di động ---------- */
@media (max-width: 860px) {
    .tv-hero-body { padding-bottom: 28px; }
    .tv-h1 { font-size: 40px; }
    .tv-hero-row { gap: 18px; }
    .tv-stats b { font-size: 28px; }

    .tv-wrap { padding: 0 0 28px; gap: 22px; }
    .tv-filter { top: 60px; margin-top: 0; border-radius: 0; border: none; border-bottom: 1px solid #e3ebef; box-shadow: none; background: rgba(243, 248, 247, .96); padding: 10px 0; flex-wrap: nowrap; }
    .tv-chips { flex-wrap: nowrap; overflow-x: auto; padding: 0 16px; scrollbar-width: none; flex: 1; min-width: 0; }
    .tv-chips::-webkit-scrollbar { display: none; }
    .tv-chip { flex: none; padding: 0 14px; }
    .tv-sort { display: none; }

    .tv-feature, .tv-year, .tv-none, .tv-empty { margin: 0 16px; }
    .tv-feature { width: auto; min-height: 300px; border-radius: 20px; }
    .tv-feature-body { padding: 18px; gap: 8px; }
    .tv-feature-t { font-size: 28px; }
    .tv-feature-m { font-size: 13px; }

    .tv-year { gap: 12px; }
    .tv-year-hd h2 { font-size: 26px; }
    .tv-year-cnt { font-size: 12px; }
    .tv-grid { grid-template-columns: 1fr; gap: 12px; }
    /* Thẻ ngang gọn như danh sách thử thách bản Mobile */
    .tv-card { flex-direction: row; align-items: stretch; border-radius: 16px; box-shadow: 0 4px 16px rgba(19, 48, 90, .07); }
    .tv-card:hover { transform: none; }
    .tv-card-img { flex: none; width: 116px; aspect-ratio: auto; min-height: 112px; }
    .tv-card-img .tv-type { top: 8px; left: 8px; font-size: 10px; padding: 3px 8px; }
    .tv-count { right: 8px; bottom: 8px; font-size: 11px; padding: 3px 8px; }
    .tv-card-body { padding: 10px 12px; gap: 4px; min-width: 0; justify-content: center; }
    .tv-card-t { font-size: 18px; }
    .tv-card-d { font-size: 12px; line-height: 1.45; }

    .tv-pv { padding: 12px; align-items: center; }
    .tv-pv-box { border-radius: 18px; }
    .tv-pv-img { aspect-ratio: 4 / 3; }
    .tv-pv-nav { width: 40px; height: 40px; }
    .tv-pv-foot { padding: 14px 16px 16px; gap: 12px; }
    .tv-pv-info { flex-basis: 100%; }
    .tv-pv-t { font-size: 24px; }
    .tv-pv-all { width: 100%; min-height: 48px; }

    .tv-full-hd { padding: 8px 10px; gap: 8px; }
    .tv-full-back { width: 42px; padding: 0; justify-content: center; }
    .tv-full-back span { display: none; }          /* di động: chỉ mũi tên, nhường chỗ cho tên album */
    .tv-full-tt h2 { font-size: 18px; }
    .tv-full-meta { font-size: 11px; gap: 6px; }
    .tv-full-nav { gap: 4px; }
    .tv-full-nav button { width: 38px; height: 38px; }
    .tv-full-nav button.x { display: none; }       /* đã có nút Quay lại bên trái */
    .tv-full-desc { font-size: 13px; margin-top: 10px; padding: 0 10px; }
    .tv-masonry { gap: 8px; padding: 8px; }
    .tv-col { gap: 8px; }
    .tv-ph { border-radius: 8px; }
}
