/* Styling for the Favoriten-Grid widget. Depends on dpi-global (tokens, .dpi-pill, .dpi-card--*) and dpi-saved-items (save button state). */

.dpi-saved-grid {
	--dpi-gap: 20px;
	--dpi-saved-columns: 1;
}

@media (min-width: 768px) {
	.dpi-saved-grid {
		--dpi-saved-columns: 2;
	}
}

@media (min-width: 1025px) {
	.dpi-saved-grid {
		--dpi-saved-columns: 3;
	}
}

/* Header: centered heading with the guide box floated to the right on desktop. */
.dpi-saved-grid__header {
	position: relative;
	margin-bottom: 40px;
}

.dpi-saved-grid__heading {
	width: 100%;
	margin: 0;
	text-align: center;
	font-family: var(--dpi-font);
	font-size: 40px;
	font-weight: 400;
	line-height: 1.1;
	color: var(--dpi-blue);
}

.dpi-saved-grid__heading-mark {
	color: inherit;
	font-weight: 800;
	text-decoration: underline;
}

/* Guide box: right-aligned copy + two round action buttons. */
.dpi-saved-grid__guide {
	position: absolute;
	top: 0;
	right: 0;
	display: flex;
	align-items: center;
	gap: 12px;
}

.dpi-saved-grid__guide[hidden] {
	display: none;
}

@media (max-width: 767px) {
	.dpi-saved-grid__header {
		display: flex;
		flex-direction: row;
		gap: 16px;
	}

	.dpi-saved-grid__heading {
		flex: 1 1 auto;
		width: auto;
		align-self: center;
		font-size: 30px;
		text-align: left;
	}

	.dpi-saved-grid__guide {
		position: static;
		flex: 0 0 auto;
	}
}

.dpi-saved-grid__guide-actions {
	display: flex;
	gap: 8px;
}

/* Circular icon buttons per the design. position:relative anchors the tooltip below. */
.dpi-saved-grid__guide-actions .dpi-saved-grid__guide-btn {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 37px;
	height: 37px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--dpi-orange);
	color: var(--dpi-orange-fg);
	font-size: 22px;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
}

.dpi-saved-grid__guide-actions .dpi-saved-grid__guide-btn > svg {
	width: calc(100% - 8px);
	height: calc(100% - 8px);
	color: inherit;
	fill: currentColor;
	stroke: currentColor;
}

.dpi-saved-grid__guide-actions .dpi-saved-grid__guide-btn > svg * {
	fill: currentColor;
	stroke: currentColor;
}

/* Alle-löschen icon sized smaller than Download/Share per design. */
.dpi-saved-grid__guide-actions .dpi-saved-grid__guide-btn--clear > svg {
	width: calc(100% - 20px);
	height: calc(100% - 20px);
}

.dpi-saved-grid__guide-actions .dpi-saved-grid__guide-btn:hover,
.dpi-saved-grid__guide-actions .dpi-saved-grid__guide-btn:focus {
	border-radius: 50%;
	color: var(--dpi-orange-fg);
	opacity: 0.9;
}

/* Read-only shared-favorites view (opened via a ?favoriten= link): clearing would wipe this visitor's own list, not what's shown. */
.dpi-saved-grid.is-shared-view [data-dpi-saved-clear-all] {
	display: none;
}

/* Guide tooltip: hidden bubble above its button, revealed only on hover/keyboard focus – not always-visible copy. Opens upward and centered (not left/right per-button) so an extra button in the row (e.g. Alle löschen) never overlaps its neighbour's tooltip. */
.dpi-saved-grid__tooltip {
	position: absolute;
	left: 50%;
	bottom: calc(100% + 5px);
	z-index: 3;
	display: flex;
	flex-direction: column;
	gap: 2px;
	box-sizing: border-box;
	width: min(180px, calc(100vw - 100px));
	max-width: 180px;
	padding: 10px 12px;
	border-radius: 0;
	background: none;
	color: var(--dpi-lime-fg);
	font-size: 10px;
	font-weight: 300;
	line-height: 1.35;
	text-align: center;
	text-decoration: none;
	white-space: normal;
	overflow-wrap: anywhere;
	opacity: 0;
	visibility: hidden;
	transform: translate(-50%, 6px);
	transition: opacity 0.15s ease, transform 0.15s ease;
	pointer-events: none;
}

.dpi-saved-grid__guide-btn:hover .dpi-saved-grid__tooltip,
.dpi-saved-grid__guide-btn:focus-visible .dpi-saved-grid__tooltip {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, 0);
}

.dpi-saved-grid__tooltip-text {
	min-width: 0; /* flex children default to min-width:auto, which can push past the tooltip's fixed width on a long word */
}

.dpi-saved-grid__clear-dialog[hidden] {
	display: none;
}

.dpi-saved-grid__clear-dialog {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.dpi-saved-grid__clear-dialog-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .14);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}

.dpi-saved-grid__clear-dialog-content {
	position: relative;
	width: min(100%, 500px);
	padding: 32px;
	border: 0;
	border-radius: 0;
	background: var(--dpi-fg-on-dark);
	color: var(--dpi-lime-fg);
	box-shadow: 0 16px 48px rgb(10 24 85 / 28%);
}

.dpi-saved-grid__clear-dialog-title {
	margin: 0 0 12px;
	font-family: var(--dpi-font);
	font-size: 28px;
	font-weight: 800;
	line-height: 1.15;
}

.dpi-saved-grid__clear-dialog-description {
	margin: 0;
	font-size: 16px;
	line-height: 1.5;
}

.dpi-saved-grid__clear-dialog-actions {
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	margin-top: 28px;
}

