/*
Theme Name: Hải Tình Mơ 3
Theme URI: https://haitinhmo.com/
Author: CÔNG TY TNHH HẢI TÌNH MƠ
Description: The website of CÔNG TY TNHH HẢI TÌNH MƠ and home of its games (Duck Leader: World Journey, Bestie Payback). Same design as "Hải Tình Mơ" 2.0.0, plus a settings screen (Appearance → Hải Tình Mơ) for each game's store links and its publisher on each store (App Store, Google Play), the app-ads.txt lines for AdMob, and a one-click update of the support and legal pages for the games published by the company.
Version: 3.2.1
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Text Domain: haitinhmo-v3
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
	html { scroll-behavior: smooth; }
}
body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}
a { text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
	outline: 2px solid var(--wp--preset--color--enamel);
	outline-offset: 3px;
	border-radius: 2px;
}
[id] { scroll-margin-top: calc(72px + 1.5rem); }
.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute;
	width: 1px; word-wrap: normal !important;
}
.htm-muted { color: var(--wp--preset--color--muted); }
img { max-width: 100%; height: auto; }

/* ---------- Header ---------- */
.htm-header {
	position: sticky;
	top: 0;
	z-index: 20;
	background: var(--wp--preset--color--paper);
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.admin-bar .htm-header { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) { .admin-bar .htm-header { top: 0; } }
.htm-header__bar {
	gap: 1.5rem;
	min-height: 72px;
	padding-top: 0.75rem;
	padding-bottom: 0.75rem;
}
.htm-wordmark { white-space: nowrap; line-height: 1.2; margin: 0; }
.htm-wordmark a {
	display: inline-flex;
	align-items: center;
	gap: 0.625rem;
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}
.htm-wordmark a::before {
	content: "";
	width: 30px;
	height: 30px;
	flex: none;
	background: url("assets/images/icon.svg") center / contain no-repeat;
}
.htm-nav .wp-block-navigation-item__content { color: var(--wp--preset--color--ink); text-decoration: none; }
.htm-nav .wp-block-navigation-item__content:hover { text-decoration: underline; }
.htm-nav.wp-block-navigation { justify-content: flex-end; gap: 1.75rem; }
.htm-nav .wp-block-navigation__responsive-container.is-menu-open {
	background: var(--wp--preset--color--paper);
	padding: 1.25rem clamp(1rem, 4vw, 2.5rem);
}
.htm-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	align-items: flex-start;
}
.htm-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	gap: 1.25rem;
	align-items: flex-start;
}
.htm-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-size: 1.5rem;
	font-weight: 600;
}

/* ---------- Front page ---------- */
.htm-home { padding-bottom: 0; }
.htm-home > * { margin-block-start: 0; }
.htm-section {
	border-top: 1px solid var(--wp--preset--color--line);
	padding-top: clamp(3.5rem, 8vw, 6.5rem);
	padding-bottom: clamp(3.5rem, 8vw, 6.5rem);
}
.htm-split {
	display: grid;
	grid-template-columns: 4fr 8fr;
	column-gap: clamp(2rem, 5vw, 4.5rem);
	row-gap: 1.75rem;
	align-items: start;
}
.htm-split > * { margin-block-start: 0; min-width: 0; }
.htm-split__head h2 { margin: 0; }
.htm-split__head p { margin-top: 0.75rem; max-width: 32ch; }

/* hero */
.htm-hero {
	display: grid;
	grid-template-columns: 1.3fr 1fr;
	column-gap: clamp(2rem, 5vw, 4.5rem);
	row-gap: 2.25rem;
	align-items: center;
	padding-top: clamp(2.5rem, 6vw, 5.5rem);
	padding-bottom: clamp(3.5rem, 8vw, 6.5rem);
}
.htm-hero > * { margin-block-start: 0; min-width: 0; }
.htm-lead {
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--lead);
	font-weight: 500;
	line-height: 1.42;
	letter-spacing: -0.008em;
	max-width: 26ch;
	margin: 0;
}
.htm-hero__text { color: var(--wp--preset--color--muted); margin-top: 1rem; }
.htm-hero .wp-block-buttons { gap: 0.75rem; margin-top: 2rem; }

