/**
 * SatelitnaTV Next: central compatibility adapters for first-party plugins.
 *
 * This file is loaded late. Rules are deliberately scoped to stable plugin
 * roots so WordPress core, collections and unrelated third-party plugins keep
 * their own presentation.
 */

/* Shared plugin contract -------------------------------------------------- */
:where(
	body.stvn-plugin-sport-detail #primary.entry-content,
	.stv-league-content-area,
	.stv-team-page,
	.frekvencie,
	.iptv-wrap,
	.wsvysielace-wrap,
	.tvpt-single
) {
	min-width: 0;
	max-width: 100%;
	color: var(--stvn-navy);
	font-family: inherit;
}

:where(
	body.stvn-plugin-sport-detail #primary.entry-content,
	.stv-league-content-area,
	.stv-team-page,
	.frekvencie,
	.iptv-wrap,
	.wsvysielace-wrap,
	.tvpt-single
) :where(button, input, select, textarea) {
	font-family: inherit;
}

:where(
	body.stvn-plugin-sport-detail #primary.entry-content,
	.stv-league-content-area,
	.stv-team-page,
	.frekvencie,
	.iptv-wrap,
	.wsvysielace-wrap,
	.tvpt-single
) :where(img, video, iframe, canvas, svg) {
	max-width: 100%;
}

:where(
	body.stvn-plugin-sport-detail #primary.entry-content,
	.stv-league-content-area,
	.stv-team-page,
	.frekvencie,
	.iptv-wrap,
	.wsvysielace-wrap,
	.tvpt-single
) :where(a, p, li, td, th, dd) {
	overflow-wrap: break-word;
}

/* Shared page width. These plugin templates call get_header() directly and
   therefore do not receive the regular .stvn-container article wrapper. */
body.stvn-plugin-sport-detail #primary.entry-content,
body.stv-league-template .stv-league-content-area,
.stvn-site-content > .content-area > .site-main.frekvencie,
.stvn-site-content .iptv-wrap,
.stvn-site-content .wsvysielace-wrap {
	width: min(calc(100% - 32px), var(--stvn-container));
	max-width: var(--stvn-container);
	margin: 38px auto 58px;
}

/* Sport CPT detail ------------------------------------------------------- */
body.stvn-plugin-sport-detail #primary.entry-content {
	padding: clamp(21px, 4vw, 44px);
	overflow: hidden;
	border: 1px solid var(--stvn-line);
	border-radius: var(--stvn-radius);
	background: #fff;
	box-shadow: var(--stvn-shadow);
	font-size: 17px;
}

body.stvn-plugin-sport-detail #primary.entry-content > :first-child {
	margin-top: 0;
}

body.stvn-plugin-sport-detail #primary.entry-content > :last-child {
	margin-bottom: 0;
}

body.stvn-plugin-sport-detail .stv-cpt-headline {
	max-width: 900px;
	margin-top: 0;
	font-size: clamp(30px, 4vw, 46px);
	line-height: 1.1;
	letter-spacing: -.035em;
}

