/*
 * Components — slider hero dan widget sidebar (judul, artikel per kategori,
 * Featured Topics, Tag Terpopuler, Artikel Terbaru).
 * Author box, tombol share, Artikel Terkait, dan komentar ada di article.css
 * karena hanya dipakai di halaman artikel.
 */

/* ---------- Pesan bantu admin (tidak tampil ke pengunjung) ---------- */
.an-admin-hint {
	margin: 0 0 var(--an-sp-40);
	padding: var(--an-sp-20) var(--an-sp-30);
	border: 1px dashed var(--an-color-border);
	border-radius: var(--an-radius-sm);
	font-size: var(--an-fs-sm);
	color: var(--an-color-muted);
}

/* =========================================
   HERO SLIDER (struktur Query Loop)
   ========================================= */
.an-slider-wrapper {
	position: relative;
	overflow: hidden;
	border-radius: var(--an-radius-lg);
}

.an-slider-wrapper .an-slider__track {
	display: flex;
	flex-wrap: nowrap;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.an-slider-wrapper .an-slider__track::-webkit-scrollbar { display: none; }

/* Flex item sebenarnya adalah <li>, bukan group di dalamnya */
.an-slider-wrapper .an-slider__track > li {
	flex: 0 0 100%;
	scroll-snap-align: start;
	margin: 0;
}

.an-slider-wrapper .an-slider__slide { position: relative; }

.an-slider-wrapper .an-slider__slide .wp-block-post-featured-image {
	aspect-ratio: 16 / 9; /* ruang dicadangkan, tanpa CLS */
	margin: 0;
	border-radius: 0;
}

/* Desktop: tinggi hero ditentukan slider (5 kolom), kolom kanan mengikutinya */
@media (min-width: 1024px) {
	.an-slider-wrapper .an-slider__slide .wp-block-post-featured-image { aspect-ratio: 3 / 2; }
}

.an-slider-wrapper .an-slider__slide .wp-block-post-title {
	position: absolute;
	inset: auto 0 0 0;
	margin: 0;
	/* Bawah ditambah 22px: ruang untuk dots */
	padding: var(--an-sp-60) var(--an-sp-30) calc(var(--an-sp-30) + 22px);
	background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
	font-size: var(--an-fs-xl);
}

.an-slider-wrapper .an-slider__slide .wp-block-post-title a { color: #fff; }

/* Tombol prev/next */
.an-slider__prev,
.an-slider__next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.8);
	cursor: pointer;
	z-index: 10;
	transition: background var(--an-transition-fast);
}

.an-slider__prev:hover,
.an-slider__next:hover { background: #fff; }

.an-slider__prev { left: var(--an-sp-20); }
.an-slider__next { right: var(--an-sp-20); }

/* Tombol jeda/putar autoplay */
.an-slider__pause {
	position: absolute;
	top: var(--an-sp-20);
	right: var(--an-sp-20);
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.8);
	color: var(--an-color-contrast);
	cursor: pointer;
	transition: background var(--an-transition-fast);
}

.an-slider__pause:hover { background: #fff; }

/* Dots */
.an-slider__dots {
	position: absolute;
	right: 0;
	bottom: var(--an-sp-30);
	left: 0;
	z-index: 3;
	display: flex;
	justify-content: center;
	gap: 8px;
	pointer-events: none;
}

.an-slider__dot {
	position: relative;
	width: 10px;
	height: 10px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, 0.5);
	cursor: pointer;
	pointer-events: auto;
	transition: background-color var(--an-transition-fast), transform var(--an-transition-fast);
}

/* Area sentuh diperluas tanpa mengubah ukuran titik */
.an-slider__dot::after {
	content: "";
	position: absolute;
	inset: -8px;
}

.an-slider__dot.is-active {
	background-color: #fff;
	transform: scale(1.2);
}

/* =========================================
   SIDEBAR
   ========================================= */

/* ---------- Judul widget / seksi ---------- */
.an-widget-title {
	margin: 0 0 var(--an-sp-30);
	padding-left: var(--an-sp-20);
	border-left: 4px solid var(--an-color-primary);
	font-size: var(--an-fs-xl);
	line-height: 1.2;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}

