/* ──────────────────────────────────────────────────────────────────────────
   LELAM — TKT-016 (feedback của Linh 14/11/2026, chủ yếu MOBILE)

   Nạp SAU lelam-custom, revision 009→015 và lelam-gl (khai phụ thuộc trong
   lelam-revision-016.php). Luật nào đè luật !important của theme thì dùng bộ
   selector dài hơn + !important.

   Phần lưới 1-2-3-4 trên mobile KHÔNG nằm ở đây: số cột phụ thuộc nhịp đang cấu
   hình nên do PHP sinh (lelam_r16_mobile_css), gắn thành style nội tuyến của
   handle này.
   ────────────────────────────────────────────────────────────────────────── */

/* ──────────────────────────────────────────────────────────────────────────
   MỤC A — THU KHOẢNG TRỐNG Ở ĐẦU TRANG (CHỈ MOBILE, ≤599px)

   "Có mấy trang này anh xem ở trên mobile cái khoảng trên đầu thì anh thu lại
    giúp em ạ … mấy trang đều giống nhau đều bị như vậy ạ"  (attachment 242,
    khung đỏ: từ header tới đoạn mô tả)

   NGUYÊN NHÂN — số đo dành cho desktop đang áp nguyên lên mobile:
     • lelam-custom.css: `.tax-line main.wp-block-group { padding-top:123px }`
       (số đo từ trang ETERNITY trên desktop — header → tiêu đề);
     • `.lelam-line__title { margin-bottom:74px }`  (tiêu đề → mô tả);
     • `.lelam-line__lede  { margin-bottom: clamp(2rem,5vw,3.5rem) }`.
   Cộng lại ~200px trắng trước khi thấy ảnh đầu tiên — khoảng khách khoanh.

   Header của site là `position:sticky` (chiếm chỗ trong luồng), nên không cần
   chừa chỗ cho nó: padding-top nhỏ là đủ. Tablet và desktop (>599px) KHÔNG đổi — khách đã duyệt, chỉ nghiệm thu trên mobile.
   ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 599px) {
	body:is(.tax-line, .tax-collection, .tax-product_cat, .post-type-archive-product, .woocommerce-shop) main.wp-block-group {
		padding-top: 32px !important;
	}

	/* Tiêu đề (LE LAM HANOI / AMARÉ …) → mô tả. */
	body .lelam-line__title {
		margin-bottom: 16px !important;
	}

	/* Mô tả → ảnh đầu tiên. */
	body .lelam-line__lede,
	body .lelam-eternity__lede {
		margin-bottom: 28px !important;
		line-height: 1.9;
	}

	body :is(.tax-line, .tax-collection, .tax-product_cat, .post-type-archive-product, .woocommerce-shop) .wp-block-term-description {
		margin-bottom: 28px !important;
	}
}

/* ──────────────────────────────────────────────────────────────────────────
   MỤC B — "CONTACT TO ORDER" BỚT GIÃN CHỮ (CHỈ MOBILE, ≤599px)

   "Cái button contact to order letter spacing nó hơi nhiều, anh thu lại xíu"

   Nhãn nút đang ăn `letter-spacing: var(--lr14-tracking-label)` = 0.16em
   (revision-014, !important) — hợp với tiêu đề viết hoa, nhưng quá thưa cho
   dòng chữ thường "Contact to Order" ở cỡ 12px trên màn hẹp.

   Chỉ ≤599px. PHP còn ghi đè theo số sản phẩm trên hàng (ô càng hẹp càng sát) —
   xem lelam_r16_text_scale().
   ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 599px) {
	.wp-block-post-template.lelam-grid-rhythm .wp-block-read-more,
	.wp-block-post-template.lelam-grid-rhythm .lelam-order-trigger,
	.wp-block-woocommerce-product-template.lelam-grid-rhythm .wp-block-read-more,
	.wp-block-woocommerce-product-template.lelam-grid-rhythm .lelam-order-trigger,
	.wp-block-query .wp-block-read-more,
	.wp-block-query .lelam-order-trigger {
		letter-spacing: 0.02em !important;
	}
}

/* ──────────────────────────────────────────────────────────────────────────
   MỤC C — TÊN SẢN PHẨM ĐẬM HƠN MỘT XÍU (CHỈ MOBILE, ≤599px)

   "Giúp em cho cái tên sp nó đậm lên 1 xíu ạ :(( giờ nhìn nó cứ giống nhau"

   Tên SP và dòng "Contact to Order" cùng cỡ chữ, cùng nét 400 nên dính vào
   nhau. Manrope self-host có sẵn nét 500 và 600 (lelam-fonts.css) — lấy 600:
   đủ tách khỏi dòng nút nhưng chưa nặng thành tiêu đề. Muốn nhẹ hơn thì đổi
   600 → 500, một chỗ duy nhất.

   Chỉ áp cho tên trong vòng lặp sản phẩm; trang chi tiết sản phẩm giữ nguyên
   (khách đã duyệt ở TKT-005).
   ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 599px) {
	.wp-block-post-template.lelam-grid-rhythm .wp-block-post-title,
	.wp-block-post-template.lelam-grid-rhythm .wp-block-post-title a,
	.wp-block-woocommerce-product-template.lelam-grid-rhythm .wp-block-post-title,
	.wp-block-woocommerce-product-template.lelam-grid-rhythm .wp-block-post-title a {
		font-weight: 600 !important;
	}
}

/* Vòng lặp chưa được gắn lớp lưới (plugin Bố cục lưới tắt) vẫn nên đậm. */
@media (max-width: 599px) {
	.lelam-shop-loop .wp-block-post-title,
	.lelam-shop-loop .wp-block-post-title a {
		font-weight: 600 !important;
	}
}

