/*
Theme Name: Thanh Tuyen EDU blog
Description: Block theme for the Thành Tuyên EDU blog at /blog. Header, footer, brand mark, Manrope and the colour tokens mirror the landing in src/app/styles.css and src/app/legal.css, so the blog and the site read as one product.
Author: DMSLab
Version: 1.0.0
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
Text Domain: thanhtuyen
*/

/*
 * theme.json owns the palette, the type scale and the radii. This file owns the
 * page furniture theme.json cannot express: the floating header, the footer
 * grid, the post list and the single-post reading column. Values are copied
 * from the landing so the two surfaces match; the class names are namespaced
 * with tt- so a WordPress admin rule can never leak into the front end.
 */

/* The landing opens with this reset in src/app/styles.css. Without it every
 * element that declares a width together with a border measures 2px larger here
 * than on the landing, which is what separated the two headers. */
*,
*::before,
*::after {
	box-sizing: border-box;
}

:root {
	--tt-green: #39b74e;
	--tt-green-ink: #217d32;
	--tt-green-hover: #185f27;
	--tt-ink: #141416;
	--tt-muted: #535d55;
	--tt-line: #dce7dd;
	--tt-mint: #f2fff4;
	--tt-panel: #f7fbf8;
	--tt-ease: cubic-bezier(.16, 1, .3, 1);
}

html {
	scroll-padding-top: 35px;
}

body {
	margin: 0;
	color: var(--tt-ink);
	background: #fff;
	font-family: Manrope, Arial, sans-serif;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
	outline: 3px solid var(--tt-green-ink);
	outline-offset: 5px;
}

::selection {
	background: var(--tt-mint);
}

/* ---------------------------------------------------------------- header -- */

.tt-header {
	position: sticky;
	top: 16px;
	z-index: 20;
	width: calc(100% - 64px);
	max-width: 1180px;
	height: 68px;
	margin: 16px auto 0;
	padding: 0 22px;
	display: flex;
	align-items: center;
	gap: 30px;
	border-radius: 16px;
	background: #fffffff5;
	box-shadow: 0 8px 30px #1836210d;
	backdrop-filter: saturate(150%) blur(6px);
}

.tt-brand {
	display: inline-flex;
	align-items: center;
	gap: 11px;
	white-space: nowrap;
	font-size: 1.0625rem;
	font-weight: 800;
	letter-spacing: -.03em;
	line-height: 1;
	color: var(--tt-ink);
	text-decoration: none;
}

.tt-brand img {
	width: 38px;
	height: 38px;
	object-fit: contain;
	border-radius: 50%;
}

.tt-brand strong {
	margin-left: 3px;
	color: var(--tt-green-ink);
	font-size: .75em;
	letter-spacing: .015em;
}

.tt-nav {
	display: flex;
	align-items: center;
	gap: 25px;
	margin-left: auto;
	font-size: .875rem;
	font-weight: 600;
}

.tt-nav a {
	color: var(--tt-ink);
	text-decoration: none;
	transition: color .2s;
}

.tt-nav a:hover,
.tt-nav a[aria-current="page"] {
	color: var(--tt-green-ink);
}

.tt-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 15px 24px;
	border: 1px solid transparent;
	border-radius: 100px;
	font-size: .9375rem;
	font-weight: 700;
	line-height: 1.4;
	white-space: nowrap;
	text-decoration: none;
	transition: transform .45s var(--tt-ease), background .3s var(--tt-ease), box-shadow .3s;
}

.tt-button:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 20px #0e110e12;
}

.tt-button:active {
	transform: scale(.97);
}

.tt-button-primary {
	background: var(--tt-green-ink);
	color: #fff;
}

.tt-button-primary:hover {
	background: var(--tt-green-hover);
	color: #fff;
}

.tt-header-cta {
	min-height: 44px;
	padding: 12px 21px;
	font-size: .875rem;
}

.tt-menu-toggle {
	display: none;
	width: 44px;
	height: 44px;
	padding: 12px;
	border: 0;
	background: none;
	cursor: pointer;
}

.tt-menu-toggle span {
	display: block;
	height: 2px;
	margin: 5px 0;
	background: var(--tt-ink);
	transition: transform .2s;
}

.tt-menu-toggle[aria-expanded="true"] span:first-child {
	transform: translateY(3.5px) rotate(45deg);
}

.tt-menu-toggle[aria-expanded="true"] span:last-child {
	transform: translateY(-3.5px) rotate(-45deg);
}

/* ------------------------------------------------------------------ main -- */

.tt-main {
	display: block;
	max-width: 1168px;
	margin: auto;
	padding: 60px 24px 95px;
}

.tt-page-head {
	max-width: 760px;
	margin-bottom: 42px;
}

