/* Reproductor de Interalmería TV · inc/player/iatv-player.css */

.iatv-player {
	--ip-acc: #f04e23;               /* color de acento (barra de progreso); a la carta usa el del programa */
	--ip-sub: 22px;                  /* tamaño de subtítulos: lo ajusta el JS según el ancho */
	--ip-bar-h: 104px;             /* alto real de la barra: los subtítulos suben por encima */
	position: relative;
	width: 100%;
	color: #fff;
	font: 15px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	-webkit-tap-highlight-color: transparent;
	user-select: none;
}
.iatv-player *, .iatv-player *::before, .iatv-player *::after { box-sizing: border-box; }

/* Dentro del contenido (noticias) */
.iatv-player .ip-stage {
	position: relative;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 8px;
	overflow: hidden;
	clip-path: inset(0 round 8px);   /* esquinas suaves: el radio solo con overflow se ve dentado sobre <video> */
	isolation: isolate;
	outline: none;
}
/* A todo el ancho (a la carta): banda negra, vídeo tan grande como quepa sin pasar del alto de la ventana */
.iatv-player--wide { background: #000; margin-bottom: 36px; }
.iatv-player--wide .ip-stage {
	width: min(100%, 1200px, calc((100vh - 150px) * 16 / 9));
	min-width: min(100%, 640px);
	margin: 0 auto;
	border-radius: 0;
	clip-path: none;
}

.iatv-player video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; object-fit: contain; }
.iatv-player .ip-ad video { cursor: pointer; }
.iatv-player.is-idle .ip-stage { cursor: none; }

/* --- Capa de clic, botón grande, carga --------------------------------------------- */
.ip-hit { position: absolute; inset: 0; }
.ip-big {
	position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px;
	display: flex; align-items: center; justify-content: center;
	border: 0; border-radius: 50%; padding: 0; cursor: pointer;
	background: rgba(0, 0, 0, .55); color: #fff;
	backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
	transition: transform .15s, background .15s, opacity .2s;
}
.ip-big:hover { transform: scale(1.06); background: var(--ip-acc); }
/* el triángulo del icono ya está centrado ópticamente; el tema no debe meter relleno en los botones */
.ip-big, .ip-btn, .ip-ad-play { padding: 0 !important; min-width: 0; min-height: 0; line-height: 0; }
.ip-big svg, .ip-ad-play svg { display: block; flex: none; }
.ip-big svg { width: 40px; height: 40px; }
.iatv-player.is-started .ip-big { opacity: 0; pointer-events: none; }

.ip-spin {
	position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px;
	border: 4px solid rgba(255, 255, 255, .25); border-top-color: #fff; border-radius: 50%;
	animation: ip-spin .8s linear infinite; display: none; pointer-events: none;
}
.iatv-player.is-waiting .ip-spin { display: block; }
@keyframes ip-spin { to { transform: rotate(360deg); } }

/* Aviso al saltar (±10 s), volumen... */
.ip-flash {
	position: absolute; top: 50%; transform: translateY(-50%);
	padding: 10px 16px; border-radius: 30px; background: rgba(0, 0, 0, .6);
	font-size: 16px; font-weight: 600; opacity: 0; transition: opacity .25s; pointer-events: none;
	left: 50%; translate: -50% 0;
}
.ip-flash.is-left { left: 12%; translate: 0 0; }
.ip-flash.is-right { left: auto; right: 12%; translate: 0 0; }
.ip-flash.is-on { opacity: 1; transition: none; }

.ip-msg {
	position: absolute; inset: 0; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 8px;
	padding: 24px; text-align: center; background: rgba(0, 0, 0, .7); font-size: 17px;
}
.ip-msg.is-on { display: flex; }
.ip-msg small { font-size: 14px; opacity: .7; }

/* --- Seguir viendo: aviso antes de empezar y tras reanudar ------------------------ */
.ip-resume {
	position: absolute; left: 0; right: 0; bottom: 0; pointer-events: none;
}
.ip-resume span {
	position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
	padding: 6px 12px; border-radius: 20px; background: rgba(0, 0, 0, .65); font-size: 14px; white-space: nowrap;
}
.ip-resume i { display: block; height: 5px; background: var(--ip-acc); }
.iatv-player.is-started .ip-resume { display: none; }
.ip-toast {
	position: absolute; left: 14px; top: 14px; display: flex; align-items: center; gap: 12px;
	padding: 8px 8px 8px 14px; border-radius: 8px; background: rgba(0, 0, 0, .72); font-size: 14px;
	opacity: 0; pointer-events: none; transition: opacity .25s;
}
.ip-toast.is-on { opacity: 1; pointer-events: auto; }
.ip-toast button {
	padding: 7px 12px !important; border: 0; border-radius: 6px; background: #fff; color: #111;
	font: 600 13px/1 inherit; cursor: pointer;
}

