/**
 * Plötner Dev Blocks — presentation for the plugin's blocks and patterns.
 *
 * Moved out of the former ploetner-dev child theme's custom.css. Depends only
 * on the design-system tokens (colors, spacing, fonts) that theme.json exposes,
 * so the plugin styles its own output on any theme that defines them.
 */

/* Cards */
.ploetner-card {
	transition: border-color 0.3s ease, transform 0.2s ease;
}

.ploetner-card:hover {
	border-color: var(--wp--preset--color--border-hover) !important;
	transform: translateY(-2px);
}

.ploetner-card-desc,
.ploetner-card-desc p {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 300;
	line-height: 1.6;
}

.ploetner-card-desc > :last-child {
	margin-bottom: 0;
}

/* Expertise grid: seamless 1px gap */
.ploetner-expertise-grid {
	background: var(--wp--preset--color--border);
	gap: 1px !important;
	overflow: hidden;
	border-radius: 3px;
}

.ploetner-expertise-grid > .wp-block-column {
	transition: background 0.3s ease;
}

.ploetner-expertise-grid > .wp-block-column:hover {
	background: var(--wp--preset--color--elevated) !important;
}

/* Speaking rows: hover tint bleeds past the content via a pseudo-element */
.ploetner-speaking-row {
	position: relative;
	transition: background 0.2s ease;
	border-radius: 2px;
}

.ploetner-speaking-row::before {
	content: "";
	position: absolute;
	inset: 0 -0.75rem;
	border-radius: 2px;
	background: transparent;
	transition: background 0.2s ease;
	pointer-events: none;
	z-index: 0;
}

.ploetner-speaking-row > * {
	position: relative;
	z-index: 1;
}

.ploetner-speaking-row:hover::before {
	background: color-mix(in srgb, var(--wp--preset--color--accent) 6%, transparent);
}

/* Speaking rows: linked talk title keeps the row colour, accent on hover */
.ploetner-speaking-row a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.ploetner-speaking-row a:hover,
.ploetner-speaking-row a:focus-visible {
	color: var(--wp--preset--color--accent);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

/* Accent (CTA) button hover */
.wp-block-button__link.has-accent-background-color {
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.wp-block-button__link.has-accent-background-color:hover {
	opacity: 0.9;
	transform: translateY(-1px);
}

/* Nav CTA (header pattern) */
.ploetner-nav-cta .wp-block-button__link {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--tiny) !important;
	padding: 0.4rem 1rem !important;
	border: 1px solid var(--wp--preset--color--accent);
	background: transparent !important;
	color: var(--wp--preset--color--accent) !important;
	transition: background 0.2s ease, color 0.2s ease;
}

.ploetner-nav-cta .wp-block-button__link:hover {
	background: var(--wp--preset--color--accent) !important;
	color: var(--wp--preset--color--base) !important;
}

/* Section label */
.ploetner-section-label {
	font-family: var(--wp--preset--font-family--mono);
	text-transform: uppercase;
	letter-spacing: 0.15em;
}

/* Inline accent mark (hero name highlight) */
mark.has-inline-color.has-accent-color {
	background: transparent;
}

/* Footer links (footer pattern) */
.ploetner-footer a {
	font-family: var(--wp--preset--font-family--mono);
	transition: color 0.2s ease;
}

.ploetner-footer a:hover {
	color: var(--wp--preset--color--accent) !important;
}

/* Mobile overlay menu (header pattern) */
.ploetner-header .wp-block-navigation__responsive-container-open,
.ploetner-header .wp-block-navigation__responsive-container-close {
	color: var(--wp--preset--color--accent);
}

/* Responsive: speaking rows stack */
@media (max-width: 782px) {
	.ploetner-speaking-row .wp-block-columns {
		flex-direction: column !important;
		gap: 0.25rem !important;
	}
}

/* Hero portrait (set an image URL on the Hero block) */
.ploetner-hero-photo img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	border-radius: 8px;
}

/* Header and footer: align content to the content width, keep the full-width
   sticky background. Applies to existing template parts, no re-insert needed. */
.ploetner-header,
.ploetner-footer {
	padding-left: max(var(--wp--preset--spacing--50), calc((100% - var(--wp--style--global--content-size, 1100px)) / 2)) !important;
	padding-right: max(var(--wp--preset--spacing--50), calc((100% - var(--wp--style--global--content-size, 1100px)) / 2)) !important;
}

/* Language switcher (header): minimal globe, list opens on click */
.ploetner-lang {
	position: relative;
	display: inline-block;
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--tiny);
}

.ploetner-lang__toggle {
	display: flex;
	align-items: center;
	padding: 0.25rem;
	list-style: none;
	cursor: pointer;
	color: var(--wp--preset--color--muted);
	border-radius: 2px;
	transition: color 0.2s ease;
}

.ploetner-lang__toggle::-webkit-details-marker {
	display: none;
}

.ploetner-lang__toggle:hover,
.ploetner-lang[open] .ploetner-lang__toggle {
	color: var(--wp--preset--color--accent);
}

.ploetner-lang__toggle:focus-visible {
	outline: 1px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

.ploetner-lang__list {
	position: absolute;
	top: calc(100% + 0.5rem);
	right: 0;
	z-index: 100;
	min-width: 10rem;
	margin: 0;
	padding: 0.35rem 0;
	list-style: none;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 3px;
}

.ploetner-lang__list a {
	display: flex;
	gap: 0.75rem;
	padding: 0.4rem 0.9rem;
	color: var(--wp--preset--color--muted);
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.2s ease, background 0.2s ease;
}

.ploetner-lang__list a:hover,
.ploetner-lang__list a:focus-visible {
	color: var(--wp--preset--color--accent);
	background: color-mix(in srgb, var(--wp--preset--color--accent) 6%, transparent);
}

.ploetner-lang__list a[aria-current="true"] {
	color: var(--wp--preset--color--contrast);
}

.ploetner-lang__code {
	color: var(--wp--preset--color--accent);
}

/* Visually hidden text for screen readers (e.g. "opens in a new tab") */
.ploetner-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Footer social links may wrap on narrow screens (also fixes saved footers) */
.ploetner-footer .wp-block-group.is-nowrap {
	flex-wrap: wrap;
}

/* Summary marker: hide in every engine */
.ploetner-lang__toggle::marker {
	content: "";
}

/* Header on small screens: keep the CTA on one line */
.ploetner-nav-cta .wp-block-button__link {
	white-space: nowrap;
}

@media (max-width: 600px) {
	.ploetner-header > .wp-block-group {
		gap: 0.75rem !important;
	}

	.ploetner-nav-cta .wp-block-button__link {
		padding: 0.35rem 0.6rem !important;
	}
}
