@charset "utf-8";

/*
 * #125 — local pilot of the illustrated visual system.
 *
 * Desktop/mobile artwork: afisha, bus and home (shared fallback).
 * Individually uploaded place/spot covers take precedence when provided.
 */

/* Same crop and anchor on every illustrated desktop page. */
.ttn-top-area--home,
.ttn-top-area--section {
	--ttn-visual-overlay: linear-gradient(180deg, rgb(9 38 78 / 61%) 0%, rgb(9 38 78 / 31%) 46%, rgb(9 38 78 / 52%) 100%);
	background-position: center center;
	background-size: cover;
}

.ttn-top-area--home {
	background-color: #164a75;
	background-image:
		var(--ttn-visual-overlay),
		url('../assets/images/hero/home-desktop.webp');
}

/*
 * Compact search landing. The illustrated portion has the same 210px
 * height below the nav as /afisha/ on desktop.
 *
 * ?ttn_hero_layout=inside  — entire form stays in the hero.
 * ?ttn_hero_layout=overlap — half the form crosses its lower edge.
 * The preferred desktop layout is now "inside"; the comparison remains.
 */
.ttn-visual-search-hero {
	min-height: 210px;
	background: transparent;
}

.ttn-visual-search-hero .hero-body {
	display: flex;
	align-items: flex-end;
	padding: 1.125rem 1.5rem 0;
}

.ttn-visual-search-hero .container {
	display: flex;
	flex-direction: column;
	width: 100%;
}

.ttn-visual-search-slot {
	position: relative;
	z-index: 2;
}

.ttn-top-area--search-layout-overlap .ttn-visual-search-slot {
	transform: translateY(50%);
}

.ttn-top-area--search-layout-inside .ttn-visual-search-hero .hero-body {
	padding-bottom: .375rem;
}

.ttn-top-area--search-layout-overlap + .ttn-home-main .ttn-home-section {
	padding-top: calc(1.5rem + 56px);
}

.ttn-top-area--search-layout-overlap + #main-content > .section {
	padding-top: calc(1.5rem + 56px);
}

/* All section landings share one treatment of the navigation and page title. */
.ttn-top-area--section {
	--ttn-visual-image: url('../assets/images/hero/home-desktop.webp');
	background-color: #214b72;
	background-image:
		var(--ttn-visual-overlay),
		var(--ttn-visual-image);
	background-repeat: no-repeat;
}

.ttn-top-area--afisha {
	--ttn-visual-image: url('../assets/images/hero/afisha-desktop.webp');
}

.ttn-top-area--bus {
	--ttn-visual-image: url('../assets/images/hero/bus-desktop.webp');
}

