/**
 * HIPNOPORTO TV — estilos do ecrã de receção.
 *
 * Tudo o que é configurável no painel chega aqui como variável CSS definida
 * no contentor, para que o JavaScript possa refazer o conteúdo sem ter de
 * repetir estilos.
 */

/* -------------------------------------------------------------------------
 * Relógio e meteorologia
 * ---------------------------------------------------------------------- */

.hptv-clock {
	color: var(--hptv-color, #1e3a8a);
	font-family: var(--hptv-font, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif);
	text-align: var(--hptv-align, left);
	line-height: 1;
}

.hptv-clock .hptv-time {
	display: block;
	font-size: var(--hptv-time-size, 40px);
	font-weight: var(--hptv-time-weight, 800);
	letter-spacing: var(--hptv-time-ls, 0);
	font-variant-numeric: var(--hptv-numeric, tabular-nums);
	line-height: 1;
}

.hptv-clock .hptv-date {
	display: block;
	font-size: var(--hptv-date-size, 20px);
	font-weight: 700;
	margin-top: var(--hptv-gap-td, 8px);
	line-height: 1.2;
}

.hptv-clock .hptv-weather {
	display: flex;
	align-items: center;
	justify-content: var(--hptv-align-flex, flex-start);
	flex-wrap: wrap;
	gap: .5em;
	margin-top: var(--hptv-gap-dm, 6px);
	line-height: 1;
}

/* O alinhamento vem em --hptv-align-flex, definida no PHP. Antes isto estava
   feito com selectores que procuravam texto dentro do atributo style, e
   bastaria acrescentar um espaço a seguir aos dois pontos para deixar de
   funcionar sem dar erro nenhum. */

.hptv-clock .hptv-temp {
	font-size: var(--hptv-meta-size, 20px);
	font-weight: 700;
}

.hptv-clock .hptv-emoji {
	font-size: calc(var(--hptv-meta-size, 20px) * 1.25);
	line-height: 1;
	display: inline-block;
	transform: translateY(1px); /* acerto óptico */
}

.hptv-clock .hptv-desc {
	font-size: var(--hptv-desc-size, 20px);
}

.hptv-clock .hptv-minmax {
	font-size: calc(var(--hptv-desc-size, 20px) * .85);
	opacity: .7;
}

/* Quando a API falha mantemos o último valor conhecido, mas esbatido, para
   se perceber que não é a leitura do momento. */
.hptv-clock .hptv-weather.is-stale {
	opacity: .45;
}

/* Previsão dos próximos dias */
.hptv-forecast {
	display: flex;
	gap: 1.1em;
	margin-top: calc(var(--hptv-gap-dm, 6px) * 1.6);
	flex-wrap: wrap;
	justify-content: var(--hptv-align-flex, flex-start);
}

.hptv-fc-day {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .18em;
	font-size: calc(var(--hptv-desc-size, 20px) * .8);
	line-height: 1.1;
}

.hptv-fc-wd { font-weight: 700; opacity: .75; }
.hptv-fc-emoji { font-size: 1.5em; }
.hptv-fc-temp { font-weight: 700; }
.hptv-fc-temp i { font-style: normal; opacity: .55; margin-left: .35em; font-weight: 400; }

/* -------------------------------------------------------------------------
 * Eventos
 * ---------------------------------------------------------------------- */

.hptv-events {
	color: var(--hptv-ev-color, #1e3a8a);
}

.hptv-events .hptv-event {
	background: var(--hptv-ev-bg, #fff);
	border: var(--hptv-ev-bw, 2px) solid var(--hptv-ev-border, #1e3a8a);
	border-radius: var(--hptv-ev-radius, 12px);
	padding: var(--hptv-ev-pad, 14px 18px);
	margin-bottom: var(--hptv-ev-gap, 14px);
}

.hptv-events .hptv-event:last-child {
	margin-bottom: 0;
}

.hptv-events .hptv-event-date {
	font-family: var(--hptv-ev-date-font, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif);
	font-size: var(--hptv-ev-date-size, 18px);
	font-weight: 700;
	letter-spacing: .02em;
	margin-bottom: var(--hptv-ev-gap-in, 6px);
	display: flex;
	align-items: center;
	gap: .6em;
	flex-wrap: wrap;
}

.hptv-events .hptv-event-title {
	font-family: var(--hptv-ev-title-font, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif);
	font-size: var(--hptv-ev-title-size, 28px);
	font-weight: 600;
	line-height: 1.15;
}

.hptv-events .hptv-badge {
	display: inline-block;
	background: var(--hptv-ev-border, #1e3a8a);
	color: var(--hptv-ev-bg, #fff);
	border-radius: 999px;
	padding: .15em .7em;
	font-size: .8em;
	letter-spacing: .06em;
	line-height: 1.4;
}

.hptv-events .hptv-event.is-today {
	box-shadow: 0 0 0 calc(var(--hptv-ev-bw, 2px) * 1.5) var(--hptv-ev-border, #1e3a8a);
}

/* Transição suave quando a lista muda ou roda */
.hptv-events .hptv-event {
	transition: opacity .45s ease;
}

.hptv-events.is-swapping .hptv-event {
	opacity: 0;
}

/* Estado vazio: sem eventos futuros não deixamos o bloco a ocupar espaço
   com uma caixa vazia. */
.hptv-events:empty {
	display: none;
}

/* -------------------------------------------------------------------------
 * Painel combinado [hipnoporto_tv]
 * ---------------------------------------------------------------------- */

.hptv-panel {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

/* Numa TV o ponteiro não existe — não queremos cursores nem selecção. */
.hptv-clock,
.hptv-events {
	-webkit-user-select: none;
	user-select: none;
}
