/* ============================================================
   TRANG LIÊN HỆ — "Hộp Thư Của Toán" (watercolor Nhật Ký Xanh)
   Template : templates/page-contact.php
   Enqueue  : inc/enqueue.php §4b (chỉ load trên template này)
   Kích thước/khoảng cách đo theo mockup (content 1140px):
   hero 42/52%, hàng card 1.5:1:2.1 gap 18, FAQ 4 cột compact.
   ============================================================ */

:root {
	--blt-ct-green:        #4caf50;
	--blt-ct-green-dark:   #388e3c;
	--blt-ct-heading:      #3a7c46;
	--blt-ct-green-deep:   #2e5d33;
	--blt-ct-green-pale:   #e8f5e9;
	--blt-ct-bg:           #f9fbf8;
	--blt-ct-card:         #ffffff;
	--blt-ct-border:       rgba(76, 175, 80, 0.12);
	--blt-ct-border-md:    rgba(76, 175, 80, 0.25);
	--blt-ct-shadow:       0 12px 40px rgba(0, 0, 0, 0.05);
	--blt-ct-text:         #3d4a3e;
	--blt-ct-muted:        #74836f;
	--blt-ct-radius:       16px;
	--blt-ct-font-title:   'Petit Formal Script', 'Segoe Script', cursive;
	--blt-ct-font-serif:   'Cormorant Garamond', Georgia, serif;
	--blt-ct-font-body:    'Nunito Sans', 'Nunito', var(--font-primary), sans-serif;
	--blt-ct-font-script:  'Petit Formal Script', 'Segoe Script', cursive;
}

/* ── Khung trang + nền watercolor ─── */
.blt-contact {
	position: relative;
	background: var(--blt-ct-bg);
	font-family: var(--blt-ct-font-body);
	color: var(--blt-ct-text);
	overflow: hidden;
	isolation: isolate;
}
/* Ảnh gốc PNG có vùng alpha trong suốt phía trên — hiển thị nguyên
   tỉ lệ 1536×1024 (66.67vw), phần fade tự tan vào nền trang */
.blt-contact::after {
	content: '';
	position: absolute;
	left: 0; right: 0; bottom: 0;
	height: min(66.67vw, 1024px);
	background: url('../images/contact/landscape.png') no-repeat bottom center / 100% auto;
	pointer-events: none;
	z-index: -1;
}

.blt-contact .glt-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.blt-contact__container {
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 20px;
}

/* ══════════════════════════════════════════
   HERO — minh họa là lớp nền watercolor nằm dưới (z-index -1),
   text nổi lên trên và có thể đè lên ảnh. Chiều cao hero do text
   quyết định → ảnh không chiếm thêm diện tích dọc.
══════════════════════════════════════════ */
.blt-contact-hero {
	position: relative;
	max-width: 1140px;
	margin: 0 auto;
	padding: 52px 0 40px;
	min-height: 340px;
	display: flex;
	align-items: center;
	gap: 30px;
}
.blt-contact-hero__avatar {
	position: relative;
	z-index: 1;
	width: 200px;
	height: 200px;
	flex-shrink: 0;
	border-radius: 50%;
	object-fit: cover;
	border: 4px solid #fff;
	box-shadow: 0 6px 23px rgb(129, 161, 92)
}
.blt-contact-hero__content {
	position: relative;
	z-index: 1;
	max-width: 540px;
	display: flex;
	flex-direction: column;
}
.blt-contact-hero__signature {
	font-family: 'Dancing Script', cursive;
	font-size: 1.7rem;
	font-weight: 600;
	color: #4f6b3f;
	align-self: flex-start;
	margin-top: 14px;
	position: absolute;
    bottom: -30px;
    right: -70px;
}

.blt-contact-hero__badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	width: fit-content;
	background: var(--blt-ct-green-pale);
	color: var(--blt-ct-green-dark);
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	padding: 6px 16px;
	border-radius: 9999px;
	border: 1px solid var(--blt-ct-border-md);
	margin-bottom: 14px;
}
.blt-contact-hero__badge svg {
	width: 15px;
	height: 15px;
}

