/* ==========================================================================
   Wici Fuji — "Phòng tối". CSS riêng của nhánh (prefix wxf-), nạp bởi layouts.wici-brand.
   Thiết kế: docs/design/fuji.DESIGN.md. Token chung (--wx-*) khai báo ở wx/shell.css theme fujifilm.
   Radius: 8px cho thẻ/nút/input/khung ảnh, 999px chỉ cho chip film.
   ========================================================================== */

.wx-body[data-brand-theme="fujifilm"] {
  --wxf-canvas: #0e0d0c;
  --wxf-surface: #171614;
  --wxf-surface-2: #211f1c;
  --wxf-ink: #f1eee8;
  --wxf-ink-2: #a19d95;
  --wxf-ink-3: #7c786f;
  --wxf-line: rgba(241, 238, 232, .12);
  --wxf-line-2: rgba(241, 238, 232, .22);
  --wxf-red: #ff4a3d;
  --wxf-red-ink: #140a09;
  --wxf-shadow: 0 30px 60px -30px rgba(0, 0, 0, .8);
  --wxf-r: 8px;
  --wxf-sec: clamp(64px, 9vw, 120px);
  --wxf-wide: 118;
  background: var(--wxf-canvas);
}

/* Grain phim rất nhẹ — lớp cố định, không bắt sự kiện (không đặt trên container cuộn) */
.wx-body[data-brand-theme="fujifilm"]::after {
  content: ''; position: fixed; inset: 0; z-index: 70; pointer-events: none; opacity: .045;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .9 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.wxf-page { overflow-x: clip; }

/* ---------- Kiểu chữ ---------- */
.wxf-h1, .wxf-h2, .wxf-hero-title, .wxf-final-title {
  margin: 0; font-family: 'Archivo', var(--wx-font-body); font-weight: 800;
  font-stretch: calc(var(--wxf-wide) * 1%); letter-spacing: -0.02em; line-height: 1.02;
  color: var(--wxf-ink); text-wrap: balance;
}
.wxf-h1 { font-size: clamp(2.3rem, 4.6vw, 4rem); }
.wxf-h2 { font-size: clamp(1.8rem, 3.2vw, 2.8rem); }
.wxf-h1 em, .wxf-h2 em, .wxf-hero-title em, .wxf-final-title em {
  font-style: italic; font-weight: 700; color: var(--wxf-ink-2);
  /* chừa chỗ cho chân chữ g/y/p ở dòng in nghiêng */
  line-height: 1.1;
}
.wxf-eyebrow, .wxf-mono-label {
  margin: 0; font: 500 12.5px/1.4 var(--wx-font-mono); letter-spacing: .06em; text-transform: uppercase;
}
.wxf-eyebrow { color: var(--wxf-red); margin-bottom: 18px; }
.wxf-mono-label { color: var(--wxf-ink-3); }
.wxf-lede { margin: 18px 0 0; max-width: 52ch; color: var(--wxf-ink-2); font-size: 17px; line-height: 1.6; text-wrap: pretty; }
.wxf-mono { font-family: var(--wx-font-mono); }

/* Nút trên nền tối: chữ nút chính tối trên đỏ (≥ 4.5:1) */
.wx-body[data-brand-theme="fujifilm"] .wx-btn { font-weight: 600; letter-spacing: .005em; }
.wx-body[data-brand-theme="fujifilm"] .wx-btn--ghost { border-color: var(--wxf-line-2); }
.wx-body[data-brand-theme="fujifilm"] .wx-btn--ghost:hover { background: rgba(241, 238, 232, .06); border-color: rgba(241, 238, 232, .4); }
.wx-body[data-brand-theme="fujifilm"] .wx-link .wx-arrow { width: 16px; height: 16px; transition: transform .25s var(--wx-ease); }
.wx-body[data-brand-theme="fujifilm"] .wx-link:hover .wx-arrow { transform: translateX(3px); }

/* ---------- Khung ảnh như bản in / khung phim; trạng thái rỗng có tên film ---------- */
.wxf-frame {
  position: relative; display: block; overflow: hidden; isolation: isolate;
  border-radius: var(--wxf-r); background: var(--wxf-surface);
  box-shadow: inset 0 0 0 1px var(--wxf-line);
}
.wxf-frame > img {
  position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover;
  transition: transform .7s var(--wx-ease), opacity .4s ease;
}
.wxf-frame-empty {
  position: absolute; inset: 10px; z-index: 0;
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 22px 12px;
  border: 1px solid var(--wxf-line); border-radius: 4px;
  font: 500 11.5px/1.4 var(--wx-font-mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--wxf-ink-2); text-align: center;
}
/* hàng lỗ phim trên/dưới của khung rỗng */
.wxf-frame-empty::before, .wxf-frame-empty::after {
  content: ''; position: absolute; left: 8px; right: 8px; height: 6px;
  background: repeating-linear-gradient(90deg, var(--wxf-line-2) 0 7px, transparent 7px 15px);
  border-radius: 1px; opacity: .7;
}
.wxf-frame-empty::before { top: 7px; }
.wxf-frame-empty::after { bottom: 7px; }

.wxf-film-dot {
  display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%;
  background: var(--film, var(--wxf-ink-3)); vertical-align: middle;
}

/* ---------- Section chung ---------- */
.wxf-sec { padding-top: var(--wxf-sec); }
.wxf-sec-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 36px; }
.wxf-sec-head .wx-link { flex: none; margin-bottom: 6px; }

/* ==========================================================================
   HERO — máy ảnh 3D full-bleed (canvas có nền gradient riêng, khớp màu trang); desktop pin ~200vh
   ========================================================================== */
