/* ==========================================================================
   BASE – font, colours and the few global layout rules (tokens: root.css).
   Layout itself is set in UX Builder (Section / Row / Column options) and in
   Theme Options:
     - Layout › Container width = 1470px  (Flatsome rows = width − 30 = 1440px, like the original)
     - Style › Colors (primary #171719, secondary #f43b4f), button radius 0
   ========================================================================== */

html { scroll-behavior: smooth; }
html, body { max-width: 100%; overflow-x: clip; }

body.ag-site,
body.ag-site #wrapper,
body.ag-site #main {
	background: var(--ag-paper);
	color: var(--ag-ink);
	font-family: var(--ag-font);
	-webkit-font-smoothing: antialiased;
}
body.ag-site h1, body.ag-site h2, body.ag-site h3, body.ag-site h4,
body.ag-site .button, body.ag-site .nav > li > a { font-family: var(--ag-font); }
/* Headings take the colour of their container; :where() keeps these rules weak, so a
   heading class with its own colour (e.g. .ag-page-title) always wins. */
body.ag-site :where(h1, h2, h3, h4) { color: inherit; width: auto; }
body.ag-site :where(.dark) :where(h1, h2, h3, h4) { color: #fff; }
body.ag-site em { color: var(--ag-red); font-style: normal; }
body.ag-site img { max-width: 100%; }

/* Side gutter: the original keeps 5vw on each side; Flatsome rows add 15px themselves. */
body.ag-site .section-content > .row:not(.row-full-width) {
	padding-left: calc(var(--ag-gutter) - 15px);
	padding-right: calc(var(--ag-gutter) - 15px);
}
/* Flatsome caps "collapse" rows at site width − 30px (1410px) while normal rows go to
   1440px – give them the same maximum so both line up on wide screens. */
body.ag-site .section-content > .row.row-collapse:not(.row-full-width) { max-width: 1440px; }
/* Title elements and collapse rows have no column padding: full gutter */
body.ag-site .section-title-container,
body.ag-site .section-content > .row.row-collapse:not(.row-full-width) {
	padding-left: var(--ag-gutter);
	padding-right: var(--ag-gutter);
}

/* Columns keep Flatsome's bottom padding (30px, "small" rows 19.6px), which
   spaces columns when they stack on mobile. Only the last row of a section or
   column skips that space after itself – the section/column padding is the gap. */
body.ag-site .section-content > .row:last-child,
body.ag-site .col-inner > .row:last-child { margin-bottom: -30px; }
body.ag-site .section-content > .row-small:last-child,
body.ag-site .col-inner > .row-small:last-child { margin-bottom: -19.6px; }
body.ag-site .section-content > .row-collapse:last-child,
body.ag-site .col-inner > .row-collapse:last-child { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
}

/* Resets for the PHP templates (News, Field Notes): wrapper class .ag-tpl */
.ag-tpl { line-height: normal; }
.ag-tpl h1, .ag-tpl h2, .ag-tpl h3, .ag-tpl h4 { margin: 0; text-rendering: auto; }
.ag-tpl p { margin: 0; }
.ag-tpl a { color: inherit; }
.ag-tpl a:hover { color: var(--ag-red); }

/* Utility: Row with five equal columns (UX Builder: add class "ag-cols-5" to the Row) */
@media (min-width: 550px) {
	.ag-cols-5 > .col { flex-basis: 20%; max-width: 20%; }
}

/* Column class "ag-wide": lets a negative Column › Margin widen the column content */
.col.ag-wide > .col-inner { width: auto; }
