/*
 * JK Client Portal: the theme's part, for a theme that doesn't do it.
 *
 * The portal's own design is portal.css, which loads after this on every
 * portal screen. Its templates also use a few layout classes they share with
 * the Memphis theme: .jkm-page, .jkm-row, .jkm-btn, .jkm-form, .jkm-lede and
 * .jkm-prose. A theme that styles the portal declares
 * add_theme_support( 'jk-client-portal' ) and provides them; under any other
 * theme this file does, in the same look, so the client area stays itself
 * after a redesign. Colours and sizes are portal.css's --jkcp-* tokens.
 */

body.jkcp {
	margin: 0;
	background: var(--jkcp-paper);
	color: var(--jkcp-ink);
	font-family: var(--jkcp-sans);
	font-size: 16px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

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

/*
 * The theme starts every element at no margin or padding, and portal.css
 * sets what it wants from there. One class of weight: enough to beat
 * another theme's ul { padding-left } rules, and no more than portal.css's
 * own classes, which load later and so win.
 */
.jkcp :where(ul, ol, li, p, h1, h2, h3, h4, h5, h6, figure, blockquote, dl, dd, fieldset) {
	margin: 0;
	padding: 0;
}

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

/* Text for screen readers only (the WordPress convention). */
.jkcp .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
	word-wrap: normal !important;
}

.jkcp img {
	max-width: 100%;
	height: auto;
}

.jkcp [hidden] {
	display: none !important;
}

.jkcp :focus-visible {
	outline: 3px solid var(--jkcp-accent);
	outline-offset: 3px;
}

/* The page: a centred column with the title above the rows. */
.jkcp .jkm-page {
	max-width: var(--jkcp-container);
	margin-inline: auto;
	padding: 56px var(--jkcp-gutter) 80px;
}

.jkcp .jkm-page__title {
	margin: 0 0 16px;
	font-family: var(--jkcp-sans);
	font-size: clamp(32px, 4vw, 42px);
	font-weight: 500;
	line-height: 1.18;
	letter-spacing: -0.025em;
}

/* Rows: a label column beside the content, one column on phones. */
.jkcp .jkm-row {
	display: grid;
	grid-template-columns: var(--jkcp-label-col) minmax(0, 1fr);
	gap: 0 40px;
	padding-top: 20px;
}

.jkcp .jkm-row--ruled {
	margin-top: 72px;
	border-top: var(--jkcp-stroke) solid var(--jkcp-ink);
}

.jkcp .jkm-row__label {
	margin: 0;
	color: var(--jkcp-muted);
	font-size: 14px;
	font-weight: 400;
	line-height: inherit;
}

@media (max-width: 900px) {
	.jkcp .jkm-page {
		padding-inline: 32px;
	}

	.jkcp .jkm-row {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px 0;
	}

	.jkcp .jkm-row--ruled {
		margin-top: 48px;
	}
}

@media (max-width: 560px) {
	.jkcp .jkm-page {
		padding-inline: 20px;
	}
}

/* Text. */
.jkcp .jkm-lede {
	max-width: 62ch;
	color: var(--jkcp-muted-3);
	font-size: 18px;
	line-height: 1.6;
}

.jkcp .jkm-prose {
	max-width: var(--jkcp-article);
}

.jkcp .jkm-prose :is(p, ul, ol) {
	margin: 0 0 22px;
	font-size: 18px;
	line-height: 1.75;
}

.jkcp .jkm-prose :is(ul, ol) {
	margin-left: 20px;
}

/* Buttons. */
.jkcp .jkm-btn,
.jkcp .jkm-form button[type="submit"] {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 22px;
	border: var(--jkcp-stroke) solid var(--jkcp-ink);
	border-radius: var(--jkcp-r-btn);
	background: none;
	color: var(--jkcp-ink);
	font-family: var(--jkcp-sans);
	font-size: 15px;
	font-weight: 500;
	text-align: center;
	cursor: pointer;
	transition: background 0.2s var(--jkcp-ease-out), color 0.2s var(--jkcp-ease-out), border-color 0.2s var(--jkcp-ease-out);
}

.jkcp .jkm-btn--solid,
.jkcp .jkm-form button[type="submit"] {
	background: var(--jkcp-ink);
	color: var(--jkcp-paper);
}

.jkcp .jkm-btn--solid:hover,
.jkcp .jkm-btn--solid:focus-visible,
.jkcp .jkm-form button[type="submit"]:hover,
.jkcp .jkm-form button[type="submit"]:focus-visible {
	border-color: var(--jkcp-accent-text);
	background: var(--jkcp-accent-text);
	color: #fff;
}

.jkcp .jkm-btn--outline:hover,
.jkcp .jkm-btn--outline:focus-visible {
	background: var(--jkcp-ink);
	color: var(--jkcp-paper);
}

.jkcp .jkm-btn--sm {
	padding: 9px 18px;
	font-size: 14px;
}

/* Form fields. */
.jkcp .jkm-form :is(input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="url"], input[type="search"], input[type="number"], input[type="date"], input[type="datetime-local"], textarea, select) {
	width: 100%;
	padding: 12px 14px;
	border: var(--jkcp-stroke) solid var(--jkcp-ink);
	border-radius: var(--jkcp-r-btn);
	background: var(--jkcp-paper);
	color: var(--jkcp-ink);
	font-family: var(--jkcp-sans);
	font-size: 16px;
}

.jkcp .jkm-form :is(input, select):not([type="checkbox"], [type="radio"], [type="file"], [type="hidden"]) {
	height: 48px;
}

.jkcp .jkm-form label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 500;
}

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