/* buttons: the solid one comes from theme.json; the outline one keeps the same outer size */
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	border: 1.5px solid currentColor;
	color: var(--wp--preset--color--enamel);
	padding: calc(0.9rem - 1.5px) calc(1.35rem - 1.5px);
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--mist);
	color: var(--wp--preset--color--ink);
}

/* the enamel name plate with brass screws */
.htm-plate {
	background: var(--wp--preset--color--enamel);
	border-radius: 10px;
	text-align: center;
	color: var(--wp--preset--color--brass-pale);
	position: relative;
	isolation: isolate;
	padding: clamp(2.6rem, 6vw, 4rem) clamp(1.75rem, 5vw, 3.75rem);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.07),
		inset 0 -1px 0 rgba(0, 0, 0, 0.3),
		0 2px 4px rgba(10, 46, 51, 0.16),
		0 26px 44px -28px rgba(10, 46, 51, 0.75);
}
.htm-plate::before {
	content: "";
	position: absolute;
	inset: 12px;
	border: 1px solid rgba(198, 161, 91, 0.55);
	border-radius: 6px;
	pointer-events: none;
	z-index: -1;
}
.htm-plate__screw {
	position: absolute;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: radial-gradient(circle at 36% 34%, #f6e9c6 0 16%, #c6a15b 46%, #7e5f25 100%);
	box-shadow: 0 1px 1.5px rgba(0, 0, 0, 0.45);
	--rot: -38deg;
}
.htm-plate__screw::after {
	content: "";
	position: absolute;
	left: 2px;
	right: 2px;
	top: 50%;
	height: 1.5px;
	margin-top: -0.75px;
	background: rgba(64, 44, 12, 0.6);
	transform: rotate(var(--rot));
}
.htm-plate__screw.--tl { top: 26px; left: 26px; }
.htm-plate__screw.--tr { top: 26px; right: 26px; --rot: 24deg; }
.htm-plate__screw.--bl { bottom: 26px; left: 26px; --rot: 71deg; }
.htm-plate__screw.--br { bottom: 26px; right: 26px; --rot: -8deg; }
.htm-plate__name { font-size: inherit; font-weight: 700; line-height: 1.1; margin: 0; color: inherit; letter-spacing: 0; }
.htm-plate__form {
	display: block;
	color: var(--wp--preset--color--brass);
	font-weight: 600;
	letter-spacing: 0.06em;
	font-size: clamp(1rem, 1.7vw, 1.2rem);
	margin-bottom: 0.7rem;
}
.htm-plate__brand {
	display: block;
	font-size: clamp(2.25rem, 4.7vw, 4.25rem);
	letter-spacing: 0.02em;
	line-height: 1.15;
	text-wrap: balance;
}
.htm-plate__rule {
	display: block;
	width: 72px;
	height: 2px;
	border-radius: 1px;
	background: var(--wp--preset--color--brass);
	margin: clamp(1.25rem, 3vw, 1.75rem) auto;
}
.htm-plate__facts {
	color: #d4dfdb;
	font-size: clamp(0.9375rem, 1.3vw, 1rem);
	line-height: 1.55;
	max-width: 46ch;
	margin: 0 auto;
}
.htm-plate__facts p { margin: 0.3rem 0 0; }
.htm-plate__facts p:first-child { margin-top: 0; }
.htm-plate__label { color: var(--wp--preset--color--brass); }
.htm-plate a { color: inherit; text-decoration: none; }
.htm-plate a:hover { text-decoration: underline; }
.htm-plate a:focus-visible { outline-color: var(--wp--preset--color--brass-pale); }

/* game cards */
.htm-games { display: grid; gap: 1.25rem; }
.htm-game {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 16px;
	padding: clamp(1.25rem, 3vw, 2rem);
	display: grid;
	grid-template-columns: 112px 1fr;
	gap: 1.25rem 1.75rem;
	align-items: start;
}
.htm-game > * { min-width: 0; }
.htm-game__icon {
	width: 112px;
	height: 112px;
	border-radius: 25px;
	box-shadow: 0 0 0 1px rgba(20, 40, 44, 0.08);
	object-fit: cover;
	display: block;
}
.htm-game__name { font-size: var(--wp--preset--font-size--large); margin: 0; }
.htm-game__alt {
	display: block;
	color: var(--wp--preset--color--muted);
	font-size: 1rem;
	font-weight: 500;
	margin-top: 0.2rem;
	letter-spacing: 0;
}
.htm-game__by { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); margin: 0.35rem 0 0; }
.htm-game__desc { margin: 0.6rem 0 0; max-width: 52ch; }
.htm-stores { display: flex; flex-wrap: wrap; gap: 0.625rem; margin-top: 1.25rem; }
.htm-store {
	background: var(--wp--preset--color--ink);
	border: 1.5px solid var(--wp--preset--color--ink);
	border-radius: 10px;
	color: var(--wp--preset--color--white);
	display: inline-flex;
	flex-direction: column;
	min-width: 172px;
	padding: 0.55rem 1rem 0.6rem;
	line-height: 1.2;
	text-decoration: none;
}
a.htm-store:hover, a.htm-store:focus-visible {
	background: var(--wp--preset--color--enamel);
	border-color: var(--wp--preset--color--enamel);
	color: var(--wp--preset--color--white);
}
.htm-store__pre { font-size: 0.75rem; opacity: 0.8; }
.htm-store__name { font-size: 1.0625rem; font-weight: 600; }
.htm-store.is-soon {
	background: transparent;
	border: 1.5px dashed #9fb2ad;
	color: var(--wp--preset--color--muted);
}
.htm-game__links {
	display: flex;
	flex-wrap: wrap;
	list-style: none;
	padding: 0;
	margin: 1.25rem 0 0;
	font-size: var(--wp--preset--font-size--small);
	gap: 0.375rem 1.25rem;
}

