/**
 * Custom styles for the Blog and Contact page templates.
 * Loaded only on those two templates (see includes/custom-functions.php).
 * Written with flexbox/gap so it adapts automatically to RTL (dir="rtl") sites.
 */

.hec-container {
	max-width: 1100px;
	margin: 0 auto;
	padding: 48px 24px 80px;
}

.hec-container--narrow {
	max-width: 640px;
}

.hec-blog-page__title,
.hec-contact-page__title {
	font-size: 2rem;
	font-weight: 700;
	margin: 0 0 32px;
}

/* ---------- Blog grid ---------- */

.hec-blog-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 32px;
}

.hec-blog-card {
	flex: 1 1 300px;
	max-width: calc(33.333% - 22px);
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

@media (max-width: 900px) {
	.hec-blog-card { max-width: calc(50% - 16px); }
}

@media (max-width: 600px) {
	.hec-blog-card { max-width: 100%; }
}

.hec-blog-card__thumb-link { display: block; line-height: 0; }

.hec-blog-card__thumb {
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
}

.hec-blog-card__thumb--placeholder {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 10;
	background: #eee;
}

.hec-blog-card__body {
	padding: 18px 20px 22px;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

.hec-blog-card__date {
	font-size: 0.8rem;
	color: #767676;
	margin-bottom: 6px;
}

.hec-blog-card__title {
	font-size: 1.15rem;
	line-height: 1.5;
	margin: 0 0 8px;
}

.hec-blog-card__title a {
	color: inherit;
	text-decoration: none;
}
.hec-blog-card__title a:hover { text-decoration: underline; }

.hec-blog-card__excerpt {
	font-size: 0.92rem;
	color: #555;
	margin: 0 0 14px;
	flex-grow: 1;
}

.hec-blog-card__more {
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: none;
	align-self: flex-start;
}
.hec-blog-card__more:hover { text-decoration: underline; }

.hec-blog-empty { color: #666; }

/* ---------- Pagination ---------- */

.hec-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 40px;
}

.hec-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	border-radius: 6px;
	background: #fff;
	border: 1px solid #ddd;
	text-decoration: none;
	color: #333;
	font-size: 0.9rem;
}

.hec-pagination .page-numbers.current {
	background: #333;
	border-color: #333;
	color: #fff;
}

.hec-pagination .page-numbers.dots {
	border: none;
	background: none;
}

/* ---------- Contact form ---------- */

.hec-notice {
	padding: 14px 18px;
	border-radius: 6px;
	margin-bottom: 24px;
	font-size: 0.95rem;
}

.hec-notice--success {
	background: #eaf7ec;
	color: #1e6b32;
	border: 1px solid #bfe6c6;
}

.hec-notice--error {
	background: #fdecea;
	color: #a52222;
	border: 1px solid #f4c2be;
}

.hec-contact-form {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

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

.hec-form-row--half {
	flex-direction: row;
	gap: 20px;
}

.hec-form-row--half > div {
	flex: 1 1 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

@media (max-width: 560px) {
	.hec-form-row--half { flex-direction: column; }
}

.hec-contact-form label {
	font-size: 0.9rem;
	font-weight: 600;
}

.hec-contact-form .req { color: #c0392b; }

.hec-contact-form input[type="text"],
.hec-contact-form input[type="email"],
.hec-contact-form input[type="tel"],
.hec-contact-form textarea {
	width: 100%;
	font: inherit;
	font-size: 1rem;
	padding: 10px 14px;
	border: 1px solid #ccc;
	border-radius: 6px;
	background: #fff;
	box-sizing: border-box;
}

.hec-contact-form input:focus,
.hec-contact-form textarea:focus {
	outline: 2px solid #333;
	outline-offset: 1px;
}

.hec-form-submit {
	align-self: flex-start;
	font: inherit;
	font-weight: 600;
	font-size: 0.95rem;
	background: #222;
	color: #fff;
	border: none;
	padding: 12px 28px;
	border-radius: 6px;
	cursor: pointer;
}
.hec-form-submit:hover { background: #444; }

/* Honeypot field: hidden from real visitors, left for bots to fill in */
.hec-hp-field {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
