/**
 * Inoforest Post Grid
 *
 * Contents
 * 1. Variables and layouts (grid, list)
 * 2. Card and hover effects
 * 3. Photo and date badge
 * 4. Body: category and comments, title, excerpt, read more, the line under the excerpt
 * 5. Showcase layout: featured post and compact posts
 * 6. Pagination
 * 7. Editor hint
 * 8. Sticky post and Nothing found
 * 9. Responsive and reduced motion
 *
 * Colours read the Design System (--inoforest-color-*) with the Travel26 design as fallback.
 */

/* 1. Variables and layouts ------------------------------------------------- */
.inoforest-post-grid {
	--ino-pg-primary: var(--inoforest-color-primary, #0b7a75);
	--ino-pg-accent: var(--inoforest-color-accent, #ff6a3d);
	--ino-pg-heading: var(--inoforest-color-heading, #0d1b2a);
	--ino-pg-text: var(--inoforest-color-text, #5a6a79);
	--ino-pg-border: var(--inoforest-color-border, #e5ebef);
	--ino-pg-border-hover: var(--ino-pg-border);
	--ino-pg-columns: 3;
	--ino-pg-gap: 30px;
	--ino-pg-radius: 24px;
	--ino-pg-ratio: 16 / 10;
	--ino-pg-lift: -6px;
	--ino-pg-zoom: 1.07;
	--ino-pg-list-image: 40%;
	--ino-pg-page-size: 50px;
	--ino-pg-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
	color: var(--ino-pg-text);
}

.inoforest-post-grid__grid {
	display: grid;
	grid-template-columns: repeat(var(--ino-pg-columns), minmax(0, 1fr));
	gap: var(--ino-pg-row-gap, var(--ino-pg-gap)) var(--ino-pg-gap);
}

.inoforest-post-grid[data-layout="list"] .inoforest-post-grid__grid {
	grid-template-columns: minmax(0, 1fr);
}

/* 2. Card and hover effects --------------------------------------------------- */
.inoforest-post-grid__card {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--ino-pg-border);
	border-radius: var(--ino-pg-radius);
	transition: transform 0.35s var(--ino-pg-ease), box-shadow 0.35s var(--ino-pg-ease), border-color 0.35s var(--ino-pg-ease);
}

.inoforest-post-grid__card:hover,
.inoforest-post-grid__card:focus-within {
	border-color: var(--ino-pg-border-hover);
}

.inoforest-post-grid[data-hover="lift"] .inoforest-post-grid__card:hover,
.inoforest-post-grid[data-hover="lift"] .inoforest-post-grid__card:focus-within {
	box-shadow: 0 14px 40px rgba(13, 27, 42, 0.1);
	transform: translateY(var(--ino-pg-lift));
}

.inoforest-post-grid[data-hover="border"] {
	--ino-pg-border-hover: var(--ino-pg-primary);
}

.inoforest-post-grid[data-hover="border"] .inoforest-post-grid__card:hover,
.inoforest-post-grid[data-hover="border"] .inoforest-post-grid__card:focus-within {
	box-shadow: 0 0 0 1px var(--ino-pg-border-hover), 0 16px 34px -18px rgba(11, 122, 117, 0.45);
}

/* 3. Photo and date badge ------------------------------------------------------ */
.inoforest-post-grid__media {
	position: relative;
	flex: none;
	overflow: hidden;
	aspect-ratio: var(--ino-pg-ratio);
	background: var(--ino-pg-media-bg, #f4f8f8);
}

.inoforest-post-grid__image {
	display: block;
	height: 100%;
}

/* Two classes to beat Elementor's `.elementor img` reset. */
.inoforest-post-grid .inoforest-post-grid__image img {
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
	transition: transform 0.8s var(--ino-pg-ease);
}

.inoforest-post-grid:not([data-hover="none"]) .inoforest-post-grid__card:hover .inoforest-post-grid__image img,
.inoforest-post-grid:not([data-hover="none"]) .inoforest-post-grid__card:focus-within .inoforest-post-grid__image img {
	transform: scale(var(--ino-pg-zoom));
}

.inoforest-post-grid .inoforest-post-grid__date {
	position: absolute;
	bottom: -1px;
	left: 20px;
	padding: 10px 16px 8px;
	font-size: 0.8rem;
	font-weight: 700;
	line-height: 1.1;
	text-align: center;
	text-transform: uppercase;
	color: #fff;
	background: var(--ino-pg-accent);
	border-radius: 10px 10px 0 0;
}

.inoforest-post-grid .inoforest-post-grid__day {
	display: block;
	font-size: 1.4rem;
}

/* 4. Body -------------------------------------------------------------------------- */
.inoforest-post-grid__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-width: 0;
	padding: 26px 26px 28px;
}

.inoforest-post-grid .inoforest-post-grid__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin-bottom: 12px;
	font-size: 0.875rem;
	line-height: 1.75;
}

.inoforest-post-grid__meta > a,
.inoforest-post-grid__meta > span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.inoforest-post-grid .inoforest-post-grid__meta a {
	color: inherit;
	text-decoration: none;
	transition: color 0.35s var(--ino-pg-ease);
}

.inoforest-post-grid .inoforest-post-grid__meta a:hover,
.inoforest-post-grid .inoforest-post-grid__meta a:focus-visible {
	color: var(--ino-pg-primary);
}

.inoforest-post-grid__meta svg,
.inoforest-post-grid__meta i {
	flex: none;
	color: var(--ino-pg-primary);
	fill: var(--ino-pg-primary);
}

.inoforest-post-grid__meta svg,
.inoforest-post-grid__more svg {
	width: 1em;
	height: 1em;
}

.inoforest-post-grid .inoforest-post-grid__title {
	margin: 0 0 12px;
	font-size: 1.25rem;
	font-weight: 800;
	line-height: 1.4;
	letter-spacing: -0.02em;
	color: var(--ino-pg-heading);
}

.inoforest-post-grid .inoforest-post-grid__title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.35s var(--ino-pg-ease);
}

.inoforest-post-grid .inoforest-post-grid__title a:hover,
.inoforest-post-grid .inoforest-post-grid__title a:focus-visible {
	color: var(--ino-pg-primary);
}

.inoforest-post-grid .inoforest-post-grid__excerpt {
	margin: 0 0 16px;
	font-size: 1rem;
	line-height: 1.75;
}

.inoforest-post-grid .inoforest-post-grid__more {
	display: inline-flex;
	align-self: flex-start;
	align-items: center;
	gap: 8px;
	margin-top: auto;
	padding-top: 10px;
	font-weight: 700;
	line-height: 1.75;
	color: var(--ino-pg-primary);
	text-decoration: none;
	transition: color 0.35s var(--ino-pg-ease);
}

.inoforest-post-grid .inoforest-post-grid__more svg,
.inoforest-post-grid .inoforest-post-grid__more i {
	font-size: 0.875em;
	fill: currentColor;
	transition: transform 0.35s var(--ino-pg-ease);
}

/* Card → Line under the excerpt: author, date, reading time at the bottom of the card. */
.inoforest-post-grid .inoforest-post-grid__footer {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	margin: auto 0 0;
	padding: 12px 0 0;
	font-size: 0.875rem;
	list-style: none;
	color: var(--inoforest-color-text, #5a6a79);
}

.inoforest-post-grid .inoforest-post-grid__more + .inoforest-post-grid__footer {
	margin-top: 0;
}

.inoforest-post-grid .inoforest-post-grid__footer li {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.inoforest-post-grid .inoforest-post-grid__footer svg,
.inoforest-post-grid .inoforest-post-grid__footer i {
	font-size: 1rem;
	color: var(--ino-pg-primary);
	fill: currentColor;
}

.inoforest-post-grid .inoforest-post-grid__footer svg {
	width: 1em;
	height: 1em;
}

.inoforest-post-grid .inoforest-post-grid__more:hover,
.inoforest-post-grid .inoforest-post-grid__more:focus-visible {
	color: var(--ino-pg-accent);
}

.inoforest-post-grid .inoforest-post-grid__more:hover svg,
.inoforest-post-grid .inoforest-post-grid__more:hover i,
.inoforest-post-grid .inoforest-post-grid__more:focus-visible svg,
.inoforest-post-grid .inoforest-post-grid__more:focus-visible i {
	transform: translateX(4px);
}

/* 5. Showcase layout ---------------------------------------------------------------------
   data-featured="left|right|top". The featured post is a normal card; compact posts are cards with a small photo
   beside the text. Defaults sit in :where() or var() fallbacks so the panel's Title, Meta and Read more controls win. */
.inoforest-post-grid__showcase {
	display: grid;
	grid-template-columns: var(--ino-pg-featured-width, minmax(0, 1.1fr)) minmax(0, 1fr);
	gap: var(--ino-pg-gap);
}

.inoforest-post-grid[data-featured="right"] .inoforest-post-grid__showcase {
	grid-template-columns: minmax(0, 1fr) var(--ino-pg-featured-width, minmax(0, 1.1fr));
}

.inoforest-post-grid[data-featured="right"] .inoforest-post-grid__card--featured {
	order: 2;
}

.inoforest-post-grid__showcase > :only-child {
	grid-column: 1 / -1;
}

.inoforest-post-grid[data-featured="top"] .inoforest-post-grid__showcase {
	grid-template-columns: minmax(0, 1fr);
}

.inoforest-post-grid :where(.inoforest-post-grid__card--featured) .inoforest-post-grid__title {
	font-size: clamp(1.35rem, 2vw, 1.65rem);
}

.inoforest-post-grid__stack {
	display: flex;
	flex-direction: column;
	gap: var(--ino-pg-stack-gap, 24px);
	min-width: 0;
}

.inoforest-post-grid .inoforest-post-grid__card--compact {
	display: grid;
	flex: 1;
	grid-template-columns: var(--ino-pg-compact-image, 200px) minmax(0, 1fr);
	gap: 24px;
	align-items: center;
	height: auto;
	/* The card clips its corners (overflow: hidden), which would let flex: 1 squeeze it below its text. */
	min-height: min-content;
	padding: 14px 24px 14px 14px;
}

.inoforest-post-grid[data-hover="lift"] .inoforest-post-grid__card--compact:hover,
.inoforest-post-grid[data-hover="lift"] .inoforest-post-grid__card--compact:focus-within {
	transform: translateY(calc(var(--ino-pg-lift) * 2 / 3));
}

.inoforest-post-grid .inoforest-post-grid__card--compact .inoforest-post-grid__media {
	align-self: stretch;
	min-height: var(--ino-pg-compact-height, 140px);
	aspect-ratio: auto;
	border-radius: 16px;
}

/* The text sets the post's height; the photo fills its side. */
.inoforest-post-grid__card--compact .inoforest-post-grid__image {
	position: absolute;
	inset: 0;
}

.inoforest-post-grid__summary {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
}

.inoforest-post-grid :where(.inoforest-post-grid__summary) .inoforest-post-grid__meta {
	margin-bottom: 6px;
	font-size: 0.825rem;
}

.inoforest-post-grid :where(.inoforest-post-grid__summary) .inoforest-post-grid__title {
	margin-bottom: 8px;
	font-size: 1.1rem;
}

.inoforest-post-grid :where(.inoforest-post-grid__summary) .inoforest-post-grid__excerpt {
	margin-bottom: 8px;
	font-size: 0.9375rem;
	line-height: 1.6;
}

.inoforest-post-grid :where(.inoforest-post-grid__summary) .inoforest-post-grid__more {
	margin-top: 0;
	padding-top: 0;
}

/* 6. Pagination (paginate_links(): .page-numbers, .current, .dots, .prev, .next) ------ */
.inoforest-post-grid__pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin-top: 56px;
}

.inoforest-post-grid .inoforest-post-grid__pagination .page-numbers {
	display: grid;
	place-items: center;
	min-width: var(--ino-pg-page-size);
	height: var(--ino-pg-page-size);
	padding: 0 10px;
	font-weight: 700;
	line-height: 1;
	color: var(--ino-pg-page-color, var(--ino-pg-heading));
	text-decoration: none;
	background: var(--ino-pg-page-bg, transparent);
	border: 1px solid var(--ino-pg-page-border, var(--ino-pg-border));
	border-radius: 50%;
	transition: background-color 0.35s var(--ino-pg-ease), color 0.35s var(--ino-pg-ease), border-color 0.35s var(--ino-pg-ease);
}

.inoforest-post-grid .inoforest-post-grid__pagination a.page-numbers:hover,
.inoforest-post-grid .inoforest-post-grid__pagination a.page-numbers:focus-visible {
	color: var(--ino-pg-page-color-hover, #fff);
	background: var(--ino-pg-page-bg-hover, var(--ino-pg-primary));
	border-color: var(--ino-pg-page-border-hover, var(--ino-pg-primary));
}

.inoforest-post-grid .inoforest-post-grid__pagination .page-numbers.current {
	color: var(--ino-pg-page-color-active, #fff);
	background: var(--ino-pg-page-bg-active, var(--ino-pg-primary));
	border-color: var(--ino-pg-page-border-active, var(--ino-pg-primary));
}

.inoforest-post-grid .inoforest-post-grid__pagination .page-numbers.dots {
	border-color: transparent;
}

.inoforest-post-grid__pagination .page-numbers svg {
	width: 1.1em;
	height: 1.1em;
	fill: currentColor;
}

/* 7. Editor hint ---------------------------------------------------------------------- */
.inoforest-post-grid__hint {
	margin: 0 0 16px;
	padding: 16px 20px;
	text-align: center;
	border: 1px dashed var(--inoforest-color-border, #e5ebef);
	border-radius: 16px;
}

/* 8. Sticky post and Nothing found (blog.html?sticky and ?empty) ---------------------------- */
.inoforest-post-grid {
	--ino-pg-sticky-border: var(--ino-pg-primary);
	--ino-pg-sticky-bg: var(--inoforest-color-surface, #f4f8f8);
	--ino-pg-sticky-badge-bg: var(--ino-pg-primary);
	--ino-pg-sticky-badge-color: #fff;
	--ino-pg-empty-bg: var(--inoforest-color-surface, #f4f8f8);
	--ino-pg-empty-icon: var(--ino-pg-primary);
	--ino-pg-empty-title: var(--ino-pg-heading);
}

/* A sticky post spans the grid (grid layout only; in the list layout every card is already wide). */
.inoforest-post-grid[data-layout="grid"] .inoforest-post-grid__card--sticky {
	grid-column: 1 / -1;
}

.inoforest-post-grid .inoforest-post-grid__card--sticky {
	border-color: var(--ino-pg-sticky-border);
}

.inoforest-post-grid .inoforest-post-grid__card--sticky .inoforest-post-grid__body {
	background: var(--ino-pg-sticky-bg);
}

.inoforest-post-grid .inoforest-post-grid__sticky {
	position: absolute;
	top: 20px;
	left: 20px;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	font-size: 0.8rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--ino-pg-sticky-badge-color);
	background: var(--ino-pg-sticky-badge-bg);
	border-radius: 50px;
}

/* The badge before the category (1.4.0): in the text, not over the photo. */
.inoforest-post-grid .inoforest-post-grid__sticky--text {
	position: static;
	align-self: flex-start;
	margin-bottom: 10px;
}

.inoforest-post-grid__sticky svg {
	width: 0.85em;
	height: 0.85em;
	fill: currentColor;
}

.inoforest-post-grid__empty {
	padding: 56px 36px;
	text-align: center;
	background: var(--ino-pg-empty-bg);
	border: 1px dashed var(--ino-pg-border);
	border-radius: var(--ino-pg-radius);
}

.inoforest-post-grid .inoforest-post-grid__empty-icon {
	display: inline-grid;
	place-items: center;
	width: 84px;
	height: 84px;
	margin-bottom: 22px;
	font-size: 34px;
	color: var(--ino-pg-empty-icon);
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 6px 20px rgba(13, 27, 42, 0.07);
}

.inoforest-post-grid__empty-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.inoforest-post-grid .inoforest-post-grid__empty-title {
	margin: 0 0 12px;
	font-size: clamp(1.4rem, 2.4vw, 1.75rem);
	color: var(--ino-pg-empty-title);
}

.inoforest-post-grid .inoforest-post-grid__empty-text {
	max-width: 480px;
	margin: 0 auto 26px;
}

.inoforest-post-grid .inoforest-post-grid__search {
	position: relative;
	max-width: 440px;
	margin: 0 auto;
}

.inoforest-post-grid .inoforest-post-grid__search .search-field {
	width: 100%;
	height: 56px;
	padding: 0 60px 0 20px;
	font: inherit;
	color: var(--ino-pg-heading);
	background: #fff;
	border: 1px solid var(--ino-pg-border);
	border-radius: 50px;
	outline: 0;
	transition: border-color 0.3s ease;
}

.inoforest-post-grid .inoforest-post-grid__search .search-field:focus {
	border-color: var(--ino-pg-primary);
}

.inoforest-post-grid .inoforest-post-grid__search .search-submit {
	position: absolute;
	top: 6px;
	right: 6px;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	color: #fff;
	background: var(--ino-pg-primary);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: background 0.3s ease;
}

.inoforest-post-grid .inoforest-post-grid__search .search-submit:hover,
.inoforest-post-grid .inoforest-post-grid__search .search-submit:focus-visible {
	background: var(--ino-pg-accent);
}

.inoforest-post-grid .inoforest-post-grid__topics {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 26px;
	padding-top: 22px;
	font-size: 0.9rem;
	border-top: 1px solid var(--ino-pg-border);
}

.inoforest-post-grid__topics > span {
	margin-right: 4px;
	font-weight: 700;
	color: var(--ino-pg-heading);
}

.inoforest-post-grid .inoforest-post-grid__topics a {
	padding: 6px 14px;
	font-weight: 600;
	color: var(--ino-pg-text);
	text-decoration: none;
	background: #fff;
	border-radius: 50px;
	transition: background 0.3s ease, color 0.3s ease;
}

.inoforest-post-grid .inoforest-post-grid__topics a:hover,
.inoforest-post-grid .inoforest-post-grid__topics a:focus-visible {
	color: #fff;
	background: var(--ino-pg-primary);
}

/* 9. Responsive and reduced motion ------------------------------------------------------ */
@media (min-width: 768px) {
	.inoforest-post-grid[data-layout="list"] .inoforest-post-grid__card {
		flex-direction: row;
	}

	.inoforest-post-grid[data-layout="list"] .inoforest-post-grid__media {
		flex: 0 0 var(--ino-pg-list-image);
		min-height: 240px;
		aspect-ratio: auto;
	}

	/* The text sets the card's height; the photo fills its side. */
	.inoforest-post-grid[data-layout="list"] .inoforest-post-grid__image {
		position: absolute;
		inset: 0;
	}

	/* Sticky post: photo beside the text, as in the list layout. */
	.inoforest-post-grid .inoforest-post-grid__card--sticky {
		flex-direction: row;
	}

	.inoforest-post-grid .inoforest-post-grid__card--sticky .inoforest-post-grid__media {
		flex: 0 0 var(--ino-pg-sticky-photo, 52%);
		min-height: var(--ino-pg-sticky-min, 330px);
		aspect-ratio: auto;
	}

	.inoforest-post-grid .inoforest-post-grid__card--sticky .inoforest-post-grid__image {
		position: absolute;
		inset: 0;
	}

	.inoforest-post-grid .inoforest-post-grid__card--sticky .inoforest-post-grid__body {
		justify-content: center;
		padding: 36px 40px;
	}

	.inoforest-post-grid .inoforest-post-grid__card--sticky .inoforest-post-grid__title {
		font-size: clamp(1.35rem, 2vw, 1.65rem);
	}

	.inoforest-post-grid .inoforest-post-grid__card--sticky .inoforest-post-grid__more {
		margin-top: 6px;
	}
}

@media (min-width: 768px) {
	/* Featured post on top: photo beside the text; compact posts in a row, photo above the text. */
	.inoforest-post-grid[data-featured="top"] .inoforest-post-grid__card--featured {
		flex-direction: row;
	}

	.inoforest-post-grid[data-featured="top"] .inoforest-post-grid__card--featured .inoforest-post-grid__media {
		flex: 0 0 var(--ino-pg-featured-image, 55%);
		min-height: var(--ino-pg-featured-height, 360px);
		aspect-ratio: auto;
	}

	.inoforest-post-grid[data-featured="top"] .inoforest-post-grid__card--featured .inoforest-post-grid__image {
		position: absolute;
		inset: 0;
	}

	.inoforest-post-grid :where([data-featured="top"] .inoforest-post-grid__card--featured) .inoforest-post-grid__body {
		justify-content: center;
		padding: 40px;
	}

	.inoforest-post-grid :where([data-featured="top"] .inoforest-post-grid__card--featured) .inoforest-post-grid__more {
		margin-top: 6px;
	}

	.inoforest-post-grid[data-featured="top"] .inoforest-post-grid__stack {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.inoforest-post-grid[data-featured="top"] .inoforest-post-grid__card--compact {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
		align-content: start;
		padding: 14px 14px 22px;
	}

	.inoforest-post-grid[data-featured="top"] .inoforest-post-grid__summary {
		padding-inline: 8px;
	}

	.inoforest-post-grid[data-featured="top"] .inoforest-post-grid__card--compact .inoforest-post-grid__media {
		min-height: 0;
		aspect-ratio: var(--ino-pg-ratio);
	}
}

@media (max-width: 991px) {
	.inoforest-post-grid[data-featured] .inoforest-post-grid__showcase {
		grid-template-columns: minmax(0, 1fr);
	}

	.inoforest-post-grid[data-featured="right"] .inoforest-post-grid__card--featured {
		order: 0;
	}
}

@media (max-width: 767px) {
	/* The design's 15 px base font on phones. */
	.inoforest-post-grid .inoforest-post-grid__excerpt,
	.inoforest-post-grid .inoforest-post-grid__more {
		font-size: 0.9375rem;
	}

	.inoforest-post-grid .inoforest-post-grid__card--compact {
		grid-template-columns: var(--ino-pg-compact-image, 110px) minmax(0, 1fr);
		gap: 16px;
		padding: 10px 14px 10px 10px;
	}

	.inoforest-post-grid .inoforest-post-grid__card--compact .inoforest-post-grid__media {
		min-height: var(--ino-pg-compact-height, 110px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.inoforest-post-grid__card,
	.inoforest-post-grid .inoforest-post-grid__image img,
	.inoforest-post-grid .inoforest-post-grid__more svg,
	.inoforest-post-grid .inoforest-post-grid__more i {
		transition: none;
	}

	.inoforest-post-grid[data-hover="lift"] .inoforest-post-grid__card:hover,
	.inoforest-post-grid[data-hover="lift"] .inoforest-post-grid__card:focus-within,
	.inoforest-post-grid:not([data-hover="none"]) .inoforest-post-grid__card:hover .inoforest-post-grid__image img,
	.inoforest-post-grid:not([data-hover="none"]) .inoforest-post-grid__card:focus-within .inoforest-post-grid__image img,
	.inoforest-post-grid .inoforest-post-grid__more:hover svg,
	.inoforest-post-grid .inoforest-post-grid__more:hover i {
		transform: none;
	}
}
