/**
 * Blog post card — [av_posts] shortcode + blog archive loop override.
 *
 * Matches Figma (Avemed Redesign → Aktualne novice in nasveti, 40:503):
 *   - soft tinted background on the card, tint color derived from primary category
 *   - rounded full-width image with pill category badge top-left
 *   - meta line (date • reading time), dark title, muted excerpt
 *   - "Preberi več →" link in the same accent color as the badge
 *
 * Each `.av-post-card--<color>` sets three CSS variables
 * (--av-pc-bg, --av-pc-accent, --av-pc-badge) consumed by the shared block
 * below, so adding a new color = add one modifier rule, zero duplication.
 */

 .av-posts__title {
	font-weight: 600;
	margin-bottom: 20px;
 }

/* Grid wrapper ------------------------------------------------------------- */
.av-posts {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.av-posts:not(.av-posts--slider) {
	display: grid;
	gap: 22px;
	grid-template-columns: repeat(var(--av-posts-cols, 3), minmax(0, 1fr));
}

@media (max-width: 849px) {
	.av-posts:not(.av-posts--slider) { grid-template-columns: 1fr; }
}

/* Slider wrapper ----------------------------------------------------------- */
/* Cards inside Flatsome's Flickity row need to fill their column height so
   the rounded corners + shadow read consistently across slides. */
.av-posts--slider .col.post-item { display: flex; }
.av-posts--slider .col.post-item > .av-post-card { width: 100%; }

/* Card base ---------------------------------------------------------------- */
.av-post-card {
	--av-pc-bg:     #f4f9f4;
	--av-pc-accent: #92c096;
	--av-pc-badge:  #92c096;
	--av-pc-ink:    #101828;
	--av-pc-body:   #4a5565;
	--av-pc-muted:  #6a7282;

	background: var(--av-pc-bg);
	border-radius: 18px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Color modifiers (tint + accent) ----------------------------------------- */
.av-post-card--orange { --av-pc-bg: #fdf5ec; --av-pc-accent: #eeaf53; --av-pc-badge: #eeaf53; }
.av-post-card--coral  { --av-pc-bg: #fdf0ed; --av-pc-accent: #f58e7d; --av-pc-badge: #f58e7d; }
.av-post-card--green  { --av-pc-bg: #f0f7f1; --av-pc-accent: #92c096; --av-pc-badge: #92c096; }
.av-post-card--blue   { --av-pc-bg: #eef3fb; --av-pc-accent: #6ea0d8; --av-pc-badge: #6ea0d8; }
.av-post-card--purple { --av-pc-bg: #f4f0fa; --av-pc-accent: #a78bda; --av-pc-badge: #a78bda; }

/* Media + badge ------------------------------------------------------------ */
.av-post-card__media {
	position: relative;
	display: block;
	aspect-ratio: 3 / 2;
	padding: 16px;
	overflow: hidden;
	line-height: 0;
	border-radius: 18px 18px 0 0;
}
.av-post-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 16px;
	transition: transform 0.5s ease;
}

.av-post-card__media-empty {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, var(--av-pc-bg), color-mix(in srgb, var(--av-pc-accent) 18%, transparent));
}

.av-post-card__badge {
	position: absolute;
	top: 32px;
	left: 32px;
	z-index: 2;
	background: var(--av-pc-badge);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 16px 14px;
	border-radius: 999px;
}

/* Body --------------------------------------------------------------------- */
.av-post-card__body {
	padding: 6px 22px 22px 26px;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	gap: 10px;
}


.av-post-card__meta {
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--av-pc-muted);
	font-size: 12px;
	font-weight: 500;
}
.av-post-card__dot { color: var(--av-pc-muted); }

.av-post-card__title {
	font-size: 20px !important;
	font-weight: 600 !important;
	line-height: 1.35 !important;
	color: var(--av-pc-ink) !important;
	margin: 0 !important;
	padding: 0 !important;
}
.av-post-card__title a {
	color: inherit !important;
	text-decoration: none;
	background: none;
	transition: color 0.3s;
}
.av-post-card__title a:hover { color: var(--av-pc-accent) !important; }

.av-post-card__excerpt {
	color: var(--av-pc-body) !important;
	font-size: 14px;
	line-height: 1.55;
	margin: 0 !important;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.av-post-card__more {
	margin-top: auto;
	color: var(--av-pc-accent) !important;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding-top: 8px;
}
.av-post-card__more svg { transition: transform 0.2s ease; }
.av-post-card__more:hover svg { transform: translateX(3px); }

/* Empty state -------------------------------------------------------------- */
.av-posts__empty { text-align: center; padding: 32px; }
.av-posts__empty mark { background: #fffbea; padding: 12px 16px; border-radius: 8px; display: inline-block; }

/* Compact variant when shown in archive context — gives a slightly tighter
   layout so the grid reads faster. */
body.blog .av-post-card,
body.archive .av-post-card { border-radius: 16px; }
body.blog .av-posts:not(.av-posts--slider),
body.archive .av-posts:not(.av-posts--slider) { gap: 28px; }

/* Mobile ------------------------------------------------------------------- */
@media (max-width: 640px) {
	.av-post-card__body { padding: 18px 18px 22px; gap: 8px; }
	.av-post-card__title { font-size: 18px !important; }
}

.av-single-post__category .av-post-card__badge {
	position: static;
	display: inline-flex;
	align-items: center;
	height: 27px;
	padding: 0 14px;
}

.av-single-post__back-row {
	display: flex;
	align-items: center;
	gap: 16px;
}
.av-single-post__category .av-post-card__badge {
	position: static;
	display: inline-flex;
	align-items: center;
	height: 27px;
	padding: 0 14px;
}

/* Share bar — end of single article ---------------------------------------- */
.av-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	margin: 40px 0 8px;
	padding-top: 28px;
	border-top: 1px solid #e6eae6;
}
.av-share__label {
	font-weight: 600;
	font-size: 15px;
	color: #101828;
}
.av-share__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}
.av-share__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 40px;
	padding: 0 16px;
	margin-bottom: 0;
	border: 1px solid #e6eae6;
	border-radius: 999px;
	background: #fff;
	color: #4a5565;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.av-share__btn:hover { transform: translateY(-1px); color: #fff; }
.av-share__btn svg { flex: none; }
.av-share__btn--facebook:hover { background: #1877f2; border-color: #1877f2; }
.av-share__btn--whatsapp:hover { background: #25d366; border-color: #25d366; }
.av-share__btn--linkedin:hover { background: #0a66c2; border-color: #0a66c2; }
.av-share__btn--copy:hover     { background: #92c096; border-color: #92c096; }
.av-share__btn--copy.is-copied {
	background: #92c096;
	border-color: #92c096;
	color: #fff;
}


.av-single-post  .av-product-faq--boxed {
	margin-top: 30px;
}

@media (max-width: 640px) {
	.av-share { gap: 12px; }
	.av-share__buttons { width: 100%; }
	.av-share__btn { flex: 1 1 auto; justify-content: center; }
}