/* Utilities should not look like a celebratory illustration. */
.ttn-top-area--outage {
	background-color: #346181;
	background-image: linear-gradient(120deg, #24516d 0%, #5c9298 100%);
}

.ttn-section-hero {
	display: flex;
	justify-content: flex-end;
	min-height: 210px;
	background: transparent;
}

.ttn-section-hero .hero-body {
	flex: 1;
	width: 100%;
	padding: .875rem 1.5rem 1.25rem;
}

.ttn-section-hero .container {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	width: 100%;
}

/* Breadcrumbs stay by the navbar while the content uses the remaining height. */
.ttn-top-area--section .ttn-breadcrumbs {
	margin-bottom: auto;
}

.ttn-top-area--section .ttn-breadcrumbs .breadcrumb {
	--bulma-breadcrumb-item-color: rgb(255 255 255 / 82%);
	--bulma-breadcrumb-item-hover-color: #fff;
	--bulma-breadcrumb-item-active-color: #fff;
	--bulma-breadcrumb-item-separator-color: rgb(255 255 255 / 55%);
	margin-bottom: .625rem;
}

.ttn-top-area--section .ttn-breadcrumbs .breadcrumb a {
	color: rgb(255 255 255 / 85%);
	text-shadow: 0 1px 7px rgb(9 38 78 / 48%);
}

.ttn-top-area--section .ttn-breadcrumbs .breadcrumb li.is-active a,
.ttn-top-area--section .ttn-breadcrumbs .breadcrumb a:hover,
.ttn-top-area--section .ttn-breadcrumbs .breadcrumb a:focus-visible {
	color: #fff;
}

/*
 * #125 retained A/B: bottom breadcrumbs remain opt-in for comparison.
 * ?ttn_breadcrumbs=bottom changes the position without a second DOM node.
 */
@media screen and (min-width: 769px) {
	/* Editorial term/venue covers override only desktop; mobile artwork stays unchanged. */
	.ttn-top-area--city,
	.ttn-top-area--spot {
		background-image:
			var(--ttn-visual-overlay),
			var(--ttn-visual-desktop-cover, var(--ttn-visual-image));
	}

	/*
	 * One 1.5rem gap from the hero to the first content block.
	 * Bulma's negative .columns margin used to halve the section padding,
	 * while the transport landing added another 1.5rem of its own.
	 * Scope this to illustrated landing pages; other templates are unchanged.
	 */
	.ttn-top-area--section + #main-content > .section > .columns {
		margin-top: 0;
	}

	.ttn-top-area--transport + #main-content .ttn-transport-sections {
		margin-top: 0;
	}

	/* One desktop title scale across all hero types, including search landings. */
	.ttn-top-area--home .ttn-home-hero h1.title,
	.ttn-top-area--transport .ttn-section-hero--search h1.title {
		font-size: clamp(1.75rem, 2.8vw, 2.4rem);
		line-height: 1.2;
		font-weight: 800;
	}

	/* Unified transport search on the home, hub and search-results pages. */
	.transport-search[data-transport-unified] .transport-location .input,
	.transport-search[data-transport-unified] .transport-date .control,
	.transport-search[data-transport-unified] .transport-submit {
		height: 3rem;
	}

	.transport-search[data-transport-unified] .transport-location .input {
		padding-top: 1.25rem;
		padding-bottom: .25rem;
	}

	.transport-search[data-transport-unified] .transport-field-label,
	.transport-search[data-transport-unified] .transport-date-caption {
		top: .25rem;
	}

	.transport-search[data-transport-unified] .transport-date-display {
		top: 1.25rem;
	}

	/*
	 * One desktop title baseline for every full-width section hero.
	 * Tambov established this placement: breadcrumbs end at ~95px and the
	 * title starts at ~118px, regardless of whether the page has metadata
	 * or city tabs below it.
	 */
	.ttn-section-hero:not(.ttn-section-hero--search) .hero-body {
		display: flex;
	}

	.ttn-section-hero:not(.ttn-section-hero--search) .container {
		flex: 1;
	}

	.ttn-top-area--breadcrumbs-top:not(.ttn-top-area--outage) .ttn-section-hero .container {
		justify-content: flex-start;
	}

	.ttn-top-area--breadcrumbs-top:not(.ttn-top-area--outage) .ttn-section-hero .ttn-breadcrumbs {
		margin-bottom: 1.4375rem;
	}

	.ttn-top-area--section .ttn-section-hero .ttn-section-hero-meta {
		margin-top: -.25rem;
	}

	:is(.ttn-top-area--city, .ttn-top-area--news) .ttn-section-hero .ttn-place-nav.tabs {
		margin-top: .625rem;
	}

	/*
	 * The city hero has a metadata line between its title and tabs.
	 * Reserve exactly that line for news so both use the same nav position.
	 */
	.ttn-top-area--news .ttn-news-hero-meta-slot {
		display: block;
		flex: 0 0 auto;
		height: 1.5em;
		font-size: .9375rem;
		margin-top: -.25rem;
	}

	/* Search hero uses the same breadcrumb inset and title baseline as other sections. */
	.ttn-top-area--transport.ttn-top-area--breadcrumbs-top .ttn-visual-search-hero .ttn-breadcrumbs {
		margin-bottom: 1.4375rem;
	}

	.ttn-top-area--transport.ttn-top-area--breadcrumbs-top .ttn-visual-search-hero h1 {
		margin-bottom: .25rem !important;
	}

	/* Stretch the search content to keep the title on the 118px baseline at all desktop widths. */
	.ttn-top-area--transport .ttn-section-hero--search .hero-body {
		align-items: stretch;
		padding-top: .875rem;
	}

	/* Anchor the form by its bottom edge, independent of title line wrapping. */
	.ttn-top-area--transport.ttn-top-area--search-layout-inside .ttn-visual-search-slot {
		margin-top: auto;
	}

	/* Compact outage hero keeps its height, but shares the 118px title line. */
	.ttn-top-area--outage.ttn-top-area--breadcrumbs-top .ttn-section-hero .hero-body {
		padding-top: .875rem;
		padding-bottom: 1.25rem;
	}

	.ttn-top-area--outage.ttn-top-area--breadcrumbs-top .ttn-section-hero .container {
		justify-content: flex-start;
	}

	.ttn-top-area--outage.ttn-top-area--breadcrumbs-top .ttn-section-hero .ttn-breadcrumbs {
		margin-bottom: 1.4375rem;
	}

	.ttn-top-area--breadcrumbs-bottom .ttn-section-hero .hero-body {
		display: flex;
		padding-top: .5rem;
		padding-bottom: .5rem;
	}

	/* Leave an actual gap between the search form and the last breadcrumb row. */
	.ttn-top-area--breadcrumbs-bottom .ttn-section-hero--search .hero-body {
		padding-top: 0;
	}

	.ttn-top-area--breadcrumbs-bottom .ttn-section-hero--search .ttn-breadcrumbs {
		margin-top: .5rem;
	}

	.ttn-top-area--breadcrumbs-bottom .ttn-section-hero .container {
		flex: 1;
	}

	.ttn-top-area--breadcrumbs-bottom .ttn-breadcrumbs {
		order: 10;
		margin-top: auto;
		margin-bottom: 0;
	}

	.ttn-top-area--breadcrumbs-bottom .ttn-breadcrumbs .breadcrumb {
		margin-bottom: 0;
	}

	.ttn-top-area--breadcrumbs-bottom .ttn-section-hero--search h1 {
		margin-bottom: .5rem !important;
	}
}

