/* ================================================================================================================== */
/* 1. STYLING DASAR DAN RESET */
/* ================================================================================================================== */
body {
	font-family: Arial, sans-serif;
	margin: 0;
	padding: 0;
	background-color: #f4f4f9; 
	color: #333;
	background-image: radial-gradient(#001f3f30 1px, transparent 0); 
	background-size: 20px 20px;
}

/* Konten Utama */
.main-content {
	padding: 20px 5%;
	text-align: center;
}

.page-title {
	padding-top: 20px;
	text-align: center;
}

/* ================================================================================================================== */
/* 2. HEADER (DESKTOP) */
/* ================================================================================================================== */

/* Header Utama */
.main-header {
	background-color: #001f3f; 
	color: white;
	padding: 15px 5%;
	display: flex; 
	justify-content: space-between; 
	align-items: center;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
	background-image: repeating-linear-gradient(
		45deg, 
		#001f3f, 
		#001f3f 10px, 
		#002850 10px, 
		#002850 11px 
	);
}

/* Container Navigasi dan Logo OPD */
.nav-container {
	display: flex;
	align-items: center;
	gap: 20px; 
}

/* Container Logo dan Judul Situs */
.logo {
	display: flex;
	align-items: center; 
	gap: 15px; 
}

/* Style untuk Logo Sleman di Header */
.logo-sleman-header {
	height: 150px; 
	width: auto;
}

/* Container khusus untuk Teks Header */
.header-text {
	display: block; 
	text-align: left;
}

/* Baris 1: Judul Utama (SIBARA) */
.header-text h1 {
	margin: 0;
	font-size: 1.6em; 
	font-weight: bold;
	color: white;
}

/* Baris 2 & 3: Teks Instansi/Wilayah */
.header-text .instansi-utama,
.header-text .wilayah {
	margin: 0;
	padding-top: 10px;
	font-size: 1.0em; 
	color: #b3cde0; 
	font-weight: normal; 
}
.header-text .wilayah {
	font-weight: bold; 
}

/* Navigasi */
.main-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
}

.main-nav li {
	margin-left: 20px;
	width: auto;
}

.main-nav a {
	color: white;
	text-decoration: none;
	padding: 8px 12px;
	border-radius: 4px;
	transition: background-color 0.3s;
}

.main-nav a:hover,
.main-nav a.active {
	background-color: #0073e6; 
}

.login-button {
	background-color: #0073e6; 
	font-weight: bold;
}

.login-button:hover {
	background-color: #005bb5;
}

/* ================================================================================================================== */
/* 3. OPD DETAIL LAYOUT (DESKTOP) */
/* ================================================================================================================== */

/* Untuk OPD Detail Container */
.detail-wrapper {
	display: flex;
	gap: 25px;
	padding: 10px;
}

/* Kolom kiri (Foto/Info OPD) */
.left-column {
	width: 32%; /* Lebar Desktop */
}

/* Kolom kanan (Menu Ikon) */
.right-column {
	width: 68%; /* Lebar Desktop */
}

/* KARTU PROFIL OPD */
.opddetail-profile-card {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	overflow: hidden;
	padding: 15px;
	text-align: center;
}

.opddetail-thumbnail {
	width: 100%;
	height: 300px; /* Tinggi Desktop */
	overflow: hidden;
	border-radius: 12px;
	background: #f0f0f0;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	cursor: pointer;
}

.opddetail-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 8px;
	margin-bottom: 10px;
	transition: transform 0.6s ease, filter 0.6s ease, opacity 0.6s ease;
}

.opddetail-profile-card h2 {
	font-size: 22px;
	color: #333;
	margin: 10px 0;
}

.alamat {
	font-size: 14px;
	color: #555;
	line-height: 1.6;
}

/* GRID MENU ICON (opd_detail.php) - Desktop 3 Kolom */
.opddetail-menu-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	grid-auto-rows: 150px; /* Atur tinggi ini agar sesuai dengan card tertinggi */
	/*gap: 25px;*/
	row-gap: 25px;      /* Jarak Vertikal (antar baris) */
    column-gap: 25px;   /* Jarak Horizontal (antar kolom) */
	margin-top: 20px;
	/*margin-top: 0 !important;
	margin-bottom: 0 !important;*/
}

