/* Blog pages only (keeps homepage untouched) */

.blog-page {
	text-align: left;
}

.blog-page .content {
	overflow: visible;
}

.breadcrumbs {
	margin-top: 20px;
	padding-bottom: 8px;
	font-size: 0.95rem;
}

.breadcrumbs ol {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	padding: 0;
	margin: 0;
	align-items: center;
}

.breadcrumbs li {
	display: inline-flex;
	gap: 10px;
	align-items: center;
}

.breadcrumbs li:not(:last-child)::after {
	content: '›';
	opacity: 0.6;
}

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

.breadcrumbs a:hover {
	color: var(--primary-color-hover);
}

.blog-hero {
	padding-top: 20px;
	padding-bottom: 40px;
}

.blog-hero h1 {
	color: var(--primary-color);
	margin-bottom: 14px;
}

/* Blog index: classic vertical list (distinct from homepage masonry cards) */
.blog-index-list {
	margin-top: 8px;
	max-width: 100%;
	display: flex;
	flex-direction: column;
	gap: 0;
}

.blog-index-item {
	border-bottom: 1px solid #d1d9e2;
}

.blog-index-item:last-child {
	border-bottom: none;
}

.blog-index-item__card {
	display: grid;
	grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
	gap: 28px;
	align-items: stretch;
	padding: 28px 0;
	text-decoration: none;
	color: inherit;
	transition: background-color 0.2s ease;
	border-radius: 16px;
	margin: 0 -12px;
	padding-left: 12px;
	padding-right: 12px;
}

.blog-index-item__card:hover {
	background: rgba(255, 255, 255, 0.65);
}

.blog-index-item__card:hover .blog-index-item__title {
	color: var(--primary-color-hover);
}

.blog-index-item__media {
	border-radius: 14px;
	overflow: hidden;
	border: 1px solid #d1d9e2;
	background: #eef2f6;
	aspect-ratio: 16 / 10;
}

.blog-index-item__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition:
		opacity 0.25s ease,
		transform 0.35s ease;
}

.blog-index-item__card:hover .blog-index-item__media img {
	opacity: 0.92;
	transform: scale(1.02);
}

.blog-index-item__body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 10px;
	min-width: 0;
}

.blog-index-item__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	font-size: 0.9rem;
	line-height: 1.4;
	color: rgba(0, 0, 0, 0.55);
}

.blog-index-item__meta time {
	font-variant-numeric: tabular-nums;
}

.blog-index-item__sep {
	opacity: 0.45;
	user-select: none;
}

.blog-index-item__read {
	white-space: nowrap;
}

.blog-index-item__title {
	margin: 0;
	font-size: 1.45rem;
	line-height: 1.25;
	font-weight: 700;
	color: var(--primary-color);
	transition: color 0.2s ease;
}

.blog-index-item__excerpt {
	margin: 0;
	font-size: 1.02rem;
	line-height: 1.65;
	color: rgba(0, 0, 0, 0.78);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

@media screen and (max-width: 720px) {
	.blog-index-item__card {
		grid-template-columns: 1fr;
		gap: 16px;
		padding-top: 22px;
		padding-bottom: 22px;
	}

	.blog-index-item__media {
		aspect-ratio: 16 / 9;
		max-height: 220px;
	}

	.blog-index-item__title {
		font-size: 1.3rem;
	}
}

.post-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	align-items: center;
	opacity: 0.85;
	font-size: 0.95rem;
}

.post-meta .dot {
	opacity: 0.5;
}

.hero-media {
	margin-top: 24px;
	border-radius: 20px;
	overflow: hidden;
	border: 1px solid #d1d9e2;
	background: var(--white);
}

.hero-media img {
	width: 100%;
	height: 420px;
	object-fit: cover;
	display: block;
}

.article-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
	gap: 48px;
	/* stretch: desna kolona mora imati punu visinu reda da bi sticky TOC imao prostor da „klizi“ tokom čitanja */
	align-items: stretch;
	padding-top: 20px;
	padding-bottom: 40px;
}

