/*
 * Dopee – blog options (Theme Options → Blog – Posts List / Blog – Single Post).
 */

/* ---------- Columns ---------- */
.dp-posts {
	--dp-cols: 3;
	--dp-gap: 28px;
}
.dp-posts--cols-2 { --dp-cols: 2; }
.dp-posts--cols-4 { --dp-cols: 4; }
/* Next to a sidebar there is less room. */
.dopee-sidebar-right .dp-content .dp-posts--cols-3,
.dopee-sidebar-left .dp-content .dp-posts--cols-3,
.dopee-sidebar-right .dp-content .dp-posts--cols-4,
.dopee-sidebar-left .dp-content .dp-posts--cols-4 { --dp-cols: 2; }

.dp-posts.dp-posts--grid,
.dp-posts.dp-posts--magazine {
	display: grid;
	grid-template-columns: repeat(var(--dp-cols), minmax(0, 1fr));
	gap: var(--dp-gap);
}

/* ---------- Magazine: the first post runs across the whole row ---------- */
.dp-posts--magazine > .dp-card:first-child {
	grid-column: 1 / -1;
}
@media (min-width: 768px) {
	.dp-posts--magazine > .dp-card:first-child:not(.dp-card--no-media) {
		display: grid;
		grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
	}
	.dp-posts--magazine > .dp-card:first-child .dp-card__figure,
	.dp-posts--magazine > .dp-card:first-child .dp-card__media {
		height: 100%;
	}
	.dp-posts--magazine > .dp-card:first-child .dp-card__body {
		justify-content: center;
		padding: clamp(28px, 4vw, 56px);
	}
	.dp-posts--magazine > .dp-card:first-child .dp-card__title {
		font-size: clamp(1.6rem, 2.6vw, 2.4rem);
	}
	.dp-posts--magazine.dp-posts--style-overlay > .dp-card:first-child {
		display: flex;
	}
	.dp-posts--magazine.dp-posts--style-overlay > .dp-card:first-child .dp-card__body {
		max-width: 760px;
		justify-content: flex-end;
	}
}

/* ---------- Masonry ---------- */
.dp-posts.dp-posts--masonry {
	display: block;
	columns: var(--dp-cols);
	column-gap: var(--dp-gap);
}
.dp-posts--masonry > .dp-card {
	break-inside: avoid;
	margin-bottom: var(--dp-gap);
}

/* ---------- Picture shape ---------- */
.dp-card__figure {
	position: relative;
}
.dp-posts--ratio-16-9 .dp-card__media { aspect-ratio: 16 / 9; }
.dp-posts--ratio-4-3 .dp-card__media { aspect-ratio: 4 / 3; }
.dp-posts--ratio-1-1 .dp-card__media { aspect-ratio: 1; }
.dp-posts--ratio-3-4 .dp-card__media { aspect-ratio: 3 / 4; }
.dp-posts--ratio-auto .dp-card__media { aspect-ratio: auto; }
.dp-posts--ratio-auto .dp-card__media img { height: auto; }
.dp-posts--ratio-auto .dp-card__media--placeholder { aspect-ratio: 16 / 11; }
.dp-posts--ratio-auto .dp-card__media--placeholder img { height: 100%; }

/* ---------- Picture hover ---------- */
.dp-posts--hover-none .dp-card__media img,
.dopee-hover .dp-posts--hover-none .dp-card:hover .dp-card__media img {
	transform: none;
}
.dp-posts--hover-tint .dp-card__media img {
	filter: grayscale(1);
	transition: filter 0.8s var(--dp-ease), transform 1.2s var(--dp-ease);
}
.dp-posts--hover-tint .dp-card:hover .dp-card__media img,
.dp-posts--hover-tint .dp-card:focus-within .dp-card__media img {
	filter: none;
}
.dopee-hover .dp-posts--hover-tint .dp-card:hover .dp-card__media img {
	transform: scale(1.03);
}
.dp-posts--hover-lift .dp-card__media img {
	transform: scale(1.1);
}
.dopee-hover .dp-posts--hover-lift .dp-card:hover .dp-card__media img {
	transform: scale(1);
}

/* ---------- Category badge ---------- */
.dp-card__badge {
	position: absolute;
	z-index: 2;
	top: 14px;
	left: 14px;
	padding: 6px 12px;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #fff;
	background: var(--dp-primary);
	border-radius: 999px;
	line-height: 1.2;
}
.dp-card__badge:hover {
	color: #fff;
	filter: brightness(1.08);
}