/* Judul pertama di sidebar sejajar dengan bagian atas konten utama */
.an-sidebar .an-widget-title { margin-top: 0; }

/* ---------- Artikel dari satu kategori (beranda) ---------- */
.an-cat-block { margin-bottom: var(--an-sp-50); }

.an-cat-list {
	display: grid;
	gap: var(--an-sp-30);
	margin: 0;
	padding: 0;
	list-style: none;
}

.an-cat-item {
	display: flex;
	align-items: flex-start;
	gap: var(--an-sp-30);
	margin: 0;
}

.an-cat-item__thumb {
	display: block;
	flex: 0 0 96px;
	aspect-ratio: 4 / 3;
	border-radius: var(--an-radius-md);
	overflow: hidden;
}

.an-cat-item__thumb img,
.an-cat-item__thumb .an-image-placeholder {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.an-cat-item__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.an-cat-item__title {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: var(--an-fs-base);
	font-weight: 700;
	line-height: 1.4;
	color: var(--an-color-contrast);
	text-decoration: none;
}

.an-cat-item__title:hover { color: var(--an-color-primary); }

.an-cat-item__date {
	font-size: var(--an-fs-sm);
	color: var(--an-color-muted);
}

/* ---------- Featured Topics & Tag Terpopuler ---------- */
.an-cat-nav,
.an-tag-nav { margin-bottom: var(--an-sp-50); }

/* Featured Topics: daftar bernomor + panah kanan */
.an-topic-list {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: an-topic;
}

.an-topic-list li {
	margin: 0;
	counter-increment: an-topic;
}

.an-topic-list a {
	display: flex;
	align-items: center;
	gap: var(--an-sp-20);
	padding: var(--an-sp-20) 0;
	font-weight: 700;
	text-decoration: none;
	color: var(--an-color-contrast);
}

.an-topic-list a::before {
	content: counter(an-topic) ".";
	flex: 0 0 1.75em;
}

.an-topic-list a::after {
	content: "";
	flex: 0 0 auto;
	width: 7px;
	height: 7px;
	margin-left: auto;
	margin-right: 4px;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
	transform: rotate(45deg);
}

.an-topic-list a:hover { color: var(--an-color-primary); }

/* Tag Terpopuler: awalan # */
.an-tag-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.an-tag-list li { margin: 0; }

.an-tag-list a {
	display: flex;
	align-items: baseline;
	gap: var(--an-sp-20);
	padding: var(--an-sp-20) 0;
	font-weight: 700;
	text-decoration: none;
	color: var(--an-color-contrast);
}

.an-tag-list a::before {
	content: "#";
	font-weight: 400;
	color: var(--an-color-muted);
}

.an-tag-list a:hover { color: var(--an-color-primary); }

/* ---------- Artikel Terbaru ---------- */
.an-recent { margin-bottom: var(--an-sp-50); }

.an-recent__list {
	display: grid;
	gap: var(--an-sp-30);
	margin: 0;
	padding: 0;
	list-style: none;
}

.an-recent__item {
	display: flex;
	align-items: center;
	gap: var(--an-sp-30);
	margin: 0;
}

.an-recent__thumb {
	display: block;
	flex: 0 0 64px;
	width: 64px;
	height: 64px;
	border-radius: var(--an-radius-md);
	overflow: hidden;
}

.an-recent__thumb img,
.an-recent__thumb .an-image-placeholder {
	width: 100%;
	height: 100%;
	aspect-ratio: auto;
	object-fit: cover;
}

.an-recent__thumb .an-image-placeholder span { display: none; }

.an-recent__title {
	display: -webkit-box;
	flex: 1;
	min-width: 0;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	overflow: hidden;
	font-size: var(--an-fs-sm);
	font-weight: 600;
	line-height: 1.4;
	color: var(--an-color-contrast);
	text-decoration: none;
}

.an-recent__title:hover { color: var(--an-color-primary); }