/* ──────────────────────────────────────────────────────────────────────────
   MỤC D — GALLERY GIỮ BỐ CỤC PC; ETERNITY DÙNG NHỊP 1-2-3-4 (CHỈ MOBILE, ≤599px)

   (Cập nhật theo yêu cầu "layout 1, 2, 3, 4 áp dụng cho trang Le lam eternity":
   phần ETERNITY ở dưới là nhịp 1-2-3-4; phần Gallery vẫn là khuôn 12 cột như PC.)

   "Anh chịu khó chỉnh nốt cả trang này vs gallery mobile giúp em nha"
   "Em muốn nó kiểu như PC … Cứ như trên PC là đc anh ui"  (ảnh khách gửi lúc 14:56:
   trang LE LAM ETERNITY trên mobile chỉ là một cột dọc)

   HIỆN TRẠNG: cả hai tường dùng lưới 12 cột + vị trí từng ô do PHP phát ra qua
   biến --ed-col / --ed-span / --ed-row / --ed-align / --ed-ratio. Dưới 900px,
   CSS của từng bên "vô hiệu hoá toàn bộ biến vị trí bằng một luật" và rơi về một
   cột (lelam-blocks/assets/frontend.css cho Gallery; revision-014 cho ETERNITY).

   CÁCH SỬA: không đụng hai tệp ấy (đã chạy production). Ở đây đặt lại đúng các
   luật PC cho ≤599px — vẫn dùng chính các biến --ed-* mà PHP đã phát, nên đổi
   khuôn vị trí ở PHP thì mobile đổi theo. Khe hở thu về 8px: khe 16px của PC
   ăn mất gần 1/5 bề ngang trên điện thoại.

   Độ ưu tiên: hai bên đều (0,4,0)–(0,5,0); selector dưới đây dài hơn một bậc
   và nạp sau, nên thắng mà không cần !important với Gallery. ETERNITY thì phải
   !important vì r014 khai !important.
   ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 599px) {
	/* ── GALLERY (/gallery/) ── */
	.lelam-gallery.lelam-gindex.is-layout-editorial.is-layout-editorial {
		--lelam-ed-gap: 8px;
	}

	.lelam-gallery.lelam-gindex.is-layout-editorial.is-layout-editorial .lelam-gallery__grid {
		grid-template-columns: repeat(12, 1fr);
	}

	.lelam-gallery.lelam-gindex.is-layout-editorial.is-layout-editorial .lelam-gallery__item {
		grid-column: var(--ed-col, auto) / span var(--ed-span, 4);
		grid-row: var(--ed-row, auto);
		align-self: var(--ed-align, start);
	}

	.lelam-gallery.lelam-gindex.is-layout-editorial.is-layout-editorial .lelam-gallery__media img,
	.lelam-gallery.lelam-gindex.is-layout-editorial.is-layout-editorial .lelam-gallery__media .lelam-gallery__img {
		aspect-ratio: var(--ed-ratio, 4 / 5);
		max-height: none;
	}

	/* Ô chữ chỉ rộng 3/12 (~85px trên điện thoại) — chữ phải nhỏ lại mới vừa. */
	.lelam-gallery.lelam-gindex .lelam-gindex__textcard-title {
		font-size: 9px !important;
		letter-spacing: 0.12em !important;
		margin-bottom: 0.5rem;
	}

	.lelam-gallery.lelam-gindex .lelam-gindex__textcard-body,
	.lelam-gallery.lelam-gindex .lelam-gindex__textcard-body p {
		font-size: 8px !important;
		line-height: 1.6 !important;
		letter-spacing: 0.02em !important;
	}

	/* ── ETERNITY (page 290): nhịp 1-2-3-4, KHÔNG phải khuôn 6 ô của PC ──
	   Các biến --r16-* do lelam_r16_eternity_rhythm_markup() (PHP) gắn. Thẻ
	   nào không có lớp lr16-* (PHP chưa chạy) thì giữ một cột của revision-014. */
	body.page-id-290 .lr14-wall .lelam-gallery__grid.lr14-grid.lr14-grid {
		grid-template-columns: repeat(var(--r16-track, 12), 1fr) !important;
		column-gap: 8px !important;
		row-gap: 20px !important;
	}

	body .lr14-grid > li.lr16-item {
		grid-column: span var(--r16-span, 12) !important;
		grid-row: auto !important;
		align-self: start !important;
		order: var(--r16-order, 0);
	}

	body .lr14-grid > li.lr16-card {
		grid-column: 1 / -1 !important;
		grid-row: auto !important;
		align-self: start !important;
		order: var(--r16-order, 0);
	}

	body .lr14-grid > li.lr16-item img,
	body .lr14-grid > li.lr16-item video,
	body .lr14-grid > li.lr16-item .lelam-gallery__img {
		aspect-ratio: var(--r16-ratio, 4 / 5) !important;
		max-height: none !important;
	}
}

