/* Manajemen Data - base styles for the 4 new widgets:
 * Proficiat untuk Prestasinya, Prestasi, Dewan Guru, Kepala Sekolah.
 * Most visual properties (colors, radius, spacing, typography) are
 * generated dynamically by Elementor's Style controls. This file sets
 * structural layout + sensible fallback defaults, and enforces a 1:1
 * (square) image ratio across every card so galleries stay aligned
 * even if source images aren't perfectly square.
 */

/* =========================================================
 * PROFICIAT UNTUK PRESTASINYA
 * ========================================================= */

.md-proficiat-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	width: 100%;
}

.md-proficiat-card {
	background: #ffffff;
	border-radius: 18px;
	padding: 20px;
	text-align: center;
	box-sizing: border-box;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.md-proficiat-card:hover {
	transform: translateY(-4px);
}

.md-proficiat-photo-wrap {
	margin-bottom: 16px;
}

.md-proficiat-photo {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 14px;
	max-width: 100%;
}

.md-proficiat-photo--placeholder {
	background: #eef1f4;
}

.md-proficiat-name {
	font-size: 18px;
	font-weight: 700;
	color: #1a1a1a;
	margin: 0 0 8px;
	line-height: 1.3;
}

.md-proficiat-desc {
	font-size: 14px;
	color: #5a5a5a;
	line-height: 1.6;
	margin: 0;
}

/* =========================================================
 * PRESTASI (GALERI)
 * ========================================================= */

.md-prestasi-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px;
	width: 100%;
}

.md-prestasi-card {
	position: relative;
	overflow: hidden;
	border-radius: 14px;
	aspect-ratio: 1 / 1;
	background: #eef1f4;
}

.md-prestasi-photo {
	display: block;
	width: 100%;
	height: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.md-prestasi-card--zoom:hover .md-prestasi-photo {
	transform: scale(1.08);
}

.md-prestasi-photo--placeholder {
	width: 100%;
	height: 100%;
}

.md-prestasi-caption {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	padding: 14px;
	background: rgba(0, 0, 0, 0.55);
	color: #ffffff;
	font-size: 13px;
	line-height: 1.4;
	opacity: 0;
	transition: opacity 0.25s ease;
	box-sizing: border-box;
}

.md-prestasi-card:hover .md-prestasi-caption {
	opacity: 1;
}

/* =========================================================
 * DEWAN GURU
 * ========================================================= */

.md-guru-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 22px;
	width: 100%;
}

.md-guru-card {
	background: #ffffff;
	border-radius: 16px;
	padding: 24px 18px;
	text-align: center;
	box-sizing: border-box;
	transition: transform 0.25s ease;
}

.md-guru-card:hover {
	transform: translateY(-4px);
}

.md-guru-photo-wrap {
	display: flex;
	justify-content: center;
	margin-bottom: 14px;
}

.md-guru-photo {
	display: block;
	width: 110px;
	height: 110px;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 50%;
	max-width: 100%;
}

.md-guru-photo--placeholder {
	width: 110px;
	height: 110px;
	background: #eef1f4;
	border-radius: 50%;
}

.md-guru-name {
	font-size: 16px;
	font-weight: 700;
	color: #1a1a1a;
	margin: 0 0 10px;
	line-height: 1.3;
}

.md-guru-mapel-list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
}

.md-guru-mapel-item {
	display: inline-block;
	background: #eaf2fb;
	color: #2271b1;
	font-size: 12px;
	font-weight: 600;
	padding: 4px 12px;
	border-radius: 999px;
	line-height: 1.6;
}

/* =========================================================
 * KEPALA SEKOLAH
 * ========================================================= */

.md-kepsek-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	width: 100%;
}

.md-kepsek-card {
	background: #ffffff;
	border-radius: 16px;
	padding: 24px 20px;
	text-align: center;
	box-sizing: border-box;
	transition: transform 0.25s ease;
}

.md-kepsek-card:hover {
	transform: translateY(-4px);
}

