/*
Theme Name: Agntic
Theme URI: https://agnticstudio.com
Author: AGNTICSTUDIO
Author URI: https://agnticstudio.com
Description: A ledger-led block theme for AGNTICSTUDIO — agentic automation for small businesses. Built from the vernacular of bookkeeping: hairline rules, tabular figures, and ledger red used only where it signals.
Requires at least: 6.7
Tested up to: 7.0
Requires PHP: 8.1
Version: 2.0.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: agntic
Tags: block-theme, full-site-editing, one-column, business, custom-colors, custom-menu, wide-blocks
*/

/* ===============================================================
   BASE
   =============================================================== */

*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	font-variant-numeric: tabular-nums;
}

::selection {
	background: var(--wp--preset--color--red);
	color: #fff;
}

:where(a):focus-visible,
:where(button):focus-visible,
:where(input, select, textarea):focus-visible {
	outline: 2px solid var(--wp--preset--color--red);
	outline-offset: 3px;
}

/* Nothing in a ledger is rounded. */
.wp-block-button__link,
.wp-block-image img,
input,
select,
textarea {
	border-radius: 0 !important;
}

/* ===============================================================
   SECTION GRID
   Structural children fill the wide measure so every left edge
   lines up. Core sets `margin-left: auto !important`, so match it.
   =============================================================== */

.alignwide.is-layout-constrained > *,
.alignfull.is-layout-constrained > * {
	max-width: var(--wp--style--global--wide-size);
	margin-left: 0 !important;
	margin-right: auto !important;
}

.wp-block-group.alignfull.is-layout-constrained {
	/* Percentage padding resolves against the PARENT's inline size, which is
	   already inset by the root padding — add it back so full-bleed sections
	   land on the same grid line as the wide ones. */
	padding-left: max(
		var(--wp--preset--spacing--30),
		calc((100% - var(--wp--style--global--wide-size)) / 2 + var(--wp--preset--spacing--30))
	);
	padding-right: max(
		var(--wp--preset--spacing--30),
		calc((100% - var(--wp--style--global--wide-size)) / 2 + var(--wp--preset--spacing--30))
	);
}

.alignwide.is-layout-constrained > :where(p, ul, ol),
.alignfull.is-layout-constrained > :where(p, ul, ol) {
	max-width: 40rem;
}

.alignwide.is-layout-constrained > :where(h1, h2),
.alignfull.is-layout-constrained > :where(h1, h2) {
	max-width: 22ch;
}

/* The section rule runs the full column, as a ruled book does. */
.alignwide.is-layout-constrained > .led-code,
.alignfull.is-layout-constrained > .led-code {
	max-width: none;
}

/* ===============================================================
   LEDGER PRIMITIVES
   =============================================================== */

/* Section code — a filing reference, not decoration. */
.led-code {
	font-family: var(--wp--preset--font-family--data);
	font-size: 0.6875rem;
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-soft);
	padding-bottom: 0.7rem;
	margin-bottom: 2.2rem;
	border-bottom: 1px solid var(--wp--preset--color--ink);
	display: block;
}

/* Ruled row — replaces the card. Accounting rules, it doesn't box. */
.led-row {
	border-top: 1px solid var(--wp--preset--color--rule);
	padding: 1.9rem 0 1.7rem;
}

.led-row:last-child {
	border-bottom: 1px solid var(--wp--preset--color--rule);
}

.led-row h3,
.led-row h4 {
	margin-top: 0;
	margin-bottom: 0.55rem;
}

/* A row that carries a running index in its own gutter. */
.led-row[data-ref]::before {
	content: attr(data-ref);
	font-family: var(--wp--preset--font-family--data);
	font-size: 0.6875rem;
	letter-spacing: 0.1em;
	color: var(--wp--preset--color--red);
	display: block;
	margin-bottom: 0.9rem;
}

/* Panel — a ruled enclosure for a discrete offer. Square, hairline, no lift. */
.led-panel {
	border: 1px solid var(--wp--preset--color--rule);
	padding: var(--wp--preset--spacing--40);
	background: var(--wp--preset--color--paper);
}

.led-panel.is-feature {
	border-color: var(--wp--preset--color--ink);
}

.led-panel > :first-child {
	margin-top: 0;
}

.led-panel > :last-child {
	margin-bottom: 0;
}

/* Figures — right-aligned, tabular, the way a book sets them. */
.led-figure {
	font-family: var(--wp--preset--font-family--data);
	font-variant-numeric: tabular-nums;
}

