/**
 * Blog: posts page, single posts and the "Blog Sidebar" Elementor template (15996).
 * Layout lives in the Elementor templates; this file holds the details Elementor controls don't
 * cover well (article typography, post cards, button variants). Colours follow the Elementor kit:
 * primary #2E7629, secondary #75B11E, light green #a4cc6c, text #7A7A7A.
 */

:root {
	--espai-green: #2e7629;
	--espai-green-2: #75b11e;
	--espai-green-light: #a4cc6c;
	--espai-green-bg: #f3f8ec;
	--espai-ink: #2b2b2b;
	--espai-body: #555;
	--espai-line: #e6ece0;
	--espai-radius: 18px;
	--espai-shadow: 0 10px 30px rgba(28, 64, 25, .10);
	--espai-shadow-hover: 0 18px 40px rgba(28, 64, 25, .18);
}

/* ---------- Two-column layout (main + sidebar template) ---------- */

.e-con.espai-blog-main {
	flex: 1 1 0%;
	min-width: 0;
}

.e-con.espai-blog-aside {
	flex: 0 0 360px;
	max-width: 360px;
}

@media (max-width: 1024px) {
	.e-con.espai-blog-main,
	.e-con.espai-blog-aside {
		flex: 0 0 auto;
		width: 100%;
		max-width: 100%;
	}
}

/* ---------- Buttons (Elementor button widget + CSS class) ---------- */
/* Higher specificity + !important: Elementor's button widget paints the kit accent colour (brown). */

.elementor-widget-button.espai-btn .elementor-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 24px;
	border: 0;
	border-radius: 10px;
	font-family: "Montserrat", sans-serif;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	color: #fff !important;
	fill: #fff !important;
	background: linear-gradient(135deg, var(--espai-green) 0%, var(--espai-green-2) 100%) !important;
	box-shadow: 0 6px 16px rgba(46, 118, 41, .25);
	transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}

.elementor-widget-button.espai-btn .elementor-button:hover,
.elementor-widget-button.espai-btn .elementor-button:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 10px 22px rgba(46, 118, 41, .32);
	background: linear-gradient(135deg, #256321 0%, var(--espai-green) 100%) !important;
}

.elementor-widget-button.espai-btn--white .elementor-button,
.elementor-widget-button.espai-btn--white .elementor-button:hover,
.elementor-widget-button.espai-btn--white .elementor-button:focus-visible {
	color: var(--espai-green) !important;
	fill: var(--espai-green) !important;
	background: #fff !important;
	box-shadow: 0 6px 16px rgba(0, 0, 0, .12);
}

.elementor-widget-button.espai-btn--white .elementor-button:hover {
	background: #f1f8e8 !important;
}

.elementor-widget-button.espai-btn--ghost .elementor-button {
	color: #fff !important;
	fill: #fff !important;
	background: transparent !important;
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .85);
}

.elementor-widget-button.espai-btn--ghost .elementor-button:hover,
.elementor-widget-button.espai-btn--ghost .elementor-button:focus-visible {
	color: var(--espai-green) !important;
	fill: var(--espai-green) !important;
	background: #fff !important;
	box-shadow: none;
}

.elementor-widget-button.espai-btn--link .elementor-button,
.elementor-widget-button.espai-btn--link .elementor-button:hover,
.elementor-widget-button.espai-btn--link .elementor-button:focus-visible {
	padding: 4px 0;
	color: var(--espai-green) !important;
	fill: var(--espai-green) !important;
	background: none !important;
	box-shadow: none;
	font-size: 14px;
}

.elementor-widget-button.espai-btn--link .elementor-button:hover {
	transform: translateX(3px);
}

.elementor-widget-button.espai-btn--full,
.elementor-widget-button.espai-btn--full .elementor-button-wrapper,
.elementor-widget-button.espai-btn--full .elementor-button {
	display: flex;
	width: 100%;
}

/* In-article CTA: text column flexes, buttons column keeps its width next to it. */
.espai-blog-cta > .e-con:first-child {
	flex: 1 1 0%;
	min-width: 0;
}

