/* AMLAB base - preflight parity for builder markup, container, buttons, CF7 basics. */

/* Border/box reset for builder markup (mirrors what a CSS preflight would set), so the base
   reset it normally ships is missing. Without it: `w-full`+`px-*`+`border` overflow
   (content-box), and a bare `border` utility draws nothing (default border-style:none,
   width:medium). Re-declaring the four properties a CSS preflight sets makes every
   border/box utility behave as designed. */
*,
::before,
::after {
	box-sizing: border-box;
	border-width: 0;
	border-style: solid;
	border-color: #e5e7eb;
}

/* The `hidden` attribute must beat display utilities. A `.block`/`.flex` utility
   class (author stylesheet) otherwise overrides the UA `[hidden]{display:none}` at
   equal specificity, leaving elements toggled via `el.hidden` still visible
   (e.g. the attendee-group fields in the registration form). */
[hidden] {
	display: none !important;
}

/* Margin reset — zero default block margins inside builder containers so utilities own all
   spacing. Scoped to builder markup (.amlab-container) to avoid collapsing
   Gutenberg prose. `:where(.amlab-container)` keeps specificity at (0,0,1) — like
   a plain element reset — so mt-*/mb-* utilities (0,1,0) still win (previously
   `.amlab-container h3` was (0,1,1) and clobbered utility margins). */
:where(.amlab-container) blockquote,
:where(.amlab-container) dl,
:where(.amlab-container) dd,
:where(.amlab-container) h1,
:where(.amlab-container) h2,
:where(.amlab-container) h3,
:where(.amlab-container) h4,
:where(.amlab-container) h5,
:where(.amlab-container) h6,
:where(.amlab-container) hr,
:where(.amlab-container) figure,
:where(.amlab-container) p,
:where(.amlab-container) pre {
	margin: 0;
}

::selection {
	background: rgba(197, 161, 90, 0.35);
}

/* theme.json emits `.has-text-color{color:text !important}` which, being later
 * in the cascade with equal specificity, overrides `.has-white-color`. Restore
 * white with a higher-specificity !important so white headings/text stay white. */
.has-white-color.has-text-color {
	color: var(--wp--preset--color--white) !important;
}
.has-primary-color.has-text-color {
	color: var(--wp--preset--color--primary) !important;
}

html {
	scroll-behavior: smooth;
}

/* WordPress inserts a 1.5rem gap between top-level blocks
 * (`:where(.wp-site-blocks) > *`). Our sections are full-bleed and manage
 * their own padding, so the gap only leaves a white strip under the sticky
 * header — remove it. */
.wp-site-blocks > * {
	margin-block-start: 0;
	margin-block-end: 0;
}

.amlab-container {
	width: min(100% - 2rem, 1180px);
	margin-inline: auto;
}

/* ===== Buttons ===== */

/* Bản CSS của core (wp-block-library) không được nạp ở front-end, phần đệm nút
   đến từ theme.json — nên thẻ <a> vẫn là display:inline. Đệm dọc của phần tử
   inline được vẽ ra ngoài mà KHÔNG tính vào chiều cao ô .wp-block-button: ô chỉ
   cao bằng một dòng chữ (~23px) trong khi nút vẽ ra 43px. Xếp ngang thì không
   lộ, còn xuống dòng trên điện thoại là hai nút chồng lên nhau. */
.wp-block-button__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-align: center;
}

.is-style-amlab-outline-light .wp-block-button__link {
	background: transparent;
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.6);
	transition: border-color 0.2s ease, background 0.2s ease;
}
.is-style-amlab-outline-light .wp-block-button__link:hover {
	border-color: #fff;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
}
.is-style-amlab-outline-primary .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--primary);
	border: 1px solid var(--wp--preset--color--primary);
	transition: background 0.2s ease, color 0.2s ease;
}
.is-style-amlab-outline-primary .wp-block-button__link:hover {
	background: var(--wp--preset--color--primary);
	color: #fff;
}

/* ===== Menu element (builder [amlab_menu]) ===== */
.amlab-menu__title { margin: 0 0 0.75rem; font-weight: 700; font-size: 0.95rem; }
.amlab-menu__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; font-size: 0.9rem; }
.amlab-menu__link { color: inherit; opacity: 0.85; }
.amlab-menu__link:hover { opacity: 1; text-decoration: underline; }

/* ===== Contact Form 7 ===== */

.amlab-form-wrap { box-shadow: 0 14px 40px rgba(39, 39, 42, 0.08); }

.wpcf7 label {
	display: block;
	font-size: 0.85rem;
	font-weight: 600;
	color: #202940;
	margin-bottom: 1rem;
}

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 select,
.wpcf7 textarea {
	width: 100%;
	margin-top: 0.35rem;
	padding: 0.7rem 0.9rem;
	border: 1px solid #E6EAF0;
	border-radius: 0.6rem;
	background: #F6F3EC;
	font-size: 0.9rem;
	color: #151B2F;
	font-weight: 400;
}

.wpcf7 input:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
	outline: none;
	border-color: #C5A15A;
	background: #fff;
	box-shadow: 0 0 0 3px rgba(197, 161, 90, 0.15);
}

.wpcf7 textarea { min-height: 120px; resize: vertical; }

.wpcf7-checkbox .wpcf7-list-item,
.wpcf7-acceptance {
	display: block;
	font-weight: 400;
	font-size: 0.85rem;
	margin: 0.35rem 0;
}

.wpcf7 .wpcf7-submit {
	background: linear-gradient(135deg, #d4ac62 0%, #C5A15A 60%, #b08d47 100%);
	color: #151C2C;
	font-weight: 700;
	border: none;
	border-radius: 999px;
	padding: 0.8rem 2rem;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(197, 161, 90, 0.25);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
	margin-top: 0.5rem;
}

.wpcf7 .wpcf7-submit:hover {
	box-shadow: 0 0 30px rgba(197, 161, 90, 0.4);
	transform: translateY(-1px);
}

.wpcf7-response-output {
	border-radius: 0.6rem;
	margin: 1rem 0 0;
	padding: 0.8rem 1rem;
	font-size: 0.85rem;
}

.wpcf7 form.sent .wpcf7-response-output { border-color: #4F78A5; color: #202940; }

/* ===== Reduced motion ===== */

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.wp-block-button__link:hover { transform: none; transition: none; }
}