/* --- Subtítulos (una caja ajustada por línea, como en HbbTV) ----------------------- */
.ip-subs {
	position: absolute; left: 0; right: 0; bottom: 5%;
	display: flex; flex-direction: column; align-items: center;
	pointer-events: none; transition: bottom .2s;
	font-size: var(--ip-sub); line-height: 1.32; font-weight: 500;
}
.iatv-player.is-controls .ip-subs { bottom: var(--ip-bar-h); }
.ip-subs span {
	display: block; padding: .06em .4em; background: rgba(8, 8, 8, .78); color: #fff;
	white-space: pre; text-align: center;
}
.ip-subs span:first-child { border-radius: 4px 4px 0 0; }
.ip-subs span:last-child { border-radius: 0 0 4px 4px; }
.ip-subs span:only-child { border-radius: 4px; }

/* --- Barra de controles ------------------------------------------------------------- */
.ip-bar {
	position: absolute; left: 0; right: 0; bottom: 0;
	padding: 28px 14px 6px;
	background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, .4) 60%, transparent);
	opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s;
	pointer-events: none;
}
.iatv-player.is-controls .ip-bar { opacity: 1; transform: none; pointer-events: auto; }
.iatv-player.is-ad .ip-bar, .iatv-player:not(.is-started) .ip-bar { display: none; }