/* ──────────────────────────────────────────────────────────────────────────
   MỤC E — COVER (BANNER) TRÊN MOBILE CO LẠI (CHỈ MOBILE, ≤599px)

   Nam: "À cover này để bé hả em"  —  Linh: "Vâng nó responsive trên mobile ý ạ"
   (ảnh khách gửi lúc 14:54: ảnh cover chiếm trọn màn hình điện thoại, ảnh ngang bị cắt
   cận tới mức chỉ còn nửa khuôn mặt)

   ĐÃ KIỂM TRA TRÊN DỮ LIỆU THẬT (bản backup Duplicator, trang chủ = page 36):
   cover là VIDEO nền (lelam-video.mp4, 1920×1080, tức ngang 16:9) nằm trong
   `<div class="wp-block-cover" style="min-height:1000px">`, chữ "COMING SOON /
   NEW COLLECTION 2026" ở đáy giữa. Đó là min-height 1000px viết thẳng vào nội
   dung trang — không phải CSS — nên trên điện thoại rộng 390px nó là khung
   390×1000, và video 16:9 phải phóng to để phủ kín: chỉ thấy khoảng 1/5 bề
   ngang (đúng nửa khuôn mặt trong ảnh khách gửi).

   CÁCH SỬA: trên mobile bỏ min-height cố định, cho cover theo TỈ LỆ khung hình
   (--lr16-cover-ratio). Cover cao theo bề ngang màn hình nên thấy được nhiều
   video hơn và gọn lại ("bé"). Chữ trong cover vẫn có chỗ: cover tự cao thêm
   khi nội dung dài hơn khung. Header ở trang chủ đã về dòng chảy thường từ
   TKT-012 (không đè lên cover) nên không cần chừa chỗ.

   Đổi tỉ lệ: 16/9 thấy trọn video nhưng rất thấp; 4/3 (mặc định) thấy ~75% bề
   ngang; 1/1 thấy ~56%; 4/5 thấy ~45%. Một chỗ duy nhất bên dưới.

   Phạm vi: trang chủ và các trang danh sách sản phẩm (nơi có banner
   "NEW COLLECTION"). Cover ở trang About/thông tin giữ nguyên.
   ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 599px) {
	body {
		--lr16-cover-ratio: 4 / 3;
	}

	body:is(.home, .tax-collection, .tax-line, .tax-product_cat, .post-type-archive-product, .woocommerce-shop) main .wp-block-cover {
		min-height: 0 !important;
		height: auto !important;
		aspect-ratio: var(--lr16-cover-ratio) !important;
	}

	body:is(.home, .tax-collection, .tax-line, .tax-product_cat, .post-type-archive-product, .woocommerce-shop) main .wp-block-cover .wp-block-cover__image-background,
	body:is(.home, .tax-collection, .tax-line, .tax-product_cat, .post-type-archive-product, .woocommerce-shop) main .wp-block-cover video.wp-block-cover__video-background {
		object-fit: cover;
	}
}
