/*
 * D2P Novosti – blog/news page styles
 * Učitava se na: is_home() + stranice sa blog.php template-om
 *
 * Scopovano: .d2p-novosti-page-wrap (home.php)
 *            .d2p-novosti-page body class (category.php grid)
 */

/* ─── Outer wrap ───────────────────────────────────────────────────── */

.d2p-novosti-page-wrap {
	width: 100%;
}

/* ─── FILTERI (iznad hero sekcije) ─────────────────────────────────── */

.d2p-novosti-filters {
	background: #fff;
	border-bottom: 1px solid #e8e6e1;
	padding: 14px 0;
}

.d2p-novosti-filters__nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 0 24px;
}

.d2p-novosti-filters__btn {
	display: inline-block;
	padding: 7px 20px;
	border: 1.5px solid #d0cec9;
	border-radius: 100px;
	font-family: 'Open Sans', sans-serif;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 1.4px;
	text-transform: uppercase;
	color: #3a3a38;
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.d2p-novosti-filters__btn:hover {
	background: #0C2340;
	border-color: #0C2340;
	color: #fff;
}

.d2p-novosti-filters__btn.active {
	background: #789B9E;
	border-color: #789B9E;
	color: #fff;
}

@media (max-width: 768px) {
	.d2p-novosti-filters__nav {
		padding: 0 16px;
		gap: 6px;
	}
	.d2p-novosti-filters__btn {
		font-size: 10px;
		padding: 6px 14px;
	}
}

/* ─── HERO SEKCIJA ─────────────────────────────────────────────────── */

.d2p-novosti-hero {
	background: #F6F7F2;
	color: #0C2340;
	width: 100%;
	padding: 56px 0;
	overflow: hidden;
	font-family: 'Open Sans', sans-serif;
}

/* content_wrap nasljeđuje theme padding i max-width; ne overridujemo */

.d2p-novosti-hero__inner {
	display: flex !important;
	align-items: center;
	gap: 48px;
	min-height: 0;
	padding: 0 24px;
}

/* Tekst strana */
.d2p-novosti-hero__text {
	flex: 1 1 0;
	min-width: 0;
}

.d2p-novosti-hero__title {
	font-size: clamp(22px, 2.4vw, 32px);
	font-weight: 700;
	line-height: 1.25;
	margin: 0 0 16px;
	color: #0C2340;
}
.d2p-novosti-hero__title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.15s;
}
.d2p-novosti-hero__title a:hover { color: #789B9E; }

.d2p-novosti-hero__excerpt {
	font-size: 15px;
	line-height: 1.65;
	color: #4a5568;
	margin: 0 0 18px;
	max-width: 560px;
}

.d2p-novosti-hero__meta {
	margin-bottom: 28px;
}

.d2p-novosti-hero__date {
	font-size: 13px;
	color: #8a9ab0;
}

.d2p-novosti-hero__cta {
	display: inline-block;
	background: #FE5000;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	font-family: 'Open Sans', sans-serif;
	letter-spacing: 0.5px;
	padding: 11px 28px;
	border-radius: 4px;
	text-decoration: none;
	transition: background 0.2s, color 0.2s;
}
.d2p-novosti-hero__cta:hover { background: #0C2340; color: #FE5000; }

/* Slika strana */
.d2p-novosti-hero__image {
	flex: 0 0 44%;
	max-width: 44%;
	max-height: 380px; /* nikad veće od ove visine */
	overflow: hidden;
	border-radius: 8px;
	box-shadow: 0 8px 32px rgba(0,0,0,0.30);
}
.d2p-novosti-hero__image a {
	display: block;
	height: 100%;
}
.d2p-novosti-hero__image img {
	width: 100%;
	height: 340px;
	max-height: 340px;
	object-fit: cover;
	object-position: center top; /* vrh slike, najčešće lice/logo */
	display: block;
}

/* ─── GRID SEKCIJA ─────────────────────────────────────────────────── */

.d2p-novosti-archive {
	padding: 56px 0 64px;
}

.d2p-novosti-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 28px 24px;
	margin-bottom: 48px;
}

/* ─── POST KARTICA ─────────────────────────────────────────────────── */

.d2p-novosti-card {
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 12px rgba(0,0,0,0.07);
	transition: box-shadow 0.2s, transform 0.2s;
	font-family: 'Open Sans', sans-serif;
}
.d2p-novosti-card:hover {
	box-shadow: 0 6px 24px rgba(0,0,0,0.13);
	transform: translateY(-3px);
}

.d2p-novosti-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: inherit;
}

