/*
 * Styles for the ESP32-S3-Zero one-page landing.
 * Loaded only on the front page, on top of the base underscores style.css.
 */

:root {
	--esp-color-text: #1c1f24;
	--esp-color-muted: #5b6270;
	--esp-color-bg: #ffffff;
	--esp-color-bg-alt: #f6f7f9;
	--esp-color-border: #e3e5e9;
	--esp-color-primary: #1a6b47;
	--esp-color-primary-dark: #124f34;
	--esp-color-success-bg: #e6f6ec;
	--esp-color-success-text: #1a6b30;
	--esp-color-error-bg: #fbeaea;
	--esp-color-error-text: #a12b2b;
	--esp-radius: 10px;
	--esp-max-width: 1120px;
}

.esp-landing {
	color: var(--esp-color-text);
	font-size: 16px;
	line-height: 1.6;
}

.esp-container {
	max-width: var(--esp-max-width);
	margin: 0 auto;
	padding: 0 20px;
}

.esp-section {
	padding: 56px 0;
}

.esp-section:nth-child(even) {
	background: var(--esp-color-bg-alt);
}

.esp-section__title {
	font-size: 1.7rem;
	line-height: 1.3;
	margin: 0 0 28px;
}

/* Buttons */

.esp-button {
	display: inline-block;
	padding: 14px 28px;
	background: var(--esp-color-primary);
	color: #fff;
	text-decoration: none;
	border: none;
	border-radius: var(--esp-radius);
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.esp-button:hover,
.esp-button:focus-visible {
	background: var(--esp-color-primary-dark);
	color: #fff;
}

/* Hero */

.esp-hero {
	padding-top: 48px;
}

.esp-hero__inner {
	display: grid;
	grid-template-columns: 1.1fr 0.9fr;
	gap: 40px;
	align-items: center;
}

.esp-hero__title {
	font-size: 2.1rem;
	line-height: 1.25;
	margin: 0 0 14px;
}

.esp-hero__subtitle {
	color: var(--esp-color-muted);
	font-size: 1.05rem;
	margin: 0 0 18px;
}

.esp-hero__price {
	font-size: 1.6rem;
	font-weight: 700;
	margin: 0 0 20px;
}

.esp-hero__price-note {
	font-size: 0.95rem;
	font-weight: 400;
	color: var(--esp-color-muted);
}

.esp-hero__advantages {
	list-style: none;
	margin: 0 0 28px;
	padding: 0;
	display: grid;
	gap: 10px;
}

.esp-hero__advantages li {
	position: relative;
	padding-left: 26px;
}

.esp-hero__advantages li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.5em;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--esp-color-primary);
}

.esp-hero__image img {
	width: 100%;
	height: auto;
	border-radius: var(--esp-radius);
}

/* Description */

.esp-description__inner {
	display: grid;
	grid-template-columns: 0.9fr 1.1fr;
	gap: 40px;
	align-items: center;
}

.esp-description__image img {
	width: 100%;
	height: auto;
	border-radius: var(--esp-radius);
}

.esp-wysiwyg {
	overflow-x: auto;
}

.esp-wysiwyg :where(p, ul, ol, table) {
	margin: 0 0 1em;
}

.esp-wysiwyg :last-child {
	margin-bottom: 0;
}

.esp-wysiwyg table {
	width: 100%;
	border-collapse: collapse;
	background: var(--esp-color-bg);
	border: 1px solid var(--esp-color-border);
	border-radius: var(--esp-radius);
	overflow: hidden;
}

.esp-wysiwyg th,
.esp-wysiwyg td {
	padding: 13px 18px;
	text-align: left;
	border-bottom: 1px solid var(--esp-color-border);
}

.esp-wysiwyg tr:last-child th,
.esp-wysiwyg tr:last-child td {
	border-bottom: none;
}

.esp-wysiwyg thead th {
	background: var(--esp-color-bg-alt);
	font-weight: 600;
}

/* Order block */

.esp-order__box {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 32px;
	background: var(--esp-color-bg);
	border: 1px solid var(--esp-color-border);
	border-radius: var(--esp-radius);
	padding: 28px;
}

