/* =============================================================
 CTIC Site - Start
 Fits the viewer into the ctic.org page template (Beaver Builder and bb-theme,
 the standard-page Themer layout): the site's dark-green hero with the page
 title and the breadcrumbs stay as on every other page of the site; the "Explore"
 sidebar is not shown here; and the tool runs the full width of the page below
 them, as in the prototype.

 This file styles the page around the viewer and puts the viewer's containers on the
 site's content line. The viewer itself is styled by round5digdeeper.css, scoped to
 #vv-viewer.
 ============================================================= */

/* Inherited page-level setting. The theme sets `word-wrap: break-word` on body; it reaches
   the viewer by inheritance and changed how it lays out (the year buttons stacked their
   digits). The prototype's page uses the browser default. (The theme's transparent mobile
   tap highlight is kept on purpose, so touch feedback is the same across the page.) */
#vv-viewer {
	max-width: 100%;
	overflow-wrap: normal;
	word-wrap: normal;
}

/* The viewer baseline.
   The prototype left many properties at the browser's defaults. The site restyles buttons,
   form fields, labels, paragraphs, links, tables, and svg for the whole page (yellow pill
   buttons, 50px radii, paragraph margins, link colors). `all: revert` at the lowest id
   specificity (1,0,0) gives anything the viewer's own rules do not set back to the browser
   default, which is how the prototype renders. Every viewer rule (#vv-viewer plus a class
   or more) and the scoped MapLibre rules still win over it. Headings are left out on
   purpose: they keep the site's own typography. */
#vv-viewer :where(button, input, select, textarea, label, p, a, table, caption, thead, tbody, tr, th, td, svg, details, summary, fieldset, legend) {
	all: revert;
}

/* The site also forces black on anything inside a button; text and icons inside a viewer
   button take the button's own color again. */
#vv-viewer :where(button) :where(*) { color: inherit; }

/* The content row that holds the viewer: no side padding, no fixed-width cap, and no
   120px of space under the tool before the footer. */
.fl-row:has(#vv-viewer) > .fl-row-content-wrap {
	padding-left: 0;
	padding-right: 0;
	padding-bottom: 0;
}
.fl-row:has(#vv-viewer) .fl-row-content.fl-row-fixed-width { max-width: none; }

/* The sidebar column is removed and the content column takes the whole row. */
.fl-col-group:has(#vv-viewer) > .fl-col:not(:has(#vv-viewer)) { display: none; }
.fl-col-group:has(#vv-viewer) > .fl-col:has(#vv-viewer) {
	width: 100%;
	max-width: 100%;
	flex: 0 0 100%;
}

/* No module margin around the viewer. */
.fl-module-fl-post-content:has(#vv-viewer) > .fl-module-content { margin: 0; }

/* The site's content line. The logo, the hero title, the breadcrumbs, and the footer all
   start on it: Beaver Builder rows hold a 1250px container inside 20px of row padding, and
   the modules add 20px more. That puts the line 40px from the window edge up to a 1290px
   window, on the centered container beyond that, and 20px from the edge under 768px (the
   row padding drops to 0 there). The breadcrumbs lost the row padding above, so they get it
   back here; the viewer's own containers (page head, Dig deeper bar, map and trend cards,
   foot) are put on the same line, while their background bands still run the full width. */
.fl-col-content:has(#vv-viewer) > .fl-module-pp-breadcrumbs {
	margin-left: max(20px, calc((100% - 1250px) / 2));
	margin-right: max(20px, calc((100% - 1250px) / 2));
}
#vv-viewer.viridis-view--round5digdeeper :is(.page-head__inner, .deeper-bar__inner, .panels, .page-foot) {
	max-width: 1290px;
	padding-left: 40px;
	padding-right: 40px;
}
@media (max-width: 767px) {
	.fl-col-content:has(#vv-viewer) > .fl-module-pp-breadcrumbs {
		margin-left: 0;
		margin-right: 0;
	}
	#vv-viewer.viridis-view--round5digdeeper :is(.page-head__inner, .deeper-bar__inner, .panels, .page-foot) {
		padding-left: 20px;
		padding-right: 20px;
	}
}

/* The site header stays above Explore the Data — 3 Nov 2026 (Dave Gustafson): "Restore
   CTIC website header. Should never disappear!" The Explore layer (z-index 9000) starts
   under the header (round5digdeeper.css, Dig Deeper); the header paints above the layer so
   its mobile menu and search can be used. z-index needs a positioned box: when the theme
   has made the header sticky it is already fixed at the top, so position is left alone. */
html.vv-deeper-on header[data-type="header"] { z-index: 9001; }
html.vv-deeper-on header[data-type="header"]:not(.fl-theme-builder-header-sticky) { position: relative; }

/* =============================================================
 CTIC Site - End
 ============================================================= */

/* 0.9.11: less white between the breadcrumbs and the viewer's first line. */
.fl-col-content:has(#vv-viewer) > .fl-module-pp-breadcrumbs { margin-bottom: 0; }
.fl-col-content:has(#vv-viewer) > .fl-module-pp-breadcrumbs .fl-module-content { margin-bottom: 0; }
#vv-viewer.viridis-view--round5digdeeper:not(.is-deeper) .page-head__inner { padding-top: 4px; }