body.stvn-plugin-sport-detail :where(.sport-tv-table-wrap, .stv-live-table-wrap) {
	width: 100%;
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

body.stvn-plugin-sport-detail :where(.stv-stream-btn, .stv-stream-mini) {
	font-family: inherit;
	text-decoration: none;
}

body.stvn-plugin-sport-detail :where(.stv-stream-btn, .stv-stream-mini, .stv-tag-btn):focus-visible {
	outline: 3px solid rgba(23, 105, 210, .28);
	outline-offset: 3px;
}

body.stvn-plugin-sport-detail .stv-tags-cloud {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin: 16px 0;
	padding: 15px 16px;
	border: 1px solid var(--stvn-line);
	border-radius: 13px;
	background: #f8fbff;
}

body.stvn-plugin-sport-detail .stv-tags-cloud strong {
	width: 100%;
	margin-bottom: 2px;
	font-size: 14px;
	line-height: 1.35;
}

body.stvn-plugin-sport-detail .stv-tags-cloud br {
	display: none;
}

body.stvn-plugin-sport-detail .stv-tag-btn {
	display: inline-flex;
	min-height: 34px;
	align-items: center;
	justify-content: center;
	padding: 6px 11px;
	color: #174d84;
	border: 1px solid #bfd6ee;
	border-radius: 999px;
	background: #fff;
	font-size: 12px;
	font-weight: 800;
	line-height: 1.2;
	text-decoration: none;
}

body.stvn-plugin-sport-detail .stv-tag-btn:hover {
	color: #fff;
	border-color: var(--stvn-blue);
	background: var(--stvn-blue);
}

/* Sport league and team virtual pages ----------------------------------- */
body.stv-league-template .stv-league-site-main {
	min-width: 0;
}

body.stv-league-template .stv-league-page,
body.stv-team-page-body .stv-team-page {
	font-family: inherit;
}

body.stv-league-template :where(button, input, select, textarea),
body.stv-team-page-body :where(button, input, select, textarea) {
	font-family: inherit;
}

body.stv-league-template :where(.sport-tv-table-wrap, .stv-league-table-wrap),
body.stv-team-page-body :where(.sport-tv-table-wrap, .stv-league-table-wrap) {
	max-width: 100%;
	overflow-x: auto;
}

/* Frekvencie ------------------------------------------------------------- */
.stvn-site-content > .content-area > .site-main.frekvencie {
	padding: 0;
	font-size: 16px;
}

.frekvencie > .frek-header h1,
.frekvencie > h1 {
	font-size: clamp(30px, 4vw, 46px);
	letter-spacing: -.03em;
}

.frekvencie :where(.frek-form, .frek-search, .frek-filters) :where(input, select) {
	min-height: 43px;
	padding: 9px 11px;
	color: var(--stvn-navy);
	border: 1px solid #c9d8e8;
	border-radius: 9px;
	background: #fff;
}

.frekvencie :where(.frek-form, .frek-search, .frek-filters) :where(input, select):focus {
	outline: 3px solid rgba(23, 105, 210, .18);
	border-color: var(--stvn-blue);
}

.frekvencie :where(.frek-form, .frek-filters) button {
	min-height: 43px;
	padding: 9px 14px;
	color: #fff;
	border: 1px solid var(--stvn-blue);
	border-radius: 9px;
	background: var(--stvn-blue);
	font-weight: 800;
}

.frekvencie :where(.frek-form, .frek-filters) button:hover {
	border-color: var(--stvn-blue-dark);
	background: var(--stvn-blue-dark);
}

.frekvencie .frek-btn {
	color: #174d84;
	border-color: #bfd6ee;
	background: #f7fbff;
}

.frekvencie .frek-btn:hover,
.frekvencie .frek-btn:focus-visible {
	color: #fff;
	border-color: var(--stvn-blue);
	background: var(--stvn-blue);
}

.frekvencie :where(.frek-tablewrap, .frek-suggest-wrap) {
	max-width: 100%;
}

/* IPTV / OTT ------------------------------------------------------------- */
.stvn-site-content .iptv-wrap {
	padding: 0;
	font-size: 16px;
}

.iptv-wrap .iptv-h1 {
	font-size: clamp(30px, 4vw, 46px);
	letter-spacing: -.03em;
}

.iptv-wrap .iptv-search input {
	min-height: 43px;
	color: var(--stvn-navy);
	border-color: #c9d8e8;
}

.iptv-wrap .iptv-search input:focus {
	outline: 3px solid rgba(23, 105, 210, .18);
	border-color: var(--stvn-blue);
}

.iptv-wrap .iptv-search button {
	min-height: 43px;
	color: #fff;
	border-color: var(--stvn-blue);
	background: var(--stvn-blue);
	font-weight: 800;
}

.iptv-wrap .iptv-search button:hover {
	border-color: var(--stvn-blue-dark);
	background: var(--stvn-blue-dark);
}

.iptv-wrap .iptv-pill {
	color: #174d84;
	border-color: #bfd6ee;
	background: #f7fbff;
}

.iptv-wrap .iptv-pill:hover,
.iptv-wrap .iptv-pill:focus-visible {
	color: #fff;
	border-color: var(--stvn-blue);
	background: var(--stvn-blue);
}

.iptv-wrap :where(.iptv-table-wrap, .iptv-grid, .iptv-card) {
	min-width: 0;
	max-width: 100%;
}

/* DVB-T / DAB transmitters ---------------------------------------------- */
.stvn-site-content .wsvysielace-wrap {
	padding: 0;
	font-size: 16px;
}

.wsvysielace-wrap > h1 {
	font-size: clamp(30px, 4vw, 46px);
	line-height: 1.1;
	letter-spacing: -.03em;
}

.wsvysielace-wrap .wsvysielace-search-input {
	min-height: 44px;
	color: var(--stvn-navy);
	border-color: #c9d8e8;
}

.wsvysielace-wrap .wsvysielace-search-input:focus {
	outline: 3px solid rgba(23, 105, 210, .18);
	border-color: var(--stvn-blue);
}

.wsvysielace-wrap .wsvysielace-search-btn {
	min-height: 44px;
	color: #fff;
	border-color: var(--stvn-blue);
	background: var(--stvn-blue);
	font-weight: 800;
}

.wsvysielace-wrap .wsvysielace-search-btn:hover {
	border-color: var(--stvn-blue-dark);
	background: var(--stvn-blue-dark);
	filter: none;
}

.wsvysielace-wrap .wsvysielace-pill {
	display: inline-flex;
	min-height: 34px;
	align-items: center;
	color: #174d84;
	border-color: #bfd6ee;
	background: #f7fbff;
	font-weight: 750;
}

.wsvysielace-wrap .wsvysielace-pill:hover,
.wsvysielace-wrap .wsvysielace-pill:focus-visible,
.wsvysielace-wrap .wsvysielace-pill.is-active {
	color: #fff;
	border-color: var(--stvn-blue);
	background: var(--stvn-blue);
}

.wsvysielace-wrap :where(.wsvysielace-grid, .wsvysielace-card, .wsvysielace-map) {
	min-width: 0;
	max-width: 100%;
}

/* Small screens ---------------------------------------------------------- */
@media (max-width: 700px) {
	body.stvn-plugin-sport-detail #primary.entry-content,
	body.stv-league-template .stv-league-content-area,
	.stvn-site-content > .content-area > .site-main.frekvencie,
	.stvn-site-content .iptv-wrap,
	.stvn-site-content .wsvysielace-wrap {
		width: min(calc(100% - 20px), var(--stvn-container));
		margin-top: 20px;
		margin-bottom: 36px;
	}

	body.stvn-plugin-sport-detail #primary.entry-content {
		padding: 18px;
		font-size: 16px;
	}

	.frekvencie :where(.frek-form, .frek-search, .frek-filters),
	.iptv-wrap .iptv-search,
	.wsvysielace-wrap .wsvysielace-search form {
		align-items: stretch;
	}

	.frekvencie :where(.frek-form, .frek-search, .frek-filters) :where(input, select),
	.frekvencie :where(.frek-form, .frek-filters) button,
	.iptv-wrap .iptv-search input,
	.iptv-wrap .iptv-search button {
		min-width: 0;
	}

	.wsvysielace-wrap .wsvysielace-table {
		display: block;
		max-width: 100%;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
}
