/* ==========================================================================
   YBT Project Gallery — Design tokens
   Signature: garis "blueprint" siku di sudut kartu (khas gambar teknik/
   RAB), muncul saat hover — menegaskan identitas kontraktor teknik.
   ========================================================================== */
.ybt-pg-wrap {
	--ybt-navy: #16233F;
	--ybt-navy-soft: #223057;
	--ybt-gold: #F0A339;
	--ybt-cream: #F7F4EE;
	--ybt-ink: #0E1729;
	font-family: 'Inter', system-ui, sans-serif;
}

/* ===== Grid — benar-benar fluid, tanpa breakpoint kaku ===== */
.ybt-pg-grid {
	display: grid;
	gap: clamp(14px, 2.2vw, 24px);
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
/* atribut kolom = jumlah maksimum kolom di layar lebar */
.ybt-pg-cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.ybt-pg-cols-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.ybt-pg-cols-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.ybt-pg-empty {
	grid-column: 1 / -1;
	text-align: center;
	color: #8a8a8a;
	padding: 60px 0;
	font-family: 'IBM Plex Mono', monospace;
	font-size: 14px;
}

/* ===== Reveal saat scroll (satu momen animasi, tidak berlebihan) ===== */
.ybt-pg-reveal {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity .6s cubic-bezier(.2,.7,.3,1), transform .6s cubic-bezier(.2,.7,.3,1);
}
.ybt-pg-reveal.is-visible {
	opacity: 1;
	transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
	.ybt-pg-reveal { opacity: 1; transform: none; transition: none; }
}

/* ===== Card ===== */
.ybt-pg-card { cursor: pointer; }
.ybt-pg-card-frame {
	position: relative;
	border-radius: 4px;
	overflow: hidden;
}

/* Signature: siku blueprint di 4 sudut, muncul saat hover/focus */
.ybt-pg-corner {
	position: absolute;
	width: 22px;
	height: 22px;
	z-index: 3;
	opacity: 0;
	transition: opacity .3s ease, width .3s ease, height .3s ease;
	pointer-events: none;
}
.ybt-pg-corner::before,
.ybt-pg-corner::after {
	content: "";
	position: absolute;
	background: var(--ybt-gold);
}
.ybt-pg-corner::before { width: 100%; height: 2px; }
.ybt-pg-corner::after  { width: 2px; height: 100%; }
.ybt-pg-corner-tl { top: 10px; left: 10px; }
.ybt-pg-corner-tr { top: 10px; right: 10px; }
.ybt-pg-corner-bl { bottom: 10px; left: 10px; }
.ybt-pg-corner-br { bottom: 10px; right: 10px; }
.ybt-pg-corner-tr::before, .ybt-pg-corner-tr::after { left: auto; right: 0; }
.ybt-pg-corner-bl::before, .ybt-pg-corner-bl::after { top: auto; bottom: 0; }
.ybt-pg-corner-br::before, .ybt-pg-corner-br::after { top: auto; bottom: 0; left: auto; right: 0; }

.ybt-pg-card:hover .ybt-pg-corner,
.ybt-pg-card:focus-within .ybt-pg-corner {
	opacity: 1;
	width: 28px;
	height: 28px;
}

.ybt-pg-card-media {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--ybt-navy);
}
.ybt-pg-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .5s cubic-bezier(.2,.7,.3,1), filter .5s ease;
}
.ybt-pg-card:hover .ybt-pg-card-media img,
.ybt-pg-card:focus-within .ybt-pg-card-media img {
	transform: scale(1.07);
}

/* Eyebrow kategori — pill kecil menempel di kiri atas foto */
.ybt-pg-card-kategori {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
	font-family: 'IBM Plex Mono', monospace;
	font-size: 10.5px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--ybt-cream);
	background: rgba(14, 23, 41, 0.55);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	border: 1px solid rgba(240, 163, 57, 0.5);
	padding: 4px 10px;
	border-radius: 20px;
}