@property --wxf-tint { syntax: '<color>'; inherits: true; initial-value: #ff4a3d; }
.wxf-home { transition: --wxf-tint 1.1s ease; }

.wxf-hero { position: relative; }
.wxf-hero-pin {
  position: relative; display: flex; flex-direction: column; justify-content: center;
  min-height: max(640px, calc(100svh - var(--wx-topbar-h))); overflow: hidden; isolation: isolate;
  background: linear-gradient(180deg, #171513 0%, #100f0e 62%, var(--wxf-canvas) 100%);
}
.wxf-camera { position: absolute; inset: 0; z-index: 0; }
.wxf-camera .wx-stage-fallback { object-fit: contain; object-position: 82% 58%; padding: 6% 0 14% 38%; }
.wxf-camera > canvas { cursor: grab; }
.wxf-camera > canvas.is-dragging { cursor: grabbing; }

.wxf-hero-grid { position: relative; z-index: 2; pointer-events: none; padding: clamp(24px, 4vw, 48px) 0 170px; }
.wxf-hero-copy { max-width: 620px; pointer-events: auto; }
.wxf-hero-title { font-size: clamp(2.4rem, 4vw, 3.5rem); --wxf-wide: 116; line-height: 1; }
.wxf-hero-lede { margin: 24px 0 0; max-width: 34ch; font-size: 18px; line-height: 1.55; color: var(--wxf-ink-2); text-wrap: pretty; }
.wxf-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

/* các bước kể chuyện + nhãn exploded view: chỉ hiện khi pin chạy (desktop) */
.wxf-story { position: absolute; inset: 0; z-index: 2; pointer-events: none; display: none; }
.wxf-hero.is-story .wxf-story { display: block; }
.wxf-story-step {
  position: absolute; left: max(var(--wx-gutter), calc((100% - var(--wx-container)) / 2)); top: 50%;
  width: min(420px, 34vw); transform: translateY(-60%); visibility: hidden; opacity: 0;
}
.wxf-story-step[data-story="2"] { top: 18%; transform: none; width: min(460px, 36vw); }
.wxf-story-title { margin: 10px 0 0; font: 800 clamp(1.7rem, 2.6vw, 2.4rem)/1.05 'Archivo', var(--wx-font-body); font-stretch: 116%; letter-spacing: -0.02em; color: var(--wxf-ink); }
.wxf-story-step p:last-child { margin: 14px 0 0; color: var(--wxf-ink-2); max-width: 40ch; }
.wxf-xray { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.wxf-xlines { position: absolute; inset: 0; overflow: visible; }
.wxf-xlines line { stroke: rgba(241, 238, 232, .45); stroke-width: 1; opacity: 0; }
.wxf-xlabel {
  position: absolute; left: 0; top: 0; visibility: hidden; opacity: 0; width: max-content; max-width: 190px;
  padding: 10px 12px; border-radius: var(--wxf-r);
  background: rgba(14, 13, 12, .82); box-shadow: inset 0 0 0 1px var(--wxf-line-2);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.wxf-xlabel b { display: block; font: 600 12.5px/1.3 var(--wx-font-mono); letter-spacing: .03em; text-transform: uppercase; color: var(--wxf-ink); }
.wxf-xlabel span { display: block; margin-top: 4px; font-size: 13.5px; line-height: 1.4; color: var(--wxf-ink-2); }
.wxf-xlabel[data-xlabel="0"] b { color: var(--wxf-red); }

/* Dải chọn phim (đáy hero) */
.wxf-filmbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; margin-inline: auto; padding: 18px 0 26px; border-top: 1px solid color-mix(in srgb, var(--wxf-tint) 30%, var(--wxf-line)); transition: border-color .8s; }
.wxf-filmbar-row { display: flex; align-items: baseline; justify-content: flex-start; gap: 12px 32px; flex-wrap: wrap; margin-bottom: 14px; }
.wxf-filmbar-now { display: flex; align-items: baseline; gap: 12px; margin: 0; min-width: 0; flex-wrap: wrap; }
.wxf-filmbar-now b { font: 700 19px/1.2 'Archivo', var(--wx-font-body); font-stretch: 112%; color: var(--wxf-ink); }
.wxf-filmbar-note { color: var(--wxf-ink-2); font-size: 14.5px; }
.wxf-filmbar-shot {
  display: inline-flex; align-items: baseline; gap: 10px; min-width: 0; text-decoration: none;
  font: 500 12px/1.4 var(--wx-font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--wxf-ink-2);
}
.wxf-filmbar-title { color: var(--wxf-ink); max-width: 30ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wxf-filmbar-shot:hover .wxf-filmbar-title { text-decoration: underline; text-decoration-color: var(--wxf-red); text-underline-offset: 4px; }
.wxf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wxf-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--wxf-line-2); background: rgba(14, 13, 12, .55); color: var(--wxf-ink-2);
  font: 500 12.5px/1 var(--wx-font-mono); letter-spacing: .02em; cursor: pointer; white-space: nowrap;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: color .2s, border-color .2s, background .2s, transform .15s;
}
.wxf-chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--chip, var(--wxf-ink-3)); }
.wxf-chip:hover { color: var(--wxf-ink); border-color: rgba(241, 238, 232, .4); }
.wxf-chip:active { transform: scale(.97); }
.wxf-chip[aria-pressed="true"] { color: var(--wxf-ink); border-color: var(--wxf-red); background: rgba(255, 74, 61, .1); }

/* Dải tên Film Simulation chạy ngang */
.wxf-marquee { display: flex; overflow: hidden; padding: 22px 0; border-bottom: 1px solid var(--wxf-line); white-space: nowrap; }
.wxf-marquee-track { display: flex; flex: none; gap: 48px; padding-right: 48px; }
.wxf-marquee-track span {
  display: inline-flex; align-items: center; gap: 14px;
  font: 800 clamp(1.4rem, 2.4vw, 2rem)/1 'Archivo', var(--wx-font-body); font-stretch: 120%; letter-spacing: -0.01em;
  color: transparent; -webkit-text-stroke: 1px rgba(241, 238, 232, .38);
}
.wxf-marquee-track span::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--chip); }

/* ánh nhuộm màu phim đang chọn lan xuống các section (đổi film → chuyển màu mượt qua @property) */
.wxf-home .wxf-sec { position: relative; }
.wxf-home .wxf-matcher::before {
  content: ''; position: absolute; z-index: -1; inset: 0 -10% 0 30%; pointer-events: none;
  background: radial-gradient(50% 60% at 60% 50%, color-mix(in srgb, var(--wxf-tint) 9%, transparent), transparent 70%);
}

/* ==========================================================================
   CONTACT SHEET cuộn ngang
   ========================================================================== */
.wxf-sheet-sec .wxf-h2 { margin-bottom: 32px; }
.wxf-sheet {
  position: relative; background: var(--wxf-surface);
  border-block: 1px solid var(--wxf-line);
}
.wxf-sheet::before, .wxf-sheet::after {
  content: ''; position: absolute; left: 0; right: 0; height: 7px; pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(241, 238, 232, .14) 0 9px, transparent 9px 20px);
}
.wxf-sheet::before { top: 9px; }
.wxf-sheet::after { bottom: 9px; }
.wxf-sheet-track {
  display: flex; gap: 14px; margin: 0; padding: 30px max(var(--wx-gutter), calc((100% - var(--wx-container)) / 2));
  list-style: none; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: max(var(--wx-gutter), calc((100% - var(--wx-container)) / 2));
  scrollbar-width: thin; scrollbar-color: var(--wxf-line-2) transparent; overscroll-behavior-x: contain;
}
.wxf-sheet-sec.is-pan { padding-top: clamp(48px, 7vw, 96px); min-height: 100svh; display: flex; flex-direction: column; justify-content: center; }
.wxf-sheet-sec.is-pan .wxf-sheet-track { overflow: visible; scroll-snap-type: none; }
.wxf-sheet-sec.is-pan .wxf-sheet-track > li { flex-basis: clamp(220px, 21vw, 300px); }
.wxf-sheet-track > li { flex: 0 0 clamp(180px, 19vw, 256px); scroll-snap-align: start; }
.wxf-sheet-item { display: block; text-decoration: none; color: var(--wxf-ink); }
.wxf-sheet-frame { aspect-ratio: 3 / 4; }
.wxf-sheet-item:hover .wxf-sheet-frame > img { transform: scale(1.03); }
.wxf-sheet-cap { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 12px; }
.wxf-sheet-name { font: 600 15.5px/1.3 'Archivo', var(--wx-font-body); font-stretch: 108%; }
.wxf-sheet-count { flex: none; font: 500 11.5px/1 var(--wx-font-mono); color: var(--wxf-ink-2); text-transform: uppercase; letter-spacing: .04em; }