/* Summary line — the balance strip. Not a stat-tile row. */
.led-summary {
	border-top: 1px solid var(--wp--preset--color--ink);
	border-bottom: 1px solid var(--wp--preset--color--rule);
}

.led-summary .wp-block-column {
	padding: 1.15rem 0 1.05rem;
}

.led-summary .wp-block-column + .wp-block-column {
	border-left: 1px solid var(--wp--preset--color--rule);
	padding-left: 1.6rem;
}

/* Stacked, the dividers must turn with the flow. */
@media (max-width: 781px) {
	.led-summary .wp-block-column + .wp-block-column {
		border-left: 0;
		border-top: 1px solid var(--wp--preset--color--rule);
		padding-left: 0;
	}
}

.led-summary__value {
	font-family: var(--wp--preset--font-family--display);
	font-size: clamp(1.7rem, 1.1rem + 1.8vw, 2.4rem);
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1;
	margin: 0 0 0.45rem;
	font-variant-numeric: tabular-nums;
}

.led-summary__label {
	font-family: var(--wp--preset--font-family--data);
	font-size: 0.6875rem;
	letter-spacing: 0.11em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-soft);
	margin: 0;
	line-height: 1.55;
}

/* ===============================================================
   SIGNATURE — the posting strip
   The product in one object: prose in, ledger entry out.
   =============================================================== */

.led-post {
	border: 1px solid var(--wp--preset--color--ink);
	display: grid;
	grid-template-columns: 1fr 1fr;
	background: var(--wp--preset--color--paper);
}

.led-post__side {
	padding: 1.5rem 1.6rem 1.7rem;
	min-width: 0;
}

.led-post__side + .led-post__side {
	border-left: 1px solid var(--wp--preset--color--ink);
	background: var(--wp--preset--color--wash);
}

.led-post__head {
	font-family: var(--wp--preset--font-family--data);
	font-size: 0.6875rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-soft);
	padding-bottom: 0.6rem;
	margin-bottom: 1.1rem;
	border-bottom: 1px solid var(--wp--preset--color--rule);
	display: flex;
	justify-content: space-between;
	gap: 1rem;
}

.led-post__meta {
	font-family: var(--wp--preset--font-family--data);
	font-size: 0.75rem;
	color: var(--wp--preset--color--ink-soft);
	margin: 0 0 0.9rem;
	word-break: break-word;
}

.led-post__prose {
	font-size: 1rem;
	line-height: 1.58;
	margin: 0;
}

/* The ledger entry itself. */
.led-entry {
	width: 100%;
	border-collapse: collapse;
	font-family: var(--wp--preset--font-family--data);
	font-size: 0.8125rem;
	font-variant-numeric: tabular-nums;
}

.led-entry th,
.led-entry td {
	padding: 0.42rem 0;
	text-align: left;
	font-weight: 400;
	vertical-align: top;
}

.led-entry th {
	color: var(--wp--preset--color--ink-soft);
	white-space: nowrap;
	padding-right: 1rem;
	font-weight: 400;
}

.led-entry td {
	text-align: right;
}

.led-entry tr.is-total th,
.led-entry tr.is-total td {
	border-top: 1px solid var(--wp--preset--color--ink);
	padding-top: 0.7rem;
	font-weight: 600;
	color: var(--wp--preset--color--ink);
}

.led-entry tr.is-status td {
	color: var(--wp--preset--color--red);
	letter-spacing: 0.06em;
}

/* The decision, sitting on the seam between the two sides. */
.led-verdict {
	border: 1px solid var(--wp--preset--color--ink);
	border-top: 0;
	margin-top: 0;
	padding: 0.75rem 1.6rem;
	font-family: var(--wp--preset--font-family--data);
	font-size: 0.75rem;
	letter-spacing: 0.04em;
	color: var(--wp--preset--color--ink-soft);
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1.6rem;
	background: var(--wp--preset--color--paper);
}

.led-verdict strong {
	color: var(--wp--preset--color--red);
	font-weight: 500;
}

@media (max-width: 781px) {
	.led-post {
		grid-template-columns: 1fr;
	}

	.led-post__side + .led-post__side {
		border-left: 0;
		border-top: 1px solid var(--wp--preset--color--ink);
	}
}

/* ===============================================================
   DARK PASSAGE — the reverse of the page, used once
   =============================================================== */

.led-dark {
	background: var(--wp--preset--color--ink);
	color: #e7e9ef;
}

.led-dark :where(h1, h2, h3, h4, p, li) {
	color: inherit;
}

.led-dark .led-code {
	color: #98a0b2;
	border-bottom-color: #3a4052;
}