/* "What we do" */
.htm-lines { column-gap: 0 !important; margin: clamp(1.75rem, 4vw, 2.5rem) 0 0; }
.htm-lines > .wp-block-column { padding-left: clamp(1.5rem, 3vw, 2.5rem); padding-right: clamp(1.5rem, 3vw, 2.5rem); }
.htm-lines > .wp-block-column:first-child { padding-left: 0; }
.htm-lines > .wp-block-column + .wp-block-column { border-left: 1px solid var(--wp--preset--color--line); }
.htm-lines h3 { margin: 0; }
.htm-lines p { margin-top: 0.6rem; }

/* company details */
.htm-facts { border-top: 1px solid var(--wp--preset--color--line); margin: 0; }
.wp-block-post-content .htm-facts { margin-top: 1.75rem; }
.htm-facts > div {
	display: grid;
	grid-template-columns: minmax(150px, 32%) 1fr;
	gap: 0.25rem 1.5rem;
	padding: 0.9rem 0;
	border-bottom: 1px solid var(--wp--preset--color--line);
}
.htm-facts dt { color: var(--wp--preset--color--muted); font-size: var(--wp--preset--font-size--small); padding-top: 0.1rem; }
.htm-facts dd { margin: 0; overflow-wrap: anywhere; }
.htm-note { display: block; color: var(--wp--preset--color--muted); font-size: var(--wp--preset--font-size--small); margin-top: 0.15rem; }