.ttn-section-hero-title,
.ttn-top-area--section .ttn-section-hero .ttn-section-hero-title {
	color: #fff !important;
	font-size: clamp(1.75rem, 2.8vw, 2.4rem);
	font-weight: 800;
	line-height: 1.2;
	text-shadow: 0 2px 12px rgb(9 38 78 / 45%);
	overflow-wrap: anywhere;
}

.ttn-top-area--section .ttn-section-hero-meta {
	margin: .5rem 0 0;
	color: #fff;
	font-size: .9375rem;
	line-height: 1.5;
	text-shadow: 0 1px 8px rgb(9 38 78 / 55%);
}

.ttn-section-hero-meta a {
	color: inherit;
	text-decoration: none;
}

.ttn-section-hero-meta a:hover,
.ttn-section-hero-meta a:focus-visible {
	color: #fff;
	text-decoration: underline;
}

.ttn-top-area--outage .ttn-section-hero {
	min-height: 132px;
}

.ttn-top-area--outage .ttn-section-hero .hero-body {
	padding-top: 1.625rem;
	padding-bottom: 1.625rem;
}

/* The transport landing has a functional search hero, not a decorative heading. */
.ttn-top-area--transport .ttn-section-hero--search .title {
	color: #fff !important;
	text-shadow: 0 2px 12px rgb(9 38 78 / 42%);
}

/* The breadcrumbs are the start of the content area, not an extra empty band. */
.ttn-top-area--section + #main-content > .section {
	padding-top: 1.5rem;
}

/* Search overlap needs space for the form AND visible breadcrumbs. */
.ttn-top-area--section.ttn-top-area--search-layout-overlap + #main-content > .section {
	padding-top: calc(1.5rem + 72px);
}

