/*
 * Template catalogue (/mau-thiep/ and style pages) - loaded only there (archive-dtc_template.php).
 * 1. Paper background: a fibre-paper photo multiplied over the page tint (draft-paper feel).
 * 2. Hover preview: the full-length invitation screenshot scrolls down slowly at a steady reading
 *    speed (duration per card from catalog-art.js), and glides back quickly when the pointer leaves.
 * 3. Heading and sub-title hidden (owner's request); the filter / colour / search bar is shown again (owner 08/11).
 */
body.post-type-archive-dtc_template .page-hero,
body.post-type-archive-dtc_template .section--tint,
body.tax-dtc_style .page-hero,
body.tax-dtc_style .section--tint {
	background-color: var(--tint, #fff3f5);
	background-image: url("../bh/minimalism-do-do/paper.webp");
	background-size: 720px auto;
	background-repeat: repeat;
	background-position: center top;
	background-blend-mode: multiply;
}

/* PC: 4 invitations per row (was 5) - larger previews, taller cards in a portrait 3:5 frame. */
@media (min-width: 960px) {
	body.post-type-archive-dtc_template .ws-themes-grid--dtc-cols-5,
	body.tax-dtc_style .ws-themes-grid--dtc-cols-5 { grid-template-columns: repeat(4, 1fr); gap: 24px; --thumb-h: 500px; }
}

/* Phones: the card was a squat 4:5.6 frame with the name and both buttons laid over its lower half, so
   only the top of each cover showed (owner 2026-10-17: "PC shows it all, mobile doesn't"). Same 3:5
   frame as on PC, with the name and buttons below the picture instead of over it. */
@media (max-width: 600px) {
	body.post-type-archive-dtc_template .ws-themes-card__thumb,
	body.tax-dtc_style .ws-themes-card__thumb { height: auto; aspect-ratio: auto; }
	body.post-type-archive-dtc_template .ws-themes-card__thumb-inner,
	body.tax-dtc_style .ws-themes-card__thumb-inner { height: auto; aspect-ratio: 3 / 5; }
	body.post-type-archive-dtc_template .ws-themes-card__overlay,
	body.tax-dtc_style .ws-themes-card__overlay {
		position: static; opacity: 1; gap: 7px; padding: 9px 8px 10px;
		background: #fff; pointer-events: auto;
	}
	body.post-type-archive-dtc_template .ws-themes-card__title,
	body.tax-dtc_style .ws-themes-card__title { color: #3b2a30; text-shadow: none; font-size: 13px; text-align: center; }
	body.post-type-archive-dtc_template .ws-themes-card__actions,
	body.tax-dtc_style .ws-themes-card__actions { grid-template-columns: 1fr 1fr; gap: 6px; transform: none; }
	body.post-type-archive-dtc_template .ws-themes-card__actions > .ws-button,
	body.tax-dtc_style .ws-themes-card__actions > .ws-button { min-height: 32px; padding: 5px 4px; gap: 3px; font-size: 11px; white-space: nowrap; }
	body.post-type-archive-dtc_template .ws-themes-card__actions .dtc-icon,
	body.tax-dtc_style .ws-themes-card__actions .dtc-icon { width: 12px; height: 12px; flex: none; }
}
@media (max-width: 360px) {
	body.post-type-archive-dtc_template .ws-themes-card__actions .dtc-icon,
	body.tax-dtc_style .ws-themes-card__actions .dtc-icon { display: none; }
}

/* Slow preview scroll: linear (steady reading speed), starts after a short pause so passing over a
   card does not trigger it; returns in 0.9s. */
body.post-type-archive-dtc_template .ws-themes-card__thumb-inner > img,
body.tax-dtc_style .ws-themes-card__thumb-inner > img {
	transition: transform .9s cubic-bezier(.22, 1, .36, 1);
}
body.post-type-archive-dtc_template .ws-themes-card:hover .ws-themes-card__thumb-inner > img,
body.tax-dtc_style .ws-themes-card:hover .ws-themes-card__thumb-inner > img {
	transition: transform var(--scroll-d, 14s) linear .25s;
}

/* main.css switches every transition off when the OS asks for reduced motion (Windows "animation
   effects" off): the preview then jumped to the end. It is started by the visitor's own pointer, so
   it keeps its slow scroll there too. */
@media (prefers-reduced-motion: reduce) {
	body.post-type-archive-dtc_template .ws-themes-card__thumb-inner > img,
	body.tax-dtc_style .ws-themes-card__thumb-inner > img {
		transition: transform .9s cubic-bezier(.22, 1, .36, 1) !important;
	}
	body.post-type-archive-dtc_template .ws-themes-card:hover .ws-themes-card__thumb-inner > img,
	body.tax-dtc_style .ws-themes-card:hover .ws-themes-card__thumb-inner > img {
		transition: transform var(--scroll-d, 14s) linear .25s !important;
	}
}

/* Filters (style, colour, search, count): shown again (owner 08/11). */
body.post-type-archive-dtc_template .page-hero,
body.tax-dtc_style .page-hero { padding: 26px 0 16px; }

/*
 * Art-directed title, composed like the first page of a printed invitation:
 * a spaced small-caps kicker between hairlines, the title hand-written in Great Vibes with a wine-to-
 * rose ink, a fine drawn flourish with a small heart, then the caption in Playfair italic.
 * On arrival it is "written": kicker fades in, the title is inked left to right, the flourish draws
 * itself, the caption rises - about 2.5s, once.
 */
.catalog-hero { text-align: center; max-width: 720px; margin: 0 auto; }
.catalog-hero__kicker {
	display: inline-flex; align-items: center; gap: 12px; margin: 0;
	font: 600 11.5px/1 'Be Vietnam Pro', system-ui, sans-serif; letter-spacing: .42em; text-transform: uppercase;
	color: #c0546b; padding-left: .42em; /* optical centring of the tracked text */
}
.catalog-hero__kicker::before, .catalog-hero__kicker::after {
	content: ""; width: 44px; height: 1px; background: linear-gradient(90deg, transparent, #d98a9c);
}
.catalog-hero__kicker::after { background: linear-gradient(90deg, #d98a9c, transparent); }
.catalog-hero__kicker span { position: relative; }
.catalog-hero__title {
	/* Great Vibes' swashes (the T's top stroke) rise above the line box, and background-clip: text only paints
	   inside the padding box: .45em of headroom, taken back by a negative margin - same layout, glyph not cut
	   (owner 2026-10-13). */
	margin: -.41em 0 0; padding: .45em .25em .06em;
	font: 400 clamp(48px, 6vw, 74px)/1.05 'Great Vibes', 'Playfair Display', serif; letter-spacing: 0;
	background: linear-gradient(100deg, #6e1a31 0%, #9b2643 45%, #c7385a 100%);
	-webkit-background-clip: text; background-clip: text; color: transparent;
	filter: drop-shadow(0 6px 14px rgba(155, 38, 67, .12));
}
.catalog-hero__flourish { display: block; width: 160px; height: 18px; margin: -4px auto 4px; overflow: visible; }
.catalog-hero__flourish path { fill: none; stroke: #d98a9c; stroke-width: 1.2; stroke-linecap: round; }
.catalog-hero__flourish .catalog-hero__heart { fill: #eb3c58; stroke: none; opacity: .85; }
.catalog-hero__sub {
	margin: 0; font: italic 500 clamp(14.5px, 1.5vw, 17px)/1.45 'Playfair Display', Georgia, serif; color: #7a5f66;
}

/* Arrival: written once. */
@keyframes chKicker { from { opacity: 0; letter-spacing: .6em; } to { opacity: 1; letter-spacing: .42em; } }
@keyframes chWrite { from { clip-path: inset(-10% 100% -30% -6%); } to { clip-path: inset(-10% -6% -30% -6%); } }
@keyframes chDraw { from { stroke-dashoffset: 260; } to { stroke-dashoffset: 0; } }
@keyframes chHeart { 0% { opacity: 0; transform: scale(.4); } 70% { opacity: .9; transform: scale(1.12); } 100% { opacity: .85; transform: scale(1); } }
@keyframes chRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.catalog-hero__kicker { animation: chKicker 1.1s cubic-bezier(.22, 1, .36, 1) both; }
.catalog-hero__title { animation: chWrite 1.9s cubic-bezier(.45, 0, .55, 1) .25s both; }
.catalog-hero__flourish path:first-child { stroke-dasharray: 260; animation: chDraw 1.4s cubic-bezier(.65, 0, .35, 1) 1.1s both; }
.catalog-hero__heart { transform-box: fill-box; transform-origin: center; animation: chHeart .8s cubic-bezier(.34, 1.4, .64, 1) 1.9s both; }
.catalog-hero__sub { animation: chRise 1s cubic-bezier(.22, 1, .36, 1) 1.7s both; }
/* main.css removes every animation when the OS asks for reduced motion: this short, one-off entrance
   is part of the page's character, so it keeps playing (calmly) there too. */
@media (prefers-reduced-motion: reduce) {
	.catalog-hero__kicker { animation: chKicker 1.1s cubic-bezier(.22, 1, .36, 1) both !important; }
	.catalog-hero__title { animation: chWrite 1.9s cubic-bezier(.45, 0, .55, 1) .25s both !important; }
	.catalog-hero__flourish path:first-child { animation: chDraw 1.4s cubic-bezier(.65, 0, .35, 1) 1.1s both !important; }
	.catalog-hero__heart { animation: chHeart .8s cubic-bezier(.34, 1.4, .64, 1) 1.9s both !important; }
	.catalog-hero__sub { animation: chRise 1s cubic-bezier(.22, 1, .36, 1) 1.7s both !important; }
}
@media (max-width: 767px) {
	body.post-type-archive-dtc_template .page-hero, body.tax-dtc_style .page-hero { padding: 18px 0 12px; }
	.catalog-hero__kicker { font-size: 10px; gap: 9px; }
	.catalog-hero__kicker::before, .catalog-hero__kicker::after { width: 24px; }
	.catalog-hero__flourish { width: 130px; height: 15px; }
}

/*
 * Phones (owner 08–10/11): only three buttons — Tông màu, Phong cách, Sắp xếp.
 * Each opens a sheet from the bottom with just that group (catalog-art.js); the bar sticks under the
 * site header while scrolling. PC unchanged.
 */
.cat-fbar, .cat-sheet { display: none; }
@media (max-width: 600px) {
	body.post-type-archive-dtc_template .tpl-catalog > .invitation-filters,
	body.tax-dtc_style .tpl-catalog > .invitation-filters {
		display: block;
		position: sticky; top: var(--cat-top, 0px); z-index: 40;
		margin: 0 0 12px; padding: 8px 0;
	}
	/* Full-width tinted strip behind the stuck bar. */
	.tpl-catalog > .invitation-filters::before {
		content: ''; position: absolute; top: 0; bottom: 0; left: calc(50% - 50vw); width: 100vw;
		background: #fbf1f3; z-index: -1; pointer-events: none; transition: box-shadow .2s;
	}
	.tpl-catalog > .invitation-filters.is-stuck::before { box-shadow: 0 8px 14px -10px rgba(110, 26, 49, .35); }
	html.cat-sheet-open .tpl-catalog > .invitation-filters { z-index: 1000; }

	/* Only the three buttons (owner 10/11: "chỉ để 3 cái đó thôi") — no search, no result count. */
	.tpl-catalog > .invitation-filters > .invitation-filter-bottom,
	.tpl-catalog > .invitation-filters > .invitation-filter-top,
	.tpl-catalog > .invitation-filters > .invitation-tone-section { display: none !important; }

	.cat-fbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
	.cat-fbar__b {
		display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; height: 40px; padding: 0 8px;
		border: 1px solid #e7c3cc; border-radius: 999px; background: #fff; color: #6e1a31;
		font: 600 13px/1 'Be Vietnam Pro', system-ui, sans-serif; cursor: pointer;
	}
	.cat-fbar__b span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
	.cat-fbar__b i { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--sw, transparent); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
	.cat-fbar__b i:empty:not([style]) { display: none; }
	.cat-fbar__b svg { flex: none; width: 12px; height: 12px; opacity: .7; }
	.cat-fbar__b.is-on { border-color: #9b2643; background: #9b2643; color: #fff; }

	.cat-sheet { display: block; position: fixed; inset: 0; z-index: 1000; }
	.cat-sheet[hidden] { display: none; }
	.cat-sheet__bg { position: absolute; inset: 0; background: rgba(40, 18, 26, .45); opacity: 0; transition: opacity .25s; }
	.cat-sheet__panel {
		position: absolute; left: 0; right: 0; bottom: 0; max-height: 82vh; display: flex; flex-direction: column;
		background: #fff; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px rgba(40, 18, 26, .18);
		transform: translateY(100%); transition: transform .3s cubic-bezier(.22, 1, .36, 1);
		padding-bottom: env(safe-area-inset-bottom); overscroll-behavior: contain;
	}
	.cat-sheet.is-in .cat-sheet__bg { opacity: 1; }
	.cat-sheet.is-in .cat-sheet__panel { transform: none; }
	.cat-sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 8px; }
	.cat-sheet__head strong { font: 700 17px/1.2 'Be Vietnam Pro', system-ui, sans-serif; color: #3b2a30; }
	.cat-sheet__x { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #f6eaed; color: #6e1a31; font-size: 22px; line-height: 1; cursor: pointer; }
	.cat-sheet__body { overflow-y: auto; padding: 4px 18px 14px; }
	.cat-sheet__foot { display: flex; gap: 10px; padding: 10px 18px 14px; border-top: 1px solid #f1e3e7; }
	.cat-sheet__reset, .cat-sheet__go { height: 46px; border-radius: 999px; font: 600 15px/1 'Be Vietnam Pro', system-ui, sans-serif; cursor: pointer; }
	.cat-sheet__reset { flex: 0 0 auto; padding: 0 18px; border: 1px solid #e7c3cc; background: #fff; color: #6e1a31; }
	.cat-sheet__go { flex: 1 1 auto; border: 0; background: #9b2643; color: #fff; }

	/* Controls laid out as chips inside the sheet. */
	.cat-sheet .invitation-occasions,
	.cat-sheet .invitation-tone-filter { display: flex; flex-wrap: wrap; gap: 8px; overflow: visible; }
	.cat-sheet .invitation-occasions > .invitation-pill,
	.cat-sheet .invitation-tone-option { flex: 0 0 auto; }
	.cat-sheet .invitation-menu { position: static; display: contents; }
	.cat-sheet .invitation-menu-trigger { display: none !important; }
	.cat-sheet .invitation-filter-menu {
		position: static !important; display: contents !important;
		width: auto; margin: 0; padding: 0; border: 0; box-shadow: none; background: none; transform: none; opacity: 1; visibility: visible;
	}
	.cat-sheet [data-tpl-menu="sort"] .invitation-filter-menu { display: flex !important; flex-wrap: wrap; gap: 8px; }
	.cat-sheet .invitation-filter-option {
		display: inline-flex; align-items: center; gap: 6px; width: auto; min-height: 38px; padding: 7px 13px;
		border: 1px solid #ead2d8; border-radius: 999px; background: #fff; color: #3b2a30; font-size: 14px;
	}
	.cat-sheet .invitation-filter-option[hidden] { display: none !important; }
	.cat-sheet .invitation-filter-option.is-selected { border-color: #9b2643; background: #9b2643; color: #fff; }
	.cat-sheet .invitation-filter-option.is-selected small { color: inherit; opacity: .8; }
	.cat-sheet .invitation-filter-option svg { width: 15px; height: 15px; }
}
