/* NORTe TV Wall */
.ntw-wall {
	--ntw-gap: 14px;
	background: var(--ntw-bg, #1e7ac2);
	padding: var(--ntw-gap);
	box-sizing: border-box;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	color: #fff;
}
.ntw-wall *, .ntw-wall *::before, .ntw-wall *::after { box-sizing: border-box; }

.ntw-grid {
	display: grid;
	grid-template-columns: repeat(var(--ntw-cols, 3), minmax(0, 1fr));
	gap: var(--ntw-gap);
}
@media (max-width: 760px) { .ntw-grid { grid-template-columns: 1fr; } }
@media (min-width: 761px) and (max-width: 1100px) { .ntw-grid { grid-template-columns: repeat(min(2, var(--ntw-cols, 3)), minmax(0, 1fr)); } }

/* Celdas */
.ntw-tile {
	position: relative;
	aspect-ratio: 16 / 9;
	background: #000;
	overflow: hidden;
	border-radius: 4px;
}
.ntw-media, .ntw-media iframe, .ntw-media video {
	position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block;
}
.ntw-media video { object-fit: contain; background: #000; }

.ntw-loading {
	position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px;
	border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%;
	animation: ntw-spin 1s linear infinite;
}
.ntw-tile.is-on .ntw-loading { display: none; }
@keyframes ntw-spin { to { transform: rotate(360deg); } }

/* Capa de clic: tapa el iframe para que el clic abra el popup */
.ntw-ch { cursor: pointer; }
.ntw-click {
	position: absolute; inset: 0; z-index: 2;
	display: flex; align-items: center; justify-content: center;
	background: transparent; transition: background .2s;
}
.ntw-play {
	font-size: 28px; width: 64px; height: 64px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	background: rgba(0,0,0,.6); opacity: 0; transform: scale(.85); transition: .2s;
}
.ntw-ch:hover .ntw-click, .ntw-ch:focus-visible .ntw-click { background: rgba(0,0,0,.25); }
.ntw-ch:hover .ntw-play, .ntw-ch:focus-visible .ntw-play { opacity: 1; transform: scale(1); }
.ntw-ch:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.ntw-label {
	position: absolute; left: 8px; top: 8px; z-index: 3; pointer-events: none;
	display: flex; align-items: center; gap: 6px;
	font-size: 12px; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.8);
}
.ntw-label img { width: 28px; height: 28px; object-fit: contain; border-radius: 4px; background: rgba(0,0,0,.4); }
.ntw-live { background: #e50914; padding: 2px 6px; border-radius: 3px; font-size: 10px; letter-spacing: .5px; }
.ntw-name { opacity: .95; }

/* Sin transmisión */
.ntw-off { display: none; }
.ntw-ch[data-offline="1"] { cursor: default; }
.ntw-ch[data-offline="1"] .ntw-off {
	position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column;
	align-items: center; justify-content: center; gap: 10px; background: #111; color: #aaa; font-size: 14px;
}
.ntw-ch[data-offline="1"] .ntw-off img { max-width: 30%; max-height: 40%; object-fit: contain; opacity: .6; }
.ntw-ch[data-offline="1"] .ntw-live, .ntw-ch[data-offline="1"] .ntw-click, .ntw-ch[data-offline="1"] .ntw-loading { display: none; }

/* Pantalla central de noticias */
.ntw-slides { position: absolute; inset: 0; }
.ntw-slide {
	position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; color: #fff; text-decoration: none;
	pointer-events: none;
}
.ntw-slide.is-active { opacity: 1; pointer-events: auto; }
.ntw-slide > img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.02); transition: transform 8s linear; }
.ntw-slide.is-active > img { transform: scale(1.1); }
.ntw-slide-txt {
	position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 14px 16px; max-height: 100%;
	background: linear-gradient(transparent, rgba(0,0,0,.88));
	display: flex; flex-direction: column; gap: 6px;
}
.ntw-src { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--ntw-accent, #1e7ac2); filter: brightness(1.6); }
.ntw-src img { height: 20px; width: auto; max-width: 70px; object-fit: contain; background: #fff; border-radius: 3px; padding: 1px 3px; }
.ntw-src time { color: #ccc; font-weight: 400; text-transform: none; }
.ntw-src time::before { content: "· hace "; }
.ntw-title { font-size: clamp(15px, 1.6vw, 22px); font-weight: 800; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ntw-empty { display: flex; align-items: center; justify-content: center; color: #aaa; }
.ntw-badge {
	position: absolute; right: 8px; top: 8px; z-index: 3; background: var(--ntw-accent, #1e7ac2);
	font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 3px; letter-spacing: .5px;
}
.ntw-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; z-index: 3; background: rgba(255,255,255,.15); }
.ntw-bar i { display: block; height: 100%; width: 0; background: var(--ntw-accent, #1e7ac2); filter: brightness(1.4); }

/* Ticker por medio (logo a la izquierda + franja del color del medio) */
.ntw-ticker {
	--ntw-seg-bg: var(--ntw-accent, #1e7ac2);
	--ntw-seg-fg: #fff;
	display: flex; align-items: stretch; height: 58px; overflow: hidden;
	background: var(--ntw-seg-bg); color: var(--ntw-seg-fg);
	transition: background-color .4s ease, color .4s ease;
}
.ntw-ticker[hidden] { display: none; }
.ntw-grid > .ntw-ticker { grid-column: 1 / -1; margin: 0 calc(var(--ntw-gap) * -1); }
.ntw-wall > .ntw-ticker:first-child { margin: calc(var(--ntw-gap) * -1) calc(var(--ntw-gap) * -1) var(--ntw-gap); }
.ntw-wall > .ntw-ticker:last-child { margin: var(--ntw-gap) calc(var(--ntw-gap) * -1) calc(var(--ntw-gap) * -1); }
.ntw-ticker-label {
	flex: 0 0 190px; display: flex; align-items: center; justify-content: center; padding: 6px 14px;
	background: var(--ntw-seg-bg); color: var(--ntw-seg-fg);
	font: 800 18px/1 system-ui, sans-serif; letter-spacing: 1px; text-transform: uppercase;
	position: relative; z-index: 2; box-shadow: 6px 0 10px rgba(0,0,0,.15);
}
.ntw-ticker.has-logo .ntw-ticker-label { background: #fff; }
.ntw-tl-logo { max-width: 100%; max-height: 40px; object-fit: contain; }
.ntw-ticker.is-swap .ntw-ticker-label > * { animation: ntw-pop .45s ease; }
@keyframes ntw-pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ntw-ticker-view { flex: 1; overflow: hidden; position: relative; }
.ntw-ticker-track {
	position: absolute; left: 0; top: 0; height: 100%;
	display: inline-flex; align-items: center; white-space: nowrap; will-change: transform;
	transform: translateX(100vw);
}
.ntw-ti {
	display: inline-flex; align-items: center; padding: 0 16px;
	font: 400 32px/1 Georgia, "Times New Roman", Times, serif;
}
.ntw-ti + .ntw-ti::before { content: "●"; font-size: .55em; margin-right: 16px; position: relative; left: -16px; }
.ntw-ti a { color: inherit; text-decoration: none; }
.ntw-ti a:hover { text-decoration: underline; }
@media (max-width: 760px) {
	.ntw-ticker { height: 44px; }
	.ntw-ticker-label { flex-basis: 110px; font-size: 13px; padding: 4px 8px; }
	.ntw-tl-logo { max-height: 30px; }
	.ntw-ti { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) {
	.ntw-ticker-track { position: static; transform: none; white-space: normal; overflow: hidden; }
	.ntw-slide > img { transition: none; }
}

/* En espera (lazy loading) */
.ntw-poster { position: absolute; inset: 0; z-index: 0; background: #111; display: flex; align-items: center; justify-content: center; }
.ntw-poster img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.55) saturate(.8); }
.ntw-poster img.ntw-poster-logo { width: auto; height: auto; max-width: 40%; max-height: 45%; object-fit: contain; filter: none; opacity: .7; }
.ntw-standby {
	position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
	font-size: 12px; background: rgba(0,0,0,.6); padding: 4px 10px; border-radius: 20px; white-space: nowrap;
}
.ntw-tile.is-on .ntw-poster { opacity: 0; transition: opacity .6s .8s; }
.ntw-media { z-index: 1; }
.ntw-tile.is-standby .ntw-loading { display: none; }
.ntw-tile:not(.is-standby) .ntw-standby { display: none; }

/* Popup */
html.ntw-lock { overflow: hidden; }
.ntw-modal {
	position: fixed; inset: 0; z-index: 999999; background: rgba(0,0,0,.85);
	display: flex; align-items: center; justify-content: center; padding: 20px;
}
.ntw-modal[hidden] { display: none; }
.ntw-modal-box { width: min(1200px, 100%); }
.ntw-modal-head { display: flex; justify-content: space-between; align-items: center; color: #fff; margin-bottom: 8px; font-weight: 700; font-family: system-ui, sans-serif; }
.ntw-modal-close { background: #fff; color: #000; border: 0; width: 38px; height: 38px; border-radius: 50%; font-size: 18px; cursor: pointer; }
.ntw-modal-media { position: relative; aspect-ratio: 16 / 9; background: #000; max-height: calc(100vh - 100px); margin: 0 auto; }
.ntw-modal-media iframe, .ntw-modal-media video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
