/* Selector diskop ke .lt-grid / .lt-modal supaya menang dari selector tema
   seperti .entry-content button atau .entry-content h3.
   Nilai warna dan ukuran berasal dari CSS variables yang dicetak
   LT_Settings::css_vars() sesuai pengaturan admin. */

.lt-grid,
.lt-grid *,
.lt-modal,
.lt-modal * {
	box-sizing: border-box;
}

.lt-grid {
	display: grid;
	grid-template-columns: repeat(var(--lt-cols, 3), minmax(0, 1fr));
	gap: 24px;
	margin: 0 0 24px;
	font-family: var(--lt-font, inherit);
}

.lt-grid .lt-card {
	display: flex;
	flex-direction: column;
	background: var(--lt-card-bg, #fff);
	border: 1px solid var(--lt-card-border, #e5e7eb);
	border-radius: var(--lt-card-radius, 16px);
	overflow: hidden;
	margin: 0;
	box-shadow: 0 1px 3px rgba(17, 24, 39, 0.06);
}

.lt-grid .lt-card .lt-cover {
	position: relative;
	width: min(var(--lt-cover-w, 100%), 100%);
	height: var(--lt-cover-h, auto);
	aspect-ratio: var(--lt-cover-ratio, 3/4);
	overflow: hidden;
	background: var(--lt-card-bg, #fff);
	border-radius: var(--lt-card-radius, 16px) var(--lt-card-radius, 16px) 0 0;
}

/* fill: gambar selalu stretch mengisi bingkai sesuai ukuran yang ditetapkan.
   border-radius 0 menimpa radius bawaan tema; sudut bawah cover selalu 0. */
.lt-grid .lt-card .lt-cover img {
	width: 100%;
	height: 100%;
	object-fit: fill;
	display: block;
	border-radius: 0;
}

.lt-grid .lt-card .lt-cover-top {
	position: relative;
	z-index: 1;
	padding: 22px 16px 0;
	text-align: center;
}

.lt-grid .lt-card .lt-cover-site {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--lt-dark, #14532d);
	margin: 0 0 12px;
	line-height: 1.4;
}

.lt-grid .lt-card .lt-cover-title {
	font-size: 24px;
	font-weight: 800;
	line-height: 1.2;
	color: var(--lt-dark, #14532d);
	margin: 0 0 12px;
	text-transform: none;
	letter-spacing: normal;
}

.lt-grid .lt-card .lt-cover-tahun {
	display: inline-block;
	background: var(--lt-accent, #f0b429);
	color: var(--lt-dark, #14532d);
	font-size: 12px;
	font-weight: 700;
	padding: 4px 12px;
	border-radius: 5px;
}

.lt-grid .lt-card .lt-cover-wave {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	height: 42%;
	display: block;
}

.lt-grid .lt-card .lt-cover-wave path:nth-child(1) {
	fill: var(--lt-accent, #f0b429);
}

.lt-grid .lt-card .lt-cover-wave path:nth-child(2) {
	fill: var(--lt-primary, #1b7a4a);
}

.lt-grid .lt-card .lt-cover-wave path:nth-child(3) {
	fill: var(--lt-dark, #14532d);
}

.lt-grid .lt-card .lt-body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 16px 16px 18px;
}

.lt-grid .lt-card .lt-date {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: #6b7280;
	margin: 0 0 8px;
}

.lt-grid .lt-card .lt-date svg {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

.lt-grid .lt-card .lt-title {
	font-size: var(--lt-title-size, 18px);
	font-weight: 700;
	color: var(--lt-dark, #14532d);
	margin: 0 0 8px;
	padding: 0;
	border: 0;
	background: none;
	line-height: 1.3;
	letter-spacing: normal;
	text-transform: none;
	overflow-wrap: anywhere;
}

.lt-grid .lt-card .lt-desc {
	font-size: var(--lt-desc-size, 13px);
	color: var(--lt-text, #4b5563);
	line-height: 1.55;
	margin: 0 0 12px;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	overflow-wrap: anywhere;
}

.lt-grid .lt-card .lt-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	border-top: 1px solid var(--lt-card-border, #e5e7eb);
	padding-top: 10px;
	margin: 0 0 14px;
}

.lt-grid .lt-card .lt-meta svg {
	width: 18px;
	height: 18px;
	color: var(--lt-primary, #1b7a4a);
	flex-shrink: 0;
}

.lt-grid .lt-card .lt-meta-label {
	font-size: 12px;
	color: #6b7280;
}

.lt-grid .lt-card .lt-meta-value {
	font-size: 13px;
	font-weight: 700;
	color: #111827;
	margin-left: auto;
}

/* margin-top:auto menempelkan tombol ke dasar kartu supaya sejajar antar kartu. */
.lt-grid .lt-card .lt-actions {
	display: flex;
	gap: 10px;
	margin-top: auto;
}

.lt-grid .lt-card .lt-btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: var(--lt-btn-height, 44px);
	margin: 0;
	padding: 0 16px;
	border-radius: var(--lt-btn-radius, 10px);
	border: 1.5px solid transparent;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.lt-grid .lt-card .lt-btn svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.lt-grid .lt-card .lt-btn-solid {
	flex: 1;
	min-width: 0;
}

.lt-grid .lt-card .lt-btn-icon {
	flex: 0 0 auto;
	width: var(--lt-btn-height, 44px);
	padding: 0;
}

.lt-grid .lt-card .lt-btn-solid,
.lt-grid .lt-card .lt-btn-solid:hover,
.lt-grid .lt-card .lt-btn-solid:focus {
	background: var(--lt-primary, #1b7a4a);
	color: var(--lt-btn-text, #fff);
}

.lt-grid .lt-card .lt-btn-solid:hover,
.lt-grid .lt-card .lt-btn-solid:focus {
	background: var(--lt-dark, #14532d);
}

.lt-grid .lt-card .lt-btn-outline,
.lt-grid .lt-card .lt-btn-outline:hover,
.lt-grid .lt-card .lt-btn-outline:focus {
	background: var(--lt-outline-bg, #fff);
	border-color: var(--lt-primary, #1b7a4a);
	color: var(--lt-primary, #1b7a4a);
}

.lt-grid .lt-card .lt-btn-outline:hover,
.lt-grid .lt-card .lt-btn-outline:focus {
	background: var(--lt-badge-bg, #e7f4ec);
	color: var(--lt-dark, #14532d);
}

.lt-empty {
	color: #4b5563;
	font-size: 14px;
}

.lt-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	font-family: var(--lt-font, inherit);
}

.lt-modal[hidden] {
	display: none;
}

.lt-modal .lt-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(17, 24, 39, 0.65);
}

.lt-modal .lt-modal-dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(960px, 100%);
	height: min(86vh, 100%);
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	animation: lt-pop 0.18s ease;
}

.lt-modal .lt-modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 6px 8px 6px 18px;
	border-bottom: 1px solid #e5e7eb;
	flex-shrink: 0;
	position: relative;
	z-index: 2;
	background: #fff;
}

.lt-modal .lt-modal-head h4 {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: #111827;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	text-transform: none;
	letter-spacing: normal;
}

/* Tombol close solid kontras supaya selalu terbaca sebagai tombol di kanan
   atas, termasuk di mobile dan saat tema mewarnai ulang elemen button. */
.lt-modal .lt-modal-dialog .lt-modal-close {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	flex-shrink: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: var(--lt-dark, #14532d);
	box-shadow: 0 1px 4px rgba(17, 24, 39, 0.25);
	color: #fff;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
}

.lt-modal .lt-modal-dialog .lt-modal-close:hover,
.lt-modal .lt-modal-dialog .lt-modal-close:focus {
	background: var(--lt-primary, #1b7a4a);
	color: #fff;
}

.lt-modal .lt-modal-close svg {
	width: 20px;
	height: 20px;
}

.lt-modal .lt-modal-frame {
	flex: 1;
	width: 100%;
	border: 0;
	background: #f3f4f6;
}

@keyframes lt-pop {
	from {
		opacity: 0;
		transform: scale(0.97);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.lt-modal .lt-modal-dialog {
		animation: none;
	}
	.lt-grid .lt-card .lt-btn {
		transition: none;
	}
}

/* Breakpoint kolom ditaruh di CSS eksternal (setelah aturan dasar) supaya
   tetap berlaku walau style inline dari PHP digabung, diurutkan ulang,
   atau dibuang oleh plugin optimasi/cache. */
@media (max-width: 1024px) {
	.lt-grid {
		grid-template-columns: repeat(var(--lt-cols-md, 2), minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.lt-grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}
	.lt-modal {
		padding: 8px;
	}
	.lt-modal .lt-modal-dialog {
		height: min(92vh, 100%);
		border-radius: 10px;
	}
	.lt-modal .lt-modal-head {
		padding: 4px 4px 4px 14px;
	}
	.lt-modal .lt-modal-head h4 {
		font-size: 14px;
	}
}

@media (max-width: 480px) {
	.lt-grid .lt-card .lt-body {
		padding: 14px 14px 16px;
	}
	.lt-grid .lt-card .lt-cover-top {
		padding: 18px 12px 0;
	}
	.lt-grid .lt-card .lt-cover-title {
		font-size: 18px;
	}
	.lt-grid .lt-card .lt-title {
		font-size: min(var(--lt-title-size, 18px), 17px);
	}
	.lt-grid .lt-card .lt-btn {
		font-size: 13px;
		padding: 0 12px;
		gap: 6px;
	}
	.lt-grid .lt-card .lt-btn-icon {
		padding: 0;
	}
	.lt-grid .lt-card .lt-meta {
		flex-wrap: wrap;
	}
}