/* ==========================================================================
   lookbook.css — Khối lookbook (ảnh biên tập lớn xen chữ, cuộn kể chuyện phối đồ). Khối JS tự chèn file này nếu trang chưa link.
   Chỉ dùng biến của lõi (--mau-*, --font-*, --k-*) nên chạy được cả nền sáng lẫn nền tối.
   Mẫu chỉnh qua biến: --lb-ti-le (tỉ lệ khung ảnh, mặc định 4 / 5) · --lb-chi-mau (màu đường chỉ) · --lb-so-mau (số bộ in chìm).
   Bố cục 3 nhịp xoay vòng theo thứ tự cảnh: ảnh trái · ảnh phải lệch xuống · sân khấu giữa.
   ========================================================================== */

.lookbook {
  --lb-ti-le: 4 / 5;
  --lb-chi-mau: var(--mau-nhan);
  --lb-so-mau: var(--mau-nhan);
  position: relative; padding-block: var(--dem-muc);
}
.lookbook__dau { margin-bottom: clamp(3.5rem, 2rem + 6vw, 8rem); }
.lookbook__dau h2 { max-width: 18ch; margin-top: var(--k-4); }
.lookbook__dau > p:not(.xw-nhan) { max-width: 44ch; margin-top: var(--k-5); color: var(--mau-chu-phu); font-size: var(--co-lon); }

.lookbook__ds {
  position: relative; display: grid; gap: clamp(5rem, 2.5rem + 9vw, 11rem);
  width: 100%; max-width: var(--rong-toi-da); margin-inline: auto; padding-inline: var(--le);
  counter-reset: lookbook;
}
.lookbook__canh {
  position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(1rem, 2.6vw, 3rem);
  align-items: end; counter-increment: lookbook;
}

/* ---------- khung ảnh ---------- */
.lookbook__khung { position: relative; margin: 0; aspect-ratio: var(--lb-ti-le); overflow: hidden; background: var(--mau-nen-2); isolation: isolate; }
.lookbook__anh { display: block; width: 100%; height: 100%; object-fit: cover; transform-origin: 50% 50%; }
.lookbook--chi-chay .lookbook__anh { will-change: transform; }
.lookbook__cho {           /* chữ trên ảnh chờ — tự ẩn khi đã có ảnh thật */
  position: absolute; left: var(--k-4); bottom: var(--k-4); z-index: 1;
  display: none; align-items: center; gap: .5em; max-width: calc(100% - 2 * var(--k-4));
  padding: .45em .8em; border-radius: 999px; background: rgba(12, 10, 9, .78); color: #F5F4EF;
  font-size: var(--co-ti); font-weight: 600; letter-spacing: .06em; line-height: 1.3;
}
.lookbook__cho::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--mau-nhan-sang, #D9A46E); }
.lookbook__khung--cho .lookbook__cho, .lookbook__khung:has(> img[src*="/cho-"]) .lookbook__cho { display: inline-flex; }

/* ---------- chữ ---------- */
.lookbook__chu { min-width: 0; }
.lookbook__nhan { font-size: var(--co-ti); font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--mau-nhan-dam); }
.lookbook__chu h3 { margin-top: var(--k-3); font-size: var(--co-2); line-height: 1.15; }
.lookbook__chu > p:not(.lookbook__nhan):not(.lookbook__mon) { margin-top: var(--k-4); color: var(--mau-chu-phu); max-width: 38ch; }
.lookbook__mon {
  margin-top: var(--k-5); padding-top: var(--k-3); border-top: 1px solid var(--mau-vien);
  font-size: var(--co-nho); line-height: 1.6; color: var(--mau-chu);
}
.lookbook__link {
  display: inline-flex; align-items: center; gap: .5em; min-height: 44px; margin-top: var(--k-3);
  color: var(--mau-nhan-dam); font-weight: 600; font-size: var(--co-nho); text-decoration: underline; text-underline-offset: .28em;
}
.lookbook__link::after { content: "→"; text-decoration: none; transition: transform .3s var(--duong-cong); }
.lookbook__link:hover::after { transform: translateX(4px); }

/* ---------- nhịp 1 · ảnh trái lớn, chữ bên phải ---------- */
.lookbook__canh:nth-of-type(3n+1) .lookbook__khung { grid-column: 1 / span 7; grid-row: 1; }
.lookbook__canh:nth-of-type(3n+1) .lookbook__chu { grid-column: 9 / span 4; grid-row: 1; padding-bottom: var(--k-6); }
/* ---------- nhịp 2 · chữ bên trái, ảnh phải nhỏ hơn và lệch xuống ---------- */
.lookbook__canh:nth-of-type(3n+2) .lookbook__khung { grid-column: 7 / span 5; grid-row: 1; margin-top: clamp(2rem, 7vw, 7.5rem); }
.lookbook__canh:nth-of-type(3n+2) .lookbook__chu { grid-column: 2 / span 4; grid-row: 1; align-self: start; }
/* ---------- nhịp 3 · sân khấu giữa, số bộ in chìm phía sau ---------- */
.lookbook__canh:nth-of-type(3n) .lookbook__khung { grid-column: 4 / span 6; grid-row: 1; }
.lookbook__canh:nth-of-type(3n) .lookbook__chu { grid-column: 3 / span 8; grid-row: 2; margin-top: var(--k-6); text-align: center; }
.lookbook__canh:nth-of-type(3n) .lookbook__chu > p:not(.lookbook__nhan):not(.lookbook__mon), .lookbook__canh:nth-of-type(3n) .lookbook__chu h3 { margin-inline: auto; }
.lookbook__canh:nth-of-type(3n)::before {
  content: counter(lookbook, decimal-leading-zero);
  content: counter(lookbook, decimal-leading-zero) / "";
  position: absolute; z-index: -1; left: 50%; top: 42%; translate: -50% -50%;
  font-family: var(--font-tieu-de); font-style: italic; font-weight: 500; line-height: .8;
  font-size: clamp(9rem, 4rem + 24vw, 26rem); letter-spacing: -.04em;
  color: var(--lb-so-mau); opacity: .16; pointer-events: none; user-select: none;
}
.lookbook__canh:nth-of-type(3n) { isolation: isolate; }