/* An error/status message can increase the glass form's visible height. */
.ttn-top-area--search-layout-overlap:has([data-transport-error]:not([hidden]), [data-transport-status]:not(:empty)) + .ttn-home-main .ttn-home-section {
	padding-top: calc(1.5rem + 96px);
}

.ttn-top-area--section.ttn-top-area--search-layout-overlap:has([data-transport-error]:not([hidden]), [data-transport-status]:not(:empty)) + #main-content > .section {
	padding-top: calc(1.5rem + 112px);
}

/* City and news navigation belong to the hero, below the heading. */
.ttn-news-hero-meta-slot {
	display: none;
}

:is(.ttn-top-area--city, .ttn-top-area--news) .ttn-place-nav.tabs {
	min-width: 0;
	max-width: 100%;
	margin: .875rem 0 0;
}

:is(.ttn-top-area--city, .ttn-top-area--news) .ttn-place-nav.tabs ul {
	justify-content: flex-start;
	align-items: center;
	gap: .5rem;
	width: 100%;
	min-width: 0;
	max-width: 100%;
	padding-bottom: .125rem;
	border-bottom: 0;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
}

:is(.ttn-top-area--city, .ttn-top-area--news) .ttn-place-nav.tabs ul::-webkit-scrollbar {
	display: none;
}

:is(.ttn-top-area--city, .ttn-top-area--news) .ttn-place-nav.tabs li {
	flex: 0 0 auto;
}

/* Place sections and news categories are navigation headings, not body text. */
:is(.ttn-top-area--city, .ttn-top-area--news) .ttn-place-nav.tabs li a {
	font-family: var(--ttn-font-heading);
	font-weight: 500;
}

:is(.ttn-top-area--city, .ttn-top-area--news) .ttn-place-nav.tabs li:not(.is-active) a {
	background: rgb(244 248 252 / 93%);
}

:is(.ttn-top-area--city, .ttn-top-area--news) .ttn-place-nav.tabs li:not(.is-active) a:hover {
	background: #fff;
}

/* Topic archives retain their exact SEO H1 and filters, with a compact cover. */
.ttn-visual-topic-hero {
	display: flex;
	align-items: flex-end;
	min-height: 165px;
	margin-bottom: 1.5rem;
	padding: 1.75rem;
	border-radius: var(--ttn-surface-radius);
	background-color: #24516d;
	background-image:
		linear-gradient(180deg, rgb(9 38 78 / 53%) 0%, rgb(9 38 78 / 51%) 100%),
		url('../assets/images/hero/home-desktop.webp');
	background-position: center center;
	background-size: cover;
}

#main-content .ttn-visual-topic-hero .title {
	color: #fff !important;
	font-size: clamp(1.5rem, 2.5vw, 2rem);
	font-weight: 800;
	line-height: 1.2;
	text-shadow: 0 2px 10px rgb(9 38 78 / 45%);
}

/* Preserve uploaded venue photos as supporting content, not a second hero. */
.ttn-spot-page-image {
	max-width: 19rem;
	margin-bottom: 1.5rem;
	overflow: hidden;
	border-radius: var(--ttn-surface-radius);
}

.ttn-spot-page-image img {
	display: block;
	width: 100%;
	height: auto;
}