/* Font khớp <em>Toán</em> trang Về Tôi: Playfair Display italic 600.
   (blog.css không load trên trang này nên ghi stack trực tiếp, không dùng var --blog-font-heading) */
.blt-contact-hero__title {
	font-family: 'Playfair Display', 'Merriweather', Georgia, serif;
	font-style: italic;
	font-size: clamp(2rem, 3.4vw, 2.9rem);
	font-weight: 600;
	line-height: 1.26;
	color: var(--blt-ct-heading);
	margin: 0 0 16px;
}
.blt-contact-hero__title .blt-contact-hero__leaf {
	display: inline-block;
	width: auto;
	height: 1.15em;
	vertical-align: -0.22em;
	margin-left: 10px;
	object-fit: contain;
	transform: scaleX(-1);
}

.blt-contact-hero__desc {
	font-size: 0.9rem;
	line-height: 1.8;
	color: var(--blt-ct-muted);
	margin: 0;
}

/* Lớp minh họa: tuyệt đối, bám mép phải, nằm DƯỚI nội dung (z-index -1).
   Mask fade mép trái để ảnh tan mềm vào nền, chỗ chồng lên text không bị cắt cứng. */
.blt-contact-hero__art {
	position: absolute;
	top: 53%;
	right: -20px;
	transform: translateY(-50%);
	width: min(660px, 56%);
	z-index: -1;
	opacity: 0.92;
	pointer-events: none;
	-webkit-mask-image: linear-gradient(to right, transparent 0, #000 24%);
	        mask-image: linear-gradient(to right, transparent 0, #000 24%);
}
.blt-contact-hero__art picture { display: block; }
.blt-contact-hero__art img {
	width: 100%;
	height: auto;
	display: block;
}

/* ══════════════════════════════════════════
   BỐ CỤC CARD — 2 cột: Kết nối (trái) + Form (phải rộng)
══════════════════════════════════════════ */
.blt-contact-cards {
	display: grid;
	grid-template-columns: 1fr 1.75fr;
	gap: 18px;
	align-items: stretch;
}

.blt-contact-card {
	display: flex;
	flex-direction: column;
	background: var(--blt-ct-card);
	border: 1px solid var(--blt-ct-border);
	border-radius: var(--blt-ct-radius);
	box-shadow: var(--blt-ct-shadow);
	padding: 20px 20px 22px;
}

.blt-contact-card__title {
	display: flex;
	align-items: center;
	gap: 9px;
	font-family: var(--blt-ct-font-serif);
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--blt-ct-heading);
	margin: 0 0 14px;
	position: relative;
    padding-left: 28px;
}
.blt-contact-card__title svg {
	width: 19px;
	height: 19px;
	color: var(--blt-ct-green);
	flex-shrink: 0;
	position: absolute;
    left: 0;
}
.blt-contact-card__title .blt-contact-card__logo {
	width: auto;
    height: 42px;
    flex-shrink: 0;
    object-fit: contain;
    left: 0;
    top: -15px;
    position: absolute;
    transform: rotate(10deg);
}
.blt-contact-card__title .blt-contact-card__ico {
	width: 26px;
	height: 26px;
	flex-shrink: 0;
	object-fit: contain;
	position: absolute;
	left: 0;
}

/* ── Card: Kết nối với Toán ─── */
.blt-connect__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 3px;
}
.blt-connect { padding-left: 16px; padding-right: 16px; }

.blt-connect__item a,
.blt-connect__item span {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 5px 4px;
	border-radius: 9px;
	font-size: 0.9rem;
	color: var(--blt-ct-text);
	text-decoration: none;
	word-break: break-word;
	overflow-wrap: anywhere;
	transition: background 0.2s, color 0.2s;
}
.blt-connect__item a:hover {
	background: var(--blt-ct-green-pale);
	color: var(--blt-ct-green-dark);
}
.blt-connect__item svg {
	width: 16px;
	height: 16px;
	color: var(--blt-ct-green);
	flex-shrink: 0;
}
.blt-connect__note {
	font-family: 'Dancing Script', cursive	;
	font-size: 1.4rem;
	color: var(--blt-ct-green-dark);
	text-align: center;
	line-height: 1.7;
	margin: auto 0 0;
	padding-top: 14px;
}
.blt-connect__heart {
	display: block;
	width: 34px;
	height: 18px;
	margin: 6px auto 0;
	color: var(--blt-ct-green);
	opacity: 0.75;
}

