/* ============================================================
   Contact + Advertise forms — Tech Edition
   ============================================================ */

/* ---------- Page wrapper ---------- */

.te-form-page {
	padding: var(--space-7) var(--gutter) var(--space-8);
}

/* Hide the article-style mini-header on these specific page templates —
   it carries share/bookmark/subscribe actions that don't apply on a form page,
   and removes the duplicate SUBSCRIBE button. */
body.page-template-page-contact .mini-header,
body.page-template-page-advertise .mini-header {
	display: none;
}

/* ---------- Single-column wrap (legacy / shortcode use) ---------- */

.te-form-wrap {
	max-width: 720px;
	margin: 0 auto;
}

/* ---------- Two-column split layout (PCMag / Mashable / Forbes pattern) ---------- */

.te-form-page--split {
	padding-top: var(--space-7);
	padding-bottom: var(--space-8);
}

.te-form-page--split .te-form-page__inner {
	max-width: var(--container-max);
	margin: 0 auto;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
	gap: var(--space-8);
	align-items: start;
}

.te-form-page--split .te-form-wrap {
	max-width: none;
	margin: 0;
}

/* Left intro column */

.te-form-intro {
	padding-right: var(--space-5);
	position: sticky;
	top: var(--space-6);
	font-family: var(--font-body);
}

.te-form-intro__title {
	font-family: var(--font-display);
	font-size: var(--text-7xl);
	font-weight: 600;
	letter-spacing: -1px;
	line-height: 1.05;
	color: var(--ink);
	margin: var(--space-3) 0 var(--space-4);
}

.te-form-intro__dek {
	font-family: var(--font-body);
	font-size: var(--text-2xl);
	line-height: 1.55;
	color: var(--muted);
	margin: 0 0 var(--space-6);
}

.te-form-intro__points {
	list-style: none;
	margin: 0 0 var(--space-6);
	padding: 0;
	border-top: 1px solid var(--line);
}

.te-form-intro__points li {
	padding: var(--space-4) 0;
	border-bottom: 1px solid var(--line);
	font-family: var(--font-body);
	font-size: var(--text-lg);
	line-height: 1.55;
	color: var(--ink-soft);
}

.te-form-intro__points li strong {
	display: inline;
	color: var(--ink);
	font-family: var(--font-ui);
	font-size: var(--text-base);
	font-weight: 700;
	letter-spacing: 0.3px;
	text-transform: uppercase;
	margin-right: var(--space-2);
}

.te-form-intro__alt {
	font-family: var(--font-ui);
	font-size: var(--text-md);
	color: var(--muted);
	margin: 0;
	padding-top: var(--space-2);
}

.te-form-intro__alt a {
	color: var(--brand);
	font-weight: 600;
	border-bottom: 1px solid currentColor;
	text-decoration: none;
}

.te-form-intro__alt a:hover {
	color: var(--brand-dark);
}

/* Form column */

.te-form-col {
	background: var(--bg-cream);
	border: 1px solid var(--line);
	padding: var(--space-6);
	border-radius: 3px;
}

/* ---------- Legacy single-column header (kept for any one-column usage) ---------- */

.te-form-header {
	text-align: center;
	margin-bottom: var(--space-7);
	padding-bottom: var(--space-5);
	border-bottom: 1px solid var(--line);
}

.te-form-kicker {
	display: inline-block;
	font-family: var(--font-ui);
	font-size: var(--text-xs);
	font-weight: 600;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--brand);
	margin-bottom: var(--space-3);
}

.te-form-title {
	font-family: var(--font-display);
	font-size: var(--text-7xl);
	font-weight: 600;
	letter-spacing: -1px;
	line-height: 1.1;
	color: var(--ink);
	margin: 0 0 var(--space-3);
}

.te-form-dek {
	font-family: var(--font-body);
	font-size: var(--text-xl);
	line-height: 1.55;
	color: var(--muted);
	max-width: 560px;
	margin: 0 auto;
}

/* ---------- Form ---------- */

.te-form {
	font-family: var(--font-ui);
}

.te-field {
	margin-bottom: var(--space-5);
}

.te-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--space-4);
}

.te-row .te-field {
	margin-bottom: 0;
}

.te-label {
	display: block;
	font-size: var(--text-sm);
	font-weight: 600;
	letter-spacing: 0.3px;
	color: var(--ink-soft);
	margin-bottom: var(--space-2);
}

.te-label .te-required {
	color: var(--brand);
	margin-left: 2px;
}

.te-input,
.te-textarea,
.te-select {
	width: 100%;
	padding: var(--space-3) var(--space-4);
	border: 1px solid #d4d4d4;
	background: #fff;
	font-family: var(--font-ui);
	font-size: var(--text-md);
	line-height: 1.5;
	color: var(--ink);
	border-radius: 2px;
	transition: border-color var(--ease-quick), background-color var(--ease-quick);
	-webkit-appearance: none;
	appearance: none;
}

.te-input:hover,
.te-textarea:hover,
.te-select:hover {
	border-color: #b0b0b0;
}

