/* ==========================================================================
   Content pages: editorial sections, tiles and the contact form
   ========================================================================== */

/* Sections are built from core groups with `align: wide`; the constrained
   post-content would otherwise cap them at the 760px reading width. */
.entry-content.dss-prose > .alignwide {
	margin-block: clamp(40px, 6vw, 96px);
}

.entry-content.dss-prose > .alignwide:first-child {
	margin-top: 0;
}

.entry-content.dss-prose > .alignwide:last-child {
	margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Page intro — eyebrow, display heading and lead, side by side
   -------------------------------------------------------------------------- */

/* Matches the breathing room `.dss-page-head` gives a titled page. */
.dss-page-intro {
	padding-block: clamp(12px, 3vw, 48px) 0;
}

.dss-page-intro .is-style-dss-display {
	margin-top: 20px;
}

.dss-page-intro .wp-block-column > :first-child {
	margin-top: 0;
}

/* --------------------------------------------------------------------------
   Facts — the small cards used for contact details and feature grids
   -------------------------------------------------------------------------- */

.dss-fact {
	display: flex;
	flex-direction: column;
	gap: 10px;
	height: 100%;
	padding: clamp(20px, 2.4vw, 32px);
	border-radius: var(--dss-r-lg);
}

.dss-fact > * {
	margin-block: 0;
}

.dss-fact__value {
	color: var(--dss-ink);
	font-size: var(--wp--preset--font-size--md);
	font-weight: 500;
	line-height: 1.45;
	letter-spacing: -0.02em;
}

.dss-fact__value a {
	color: inherit;
	text-decoration: none;
}

.dss-fact__value a:hover {
	color: var(--dss-accent);
}

.dss-fact h3,
.dss-fact h4 {
	font-size: var(--wp--preset--font-size--md);
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: -0.02em;
}

/* Supporting copy inside a card; classed paragraphs keep their own style. */
.dss-fact p:not([class*="dss-"]):not([class*="is-style-dss"]) {
	color: var(--dss-ink-70);
	font-size: 0.9375rem;
	line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Chapters — a numbered eyebrow and heading beside its copy
   -------------------------------------------------------------------------- */

.dss-chapter {
	padding-top: clamp(24px, 3vw, 40px);
	border-top: 1px solid var(--dss-line);
}

.dss-chapter .wp-block-column > :first-child,
.dss-chapter > :first-child {
	margin-top: 0;
}

.dss-chapter h2 {
	margin-top: 14px;
}

/* --------------------------------------------------------------------------
   Figures — a large number with a mono caption
   -------------------------------------------------------------------------- */

.dss-figure {
	color: var(--dss-accent);
	font-size: var(--wp--preset--font-size--xl);
	font-weight: 600;
	line-height: 1;
	letter-spacing: -0.04em;
}

.dss-figure__label {
	color: var(--dss-ink-50);
	font-family: var(--dss-mono);
	font-size: 0.6875rem;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   Meta row — mono links under an intro
   -------------------------------------------------------------------------- */

.dss-meta-row {
	gap: 12px 28px;
	margin-top: 28px;
	padding-top: 22px;
	border-top: 1px solid var(--dss-line);
}

.dss-meta-row p {
	margin: 0;
	color: var(--dss-ink-70);
	font-family: var(--dss-mono);
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.dss-meta-row a {
	color: inherit;
	text-decoration: none;
	transition: color 0.25s ease;
}

.dss-meta-row a:hover {
	color: var(--dss-accent);
}

/* --------------------------------------------------------------------------
   Section head — heading stack on the left, supporting copy on the right
   -------------------------------------------------------------------------- */

.dss-section-head .wp-block-group > :first-child {
	margin-top: 0;
}

.dss-section-head .wp-block-group > h2 {
	margin-top: 14px;
}

/* --------------------------------------------------------------------------
   Contact section — copy on the left, the form on the right
   -------------------------------------------------------------------------- */

/* The eyebrow already opens the section, so drop the prose heading rhythm. */
.dss-contact-form h2 {
	margin-top: 14px;
}

.dss-contact-form .wp-block-column > :first-child {
	margin-top: 0;
}

/* --------------------------------------------------------------------------
   Contact form (Contact Form 7)
   -------------------------------------------------------------------------- */

.dss-form .wpcf7 {
	margin: 0;
}

.dss-form form {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.dss-form__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
}

.dss-form p {
	margin: 0;
}

.dss-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.dss-field__label {
	color: var(--dss-ink-70);
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.3;
}

.dss-field__label em {
	color: var(--dss-accent);
	font-style: normal;
}

.dss-form .wpcf7-form-control-wrap {
	display: block;
}

.dss-field__input {
	box-sizing: border-box;
	width: 100%;
	min-height: 52px;
	padding: 14px 18px;
	border: 1px solid var(--dss-line);
	border-radius: var(--dss-r-md);
	background: var(--dss-surface);
	color: var(--dss-ink);
	font: inherit;
	font-size: 1rem;
	transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

textarea.dss-field__input {
	min-height: 160px;
	resize: vertical;
}

.dss-field__input::placeholder {
	color: var(--dss-ink-50);
}

.dss-field__input:focus {
	border-color: var(--dss-accent);
	outline: 0;
	box-shadow: 0 0 0 4px var(--dss-accent-soft);
}

.dss-form__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
	margin-top: 2px;
}

.dss-form__submit {
	min-height: 52px;
	padding: 0 32px;
	border: 0;
	border-radius: var(--dss-r-pill);
	background: var(--dss-ink);
	color: #fff;
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.3s ease, box-shadow 0.4s ease;
}

.dss-form__submit:hover {
	background: var(--dss-accent);
	box-shadow: var(--dss-shadow-glow);
}

.dss-form__note {
	color: var(--dss-ink-50);
	font-size: 0.8125rem;
}

/* The plugin positions its spinner absolutely next to the submit button. */
.dss-form .wpcf7-spinner {
	margin: 0 0 0 4px;
}

.dss-form .wpcf7-not-valid-tip {
	margin-top: 6px;
	color: #e5484d;
	font-size: 0.8125rem;
}

.dss-form .wpcf7-response-output {
	margin: 18px 0 0 !important;
	padding: 14px 18px !important;
	border: 0 !important;
	border-radius: var(--dss-r-md);
	background: var(--dss-base);
	box-shadow: inset 3px 0 0 var(--dss-accent);
	font-size: 0.9375rem;
}

.dss-form form.invalid .wpcf7-response-output,
.dss-form form.failed .wpcf7-response-output {
	box-shadow: inset 3px 0 0 #e5484d;
}

@media (max-width: 600px) {
	.dss-form__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.dss-form__submit {
		width: 100%;
	}
}

/* --------------------------------------------------------------------------
   Policy pages — contents rail beside the text
   -------------------------------------------------------------------------- */

.dss-legal {
	display: grid;
	/* The text track is capped at the theme's content size so the measure stays
	   readable; the leftover width trails after it instead of splitting into a
	   gutter between the rail and the copy. */
	grid-template-columns: minmax(0, 300px) minmax(0, 760px);
	gap: clamp(32px, 8vw, 120px);
	align-items: start;
}

@media (max-width: 1080px) {
	.dss-legal {
		grid-template-columns: minmax(0, 1fr);
		gap: 32px;
	}
}

/* The aside is the grid item; the panel inside it is what sticks. */
.dss-legal__aside {
	position: sticky;
	top: calc(var(--dss-header-h) + var(--dss-gutter) * 2 + var(--dss-admin-bar));
}

@media (max-width: 1080px) {
	.dss-legal__aside {
		position: static;
	}
}

.dss-legal__body > :first-child {
	margin-top: 0;
}

/* Section numbering runs off the headings, so the editor never has to keep a
   count by hand. */
.dss-legal__body {
	counter-reset: dss-legal;
}

.dss-legal__body > h2 {
	margin-top: clamp(48px, 6vw, 88px);
	padding-top: clamp(28px, 3vw, 44px);
	border-top: 1px solid var(--dss-line);
	font-size: clamp(1.5rem, 2.4vw, 2rem);
	line-height: 1.1;
	letter-spacing: -0.035em;
	counter-increment: dss-legal;
}

.dss-legal__body > h2::before {
	content: counter(dss-legal, decimal-leading-zero);
	display: block;
	margin-bottom: 14px;
	color: var(--dss-accent);
	font-family: var(--dss-mono);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	line-height: 1;
}

.dss-legal__body > h3 {
	margin-top: 2em;
	font-size: 1.125rem;
	letter-spacing: -0.02em;
}

/* Last updated / effective date, lifted out of the running text. */
.dss-legal__meta {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 8px;
	padding: 9px 18px 9px 14px;
	border: 1px solid var(--dss-line);
	border-radius: var(--dss-r-pill);
	background: var(--dss-surface);
	color: var(--dss-ink-70);
	font-family: var(--dss-mono);
	font-size: 0.75rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.dss-legal__meta::before {
	content: "";
	flex: none;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--dss-accent);
}

.dss-legal__meta strong {
	font-weight: 500;
}

.dss-prose .dss-legal__lede {
	color: var(--dss-ink);
	font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
	line-height: 1.5;
	letter-spacing: -0.015em;
}

.dss-legal__body ul,
.dss-legal__body ol {
	padding-left: 20px;
}

.dss-legal__body li {
	margin: 8px 0;
}

.dss-legal__body li::marker {
	color: var(--dss-accent);
}

.dss-legal__body .wp-block-table {
	margin-top: 1.5em;
}

/* Contents rail
   -------------------------------------------------------------------------- */

.dss-toc {
	margin: 0;
}

.dss-toc__panel {
	padding: clamp(20px, 2vw, 28px);
	border-radius: var(--dss-r-lg);
	background: var(--dss-surface);
}

.dss-toc__summary {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 4px 12px;
	list-style: none;
	cursor: pointer;
}

.dss-toc__summary::-webkit-details-marker {
	display: none;
}

.dss-toc__eyebrow {
	grid-column: 1 / -1;
	margin-bottom: 10px;
}

.dss-toc__label {
	font-size: 1.125rem;
	font-weight: 600;
	letter-spacing: -0.03em;
}

.dss-toc__chevron {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border: 1px solid var(--dss-mist-deep);
	border-radius: 50%;
	color: var(--dss-ink);
	transition: transform 0.4s var(--dss-ease);
}

.dss-toc__panel[open] .dss-toc__chevron {
	transform: rotate(180deg);
}

.dss-toc__list {
	margin: 18px 0 0;
	padding: 0 0 0 12px;
	list-style: none;
}

.dss-toc__item {
	margin: 0;
}

.dss-toc__link {
	position: relative;
	display: grid;
	grid-template-columns: 2.25em minmax(0, 1fr);
	gap: 10px;
	padding: 8px 12px 8px 0;
	border-radius: var(--dss-r-sm);
	color: var(--dss-ink-70);
	font-size: 0.9375rem;
	line-height: 1.3;
	text-decoration: none;
	transition: color 0.25s ease, background-color 0.25s ease;
}

/* Marks the section being read; the bar is drawn in the rail's own padding. */
.dss-toc__link::before {
	content: "";
	position: absolute;
	top: 8px;
	bottom: 8px;
	left: -12px;
	width: 2px;
	border-radius: 1px;
	background: var(--dss-accent);
	opacity: 0;
	transform: scaleY(0.4);
	transition: opacity 0.25s ease, transform 0.4s var(--dss-ease);
}

.dss-toc__num {
	color: var(--dss-ink-50);
	font-family: var(--dss-mono);
	font-size: 0.6875rem;
	letter-spacing: 0.08em;
	line-height: 1.55;
	transition: color 0.25s ease;
}

.dss-toc__text {
	transition: transform 0.4s var(--dss-ease);
}

.dss-toc__link:hover,
.dss-toc__link:focus-visible {
	color: var(--dss-accent);
}

.dss-toc__link:hover .dss-toc__text,
.dss-toc__link:focus-visible .dss-toc__text {
	transform: translateX(3px);
}

.dss-toc__link.is-active {
	color: var(--dss-ink);
	font-weight: 500;
}

.dss-toc__link.is-active::before {
	opacity: 1;
	transform: none;
}

.dss-toc__link.is-active .dss-toc__num {
	color: var(--dss-accent);
}

/* On a wide screen the list is permanent furniture, so the summary reads as a
   heading and the disclosure affordance goes away. */
@media (min-width: 1081px) {
	.dss-toc__summary {
		pointer-events: none;
	}

	.dss-toc__chevron {
		display: none;
	}

	.dss-toc__list {
		max-height: calc(100dvh - var(--dss-header-h) - var(--dss-gutter) * 4 - 140px);
		overflow-y: auto;
		overscroll-behavior: contain;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dss-toc__link:hover .dss-toc__text {
		transform: none;
	}
}