.espai-blog-cta > .e-con:last-child {
	flex: 0 0 230px;
	position: relative;
	z-index: 1;
}

@media (max-width: 767px) {
	.espai-blog-cta > .e-con:first-child,
	.espai-blog-cta > .e-con:last-child {
		flex: 0 0 auto;
		width: 100%;
	}
}

/* ---------- Post hero (Header Blog) ---------- */

.espai-blog-hero .elementor-heading-title {
	max-width: 900px;
	text-wrap: balance;
}

.espai-blog-hero .elementor-widget-post-info .elementor-icon-list-items {
	gap: 6px 18px;
}

.espai-blog-hero .elementor-widget-post-info .elementor-icon-list-item {
	margin: 0 !important;
	padding: 0 !important;
}

.espai-blog-hero .elementor-widget-post-info .elementor-icon-list-item::after {
	display: none !important;
}

.espai-blog-hero .espai-blog-hero__badge .elementor-icon-list-item {
	padding: 5px 14px !important;
	border-radius: 999px;
	background: linear-gradient(135deg, var(--espai-green) 0%, var(--espai-green-2) 100%);
}

.espai-blog-hero .espai-blog-hero__badge a,
.espai-blog-hero .espai-blog-hero__badge .elementor-icon-list-text {
	color: #fff !important;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
}

/* ---------- Article typography (Post Content widget) ---------- */

.espai-article {
	color: var(--espai-body);
	font-family: "Montserrat", sans-serif;
	font-size: 17px;
	line-height: 1.8;
}

.espai-article .elementor-widget-text-editor > p:first-child,
.espai-article .elementor-widget-text-editor > .elementor-widget-container > p:first-child {
	font-family: "Lora", serif;
	font-size: 21px;
	font-style: italic;
	line-height: 1.6;
	color: #3d3d3d;
	padding-left: 20px;
	border-left: 4px solid var(--espai-green-light);
}

.espai-article p {
	margin: 0 0 1.15em;
}

.espai-article h2 {
	margin: 1.9em 0 .6em;
	font-family: "Montserrat", sans-serif;
	font-size: 28px;
	font-weight: 600;
	line-height: 1.25;
	color: var(--espai-green);
}

.espai-article h2::after {
	content: "";
	display: block;
	width: 56px;
	height: 4px;
	margin-top: 12px;
	border-radius: 4px;
	background: linear-gradient(90deg, var(--espai-green) 0%, var(--espai-green-light) 100%);
}

.espai-article h3 {
	margin: 1.6em 0 .45em;
	font-family: "Montserrat", sans-serif;
	font-size: 21px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--espai-ink);
}

.espai-article h4 {
	margin: 1.4em 0 .4em;
	font-size: 18px;
	font-weight: 600;
	color: var(--espai-ink);
}

.espai-article strong {
	color: var(--espai-ink);
	font-weight: 600;
}

.espai-article a {
	color: var(--espai-green);
	font-weight: 500;
	text-decoration: underline;
	text-decoration-color: var(--espai-green-light);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

.espai-article a:hover {
	color: var(--espai-green-2);
}

.espai-article ul,
.espai-article ol {
	margin: 0 0 1.4em;
	padding: 0;
}

.espai-article ul {
	list-style: none;
}

.espai-article ul > li {
	position: relative;
	margin: 0 0 .7em;
	padding-left: 30px;
}

.espai-article ul > li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .5em;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--espai-green-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%232e7629' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M4 8.5l2.6 2.5L12 5.5'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.espai-article ol {
	padding-left: 1.4em;
}

.espai-article ol > li {
	margin: 0 0 .7em;
	padding-left: 6px;
}

.espai-article ol > li::marker {
	color: var(--espai-green);
	font-weight: 700;
}

.espai-article blockquote h2,
.espai-article blockquote h3,
.espai-article blockquote h4,
.espai-article blockquote p {
	margin: 0;
	font-family: "Lora", serif;
	font-size: 19px;
	font-style: italic;
	font-weight: 500;
	line-height: 1.55;
	color: #2f4d2c;
}

.espai-article blockquote h2::after {
	display: none;
}

.espai-article blockquote {
	margin: 1.6em 0;
	padding: 22px 26px;
	border: 0;
	border-radius: var(--espai-radius);
	background: var(--espai-green-bg);
	font-family: "Lora", serif;
	font-style: italic;
	font-size: 19px;
	color: #3d3d3d;
}

.espai-article img {
	height: auto;
	border-radius: 14px;
}

/* ---------- In-article CTA ---------- */

.espai-blog-cta {
	position: relative;
	overflow: hidden;
}

.espai-blog-cta::after {
	content: "";
	position: absolute;
	right: -60px;
	bottom: -80px;
	width: 240px;
	height: 240px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .08);
	pointer-events: none;
}