.led-dark .led-row {
	border-top-color: #2c3142;
}

.led-dark .led-row:last-child {
	border-bottom-color: #2c3142;
}

.led-dark a {
	color: #fff;
}

/* ===============================================================
   HEADER / FOOTER
   =============================================================== */

.agntic-header {
	border-bottom: 1px solid var(--wp--preset--color--ink);
	background: var(--wp--preset--color--paper);
	position: sticky;
	top: 0;
	z-index: 100;
}

.agntic-header .wp-block-navigation a:hover {
	color: var(--wp--preset--color--red);
	text-decoration: none;
}

.agntic-footer a {
	color: #c3c9d6;
	text-decoration: none;
}

.agntic-footer a:hover {
	color: #fff;
	text-decoration: underline;
}

/* ===============================================================
   LISTS — ledger tick, not a checkmark bullet
   =============================================================== */

.led-ticks ul,
ul.led-ticks {
	list-style: none;
	padding-left: 0;
	margin-left: 0;
}

.led-ticks li {
	position: relative;
	padding-left: 1.5rem;
	margin-bottom: 0.6rem;
}

.led-ticks li::before {
	content: "✓";
	position: absolute;
	left: 0;
	top: 0;
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.875rem;
	line-height: 1.62;
	color: var(--wp--preset--color--red);
}

/* ===============================================================
   FORMS
   =============================================================== */

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 select,
.wpcf7 textarea {
	width: 100%;
	padding: 0.75rem 0.85rem;
	font-family: var(--wp--preset--font-family--body);
	font-size: 1rem;
	color: var(--wp--preset--color--ink);
	background: var(--wp--preset--color--paper);
	border: 1px solid var(--wp--preset--color--rule);
	transition: border-color 0.15s ease;
}

.wpcf7 input:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
	border-color: var(--wp--preset--color--ink);
}

.wpcf7 label {
	display: block;
	font-family: var(--wp--preset--font-family--data);
	font-size: 0.6875rem;
	letter-spacing: 0.11em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-soft);
	margin-bottom: 0.45rem;
}

.wpcf7 p {
	margin-bottom: 1.3rem;
}

.wpcf7 input[type="submit"] {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--paper);
	border: 0;
	padding: 0.85rem 1.5rem;
	font-family: var(--wp--preset--font-family--data);
	font-size: 0.8125rem;
	font-weight: 500;
	letter-spacing: 0.04em;
	cursor: pointer;
	width: auto;
	transition: background 0.15s ease;
}

.wpcf7 input[type="submit"]:hover {
	background: var(--wp--preset--color--red);
}

/* ===============================================================
   MOTION
   =============================================================== */

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
		animation: none !important;
	}
}

/* ===============================================================
   INTAKE REGISTER — the classes of work, set as a ruled register
   =============================================================== */

.led-register {
	width: 100%;
	border-collapse: collapse;
	border-top: 1px solid var(--wp--preset--color--ink);
	border-bottom: 1px solid var(--wp--preset--color--ink);
}

.led-register th {
	font-family: var(--wp--preset--font-family--data);
	font-size: 0.6875rem;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-soft);
	text-align: left;
	padding: 0.85rem 1.4rem 0.8rem 0;
	border-bottom: 1px solid var(--wp--preset--color--rule);
	white-space: nowrap;
}

.led-register td {
	padding: 1.05rem 1.4rem 1rem 0;
	border-top: 1px solid var(--wp--preset--color--rule);
	vertical-align: top;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.led-register tbody tr:first-child td {
	border-top: 0;
}

.led-register th:last-child,
.led-register td:last-child {
	padding-right: 0;
}

/* The guarantee column carries the signal colour. */
.led-register td:last-child {
	font-family: var(--wp--preset--font-family--data);
	font-size: 0.8125rem;
	color: var(--wp--preset--color--red);
	white-space: nowrap;
}

@media (max-width: 781px) {
	.led-register,
	.led-register tbody,
	.led-register tr,
	.led-register td {
		display: block;
		width: 100%;
	}

	.led-register thead {
		display: none;
	}

	.led-register tr {
		border-top: 1px solid var(--wp--preset--color--rule);
		padding: 1rem 0;
	}

	.led-register tbody tr:first-child {
		border-top: 0;
	}

	.led-register td {
		border-top: 0;
		padding: 0 0 0.35rem;
		white-space: normal;
	}

	.led-register td:first-child {
		font-weight: 600;
	}

	.led-register td:nth-child(2) {
		color: var(--wp--preset--color--ink-soft);
	}
}
