/* ACEH PULIH – frontend. Semua selector berprefix .aceh-pulih agar tidak bentrok dengan tema. */

/* ---- Mobile only: disembunyikan total di tablet/laptop/desktop ---- */
.aceh-pulih-widget {
	display: none;
}

@media screen and (max-width: 767px) {
	.aceh-pulih-widget {
		display: block;
		width: 100%;
		max-width: 100%;
		box-sizing: border-box;
		position: relative;
		overflow: hidden;
		margin: 10px 0;
		padding: 10px 10px 10px;
		color: var(--ap-text, #fff);
		border-radius: var(--ap-radius, 20px);
		background: linear-gradient(155deg, var(--ap-dark, #064A78) 0%, var(--ap-main, #087FB0) 58%, var(--ap-cyan, #08B9D8) 100%);
		font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
		line-height: 1.35;
		-webkit-text-size-adjust: 100%;
		box-shadow: 0 10px 28px rgba(6, 74, 120, .28);
	}

	.aceh-pulih-widget *,
	.aceh-pulih-widget *::before,
	.aceh-pulih-widget *::after {
		box-sizing: border-box;
	}

	.aceh-pulih-widget > * {
		position: relative;
		z-index: 1;
	}

	/* Ornamen khas Aceh: pola geometris bersulur (terinspirasi motif pucuk rebung / ukiran Gayo) */
	.aceh-pulih-widget > .aceh-pulih__ornament {
		position: absolute;
		z-index: 0;
		inset: 0;
		pointer-events: none;
		opacity: .10;
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M24 4l8 12-8 12-8-12z M24 28l8 8-8 8-8-8z M4 24l8-8 8 8-8 8z M28 24l8-8 8 8-8 8z' fill='none' stroke='%23ffffff' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E");
		background-size: 48px 48px;
		-webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 55%);
		mask-image: linear-gradient(180deg, #000 0%, transparent 55%);
	}

	.aceh-pulih__sprite {
		position: absolute !important;
		width: 0;
		height: 0;
		overflow: hidden;
	}

	/* ---- Header ---- */
	.aceh-pulih__header {
		display: flex;
		align-items: center;
		gap: 9px;
		margin: 0 0 8px;
	}

	.aceh-pulih__art {
		flex: 0 0 15%;
		max-width: 58px;
	}

	.aceh-pulih__map-mini {
		display: block;
		width: 100%;
		height: auto;
		fill: var(--ap-map-fill, #fff);
		stroke: var(--ap-map-stroke, #08B9D8);
		stroke-width: 1.2px;
		stroke-linejoin: round;
		filter: drop-shadow(0 4px 8px rgba(0, 20, 40, .35));
	}

	.aceh-pulih__logo {
		display: block;
		width: 100%;
		height: auto;
	}

	.aceh-pulih__heading {
		min-width: 0;
		flex: 1 1 auto;
	}

	.aceh-pulih-widget .aceh-pulih__title {
		margin: 0;
		padding: 0;
		border: 0;
		color: #fff;
		font-size: clamp(16px, 4.8vw, 20px);
		line-height: 1.05;
		font-weight: 900;
		letter-spacing: .01em;
		text-transform: uppercase;
		text-shadow: 0 2px 10px rgba(0, 20, 40, .35);
		overflow-wrap: anywhere;
	}

	.aceh-pulih-widget .aceh-pulih__subtitle {
		margin: 3px 0 0;
		padding: 5px 0 0;
		position: relative;
		color: var(--ap-subtitle, #D9F0F8);
		font-size: clamp(10.5px, 3vw, 12px);
		font-weight: 600;
		line-height: 1.25;
	}

	.aceh-pulih__subtitle::before {
		content: "";
		position: absolute;
		top: 0;
		left: 0;
		width: 26px;
		height: 2px;
		border-radius: 3px;
		background: linear-gradient(90deg, var(--ap-cyan, #08B9D8), #fff);
	}

	/* ---- Kotak informasi ---- */
	.aceh-pulih__info {
		display: flex;
		align-items: center;
		gap: 12px;
		margin: 0 0 8px;
		padding: 8px 8px 8px 10px;
		border-radius: calc(var(--ap-radius, 20px) * .7);
		background: var(--ap-info-bg, #D9F0F8);
		color: var(--ap-info-text, #0B3550);
	}

	.aceh-pulih-widget .aceh-pulih__info-text {
		flex: 1 1 auto;
		min-width: 0;
		margin: 0;
		padding: 0;
		color: inherit;
		font-size: 10.5px;
		line-height: 1.4;
		font-weight: 500;
	}

	.aceh-pulih-widget a.aceh-pulih__info-btn {
		flex: 0 0 auto;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 30px;
		height: 26px;
		border-radius: 8px;
		color: var(--ap-btn-icon, #fff);
		text-decoration: none;
		background: linear-gradient(135deg, var(--ap-btn, #08B9D8), var(--ap-btn-end, #064A78));
		box-shadow: 0 4px 10px rgba(6, 74, 120, .3);
		transition: transform .2s ease, box-shadow .2s ease;
	}

	.aceh-pulih-widget a.aceh-pulih__info-btn:hover,
	.aceh-pulih-widget a.aceh-pulih__info-btn:focus-visible {
		transform: translateX(2px);
		box-shadow: 0 6px 14px rgba(6, 74, 120, .4);
		color: var(--ap-btn-icon, #fff);
	}

	/* ---- Slider berita ---- */
	.aceh-pulih__news {
		margin: 0;
	}

	.aceh-pulih__stage {
		position: relative;
	}

	.aceh-pulih-widget ul.aceh-pulih__track {
		display: flex;
		gap: var(--ap-gap, 12px);
		margin: 0;
		padding: 0;
		list-style: none;
		overflow-x: auto;
		overflow-y: hidden;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior-x: contain;
		scrollbar-width: none;
		touch-action: pan-x pan-y;
	}

	.aceh-pulih__track::-webkit-scrollbar {
		display: none;
	}

	.aceh-pulih-widget li.aceh-pulih__card {
		flex: 0 0 calc((100% - (var(--ap-visible, 2) - 1) * var(--ap-gap, 12px)) / var(--ap-visible, 2));
		min-width: 0;
		margin: 0;
		padding: 0;
		list-style: none;
		scroll-snap-align: start;
	}

	.aceh-pulih-widget a.aceh-pulih__card-link {
		display: block;
		color: var(--ap-text, #fff);
		text-decoration: none;
		-webkit-tap-highlight-color: transparent;
	}

	.aceh-pulih__media {
		display: block;
		position: relative;
		aspect-ratio: 16 / 9;
		overflow: hidden;
		border-radius: calc(var(--ap-radius, 20px) * .5);
		background: rgba(255, 255, 255, .15);
		box-shadow: 0 4px 12px rgba(0, 20, 40, .25);
	}

	.aceh-pulih-widget .aceh-pulih__img {
		display: block;
		width: 100%;
		height: 100%;
		max-width: none;
		margin: 0;
		object-fit: cover;
		transition: transform .45s ease;
	}

	.aceh-pulih__img-fallback {
		position: absolute;
		inset: 0;
		background: linear-gradient(135deg, var(--ap-main, #087FB0), var(--ap-cyan, #08B9D8));
	}

	.aceh-pulih__card-link:hover .aceh-pulih__img,
	.aceh-pulih__card-link:focus-visible .aceh-pulih__img {
		transform: scale(1.05);
	}

	.aceh-pulih__card-title {
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 3;
		line-clamp: 3;
		overflow: hidden;
		margin: 6px 0 0;
		color: var(--ap-text, #fff);
		font-size: var(--ap-title-size, 12px);
		font-weight: 700;
		line-height: 1.32;
		overflow-wrap: break-word;
		hyphens: auto;
	}

	.aceh-pulih__card-date {
		display: block;
		margin-top: 4px;
		color: var(--ap-light, #D9F0F8);
		opacity: .85;
		font-size: 9.5px;
		font-weight: 500;
	}

	/* Panah: melayang di tepi foto, seperti referensi */
	.aceh-pulih-widget button.aceh-pulih__arrow {
		position: absolute;
		z-index: 3;
		/* tengah vertikal foto: lebar kartu x 9/16 / 2 - setengah tinggi tombol */
		top: calc(((100% - (var(--ap-visible, 2) - 1) * var(--ap-gap, 12px)) / var(--ap-visible, 2)) * 0.28125 - 14px);
		margin: 0;
		padding: 0;
		width: 28px;
		height: 28px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		border: 0;
		border-radius: 50%;
		color: #fff;
		cursor: pointer;
		background: linear-gradient(145deg, var(--ap-cyan, #08B9D8), var(--ap-dark, #064A78));
		box-shadow: 0 4px 12px rgba(0, 20, 40, .4), inset 0 0 0 1px rgba(255, 255, 255, .25);
		transition: transform .2s ease, opacity .2s ease;
		-webkit-tap-highlight-color: transparent;
	}

		.aceh-pulih__arrow svg { width: 16px; height: 16px; }
	.aceh-pulih__info-btn svg { width: 18px; height: 18px; }

	.aceh-pulih__arrow--prev { left: -5px; }
	.aceh-pulih__arrow--next { right: -5px; }

	.aceh-pulih-widget button.aceh-pulih__arrow:hover { transform: scale(1.08); }

	.aceh-pulih-widget button.aceh-pulih__arrow[disabled] {
		opacity: .35;
		cursor: default;
		transform: none;
	}

	.aceh-pulih__dots {
		display: flex;
		justify-content: center;
		gap: 6px;
		margin-top: 8px;
	}

	.aceh-pulih-widget button.aceh-pulih__dot {
		width: 7px;
		height: 7px;
		min-width: 7px;
		margin: 0;
		padding: 0;
		border: 0;
		border-radius: 50%;
		background: rgba(255, 255, 255, .55);
		cursor: pointer;
		transition: background .2s ease, transform .2s ease;
	}

	.aceh-pulih-widget button.aceh-pulih__dot.is-active {
		background: #fff;
		transform: scale(1.25);
		box-shadow: 0 0 0 3px rgba(255, 255, 255, .25);
	}

	.aceh-pulih__empty {
		padding: 16px 12px;
		border: 1px dashed rgba(255, 255, 255, .55);
		border-radius: calc(var(--ap-radius, 20px) * .6);
		text-align: center;
		font-size: 12px;
		font-weight: 600;
		color: var(--ap-light, #D9F0F8);
	}

	@media (prefers-reduced-motion: reduce) {
		.aceh-pulih-widget *,
		.aceh-pulih-widget *::before {
			transition: none !important;
			animation: none !important;
			scroll-behavior: auto !important;
		}
	}
}