/* ── Card: Form ─── */
.blt-contact-form-card .blt-contact-card__sub {
	font-size: 0.88rem;
	color: var(--blt-ct-muted);
	margin: -6px 0 14px;
}

.blt-contact-form .blt-form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}
.blt-contact-form .blt-field {
	margin-bottom: 10px;
}
.blt-contact-form label {
	display: block;
	font-size: 0.84rem;
	font-weight: 700;
	color: var(--blt-ct-text);
	margin-bottom: 6px;
}
.blt-contact-form .blt-field__req {
	color: #e57373;
}
.blt-contact-form input,
.blt-contact-form textarea {
	width: 100%;
	font-family: inherit;
	font-size: 0.9rem;
	color: var(--blt-ct-text);
	background: #fdfefd;
	border: 1px solid var(--blt-ct-border-md);
	border-radius: 9px;
	padding: 9px 12px;
	transition: border-color 0.2s, box-shadow 0.2s;
}
.blt-contact-form input::placeholder,
.blt-contact-form textarea::placeholder {
	color: #a9b5a5;
}
.blt-contact-form input:focus,
.blt-contact-form textarea:focus {
	outline: none;
	border-color: var(--blt-ct-green);
	box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.14);
}
.blt-contact-form textarea {
	resize: vertical;
	min-height: 88px;
}

.blt-contact-form__submit {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--blt-ct-green-dark);
	color: #fff;
	font-family: inherit;
	font-size: 0.92rem;
	font-weight: 700;
	border: none;
	border-radius: 9px;
	padding: 10px 20px;
	width: fit-content;
	cursor: pointer;
	transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.blt-contact-form__submit svg {
	width: 16px;
	height: 16px;
}
.blt-contact-form__submit:hover {
	background: var(--blt-ct-green-deep);
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(56, 142, 60, 0.3);
}

/* ══════════════════════════════════════════
   OVERLAY "ĐANG GỬI" — phủ mờ form card khi bấm submit,
   chặn mọi thao tác + hoạt ảnh máy bay đưa thư đang bay (loading)
══════════════════════════════════════════ */
.blt-contact-form-card {
	position: relative;
}
.blt-contact-sending {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	border-radius: inherit;
	background: rgba(249, 251, 248, 0.72);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}
.blt-contact-form-card.blt-is-sending .blt-contact-sending {
	opacity: 1;
	visibility: visible;
}

.blt-contact-sending__scene {
	position: relative;
	width: 220px;
	height: 120px;
}
.blt-contact-sending__trail {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	color: var(--blt-ct-green);
	opacity: 0.5;
}
.blt-contact-sending__trail path {
	stroke-dasharray: 4 8;
	animation: blt-ct-trail 1s linear infinite;
}
@keyframes blt-ct-trail {
	to { stroke-dashoffset: -12; }
}
/* Máy bay bay đúng theo quỹ đạo lượn sóng của vệt trail (offset-path px trùng
   toạ độ path SVG trong khung scene 220×120). offset-rotate:0 → giữ nguyên
   hướng mũi máy bay watercolor (chếch lên-phải), chỉ trượt dọc đường bay. */