/* support band */
.htm-band {
	background: var(--wp--preset--color--mist);
	padding-top: clamp(3rem, 7vw, 5rem);
	padding-bottom: clamp(3rem, 7vw, 5rem);
}
.htm-band__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem 3rem;
}
.htm-band__inner > * { margin-block-start: 0; }
.htm-band h2 { margin: 0; }
.htm-band p { margin: 0.75rem 0 0; max-width: 56ch; }

/* ---------- Footer ---------- */
.htm-footer {
	background: var(--wp--preset--color--enamel);
	color: #d4dfdb;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.6;
	padding-top: clamp(3rem, 6vw, 4.5rem);
	padding-bottom: 2rem;
	margin-block-start: 0;
}
.htm-footer a { color: var(--wp--preset--color--paper); }
.htm-footer a:hover, .htm-footer a:focus-visible { color: var(--wp--preset--color--brass-pale); }
.htm-footer a:focus-visible { outline-color: var(--wp--preset--color--brass-pale); }
.htm-footer__grid { display: grid; grid-template-columns: 1.7fr 1fr 1.2fr; gap: 2.5rem; }
.htm-footer__grid > * { margin-block-start: 0; min-width: 0; }
.htm-footer__brand { color: var(--wp--preset--color--brass-pale); font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; margin: 0 0 0.6rem; }
.htm-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.htm-footer p { margin: 0 0 0.6rem; }
.htm-footer__base {
	border-top: 1px solid rgba(234, 217, 174, 0.22);
	color: #afc1bc;
	font-size: 0.875rem;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.5rem 2rem;
	margin-top: 3rem;
	padding-top: 1.25rem;
}
.htm-footer__base p { margin: 0; }

/* ---------- Policy, support and data pages ---------- */
.htm-page {
	padding-top: clamp(2.5rem, 6vw, 4.5rem);
	padding-bottom: clamp(4rem, 9vw, 7rem);
}
.htm-meta { color: var(--wp--preset--color--muted); font-size: var(--wp--preset--font-size--small); }
.htm-page .wp-block-post-content h2 {
	border-top: 1px solid var(--wp--preset--color--line);
	font-size: clamp(1.5rem, 1.25rem + 1vw, 1.875rem);
	margin-top: 3rem;
	padding-top: 1.75rem;
}
.htm-page .wp-block-post-content h3 { font-size: 1.1875rem; margin-top: 2rem; }
.htm-page .wp-block-post-content :is(h2, h3) + * { margin-top: 0.75rem; }
.htm-page .wp-block-post-content :is(ul, ol, .wp-block-details) + h2 { border-top: 0; }
.htm-page .wp-block-post-content :is(ul, ol) { padding-left: 1.25rem; }
.htm-page .wp-block-post-content li + li { margin-top: 0.4rem; }
.htm-page .wp-block-post-content li:empty { display: none; }
.htm-toc {
	background: var(--wp--preset--color--mist);
	border-radius: 12px;
	font-size: var(--wp--preset--font-size--small);
	margin-top: 2rem;
	padding: 1.25rem 1.5rem;
}
.htm-toc > * { margin-block-start: 0; }
.htm-toc p { margin: 0 0 0.5rem; font-weight: 600; }
.htm-page .wp-block-post-content .htm-toc ul {
	columns: 2 15rem;
	column-gap: 2rem;
	list-style: none;
	padding: 0;
	margin: 0;
}
.htm-page .wp-block-post-content .htm-toc li { break-inside: avoid; margin: 0 0 0.35rem; }
.htm-address {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 12px;
	padding: 1.25rem 1.5rem;
}
.htm-address > * { margin-block-start: 0; }
.htm-address p { margin: 0 0 0.35rem; }
.htm-address p:last-child { margin-bottom: 0; }