/* ==========================================================================
   THẺ RECIPE + LƯỚI
   ========================================================================== */
.wxf-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 22px; }
.wxf-grid--stagger { padding-bottom: 56px; }
.wxf-grid--stagger > :nth-child(even) { position: relative; top: 56px; }

.wxf-card { position: relative; min-width: 0; }
.wxf-card-link { display: block; text-decoration: none; color: var(--wxf-ink); border-radius: var(--wxf-r); }
.wxf-card-frame { aspect-ratio: 4 / 5; box-shadow: inset 0 0 0 1px var(--wxf-line), var(--wxf-shadow); }
.wxf-card-link:hover .wxf-card-frame > img { transform: scale(1.03); }
.wxf-card-body { display: block; padding: 14px 2px 0; }
.wxf-card-title {
  display: block; font: 600 17px/1.3 'Archivo', var(--wx-font-body); font-stretch: 106%; letter-spacing: -0.005em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wxf-card-meta {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 6px;
  font: 500 11.5px/1.4 var(--wx-font-mono); letter-spacing: .03em; text-transform: uppercase; color: var(--wxf-ink-2);
}
.wxf-card-spec { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wxf-card-spec .wxf-film-dot { margin: -2px 7px 0 0; }
.wxf-card-stats { display: flex; gap: 10px; flex: none; color: var(--wxf-ink-3); }

.wxf-fav {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0;
  border: 1px solid rgba(241, 238, 232, .14); border-radius: var(--wxf-r);
  background: rgba(14, 13, 12, .62); color: rgba(241, 238, 232, .78); cursor: pointer;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: color .2s, background .2s, transform .15s, border-color .2s;
}
.wxf-fav svg { fill: none; }
.wxf-fav svg path { fill: transparent; stroke: currentColor; stroke-width: 1.7; }
.wxf-fav:hover { color: var(--wxf-ink); border-color: rgba(241, 238, 232, .35); }
.wxf-fav:active { transform: scale(.94); }
.wxf-fav.is-on { color: var(--wxf-red); border-color: rgba(255, 74, 61, .45); }
.wxf-fav.is-on svg path { fill: currentColor; }
.wxf-fav:disabled { opacity: .6; }

.wxf-card-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.wxf-tool-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px;
  border: 1px solid var(--wxf-line-2); border-radius: var(--wxf-r); background: transparent; color: var(--wxf-ink-2);
  font: 500 12px/1 var(--wx-font-mono); text-transform: uppercase; letter-spacing: .04em; cursor: pointer;
  transition: color .2s, border-color .2s;
}
.wxf-tool-btn:hover { color: var(--wxf-ink); border-color: rgba(241, 238, 232, .4); }
.wxf-tool-btn.is-public { color: var(--wxf-ink); }
.wxf-tool-btn--danger:hover { color: var(--wxf-red); border-color: rgba(255, 74, 61, .5); }
.wxf-tool-btn svg { width: 13px; height: 13px; }

/* nghiêng 3D + vệt sáng theo con trỏ (wx/fuji.js đặt --rx/--ry/--mx/--my) */
.wxf-card-link { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .6s var(--wx-ease); will-change: transform; }
.wxf-card-link.is-tilt { transition-duration: .15s; }
.wxf-card-frame::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 30%), rgba(255, 244, 230, .22), transparent 46%);
  mix-blend-mode: soft-light;
}
.wxf-card-link.is-tilt .wxf-card-frame::after { opacity: 1; }

/* ==========================================================================
   AI MATCHER
   ========================================================================== */
.wxf-matcher-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.wxf-facts {
  display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 12px 36px;
  margin: 36px 0 0; padding-top: 22px; border-top: 1px solid var(--wxf-line);
}
.wxf-facts dt { font: 500 11.5px/1.4 var(--wx-font-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--wxf-ink-3); }
.wxf-facts dd { margin: 6px 0 0; font: 600 16.5px/1.3 'Archivo', var(--wx-font-body); color: var(--wxf-ink); }

/* bàn soi phim: mặt sáng âm ấm ở giữa */
.wxf-lightbox {
  position: relative; padding: clamp(14px, 2vw, 22px); border-radius: var(--wxf-r);
  background: radial-gradient(120% 90% at 50% 40%, #262320, var(--wxf-surface) 70%);
  box-shadow: inset 0 0 0 1px var(--wxf-line), var(--wxf-shadow);
}
.wxf-drop {
  position: relative; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px;
  min-height: clamp(280px, 30vw, 380px); padding: 32px 24px; text-align: center; cursor: pointer;
  border: 1px dashed rgba(241, 238, 232, .28); border-radius: 6px; transition: border-color .2s, background .2s;
}
.wxf-drop:hover, .wxf-drop.is-dragging { border-color: var(--wxf-red); background: rgba(255, 74, 61, .04); }
.wxf-drop--locked { cursor: default; }
.wxf-drop--locked:hover { border-color: rgba(241, 238, 232, .28); background: none; }
.wxf-drop-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.wxf-drop:focus-within { border-color: var(--wxf-red); }
.wxf-drop-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.wxf-drop-title { margin: 0; font: 700 22px/1.2 'Archivo', var(--wx-font-body); font-stretch: 112%; color: var(--wxf-ink); }
.wxf-drop-text { margin: 0; color: var(--wxf-ink-2); font-size: 15px; max-width: 34ch; }
.wxf-drop--locked .wx-btn { margin-top: 14px; }
.wxf-drop-cta {
  margin-top: 10px; display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px;
  border: 1px solid var(--wxf-line-2); border-radius: var(--wxf-r);
  font: 500 12.5px/1 var(--wx-font-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--wxf-ink);
}
.wxf-drop-preview { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.wxf-drop-preview[hidden], .wxf-drop-empty[hidden] { display: none; }
.wxf-drop-preview img { max-height: 260px; width: auto; border-radius: 4px; box-shadow: var(--wxf-shadow); }
.wxf-drop-file { font: 500 12px/1.4 var(--wx-font-mono); color: var(--wxf-ink-2); word-break: break-all; }
.wxf-matcher-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 16px; }
.wxf-matcher-actions .wx-btn:disabled { opacity: .45; cursor: not-allowed; }
.wxf-matcher-status { color: var(--wxf-ink-2); font-size: 14px; }
.wxf-matcher-form.is-loading .wxf-drop { opacity: .7; }
.wxf-matcher-results { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--wxf-line); scroll-margin-top: calc(var(--wx-topbar-h) + 24px); }
.wxf-matcher-mood { margin: 0 0 24px; font-family: 'Archivo', var(--wx-font-body); font-style: italic; font-size: 20px; color: var(--wxf-ink); }
.wxf-matcher-cards { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 22px; }
.wxf-match { display: block; text-decoration: none; color: var(--wxf-ink); }
.wxf-match-frame { aspect-ratio: 4 / 5; }
.wxf-match:hover .wxf-match-frame > img { transform: scale(1.03); }
.wxf-match-body { display: block; padding-top: 12px; }
.wxf-match-film { display: block; font: 600 16px/1.3 'Archivo', var(--wx-font-body); }
.wxf-match-reason { display: block; margin-top: 6px; color: var(--wxf-ink-2); font-size: 14.5px; line-height: 1.55; }

