/* =============================================
   Gentar News - Archive / search
   Dimuat ketika is_archive() atau is_search().
   Layout lebar sama persis dengan Single Post.
   ============================================= */

.archive-header,
.search-header {
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 2px solid var(--color-accent);
}

.archive-header .page-title,
.search-header .page-title {
	font-family: var(--font-heading);
	font-size: clamp(1.45rem, 3.2vw, 2.1rem);
	font-weight: var(--heading-weight, 700);
	line-height: 1.25;
	color: var(--color-text);
	margin: 0;
	letter-spacing: -0.02em;
}

.search-header .page-title span {
	color: var(--color-accent);
}

.archive-description {
	margin-top: 10px;
	color: var(--color-muted);
	font-size: 0.95rem;
	line-height: 1.6;
}

.archive-description p:last-child {
	margin-bottom: 0;
}

/* Responsivitas Grid di Halaman Arsip & Pencarian */
.archive .grid-posts-container,
.search .grid-posts-container {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: var(--gap, 24px);
	width: 100%;
}

@media (max-width: 768px) {
	.archive .grid-posts-container,
	.search .grid-posts-container {
		grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
		gap: 20px;
	}
}

@media (max-width: 600px) {
	.archive .grid-posts-container,
	.search .grid-posts-container {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}
}

.no-results .page-content {
	background: var(--color-bg-alt);
	padding: 24px;
	border-radius: var(--radius);
}

.no-results .search-form {
	max-width: 460px;
}

/* =============================================
   ARSIP EDITORIAL (Author, Archive, dan Search)
   Selaras tata letak editorial Gentar News:
   masthead ringkas + grid borderless 3 kolom dengan
   pemisah garis tipis (hairline dividers).
   ============================================= */

body.archive,
body.search {
	--editorial-divider: var(--color-border);
	--editorial-divider: color-mix(in srgb, var(--color-muted) 22%, transparent);
}

/* Breadcrumb mandiri agar halaman author/archive/search tidak bergantung pada single.css. */
body.archive .breadcrumbs,
body.search .breadcrumbs {
	margin: 0 0 14px;
	font-size: 13px;
	line-height: 1.4;
	font-weight: 500;
	color: var(--color-text);
}

body.archive .breadcrumbs-list,
body.search .breadcrumbs-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 6px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: inherit;
}

body.archive .breadcrumbs-item,
body.search .breadcrumbs-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
}

body.archive .breadcrumbs-item + .breadcrumbs-item::before,
body.search .breadcrumbs-item + .breadcrumbs-item::before {
	content: "/";
	color: var(--color-muted);
	opacity: 0.6;
	line-height: 1;
}

body.archive .breadcrumbs-item a,
body.search .breadcrumbs-item a {
	color: var(--color-muted);
	text-decoration: none;
	transition: color 0.18s ease;
}

body.archive .breadcrumbs-item a:hover,
body.archive .breadcrumbs-item a:focus-visible,
body.search .breadcrumbs-item a:hover,
body.search .breadcrumbs-item a:focus-visible {
	color: var(--color-link);
	text-decoration: underline;
}

body.archive .breadcrumbs-current,
body.search .breadcrumbs-current {
	color: var(--color-text);
	font-weight: 600;
}

@media (max-width: 700px) {
	body.archive .breadcrumbs,
	body.search .breadcrumbs {
		font-size: 12px;
	}
}

/* ---------- Header Arsip Editorial (Kategori / Tag / Tanggal) ---------- */

.archive-masthead {
	padding: 20px 24px;
	margin: 0 0 28px;
	background: var(--color-bg-alt);
	border: 1px solid var(--color-border);
	border-left: 3px solid var(--color-accent);
	border-radius: var(--radius);
}

.archive-kicker {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 6px;
}

.archive-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 4px;
	background: color-mix(in srgb, var(--color-link) 10%, transparent);
	color: var(--color-link);
	font-family: var(--font-body);
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	line-height: 1.4;
}

.archive-sep {
	display: inline-block;
	width: 0;
	height: 0.75rem;
	border-left: 1px solid var(--color-separator);
}

.archive-count {
	font-family: var(--font-body);
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--color-muted);
	font-variant-numeric: tabular-nums;
}

.archive-masthead-title {
	font-family: var(--font-heading);
	font-size: clamp(1.35rem, 2.8vw, 1.85rem);
	font-weight: var(--heading-weight, 700);
	line-height: 1.25;
	letter-spacing: -0.02em;
	color: var(--color-text);
	margin: 0;
	overflow-wrap: break-word;
}

.archive-masthead-desc {
	margin-top: 8px;
	color: var(--color-muted);
	font-family: var(--font-body);
	font-size: 0.94rem;
	line-height: 1.6;
}

.archive-masthead-desc p:last-child {
	margin-bottom: 0;
}