.ybt-pg-count-badge {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: rgba(14, 23, 41, 0.55);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	color: var(--ybt-cream);
	font-family: 'IBM Plex Mono', monospace;
	font-size: 11px;
	font-weight: 600;
	padding: 4px 9px;
	border-radius: 20px;
}
.ybt-pg-count-icon { font-size: 11px; opacity: .9; }

/* Caption kaca — selalu terlihat, naik sedikit saat hover */
.ybt-pg-card-caption {
	position: absolute;
	left: 0; right: 0; bottom: 0;
	z-index: 2;
	padding: 34px 16px 14px;
	background: linear-gradient(0deg, rgba(14,23,41,0.92) 0%, rgba(14,23,41,0.55) 55%, rgba(14,23,41,0) 100%);
	transform: translateY(4px);
	transition: transform .35s ease;
}
.ybt-pg-card:hover .ybt-pg-card-caption,
.ybt-pg-card:focus-within .ybt-pg-card-caption {
	transform: translateY(0);
}
.ybt-pg-card-title {
	font-family: 'Oswald', sans-serif;
	font-size: 16.5px;
	line-height: 1.28;
	margin: 0 0 6px;
	color: #fff;
}
.ybt-pg-card-cta {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-family: 'IBM Plex Mono', monospace;
	font-size: 11px;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: var(--ybt-gold);
	opacity: 0;
	transform: translateX(-6px);
	transition: opacity .3s ease .05s, transform .3s ease .05s;
}
.ybt-pg-card:hover .ybt-pg-card-cta,
.ybt-pg-card:focus-within .ybt-pg-card-cta {
	opacity: 1;
	transform: translateX(0);
}
.ybt-pg-card-cta svg { transition: transform .3s ease; }
.ybt-pg-card:hover .ybt-pg-card-cta svg { transform: translateX(3px); }

.ybt-pg-card:focus-visible {
	outline: 2px solid var(--ybt-gold);
	outline-offset: 3px;
}

/* ===== Muat Lebih / Lihat Semua ===== */
.ybt-pg-loadmore-row,
.ybt-pg-viewall-row {
	text-align: center;
	margin-top: clamp(20px, 4vw, 34px);
}
.ybt-pg-loadmore-btn,
.ybt-pg-viewall-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: 'Oswald', sans-serif;
	letter-spacing: .04em;
	text-transform: uppercase;
	font-size: 13.5px;
	background: var(--ybt-navy);
	color: #fff !important;
	border: 1px solid var(--ybt-navy);
	padding: 12px 28px;
	border-radius: 30px;
	cursor: pointer;
	text-decoration: none;
	transition: background .2s ease, color .2s ease, transform .2s ease;
}
.ybt-pg-loadmore-btn:hover,
.ybt-pg-viewall-btn:hover {
	background: var(--ybt-gold);
	border-color: var(--ybt-gold);
	color: var(--ybt-navy) !important;
	transform: translateY(-1px);
}
.ybt-pg-loadmore-btn[disabled] { opacity: .6; cursor: default; transform: none; }

/* ===== Lightbox ===== */
.ybt-pg-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(9, 13, 24, 0.96);
	z-index: 999990;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity .3s ease, visibility 0s linear .3s;
}
.ybt-pg-lightbox.is-open {
	opacity: 1;
	visibility: visible;
	transition: opacity .3s ease;
}
.ybt-pg-lb-stage {
	max-width: 90vw;
	max-height: 86vh;
	text-align: center;
	transform: scale(.96);
	transition: transform .3s ease;
}
.ybt-pg-lightbox.is-open .ybt-pg-lb-stage { transform: scale(1); }
.ybt-pg-lb-img {
	max-width: 90vw;
	max-height: 76vh;
	object-fit: contain;
	border-radius: 4px;
	box-shadow: 0 24px 70px rgba(0,0,0,.55);
}
.ybt-pg-lb-caption {
	color: var(--ybt-cream);
	font-family: 'IBM Plex Mono', monospace;
	font-size: 12.5px;
	letter-spacing: .04em;
	margin-top: 16px;
}
.ybt-pg-lb-close,
.ybt-pg-lb-prev,
.ybt-pg-lb-next {
	position: absolute;
	background: rgba(247,244,238,0.08);
	color: var(--ybt-cream);
	border: 1px solid rgba(247,244,238,0.25);
	cursor: pointer;
	border-radius: 50%;
	width: 44px;
	height: 44px;
	font-size: 20px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .2s ease, border-color .2s ease, color .2s ease;
}
.ybt-pg-lb-close:hover,
.ybt-pg-lb-prev:hover,
.ybt-pg-lb-next:hover {
	background: var(--ybt-gold);
	color: var(--ybt-navy);
	border-color: var(--ybt-gold);
}
.ybt-pg-lb-close { top: 20px; right: 20px; }
.ybt-pg-lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.ybt-pg-lb-next { right: 20px; top: 50%; transform: translateY(-50%); }