/* the per-game table in the privacy policy */
.htm-page .wp-block-table { margin-top: 1.25rem; overflow-x: auto; }
.htm-page .wp-block-table table { border-collapse: collapse; width: 100%; font-size: var(--wp--preset--font-size--small); background: var(--wp--preset--color--white); }
.htm-page .wp-block-table th, .htm-page .wp-block-table td { border: 1px solid var(--wp--preset--color--line); padding: 0.6rem 0.75rem; text-align: left; vertical-align: top; }
.htm-page .wp-block-table thead th { background: var(--wp--preset--color--mist); font-weight: 600; }
.htm-page .wp-block-table figcaption { color: var(--wp--preset--color--muted); font-size: var(--wp--preset--font-size--small); }

/* FAQ (Details blocks) */
.htm-page .wp-block-details {
	border-bottom: 1px solid var(--wp--preset--color--line);
	margin: 0;
	padding: 0;
}
.htm-page .wp-block-post-content :is(h2, h3, .htm-meta) + .wp-block-details,
.htm-page .wp-block-post-content > .wp-block-details:first-child { border-top: 1px solid var(--wp--preset--color--line); margin-top: 1rem; }
.htm-page .wp-block-details summary {
	cursor: pointer;
	font-weight: 600;
	padding: 1rem 2.5rem 1rem 0;
	position: relative;
	list-style: none;
}
.htm-page .wp-block-details summary::-webkit-details-marker { display: none; }
.htm-page .wp-block-details summary::after {
	content: "";
	position: absolute;
	right: 0.5rem;
	top: 1.35rem;
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
}
.htm-page .wp-block-details[open] summary::after { top: 1.6rem; transform: rotate(-135deg); }
.htm-page .wp-block-details > :not(summary) { margin-top: 0; }
.htm-page .wp-block-details > :last-child { padding-bottom: 1rem; }

/* 404 */
.htm-404 .wp-block-buttons { margin-top: 2rem; }

/* ---------- Narrow screens ---------- */
@media (max-width: 900px) {
	.htm-hero { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
	.htm-split { grid-template-columns: 1fr; }
	.htm-footer__grid { grid-template-columns: 1fr 1fr; }
	.htm-footer__company { grid-column: 1 / -1; }
}
@media (max-width: 781px) {
	.htm-lines > .wp-block-column { padding-left: 0; padding-right: 0; }
	.htm-lines > .wp-block-column + .wp-block-column {
		border-left: 0;
		border-top: 1px solid var(--wp--preset--color--line);
		padding-top: 1.5rem;
		margin-top: 1.5rem;
	}
}
@media (max-width: 560px) {
	.htm-game { grid-template-columns: 1fr; }
	.htm-game__icon { width: 88px; height: 88px; border-radius: 20px; }
	.htm-store { flex: 1 1 100%; }
	.htm-facts > div { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
	.htm-plate::before { inset: 8px; }
	.htm-plate__screw { width: 9px; height: 9px; }
	.htm-plate__screw.--tl { top: 16px; left: 16px; }
	.htm-plate__screw.--tr { top: 16px; right: 16px; }
	.htm-plate__screw.--bl { bottom: 16px; left: 16px; }
	.htm-plate__screw.--br { bottom: 16px; right: 16px; }
}
@media (max-width: 480px) {
	.htm-footer__grid { grid-template-columns: 1fr; }
}

/* ---------- 3.0.0 additions ---------- */
/* a game whose picture is not available (old theme removed and no image set in Appearance → Hải Tình Mơ) */
.htm-game__icon.is-blank {
	display: grid;
	place-items: center;
	background: var(--wp--preset--color--enamel);
	color: var(--wp--preset--color--brass-pale);
	font-size: 1.75rem;
	font-weight: 700;
	letter-spacing: 0.02em;
}
/* the dynamic blocks keep the spacing of the paragraphs they replace */
.htm-split__head .htm-pubtext { margin-top: 0.75rem; max-width: 32ch; }
.htm-lines .htm-pubtext { margin-top: 0.6rem; }
/* an old address (#quack-trek) lands exactly where the new one (#duck-leader) does */
.htm-alias-host { position: relative; }
.htm-alias { position: absolute; top: 0; left: 0; width: 0; height: 0; }