.article-aside {
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.blog-page .article-content h2[id] {
	scroll-margin-top: 5.5rem;
}

.article-card {
	background: var(--white);
	border-radius: 20px;
	border: 1px solid rgba(209, 217, 226, 0.95);
	padding: 28px;
	box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.article-content article {
	max-width: 78ch;
}

.article-content h2 {
	font-size: 2rem;
	line-height: 2.3rem;
	margin-top: 34px;
	margin-bottom: 14px;
}

.article-content h3 {
	font-size: 1.35rem;
	line-height: 1.75rem;
	margin-top: 22px;
	margin-bottom: 10px;
}

.faq {
	margin-top: 8px;
}

.faq-item {
	border: 1px solid #d1d9e2;
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.7);
	margin: 12px 0;
	overflow: hidden;
}

.faq-item summary {
	cursor: pointer;
	list-style: none;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.faq-item summary::-webkit-details-marker {
	display: none;
}

.faq-item summary::after {
	content: '+';
	margin-left: auto;
	font-weight: 700;
	opacity: 0.8;
}

.faq-item[open] summary::after {
	content: '–';
}

.faq-question {
	font-size: 1.1rem;
	line-height: 1.5rem;
	font-weight: 700;
	color: var(--primary-color);
}

.faq-answer {
	padding: 0 16px 14px;
}

.faq-answer p:last-child {
	margin-bottom: 0;
}

.article-content p {
	line-height: 1.8;
	margin: 0 0 14px;
}

.article-content ul {
	padding-left: 18px;
	margin: 0 0 16px;
	line-height: 1.8;
}

.article-content a {
	color: var(--primary-color);
}

.article-content a:hover {
	color: var(--primary-color-hover);
}

.blog-cta-banner {
	margin-top: 24px;
}

.blog-cta-banner__inner {
	border-radius: 20px;
	border: 1px solid #d1d9e2;
	background: var(--light-bg);
	padding: 24px;
	display: grid;
	gap: 10px;
	align-items: start;
}

.blog-cta-banner__inner h2 {
	margin: 0;
	font-size: 1.75rem;
	line-height: 2rem;
}

.blog-cta-banner__inner p {
	margin: 0;
	line-height: 1.7;
	max-width: 72ch;
}

.blog-cta-banner__inner .cta-button {
	justify-self: start;
	margin-top: 8px;
}

.author-card {
	display: flex;
	gap: 14px;
	align-items: center;
	border-top: 1px solid #d1d9e2;
	padding-top: 20px;
	margin-top: 28px;
}

.author-card img {
	width: 56px;
	height: 56px;
	border-radius: 999px;
	object-fit: cover;
	flex: 0 0 auto;
}

.author-card strong {
	display: block;
}

.aside-sticky {
	position: sticky;
	top: calc(1rem + env(safe-area-inset-top, 0px));
	align-self: flex-start;
	width: 100%;
	display: flex;
	flex-direction: column;
	gap: 18px;
	max-height: calc(100vh - 2rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
	overflow-y: auto;
	overflow-x: hidden;
	padding-right: 6px;
	scrollbar-color: rgba(2, 115, 97, 0.35) transparent;
	scrollbar-width: thin;
}

.aside-sticky::-webkit-scrollbar {
	width: 6px;
}

.aside-sticky::-webkit-scrollbar-thumb {
	background: rgba(2, 115, 97, 0.25);
	border-radius: 999px;
}

/* Bočni „Sadržaj“ — moderan TOC sa vertikalnom šinom */
.article-toc {
	--toc-rail-x: 18px;
	position: relative;
	padding: 0;
	border-radius: 18px;
	background: linear-gradient(155deg, #ffffff 0%, #f5faf8 55%, #f0f7f5 100%);
	border: 1px solid rgba(2, 115, 97, 0.14);
	box-shadow:
		0 1px 2px rgba(15, 23, 42, 0.04),
		0 10px 36px rgba(2, 115, 97, 0.08);
	overflow: hidden;
}

.article-toc__head {
	padding: 18px 20px 14px;
	border-bottom: 1px solid rgba(2, 115, 97, 0.1);
	background: rgba(255, 255, 255, 0.55);
}

.article-toc__eyebrow {
	display: block;
	font-size: 0.68rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	font-weight: 700;
	font-family: 'Manrope', sans-serif;
	color: var(--primary-color);
	opacity: 0.9;
	margin: 0 0 6px;
}

.article-toc__title {
	font-family: 'Petrona', serif;
	font-size: 1.32rem;
	font-weight: 600;
	line-height: 1.3;
	margin: 0;
	color: var(--black);
}

.article-toc__body {
	position: relative;
	padding: 16px 18px 20px;
	min-height: 72px;
}

.article-toc__rail {
	position: absolute;
	left: var(--toc-rail-x);
	top: 16px;
	bottom: 20px;
	width: 3px;
	pointer-events: none;
	border-radius: 999px;
}

.article-toc__rail-track {
	position: absolute;
	inset: 0;
	border-radius: 999px;
	background: rgba(2, 115, 97, 0.14);
}

.article-toc__rail-fill {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 0%;
	border-radius: 999px;
	background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-color-hover) 100%);
	box-shadow: 0 0 14px rgba(2, 115, 97, 0.35);
	transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	will-change: height;
}

@media (prefers-reduced-motion: reduce) {
	.article-toc__rail-fill {
		transition: none;
	}
}

.article-toc__list {
	list-style: none;
	margin: 0;
	padding: 0 0 0 30px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.article-toc__item {
	position: relative;
	margin: 0;
}

.article-toc__item::before {
	content: '';
	position: absolute;
	left: -21px;
	top: 50%;
	transform: translateY(-50%);
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid rgba(2, 115, 97, 0.28);
	z-index: 1;
	transition:
		border-color 0.2s ease,
		background 0.2s ease,
		transform 0.2s ease,
		box-shadow 0.2s ease;
	box-sizing: border-box;
}

.article-toc__item.is-active::before {
	border-color: var(--primary-color);
	background: var(--primary-color);
	transform: translateY(-50%) scale(1.12);
	box-shadow: 0 0 0 3px rgba(2, 115, 97, 0.18);
}

.article-toc__link {
	display: block;
	padding: 9px 12px 9px 6px;
	border-radius: 11px;
	font-size: 0.94rem;
	line-height: 1.4;
	font-weight: 500;
	color: rgba(0, 0, 0, 0.72);
	text-decoration: none;
	transition:
		color 0.2s ease,
		background 0.2s ease;
}

.article-toc__link:hover {
	color: var(--primary-color-hover);
	background: rgba(2, 115, 97, 0.07);
}

.article-toc__item.is-active .article-toc__link {
	color: var(--primary-color);
	font-weight: 700;
	background: rgba(2, 115, 97, 0.1);
}

.article-toc__link:focus-visible {
	outline: 2px solid var(--primary-color);
	outline-offset: 2px;
}

.aside-card h3 {
	font-size: 1.5rem;
	line-height: 1.8rem;
	margin-bottom: 12px;
}

.aside-card ul {
	margin: 0;
	padding-left: 18px;
	line-height: 1.8;
}

.aside-card a {
	color: inherit;
	text-decoration: none;
}

.aside-card a:hover {
	color: var(--primary-color-hover);
}

.aside-card .cta-button {
	width: 100%;
	justify-content: center;
}

.related-posts {
	padding-top: 40px;
}

.related-posts h2 {
	margin-bottom: 16px;
}

.related-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 18px;
}

.related-item {
	display: flex;
	flex-direction: column;
	gap: 10px;
	text-decoration: none;
	color: inherit;
	background: var(--white);
	border-radius: 20px;
	overflow: hidden;
	border: 1px solid #d1d9e2;
}

.related-item img {
	width: 100%;
	height: 160px;
	object-fit: cover;
	display: block;
}

.related-item .pad {
	padding: 14px 14px 18px;
}

.related-item h3 {
	font-size: 1.25rem;
	line-height: 1.3;
	margin-bottom: 6px;
}

.related-item p {
	margin: 0;
	opacity: 0.85;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.related-item:hover h3 {
	color: var(--primary-color-hover);
}

.related-item:hover img {
	opacity: 0.8;
}

@media screen and (max-width: 1200px) {
	.hero-media img {
		height: 320px;
	}

	.article-layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 32px;
	}

	/* Bez bočne kolone nema smisla prikazivati TOC — sakriveno, ne iznad teksta */
	.article-aside {
		display: none;
	}

	.related-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media screen and (max-width: 600px) {
	.hero-media img {
		height: 220px;
	}

	.article-card {
		padding: 18px;
		border-radius: 16px;
	}

	.related-grid {
		grid-template-columns: 1fr;
	}
}