/* ==========================================================================
   RECIPE READER: bản in + phiếu EXIF + timeline dọc
   ========================================================================== */
.wxf-reader-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 7vw, 104px); align-items: start; }
.wxf-reader-media { position: relative; margin: 0; padding-bottom: 40px; }
.wxf-reader-frame { aspect-ratio: 4 / 5; width: 82%; box-shadow: inset 0 0 0 1px var(--wxf-line), var(--wxf-shadow); }
.wxf-reader-frame:hover > img { transform: scale(1.03); }
.wxf-exif {
  position: relative; z-index: 2; width: min(78%, 340px); margin: -120px 0 0 auto; padding: 18px 20px 20px;
  border-radius: var(--wxf-r); background: rgba(23, 22, 20, .94); box-shadow: inset 0 0 0 1px var(--wxf-line-2), var(--wxf-shadow);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.wxf-exif-head { margin: 0 0 12px; font: 500 11.5px/1.4 var(--wx-font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--wxf-red); }
.wxf-exif dl { margin: 0; display: grid; gap: 8px; }
.wxf-exif dl > div { display: flex; justify-content: space-between; gap: 16px; }
.wxf-exif dt { font: 400 12px/1.4 var(--wx-font-mono); color: var(--wxf-ink-2); }
.wxf-exif dd { margin: 0; font: 500 12.5px/1.4 var(--wx-font-mono); color: var(--wxf-ink); text-align: right; }

.wxf-reader-copy { padding-top: clamp(0px, 3vw, 40px); }
.wxf-timeline { position: relative; list-style: none; margin: 40px 0 40px; padding: 0 0 0 34px; }
.wxf-timeline::before { content: ''; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1px; background: var(--wxf-line-2); }
.wxf-timeline li { position: relative; padding-bottom: 32px; }
.wxf-timeline li:last-child { padding-bottom: 0; }
.wxf-timeline li::before {
  content: ''; position: absolute; left: -34px; top: 7px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--wxf-canvas); box-shadow: inset 0 0 0 1.5px var(--wxf-ink-2);
}
.wxf-timeline li:first-child::before { box-shadow: inset 0 0 0 1.5px var(--wxf-red); background: var(--wxf-red); }
.wxf-timeline h3 { margin: 0; font: 700 20px/1.3 'Archivo', var(--wx-font-body); font-stretch: 110%; color: var(--wxf-ink); }
.wxf-timeline p { margin: 8px 0 0; color: var(--wxf-ink-2); max-width: 46ch; }

/* ==========================================================================
   KẾT: full-bleed ảnh
   ========================================================================== */
.wxf-final {
  position: relative; display: flex; align-items: flex-end; overflow: hidden; isolation: isolate;
  min-height: clamp(420px, 62vh, 620px); margin-top: var(--wxf-sec); padding: 56px 0 clamp(48px, 7vw, 88px);
  background: var(--wxf-surface);
}
.wxf-final-media { position: absolute; inset: -14% 0; z-index: -2; }
.wxf-final-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: saturate(.95) brightness(.78); }
.wxf-final::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, var(--wxf-canvas) 0%, rgba(14, 13, 12, .1) 30%, rgba(14, 13, 12, .35) 62%, rgba(14, 13, 12, .9) 100%);
}
.wxf-final-inner { display: flex; flex-direction: column; align-items: flex-start; gap: 28px; }
.wxf-final-title { font-size: clamp(2.2rem, 4.6vw, 4.2rem); max-width: 19ch; --wxf-wide: 120; }
.wxf-final-title em { color: var(--wxf-ink); }
/* footer ngay sau dải ảnh — bỏ khoảng hở */
.wx-body[data-brand-theme="fujifilm"] .wx-main:has(.wxf-home) + .wx-footer { margin-top: 0; }

/* ==========================================================================
   TRANG CON: tiêu đề trang
   ========================================================================== */
.wxf-pagehead { padding: clamp(36px, 6vw, 80px) 0 clamp(28px, 4vw, 44px); }
.wxf-pagehead .wxf-lede { margin-top: 16px; }
.wxf-pagehead-row { display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.wxf-count { font: 500 12.5px/1.4 var(--wx-font-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--wxf-ink-2); }
.wxf-count b { color: var(--wxf-ink); font-weight: 500; }
.wxf-back {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 22px;
  font: 500 12.5px/1 var(--wx-font-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--wxf-ink-2); text-decoration: none;
}
.wxf-back:hover { color: var(--wxf-ink); }
.wxf-back svg { width: 15px; height: 15px; }

/* ==========================================================================
   THƯ VIỆN: thanh lọc dính + lưới 4/3/2
   ========================================================================== */
.wxf-filter {
  position: sticky; top: var(--wx-topbar-h); z-index: 40;
  background: color-mix(in srgb, var(--wxf-canvas) 90%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-block: 1px solid var(--wxf-line);
}
.wxf-filter-bar { display: flex; align-items: center; gap: 12px; min-height: 0; }
.wxf-filter-toggle { display: none; }
.wxf-filter-form {
  flex: 1; display: grid; grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr)) auto; gap: 10px; align-items: end;
  padding: 14px 0;
}
.wxf-field { min-width: 0; }
.wxf-field-label { display: block; margin: 0 0 6px; font: 500 11px/1.2 var(--wx-font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--wxf-ink-3); }
.wxf-filter-actions { display: flex; align-items: center; gap: 12px; }
.wxf-filter-actions .wx-btn { min-height: 44px; padding: 0 20px; }
.wxf-filter-reset { font: 500 12px/1 var(--wx-font-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--wxf-ink-2); text-decoration: none; white-space: nowrap; }
.wxf-filter-reset:hover { color: var(--wxf-red); }

