/* Core Grid Architecture */
.sdg-container {
	margin: 2em 0;
	font-family: inherit;
}
.sdg-search-wrapper {
	margin-bottom: 30px;
}

/* Upgraded 100% Width Custom Search Box */
#sdg-live-filter {
	width: 100%;
	max-width: 100%; /* Forces full width */
	padding: 16px 20px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	font-size: 16px;
	background-color: #f9fafb;
	color: #111827;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
	transition: all 0.3s ease;
	box-sizing: border-box;
}
#sdg-live-filter:focus {
	outline: none;
	background-color: #ffffff;
	border-color: #3b82f6;
	box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}
#sdg-live-filter::placeholder {
	color: #9ca3af;
}

/* Upgraded CSS Grid Layout (Up to 6 per row) */
.sdg-matrix-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 15px;
	align-items: stretch;
}
.sdg-alphabet-anchor {
	grid-column: 1 / -1; /* Forces header to span the whole row */
	margin-top: 30px;
	border-bottom: 2px solid #e5e7eb;
	padding-bottom: 5px;
}
.sdg-alphabet-anchor h3 {
	margin: 0;
	font-size: 22px;
	color: #1f2937;
}

/* Individual Tiles */
.sdg-tile-element {
	width: 100%;
	box-sizing: border-box;
}
.sdg-tile-click-surface {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	position: relative;
	padding: 12px 15px;
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	text-decoration: none;
	color: #374151;
	transition:
		box-shadow 0.25s ease,
		border-color 0.25s ease,
		transform 0.2s ease;
	height: 100%;
	box-sizing: border-box;
}
.sdg-tile-click-surface h4 {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: #111827;
	line-height: 1.4;
	word-wrap: break-word;
	overflow-wrap: break-word;
	hyphens: auto;
	width: 100%;
}
.sdg-tile-click-surface:hover {
	border-color: #9ca3af;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

/* Tooltip implementation inside the shortcode grid */
.sdg-tooltip-box {
	visibility: hidden;
	opacity: 0;
	width: 280px;
	background-color: #1f2937;
	color: #f9fafb;
	text-align: left;
	border-radius: 6px;
	padding: 12px;
	position: absolute;
	z-index: 99;
	bottom: 115%;
	left: 50%;
	transform: translateX(-50%);
	font-size: 13px;
	line-height: 1.4;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
	transition:
		opacity 0.2s ease,
		transform 0.2s ease;
	pointer-events: none;
}
.sdg-tooltip-box::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	margin-left: -6px;
	border-width: 6px;
	border-style: solid;
	border-color: #1f2937 transparent transparent transparent;
}
.sdg-tile-click-surface:hover .sdg-tooltip-box {
	visibility: visible;
	opacity: 1;
}

/* Modals */
.sdg-modal-viewport {
	display: none;
	position: fixed;
	z-index: 999999;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	overflow: auto;
	background-color: rgba(17, 24, 39, 0.6);
	backdrop-filter: blur(4px);
}
.sdg-modal-viewport.sdg-active {
	display: flex;
	align-items: center;
	justify-content: center;
}
.sdg-modal-container {
	background-color: #ffffff;
	padding: 32px;
	border-radius: 12px;
	width: 90%;
	max-width: 650px;
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
	position: relative;
	animation: sdg-slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.sdg-modal-dismiss-btn {
	position: absolute;
	top: 16px;
	right: 20px;
	background: none;
	border: none;
	font-size: 28px;
	cursor: pointer;
	color: #9ca3af;
}
.sdg-modal-dismiss-btn:hover {
	color: #111827;
}
@keyframes sdg-slide-up {
	from {
		transform: translateY(15px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}