/* CARD MENU ICON */
.opddetail-menu-card {
	background: #ffffff;
	border-radius: 14px;
	padding: 10px 10px;
	text-align: center;
	box-shadow: 0 5px 15px rgba(0,0,0,0.2);
	transition: 0.25s ease;
	cursor: pointer;
	border: 1px solid #f1f1f1;
	text-decoration: none !important;
	/*max-height: 150px;*/
	/* KUNCI: Flexbox untuk Pemusatan Vertikal */
    display: flex;
    flex-direction: column; 
    justify-content: center; /* Pusatkan item secara vertikal di dalam baris yang tingginya sudah sama */
    align-items: center;
	/* Penting: Pastikan margin vertikal item di dalamnya tidak mendorong card */
    margin-top: 0;
    margin-bottom: 0;
}

.opddetail-menu-card:hover {
	transform: translateY(-6px);
	box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}

.opddetail-menu-icon {
	font-size: 40px;
	margin-bottom: 15px;
	margin-top: 15px;
}

/* --- WARNA ICON (DITAMBAHKAN) --- */
.icon-blue { color: #1F6FEB; } 
.icon-green { color: #0BA95B; } 
.icon-orange { color: #F9A825; } 
.icon-yellow { color: #F4C430; } 
.icon-purple { color: #673AB7; } 
.icon-cyan { color: #00ACC1; } 
.icon-pink { color: #E91E63; } 
.icon-navy { color: #002855; } 
.icon-red { color: #D84315; } 

.opddetail-menu-card p {
	font-size: 17px;
	font-weight: 600;
	color: #444;
	margin-bottom: 0;
	margin-top: 0;
}

/* GRID MENU INFO (opd_profil.php) - Desktop 3 Kolom */
.opddetailnya-menu-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 25px;
	margin-top: 30px;
}

/* ================================================================================================================== */
/* 4. MEDIA QUERIES (RESPONSIVE DESIGN) */
/* ================================================================================================================== */

/* Penyesuaian untuk layar Tablet dan Mobile (Lebar maks 768px) */
@media (max-width: 768px) {
	
	/* [RESPONSIVE HEADER] */
	.main-header {
		flex-direction: column; 
		align-items: flex-start; 
		padding: 15px 5%; 
	}
	.logo-sleman-header {
		height: 60px; 
	}
	.header-text h1 {
		font-size: 1.1em; 
	}
	
	/* MODIFIKASI FINAL: TOMBOL BERANDA & LOGIN (FULL WIDTH, 2 KOLOM) */
	.nav-container {
		width: 100%;
		flex-direction: column; 
		align-items: flex-start;
	}
	
	.main-nav {
		width: 100%;
		margin-top: 10px; 
	}
	
	.main-nav ul {
		display: flex;
		flex-direction: row; 
		justify-content: space-between; 
		padding: 0;
		margin: 0;
		width: 100%; 
	}

	.main-nav li {
		margin-left: 0; 
		margin-right: 5px; 
		width: 50%; 
		flex-grow: 1; 
	}
	/* Pastikan tombol terakhir tidak memiliki margin kanan */
	.main-nav li:last-child {
		margin-right: 0; 
	}

	.main-nav a {
		font-size: 0.9em; 
		padding: 10px 12px; 
		text-align: center;
		display: block; 
	}
	
	/* [RESPONSIVE DETAIL OPD] */
	
	.detail-wrapper {
		flex-direction: column;
		gap: 15px;
	}
	
	/* KUNCI: KOLOM KIRI (FOTO/INFO OPD) MENGAMBIL LEBAR PENUH */
	.left-column {
		width: 100% !important; 
		min-width: initial;
		margin-bottom: 10px; 
	}

	.right-column {
		width: 100% !important;
	}

	/* MEMPERPENDEK KARTU FOTO OPD */
	.opddetail-profile-card {
		padding: 15px; 
	}

	.opddetail-thumbnail {
		height: 150px; 
		margin-bottom: 10px;
	}

	.opddetail-profile-card h2 {
		font-size: 1.3em; 
	}
	.opddetail-profile-card .alamat {
		font-size: 0.9em; 
	}
	
	/* MENGATUR GRID MENU ICON MENJADI 2 KOLOM */
	.opddetail-menu-grid {
		grid-template-columns: repeat(2, 1fr); 
		gap: 15px;
	}

	.opddetailnya-menu-grid {
		grid-template-columns: 1fr 1fr; 
		gap: 15px;
	}

	.opddetail-menu-icon {
		font-size: 30px; 
	}
	.opddetail-menu-card p {
		font-size: 14px;
	}
}

/* Penyesuaian tambahan untuk layar yang sangat kecil (< 480px) */
@media (max-width: 480px) {
	.logo-sleman-header {
		height: 45px; 
	}
	.header-text h1 {
		font-size: 1.0em; 
	}
	
	/* Grid pada detail OPD menjadi 1 kolom (untuk layar sangat kecil) */
	.opddetailnya-menu-grid {
		grid-template-columns: 1fr;
	}
	.opddetail-menu-grid {
		grid-template-columns: 1fr;
	}
}

/* ================================================================================================================== */
/* 5. STYLING TAMBAHAN LAINNYA */
/* ================================================================================================================== */

/* --- TATA LETAK MAP & PROFILE (PENTING UNTUK RESPONSIVE) --- */
.map-profile-container {
	display: flex;
	gap: 25px;
	margin-bottom: 30px;
	text-align: left; 
	padding: 0 5%;
}

.profile-section {
	flex: 1; 
	min-width: 300px; 
}

.map-section {
	flex: 2; 
}

#opdMap {
	height: 400px; 
	width: 100%;
	border-radius: 12px;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1); 
}

/* Judul dan Deskripsi Profil */
.profile-title {
	font-size: 2.0em;
	font-weight: 700;
	color: #001f3f;
	margin-top: 0;
	margin-bottom: 10px;
}

.profile-description {
	font-size: 1.0em;
	color: #555;
	line-height: 1.6;
}

.section-heading {
	text-align: center;
	font-size: 1.8em;
	color: #001f3f;
	margin: 40px 0 20px 0;
	font-weight: 600;
}

/* Footer */
.main-footer {
	background-color: #001f3f;
	color: #b3cde0;
	text-align: center;
	padding: 15px;
	margin-top: 30px;
}

/* --- OPD Grid Styling (Untuk index.php) --- */
.opd-grid {
	display: grid;
	/* 4 kolom di desktop besar */
	grid-template-columns: repeat(5, 1fr); 
	gap: 20px; 
	padding: 0 5%;
}

/* 2. Styling Kartu (opd-card) */
.opd-card {
	background-color: white;
	padding: 15px; 
	border-radius: 12px;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); 
	text-align: center;
	display: flex;
	flex-direction: column; 
	height: 100%;
	/* Efek Hover Keren */
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	cursor: pointer;
}

.opd-card:hover {
	transform: translateY(-5px); 
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15); 
}

/* Container untuk tata letak konten di dalam kartu */
.opd-card-content {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

.opd-text-area {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	align-items: center;
}


/* 3. Pengaturan Thumbnail */
.opd-thumbnail {
	width: 100%;
	padding-bottom: 75%; 
	height: 0;
	overflow: hidden;
	position: relative;
	margin-bottom: 10px;
	border-radius: 4px;
	background-color: #f0f0f0; 
}

.opd-thumbnail img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.thumbnail-placeholder {
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	color: #888;
}

/* 4. Judul OPD (opd-title) */
.opd-title {
	font-size: 15px; 
	font-weight: bold;
	margin: 5px 0 3px 0; 
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	flex-grow: 1; 
	width: 100%;
}

/* 5. Deskripsi (opd-description) */
.opd-description {
	order: 3; 
	font-size: 12px; 
	color: #555;
	background-color: #f7f7f7;
	padding: 8px;
	border-radius: 6px;
	margin-top: 15px;
	display: -webkit-box;
	-webkit-line-clamp: 2; 
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	width: 100%;
}

/* 6. Modifikasi Link Detail (opd-detail-link) menjadi Tombol Biru */
.opd-detail-link {
	order: 2; 
	margin-top: auto; 
	display: block;
	width: 100%; 

	background-color: #007bff; 
	color: white; 
	text-decoration: none; 
	text-align: center; 
	font-size: 15px; 
	font-weight: bold; 
	padding: 8px 0; 
	border-radius: 8px; 
	box-shadow: 0 4px 6px rgba(0, 123, 255, 0.3);
	margin-top: 10px; 
}

/* Efek Hover (opsional, untuk interaksi) */
.opd-detail-link:hover {
	background-color: #0056b3; 
	box-shadow: 0 6px 8px rgba(0, 123, 255, 0.4);
}

/* Styling untuk pesan jika tidak ada data */
.no-data {
	grid-column: 1 / -1; 
	text-align: center; 
	color: #888;
	padding: 20px;
	font-style: italic;
}

/* --- MEDIA QUERIES KHUSUS INDEX.PHP --- */

/* Tablet Landscape (Max 992px) */
@media (max-width: 992px) {
	.opd-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

/* Tablet Portrait (Max 768px) */
@media (max-width: 768px) {
	.map-profile-container {
		flex-direction: column;
		gap: 20px;
	}
	
	.profile-section,
	.map-section {
		flex: 100%; 
		min-width: initial;
	}
	
	#opdMap {
		height: 300px; 
	}
	
	.opd-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.opd-description {
		-webkit-line-clamp: 3; 
	}
}

/* Mobile (Max 576px) */
@media (max-width: 576px) {
	.opd-grid {
		grid-template-columns: 1fr;
	}
	.opd-card {
		flex-direction: row; 
		text-align: left;
		align-items: center;
	}
	.opd-card-content {
		display: flex;
		flex-direction: row;
		align-items: center;
		width: 100%;
		/* Menghilangkan padding agar konten di kartu mobile lebih rapat */
		padding: 0; 
	}
	.opd-thumbnail {
		width: 80px; 
		min-width: 80px;
		padding-bottom: 0;
		height: 80px;
		margin-right: 15px;
		margin-bottom: 0;
	}
	.opd-text-area {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		flex-grow: 1;
		/* Menyesuaikan jarak margin di mode mobile */
		margin-top: 0; 
		padding-right: 0; 
	}
	.opd-title {
		margin: 0; 
		font-size: 14px;
		width: auto; 
	}
	.opd-detail-link {
		width: auto; 
		font-size: 13px;
		padding: 6px 10px;
		margin-top: 5px;
		align-self: flex-start; 
	}
	.opd-description {
		display: none; 
	}
}
/* ... sisa styling modal ... */
.image-modal {
	display: none; 
	position: fixed; 
	z-index: 1000; 
	padding-top: 60px; 
	left: 0;
	top: 0;
	width: 100%; 
	height: 100%; 
	overflow: auto; 
	background-color: rgba(0,0,0,0.9); 
}

.modal-content-img {
	margin: auto;
	display: block;
	max-width: 90%;
	max-height: 80vh; 
	border-radius: 12px;
	box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
	transition: 0.3s;
}

.close-btn {
	position: absolute;
	top: 15px;
	right: 35px;
	color: #f1f1f1;
	font-size: 40px;
	font-weight: bold;
	transition: 0.3s;
	cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
	color: #bbb;
	text-decoration: none;
	cursor: pointer;
}

.modal-content-img {
 -webkit-animation-name: zoom;
 -webkit-animation-duration: 0.6s;
 animation-name: zoom;
 animation-duration: 0.6s;
}

@-webkit-keyframes zoom {
 from {-webkit-transform:scale(0)} 
 to {-webkit-transform:scale(1)}
}

@keyframes zoom {
 from {transform:scale(0)} 
 to {transform:scale(1)}
}