/* multi-select (photo/_multiselect) */
.wxf-filter .ms-select { position: relative; }
.wxf-filter .ms-field {
  position: relative; display: flex; align-items: center; flex-wrap: nowrap; gap: 6px; overflow: hidden;
  min-height: 44px; padding: 5px 30px 5px 10px; border-radius: var(--wxf-r);
  background: var(--wxf-surface-2); border: 1px solid var(--wxf-line); cursor: text;
  transition: border-color .2s, background .2s;
}
.wxf-filter .ms-field:hover { border-color: var(--wxf-line-2); }
.wxf-filter .ms-select.is-open .ms-field { border-color: var(--wxf-red); }
.wxf-filter .ms-select.has-value .ms-field { flex-wrap: wrap; }
.wxf-filter .ms-chips { display: contents; }
.wxf-filter .ms-chip {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 3px 3px 3px 9px; border-radius: 999px;
  background: rgba(255, 74, 61, .14); color: var(--wxf-ink); font: 500 12px/1.3 var(--wx-font-mono);
}
.wxf-filter .ms-chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wxf-filter .ms-chip-x {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 20px; height: 20px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--wxf-ink-2); font-size: 15px; line-height: 1; cursor: pointer;
}
.wxf-filter .ms-chip-x:hover { color: var(--wxf-ink); background: rgba(241, 238, 232, .1); }
.wxf-filter .ms-search {
  flex: 1; min-width: 60px; border: 0; outline: 0; background: transparent; padding: 4px 2px;
  font: 400 14px/1.3 var(--wx-font-body); color: var(--wxf-ink); text-overflow: ellipsis;
}
.wxf-filter .ms-search::placeholder { color: var(--wxf-ink-3); opacity: 1; }
.wxf-filter .ms-caret { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); color: var(--wxf-ink-3); font-size: 10px; pointer-events: none; }
.wxf-filter .ms-panel {
  display: none; position: absolute; left: 0; top: calc(100% + 6px); z-index: 45; min-width: 100%; width: max(100%, 260px);
  max-height: 320px; overflow-y: auto; padding: 6px; border-radius: var(--wxf-r);
  background: var(--wxf-surface); box-shadow: inset 0 0 0 1px var(--wxf-line-2), 0 24px 48px -16px rgba(0, 0, 0, .85);
  scrollbar-width: thin; scrollbar-color: var(--wxf-line-2) transparent;
}
.wxf-filter .ms-select.is-open .ms-panel { display: block; }
.wxf-filter .ms-option {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 6px;
  color: var(--wxf-ink-2); font-size: 14px; cursor: pointer; transition: background .15s, color .15s;
}
.wxf-filter .ms-option[hidden] { display: none; }
.wxf-filter .ms-option:hover { background: var(--wxf-surface-2); color: var(--wxf-ink); }
.wxf-filter .ms-option-check {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 16px; height: 16px;
  border: 1px solid var(--wxf-line-2); border-radius: 4px; font-size: 11px; color: transparent;
}
.wxf-filter .ms-option.is-selected { color: var(--wxf-ink); }
.wxf-filter .ms-option.is-selected .ms-option-check { background: var(--wxf-red); border-color: var(--wxf-red); color: var(--wxf-red-ink); }
.wxf-filter .ms-empty { padding: 10px; color: var(--wxf-ink-3); font-size: 13px; }

.wxf-library { padding-top: 40px; }
.wxf-grid--library { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.wxf-sentinel { grid-column: 1 / -1; min-height: 1px; }
.wxf-sentinel.is-loading { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
.wxf-sentinel.is-loading::before, .wxf-sentinel.is-loading::after {
  content: ''; aspect-ratio: 4 / 5; border-radius: var(--wxf-r); background: var(--wxf-surface);
  animation: wxf-pulse 1.4s ease-in-out infinite;
}
@keyframes wxf-pulse { 50% { opacity: .5; } }
.wxf-sentinel.is-error::after { content: 'Không tải thêm được. Dùng nút Trang sau bên dưới.'; display: block; padding: 16px 0; color: var(--wxf-ink-2); font-size: 14px; }

.wxf-empty {
  display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 48px clamp(24px, 4vw, 48px);
  border-radius: var(--wxf-r); border: 1px dashed var(--wxf-line-2); color: var(--wxf-ink-2);
}
.wxf-empty h2, .wxf-empty h3 { margin: 0; font: 700 22px/1.3 'Archivo', var(--wx-font-body); font-stretch: 110%; color: var(--wxf-ink); }
.wxf-empty p { margin: 0; max-width: 52ch; }

/* phân trang dùng cho thư viện (cùng kiểu wx-pager) */
.wxf-pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 72px; }

/* ==========================================================================
   CHI TIẾT RECIPE (photo/show) — giữ hook .photo-detail / .photo-detail-media / .recipe-specs cho photo-show.js
   ========================================================================== */
.wxf-detail { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.wxf-detail.is-landscape { grid-template-columns: minmax(0, 1fr); }
.wxf-detail.is-landscape .wxf-detail-info { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px clamp(32px, 5vw, 72px); align-items: start; }
.wxf-detail.is-landscape .wxf-detail-head { grid-column: 1; }
.wxf-detail.is-landscape .recipe-specs { grid-column: 2; grid-row: 1 / span 3; margin-top: 0; }
.wxf-detail-media {
  position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden;
  min-height: 320px; max-height: 82vh; border-radius: var(--wxf-r); background: #090808;
  box-shadow: inset 0 0 0 1px var(--wxf-line), var(--wxf-shadow); touch-action: pan-y;
}
.wxf-detail.is-portrait .wxf-detail-media, .wxf-detail.is-square .wxf-detail-media { position: sticky; top: calc(var(--wx-topbar-h) + 20px); }
.wxf-detail-media img {
  display: block; max-width: 100%; max-height: 82vh; width: auto; height: auto;
  transform-origin: center; transition: transform .25s cubic-bezier(.4, 0, .2, 1); user-select: none; -webkit-user-drag: none;
}
.wxf-detail-media.is-zoomed { cursor: zoom-out; touch-action: none; }
.wxf-detail-media:not(.is-zoomed):hover { cursor: zoom-in; }
.wxf-detail-media.is-panning { cursor: grabbing; }
.wxf-detail-media.is-panning img { transition: none; }
.wxf-detail-media .wxf-frame-empty { position: static; inset: auto; min-height: 420px; width: calc(100% - 20px); margin: 10px; }
.wxf-detail-media .photo-fav-btn { top: 14px; right: 14px; width: 44px; height: 44px; }
.photo-viewer-tools {
  position: absolute; left: 50%; bottom: 14px; z-index: 3; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 2px; padding: 4px; border-radius: var(--wxf-r);
  background: rgba(14, 13, 12, .72); box-shadow: inset 0 0 0 1px var(--wxf-line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity .2s;
}
.wxf-detail-media:hover .photo-viewer-tools, .photo-viewer-tools:focus-within { opacity: 1; }
@media (hover: none) { .photo-viewer-tools { opacity: 1; } }
.photo-viewer-tools button {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0;
  border: 0; border-radius: 6px; background: transparent; color: rgba(241, 238, 232, .82); cursor: pointer;
}
.photo-viewer-tools button:hover { background: rgba(241, 238, 232, .1); color: var(--wxf-ink); }
.photo-viewer-tools button:disabled { opacity: .35; cursor: not-allowed; }
.photo-viewer-tools .pv-sep { width: 1px; height: 16px; margin: 0 3px; background: var(--wxf-line-2); }
.photo-viewer-tools .pv-zoom { min-width: 44px; text-align: center; font: 500 11.5px/1 var(--wx-font-mono); color: var(--wxf-ink-2); }

.wxf-detail-film { display: flex; align-items: center; gap: 9px; margin: 0 0 14px; font: 500 12.5px/1.4 var(--wx-font-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--wxf-ink-2); }
.wxf-detail-title { font-size: clamp(2.1rem, 3.8vw, 3.4rem); --wxf-wide: 116; }
.wxf-detail-caption { margin: 16px 0 0; max-width: 48ch; color: var(--wxf-ink-2); font-size: 16.5px; }
.wxf-detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: 22px; font: 500 12.5px/1.4 var(--wx-font-mono); color: var(--wxf-ink-2); letter-spacing: .03em; }
.wxf-detail-meta b { color: var(--wxf-ink); font-weight: 500; }
.wxf-creator { display: inline-flex; align-items: center; gap: 10px; color: var(--wxf-ink); text-decoration: none; font-family: var(--wx-font-body); font-size: 14.5px; letter-spacing: 0; }
.wxf-creator img, .wxf-creator .wxf-avatar { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
.wxf-avatar { display: inline-flex; align-items: center; justify-content: center; background: var(--wxf-surface-2); font-weight: 700; }
.wxf-creator:hover span { text-decoration: underline; text-underline-offset: 3px; }

.wxf-demo-note { margin: 28px 0 0; padding: 18px 20px; border-radius: var(--wxf-r); border: 1px dashed var(--wxf-line-2); color: var(--wxf-ink-2); }

.recipe-specs { margin-top: 34px; }
.wxf-specs-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--wxf-line); }
.wxf-specs-title { margin: 0; font: 700 19px/1.2 'Archivo', var(--wx-font-body); font-stretch: 112%; color: var(--wxf-ink); }
.recipe-lang-toggle { display: inline-flex; padding: 3px; border-radius: var(--wxf-r); background: var(--wxf-surface-2); }
.recipe-lang-toggle button {
  min-width: 40px; min-height: 30px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent;
  font: 500 12px/1 var(--wx-font-mono); color: var(--wxf-ink-2); cursor: pointer;
}
.recipe-lang-toggle button.is-active { background: var(--wxf-canvas); color: var(--wxf-ink); box-shadow: inset 0 0 0 1px var(--wxf-line-2); }
.wxf-spec-group { padding-top: 22px; }
.wxf-spec-group h3 { margin: 0 0 12px; font: 500 11.5px/1.3 var(--wx-font-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--wxf-red); }
.wxf-spec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin: 0; }
.wxf-spec-grid > div { min-width: 0; }
.wxf-spec-grid dt { font: 400 11.5px/1.35 var(--wx-font-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--wxf-ink-3); }
.wxf-spec-grid dd { margin: 4px 0 0; font: 500 14.5px/1.4 var(--wx-font-mono); color: var(--wxf-ink); overflow-wrap: anywhere; }
.wxf-detail-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.wxf-samples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 32px; }
.wxf-samples .wxf-frame { aspect-ratio: 3 / 2; }
.wxf-samples .wxf-frame:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; min-height: 100%; }

