/* ======================================
   PERSONA AI — PASSWORD-PROTECTED PAGES
   Loaded only while a page is locked (inc/password-protected.php), with
   templates/password-protected.php. The form sits centred in the space below
   the fixed, transparent site header (Hyperion #website_header.sticky): the
   panel's top padding clears the header at every width, so the field and
   button are never covered. Persona type and colours; WordPress's own form
   markup (label, password field, Enter button, "Invalid password." alert).
   Every rule is scoped to #pc-password; nothing changes on other pages.
====================================== */

#pc-password {
	--pc-pw-text: #f4f4f2;
	--pc-pw-muted: rgba(244, 244, 242, 0.6);
	--pc-pw-line: rgba(244, 244, 242, 0.35);
	--pc-pw-accent: #f5dfa3;
	--pc-pw-error: #ffa17c;
	--pc-pw-ease: cubic-bezier(0.4, 0, 0.2, 1);

	/* Above Hyperion's fixed background layer, below its fixed header (as #pc-main). */
	position: relative;
	z-index: 3;
	box-sizing: border-box;
	display: flex;
	flex: 1 0 auto;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-width: 0;
	min-height: 100vh;
	min-height: 100svh;
	/* Top: clears the fixed header (113px on desktop, about 72px on phones) with room to spare. */
	padding: clamp(136px, 20vh, 200px) 20px clamp(64px, 10vh, 120px);
	background: #000;
	color: var(--pc-pw-text);
	font-family: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#pc-password .pc-password__panel {
	box-sizing: border-box;
	width: 100%;
	max-width: 440px;
	margin: 0;
	padding: 0;
}

/* Hyperion sizes every heading in its page wrapper with !important. */
#pc-password .pc-password__title {
	margin: 0 0 12px;
	padding: 0;
	color: var(--pc-pw-text);
	font-family: inherit;
	font-size: 28px !important;
	font-weight: 400;
	line-height: 1.2;
	letter-spacing: -0.02em;
	text-transform: none;
}

#pc-password .post-password-form {
	margin: 0;
	padding: 0;
}

#pc-password .post-password-form p {
	margin: 0 0 24px;
	padding: 0;
	color: var(--pc-pw-muted);
	font-family: inherit;
	font-size: 14px;
	line-height: 1.5;
}

/* Last paragraph: the field and the button, side by side (stacked on narrow screens). */
#pc-password .post-password-form p:last-child {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 12px;
	margin: 0;
}

#pc-password .post-password-form label {
	display: flex;
	flex: 1 1 220px;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	color: var(--pc-pw-text);
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.2;
}

#pc-password .post-password-form input[type="password"] {
	box-sizing: border-box;
	width: 100%;
	height: 44px;
	margin: 0;
	padding: 0 16px;
	border: 1px solid var(--pc-pw-line);
	/* Hyperion: input[type="password"] { border-radius: 0 0 !important } on every input. */
	border-radius: 999px !important;
	background: transparent;
	box-shadow: none;
	color: var(--pc-pw-text);
	font-family: inherit;
	font-size: 16px; /* no zoom on iOS */
	line-height: 1;
}

#pc-password .post-password-form input[type="password"]:focus {
	border-color: var(--pc-pw-text);
	outline: none;
}

#pc-password .post-password-form input[type="password"]:focus-visible {
	outline: 2px solid var(--pc-pw-accent);
	outline-offset: 2px;
}

/* Enter: the Persona primary button (pill, day background, black text). */
#pc-password .post-password-form input[type="submit"] {
	box-sizing: border-box;
	flex: 0 0 auto;
	height: 44px;
	margin: 0;
	padding: 0 24px;
	border: 0;
	border-radius: 999px;
	background: var(--pc-pw-text);
	color: #000;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

#pc-password .post-password-form input[type="submit"]:active {
	background: var(--pc-pw-muted);
}

#pc-password .post-password-form input[type="submit"]:focus-visible {
	outline: 2px solid transparent;
	box-shadow: 0 0 0 2px #000, 0 0 0 4px var(--pc-pw-accent);
}

@media (hover: hover) {
	#pc-password .post-password-form input[type="submit"]:hover:not(:active) {
		background: var(--pc-pw-accent);
	}
}

@media (prefers-reduced-motion: no-preference) {
	#pc-password .post-password-form input[type="submit"],
	#pc-password .post-password-form input[type="password"] {
		transition: background-color 300ms var(--pc-pw-ease), border-color 300ms var(--pc-pw-ease), box-shadow 300ms var(--pc-pw-ease);
	}
}

/* Wrong password (WordPress 6.8+): announced (role="alert") above the form. */
#pc-password .post-password-form-invalid-password p {
	margin: 0 0 16px;
	color: var(--pc-pw-error);
	font-size: 14px;
}

#pc-password .password-form-error input[type="password"] {
	border-color: var(--pc-pw-error);
}

/* Phones: the button under the field, full width. */
@media (max-width: 479px) {
	#pc-password .post-password-form input[type="submit"] {
		flex: 1 1 100%;
	}
}