.d2p-novosti-card__thumb {
	width: 100%;
	aspect-ratio: 438.75 / 247;
	overflow: hidden;
	background: #eef1f3;
	flex-shrink: 0;
}
.d2p-novosti-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}
.d2p-novosti-card:hover .d2p-novosti-card__thumb img {
	transform: scale(1.04);
}
.d2p-novosti-card__thumb-placeholder {
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #e8ecf0 0%, #d4dbe3 100%);
}

.d2p-novosti-card__body {
	padding: 16px 20px 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}

.d2p-novosti-card__title {
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
	color: #1a1a18;
	margin: 0;
	/* 3 linije max */
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.d2p-novosti-card:hover .d2p-novosti-card__title {
	color: #0C2340;
}

.d2p-novosti-card__date {
	font-size: 12px;
	color: #9a9a95;
	margin-top: auto;
	padding-top: 8px;
}

/* ─── PAGINACIJA ───────────────────────────────────────────────────── */

.d2p-novosti-pagination {
	display: flex;
	justify-content: center;
}

.d2p-novosti-pagination .page-numbers {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 0;
	margin: 0;
}

.d2p-novosti-pagination .page-numbers li a,
.d2p-novosti-pagination .page-numbers li span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	color: #3a3a38;
	text-decoration: none;
	background: #fff;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.d2p-novosti-pagination .page-numbers li a:hover {
	background: #0C2340;
	border-color: #0C2340;
	color: #fff;
}

.d2p-novosti-pagination .page-numbers li span.current {
	background: #789B9E;
	border-color: #789B9E;
	color: #fff;
	font-weight: 600;
}

.d2p-novosti-pagination .page-numbers li span.dots {
	border-color: transparent;
	background: transparent;
	cursor: default;
}

/* ─── No results ───────────────────────────────────────────────────── */

.d2p-novosti-no-results {
	text-align: center;
	color: #888;
	padding: 48px 0;
}

/* ─── Category archive: 4 kolone (category.php) ───────────────────── */

.classic_wrap.classic_4.columns_wrap {
	display: flex;
	flex-wrap: wrap;
	gap: 24px 20px;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

.classic_wrap.classic_4.columns_wrap > .col-lg-3 {
	width: calc(25% - 15px) !important;
	flex: 0 0 calc(25% - 15px) !important;
	max-width: calc(25% - 15px) !important;
	float: none !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
}

body.category .post_layout_classic .post_featured {
	aspect-ratio: 438.75 / 247;
	overflow: hidden;
}
body.category .post_layout_classic .post_featured img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* ─── RESPONSIVE ───────────────────────────────────────────────────── */

/* Tablet: ≤900px – 2 kolone */
@media (max-width: 900px) {
	.d2p-novosti-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 20px 16px;
	}
}

/* Tablet mali: ≤768px – hero stack + 2 kolone */
@media (max-width: 768px) {
	.d2p-novosti-hero__inner {
		flex-direction: column;
		gap: 28px;
	}
	.d2p-novosti-hero__image {
		flex: 0 0 100%;
		max-width: 100%;
		max-height: 220px;
		order: -1;
	}
	.d2p-novosti-hero__image img {
		height: 220px;
		max-height: 220px;
	}
	.d2p-novosti-hero {
		padding: 36px 0;
	}
	.classic_wrap.classic_4.columns_wrap > .col-lg-3 {
		width: calc(50% - 10px) !important;
		flex: 0 0 calc(50% - 10px) !important;
		max-width: calc(50% - 10px) !important;
	}
}

/* Mobilni: ≤480px – 1 kolona */
@media (max-width: 480px) {
	.d2p-novosti-grid {
		grid-template-columns: 1fr;
	}
	.classic_wrap.classic_4.columns_wrap > .col-lg-3 {
		width: 100% !important;
		flex: 0 0 100% !important;
		max-width: 100% !important;
	}
}