/* Mobile: panah dipindah ke bawah supaya tidak menutupi foto & mudah dijangkau jempol */
@media (max-width: 640px) {
	.ybt-pg-lb-prev, .ybt-pg-lb-next {
		top: auto;
		bottom: 18px;
		transform: none;
		width: 40px;
		height: 40px;
	}
	.ybt-pg-lb-prev { left: 50%; margin-left: -54px; }
	.ybt-pg-lb-next { left: 50%; margin-left: 14px; }
	.ybt-pg-lb-close { top: 14px; right: 14px; width: 38px; height: 38px; }
	.ybt-pg-lb-stage { max-height: 78vh; }
	.ybt-pg-lb-img { max-height: 62vh; }
}

/* ===== Admin meta box (tidak berubah secara fungsi) ===== */
.ybt-pg-gallery-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	list-style: none;
	margin: 12px 0;
	padding: 0;
	min-height: 10px;
	max-width: 520px;
}
.ybt-pg-gallery-item {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 40px 6px 8px;
	background: #f6f7f7;
	border: 1px solid #dcdcde;
	border-radius: 6px;
}
.ybt-pg-item-handle {
	cursor: grab;
	color: #16233F;
	font-size: 15px;
	flex: 0 0 auto;
}
.ybt-pg-gallery-item img {
	width: 52px;
	height: 52px;
	object-fit: cover;
	border-radius: 4px;
	flex: 0 0 auto;
	display: block;
}
.ybt-pg-caption-input {
	flex: 1 1 auto;
	min-width: 0;
}
.ybt-pg-remove-item {
	position: absolute;
	top: 50%;
	right: 8px;
	transform: translateY(-50%);
	width: 22px;
	height: 22px;
	line-height: 20px;
	border-radius: 50%;
	background: #c0392b;
	color: #fff;
	border: none;
	cursor: pointer;
	font-size: 14px;
	padding: 0;
}
.ybt-pg-gallery-item.ui-sortable-helper { box-shadow: 0 6px 16px rgba(0,0,0,.3); background: #fff; }

/* ===== Urutan manual (drag & drop) di daftar Proyek ===== */
.column-ybt_pg_order { width: 70px; text-align: center; }
.ybt-pg-drag-handle {
	cursor: grab;
	color: var(--ybt-navy, #16233F);
	font-size: 16px;
	margin-right: 6px;
	user-select: none;
}
.ybt-pg-order-value {
	font-family: 'IBM Plex Mono', monospace;
	font-size: 12px;
	color: #666;
}
#the-list tr.ui-sortable-helper {
	background: #fff;
	box-shadow: 0 8px 20px rgba(0,0,0,.15);
	outline: 1px solid var(--ybt-gold, #F0A339);
}
#the-list tr { cursor: default; }
.ybt-pg-order-notice {
	display: inline-block;
	margin: 8px 0;
	padding: 6px 12px;
	border-radius: 4px;
	background: #16233F;
	color: #F7F4EE;
	font-family: 'IBM Plex Mono', monospace;
	font-size: 12px;
}
