/*
Theme Name:   Terrasys (Kadence Child)
Theme URI:    https://terrasys.ai
Description:  Terrasys marketing brand for Kadence. Reproduces the live design at
              asset-dashboard-balingupjer.replit.app/sites -- warm paper ground, Outfit display
              over Space Mono body, terracotta and forest accents, 2px-radius controls. Built by
              populating KADENCE'S OWN palette and typography slots, so the Customizer, block
              editor and Kadence Blocks keep working normally.
Author:       Terrasys
Template:     kadence
Version:      2.0.0
Text Domain:  terrasys-kadence
*/

/*
  MEASURED SOURCE -- every value below was read off the live pages with getComputedStyle on
  2026-07-28, not eyeballed from a screenshot:
      /sites            index: centred hero + 3-card grid
      /sites/dadocs     centred hero + pill + button pair + checklist card   (terracotta accent)
      /sites/terracert  split hero + stats + enquiry form card               (forest accent)

    ground   #F9F8F6      ink        #2A2522      muted    #6B6461
    hairline #DDDAD5      terracotta #C9641D      forest   #334D44
    H1       Outfit 700, 60px, -1.5px tracking, line-height 1.0
    body     Space Mono 14px / 20px
    label    Space Mono 12px UPPERCASE, 0.6px tracking, weight 500, muted
    card     radius 8px, 0.667px hairline border, translucent white, 0 1px 3px rgba(0,0,0,.1)
    button   radius 2px (deliberately near-square), padding 8px 16px, Outfit 600
    layout   container 1280px, hero 768px, grid gap 24px, header/footer padding 24px 48px

  NOTE ON THE TWO ACCENTS: terracotta is the Terrasys/DA Docs brand, forest is TerraCert. They are
  siblings, not a mistake -- palette slots 1 and 2. Pick per page; do not blend them.

  Everything expressible as a Kadence setting lives in theme.json / functions.php. The rules below
  are only the things Kadence has no control for.
*/

/* --- Card: translucent fill + hairline + lift. Kadence Blocks can do the box, but not the
       translucent-over-paper fill or the hover transform. ---------------------------------- */