/* ==========================================================================
   TIN TỨC
   ========================================================================== */
.wxf-news-lead { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 56px); align-items: center; text-decoration: none; color: var(--wxf-ink); }
.wxf-news-lead .wxf-frame { aspect-ratio: 16 / 10; }
.wxf-news-lead:hover .wxf-frame > img { transform: scale(1.03); }
.wxf-news-lead h2 { margin: 14px 0 0; font: 800 clamp(1.6rem, 2.6vw, 2.3rem)/1.12 'Archivo', var(--wx-font-body); font-stretch: 112%; letter-spacing: -0.015em; text-wrap: balance; }
.wxf-news-lead p { margin: 14px 0 0; color: var(--wxf-ink-2); max-width: 48ch; }
.wxf-news-tag { font: 500 11.5px/1.4 var(--wx-font-mono); letter-spacing: .05em; text-transform: uppercase; color: var(--wxf-red); }
.wxf-news-date { font: 500 11.5px/1.4 var(--wx-font-mono); letter-spacing: .04em; color: var(--wxf-ink-3); }
.wxf-news-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 56px); margin-top: clamp(48px, 6vw, 80px); border-top: 1px solid var(--wxf-line); }
.wxf-news-item { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 20px; padding: 24px 0; text-decoration: none; color: var(--wxf-ink); border-bottom: 1px solid var(--wxf-line); }
.wxf-news-item .wxf-frame { aspect-ratio: 4 / 3; }
.wxf-news-item .wxf-frame-empty { inset: 6px; padding: 8px; font-size: 10px; }
.wxf-news-item .wxf-frame-empty::before, .wxf-news-item .wxf-frame-empty::after { display: none; }
.wxf-news-item:hover .wxf-frame > img { transform: scale(1.04); }
.wxf-news-item h3 { margin: 6px 0 0; font: 600 17px/1.35 'Archivo', var(--wx-font-body); font-stretch: 104%; text-wrap: pretty; }
.wxf-news-item:hover h3 { text-decoration: underline; text-decoration-color: var(--wxf-red); text-underline-offset: 4px; }
.wxf-news-item p { margin: 6px 0 0; color: var(--wxf-ink-2); font-size: 14px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Bài viết */
.wxf-article { padding-top: clamp(32px, 5vw, 64px); }
.wxf-article-head { max-width: 860px; }
.wxf-article-title { font-size: clamp(2rem, 4vw, 3.3rem); --wxf-wide: 112; line-height: 1.08; }
.wxf-article-meta { display: flex; gap: 18px; margin-top: 18px; }
.wxf-article-cover { margin: clamp(28px, 4vw, 48px) 0 0; aspect-ratio: 16 / 9; }
.wxf-article-body { display: grid; grid-template-columns: minmax(0, 68ch); justify-content: center; margin-top: clamp(32px, 5vw, 56px); }
.wxf-article-excerpt { margin: 0 0 28px; font-size: 19px; line-height: 1.6; color: var(--wxf-ink); font-weight: 500; }
.wx-body[data-brand-theme="fujifilm"] .wx-prose img { border-radius: var(--wxf-r); height: auto; }
.wx-body[data-brand-theme="fujifilm"] .wx-prose h2,
.wx-body[data-brand-theme="fujifilm"] .wx-prose h3 { font-weight: 800; font-stretch: 110%; }
.wx-body[data-brand-theme="fujifilm"] .wx-prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.wx-body[data-brand-theme="fujifilm"] .wx-prose th, .wx-body[data-brand-theme="fujifilm"] .wx-prose td { padding: 8px 10px; border-bottom: 1px solid var(--wxf-line); text-align: left; }
.wx-body[data-brand-theme="fujifilm"] .wx-prose code { font-family: var(--wx-font-mono); font-size: .9em; background: var(--wxf-surface-2); padding: 1px 5px; border-radius: 4px; }
.wx-body[data-brand-theme="fujifilm"] .wx-prose strong { color: var(--wxf-ink); }
.wxf-related { margin-top: var(--wxf-sec); }
.wxf-related .wxf-news-list { margin-top: 28px; }

/* ==========================================================================
   CÂU CHUYỆN + PHÁP LÝ
   ========================================================================== */
.wxf-about { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.wxf-about-copy .wx-prose { font-size: 18px; }
.wxf-about-copy .wx-prose p:first-child { font-size: 21px; line-height: 1.6; color: var(--wxf-ink); }
.wxf-about-strip { position: sticky; top: calc(var(--wx-topbar-h) + 24px); display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.wxf-about-strip .wxf-frame { aspect-ratio: 4 / 5; }
.wxf-about-strip .wxf-frame:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 11; }
.wxf-about-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

.wxf-legal { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 8fr); gap: clamp(24px, 5vw, 72px); align-items: start; }
.wxf-legal-aside { position: sticky; top: calc(var(--wx-topbar-h) + 24px); display: grid; gap: 10px; }
.wxf-legal-aside a { color: var(--wxf-ink-2); text-decoration: none; font-size: 14.5px; }
.wxf-legal-aside a:hover, .wxf-legal-aside a[aria-current="page"] { color: var(--wxf-ink); }
.wxf-legal-aside a[aria-current="page"]::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--wxf-red); vertical-align: 2px; }
.wxf-legal .wx-prose h2 { font-size: 1.3em; }
.wxf-legal-page .wxf-pagehead .wxf-count { margin: 16px 0 0; }