/* ---------- Card style: minimal ---------- */
.dp-posts--style-minimal .dp-card {
	background: transparent;
	border: 0;
	border-radius: 0;
	overflow: visible;
}
.dopee-hover .dp-posts--style-minimal .dp-card:hover {
	transform: none;
	box-shadow: none;
}
.dp-posts--style-minimal .dp-card__media {
	border-radius: var(--dp-radius);
}
.dp-posts--style-minimal .dp-card__body {
	padding: 20px 0 0;
}
.dp-posts--style-minimal.dp-posts--list .dp-card__body,
.dp-posts--style-minimal.dp-posts--magazine > .dp-card:first-child .dp-card__body {
	padding: 8px 0 8px clamp(20px, 3vw, 40px);
}

/* ---------- Card style: overlay (text on the picture) ---------- */
.dp-posts--style-overlay .dp-card {
	isolation: isolate;
	min-height: 360px;
	justify-content: flex-end;
	border: 0;
	background: #0c0d0d;
}
.dp-posts--style-overlay .dp-card__figure {
	position: absolute;
	inset: 0;
	z-index: -1;
}
.dp-posts--style-overlay .dp-card__media {
	width: 100%;
	height: 100%;
	aspect-ratio: auto;
}
.dp-posts--style-overlay.dp-posts--ratio-auto .dp-card__media img {
	height: 100%;
}
.dp-posts--style-overlay .dp-card__figure::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.35) 45%, rgba(0, 0, 0, 0.05) 75%);
	pointer-events: none;
}
.dp-posts--style-overlay .dp-card__body {
	flex: 0 0 auto;
	position: relative;
	color: #fff;
}
.dp-posts--style-overlay .dp-card__body,
.dp-posts--style-overlay .dp-card__title a,
.dp-posts--style-overlay .dp-meta,
.dp-posts--style-overlay .dp-link-arrow {
	color: #fff;
}
.dp-posts--style-overlay .dp-card__excerpt {
	color: rgba(255, 255, 255, 0.78);
}
/* Whole card clickable; links inside stay clickable above it. */
.dp-posts--style-overlay .dp-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
}
.dp-posts--style-overlay .dp-meta a,
.dp-posts--style-overlay .dp-link-arrow,
.dp-posts--style-overlay .dp-card__badge {
	position: relative;
	z-index: 1;
}
.dp-posts--style-overlay.dp-posts--ratio-1-1 .dp-card,
.dp-posts--style-overlay.dp-posts--ratio-3-4 .dp-card {
	min-height: 0;
	aspect-ratio: var(--dp-ov-ratio, 1);
}
.dp-posts--style-overlay.dp-posts--ratio-3-4 .dp-card { --dp-ov-ratio: 3 / 4; }
.dp-posts--style-overlay.dp-posts--list .dp-card {
	display: flex;
	min-height: 420px;
}
.dp-posts--style-overlay.dp-posts--magazine > .dp-card:first-child {
	min-height: clamp(420px, 55vw, 620px);
	aspect-ratio: auto;
}

/* ---------- Load more / older-newer ---------- */
.dp-loadmore {
	display: flex;
	justify-content: center;
	margin-top: clamp(40px, 5vw, 64px);
}
.dp-loadmore__btn[aria-busy="true"] {
	opacity: 0.7;
	pointer-events: none;
}
.posts-navigation .nav-links {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	margin-top: clamp(40px, 5vw, 64px);
}
.posts-navigation .nav-next {
	margin-left: auto;
}
.posts-navigation a {
	display: inline-flex;
	padding: 12px 22px;
	border: 1px solid var(--dp-border-strong);
	border-radius: 999px;
	color: var(--dp-text);
	font-weight: 600;
	transition: border-color 0.3s;
}
.posts-navigation a:hover {
	border-color: var(--dp-primary);
}

/* ---------- Single: header styles ---------- */
.dp-single--image-top .dp-post-thumb {
	margin-bottom: 36px;
}
.dp-post-hero {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: min(78vh, 760px);
	padding-block: calc(var(--dp-header-h) + 48px) clamp(40px, 6vw, 80px);
	overflow: hidden;
	color: #fff;
	isolation: isolate;
	background: #0c0d0d;
}
.dp-post-hero .dp-post-hero__img {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	max-width: none;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
}
.dp-post-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.35) 55%, rgba(0, 0, 0, 0.15) 100%);
}
.dp-post-hero__inner {
	width: 100%;
}
.dp-post-hero .dp-meta,
.dp-post-hero .dp-meta a {
	color: rgba(255, 255, 255, 0.85);
}
.dp-post-hero .dp-meta__cats a {
	color: var(--dp-primary);
}
.dp-post-hero__title {
	max-width: 18ch;
	margin: 16px 0 0;
	color: #fff;
}