.terrasys-card {
	background-color: rgba(255, 255, 255, 0.5);
	border: 1px solid var(--terrasys-hairline, #DDDAD5);
	border-radius: 8px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
	transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.terrasys-card:hover,
.terrasys-card:focus-within {
	border-color: var(--global-palette1, #C9641D);
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* --- Pill badge above a hero heading. Fully-rounded mono label. ------------------------- */
.terrasys-pill {
	display: inline-block;
	background-color: rgba(255, 255, 255, 0.5);
	border: 1px solid var(--terrasys-hairline, #DDDAD5);
	border-radius: 999px;
	padding: 0.25rem 0.75rem;
	font-family: var(--global-mono-font-family, "Space Mono", monospace);
	font-size: 0.875rem;
	color: var(--terrasys-forest, #334D44);
}

/* --- Form label: mono, uppercase, tracked. Matches the enquiry form on /sites/terracert. -- */
.terrasys-label,
.terrasys-form label {
	display: block;
	font-family: var(--global-mono-font-family, "Space Mono", monospace);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--global-palette5, #6B6461);
	margin-bottom: 0.35rem;
}

/* --- Inputs: near-square, hairline, paper-tinted. --------------------------------------- */
.terrasys-form input[type="text"],
.terrasys-form input[type="email"],
.terrasys-form select,
.terrasys-form textarea {
	background-color: rgba(255, 255, 255, 0.5);
	border: 1px solid var(--terrasys-hairline, #DDDAD5);
	border-radius: 2px;
	padding: 0.5rem 0.75rem;
	font-family: var(--global-body-font-family, Outfit, sans-serif);
	font-size: 0.875rem;
	width: 100%;
}

.terrasys-form input:focus,
.terrasys-form select:focus,
.terrasys-form textarea:focus {
	outline: 2px solid var(--global-palette1, #C9641D);
	outline-offset: 1px;
	border-color: transparent;
}

/* --- Stat block: big Outfit figure over a mono caption (the "24h / Turnaround time" pair). - */
.terrasys-stat strong {
	display: block;
	font-family: var(--global-heading-font-family, Outfit, sans-serif);
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--global-palette4, #2A2522);
	line-height: 1.2;
}

.terrasys-stat span {
	font-family: var(--global-mono-font-family, "Space Mono", monospace);
	font-size: 0.875rem;
	color: var(--global-palette5, #6B6461);
}

/* --- Forest variant, for TerraCert pages. Swap the accent without a second theme. -------- */
.terrasys-forest .wp-block-button__link {
	background-color: var(--terrasys-forest, #334D44);
}

.terrasys-forest .terrasys-card:hover,
.terrasys-forest .terrasys-card:focus-within {
	border-color: var(--terrasys-forest, #334D44);
}

@media (prefers-reduced-motion: reduce) {
	.terrasys-card {
		transition: none;
	}
	.terrasys-card:hover,
	.terrasys-card:focus-within {
		transform: none;
	}
}

/* --- Fonts -------------------------------------------------------------------------------
   Kadence stores typography in theme mods, so theme.json alone downloads Outfit/Space Mono but
   never applies them -- measured: the page still reported the system stack in
   --global-body-font-family. Rather than fight that with !important, set Kadence's OWN
   variables. Its stylesheet defines them; this child sheet loads after and supplies the values,
   so everything downstream (blocks, Kadence Blocks, the editor) inherits correctly.

   BODY IS MONO ON PURPOSE. Space Mono for running text with Outfit for headings is the single
   most distinctive thing about this brand -- it is not a mistake to be tidied up later. --- */
:root {
	--global-body-font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	--global-heading-font-family: Outfit, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
	--global-primary-nav-font-family: Outfit, ui-sans-serif, system-ui, sans-serif;
	--global-mono-font-family: "Space Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	/* Hairline is a BORDER colour, not a palette slot -- slot 6 is Kadence's muted TEXT role. */
	--terrasys-hairline: #DDDAD5;
	/* Forest is the TerraCert accent. NOT a palette slot: Kadence models only two
	   accents, and forcing a third into a text/background slot is exactly what put a
	   near-black page background on the site earlier. */
	--terrasys-forest: #334D44;
}

/* Display heading: 60px / 700 / -1.5px / line-height 1.0, measured off the live page. */
h1, .entry-title, .wp-block-heading.has-xx-large-font-size {
	font-family: var(--global-heading-font-family);
	font-weight: 700;
	letter-spacing: -0.025em;
	line-height: 1.02;
}

/* --- Aligning to the original -----------------------------------------------------------
   Differences measured against asset-dashboard-balingupjer.replit.app/sites by screenshot
   comparison, 2026-07-28. Each rule below closes one gap; none is decoration. */

/* The original has ONE uniform paper ground. Kadence tints alternate sections by default, which
   read as banding. */
body,
.content-bg,
.entry-content-wrap,
.site-container,
.content-area {
	background-color: #F9F8F6;
}

/* Wordmark: Outfit bold with the trailing period, terracotta -- not the mono site-title default. */
.site-title,
.site-branding .site-title a {
	font-family: var(--global-heading-font-family);
	font-weight: 700;
	letter-spacing: -0.025em;
	color: var(--global-palette1, #C9641D);
}

/* The wordmark is now a Kadence HTML header element (see header_swap.php) rather than the
   hardcoded, unlinkable site-title. The trailing period is part of the mark, added here so the
   link text stays clean for screen readers and the period can be coloured on its own. */
.terrasys-wordmark {
	font-family: var(--global-heading-font-family);
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: -0.025em;
	color: var(--global-palette4, #2A2522);
	text-decoration: none;
}

.terrasys-wordmark::after {
	content: ".";
	color: var(--global-palette1, #C9641D);
}

.terrasys-wordmark:hover {
	color: var(--global-palette1, #C9641D);
}

/* Card headings are 1.15rem in the original. The block ships a has-large-font-size class, so
   this needs equal specificity to win -- not !important. */
.terrasys-card h3.wp-block-heading,
.terrasys-card h3.has-large-font-size {
	font-size: 1.15rem;
	line-height: 1.25;
	margin-top: 0.75rem;
}

/* Domain label above each card title: mono, terracotta, small. */
.terrasys-card > p:first-child {
	font-family: var(--global-mono-font-family);
	font-size: 0.82rem;
	color: var(--global-palette1, #C9641D);
	margin: 0;
}

/* Nav: mono, small, muted -- the original header is deliberately quiet. */
.primary-menu-container .menu-item > a {
	font-family: var(--global-mono-font-family);
	font-size: 0.875rem;
	color: var(--global-palette4, #2A2522);
}

/* The original is ONE uniform ground with no tinted hero band. My hero group used Paper Tint;
   make every full-width section the same paper so the seams disappear. */
.wp-block-group.alignfull.has-theme-palette-7-background-color,
.wp-block-group.has-theme-palette-7-background-color {
	background-color: #F9F8F6 !important;
}

/* Header: quiet, paper ground, hairline rule under it -- matches the original chrome. */
.site-header-wrap,
.site-header-row-container-inner {
	background-color: #F9F8F6;
}

.site-header-main-section-left .site-title {
	font-size: 1.5rem;
}

/* --- Card icons, arrows, and the whole-card link ----------------------------------------
   The original cards carry a tinted rounded-square icon top-left and a right-aligned arrow, and
   the ENTIRE card is clickable. Implemented with a stretched ::after on the heading's anchor:
   one real link in the markup, so screen readers announce one destination and keyboard focus
   lands somewhere sensible -- rather than an onclick on a div, which is neither. */
.terrasys-card {
	position: relative;
}

.terrasys-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 6px;
	background-color: rgba(42, 37, 34, 0.05);
	color: var(--global-palette4, #2A2522);
	margin-bottom: 1.25rem;
}

.terrasys-arrow {
	position: absolute;
	top: 1.5rem;
	right: 1.5rem;
	font-size: 1rem;
	color: var(--global-palette5, #6B6461);
	transition: transform 0.15s ease, color 0.15s ease;
}

.terrasys-card:hover .terrasys-arrow,
.terrasys-card:focus-within .terrasys-arrow {
	transform: translateX(3px);
	color: var(--global-palette1, #C9641D);
}

/* The heading anchor covers the card. Inherits colour so the title does not turn link-blue. */
.terrasys-card h3 a {
	color: inherit;
	text-decoration: none;
}

.terrasys-card h3 a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 8px;
}

.terrasys-card h3 a:focus-visible::after {
	outline: 2px solid var(--global-palette1, #C9641D);
	outline-offset: 2px;
}

.terrasys-domain {
	margin: 0 0 0.25rem;
}

/* --- Display heading ---------------------------------------------------------------------
   Measured 32px on a 1036px viewport against the original's 60px. WordPress fluid typography
   was scaling far harder than the source, so the display size is set explicitly here with a
   clamp whose MAXIMUM matches the original exactly. */
.terrasys-display {
	font-family: var(--global-heading-font-family);
	font-size: clamp(2.5rem, 5.8vw, 3.75rem);
	font-weight: 700;
	letter-spacing: -0.025em;
	line-height: 1.02;
}

/* --- Numbered steps, choice list, map placeholder (TerraCert "Start a report") ----------- */
.terrasys-step {
	position: relative;
	padding-left: 4.5rem !important;
}

.terrasys-stepnum {
	position: absolute;
	left: 1.5rem;
	top: 1.6rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: 999px;
	background: var(--terrasys-forest, #334D44);
	color: #FFFFFF;
	font-family: var(--global-heading-font-family);
	font-weight: 700;
	font-size: 0.95rem;
	line-height: 1;
}

/* A step card is a description, not a link -- suppress the card's hover lift here. */
.terrasys-step:hover,
.terrasys-step:focus-within {
	transform: none;
	border-color: var(--terrasys-hairline, #DDDAD5);
}

.terrasys-choices {
	list-style: none;
	margin: 1rem 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 0.5rem 1.25rem;
}

.terrasys-choices li {
	position: relative;
	padding-left: 1.9rem;
	font-family: var(--global-mono-font-family);
	font-size: 0.875rem;
	color: var(--global-palette4, #2A2522);
}

/* An empty checkbox glyph -- these are CHOICES the user will make, not features we claim. */
.terrasys-choices li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.15em;
	width: 1.05rem;
	height: 1.05rem;
	border: 1px solid var(--terrasys-hairline, #DDDAD5);
	border-radius: 2px;
	background: rgba(255, 255, 255, 0.6);
}

/* Placeholder for the map. Deliberately looks unbuilt rather than like a broken map -- the
   interface does not exist yet and the page should not imply otherwise. */
.terrasys-mapstub {
	margin-top: 1rem;
	min-height: 180px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px dashed var(--terrasys-hairline, #DDDAD5);
	border-radius: 6px;
	background:
		repeating-linear-gradient(45deg, rgba(42,37,34,0.02) 0 12px, transparent 12px 24px),
		rgba(255,255,255,0.5);
	font-family: var(--global-mono-font-family);
	font-size: 0.8rem;
	letter-spacing: 0.05em;
	color: var(--global-palette5, #6B6461);
	text-align: center;
	padding: 1rem;
}

/* --- Vertical rhythm at the top of a page ------------------------------------------------
   MEASURED 2026-07-28: 264px between the header and the H1, against roughly 60-100px in the
   original. Three things were stacking: Kadence's 80px .content-area margin-top, this theme's
   64px hero padding, and the page-title area's residual spacing. Kadence's margin is the one to
   remove -- it exists to separate a title bar we have turned off. */
.content-area,
.site-main {
	margin-top: 0;
}

/* Full-width hero groups own their own top space; 3rem lands close to the source. */
.entry-content > .wp-block-group.alignfull:first-child {
	padding-top: 3rem;
}

/* --- Pill centring -----------------------------------------------------------------------
   The pill class sits ON the <p>, so display:inline-block made the paragraph shrink-wrap and
   sit at the start of the line -- text-align:center then only centred the text INSIDE it.
   Measured at left:4px instead of centred. Centre the box itself. */
.terrasys-pill.has-text-align-center {
	display: table;
	margin-left: auto;
	margin-right: auto;
}

/* Left-aligned pill (the split TerraCert hero) keeps inline-block, which is correct there. */
.terrasys-pill:not(.has-text-align-center) {
	display: inline-block;
}

/* --- Brand + breadcrumb, and the Team Login button ---------------------------------------
   MEASURED off the original 2026-07-28: the login control is Space Mono 12px, colour #6B6461,
   2px radius, 0 12px padding, 8px gap, with Lucide's "log-in" glyph. The trail beside the
   wordmark is this theme's addition -- the original has no breadcrumb. */

.terrasys-brand {
	display: inline-flex;
	align-items: baseline;
	gap: 0.45rem;
	flex-wrap: wrap;
}

.terrasys-sep {
	font-family: var(--global-heading-font-family);
	font-size: 1.5rem;
	font-weight: 400;
	color: var(--terrasys-hairline, #DDDAD5);
}

/* Trail entries match the wordmark's face and size, and separate from it by WEIGHT alone --
   Outfit 1.5rem at weight 400 against the wordmark's 700. Same voice, quieter. */
.terrasys-brand a:not(.terrasys-wordmark),
.terrasys-brand span[aria-current] {
	font-family: var(--global-heading-font-family);
	font-size: 1.5rem;
	font-weight: 400;
	letter-spacing: -0.025em;
	color: var(--global-palette5, #6B6461);
	text-decoration: none;
}

.terrasys-brand a:not(.terrasys-wordmark):hover {
	color: var(--global-palette1, #C9641D);
}

/* The page you are on: not a link, and quietly emphasised. */
.terrasys-brand span[aria-current] {
	color: var(--global-palette4, #2A2522);
}

/* --- Team Login -------------------------------------------------------------------------
   Styled from the existing nav item, so the menu stays editable in the Customizer. The icon is
   an inline SVG data URI rather than markup, which keeps the menu item plain text. */
/* Specificity note: Kadence sets this padding with
   `.main-navigation .primary-menu-container > ul > li.menu-item > a` (3 classes). Matching that
   selector exactly means this wins on load order instead of needing !important. Measured: my
   earlier 2-class selector lost, padding stayed 7.2px, and the icon rendered UNDER the text. */
.main-navigation .primary-menu-container > ul > li.nav-login > a,
.header-navigation ul li.nav-login > a {
	font-family: var(--global-mono-font-family);
	font-size: 12px;
	color: var(--global-palette5, #6B6461);
	border: 1px solid var(--terrasys-hairline, #DDDAD5);
	border-radius: 2px;
	padding: 0.5rem 0.75rem 0.5rem 2.1rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B6461' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m10 17 5-5-5-5'/%3E%3Cpath d='M15 12H3'/%3E%3Cpath d='M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: 0.7rem center;
	transition: border-color 0.15s ease, color 0.15s ease;
}

.main-navigation .primary-menu-container > ul > li.nav-login > a:hover,
.header-navigation ul li.nav-login > a:hover {
	border-color: var(--global-palette1, #C9641D);
	color: var(--global-palette4, #2A2522);
}

/* --- "In development" flag ---------------------------------------------------------------
   These are NOT orderable products. The flag has to read as a status, not a feature badge, so
   it is muted rather than accented -- an eye-catching colour here would imply availability. */
.terrasys-wipflag {
	display: inline-block;
	font-family: var(--global-mono-font-family);
	font-size: 0.7rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--global-palette5, #6B6461);
	background: rgba(42, 37, 34, 0.05);
	border-radius: 2px;
	padding: 0.15rem 0.5rem;
	margin-bottom: 0.9rem;
}

/* A work-in-progress card is not a link, so it does not lift or highlight on hover. */
.terrasys-wip:hover,
.terrasys-wip:focus-within {
	transform: none;
	border-color: var(--terrasys-hairline, #DDDAD5);
}

/* Ordinary nav items -- sections, not actions. Plain mono links, no box and no icon; only
   .nav-login gets the bordered button treatment above. Scoped to match Kadence's own
   3-class nav selector so it wins on load order rather than !important. */
.main-navigation .primary-menu-container > ul > li.menu-item:not(.nav-login) > a,
.header-navigation ul li.menu-item:not(.nav-login) > a {
	font-family: var(--global-mono-font-family);
	font-size: 0.875rem;
	color: var(--global-palette5, #6B6461);
	border: 0;
	background-image: none;
	padding: 0.5rem 0.75rem;
	transition: color 0.15s ease;
}

.main-navigation .primary-menu-container > ul > li.menu-item:not(.nav-login) > a:hover,
.header-navigation ul li.menu-item:not(.nav-login) > a:hover {
	color: var(--global-palette1, #C9641D);
}

/* The page you are on, marked quietly rather than with a heavy underline. */
.main-navigation .primary-menu-container > ul > li.current-menu-item:not(.nav-login) > a,
.header-navigation ul li.current-menu-item:not(.nav-login) > a {
	color: var(--global-palette4, #2A2522);
}