/* ==========================================================================
   KHO ẢNH (photo/library)
   ========================================================================== */
.wxf-lib-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; align-items: end; }
.wxf-lib-user { display: flex; align-items: center; gap: 16px; margin-top: 22px; }
.wxf-lib-user img, .wxf-lib-user .wxf-avatar { width: 52px; height: 52px; border-radius: var(--wxf-r); object-fit: cover; font-size: 20px; color: var(--wxf-ink); }
.wxf-lib-user p { margin: 0; }
.wxf-lib-name { font-weight: 600; color: var(--wxf-ink); }
.wxf-lib-mail { color: var(--wxf-ink-2); font-size: 14px; }
.wxf-quota { padding: 18px 22px; border-radius: var(--wxf-r); background: var(--wxf-surface); box-shadow: inset 0 0 0 1px var(--wxf-line); min-width: 260px; }
.wxf-quota-num { margin: 6px 0 0; font: 800 30px/1.1 'Archivo', var(--wx-font-body); font-stretch: 112%; color: var(--wxf-ink); }
.wxf-quota-sub { margin: 6px 0 0; color: var(--wxf-ink-2); font-size: 13.5px; }
.wxf-lib-sec { padding-top: clamp(48px, 6vw, 80px); }
.wxf-lib-sec > .wxf-h2 { margin-bottom: 28px; font-size: clamp(1.5rem, 2.4vw, 2.1rem); }
.wxf-lib-sec > .wxf-h2 span { color: var(--wxf-ink-3); font-weight: 600; }
.wxf-history { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 48px); border-top: 1px solid var(--wxf-line); }
.wxf-history-item { padding: 20px 0; border-bottom: 1px solid var(--wxf-line); }
.wxf-history-mood { margin: 0; font-family: 'Archivo', var(--wx-font-body); font-style: italic; font-size: 17px; color: var(--wxf-ink); }
.wxf-history-meta { margin: 6px 0 0; font: 500 11.5px/1.4 var(--wx-font-mono); color: var(--wxf-ink-3); letter-spacing: .03em; }
.wxf-history-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.wxf-history-links a {
  display: inline-flex; align-items: center; min-height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--wxf-line-2); color: var(--wxf-ink-2); text-decoration: none; font: 500 12px/1 var(--wx-font-mono);
}
.wxf-history-links a:hover { color: var(--wxf-ink); border-color: var(--wxf-red); }