/* ---------- Share + post navigation ---------- */

.espai-blog-share .elementor-share-btn {
	border-radius: 50%;
}

.espai-blog-nav .elementor-post-navigation {
	padding: 18px 0;
	border-color: var(--espai-line) !important;
}

.espai-blog-nav .post-navigation__prev--label,
.espai-blog-nav .post-navigation__next--label {
	color: var(--espai-green);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.espai-blog-nav .post-navigation__prev--title,
.espai-blog-nav .post-navigation__next--title {
	color: var(--espai-ink);
	font-size: 15px;
	font-weight: 600;
	text-transform: none;
}

.espai-blog-nav .post-navigation__arrow-wrapper {
	color: var(--espai-green);
}

/* ---------- Post cards (Archive Posts / Posts widgets, "cards" skin) ---------- */

.espai-blog-grid .elementor-post__card {
	border: 0 !important;
	border-radius: var(--espai-radius) !important;
	background: #fff;
	box-shadow: var(--espai-shadow) !important;
	transition: transform .3s ease, box-shadow .3s ease;
}

.espai-blog-grid .elementor-post:hover .elementor-post__card {
	transform: translateY(-4px);
	box-shadow: var(--espai-shadow-hover) !important;
}

.espai-blog-grid .elementor-post__thumbnail__link {
	margin-bottom: 0 !important;
}

.espai-blog-grid .elementor-posts--thumbnail-top .elementor-post__thumbnail {
	padding-bottom: 62%;
}

.espai-blog-grid .elementor-post__thumbnail img {
	transition: transform .6s ease;
}

.espai-blog-grid .elementor-post:hover .elementor-post__thumbnail img {
	transform: translate(-50%, -50%) scale(1.06);
}

.espai-blog-grid .elementor-post__badge {
	margin: 16px !important;
	padding: 6px 14px !important;
	border-radius: 999px !important;
	background: linear-gradient(135deg, var(--espai-green) 0%, var(--espai-green-2) 100%) !important;
	color: #fff !important;
	font-family: "Montserrat", sans-serif;
	font-size: 11px !important;
	font-weight: 600 !important;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.espai-blog-grid .elementor-post__text {
	padding: 26px 28px 0 !important;
	margin-top: 0 !important;
}

.espai-blog-grid .elementor-post__title {
	margin: 0 0 12px !important;
	font-family: "Montserrat", sans-serif;
	font-size: 20px !important;
	font-weight: 600 !important;
	line-height: 1.35 !important;
}

.espai-blog-grid .elementor-post__title a {
	color: var(--espai-ink) !important;
	font-family: "Montserrat", sans-serif !important;
	font-size: 20px !important;
	font-weight: 600 !important;
	line-height: 1.35 !important;
	transition: color .2s ease;
}

.espai-blog-grid .elementor-post__read-more,
.espai-blog-grid .elementor-post__meta-data,
.espai-blog-grid .elementor-post__excerpt,
.espai-sb-posts .elementor-post__title a,
.espai-sb-posts .elementor-post__meta-data {
	font-family: "Montserrat", sans-serif !important;
	font-style: normal !important;
}

.espai-blog-grid .elementor-post:hover .elementor-post__title a {
	color: var(--espai-green) !important;
}

.espai-blog-grid .elementor-post__excerpt p {
	margin: 0 0 18px;
	color: #6b6b6b;
	font-size: 15px;
	line-height: 1.65;
}

.espai-blog-grid .elementor-post__read-more {
	display: inline-flex;
	margin-bottom: 24px;
	color: var(--espai-green) !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	text-transform: none !important;
}

.espai-blog-grid .elementor-post__meta-data {
	padding: 14px 28px !important;
	border-top: 1px solid var(--espai-line) !important;
	color: #8a8a8a !important;
	font-size: 13px !important;
}

.espai-blog-grid .elementor-pagination {
	margin-top: 48px;
	font-weight: 600;
}

.espai-blog-grid .elementor-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	margin: 0 4px;
	padding: 0 12px;
	border-radius: 10px;
	background: #f4f6f2;
	color: var(--espai-ink);
}

.espai-blog-grid .elementor-pagination .page-numbers.current,
.espai-blog-grid .elementor-pagination a.page-numbers:hover {
	background: linear-gradient(135deg, var(--espai-green) 0%, var(--espai-green-2) 100%);
	color: #fff;
}

/* ---------- Blog sidebar (template 15996) ---------- */

.espai-sb-card {
	overflow: hidden;
}

.espai-sb-card .elementor-widget-heading .elementor-heading-title {
	text-wrap: balance;
}

.espai-sb-links .elementor-icon-list-item {
	padding: 11px 0 !important;
	border-bottom: 1px solid var(--espai-line);
}

.espai-sb-links .elementor-icon-list-item:last-child {
	border-bottom: 0;
}

.espai-sb-links .elementor-icon-list-item a {
	width: 100%;
	transition: color .2s ease, transform .2s ease;
}

.espai-sb-links .elementor-icon-list-item a:hover {
	transform: translateX(4px);
}

.espai-sb-links .elementor-icon-list-item a:hover .elementor-icon-list-text {
	color: var(--espai-green) !important;
}

.espai-sb-links .elementor-icon-list-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px !important;
	height: 36px;
	margin-right: 12px;
	border-radius: 10px;
	background: var(--espai-green-bg);
}