.blt-contact-sending__plane {
	position: absolute;
	top: 0;
	left: 0;
	width: 62px;
	height: auto;
	offset-path: path('M12 108 C55 108 62 25 100 20 S158 55 175 42 S200 15 210 10');
	offset-rotate: 0deg;
	animation: blt-ct-fly 2.8s ease-in-out infinite;
}
@keyframes blt-ct-fly {
	0%   { offset-distance: 0%;   opacity: 0; }
	12%  { opacity: 1; }
	88%  { opacity: 1; }
	100% { offset-distance: 100%; opacity: 0; }
}
.blt-contact-sending__text {
	margin: 0;
	font-family: var(--blt-ct-font-serif);
	font-size: 1.15rem;
	font-weight: 600;
	color: var(--blt-ct-green-deep);
	letter-spacing: 0.3px;
	text-align: center;
	animation: blt-ct-pulse 1.6s ease-in-out infinite;
}
@keyframes blt-ct-pulse {
	0%, 100% { opacity: 0.55; }
	50%      { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
	.blt-contact-sending__plane,
	.blt-contact-sending__trail path,
	.blt-contact-sending__text {
		animation: none;
	}
	.blt-contact-sending__plane {
		opacity: 1;
		offset-distance: 55%;
	}
}

/* Thông báo kết quả gửi */
.blt-contact-notice {
	border-radius: 9px;
	padding: 11px 15px;
	font-size: 0.9rem;
	font-weight: 600;
	margin-bottom: 14px;
	max-height: 200px;
	transition: opacity 0.5s ease, transform 0.5s ease, margin 0.5s ease,
		max-height 0.5s ease, padding 0.5s ease;
}
/* Tự ẩn mượt sau vài giây (JS thêm class) */
.blt-contact-notice--hide {
	opacity: 0;
	transform: translateY(-6px);
	max-height: 0;
	margin-bottom: 0;
	padding-top: 0;
	padding-bottom: 0;
	overflow: hidden;
	pointer-events: none;
}
.blt-contact-notice--success {
	background: var(--blt-ct-green-pale);
	color: var(--blt-ct-green-deep);
	border: 1px solid var(--blt-ct-border-md);
}
.blt-contact-notice--error {
	background: #fdecea;
	color: #b3443c;
	border: 1px solid rgba(229, 115, 115, 0.35);
}

/* ══════════════════════════════════════════
   FAQ — compact như mockup
══════════════════════════════════════════ */
.blt-contact-faq {
	margin-top: 28px;
}
.blt-contact-faq__heading {
	display: flex;
	align-items: center;
	gap: 9px;
	font-family: var(--blt-ct-font-serif);
	font-size: 1.5rem;
	font-weight: 600;
	color: var(--blt-ct-heading);
	margin: 0 0 12px;
}
.blt-contact-faq__heading svg {
	width: 28px;
	height: 13px;
	color: var(--blt-ct-green);
	flex-shrink: 0;
}
.blt-contact-faq__heading svg:first-child {
	transform: scaleX(-1);
}

.blt-contact-faq__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px;
	align-items: start; /* mỗi ô cao theo nội dung → đóng lại thì co gọn đúng */
}

.blt-faq-item {
	background: var(--blt-ct-card);
	border: 1px solid var(--blt-ct-border);
	border-radius: 13px;
	box-shadow: var(--blt-ct-shadow);
	padding: 0;
}
.blt-faq-item summary {
	display: flex;
	align-items: center;
	gap: 10px;
	list-style: none;
	cursor: pointer;
	padding: 12px;
	font-size: 0.85rem;
	font-weight: 800;
	line-height: 1.4;
	color: var(--blt-ct-text);
	/* Cố định vùng tiêu đề → card đóng luôn bằng nhau dù title 1 hay 2 dòng */
	min-height: 64px;
	box-sizing: border-box;
}
.blt-faq-item summary::-webkit-details-marker { display: none; }
.blt-faq-item__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	flex-shrink: 0;
	border-radius: 50%;
	background: var(--blt-ct-green-pale);
	color: var(--blt-ct-green-dark);
}
.blt-faq-item__icon svg {
	width: 16px;
	height: 16px;
}
.blt-faq-item__icon img {
	width: 26px;
	height: 26px;
	object-fit: contain;
}
.blt-faq-item__chevron {
	margin-left: auto;
	flex-shrink: 0;
	width: 15px;
	height: 15px;
	color: var(--blt-ct-muted);
	transition: transform 0.25s;
}
.blt-faq-item__chevron svg {
	width: 100%;
	height: 100%;
}
.blt-faq-item[open] .blt-faq-item__chevron {
	transform: rotate(180deg);
}
.blt-faq-item__answer {
	font-size: 0.82rem;
	line-height: 1.6;
	color: var(--blt-ct-muted);
	padding: 0 12px 12px;
	margin: 0;
}
/* Desktop (4 card ngang): cố định chiều cao vùng trả lời → card mở bằng nhau.
   Tablet/mobile card xếp dọc nên để tự nhiên, không ép chiều cao thừa. */
