/* =============================================================================
   DZS Posts Widget
   BEM: .dzs-posts (block), __element, --modifier
   Only structural CSS here. Colors, spacing, typography come from
   Elementor Style controls or theme defaults — no overrides in this file.
   CSS custom properties --dzs-cols and --dzs-gap are set by Elementor
   responsive controls directly on .dzs-posts__inner.
   ============================================================================= */

/* --------------------------------------------------------------------------
   Shared
   -------------------------------------------------------------------------- */
.dzs-posts__inner {
	--dzs-cols: 3;
	--dzs-gap: 24px;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* --------------------------------------------------------------------------
   Grid layout
   -------------------------------------------------------------------------- */
.dzs-posts--grid .dzs-posts__inner {
	display: grid;
	grid-template-columns: repeat(var(--dzs-cols), 1fr);
	gap: var(--dzs-gap);
}

/* --------------------------------------------------------------------------
   Masonry layout
   Masonry.js positions items absolutely; container needs position:relative.
   Item width is calculated so Masonry.js can tile columns correctly.
   Horizontal gutter is read from --dzs-gap in JS (parseFloat getComputedStyle).
   Vertical gap comes from margin-bottom here.
   -------------------------------------------------------------------------- */
.dzs-posts--masonry .dzs-posts__inner {
	position: relative;
}

.dzs-posts--masonry .dzs-posts__item,
.dzs-posts--masonry .dzs-posts__sizer {
	width: calc((100% - var(--dzs-gap) * (var(--dzs-cols) - 1)) / var(--dzs-cols));
}

.dzs-posts--masonry .dzs-posts__item {
	margin-bottom: var(--dzs-gap);
}

.dzs-posts--masonry .dzs-posts__sizer {
	height: 0;
	padding: 0;
	margin: 0;
	overflow: hidden;
	visibility: hidden;
}

/* --------------------------------------------------------------------------
   Carousel layouts (Swiper v8) — shared
   -------------------------------------------------------------------------- */
.dzs-posts--carousel,
.dzs-posts--carousel-flush,
.dzs-posts--carousel-peek {
	position: relative;
}

.dzs-posts--carousel .dzs-posts__inner,
.dzs-posts--carousel-flush .dzs-posts__inner,
.dzs-posts--carousel-peek .dzs-posts__inner {
	overflow: hidden;
}

.dzs-posts--carousel .swiper-wrapper,
.dzs-posts--carousel-flush .swiper-wrapper,
.dzs-posts--carousel-peek .swiper-wrapper {
	display: flex;
	align-items: stretch;
}

.dzs-posts--carousel .dzs-posts__item,
.dzs-posts--carousel-flush .dzs-posts__item,
.dzs-posts--carousel-peek .dzs-posts__item {
	height: auto;
}

/* --------------------------------------------------------------------------
   Carousel – Peek: overflow visible so half-slides show on both sides.
   -------------------------------------------------------------------------- */
.dzs-posts--carousel-peek {
	overflow: visible;
}

.dzs-posts--carousel-peek .dzs-posts__inner {
	overflow: visible;
}

/* --------------------------------------------------------------------------
   Dots – below: element sits outside .swiper container in normal document
   flow — no position override needed.
   Dots – inside: Swiper positions it absolute; we only control bottom offset.
   -------------------------------------------------------------------------- */
.dzs-pagination--below {
	position: static !important;
	width: 100% !important;
	text-align: center;
	bottom: auto !important;
	transform: none !important;
}

.dzs-pagination--inside {
	position: absolute !important;
	left: 0;
	right: 0;
	text-align: center;
}

/* --------------------------------------------------------------------------
   Card — structural only, no colors or spacing (set via Elementor controls)
   -------------------------------------------------------------------------- */
.dzs-posts__card {
	height: 100%;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.dzs-posts__card-body {
	flex: 1;
	display: flex;
	flex-direction: column;
}

/* --------------------------------------------------------------------------
   Image
   -------------------------------------------------------------------------- */
.dzs-posts__image-link {
	display: block;
	overflow: hidden;
}

.dzs-posts__image-wrap {
	position: relative;
	padding-bottom: 60%;
	overflow: hidden;
}

.dzs-posts__image-wrap img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.dzs-posts__card--hover-zoom:hover .dzs-posts__image-wrap img {
	transform: scale(1.04);
}

/* --------------------------------------------------------------------------
   Meta (date, category)
   -------------------------------------------------------------------------- */
.dzs-posts__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3em 0.7em;
}

.dzs-posts__meta a {
	color: inherit;
	text-decoration: none;
}

.dzs-posts__meta a:hover {
	text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Title — inherits all font/size/spacing from theme + Elementor controls
   -------------------------------------------------------------------------- */
.dzs-posts__title a {
	text-decoration: none;
	color: inherit;
}

.dzs-posts__title a:hover {
	text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Excerpt
   -------------------------------------------------------------------------- */
.dzs-posts__excerpt {
	flex: 1;
}

/* --------------------------------------------------------------------------
   Read more
   -------------------------------------------------------------------------- */
.dzs-posts__read-more {
	display: inline-block;
	margin-top: auto;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.dzs-posts__read-more:hover {
	text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Carousel arrows — structural + positioning only, colors via Elementor
   -------------------------------------------------------------------------- */
.dzs-posts__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	cursor: pointer;
	padding: 0;
	line-height: 1;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.dzs-posts__arrow--prev {
	left: 8px;
}

.dzs-posts__arrow--next {
	right: 8px;
}

/* --------------------------------------------------------------------------
   Pagination (Grid / Masonry)
   -------------------------------------------------------------------------- */
.dzs-posts__pagination {
	text-align: center;
}

.dzs-posts__pagination .page-numbers {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 4px;
	list-style: none;
	padding: 0;
	margin: 0;
}

.dzs-posts__pagination .page-numbers li a,
.dzs-posts__pagination .page-numbers li span {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 2rem;
	height: 2rem;
	padding: 0 0.5em;
	text-decoration: none;
}