.espai-sb-contact .elementor-icon-list-item a:hover .elementor-icon-list-text {
	color: var(--espai-green) !important;
}

.espai-sb-posts .elementor-post {
	padding-bottom: 14px;
	border-bottom: 1px solid var(--espai-line);
}

.espai-sb-posts .elementor-post:last-child {
	padding-bottom: 0;
	border-bottom: 0;
}

.espai-sb-posts .elementor-post__thumbnail {
	border-radius: 10px;
	overflow: hidden;
}

.espai-sb-posts .elementor-post__thumbnail__link {
	margin-right: 14px !important;
}

.espai-sb-posts .elementor-post__title {
	margin: 0 0 4px !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 1.35 !important;
}

.espai-sb-posts .elementor-post__title a {
	color: var(--espai-ink) !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 1.35 !important;
}

.espai-sb-posts .elementor-post__title a:hover {
	color: var(--espai-green) !important;
}

.espai-sb-posts .elementor-post__meta-data {
	color: #8a8a8a !important;
	font-size: 12px !important;
}

/* On the posts page the grid already lists the latest posts. */
body.blog .espai-sb-card--posts {
	display: none;
}

/* House cards (loop template 369) inside the narrow sidebar */
.espai-sb-houses .e-loop-item {
	border-radius: 14px;
	overflow: hidden;
}

.espai-sb-houses .installation-data-list .short_label {
	font-size: 11px;
	word-break: normal;
	overflow-wrap: normal;
	hyphens: none;
}

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

@media (max-width: 1024px) {
	.espai-article {
		font-size: 16px;
	}

	.espai-article h2 {
		font-size: 24px;
	}
}

@media (max-width: 767px) {
	.espai-article .elementor-widget-text-editor > p:first-child,
	.espai-article .elementor-widget-text-editor > .elementor-widget-container > p:first-child {
		font-size: 18px;
		padding-left: 14px;
	}

	.espai-article h2 {
		font-size: 22px;
	}

	.espai-article h3 {
		font-size: 19px;
	}

	.espai-blog-grid .elementor-post__text {
		padding: 22px 20px 0 !important;
	}

	.espai-blog-grid .elementor-post__meta-data {
		padding: 12px 20px !important;
	}
}