@media (max-width: 600px) {
	.archive-masthead {
		padding: 16px 16px;
		margin-bottom: 24px;
	}

	.archive-masthead-desc {
		font-size: 0.88rem;
		line-height: 1.55;
	}
}

/* ---------- Header Pencarian (Search Masthead & Input Ulang) ---------- */

.search-masthead-query {
	color: var(--color-link);
}

.search-masthead-form {
	margin-top: 14px;
}

.search-masthead-form .search-form {
	display: flex;
	align-items: stretch;
	gap: 8px;
	max-width: 560px;
}

.search-masthead-form .search-field {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 44px;
	padding: 10px 14px;
	background: var(--color-bg);
	color: var(--color-text);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	font-family: var(--font-body);
	font-size: 0.95rem;
	line-height: 1.4;
	appearance: none;
	-webkit-appearance: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

html.gentar-dark .search-masthead-form .search-field {
	background: var(--color-dark);
}

.search-masthead-form .search-field::placeholder {
	color: var(--color-muted);
	opacity: 1;
}

.search-masthead-form .search-field::-webkit-search-decoration,
.search-masthead-form .search-field::-webkit-search-cancel-button,
.search-masthead-form .search-field::-webkit-search-results-button,
.search-masthead-form .search-field::-webkit-search-results-decoration {
	display: none;
}

.search-masthead-form .search-field:focus,
.search-masthead-form .search-field:focus-visible {
	border-color: var(--color-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 18%, transparent);
	outline: 2px solid transparent;
}

html.gentar-dark .search-masthead-form .search-field:focus,
html.gentar-dark .search-masthead-form .search-field:focus-visible {
	border-color: var(--color-link);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-link) 22%, transparent);
}

.search-masthead-form .search-submit {
	flex: 0 0 auto;
	min-height: 44px;
	min-width: 78px;
	padding: 0 20px;
	background: var(--color-accent);
	color: #ffffff;
	border: 0;
	border-radius: var(--radius);
	font-family: var(--font-body);
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.search-masthead-form .search-submit:hover,
.search-masthead-form .search-submit:focus-visible {
	background: #a30d25;
	color: #ffffff;
}

@media (max-width: 1024px) {
	.search-masthead-form .search-field {
		font-size: 16px;
	}
}

@media (max-width: 600px) {
	.search-masthead-form {
		margin-top: 12px;
	}

	.search-masthead-form .search-submit {
		padding: 0 16px;
	}
}

/* ---------- Header Profil Penulis ---------- */

.author-profile {
	display: flex;
	align-items: flex-start;
	gap: 20px;
	padding: 22px 24px;
	margin: 0 0 28px;
	background: var(--color-bg-alt);
	border: 1px solid var(--color-border);
	border-left: 3px solid var(--color-accent);
	border-radius: var(--radius);
}

.author-profile-avatar {
	flex: 0 0 auto;
	width: 80px;
	height: 80px;
	border-radius: 50%;
	overflow: hidden;
	border: 2px solid var(--color-border);
	background: var(--color-bg);
	display: flex;
	align-items: center;
	justify-content: center;
}

.author-profile-avatar-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 50%;
}

.author-profile-initials {
	width: 100%;
	height: 100%;
	display: grid;
	place-items: center;
	background: var(--color-accent);
	color: #ffffff;
	font-family: var(--font-heading);
	font-size: 1.55rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	line-height: 1;
}

.author-profile-body {
	flex: 1 1 auto;
	min-width: 0;
}

.author-profile-kicker {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 6px;
}

.author-profile-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 4px;
	background: color-mix(in srgb, var(--color-link) 10%, transparent);
	color: var(--color-link);
	font-family: var(--font-body);
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	line-height: 1.4;
}

.author-profile-sep {
	display: inline-block;
	width: 0;
	height: 0.75rem;
	border-left: 1px solid var(--color-separator);
}

.author-profile-count {
	font-family: var(--font-body);
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--color-muted);
	font-variant-numeric: tabular-nums;
}

.author-profile-name {
	font-family: var(--font-heading);
	font-size: clamp(1.35rem, 2.8vw, 1.85rem);
	font-weight: var(--heading-weight, 700);
	line-height: 1.25;
	letter-spacing: -0.02em;
	color: var(--color-text);
	margin: 0 0 8px;
	overflow-wrap: break-word;
}

.author-profile-bio {
	font-family: var(--font-body);
	font-size: 0.94rem;
	line-height: 1.6;
	color: var(--color-muted);
	margin: 0;
}

.author-profile-bio p {
	margin: 0;
}

.author-profile-actions {
	margin-top: 12px;
	padding-top: 10px;
	border-top: 1px dashed var(--color-border);
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 14px;
}

.author-profile-website {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--font-body);
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--color-link);
	text-decoration: none;
	transition: opacity 0.18s ease, transform 0.15s ease;
}

