/* OAF Submissions: public form. Inherits the site's type; black on white. */

.oafs {
	--oafs-ink: #000;
	--oafs-paper: #fff;
	--oafs-muted: #5c5c5c;
	--oafs-line: #000;
	--oafs-soft: #d9d9d9;
	--oafs-error: #b3261e;
	max-width: 640px;
	color: var(--oafs-ink);
	font: inherit;
	line-height: 1.5;
	text-align: left;
}

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

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

.oafs p {
	margin: 0;
}

/* Sections */

.oafs-section {
	margin: 0 0 56px;
	padding: 0;
	border: 0;
	min-width: 0;
}

.oafs-section > legend {
	display: block;
	width: 100%;
	margin: 0 0 24px;
	padding: 0 0 10px;
	border-bottom: 1px solid var(--oafs-line);
	font-size: 1.25em;
	font-weight: inherit;
	line-height: 1.3;
}

.oafs-note {
	margin: 0 0 24px !important;
	color: var(--oafs-muted);
}

/* Fields */

.oafs-field {
	margin: 0 0 24px;
}

.oafs-pair {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 20px;
}

.oafs-field > label,
.oafs-label {
	display: block;
	margin: 0 0 6px;
}

.oafs-optional {
	color: var(--oafs-muted);
}

.oafs-hint {
	margin: 0 0 8px !important;
	color: var(--oafs-muted);
	font-size: 0.875em;
}

.oafs input[type="text"],
.oafs input[type="email"],
.oafs textarea {
	display: block;
	width: 100%;
	margin: 0;
	padding: 11px 12px;
	border: 1px solid var(--oafs-line);
	border-radius: 0;
	background: var(--oafs-paper);
	color: var(--oafs-ink);
	font: inherit;
	font-size: max(16px, 1em); /* below 16px, phones zoom the page on focus */
	line-height: 1.4;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}

.oafs textarea {
	min-height: 9em;
	resize: vertical;
}

.oafs ::placeholder {
	color: #8a8a8a;
	opacity: 1;
}

.oafs input:focus-visible,
.oafs textarea:focus-visible,
.oafs button:focus-visible,
.oafs a:focus-visible,
.oafs-summary:focus-visible,
.oafs-done:focus-visible,
.oafs-file-input:focus-visible + .oafs-file-pick {
	outline: 2px solid var(--oafs-ink);
	outline-offset: 2px;
}

.oafs [aria-invalid="true"] {
	border-color: var(--oafs-error) !important;
}

.oafs-error {
	color: var(--oafs-error);
	font-size: 0.875em;
}

.oafs-error:not(:empty) {
	margin-top: 6px !important;
}

.oafs-count {
	margin-top: 6px !important;
	color: var(--oafs-muted);
	font-size: 0.875em;
	text-align: right;
}

.oafs-count.is-over {
	color: var(--oafs-error);
}

/* Honeypot: off screen for people, present for bots. */

.oafs-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Buttons */

.oafs-button {
	display: inline-block;
	margin: 0;
	padding: 13px 22px;
	border: 1px solid var(--oafs-ink);
	border-radius: 0;
	background: var(--oafs-ink);
	color: var(--oafs-paper);
	font: inherit;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.oafs-button:hover {
	background: #333;
	border-color: #333;
}

.oafs-button-quiet {
	background: var(--oafs-paper);
	color: var(--oafs-ink);
}

.oafs-button-quiet:hover {
	background: var(--oafs-ink);
	border-color: var(--oafs-ink);
	color: var(--oafs-paper);
}

.oafs-button[disabled] {
	opacity: 0.55;
	cursor: default;
}

.oafs-link {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.oafs a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Artworks */

.oafs-work {
	margin: 0 0 32px;
	padding: 0 0 8px;
	border-bottom: 1px solid var(--oafs-soft);
}

.oafs-work-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin: 0 0 16px;
}

.oafs-work-head h3 {
	margin: 0;
	padding: 0;
	font: inherit;
	font-weight: 600;
}

/* File pickers */

.oafs-file-row {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	padding: 16px;
	border: 1px dashed var(--oafs-line);
}

.oafs-file.is-done .oafs-file-row {
	border-style: solid;
}

.oafs-file-thumb {
	flex: 0 0 auto;
	width: 96px;
	height: 96px;
	object-fit: contain;
	background: #f2f2f2;
}

.oafs-file-main {
	flex: 1 1 auto;
	min-width: 0;
}

.oafs-file-name {
	margin: 0 0 6px !important;
	overflow-wrap: anywhere;
}

.oafs-file-status {
	color: var(--oafs-muted);
	font-size: 0.875em;
}

.oafs-file-status:not(:empty) {
	margin: 0 0 10px !important;
}

.oafs-file.is-error .oafs-file-status {
	color: var(--oafs-error);
}

.oafs-file-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
}

.oafs-file-input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.oafs-file-pick {
	padding: 9px 16px;
}

.oafs-progress {
	height: 3px;
	margin: 0 0 8px;
	background: var(--oafs-soft);
}

.oafs-progress span {
	display: block;
	width: 0;
	height: 100%;
	background: var(--oafs-ink);
	transition: width 0.15s linear;
}

/* Checkboxes */

.oafs-check {
	display: grid;
	grid-template-columns: 22px 1fr;
	gap: 0 12px;
	margin: 0 0 18px;
}

.oafs-check input[type="checkbox"] {
	width: 20px;
	height: 20px;
	margin: 2px 0 0;
	accent-color: #000;
}

.oafs-check label {
	margin: 0;
}

.oafs-check .oafs-error {
	grid-column: 2;
}

/* Submit, summary, done */

.oafs-summary {
	margin: 0 0 24px;
	padding: 14px 16px;
	border: 1px solid var(--oafs-error);
	color: var(--oafs-error);
}

.oafs-submit .oafs-hint {
	margin: 12px 0 0 !important;
}

.oafs-done {
	padding: 24px 0;
	border-top: 1px solid var(--oafs-line);
	border-bottom: 1px solid var(--oafs-line);
	font-size: 1.125em;
}

.oafs-closed {
	padding: 24px 0;
	border-top: 1px solid var(--oafs-line);
	border-bottom: 1px solid var(--oafs-line);
}

@media (max-width: 560px) {
	.oafs-pair {
		grid-template-columns: 1fr;
	}

	.oafs-section {
		margin-bottom: 44px;
	}

	.oafs-file-thumb {
		width: 72px;
		height: 72px;
	}

	.oafs-submit .oafs-button {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.oafs-progress span {
		transition: none;
	}
}