@media (min-width: 769px) {
	.blt-faq-item[open] .blt-faq-item__answer {
		min-height: 6.5em;
	}
}

/* ══════════════════════════════════════════
   QUOTE KẾT TRANG — dấu ❝ ❞ hai bên như mockup
══════════════════════════════════════════ */
.blt-contact-quote {
	text-align: center;
	padding: 54px 20px 140px;
}
.blt-contact-quote__inner {
	position: relative;
	display: inline-block;
	max-width: 900px;
	padding: 0 24px;
}
.blt-contact-quote__mark {
	position: absolute;
	font-size: 2.6rem;
	line-height: 1;
	color: #7f9d5c;
	opacity: 0.8;
}
.blt-contact-quote__mark--open  { left: 70px;  top: 2px; }
.blt-contact-quote__mark--close { right: 0; bottom: -4px; }
.blt-contact-quote__text {
	font-family: 'Dancing Script', cursive;
	font-size: clamp(1.35rem, 1.9vw, 1.65rem);
	font-weight: 400;
	line-height: 1.9;
	color: var(--blt-ct-heading);
	margin: 0;
}
.blt-contact-quote__heart {
	display: block;
	width: 48px;
	height: auto;
	margin: 4px auto 0;
	opacity: 1;
}

/* ══════════════════════════════════════════
   RESPONSIVE — Tablet ≤768px
══════════════════════════════════════════ */
@media (max-width: 768px) {
	.blt-contact-hero {
		flex-direction: column;
		text-align: center;
		padding: 40px 0 28px;
		min-height: 0;
		justify-content: center;
		gap: 16px;
	}
	.blt-contact-hero__content {
		max-width: 100%;
		margin: 0 auto;
		align-items: center;
	}
	.blt-contact-hero__badge { margin: 0 auto 16px; }
	.blt-contact-hero__desc { margin: 0 auto; }
	/* Chữ ký về luồng thường, căn giữa dưới mô tả (bỏ absolute của desktop) */
	.blt-contact-hero__signature {
		position: static;
		align-self: center;
		right: auto;
		bottom: auto;
		margin-top: 10px;
	}
	/* Ảnh watercolor thành điểm nhấn góc phải trên, bleed nhẹ ra mép,
	   fade mềm về giữa — nhìn thấy rõ nhưng không đè chữ (z-index -1, sau avatar) */
	.blt-contact-hero__art {
		top: -16px;
		right: -8%;
		bottom: auto;
		transform: none;
		width: min(300px, 60%);
		opacity: 0.5;
		-webkit-mask-image: linear-gradient(to bottom left, #000 34%, transparent 82%);
		        mask-image: linear-gradient(to bottom left, #000 34%, transparent 82%);
	}

	/* Tablet: Kết nối + Form xuống 1 cột dọc */
	.blt-contact-cards {
		grid-template-columns: 1fr;
	}

	.blt-contact-faq__grid {
		grid-template-columns: 1fr 1fr;
	}
}

/* ══════════════════════════════════════════
   RESPONSIVE — Mobile ≤560px
══════════════════════════════════════════ */
@media (max-width: 560px) {
	.blt-contact-cards,
	.blt-contact-faq__grid {
		grid-template-columns: 1fr;
	}
	.blt-contact-card { padding: 20px 16px 22px; }

	.blt-contact-form .blt-form-row {
		grid-template-columns: 1fr;
		gap: 0;
	}
	.blt-contact-form__submit {
		width: 100%;
		justify-content: center;
	}

	.blt-contact-hero__avatar { width: 104px; height: 104px; }

	.blt-contact-quote { padding: 48px 16px 120px; }
	.blt-contact-quote__inner { padding: 0 30px; }
	.blt-contact-quote__mark { font-size: 2rem; }
}