.author-profile-website:hover,
.author-profile-website:focus-visible {
	opacity: 0.85;
	text-decoration: underline;
	transform: translateX(2px);
}

@media (max-width: 600px) {
	.author-profile {
		gap: 14px;
		padding: 18px 16px;
		margin-bottom: 24px;
	}

	.author-profile-avatar {
		width: 60px;
		height: 60px;
	}

	.author-profile-initials {
		font-size: 1.25rem;
	}

	.author-profile-bio {
		font-size: 0.88rem;
		line-height: 1.55;
	}
}

@media (max-width: 420px) {
	.author-profile {
		flex-direction: column;
		align-items: center;
		text-align: center;
		padding: 20px 14px;
		border-left: 1px solid var(--color-border);
		border-top: 3px solid var(--color-accent);
	}

	.author-profile-kicker,
	.author-profile-actions {
		justify-content: center;
	}
}

/* ---------- Daftar Artikel Editorial (3 Kolom Borderless) ---------- */

.editorial-posts-heading {
	margin-top: 0;
	margin-bottom: 20px;
}

.editorial-posts-grid {
	display: grid;
	width: 100%;
}

.editorial-post-card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.editorial-post-thumb {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: var(--radius);
	background: var(--color-bg-alt);
	flex: 0 0 auto;
}

.editorial-post-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.editorial-post-card:hover .editorial-post-thumb img,
.editorial-post-card:focus-within .editorial-post-thumb img {
	transform: scale(1.04);
}

.editorial-post-thumb-placeholder {
	width: 100%;
	height: 100%;
	display: grid;
	place-items: center;
	color: var(--color-muted);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
}

.editorial-post-thumb-placeholder svg {
	opacity: 0.45;
}

/* Video overlay selaras homepage (scrim tipis + ikon play di tengah) */
.editorial-post-thumb--video::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		radial-gradient(
			circle at 50% 50%,
			rgba(0, 0, 0, 0.38),
			rgba(0, 0, 0, 0.18) 55%,
			rgba(0, 0, 0, 0) 80%
		),
		linear-gradient(
			to top,
			rgba(0, 0, 0, 0.72),
			rgba(0, 0, 0, 0.32) 35%,
			rgba(0, 0, 0, 0.06) 62%,
			rgba(0, 0, 0, 0) 75%
		);
	pointer-events: none;
	z-index: 1;
}

.editorial-video-play {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: grid;
	place-items: center;
	margin: auto;
	width: 46px;
	height: 46px;
	color: #ffffff;
	filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.55));
	transition: transform 0.2s ease;
	pointer-events: none;
}

.editorial-video-play svg {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
	paint-order: stroke fill;
	stroke: rgba(0, 0, 0, 0.55);
	stroke-width: 7;
	stroke-linejoin: round;
	stroke-linecap: round;
}

.editorial-post-card:hover .editorial-video-play,
.editorial-post-card:focus-within .editorial-video-play {
	transform: scale(1.08);
}

.editorial-post-body {
	min-width: 0;
	padding-top: 10px;
}

.editorial-post-meta {
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
	gap: 8px;
	min-width: 0;
	margin: 0 0 6px;
	font-family: var(--font-body);
	font-size: 0.72rem;
	line-height: 1.35;
}

.editorial-post-cat {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--color-link);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	text-decoration: none;
}

.editorial-post-cat:hover,
.editorial-post-cat:focus-visible {
	text-decoration: underline;
}

.editorial-post-sep {
	display: inline-block;
	align-self: center;
	flex: 0 0 auto;
	width: 0;
	height: 0.7rem;
	border-left: 1px solid var(--color-separator);
}

.editorial-post-date {
	flex: 0 0 auto;
	white-space: nowrap;
	color: var(--color-muted);
}

.editorial-post-title {
	margin: 0;
	font-family: var(--font-heading);
	font-size: calc(var(--heading-size-desktop) * 0.84);
	font-weight: var(--heading-weight, 700);
	line-height: 1.38;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	overflow: hidden;
}

.editorial-post-title a {
	display: inline;
	color: var(--color-text);
	text-decoration: none;
	overflow-wrap: anywhere;
	background-image: linear-gradient(currentColor, currentColor);
	background-position: 0 100%;
	background-repeat: no-repeat;
	background-size: 0 1px;
	transition: background-size 0.25s ease, color 0.2s ease;
}

.editorial-post-card:hover .editorial-post-title a,
.editorial-post-title a:hover,
.editorial-post-title a:focus-visible {
	color: var(--color-link);
	background-size: 100% 1px;
	text-decoration: none;
}

@media (max-width: 700px) {
	.editorial-post-title {
		font-size: var(--heading-size-mobile);
	}
}

