/**
 * /new-home-newsroom and /new-home-markets. Loaded only on those two
 * templates (see inc/new-home-helpers.php) -- isolated from every other
 * page. Mobile-first throughout.
 */

:root {
	--ts-navy: #00306e;
	--ts-navy-dark: #001529;
	--ts-gold: #fbe610;
	--ts-ink: #14171f;
	--ts-body: #55606e;
	--ts-line: #e3e6ea;
	--ts-bg: #f5f6f8;
	--ts-surface: #ffffff;
}

/* --nh-* dark overrides already come from new-home.css (loaded as a
   dependency for the .nh-card rules) -- only the --ts-* set is defined
   here. */
[data-theme="dark"] {
	--ts-ink: #e5e7eb;
	--ts-body: #9ca3af;
	--ts-line: #2a2f3a;
	--ts-bg: #0f1218;
	--ts-surface: #171b23;
}

@media (prefers-reduced-motion: no-preference) {
	.ts, .ts-masthead, .ts-footer, .nh-card {
		transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
	}
}

.ts-body { margin: 0; background: var(--ts-bg); }
.ts, .ts *, .ts *::before, .ts *::after { box-sizing: border-box; }
.ts { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ts-ink); background: var(--ts-bg); }
.ts a { text-decoration: none; color: inherit; }
.ts img { max-width: 100%; height: auto; display: block; }
.ts .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.ts-inner { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* ---------- Masthead ---------- */

.ts-masthead { background: var(--ts-surface); border-bottom: 1px solid var(--ts-line); position: sticky; top: 0; z-index: 30; }
.ts-masthead__row { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
.ts-masthead__controls { display: flex; align-items: center; gap: 10px; }
.ts-burger { display: flex; flex-direction: column; justify-content: center; gap: 4px; width: 38px; height: 38px; padding: 0; background: none; border: 1px solid var(--ts-line); border-radius: 6px; cursor: pointer; flex: 0 0 auto; }
.ts-burger span { display: block; width: 18px; height: 2px; margin: 0 auto; background: var(--ts-navy); }
.ts-nav ul { list-style: none; margin: 0; padding: 0; display: none; }
.ts-nav.is-open ul { display: flex; flex-direction: column; position: absolute; left: 0; right: 0; top: 100%; background: var(--ts-surface); border-bottom: 1px solid var(--ts-line); padding: 8px 16px 16px; z-index: 29; }
.ts-nav.is-open ul li a { display: block; padding: 10px 0; border-bottom: 1px solid var(--ts-line); font-weight: 600; font-size: 0.9rem; }

.ts-theme-toggle { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: 0 0 auto; padding: 0; background: none; border: 1px solid var(--ts-line); border-radius: 50%; cursor: pointer; font-size: 1rem; line-height: 1; color: var(--ts-ink); }
.ts-theme-toggle__icon--moon { display: none; }
[data-theme="dark"] .ts-theme-toggle__icon--sun { display: none; }
[data-theme="dark"] .ts-theme-toggle__icon--moon { display: inline; }

@media (min-width: 900px) {
	.ts-burger { display: none; }
	.ts-nav ul { display: flex !important; gap: 22px; position: static; background: none; border: none; padding: 0; }
	.ts-nav ul li a { padding: 0; border: none; font-weight: 500; font-size: 0.88rem; }
}

/* ---------- Hero (newsroom page) ---------- */

.ts-hero { margin: 20px 0 0; }
.ts-hero .nh-card { display: grid; grid-template-columns: 1fr; }
.ts-hero .nh-card__title { font-size: 1.3rem; }

@media (min-width: 700px) {
	.ts-hero .nh-card { grid-template-columns: 1.1fr 1fr; }
	.ts-hero .nh-card__media { aspect-ratio: auto; height: 100%; }
	.ts-hero .nh-card__title { font-size: 1.6rem; }
}

/* ---------- Quotes / at-a-glance widget rows ---------- */

.ts-quotes, .ts-glance, .ts-chart { margin: 24px 0 0; padding-top: 24px; border-top: 1px solid var(--ts-line); }
.ts-quotes__title { font-size: 1rem; font-weight: 700; margin: 0 0 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--ts-body); }
.ts-quotes__row { display: flex; flex-direction: column; gap: 16px; }
.ts-quotes__mini { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; font-size: 0.85rem; }
.ts-quotes__mini strong { margin-right: 4px; color: var(--ts-navy); }

.ts-glance__row { display: flex; flex-direction: column; gap: 16px; }
.ts-glance__item { min-width: 0; }

@media (min-width: 700px) {
	.ts-quotes__row { flex-direction: row; align-items: flex-start; }
	.ts-quotes__company { flex: 0 0 auto; }
	.ts-glance__row { flex-direction: row; }
	.ts-glance__item { flex: 1; }
}

/* ---------- Newsletter ---------- */

.ts-newsletter { margin: 24px 0 0; padding: 24px; background: var(--ts-navy); border-radius: 10px; color: #fff; }
.ts-newsletter__inner { display: flex; flex-direction: column; gap: 16px; }
.ts-newsletter__text h2 { font-size: 1.15rem; margin: 0 0 6px; }
.ts-newsletter__text p { font-size: 0.85rem; margin: 0; color: rgba(255,255,255,.8); }
.ts-newsletter__form :is(input[type="email"], input[type="text"]) { width: 100%; padding: 10px 12px; border: none; border-radius: 6px; font-size: 0.9rem; }
.ts-newsletter__form input[type="submit"] { margin-top: 8px; padding: 10px 18px; border: none; border-radius: 6px; background: var(--ts-gold); color: var(--ts-navy-dark); font-weight: 700; cursor: pointer; }

@media (min-width: 700px) {
	.ts-newsletter__inner { flex-direction: row; align-items: center; justify-content: space-between; gap: 32px; }
	.ts-newsletter__form { flex: 0 0 320px; }
}

/* ---------- Ticker / stock widget ---------- */

.ts-widget { margin: 20px 0 0; }

/* ---------- tout-layout section ---------- */

.tout-layout { padding: 28px 0; }
.tout-layout + .tout-layout { border-top: 1px solid var(--ts-line); }

.tout-layout-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.tout-layout-heading { font-size: 1.25rem; font-weight: 700; margin: 0; padding-left: 12px; border-left: 4px solid var(--ts-gold); }

.cta-more-link-arrow { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 600; color: var(--ts-navy); white-space: nowrap; }
.cta-more-link-arrow:hover { text-decoration: underline; }
.cta-more-link-arrow .icon-wrapper { display: inline-flex; }

.filters { margin-bottom: 16px; }
.filters .carousel { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.filter-button { flex: 0 0 auto; padding: 6px 14px; border: 1px solid var(--ts-line); border-radius: 999px; background: var(--ts-surface); color: var(--ts-body); font-size: 0.8rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.filter-button.is-active { background: var(--ts-navy); border-color: var(--ts-navy); color: #fff; }

.feed-list { display: flex; flex-direction: column; }
.tout { display: flex; align-items: baseline; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--ts-line); }
.tout:last-child { border-bottom: none; }
.publish-date { flex: 0 0 auto; width: 76px; font-size: 0.72rem; color: #9ca3af; }
.tout-title { flex: 1; margin: 0; font-size: 0.92rem; line-height: 1.4; font-weight: 600; }
.tout-title-link:hover { color: var(--nh-cat-color, var(--ts-navy)); }
.tout-cat-tag { flex: 0 0 auto; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--nh-cat-color, var(--ts-navy)); }

@media (max-width: 480px) {
	.tout { flex-wrap: wrap; gap: 2px 10px; }
	.publish-date { width: auto; order: 2; }
	.tout-title { order: 1; flex-basis: 100%; }
	.tout-cat-tag { order: 3; }
}

/* ---------- tout card-grid display mode ---------- */

.tout-layout--cards .tout-card-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
}

@media (min-width: 640px) {
	.tout-layout--cards .tout-card-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 960px) {
	.tout-layout--cards .tout-card-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Markets page: two-column layout ---------- */

.ts-markets__cols { display: grid; grid-template-columns: 1fr; gap: 0 40px; }
.ts-markets__aside { border-top: 1px solid var(--ts-line); margin-top: 8px; padding-top: 8px; }
.ts-markets__aside .tout-layout { padding-top: 20px; }

@media (min-width: 900px) {
	.ts-markets__cols { grid-template-columns: 2fr 1fr; align-items: start; }
	.ts-markets__aside { border-top: none; border-left: 1px solid var(--ts-line); margin-top: 0; padding-top: 0; padding-left: 32px; }
}

/* ---------- Footer ---------- */

.ts-footer { background: var(--ts-navy-dark); color: rgba(255,255,255,.85); margin-top: 32px; }
.ts-footer__cols { display: grid; grid-template-columns: 1fr; gap: 24px; padding: 32px 16px 20px; }
.ts-footer__cols h3 { color: #fff; font-size: 0.8rem; text-transform: uppercase; letter-spacing: .04em; margin: 0 0 10px; }
.ts-footer__cols a { display: block; font-size: 0.82rem; color: rgba(255,255,255,.72); margin-bottom: 6px; }
.ts-footer__cols a:hover { color: var(--ts-gold); }
.ts-footer__cols p { font-size: 0.8rem; color: rgba(255,255,255,.55); margin: 10px 0 0; }
.ts-footer__bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 14px 16px; font-size: 0.75rem; color: rgba(255,255,255,.5); }

@media (min-width: 768px) {
	.ts-footer__cols { grid-template-columns: 1.4fr 1fr 1fr; }
}

/* ---------- Scroll reveal ---------- */

.ts-reveal {
	opacity: 0;
	transform: translateY(16px);
}

.ts-reveal.is-visible {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: no-preference) {
	.ts-reveal {
		transition: opacity 0.5s ease, transform 0.5s ease;
	}
}

/* ---------- Focus visibility ---------- */

.ts a:focus-visible,
.ts button:focus-visible {
	outline: 2px solid var(--ts-navy);
	outline-offset: 2px;
}