@media screen and (max-width: 768px) {
	/* One prepared 1080px mobile WebP per illustrated section. */
	.ttn-top-area--home {
		background-image:
			var(--ttn-visual-overlay),
			url('../assets/images/hero/home-mobile.webp');
		background-position: 78% center;
	}

	/* One 24px content gap for section pages, including Bulma columns wrappers. */
	.ttn-top-area--section + #main-content > .section > .columns {
		margin-top: 0;
	}

	/* Use the same heading scale in home, transport and every section hero. */
	.ttn-top-area--home .ttn-home-hero h1.title,
	.ttn-top-area--transport .ttn-section-hero--search h1.title,
	.ttn-top-area--section .ttn-section-hero .ttn-section-hero-title {
		font-size: clamp(1.5rem, 3.33vw, 1.75rem) !important;
		font-weight: 800;
		line-height: 1;
	}

	/* Search stays fully inside the hero; no forced blank area below the form. */
	.ttn-visual-search-hero {
		min-height: 0;
	}

	.ttn-visual-search-hero .hero-body,
	.ttn-top-area--search-layout-inside .ttn-visual-search-hero .hero-body {
		padding: 1.25rem .75rem 1.5rem;
	}

	.ttn-top-area--search-layout-overlap .ttn-visual-search-slot {
		transform: none;
	}

	.ttn-top-area--search-layout-overlap + .ttn-home-main .ttn-home-section,
	.ttn-top-area--search-layout-overlap + #main-content > .section,
	.ttn-top-area--section.ttn-top-area--search-layout-overlap + #main-content > .section {
		padding-top: 1.5rem;
	}

	.ttn-top-area--section {
		background-position: 75% center;
	}

	/* All other sections inherit home; afisha and bus use their own artwork. */
	.ttn-top-area--section {
		--ttn-visual-image: url('../assets/images/hero/home-mobile.webp');
	}

	.ttn-top-area--afisha {
		--ttn-visual-image: url('../assets/images/hero/afisha-mobile.webp');
	}

	.ttn-top-area--bus {
		--ttn-visual-image: url('../assets/images/hero/bus-mobile.webp');
	}

	/* Optional editorial city/spot covers override the shared home fallback. */
	.ttn-top-area--city,
	.ttn-top-area--spot {
		background-image:
			var(--ttn-visual-overlay),
			var(--ttn-visual-mobile-cover, var(--ttn-visual-image));
	}

	.ttn-top-area--afisha {
		background-position: 86% center;
	}

	.ttn-top-area--city {
		background-position: 85% center;
	}

	.ttn-top-area--spot {
		background-position: 80% center;
	}

	/* Natural height accommodates long titles and multi-row breadcrumb trails. */
	.ttn-section-hero {
		min-height: 0;
	}

	.ttn-section-hero .hero-body {
		padding: 1.25rem .75rem 1.5rem;
	}

	.ttn-top-area--section .ttn-section-hero .ttn-breadcrumbs {
		margin-bottom: 0;
	}

	.ttn-top-area--section .ttn-section-hero .ttn-breadcrumbs .breadcrumb {
		margin-bottom: .75rem;
	}

	/* Compact mobile captions under place and spot titles. */
	:is(.ttn-top-area--city, .ttn-top-area--spot) .ttn-section-hero-meta {
		margin-top: 0;
		font-size: .875rem;
	}

	/* News reserves the city metadata row, keeping both tab strips aligned. */
	.ttn-top-area--news .ttn-news-hero-meta-slot {
		display: block;
		height: 1.5em;
		margin-top: 0;
		font-size: .875rem;
		line-height: 1.5;
	}

	:is(.ttn-top-area--city, .ttn-top-area--news) .ttn-place-nav.tabs {
		margin-top: .75rem;
		margin-left: -1.5rem;
		margin-right: -1.5rem;
		width: calc(100% + 3rem);
		max-width: none;
	}

	/* Full-bleed mobile scroller: inset only the first tab, not the viewport. */
	:is(.ttn-top-area--city, .ttn-top-area--news) .ttn-place-nav.tabs ul {
		padding-left: 1.5rem;
		padding-right: 0;
	}

	.ttn-top-area--outage .ttn-section-hero {
		min-height: 0;
	}

	.ttn-top-area--outage .ttn-section-hero .hero-body {
		padding: 1.25rem .75rem 1.5rem;
	}

	.ttn-top-area--city .ttn-section-hero,
	.ttn-top-area--spot .ttn-section-hero {
		min-height: 0;
	}

	.ttn-spot-page-image {
		max-width: 13rem;
	}

	.ttn-visual-topic-hero {
		background-image:
			linear-gradient(180deg, rgb(9 38 78 / 53%) 0%, rgb(9 38 78 / 51%) 100%),
			url('../assets/images/hero/home-mobile.webp');
		min-height: 128px;
		margin-inline: -.75rem;
		padding: 1.25rem .75rem;
		border-radius: 0;
	}
}