/* modal sửa recipe (photo-library.css giữ bố cục, đây là lớp màu tối) */
.wxf-lib .lib-edit-overlay { background: rgba(5, 5, 4, .72); z-index: 10000; }
.wxf-lib .lib-edit-box { background: var(--wxf-surface); color: var(--wxf-ink); font-family: var(--wx-font-body); box-shadow: inset 0 0 0 1px var(--wxf-line-2), 0 40px 80px -20px #000; border-radius: var(--wxf-r); }
.wxf-lib .lib-edit-title { font-family: 'Archivo', var(--wx-font-body); font-weight: 800; font-stretch: 112%; color: var(--wxf-ink); }
.wxf-lib .lib-edit-close { color: var(--wxf-ink-2); }
.wxf-lib .lib-edit-group, .wxf-lib .lib-edit-group.lib-fuji { background: transparent; border-color: var(--wxf-line); border-radius: var(--wxf-r); }
.wxf-lib .lib-edit-group > summary { color: var(--wxf-ink); }
.wxf-lib .lib-fuji > summary, .wxf-lib .lib-fuji-section { background: var(--wxf-surface-2); color: var(--wxf-red); font-family: var(--wx-font-mono); }
.wxf-lib .lib-edit-field > span, .wxf-lib .lib-fuji .lib-edit-field > span { color: var(--wxf-ink-2); }
.wxf-lib .lib-fuji .lib-edit-field { border-bottom-color: var(--wxf-line); }
.wxf-lib .lib-fuji .lib-edit-field:hover { background: rgba(241, 238, 232, .03); }
.wxf-lib .lib-edit-field input[type="text"], .wxf-lib .lib-edit-field select, .wxf-lib .lib-edit-field textarea,
.wxf-lib .lib-fuji .lib-edit-field input[type="text"], .wxf-lib .lib-fuji .lib-edit-field select,
.wxf-lib .lib-tag-input, .wxf-lib .lib-stepper, .wxf-lib .lib-fuji .lib-stepper, .wxf-lib .lib-segmented, .wxf-lib .lib-fuji .lib-segmented {
  background: var(--wxf-surface-2); color: var(--wxf-ink); border-color: var(--wxf-line-2);
}
.wxf-lib .lib-edit-field input:focus, .wxf-lib .lib-edit-field select:focus { border-color: var(--wxf-red); }
.wxf-lib .lib-edit-chip { background: transparent; border-color: var(--wxf-line-2); color: var(--wxf-ink-2); }
.wxf-lib .lib-edit-chip:has(input:checked) { background: rgba(255, 74, 61, .14); border-color: var(--wxf-red); color: var(--wxf-ink); }
.wxf-lib .lib-tag-entry { color: var(--wxf-ink); }
.wxf-lib .lib-tag-chip { background: var(--wxf-canvas); }
.wxf-lib .lib-stepper-btn, .wxf-lib .lib-fuji .lib-stepper-btn { background: var(--wxf-canvas); color: var(--wxf-red); }
.wxf-lib .lib-stepper-value, .wxf-lib .lib-fuji .lib-stepper-value { color: var(--wxf-ink); font-family: var(--wx-font-mono); }
.wxf-lib .lib-seg-btn, .wxf-lib .lib-fuji .lib-seg-btn { background: transparent; color: var(--wxf-ink-2); border-left-color: var(--wxf-line); }
.wxf-lib .lib-seg-btn:hover { background: rgba(241, 238, 232, .05); }
.wxf-lib .lib-seg-btn.is-active, .wxf-lib .lib-fuji .lib-seg-btn.is-active { background: var(--wxf-red); color: var(--wxf-red-ink); }
.wxf-lib .lib-wbgrid-wrap, .wxf-lib .lib-fuji .lib-wbgrid-wrap, .wxf-lib .lib-wbgrid-bottom, .wxf-lib .lib-fuji .lib-wbgrid-bottom { background: var(--wxf-surface-2); border-color: var(--wxf-line); }
.wxf-lib .lib-wb-arrow { background: var(--wxf-canvas); border-color: var(--wxf-line-2); color: var(--wxf-ink-2); }
.wxf-lib .lib-wb-axis, .wxf-lib .lib-wb-readout { color: var(--wxf-ink); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1180px) {
  .wxf-grid--library { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wxf-sentinel.is-loading { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wxf-filter-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wxf-filter-actions { grid-column: 1 / -1; justify-content: flex-end; }
}

@media (max-width: 960px) {
  /* hero mobile/tablet: máy ảnh trên (≈54svh), chữ + dải film bên dưới, không pin */
  .wxf-hero-pin { display: block; min-height: 0; }
  .wxf-camera { position: relative; inset: auto; height: 54svh; min-height: 320px; max-height: 560px; }
  .wxf-camera .wx-stage-fallback { padding: 4% 6%; object-position: center; }
  .wxf-hero-grid { padding: 8px 0 0; }
  .wxf-filmbar { position: relative; margin-top: 32px; }
  .wxf-xray, .wxf-story { display: none !important; }
  .wxf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 14px; }
  .wxf-grid--stagger > :nth-child(even) { top: 40px; }
  .wxf-matcher-grid, .wxf-reader-grid, .wxf-about, .wxf-legal, .wxf-news-lead, .wxf-detail, .wxf-detail.is-landscape .wxf-detail-info { grid-template-columns: minmax(0, 1fr); }
  .wxf-detail.is-landscape .recipe-specs { grid-column: auto; grid-row: auto; }
  .wxf-detail.is-portrait .wxf-detail-media, .wxf-detail.is-square .wxf-detail-media { position: relative; top: auto; }
  .wxf-reader-media { max-width: 520px; }
  .wxf-matcher-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wxf-about-strip, .wxf-legal-aside { position: static; }
  .wxf-legal-aside { display: flex; flex-wrap: wrap; gap: 16px; }
  .wxf-news-list, .wxf-history { grid-template-columns: minmax(0, 1fr); }
  .wxf-lib-head { grid-template-columns: minmax(0, 1fr); }

  /* thanh lọc: gọn thành 1 nút, mở ra panel */
  .wxf-filter-bar { flex-wrap: wrap; padding: 10px 0; }
  .wxf-filter-toggle {
    display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px;
    border: 1px solid var(--wxf-line-2); border-radius: var(--wxf-r); background: var(--wxf-surface-2); color: var(--wxf-ink);
    font: 600 14.5px/1 var(--wx-font-body); cursor: pointer;
  }
  .wxf-filter-toggle b { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--wxf-red); color: var(--wxf-red-ink); font: 600 12px/1 var(--wx-font-mono); }
  .wxf-filter-toggle svg { width: 16px; height: 16px; transition: transform .25s var(--wx-ease); }
  .wxf-filter-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .wxf-filter-bar .wxf-count { margin-left: auto; }
  .wxf-filter-form { display: none; flex: 1 0 100%; grid-template-columns: minmax(0, 1fr); padding: 6px 0 14px; max-height: calc(100dvh - var(--wx-topbar-h) - 90px); overflow-y: auto; }
  .wxf-filter-form.is-open { display: grid; }
  .wxf-filter-actions { justify-content: stretch; }
  .wxf-filter-actions .wx-btn { flex: 1; }
  .wxf-filter .ms-panel { position: static; width: 100%; margin-top: 6px; max-height: 240px; }
  .wxf-grid--library { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wxf-sentinel.is-loading { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .wxf-hero-lede { font-size: 16.5px; }
  .wxf-hero-actions .wx-btn { flex: 1 1 auto; }
  .wxf-filmbar { margin-top: 24px; }
  .wxf-filmbar-title { max-width: 18ch; }
  .wxf-chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--wx-gutter) * -1); padding: 2px var(--wx-gutter) 6px; scrollbar-width: none; }
  .wxf-chips::-webkit-scrollbar { display: none; }
  .wxf-sec-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .wxf-card-title { font-size: 15.5px; }
  .wxf-card-stats { display: none; }
  .wxf-card-meta { font-size: 10.5px; }
  .wxf-fav { top: 8px; right: 8px; width: 34px; height: 34px; }
  .wxf-facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .wxf-matcher-cards { grid-template-columns: minmax(0, 1fr); }
  .wxf-reader-frame { width: 88%; }
  .wxf-exif { width: 86%; margin-top: -90px; }
  .wxf-spec-grid { grid-template-columns: minmax(0, 1fr); }
  .wxf-samples { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .wxf-news-item { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; }
  .wxf-about-copy .wx-prose p:first-child { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .wxf-frame > img, .wxf-chip, .wxf-card-link { transition: none; }
  .wxf-card-link { transform: none; }
  .wxf-sentinel.is-loading::before, .wxf-sentinel.is-loading::after { animation: none; }
}

/* ảnh mẫu trôi parallax trong khung (motion data-m="parallax") — ảnh cao hơn khung để không lộ mép */
.wxf-samples .wxf-frame > img[data-m~="parallax"] { inset: -10% 0; height: 120%; }
/* thanh tiến độ đọc bài (motion data-m="progress") */
.wxf-page .wx-progress { background: var(--wxf-red); }


/* Fuji personal library mobile polish — keep cards, quota and toolbar readable. */
.wxf-lib .wxf-lib-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.wxf-lib .wxf-lib-shortcuts a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--wxf-line-2); border-radius: var(--wxf-r); color: var(--wxf-ink);
  font-size: 13px; font-weight: 600; text-decoration: none;
}
.wxf-lib .wxf-lib-shortcuts a:hover { background: var(--wxf-surface-2); }
.wxf-lib .wxf-lib-user { min-width: 0; }
.wxf-lib .wxf-lib-user > div { min-width: 0; }
.wxf-lib .wxf-lib-mail { overflow-wrap: anywhere; line-height: 1.5; }
.wxf-lib .wxf-lib-name { overflow-wrap: anywhere; }
.wxf-lib .wxf-card-tools .wxf-tool-btn { min-height: 42px; }
.wxf-lib .wxf-lib-sec:last-of-type { padding-bottom: 96px; }

@media (max-width: 640px) {
  .wxf-lib .wxf-lib-head { gap: 28px; padding-top: 36px; padding-bottom: 8px; }
  .wxf-lib .wxf-lib-head .wxf-h1 { font-size: clamp(2rem, 9vw, 2.7rem); line-height: 1.1; }
  .wxf-lib .wxf-lib-user { gap: 12px; margin-top: 18px; }
  .wxf-lib .wxf-lib-user img,
  .wxf-lib .wxf-lib-user .wxf-avatar { width: 46px; height: 46px; flex: 0 0 46px; }
  .wxf-lib .wxf-lib-name { font-size: 14px; }
  .wxf-lib .wxf-lib-mail { font-size: 12px; }
  .wxf-lib .wxf-quota { width: 100%; min-width: 0; padding: 18px; }
  .wxf-lib .wxf-quota-num { font-size: clamp(25px, 7vw, 30px); }
  .wxf-lib .wxf-quota-sub { font-size: 12px; }
  .wxf-lib .wxf-lib-sec { padding-top: 40px; }
  .wxf-lib .wxf-lib-sec > .wxf-h2 { margin-bottom: 20px; font-size: clamp(1.35rem, 6vw, 1.8rem); line-height: 1.2; }
  .wxf-lib .wxf-grid--library { gap: 28px 12px; }
  .wxf-lib .wxf-card-tools { flex-wrap: nowrap; gap: 6px; }
  .wxf-lib .wxf-card-tools .wxf-tool-btn {
    min-width: 0; flex: 1 1 auto; justify-content: center;
    min-height: 44px; padding: 0 7px; font-size: 10px; letter-spacing: 0;
  }
  .wxf-lib .wxf-card-title { font-size: 14px; }
  .wxf-lib .wxf-lib-sec:last-of-type { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}