.esp-order__calc {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.esp-order__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.esp-order__row--total {
	padding-top: 14px;
	border-top: 1px solid var(--esp-color-border);
}

.esp-order__label {
	color: var(--esp-color-muted);
}

.esp-order__value {
	font-size: 1.15rem;
	font-weight: 600;
}

.esp-order__value--total {
	font-size: 1.4rem;
	color: var(--esp-color-primary);
}

.esp-qty {
	display: flex;
	align-items: stretch;
	border: 1px solid var(--esp-color-border);
	border-radius: var(--esp-radius);
	overflow: hidden;
}

.esp-qty__btn {
	width: 40px;
	background: var(--esp-color-bg-alt);
	border: none;
	font-size: 1.2rem;
	line-height: 1;
	cursor: pointer;
}

.esp-qty__btn:hover {
	background: var(--esp-color-border);
}

.esp-qty input {
	width: 64px;
	border: none;
	text-align: center;
	font-size: 1rem;
	-moz-appearance: textfield;
}

.esp-order__form {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.esp-form-row {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.esp-form-row label {
	font-size: 0.9rem;
	color: var(--esp-color-muted);
}

.esp-form-row input,
.esp-form-row textarea {
	padding: 11px 14px;
	border: 1px solid var(--esp-color-border);
	border-radius: var(--esp-radius);
	font: inherit;
	color: inherit;
}

.esp-form-row textarea {
	resize: none;
}

.esp-form-row input:focus,
.esp-form-row textarea:focus {
	outline: 2px solid var(--esp-color-primary);
	outline-offset: 1px;
}

.esp-form-row--hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.esp-order__submit {
	margin-top: 4px;
	width: 100%;
	text-align: center;
}

.esp-notice {
	padding: 14px 18px;
	border-radius: var(--esp-radius);
	margin-bottom: 24px;
}

.esp-notice--success {
	background: var(--esp-color-success-bg);
	color: var(--esp-color-success-text);
}

.esp-notice--error {
	background: var(--esp-color-error-bg);
	color: var(--esp-color-error-text);
}

/* Tables (discounts, specs) */

.esp-table-wrap {
	overflow-x: auto;
	border: 1px solid var(--esp-color-border);
	border-radius: var(--esp-radius);
}

.esp-table {
	width: 100%;
	border-collapse: collapse;
	background: var(--esp-color-bg);
}

.esp-table th,
.esp-table td {
	padding: 13px 18px;
	text-align: left;
	border-bottom: 1px solid var(--esp-color-border);
}

.esp-table tr:last-child th,
.esp-table tr:last-child td {
	border-bottom: none;
}

.esp-table thead th {
	background: var(--esp-color-bg-alt);
	font-weight: 600;
}

.esp-specs__table th {
	width: 45%;
	color: var(--esp-color-muted);
	font-weight: 500;
}

/* Use cases */

.esp-usecases__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
}

.esp-usecase-card {
	background: var(--esp-color-bg);
	border: 1px solid var(--esp-color-border);
	border-radius: var(--esp-radius);
	padding: 22px;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.esp-usecase-card:hover {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
	transform: translateY(-2px);
}

.esp-usecase-card__icon {
	width: 40px;
	height: 40px;
	margin-bottom: 12px;
	object-fit: contain;
}

.esp-usecase-card__title {
	font-size: 1.05rem;
	margin: 0 0 8px;
}

.esp-usecase-card__description {
	color: var(--esp-color-muted);
	font-size: 0.92rem;
	margin: 0;
}

/* Pinout */

.esp-pinout__image-wrap {
	overflow-x: auto;
	margin-bottom: 24px;
}

.esp-pinout__image {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: var(--esp-radius);
	border: 1px solid var(--esp-color-border);
}

/* CTA */

.esp-cta__inner {
	text-align: center;
	max-width: 640px;
}

.esp-cta__title {
	font-size: 1.6rem;
	margin: 0 0 12px;
}

.esp-cta__text {
	color: var(--esp-color-muted);
	margin: 0 0 24px;
}

/* Footer */

.esp-footer {
	padding: 40px 0;
	border-top: 1px solid var(--esp-color-border);
	background: var(--esp-color-bg-alt);
}

.esp-footer__inner {
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}

.esp-footer__brand {
	font-weight: 700;
	font-size: 1.1rem;
}

.esp-footer__contacts {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 18px;
	margin: 0;
	padding: 0;
}

.esp-footer__contacts a {
	color: var(--esp-color-text);
	text-decoration: none;
}

.esp-footer__contacts a:hover {
	color: var(--esp-color-primary);
}

.esp-footer__address {
	color: var(--esp-color-muted);
	font-size: 0.9rem;
	margin: 0;
	white-space: pre-line;
}

.esp-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 16px;
	color: var(--esp-color-muted);
	font-size: 0.85rem;
	margin-top: 10px;
}

.esp-footer__bottom a {
	color: var(--esp-color-muted);
}

/* Responsive */

@media (max-width: 900px) {
	.esp-hero__inner,
	.esp-description__inner {
		grid-template-columns: 1fr;
	}

	.esp-hero__image {
		order: -1;
	}

	.esp-order__box {
		grid-template-columns: 1fr;
	}

	.esp-usecases__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.esp-section {
		padding: 40px 0;
	}

	.esp-hero__title {
		font-size: 1.6rem;
	}

	.esp-section__title {
		font-size: 1.4rem;
	}

	.esp-usecases__grid {
		grid-template-columns: 1fr;
	}

	.esp-order__box {
		padding: 20px;
	}

	.esp-order__row {
		flex-wrap: wrap;
	}
}
