/*
 * Redesigned TV display page.
 * Theme colors sampled directly from the union's own logo/wordmark:
 *   gold/bronze  ~ #d2ab67  (the calligraphy wordmark)
 *   green        ~ #00a050  (logo ring, price-up indicator)
 *   red          ~ #e6141e  (logo ring, price-down indicator)
 * Override the gold via «تنظیمات صفحه TV» in wp-admin (--tt-accent).
 */

:root {
	--tt-accent: #d2ab67;
	--tt-bg: #0b0c10;
	--tt-panel: #15171c;
	--tt-border: #2a2d35;
	--tt-text: #f3efe6;
	--tt-muted: #9a958a;
	--tt-green: #00a050;
	--tt-red: #e6141e;
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	padding: 0;
	height: 100%;
	background: var(--tt-bg);
	color: var(--tt-text);
	font-family: Tahoma, 'IRANSans', sans-serif;
	overflow: hidden;
}

.tt-tv {
	height: 100vh;
	display: flex;
	flex-direction: column;
}

/* ===== Header ===== */
.tt-tv__header {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 40px;
	background: linear-gradient(180deg, #17140f, #0b0c10);
	border-bottom: 2px solid var(--tt-accent);
}
.tt-tv__brand { display: flex; align-items: center; gap: 20px; }
.tt-tv__logo { height: 64px; width: auto; }
.tt-tv__wordmark { height: 46px; width: auto; }

.tt-tv__datetime {
	display: flex;
	align-items: center;
	gap: 16px;
	text-align: left;
	direction: ltr;
}
.tt-tv__analog-clock { flex: 0 0 auto; }
.tt-tv__clock-digital { text-align: left; }
.tt-tv__date { color: var(--tt-accent); font-size: 1.1rem; margin-bottom: 2px; }
.tt-tv__clock { font-size: 2.1rem; font-weight: 700; letter-spacing: 2px; direction: ltr; }

/* ===== Price grid ===== */
.tt-tv__prices {
	flex: 1 1 auto;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	grid-auto-rows: 1fr;
	gap: 18px;
	padding: 24px 40px;
	overflow: hidden;
}

.tt-price-card {
	background: var(--tt-panel);
	border: 1px solid var(--tt-border);
	border-right: 4px solid var(--tt-accent);
	border-radius: 14px;
	padding: 18px 26px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 8px;
}
.tt-price-card__label { font-size: 1.35rem; color: var(--tt-muted); font-weight: 600; }
.tt-price-card__value {
	font-size: clamp(1.8rem, 3.2vw, 2.8rem);
	font-weight: 800;
	direction: ltr;
	text-align: right;
}
.tt-price-card__value.is-up { color: var(--tt-green); }
.tt-price-card__value.is-down { color: var(--tt-red); }

.tt-price-card__delta { font-size: 1.1rem; font-weight: 600; direction: rtl; }
.tt-price-card__delta.is-up { color: var(--tt-green); }
.tt-price-card__delta.is-down { color: var(--tt-red); }

/* ===== Ticker ===== */
.tt-tv__ticker {
	flex: 0 0 auto;
	display: flex;
	align-items: stretch;
	height: 64px;
	background: #17140f;
	border-top: 2px solid var(--tt-accent);
	overflow: hidden;
}
.tt-tv__ticker-badge {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	padding: 0 26px;
	background: var(--tt-accent);
	color: #17140f;
	font-weight: 800;
	font-size: 1.15rem;
	white-space: nowrap;
}
.tt-tv__ticker-viewport {
	flex: 1 1 auto;
	position: relative;
	overflow: hidden;
}
.tt-tv__ticker-rotator {
	position: relative;
	height: 100%;
}
.tt-tv__ticker-slide {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	padding: 0 24px;
	font-size: 1.3rem;
	color: var(--tt-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	opacity: 0;
	transition: opacity .6s ease;
}
.tt-tv__ticker-slide.is-active {
	opacity: 1;
}

/* ===== Updated-at bar (shown when the ticker is off / floating when it's on) ===== */
.tt-tv__updated-bar {
	flex: 0 0 auto;
	text-align: center;
	padding: 12px;
	color: var(--tt-muted);
	font-size: 1rem;
	border-top: 1px solid var(--tt-border);
}
.tt-tv__updated-floating {
	position: fixed;
	bottom: 72px;
	left: 0; right: 0;
	text-align: center;
	color: var(--tt-muted);
	font-size: .85rem;
	pointer-events: none;
}