.dpi-saved-grid__clear-dialog-actions button {
	padding: 12px 20px;
	border: 1px solid var(--dpi-lime-fg);
	border-radius: 0;
	background: transparent;
	color: var(--dpi-lime-fg);
	font-family: var(--dpi-font);
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
}

.dpi-saved-grid__clear-dialog-confirm {
	background: var(--dpi-blue) !important;
	border-color: var(--dpi-blue) !important;
	color: var(--dpi-fg-on-dark) !important;
}

.dpi-saved-grid__clear-dialog-actions button:focus-visible {
	outline: 2px solid var(--dpi-blue);
	outline-offset: 2px;
}

@media (max-width: 767px) {
	.dpi-saved-grid__clear-dialog-content {
		padding: 24px;
	}

	.dpi-saved-grid__clear-dialog-actions {
		flex-direction: column-reverse;
	}

	.dpi-saved-grid__clear-dialog-actions button {
		width: 100%;
	}
}

/* Cards grid: reuses dpi-global's shared .dpi-grid layout; Elementor controls the responsive column count. */

.dpi-saved-grid__card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: 300px;
	border-radius: 0;
	background-size: cover;
	background-position: center;
	color: var(--dpi-fg-on-dark);
	overflow: hidden;
}

.dpi-saved-grid__cards .dpi-grid__row--three {
	display: grid;
	grid-template-columns: repeat(var(--dpi-saved-columns), minmax(0, 1fr));
}

.dpi-saved-grid__cards .dpi-grid__row--three > * {
	min-width: 0;
}

.dpi-saved-grid__card.dpi-card--orange {
	color: var(--dpi-orange-fg);
}

.dpi-saved-grid__card.dpi-card--blue {
	color: var(--dpi-blue-fg);
}

.dpi-saved-grid__card.dpi-card--lime {
	color: var(--dpi-lime-fg);
}

/* Dark scrim behind text on photo cards (career/story) so white text stays legible. */
.dpi-saved-grid__card--image::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.55) 45%, rgba(0, 0, 0, 0) 80%);
	pointer-events: none;
}

.dpi-saved-grid__card--image {
	color: var(--dpi-fg-on-dark);
}

/* Beat Elementor kit link colours (.elementor-kit-* a) inside coloured cards. */
.dpi-saved-grid__card.dpi-card--orange a,
.dpi-saved-grid__card.dpi-card--orange a:hover,
.dpi-saved-grid__card.dpi-card--orange a:focus {
	color: var(--dpi-orange-fg);
}

.dpi-saved-grid__card.dpi-card--blue a,
.dpi-saved-grid__card.dpi-card--blue a:hover,
.dpi-saved-grid__card.dpi-card--blue a:focus {
	color: var(--dpi-blue-fg);
}

.dpi-saved-grid__card.dpi-card--lime a,
.dpi-saved-grid__card.dpi-card--lime a:hover,
.dpi-saved-grid__card.dpi-card--lime a:focus {
	color: var(--dpi-lime-fg);
}

.dpi-saved-grid__card.dpi-saved-grid__card--image a,
.dpi-saved-grid__card.dpi-saved-grid__card--image a:hover,
.dpi-saved-grid__card.dpi-saved-grid__card--image a:focus {
	color: var(--dpi-fg-on-dark);
}

.dpi-saved-grid__card-link,
.dpi-saved-grid__card-link:hover,
.dpi-saved-grid__card-link:focus {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 20px 25px;
	border-radius: 0;
	color: inherit; /* also on :hover/:focus to override Elementor reset.css's global a:hover colour change – card keeps the card colour on hover */
	text-align: left;
	text-decoration: none;
}

.dpi-saved-grid__card-link:focus-visible {
	outline: 2px solid var(--dpi-lime);
	outline-offset: -2px;
}

.dpi-saved-grid__card-top {
	display: flex;
	position: relative;
	z-index: 1;
}

.dpi-saved-grid__card-bottom {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.dpi-saved-grid__badge {
	position: relative;
	z-index: 1;
	align-self: flex-start;
}

/* Same as career-grid: .dpi-pill's default (blue bg) would blend straight into a blue card's background, so the badge switches to orange there. */
.dpi-saved-grid__card.dpi-card--blue .dpi-saved-grid__badge {
	background: var(--dpi-orange);
	color: var(--dpi-orange-fg);
}

.dpi-saved-grid__title {
	font-family: var(--dpi-font);
	font-size: 24px;
	font-weight: 700;
	line-height: 1.3;
}

.dpi-saved-grid__subtitle {
	font-family: var(--dpi-font);
	font-size: 15px;
	font-weight: 400;
	line-height: 1.4;
}

/* Save/bookmark toggle: sibling of the card link, on top so unsaving never triggers navigation. Scoped under its card parent for specificity over Elementor's own button defaults. */
.dpi-saved-grid__card .dpi-saved-grid__save {
	position: absolute;
	top: var(--dpi-card-padding-top, 20px);
	right: var(--dpi-card-padding-right, 25px);
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: inherit;
	font-size: 16px;
	cursor: pointer;
}

.dpi-saved-grid__card .dpi-saved-grid__save:hover,
.dpi-saved-grid__card .dpi-saved-grid__save:focus {
	background: transparent;
	color: inherit;
}

.dpi-saved-grid__card .dpi-saved-grid__save i,
.dpi-saved-grid__card .dpi-saved-grid__save svg {
	width: 21px;
	height: 27px;
	max-height: 27px;
}

.dpi-saved-grid__card .dpi-saved-grid__save svg,
.dpi-saved-grid__card .dpi-saved-grid__save svg path {
	fill: currentColor;
	stroke: currentColor;
}

.dpi-saved-grid__status {
	margin: 0 0 12px;
	font-family: var(--dpi-font);
	font-size: 14px;
	color: var(--dpi-muted);
}

.dpi-saved-grid__status:empty {
	display: none;
}