/* ---------- đường chỉ may (trang trí) ---------- */
.lookbook__chi { position: absolute; top: 0; bottom: 0; left: calc(var(--le) * .45); width: 2px; pointer-events: none; }
.lookbook__chi::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(to bottom, var(--lb-chi-mau) 0 7px, transparent 7px 14px); opacity: .7;
  clip-path: inset(0 0 calc((1 - var(--lb-chi, 1)) * 100%) 0);
}
.lookbook__chi::after {   /* mũi kim — chỉ hiện khi đường chỉ đang chạy theo thanh cuộn (L2+) */
  content: ""; position: absolute; left: 50%; top: calc(var(--lb-chi, 1) * 100%);
  width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--lb-chi-mau);
  box-shadow: 0 0 0 5px rgba(161, 98, 7, .18); display: none;
}
.lookbook--chi-chay .lookbook__chi::after { display: block; }

/* ---------- hiện dần khi cuộn tới (L1+) ---------- */
:where(html.xuong-dong) .lookbook__canh[data-lb-trang] .lookbook__khung {
  transition: clip-path 1.15s var(--duong-cong), opacity .7s var(--duong-cong);
}
:where(html.xuong-dong) .lookbook__canh[data-lb-trang="cho"] .lookbook__khung { clip-path: inset(9% 7% 9% 7%); opacity: 0; }
:where(html.xuong-dong) .lookbook__canh[data-lb-trang] .lookbook__chu > * {
  transition: opacity .8s var(--duong-cong), transform .8s var(--duong-cong);
}
:where(html.xuong-dong) .lookbook__canh[data-lb-trang="cho"] .lookbook__chu > * { opacity: 0; transform: translate3d(0, 24px, 0); }
.lookbook__canh[data-lb-trang="hien"] .lookbook__chu > :nth-child(2) { transition-delay: .1s; }
.lookbook__canh[data-lb-trang="hien"] .lookbook__chu > :nth-child(3) { transition-delay: .2s; }
.lookbook__canh[data-lb-trang="hien"] .lookbook__chu > :nth-child(4) { transition-delay: .28s; }
.lookbook__canh[data-lb-trang="hien"] .lookbook__chu > :nth-child(n+5) { transition-delay: .34s; }
:where(html.xuong-dong) .lookbook__canh[data-lb-trang]:nth-of-type(3n)::before { transition: opacity 1.4s var(--duong-cong) .2s; }
:where(html.xuong-dong) .lookbook__canh[data-lb-trang="cho"]:nth-of-type(3n)::before { opacity: 0; }

/* ---------- máy tính bảng ---------- */
@media (max-width: 1024px) and (min-width: 761px) {
  .lookbook__canh:nth-of-type(3n+1) .lookbook__khung { grid-column: 1 / span 7; }
  .lookbook__canh:nth-of-type(3n+1) .lookbook__chu { grid-column: 8 / span 5; }
  .lookbook__canh:nth-of-type(3n+2) .lookbook__khung { grid-column: 6 / span 7; }
  .lookbook__canh:nth-of-type(3n+2) .lookbook__chu { grid-column: 1 / span 5; }
  .lookbook__canh:nth-of-type(3n) .lookbook__khung { grid-column: 3 / span 8; }
  .lookbook__canh:nth-of-type(3n) .lookbook__chu { grid-column: 2 / span 10; }
}
/* ---------- điện thoại: một cột, không parallax, đường chỉ ở mép trái ---------- */
@media (max-width: 760px) {
  .lookbook__ds { gap: clamp(4rem, 14vw, 6rem); padding-left: calc(var(--le) + 14px); }
  .lookbook__chi { left: calc(var(--le) * .5); }
  .lookbook__canh { grid-template-columns: minmax(0, 1fr); }
  .lookbook__canh:nth-of-type(n) .lookbook__khung { grid-column: 1; grid-row: 1; margin-top: 0; }
  .lookbook__canh:nth-of-type(n) .lookbook__chu { grid-column: 1; grid-row: 2; margin-top: var(--k-5); padding-bottom: 0; text-align: left; }
  .lookbook__canh:nth-of-type(3n) .lookbook__chu > p:not(.lookbook__nhan):not(.lookbook__mon), .lookbook__canh:nth-of-type(3n) .lookbook__chu h3 { margin-inline: 0; }
  .lookbook__canh:nth-of-type(3n)::before { top: 30%; font-size: clamp(8rem, 44vw, 12rem); }
}
@media print { .lookbook__canh[data-lb-trang] .lookbook__khung, .lookbook__canh[data-lb-trang] .lookbook__chu > * { opacity: 1 !important; transform: none !important; clip-path: none !important; } }