.tt-eyebrow {
	margin: 0 0 14px;
	color: var(--tt-green-ink);
	font-size: .8125rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.tt-page-head h1 {
	margin: 0 0 16px;
	color: var(--tt-ink);
	font-size: clamp(2rem, 4.6vw, 3.4rem);
	font-weight: 600;
	letter-spacing: -.04em;
	line-height: 1.12;
}

.tt-lede {
	margin: 0;
	max-width: 620px;
	color: var(--tt-muted);
	font-size: 1.0625rem;
	line-height: 1.8;
}

/* ------------------------------------------------------------- post list -- */

.tt-post-list {
	display: grid;
	gap: 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tt-post-card {
	display: grid;
	gap: 18px;
	padding: 34px 36px;
	border: 1px solid var(--tt-line);
	border-radius: 28px;
	background: #fff;
	transition: border-color .3s var(--tt-ease), transform .45s var(--tt-ease);
}

.tt-post-card:hover {
	border-color: #bfdcc6;
	transform: translateY(-3px);
}

.tt-post-card__media {
	display: block;
	margin: 0;
	overflow: hidden;
	border-radius: 20px;
	background: var(--tt-panel);
	/* The template sets a 21:9 crop; the cap stops a wide card from turning the
	 * first article into a full-screen image on a large monitor. */
	max-height: 420px;
}

.tt-post-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.tt-meta {
	margin: 0;
	color: var(--tt-muted);
	font-size: .8125rem;
	font-weight: 600;
	letter-spacing: 0;
}

.tt-post-card__title {
	margin: 0;
	font-size: clamp(1.5rem, 3vw, 2.1rem);
	font-weight: 700;
	letter-spacing: -.038em;
	line-height: 1.2;
}

.tt-post-card__title a {
	color: var(--tt-ink);
	text-decoration: none;
}

.tt-post-card__title a:hover {
	color: var(--tt-green-ink);
}

.tt-excerpt {
	margin: 0;
	max-width: 68ch;
	color: var(--tt-muted);
	font-size: 1rem;
	line-height: 1.75;
}

.tt-excerpt p {
	margin: 0;
}

.tt-pagination {
	margin-top: 44px;
	font-size: .875rem;
	font-weight: 700;
}

.tt-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	margin-right: 6px;
	border: 1px solid var(--tt-line);
	border-radius: 100px;
	color: var(--tt-ink);
	text-decoration: none;
}

.tt-pagination .page-numbers.current {
	border-color: var(--tt-green-ink);
	background: var(--tt-mint);
	color: var(--tt-green-ink);
}

/* ---------------------------------------------------------------- single -- */

.tt-back {
	margin-bottom: 30px;
	font-size: .875rem;
	font-weight: 700;
}

.tt-back a {
	color: var(--tt-green-ink);
	text-decoration: none;
}

.tt-single-media {
	margin: 0 0 34px;
	overflow: hidden;
	border-radius: 20px;
}

.tt-single-media img {
	display: block;
	width: 100%;
	height: auto;
}

.tt-entry {
	max-width: 68ch;
	font-size: 1.0625rem;
	line-height: 1.85;
}

.tt-entry > * + * {
	margin-top: 1.35rem;
}

.tt-entry h2,
.tt-entry h3 {
	margin-top: 2.4rem;
}

.tt-entry img,
.tt-entry video,
.tt-entry iframe {
	max-width: 100%;
	height: auto;
	border-radius: 20px;
}

.tt-entry ul,
.tt-entry ol {
	padding-left: 1.35rem;
}

.tt-entry li + li {
	margin-top: .5rem;
}

.tt-entry blockquote {
	margin-inline: 0;
	padding-left: 20px;
	border-left: 3px solid var(--tt-green-ink);
	color: var(--tt-muted);
}

.tt-entry table {
	width: 100%;
	border-collapse: collapse;
	font-size: .9375rem;
}

.tt-entry th,
.tt-entry td {
	padding: 10px 12px;
	border: 1px solid var(--tt-line);
	text-align: left;
}

.tt-entry :not(pre) > code {
	padding: 2px 6px;
	border-radius: 6px;
	background: var(--tt-panel);
	font-size: .875em;
}

.tt-entry pre {
	overflow-x: auto;
	padding: 16px 18px;
	border-radius: 12px;
	background: var(--tt-panel);
}

.tt-terms {
	margin-top: 38px;
	color: var(--tt-muted);
	font-size: .8125rem;
}

.tt-post-nav {
	display: flex;
	justify-content: space-between;
	gap: 20px;
	margin-top: 42px;
	padding-top: 24px;
	border-top: 1px solid var(--tt-line);
	font-size: .875rem;
	font-weight: 700;
}

.tt-e404 {
	display: grid;
	gap: 22px;
	max-width: 620px;
}

/* ---------------------------------------------------------------- footer -- */

.tt-footer {
	max-width: 1240px;
	margin: auto;
	padding: 0 36px 40px;
	font-size: .8125rem;
	color: var(--tt-muted);
}

.tt-footer-columns {
	display: grid;
	grid-template-columns: 1.2fr 1fr 1fr;
	gap: 30px;
	padding-top: 35px;
	border-top: 1px solid var(--tt-line);
}

.tt-footer a {
	color: var(--tt-muted);
}

.tt-footer-company .tt-brand {
	margin-bottom: 16px;
	color: var(--tt-ink);
	font-size: 1rem;
}

.tt-footer-company p {
	max-width: 300px;
	margin: 0 0 15px;
}

.tt-footer-legal-name {
	margin: 20px 0 12px;
	color: var(--tt-ink);
	font-size: .875rem;
	font-weight: 700;
	letter-spacing: 0;
	line-height: 1.6;
}

.tt-footer-column h2 {
	margin: 0 0 15px;
	color: var(--tt-ink);
	font-size: .875rem;
	font-weight: 700;
	letter-spacing: 0;
	line-height: 1.4;
}

.tt-footer-column nav {
	display: flex;
	flex-direction: column;
	gap: 9px;
}

.tt-footer-column a {
	font-size: .8125rem;
	text-decoration: underline;
	text-underline-offset: 4px;
	overflow-wrap: anywhere;
}

.tt-footer-column p {
	margin: 0 0 9px;
	max-width: none;
}

.tt-footer-bottom {
	display: flex;
	justify-content: space-between;
	gap: 20px;
	flex-wrap: wrap;
	margin-top: 30px;
	padding-top: 20px;
	border-top: 1px solid var(--tt-line);
}

.tt-footer-social {
	display: flex;
	align-items: center;
	gap: 10px;
}

.tt-footer-social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	flex-shrink: 0;
	border: 1px solid var(--tt-line);
	border-radius: 50%;
	background: #fff;
	color: var(--tt-green-ink);
	text-decoration: none;
	transition: background .2s, border-color .2s;
}