/* Progreso: un segmento por capítulo, con separación */
.ip-prog { position: relative; height: 22px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.ip-segs { position: relative; display: flex; gap: 3px; width: 100%; height: 100%; align-items: center; }
.ip-seg { position: relative; height: 5px; flex: 0 0 auto; background: rgba(255, 255, 255, .25); transition: height .12s; overflow: hidden; }
.ip-seg:first-child { border-radius: 3px 0 0 3px; }
.ip-seg:last-child { border-radius: 0 3px 3px 0; }
.ip-seg:only-child { border-radius: 3px; }
.ip-prog:hover .ip-seg, .ip-prog.is-drag .ip-seg { height: 7px; }
.ip-prog .ip-seg.is-hover { height: 10px; }
.ip-buf, .ip-fill, .ip-hov { position: absolute; left: 0; top: 0; bottom: 0; width: 0; }
.ip-buf { background: rgba(255, 255, 255, .35); }
.ip-hov { background: rgba(255, 255, 255, .25); }
.ip-fill { background: var(--ip-acc); }
.ip-knob {
	position: absolute; top: 50%; width: 15px; height: 15px; margin: -7.5px 0 0 -7.5px; border-radius: 50%;
	background: var(--ip-acc); box-shadow: 0 0 0 2px rgba(0, 0, 0, .15);
	transform: scale(0); transition: transform .12s; pointer-events: none;
}
.ip-prog:hover .ip-knob, .ip-prog.is-drag .ip-knob { transform: scale(1); }

.ip-tip {
	position: absolute; bottom: 30px; transform: translateX(-50%);
	max-width: 280px; padding: 6px 10px; border-radius: 6px; background: rgba(20, 20, 20, .92);
	text-align: center; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .1s;
}
.ip-prog:hover .ip-tip, .ip-prog.is-drag .ip-tip { opacity: 1; }
.ip-tip b { display: block; max-width: 260px; overflow: hidden; text-overflow: ellipsis; font-size: 13px; font-weight: 600; }
.ip-tip i { font-style: normal; font-size: 14px; font-variant-numeric: tabular-nums; opacity: .85; }

.ip-row { display: flex; align-items: center; gap: 2px; height: 48px; }
.ip-sp { flex: 1; min-width: 8px; }
.ip-btn {
	position: relative; flex: none; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 8px;
	display: inline-flex; align-items: center; justify-content: center;
	background: none; color: #fff; cursor: pointer; opacity: .92; transition: opacity .12s, background .12s;
}
.ip-btn:hover { opacity: 1; background: rgba(255, 255, 255, .12); }
.ip-btn:focus-visible, .ip-big:focus-visible { outline: 2px solid var(--ip-acc); outline-offset: 2px; }
.ip-btn svg { width: 28px; height: 28px; pointer-events: none; }
.ip-btn[hidden] { display: none; }
.ip-btn.is-on::after {   /* subrayado: subtítulos activos */
	content: ""; position: absolute; left: 11px; right: 11px; bottom: 7px; height: 3px; border-radius: 2px; background: var(--ip-acc);
}
.ip-btn .ip-badge { position: absolute; right: 3px; top: 5px; font-size: 10px; font-weight: 700; }

.ip-vol { display: flex; align-items: center; }
.ip-vol-sl {   /* deslizador propio: el <input range> lo deforma el tema */
	position: relative; width: 0; height: 30px; opacity: 0; overflow: hidden; cursor: pointer; touch-action: none;
	transition: width .2s, opacity .2s, margin .2s; outline: none;
}
.ip-vol:hover .ip-vol-sl, .ip-vol-sl:focus-visible, .ip-vol-sl.is-drag { width: 84px; opacity: 1; margin: 0 10px 0 2px; overflow: visible; }
.ip-vol-sl::before { content: ""; position: absolute; left: 0; right: 0; top: 13px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .3); }
.ip-vol-sl b { position: absolute; left: 0; top: 13px; height: 4px; border-radius: 2px; background: #fff; }
.ip-vol-sl i { position: absolute; top: 8px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #fff; }
/* Táctil: el deslizador sale en una pastilla encima del botón al tocarlo */
.ip-vol { position: relative; }
.ip-vol.is-open::after {
	content: ""; position: absolute; left: -6px; bottom: 50px; width: 172px; height: 46px; border-radius: 23px; background: rgba(24, 24, 24, .94);
}
.iatv-player .ip-vol.is-open .ip-vol-sl {
	display: block; position: absolute; z-index: 1; left: 10px; bottom: 58px; width: 140px; height: 30px; margin: 0; opacity: 1; overflow: visible;
}
.ip-vol.is-open .ip-vol-sl i { width: 18px; height: 18px; top: 6px; margin-left: -9px; }

.ip-time { padding: 0 10px; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; opacity: .95; }
.ip-chap {
	min-width: 0; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
	font-size: 15px; opacity: .85; cursor: pointer;
}
.ip-chap:empty { display: none; }
.ip-chap::before { content: "·"; margin-right: 10px; opacity: .6; }

/* Menú de velocidad */
.ip-menu {
	position: absolute; right: 12px; bottom: calc(var(--ip-bar-h) - 30px); min-width: 170px;
	padding: 6px; border-radius: 10px; background: rgba(24, 24, 24, .94); display: none;
}
.ip-menu.is-on { display: block; }
.ip-menu header { padding: 6px 10px 8px; font-size: 13px; opacity: .6; }
.ip-menu button {
	display: flex; width: 100%; padding: 9px 12px; border: 0; border-radius: 6px; background: none; color: #fff;
	font: inherit; text-align: left; cursor: pointer;
}
.ip-menu button:hover { background: rgba(255, 255, 255, .1); }
.ip-menu button.is-on::after { content: "✓"; margin-left: auto; color: var(--ip-acc); }

/* --- Pre-roll ---------------------------------------------------------------------- */
.ip-ad { position: absolute; inset: 0; display: none; background: #000; }
.iatv-player.is-ad .ip-ad { display: block; }
.iatv-player.is-ad .ip-subs, .iatv-player.is-ad .ip-big { display: none; }
.ip-ad-label {
	position: absolute; left: 14px; bottom: 18px; padding: 5px 10px; border-radius: 4px;
	background: rgba(0, 0, 0, .6); font-size: 13px; font-weight: 600; letter-spacing: .02em;
}
.ip-ad-label span { font-weight: 400; opacity: .8; margin-left: 6px; font-variant-numeric: tabular-nums; }
.ip-ad-link {
	position: absolute; left: 14px; top: 14px; padding: 8px 14px; border-radius: 6px; border: 0;
	background: rgba(0, 0, 0, .6); color: #fff; font: 600 14px/1 inherit; cursor: pointer; text-decoration: none;
}
.ip-ad-link:hover { background: #fff; color: #111; }
.ip-ad-skip {
	position: absolute; right: 0; bottom: 34px; min-width: 150px; padding: 12px 18px; border: 1px solid rgba(255, 255, 255, .35); border-right: 0;
	background: rgba(0, 0, 0, .72); color: #fff; font: 600 15px/1 inherit; text-align: center; cursor: default;
}
.ip-ad-skip.is-ready { cursor: pointer; }
.ip-ad-skip.is-ready:hover { background: #fff; color: #111; }
.ip-ad-play {
	position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none;
	width: 76px; height: 76px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer;
}
.ip-ad-play { align-items: center; justify-content: center; }
.ip-ad-play svg { width: 36px; height: 36px; }
.ip-ad.is-paused .ip-ad-play { display: flex; }
.ip-ad-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .2); }
.ip-ad-prog i { display: block; height: 100%; width: 0; background: #ffcc00; }

/* --- Chromecast / AirPlay en uso --------------------------------------------------- */
.ip-cast {
	position: absolute; inset: 0; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 10px;
	background: rgba(0, 0, 0, .72); text-align: center;
}
.iatv-player.is-casting .ip-cast { display: flex; }
.ip-cast svg { width: 56px; height: 56px; opacity: .9; }
.ip-cast b { font-size: 18px; font-weight: 600; }

/* --- Compartir -------------------------------------------------------------------- */
.ip-share {
	position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
	padding: 16px; background: rgba(0, 0, 0, .55);
}
.ip-share.is-on { display: flex; }
.ip-share-panel {
	width: min(100%, 520px); max-height: 100%; overflow: auto; padding: 18px 22px 20px; border-radius: 14px;
	background: #202020; box-shadow: 0 12px 40px rgba(0, 0, 0, .5); user-select: text;
}
.ip-share-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ip-share-head b { font-size: 18px; font-weight: 600; }
.ip-share-x { margin-right: -10px; }
.ip-share-nets { display: flex; gap: 6px; margin: 0 -6px 18px; overflow-x: auto; }
.ip-share-nets a, .ip-share-nets button {
	display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 76px; padding: 6px 4px !important;
	border: 0; border-radius: 10px; background: none; color: #ddd; font: 13px/1.2 inherit; text-decoration: none; cursor: pointer;
}
.ip-share-nets a:hover, .ip-share-nets button:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.ip-share-nets span { display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; color: #fff; }
.ip-share-nets svg { width: 28px; height: 28px; }
.ip-share-url {
	display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border: 1px solid #444; border-radius: 10px; background: #121212;
}
.ip-share-url input {
	flex: 1; min-width: 0; height: auto !important; margin: 0 !important; padding: 6px 0 !important; border: 0 !important;
	background: none !important; box-shadow: none !important; color: #fff !important; font: 14px/1.3 inherit !important; outline: none;
}
.ip-share-copy {
	flex: none; padding: 9px 16px !important; border: 0; border-radius: 8px; background: var(--ip-acc); color: #fff;
	font: 600 14px/1 inherit; cursor: pointer; transition: background .15s;
}
.ip-share-copy.is-ok { background: #2e9b4e; }
.ip-share-at { display: inline-flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 14px; color: #ddd; cursor: pointer; }
.ip-share-at input { width: 18px; height: 18px; margin: 0; accent-color: var(--ip-acc); cursor: pointer; }

/* --- Pantalla completa y móvil ----------------------------------------------------- */
.iatv-player:fullscreen, .iatv-player:-webkit-full-screen { background: #000; }
.iatv-player:fullscreen .ip-stage { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; clip-path: none; min-width: 0; }
.iatv-player:-webkit-full-screen .ip-stage { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; clip-path: none; min-width: 0; }

@media (max-width: 640px) {
	.iatv-player { --ip-bar-h: 88px; }
	.ip-bar { padding: 22px 12px 4px; }
	.ip-row { height: 42px; }
	.ip-btn { width: 40px; height: 40px; }
	.ip-btn svg { width: 24px; height: 24px; }
	.ip-time { font-size: 13px; padding: 0 6px; }
	.ip-chap, .ip-vol-sl, .ip-btn.ip-skipb { display: none; }
	.ip-big { width: 68px; height: 68px; margin: -34px 0 0 -34px; }
	.ip-big svg { width: 32px; height: 32px; }
	.ip-ad-skip { min-width: 120px; padding: 10px 12px; font-size: 14px; bottom: 26px; }
}
