/**
 * Hoard Shortcuts Frontend Styles
 * Responsive card layout for shortcut display
 */

/* Main Container */
.hoard-shortcuts {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 18px;
	margin: 14px 0 0;
	padding: 0 14px 14px;
	list-style: none;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	align-items: stretch;
}

.widget_hoard_shortcuts {
	container-type: inline-size;
}

.widget_hoard_shortcuts .widget-title,
.widget_hoard_shortcuts .widgettitle {
	margin-bottom: 0;
}

/* Individual Shortcut Card */
.hoard-shortcut-card {
	position: relative;
	isolation: isolate;
	min-height: 108px;
	height: 100%;
	padding: 12px 16px;
	border-radius: 8px;
	background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
	text-decoration: none;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	transition: all 0.3s ease;
	color: inherit;
	min-width: 0;
	box-sizing: border-box;
}

.hoard-shortcut-card.has-link::after {
	content: "\2197";
	position: absolute;
	top: 0;
	right: 0;
	width: 28px;
	height: 28px;
	border-radius: 0 8px 0 10px;
	background-color: rgba(255, 255, 255, 0.12);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
	font-weight: 700;
	line-height: 1;
	color: rgba(255, 255, 255, 0.88);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
	transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

/* Card Hover State */
.hoard-shortcut-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	text-decoration: none;
}

.hoard-shortcut-card.has-link:hover::after,
.hoard-shortcut-card.has-link:focus::after,
.hoard-shortcut-card.has-link:focus-visible::after {
	transform: translate(2px, -2px);
	background-color: rgba(255, 255, 255, 0.18);
	color: #ffffff;
}

.hoard-shortcut-card:focus {
	outline: 2px solid #4c6ef5;
	outline-offset: 2px;
}

.hoard-shortcut-image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	background-color: #f0f0f0;
	z-index: -2;
}

.hoard-shortcut-card.has-image:not(.image-only)::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(15, 23, 42, 0.2) 0%, rgba(15, 23, 42, 0.68) 100%);
	z-index: -1;
}

.hoard-shortcut-card:not(.has-image) {
	background:
		radial-gradient(
			circle at top left,
			var(--cor-tema-tonalidade-2-rgba, rgba(96, 165, 250, 0.22)),
			transparent 48%
		),
		linear-gradient(
			135deg,
			var(--cor-tema-tonalidade-4, #243247) 0%,
			var(--cor-tema-tonalidade-5, #162033) 55%,
			var(--cor-tema-mais-escura, #0f172a) 100%
		);
}

.hoard-shortcut-content {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	text-align: center;
}

.hoard-shortcut-title {
	display: block;
	font-weight: 600;
	font-size: 1rem;
	line-height: 1.4;
	color: #f8fafc;
	word-break: normal;
	overflow-wrap: anywhere;
	transition: transform 0.25s ease, opacity 0.25s ease;
}

.hoard-shortcut-description {
	position: absolute;
	inset: 50% 0 auto;
	font-size: 13px;
	line-height: 1.5;
	color: #e5edf9;
	margin: 0;
	text-decoration: none;
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
	width: 100%;
	max-width: 32ch;
	padding-inline: 8px;
	max-height: 0;
	opacity: 0;
	pointer-events: none;
	transform: translateY(-50%) scale(0.96);
	transition: opacity 0.25s ease, transform 0.25s ease, max-height 0.25s ease;
	text-align: center;
	margin-inline: auto;
}

.hoard-shortcut-card.has-description:hover .hoard-shortcut-description,
.hoard-shortcut-card.has-description:focus .hoard-shortcut-description,
.hoard-shortcut-card.has-description:focus-visible .hoard-shortcut-description {
	max-height: 6em;
	opacity: 1;
	transform: translateY(-50%) scale(1);
}

.hoard-shortcut-card.has-description:hover .hoard-shortcut-title,
.hoard-shortcut-card.has-description:focus .hoard-shortcut-title,
.hoard-shortcut-card.has-description:focus-visible .hoard-shortcut-title {
	opacity: 0;
	transform: scale(0.96);
}

.hoard-shortcut-card.has-image .hoard-shortcut-title,
.hoard-shortcut-card.has-image .hoard-shortcut-description {
	color: #ffffff;
	text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.hoard-shortcut-card.has-image.has-link::after {
	background-color: rgba(15, 23, 42, 0.3);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.hoard-shortcut-card.has-image.has-link:hover::after,
.hoard-shortcut-card.has-image.has-link:focus::after,
.hoard-shortcut-card.has-image.has-link:focus-visible::after {
	background-color: rgba(15, 23, 42, 0.42);
}

.hoard-shortcut-card.image-only .hoard-shortcut-content {
	display: none;
}

.hoard-shortcut-card:not(.has-link) {
	cursor: default;
}

.hoard-shortcut-card:not(.has-link):hover {
	transform: none;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.hoard-shortcut-card:not(.has-title) .hoard-shortcut-description {
	max-height: 6em;
	opacity: 1;
	position: static;
	transform: none;
}

.hoard-shortcut-card:not(.has-image):not(.has-description) .hoard-shortcut-title {
	color: #f8fafc;
}

.hoard-shortcut-card:not(.has-image) .hoard-shortcut-content {
	padding-inline: 4px;
}

/* Responsive Design - Tablet */
@media (max-width: 960px) {
	.hoard-shortcuts {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px;
	}
}

@media (max-width: 768px) {
	.hoard-shortcuts {
		grid-template-columns: 1fr;
		gap: 12px;
		padding: 0 12px 12px;
	}

	.hoard-shortcut-image {
		height: 100%;
	}

	.hoard-shortcut-title {
		font-size: 0.95rem;
	}

	.hoard-shortcut-description {
		font-size: 12px;
	}
}

@container (max-width: 420px) {
	.hoard-shortcuts {
		grid-template-columns: 1fr;
		gap: 12px;
		padding: 0 12px 12px;
	}
}

@container (min-width: 421px) and (max-width: 720px) {
	.hoard-shortcuts {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Responsive Design - Mobile */
@media (max-width: 480px) {
	.hoard-shortcuts {
		grid-template-columns: 1fr;
		gap: 10px;
		padding: 0 10px 10px;
	}

	.hoard-shortcut-card {
		min-height: 100px;
		padding: 14px;
	}

	.hoard-shortcut-title {
		font-size: 0.9rem;
	}

	.hoard-shortcut-description {
		font-size: 11px;
		-webkit-line-clamp: 3;
	}

	.hoard-shortcut-card {
		border-radius: 6px;
	}
}

/* Dark Mode Support (if theme supports prefers-color-scheme) */
@media (prefers-color-scheme: dark) {
	.hoard-shortcut-card {
		background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
	}

	.hoard-shortcut-card:hover {
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
	}

	.hoard-shortcut-image {
		background-color: #1a1a1a;
	}
}

/* Print Styles */
@media print {
	.hoard-shortcut-card {
		page-break-inside: avoid;
		box-shadow: none;
		border: 1px solid #ddd;
	}

	.hoard-shortcut-card:hover {
		transform: none;
	}
}

/* Accessibility - No Motion */
@media (prefers-reduced-motion: reduce) {
	.hoard-shortcut-card,
	.hoard-shortcut-card:hover {
		transition: none;
		transform: none;
	}
}