.tt-footer-social a:hover {
	border-color: var(--tt-green-ink);
	background: var(--tt-mint);
}

.tt-footer-social a:focus-visible {
	outline: 3px solid var(--tt-green-ink);
	outline-offset: 4px;
}

.tt-footer-social svg {
	display: block;
	width: 22px;
	height: 22px;
	fill: currentColor;
}

.tt-site-credit {
	width: 100%;
	margin: 18px 0 0;
	color: var(--tt-muted);
	font-size: .8125rem;
	line-height: 1.6;
	text-align: center;
}

.tt-site-credit a {
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ------------------------------------------------------------ responsive -- */

@media (max-width: 1023px) {
	.tt-header {
		width: calc(100% - 36px);
		padding: 0 18px;
	}

	.tt-brand {
		gap: 7px;
		font-size: .9375rem;
	}

	/* Without JavaScript every destination stays visible: the row scrolls. */
	.tt-js .tt-nav {
		display: none;
	}

	.tt-js .tt-nav.is-open {
		display: flex;
	}

	.tt-js .tt-nav {
		position: absolute;
		top: 76px;
		left: 0;
		right: 0;
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
		padding: 18px 22px;
		border-radius: 16px;
		background: #fff;
		box-shadow: 0 20px 25px #1741210d;
	}

	.tt-js .tt-nav a {
		padding: 8px 0;
		font-size: 1rem;
	}

	.tt-header-cta {
		margin-left: auto;
	}

	.tt-js .tt-menu-toggle {
		display: block;
	}

	.tt-post-card {
		padding: 28px 24px;
	}

	.tt-footer-columns {
		grid-template-columns: 1fr 1fr;
	}
}

@media (max-width: 767px) {
	.tt-header {
		top: 10px;
		width: calc(100% - 24px);
		height: 62px;
		margin: 10px auto 0;
		padding: 0 12px;
		gap: 8px;
		border-radius: 14px;
	}

	.tt-brand {
		gap: 6px;
		font-size: .875rem;
	}

	.tt-brand img {
		width: 32px;
		height: 32px;
	}

	.tt-header-cta {
		min-height: 40px;
		padding: 10px 13px;
		font-size: .75rem;
	}

	.tt-js .tt-nav {
		top: 68px;
	}

	.tt-main {
		padding: 42px 20px 70px;
	}

	.tt-post-card {
		padding: 24px 20px;
	}

	.tt-page-head h1,
	.tt-post-card__title {
		font-weight: 700;
	}

	.tt-entry {
		font-size: 1rem;
	}

	.tt-post-nav {
		flex-direction: column;
		gap: 12px;
	}

	.tt-footer {
		padding: 0 24px 32px;
	}

	.tt-footer-columns {
		grid-template-columns: 1fr;
		gap: 28px;
	}

	.tt-footer-company p {
		max-width: none;
	}

	.tt-footer-column h2 {
		font-size: 1rem;
		margin-bottom: 12px;
	}

	.tt-footer-column a {
		font-size: .875rem;
	}

	.tt-footer-bottom {
		gap: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		transition-duration: .001ms !important;
		animation-duration: .001ms !important;
		animation-iteration-count: 1 !important;
	}

	.tt-button:hover,
	.tt-post-card:hover {
		transform: none;
	}
}