.te-input:focus,
.te-textarea:focus,
.te-select:focus {
	outline: none;
	border-color: var(--brand);
	background-color: var(--bg);
	box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

.te-textarea {
	min-height: 140px;
	resize: vertical;
	line-height: 1.55;
}

.te-select {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
	background-repeat: no-repeat;
	background-position: right var(--space-4) center;
	padding-right: 40px;
}

/* Honeypot — hidden from humans, bots fill it */
.te-honeypot {
	position: absolute;
	left: -9999px;
	top: -9999px;
	height: 0;
	width: 0;
	opacity: 0;
	pointer-events: none;
}

.te-conditional {
	display: none;
}

.te-conditional.is-visible {
	display: block;
}

/* ---------- Submit button ---------- */

.te-actions {
	margin-top: var(--space-6);
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: var(--space-3);
}

.te-submit {
	background: var(--brand);
	color: #fff;
	padding: var(--space-4) var(--space-6);
	font-family: var(--font-ui);
	font-size: var(--text-base);
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	border: none;
	border-radius: 2px;
	cursor: pointer;
	transition: background var(--ease-quick), transform var(--ease-quick);
	min-height: 48px;
}

.te-submit:hover:not(:disabled) {
	background: var(--brand-dark);
}

.te-submit:active:not(:disabled) {
	transform: translateY(1px);
}

.te-submit:disabled {
	opacity: 0.7;
	cursor: progress;
}

.te-note {
	font-size: var(--text-sm);
	color: var(--muted);
	text-align: center;
	margin: 0;
}

.te-note a {
	color: var(--brand);
	border-bottom: 1px solid currentColor;
}

/* ---------- Status messages ---------- */

.te-form-status {
	display: none;
	padding: var(--space-4);
	margin-top: var(--space-5);
	border-radius: 2px;
	font-size: var(--text-md);
	line-height: 1.5;
}

.te-form-status.is-visible {
	display: block;
}

.te-form-status--error {
	background: #fff3f2;
	border-left: 3px solid var(--brand);
	color: var(--ink);
}

.te-form-status--success {
	background: #f0f9f4;
	border-left: 3px solid #1d9e75;
	color: var(--ink);
}

/* ---------- Success state replaces the form ---------- */

.te-form-success {
	display: none;
	text-align: center;
	padding: var(--space-7) var(--space-5);
	border: 1px solid var(--line);
	background: var(--bg);
}

.te-form-success.is-visible {
	display: block;
}

.te-form-success__check {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: #1d9e75;
	color: #fff;
	font-size: 30px;
	line-height: 1;
	margin-bottom: var(--space-4);
}

.te-form-success__title {
	font-family: var(--font-display);
	font-size: var(--text-4xl);
	font-weight: 600;
	margin: 0 0 var(--space-3);
	color: var(--ink);
}

.te-form-success__body {
	font-family: var(--font-body);
	font-size: var(--text-xl);
	line-height: 1.55;
	color: var(--muted);
	max-width: 480px;
	margin: 0 auto;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
	.te-form-page--split .te-form-page__inner {
		grid-template-columns: 1fr;
		gap: var(--space-6);
	}
	.te-form-intro {
		position: static;
		padding-right: 0;
	}
	.te-form-intro__title {
		font-size: var(--text-6xl);
	}
	.te-form-intro__dek {
		font-size: var(--text-xl);
	}
}

@media (max-width: 640px) {
	.te-form-page {
		padding: var(--space-5) var(--gutter) var(--space-7);
	}
	.te-form-title {
		font-size: var(--text-6xl);
	}
	.te-form-dek {
		font-size: var(--text-lg);
	}
	.te-form-intro__title {
		font-size: var(--text-5xl);
	}
	.te-form-intro__dek {
		font-size: var(--text-lg);
	}
	.te-form-col {
		padding: var(--space-5) var(--space-4);
	}
	.te-row {
		grid-template-columns: 1fr;
		gap: var(--space-5);
	}
	.te-row .te-field {
		margin-bottom: 0;
	}
}

/* ---------- Dark mode ---------- */

[data-theme="dark"] .te-form-col {
	background: var(--bg-soft);
	border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .te-input,
[data-theme="dark"] .te-textarea,
[data-theme="dark"] .te-select {
	background-color: var(--bg);
	border-color: rgba(255, 255, 255, 0.15);
	color: var(--ink);
}

[data-theme="dark"] .te-input:focus,
[data-theme="dark"] .te-textarea:focus,
[data-theme="dark"] .te-select:focus {
	background-color: var(--bg-soft);
	border-color: var(--brand);
}

/* Defence-in-depth: re-assert the no-repeat + position on selects in dark mode
   in case a future edit reintroduces a background shorthand higher up. */
[data-theme="dark"] .te-select {
	background-repeat: no-repeat;
	background-position: right var(--space-4) center;
}

[data-theme="dark"] .te-form-intro__points {
	border-top-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .te-form-intro__points li {
	border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .te-form-status--error {
	background: rgba(192, 57, 43, 0.08);
}

[data-theme="dark"] .te-form-status--success {
	background: rgba(29, 158, 117, 0.08);
}

[data-theme="dark"] .te-form-success {
	background: var(--bg);
}

[data-theme="dark"] .te-select {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