.md-kepsek-photo-wrap {
	display: flex;
	justify-content: center;
	margin-bottom: 16px;
}

.md-kepsek-photo {
	display: block;
	width: 130px;
	height: 130px;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 14px;
	max-width: 100%;
}

.md-kepsek-photo--placeholder {
	width: 130px;
	height: 130px;
	background: #eef1f4;
	border-radius: 14px;
}

.md-kepsek-name {
	font-size: 17px;
	font-weight: 700;
	color: #1a1a1a;
	margin: 0 0 10px;
	line-height: 1.3;
}

.md-kepsek-periode-list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
}

.md-kepsek-periode-item {
	display: inline-block;
	background: #fff3d6;
	color: #8a5a00;
	font-size: 12px;
	font-weight: 600;
	padding: 4px 12px;
	border-radius: 999px;
	line-height: 1.6;
}

/* =========================================================
 * LAPORAN DANA BOS (TABEL)
 * ========================================================= */

.md-danabos-wrap {
	width: 100%;
	background: #ffffff;
}

.md-danabos-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.md-danabos-table thead th {
	text-align: left;
	padding: 14px 16px;
	font-weight: 700;
	white-space: nowrap;
}

.md-danabos-table tbody td {
	padding: 12px 16px;
	vertical-align: middle;
	border-bottom: 1px solid #ececec;
}

.md-danabos-table tbody tr:last-child td {
	border-bottom: none;
}

.md-danabos-btn {
	display: inline-block;
	padding: 6px 18px;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.2s ease, opacity 0.2s ease;
}

.md-danabos-btn--disabled {
	opacity: 0.4;
	cursor: not-allowed;
	background: #9aa5b1 !important;
}

/* Mode: scroll horizontal - table keeps its shape, wrapper scrolls */
.md-danabos-mode-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.md-danabos-mode-scroll .md-danabos-table {
	min-width: 560px;
}

/* Mode: stack - table becomes stacked "cards" on small screens */
@media (max-width: 680px) {
	.md-danabos-mode-stack .md-danabos-table,
	.md-danabos-mode-stack .md-danabos-table thead,
	.md-danabos-mode-stack .md-danabos-table tbody,
	.md-danabos-mode-stack .md-danabos-table tr,
	.md-danabos-mode-stack .md-danabos-table td {
		display: block;
		width: 100%;
	}

	.md-danabos-mode-stack .md-danabos-table thead {
		position: absolute;
		left: -9999px;
		top: -9999px;
	}

	.md-danabos-mode-stack .md-danabos-table tr {
		margin-bottom: 14px;
		border: 1px solid #ececec;
		border-radius: 10px;
		overflow: hidden;
	}

	.md-danabos-mode-stack .md-danabos-table tbody tr:nth-child(even) {
		background-color: inherit;
	}

	.md-danabos-mode-stack .md-danabos-table td {
		text-align: right;
		padding: 10px 14px;
		border-bottom: 1px solid #f0f0f0;
		position: relative;
	}

	.md-danabos-mode-stack .md-danabos-table td:last-child {
		border-bottom: none;
	}

	.md-danabos-mode-stack .md-danabos-table td::before {
		content: attr(data-label);
		float: left;
		font-weight: 700;
		color: #50575e;
		margin-right: 10px;
	}
}

/* =========================================================
 * RESPONSIVE FALLBACKS (used if Elementor responsive controls
 * haven't been customized by the admin yet)
 * ========================================================= */

@media (max-width: 1024px) {
	.md-guru-grid { grid-template-columns: repeat(2, 1fr); }
	.md-prestasi-grid { grid-template-columns: repeat(3, 1fr); }
	.md-kepsek-grid { grid-template-columns: repeat(2, 1fr); }
	.md-proficiat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
	.md-guru-grid,
	.md-prestasi-grid,
	.md-kepsek-grid,
	.md-proficiat-grid {
		grid-template-columns: repeat(1, 1fr);
	}
}