/* Desktop >1024px: 3 kolom x 3 baris (9 default), garis pemisah tipis di celah */
@media (min-width: 1025px) {
	.editorial-posts-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		column-gap: 24px;
		row-gap: 0;
	}

	.editorial-posts-grid .editorial-post-card {
		padding: 0 0 22px;
	}

	.editorial-posts-grid .editorial-post-card:nth-child(n + 4) {
		padding-top: 22px;
		border-top: 1px solid var(--editorial-divider);
	}

	.editorial-posts-grid .editorial-post-card:nth-child(3n + 2)::before,
	.editorial-posts-grid .editorial-post-card:nth-child(3n)::before {
		content: "";
		position: absolute;
		left: -12px;
		top: 0;
		bottom: 22px;
		width: 1px;
		background: var(--editorial-divider);
		pointer-events: none;
	}

	.editorial-posts-grid .editorial-post-card:nth-child(n + 4):nth-child(3n + 2)::before,
	.editorial-posts-grid .editorial-post-card:nth-child(n + 4):nth-child(3n)::before {
		top: 22px;
	}
}

/* Tablet 601px-1024px: 2 kolom bersih tanpa tabrakan aturan nth-child */
@media (min-width: 601px) and (max-width: 1024px) {
	.editorial-posts-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		column-gap: 20px;
		row-gap: 0;
	}

	.editorial-posts-grid .editorial-post-card {
		padding: 0 0 20px;
	}

	.editorial-posts-grid .editorial-post-card:nth-child(n + 3) {
		padding-top: 20px;
		border-top: 1px solid var(--editorial-divider);
	}

	.editorial-posts-grid .editorial-post-card:nth-child(2n)::before {
		content: "";
		position: absolute;
		left: -10px;
		top: 0;
		bottom: 20px;
		width: 1px;
		background: var(--editorial-divider);
		pointer-events: none;
	}

	.editorial-posts-grid .editorial-post-card:nth-child(n + 3):nth-child(2n)::before {
		top: 20px;
	}
}

/* Mobile <=600px: daftar editorial horizontal ringkas agar cepat dipindai */
@media (max-width: 600px) {
	.editorial-posts-heading {
		margin-bottom: 16px;
	}

	.editorial-posts-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
	}

	.editorial-posts-grid .editorial-post-card {
		display: grid;
		grid-template-columns: clamp(114px, 36vw, 152px) minmax(0, 1fr);
		column-gap: 14px;
		align-items: start;
		padding: 14px 0;
	}

	.editorial-posts-grid .editorial-post-card:first-child {
		padding-top: 0;
	}

	.editorial-posts-grid .editorial-post-card + .editorial-post-card {
		border-top: 1px solid var(--editorial-divider);
	}

	.editorial-post-body {
		padding-top: 0;
	}

	.editorial-post-meta {
		margin-bottom: 4px;
		font-size: 0.68rem;
		gap: 6px;
	}

	.editorial-post-title {
		font-size: var(--heading-size-mobile);
		line-height: 1.32;
	}

	.editorial-video-play {
		width: 32px;
		height: 32px;
	}

	.editorial-video-play svg {
		stroke-width: 12;
	}
}

/* Pagination & Empty State arsip editorial */
.editorial-posts-section .pagination,
.editorial-posts-section .navigation.pagination {
	margin: 12px 0 32px;
	padding-top: 22px;
	border-top: 1px solid var(--editorial-divider);
}

.editorial-posts-section .pagination a.page-numbers,
.editorial-posts-section .navigation.pagination a.page-numbers {
	transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.editorial-posts-section .pagination a.page-numbers:hover,
.editorial-posts-section .pagination a.page-numbers:focus-visible,
.editorial-posts-section .navigation.pagination a.page-numbers:hover,
.editorial-posts-section .navigation.pagination a.page-numbers:focus-visible {
	border-color: var(--color-accent);
	color: var(--color-link);
	text-decoration: none;
}

.editorial-posts-empty {
	padding: 28px 24px;
	background: var(--color-bg-alt);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	text-align: center;
}

.editorial-posts-empty p {
	margin: 0 0 16px;
	color: var(--color-muted);
	font-size: 0.95rem;
}

.editorial-empty-home {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
}

@media (max-width: 600px) {
	.editorial-posts-section .pagination .page-numbers,
	.editorial-posts-section .navigation.pagination .page-numbers {
		min-width: 44px;
		height: 44px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.editorial-post-thumb img,
	.editorial-video-play,
	.author-profile-website {
		transition: none;
	}

	.editorial-post-card:hover .editorial-post-thumb img,
	.editorial-post-card:focus-within .editorial-post-thumb img,
	.editorial-post-card:hover .editorial-video-play,
	.editorial-post-card:focus-within .editorial-video-play,
	.author-profile-website:hover,
	.author-profile-website:focus-visible {
		transform: none;
	}
}
