/**
 * Trang Contact.
 *
 * Bố cục 2 cột: cột chữ (các khối "tiêu đề có 2 đường kẻ" + nội dung + nút) và
 * cột ảnh. Dưới 1000px xếp thành 1 cột, chữ trước ảnh sau.
 *
 * Font và cỡ chữ kế thừa từ Blocksy (không đặt font-family riêng) nên đổi
 * Typography trong Customizer là trang này đổi theo.
 */

.bch-contact {
	/* Màu lấy đúng theo bản thiết kế; đổi ở đây là đổi cả trang. */
	--ct-heading:   #555;
	--ct-rule:      #eee;
	--ct-link:      #3274c0;
	--ct-btn-bg:    #a00;
	--ct-btn-hover: #8a0000;

	--ct-ink:       var(--theme-text-color, #131117);
	--ct-ease:      cubic-bezier(.16, 1, .3, 1);

	/* Blocksy bọc nội dung trong .entry-content.is-layout-constrained -> con
	   trực tiếp có thể bị bó lại theo bề ngang của block. Phần này cần trải
	   hết bề ngang container như trong thiết kế. */
	max-width: none;
	margin-block: 0;
}

/* ==========================================================================
   LƯỚI 2 CỘT
   ========================================================================== */
.bch-contact__grid {
	display: grid;
	gap: clamp(1.75rem, 3.5vw, 2.75rem);
	align-items: start;
}

/* 1000px = ngưỡng desktop của Blocksy -> đổi cột cùng lúc với header/sidebar. */
@media (min-width: 62.5rem) {

	.bch-contact__grid {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	}

	/* Đảo cột bằng order, giữ nguyên thứ tự trong HTML: đọc màn hình và tab
	   bàn phím vẫn đi qua phần chữ trước. */
	.bch-contact--media-left .bch-contact__body  { order: 2; }
	.bch-contact--media-left .bch-contact__media { order: 1; }
}

/* ==========================================================================
   TIÊU ĐỀ CÓ 2 ĐƯỜNG KẺ
   ========================================================================== */
.bch-contact__heading {
	display: flex;
	align-items: center;
	gap: clamp(.75rem, 2vw, 1.5rem);
	margin: 0 0 clamp(1.25rem, 2.5vw, 1.75rem);
}

.bch-contact__heading::before,
.bch-contact__heading::after {
	content: "";
	flex: 1 1 0;
	block-size: 1px;
	background: var(--ct-rule);
}

.bch-contact__heading-text {
	margin: 0;
	font-size: clamp(1rem, .95rem + .25vw, 1.125rem);
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: .02em;
	text-align: center;
	text-transform: uppercase;
	text-wrap: balance;
	color: var(--ct-heading);
}

/* ==========================================================================
   KHỐI NỘI DUNG
   ========================================================================== */
.bch-contact__block + .bch-contact__block {
	margin-block-start: clamp(1.75rem, 3.5vw, 2.5rem);
}

.bch-contact__rte {
	color: var(--ct-ink);
	line-height: 1.65;
}

.bch-contact__rte > :first-child { margin-block-start: 0; }
.bch-contact__rte > :last-child  { margin-block-end: 0; }

.bch-contact__rte p { margin-block: 0 1em; }

.bch-contact__rte :where(ul, ol) {
	margin-block: 1em;
	padding-inline-start: 1.5em;
}

.bch-contact__rte ul { list-style: disc; }
.bch-contact__rte ol { list-style: decimal; }
.bch-contact__rte li + li { margin-block-start: .5em; }

.bch-contact__rte a {
	color: var(--ct-link);
	font-weight: 700;
	text-decoration: none;
	overflow-wrap: anywhere; /* email dài không làm tràn ngang trên điện thoại */
}

.bch-contact__rte a:hover,
.bch-contact__rte a:focus-visible { text-decoration: underline; }

.bch-contact__rte :where(h2, h3, h4) {
	line-height: 1.3;
	color: var(--ct-ink);
}

.bch-contact__rte img {
	max-inline-size: 100%;
	block-size: auto;
}

/* ==========================================================================
   DÃY NÚT
   ========================================================================== */
.bch-contact__actions {
	display: flex;
	flex-wrap: wrap;
	gap: .75rem 1.5rem;
	margin-block-start: clamp(1.25rem, 2.5vw, 1.75rem);
}

.bch-contact__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-block-size: 38px;
	padding: .5rem 1.5rem;
	border-radius: 3px;
	background: var(--ct-btn-bg);
	color: #fff;
	font-size: .875rem;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: .03em;
	text-align: center;
	text-transform: uppercase;
	text-decoration: none;
	transition: background-color .2s var(--ct-ease), transform .2s var(--ct-ease);
}

.bch-contact__btn:hover,
.bch-contact__btn:focus {
	background: var(--ct-btn-hover);
	color: #fff;
	text-decoration: none;
}

.bch-contact__btn:hover { transform: translateY(-1px); }

.bch-contact__btn:focus-visible {
	outline: 3px solid var(--ct-btn-bg);
	outline-offset: 2px;
}

/* ==========================================================================
   ẢNH
   ========================================================================== */
.bch-contact__media {
	margin: 0;
	min-inline-size: 0;
}

.bch-contact__media img {
	display: block;
	inline-size: 100%;
	block-size: auto;
}

/* Ô ảnh mẫu: giữ đúng khung 600×400 kể cả khi cột hẹp hơn. */
.bch-contact__placeholder {
	aspect-ratio: 3 / 2;
	object-fit: cover;
	background: #eee;
}

/* ==========================================================================
   BIỂU MẪU
   ========================================================================== */
.bch-contact__form {
	margin-block-start: clamp(2rem, 4vw, 3rem);
}

.bch-contact__form .wpforms-container { margin-block: 0; }

@media (prefers-reduced-motion: reduce) {

	.bch-contact__btn { transition: none; }
	.bch-contact__btn:hover { transform: none; }
}