/* Narrow, easy-to-read column when there is no sidebar. */
.dp-single--narrow {
	width: 100%;
	max-width: 760px;
	margin-inline: auto;
}

/* ---------- Drop cap ---------- */
.dp-entry--dropcap > p:first-of-type::first-letter {
	float: left;
	margin: 0.06em 0.12em 0 0;
	font-family: var(--dp-font-heading);
	font-size: 4.4em;
	font-weight: 700;
	line-height: 0.8;
	color: var(--dp-primary);
}

/* ---------- Share ---------- */
.dp-share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 32px 0;
}
.dp-share__label {
	margin-right: 6px;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--dp-muted);
}
.dp-share__link {
	display: inline-grid;
	place-items: center;
	width: 42px;
	height: 42px;
	padding: 0;
	color: var(--dp-text);
	background: transparent;
	border: 1px solid var(--dp-border-strong);
	border-radius: 50%;
	cursor: pointer;
	transition: color 0.3s, border-color 0.3s, background-color 0.3s, transform 0.4s var(--dp-ease);
}
.dp-share__link:hover,
.dp-share__link:focus-visible {
	color: #fff;
	background: var(--dp-primary);
	border-color: var(--dp-primary);
	transform: translateY(-2px);
}
.dp-share__copy.is-copied {
	color: #fff;
	background: var(--dp-secondary, var(--dp-primary));
	border-color: transparent;
}

/* ---------- Author box ---------- */
.dp-author-box {
	display: flex;
	gap: 24px;
	align-items: flex-start;
	margin: 40px 0;
	padding: clamp(22px, 3vw, 32px);
	background: var(--dp-surface);
	border: 1px solid var(--dp-border);
	border-radius: var(--dp-radius);
}
.dp-author-box .dp-author-box__avatar {
	flex: 0 0 auto;
	width: 80px;
	height: 80px;
	border-radius: 50%;
	object-fit: cover;
}
.dp-author-box__body {
	display: grid;
	gap: 6px;
	min-width: 0;
}
.dp-author-box__label {
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--dp-primary);
}
.dp-author-box__name {
	margin: 0;
	font-size: 1.35rem;
}
.dp-author-box__bio {
	margin: 4px 0 6px;
	color: var(--dp-muted);
}

/* ---------- Related posts ---------- */
.dp-related {
	margin-top: clamp(56px, 7vw, 88px);
	padding-top: clamp(40px, 5vw, 56px);
	border-top: 1px solid var(--dp-border);
}
.dp-related__title {
	margin: 0 0 28px;
	font-size: clamp(1.5rem, 2.4vw, 2rem);
}
.dp-related .dp-posts.dp-related__posts {
	--dp-cols: 3;
	display: grid;
	columns: auto;
	grid-template-columns: repeat(var(--dp-cols), minmax(0, 1fr));
}
.dp-related .dp-posts--list .dp-card,
.dp-related .dp-posts--magazine > .dp-card:first-child {
	display: flex;
	grid-column: auto;
}
.dopee-sidebar-right .dp-related .dp-related__posts,
.dopee-sidebar-left .dp-related .dp-related__posts {
	--dp-cols: 2;
}
.dp-related .dp-card__title {
	font-size: 1.15rem;
}

/* ---------- Smaller screens ---------- */
@media (max-width: 1100px) {
	.dp-posts--cols-4 { --dp-cols: 3; }
}
@media (max-width: 960px) {
	.dp-posts,
	.dp-related .dp-posts.dp-related__posts { --dp-cols: 2; }
}
@media (max-width: 640px) {
	:root .dp-posts.dp-posts,
	.dp-related .dp-posts.dp-related__posts { --dp-cols: 1; }
	.dp-posts--style-overlay .dp-card { min-height: 320px; }
	.dp-author-box { flex-direction: column; }
	.dp-post-hero { min-height: 62vh; }
}
@media (prefers-reduced-motion: reduce) {
	.dp-share__link:hover { transform: none; }
}
