/**
 * Gutenberg-only overrides for PostGhost Player.
 * Does NOT affect the Elementor widget — only block editor + block frontend.
 */

.wp-block-pg-podcast-player .pg-modern-player,
.pg-podcast-block .pg-modern-player,
.pg-block-preview .pg-modern-player {
	/* Keep player chrome intact inside the block canvas. */
	max-width: 100%;
}

/* Editor themes inject paragraph margins that break the Elementor spacing. */
.wp-block-pg-podcast-player .pg-modern-player p,
.pg-podcast-block .pg-modern-player p,
.pg-block-preview .pg-modern-player p,
.editor-styles-wrapper .pg-modern-player p {
	margin: 0 !important;
	padding: 0 !important;
}

/*
 * Match the Elementor single-row layout inside Gutenberg (Layout 01 only).
 * Elementor widget markup/CSS stay untouched.
 */
.wp-block-pg-podcast-player .pg-modern-player:not(.pg-modern-player--layout_02) .pg-modern-player__main,
.pg-podcast-block .pg-modern-player:not(.pg-modern-player--layout_02) .pg-modern-player__main,
.pg-block-preview .pg-modern-player:not(.pg-modern-player--layout_02) .pg-modern-player__main,
.editor-styles-wrapper .pg-modern-player:not(.pg-modern-player--layout_02) .pg-modern-player__main {
	flex-direction: row !important;
	align-items: center !important;
	gap: 16px !important;
}

.wp-block-pg-podcast-player .pg-modern-player:not(.pg-modern-player--layout_02) .pg-modern-player__heading,
.pg-podcast-block .pg-modern-player:not(.pg-modern-player--layout_02) .pg-modern-player__heading,
.pg-block-preview .pg-modern-player:not(.pg-modern-player--layout_02) .pg-modern-player__heading,
.editor-styles-wrapper .pg-modern-player:not(.pg-modern-player--layout_02) .pg-modern-player__heading {
	flex: 0 1 200px;
	min-width: 120px;
	max-width: 240px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 2px;
}

.wp-block-pg-podcast-player .pg-modern-player:not(.pg-modern-player--layout_02) .pg-modern-player__controls,
.pg-podcast-block .pg-modern-player:not(.pg-modern-player--layout_02) .pg-modern-player__controls,
.pg-block-preview .pg-modern-player:not(.pg-modern-player--layout_02) .pg-modern-player__controls,
.editor-styles-wrapper .pg-modern-player:not(.pg-modern-player--layout_02) .pg-modern-player__controls {
	flex: 1 1 auto !important;
	width: auto !important;
	min-width: 0;
}

.wp-block-pg-podcast-player .pg-modern-player__meta,
.pg-podcast-block .pg-modern-player__meta,
.pg-block-preview .pg-modern-player__meta,
.editor-styles-wrapper .pg-modern-player__meta {
	margin: 0 !important;
}

.wp-block-pg-podcast-player .pg-modern-player__title,
.pg-podcast-block .pg-modern-player__title,
.pg-block-preview .pg-modern-player__title,
.editor-styles-wrapper .pg-modern-player__title {
	margin: 0 !important;
}

.wp-block-pg-podcast-player .pg-modern-player--layout_02 .pg-modern-player__main,
.pg-podcast-block .pg-modern-player--layout_02 .pg-modern-player__main,
.pg-block-preview .pg-modern-player--layout_02 .pg-modern-player__main,
.editor-styles-wrapper .pg-modern-player--layout_02 .pg-modern-player__main {
	flex-direction: column !important;
	align-items: stretch !important;
	gap: 12px !important;
}

.wp-block-pg-podcast-player .pg-modern-player--layout_02 .pg-modern-player__heading,
.pg-podcast-block .pg-modern-player--layout_02 .pg-modern-player__heading,
.pg-block-preview .pg-modern-player--layout_02 .pg-modern-player__heading,
.editor-styles-wrapper .pg-modern-player--layout_02 .pg-modern-player__heading {
	flex: none;
	max-width: none;
	min-width: 0;
}

@media (max-width: 782px) {
	.wp-block-pg-podcast-player .pg-modern-player:not(.pg-modern-player--layout_02) .pg-modern-player__main,
	.pg-podcast-block .pg-modern-player:not(.pg-modern-player--layout_02) .pg-modern-player__main,
	.pg-block-preview .pg-modern-player:not(.pg-modern-player--layout_02) .pg-modern-player__main,
	.editor-styles-wrapper .pg-modern-player:not(.pg-modern-player--layout_02) .pg-modern-player__main {
		flex-wrap: wrap;
	}

	.wp-block-pg-podcast-player .pg-modern-player:not(.pg-modern-player--layout_02) .pg-modern-player__heading,
	.pg-podcast-block .pg-modern-player:not(.pg-modern-player--layout_02) .pg-modern-player__heading,
	.pg-block-preview .pg-modern-player:not(.pg-modern-player--layout_02) .pg-modern-player__heading,
	.editor-styles-wrapper .pg-modern-player:not(.pg-modern-player--layout_02) .pg-modern-player__heading {
		flex: 1 1 140px;
		max-width: none;
	}

	.wp-block-pg-podcast-player .pg-modern-player:not(.pg-modern-player--layout_02) .pg-modern-player__controls,
	.pg-podcast-block .pg-modern-player:not(.pg-modern-player--layout_02) .pg-modern-player__controls,
	.pg-block-preview .pg-modern-player:not(.pg-modern-player--layout_02) .pg-modern-player__controls,
	.editor-styles-wrapper .pg-modern-player:not(.pg-modern-player--layout_02) .pg-modern-player__controls {
		flex: 1 1 100%;
	}
}
