/* The Unsent Letters Movement. Styled to match iamcontent.care.
 *
 * To change the look, edit the variables in the first block. Everything else follows.
 * Colours: cream page #FCFAF6 and near-black headings from the site, and the accent
 * #274477, the blue of the handwriting on the postcard.
 * Body text inherits your site's font; headings use the serif your site uses (Merriweather),
 * falling back to Georgia if it isn't loaded on the page. */

.ulm {
	--ulm-bg: #fcfaf6;
	--ulm-paper: #fffefb;
	--ulm-ink: #1a1a1a;
	--ulm-head: #030303;
	--ulm-accent: #274477;
	--ulm-accent-dark: #1b3157;
	--ulm-rule: #e4dfd3;
	--ulm-border: #cfc9ba;
	--ulm-muted: #5c5c57;
	--ulm-error: #8f2d2d;
	--ulm-serif: 'Merriweather', Georgia, 'Times New Roman', serif;

	box-sizing: border-box;
	max-width: 720px;
	margin: 0 auto 2.5rem;
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--ulm-ink);
}
.ulm *,
.ulm *::before,
.ulm *::after { box-sizing: border-box; }

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

/* ------------------------------ headings ------------------------------ */

.ulm .ulm-title {
	margin: 0 0 1rem;
	font-family: var(--ulm-serif);
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--ulm-head);
}

/* ------------------------------- fields ------------------------------- */

.ulm .ulm-field { margin: 0 0 1.25rem; }

.ulm label {
	display: block;
	margin: 0 0 .4rem;
	font-weight: 600;
	color: var(--ulm-ink);
}
.ulm .ulm-opt { font-weight: 400; color: var(--ulm-muted); }

.ulm input[type="text"],
.ulm input[type="email"],
.ulm textarea {
	display: block;
	width: 100%;
	margin: 0;
	padding: .8rem .9rem;
	font: inherit;
	font-size: 16px; /* stops iPhones zooming in */
	color: var(--ulm-ink);
	background: var(--ulm-paper);
	border: 1px solid var(--ulm-border);
	border-radius: 4px;
	box-shadow: none;
}
.ulm input[type="text"]:focus,
.ulm input[type="email"]:focus,
.ulm textarea:focus {
	outline: 3px solid rgba(39, 68, 119, .3);
	outline-offset: 0;
	border-color: var(--ulm-accent);
}
.ulm ::placeholder { color: #7b7b74; opacity: 1; }

/* The letter itself: ruled paper. */
.ulm textarea {
	min-height: 31rem;
	padding: 2rem 1.25rem 1rem;
	font-family: var(--ulm-serif);
	font-size: 1.05rem;
	line-height: 2rem;
	resize: vertical;
	background-color: var(--ulm-paper);
	background-image: linear-gradient(to bottom, transparent calc(2rem - 1px), var(--ulm-rule) calc(2rem - 1px), var(--ulm-rule) 2rem);
	background-size: 100% 2rem;
	background-attachment: local;
}

.ulm .ulm-help {
	margin: .4rem 0 0;
	font-size: .9rem;
	color: var(--ulm-muted);
}

.ulm .ulm-notice {
	margin: 1.5rem 0 1rem;
	padding: .9rem 1rem;
	font-size: .95rem;
	background: #f3f0e7;
	border-left: 3px solid var(--ulm-accent);
	border-radius: 0 4px 4px 0;
}

.ulm .ulm-check {
	display: flex;
	align-items: flex-start;
	gap: .75rem;
	margin: .75rem 0;
	font-size: .95rem;
	font-weight: 400;
	cursor: pointer;
}
.ulm .ulm-check input {
	flex: none;
	width: 22px;
	height: 22px;
	margin: .15rem 0 0;
	accent-color: var(--ulm-accent);
}

/* Hidden spam trap: people never see it. */
.ulm .ulm-hp {
	position: absolute !important;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ------------------------------- buttons ------------------------------ */

.ulm button.ulm-btn {
	appearance: none;
	display: inline-block;
	min-height: 48px;
	margin: 1rem 0 0;
	padding: .85rem 1.75rem;
	font: inherit;
	font-weight: 600;
	letter-spacing: .01em;
	line-height: 1.2;
	color: #fff;
	background: var(--ulm-accent);
	border: 1.5px solid var(--ulm-accent);
	border-radius: 4px;
	cursor: pointer;
	text-transform: none;
	box-shadow: none;
}
.ulm button.ulm-btn:hover,
.ulm button.ulm-btn:focus-visible { background: var(--ulm-accent-dark); border-color: var(--ulm-accent-dark); color: #fff; }
.ulm button.ulm-btn:focus-visible { outline: 3px solid rgba(39, 68, 119, .35); outline-offset: 2px; }
.ulm button.ulm-btn:disabled { opacity: .6; cursor: progress; }

.ulm button.ulm-btn--ghost { color: var(--ulm-accent); background: transparent; }
.ulm button.ulm-btn--ghost:hover,
.ulm button.ulm-btn--ghost:focus-visible { color: var(--ulm-accent-dark); background: rgba(39, 68, 119, .08); }

.ulm button.ulm-linkbtn {
	appearance: none;
	min-height: 44px;
	padding: .25rem 0;
	font: inherit;
	color: var(--ulm-accent);
	text-decoration: underline;
	text-underline-offset: 3px;
	background: none;
	border: 0;
	cursor: pointer;
	text-transform: none;
	box-shadow: none;
}
.ulm button.ulm-linkbtn:hover { color: var(--ulm-accent-dark); background: none; }

/* ------------------------------ messages ------------------------------ */

.ulm .ulm-error {
	margin: .75rem 0 0;
	font-weight: 600;
	color: var(--ulm-error);
}
.ulm .ulm-ok {
	margin: .75rem 0 0;
	font-weight: 600;
	color: var(--ulm-accent);
}

/* --------------------------- after dropping --------------------------- */

.ulm .ulm-done,
.ulm .ulm-letter {
	padding: 1.75rem 1.5rem;
	background: var(--ulm-paper);
	border: 1px solid var(--ulm-rule);
	border-radius: 4px;
}
.ulm .ulm-done:focus,
.ulm .ulm-letter:focus { outline: none; }

.ulm .ulm-code-wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .75rem 1rem;
	margin: 1rem 0;
}
.ulm .ulm-code {
	display: inline-block;
	padding: .6rem 1rem;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 1.35rem;
	letter-spacing: .06em;
	color: var(--ulm-head);
	background: #fff;
	border: 1.5px dashed var(--ulm-accent);
	border-radius: 4px;
	overflow-wrap: anywhere;
}
.ulm .ulm-code-wrap button.ulm-btn { margin: 0; }

.ulm .ulm-emailed { color: var(--ulm-muted); font-size: .95rem; }

/* The letter shown back to its writer. */
.ulm .ulm-letter { margin-top: 1.5rem; }
.ulm .ulm-letter__meta { margin: 0 0 1rem; font-size: .9rem; color: var(--ulm-muted); }
.ulm .ulm-letter__body {
	font-family: var(--ulm-serif);
	font-size: 1.05rem;
	line-height: 1.9;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}
.ulm .ulm-letter__actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; margin: 1.25rem 0 0; }
.ulm .ulm-letter__actions button.ulm-btn { margin: 0; }

/* ------------------------------ retrieve ------------------------------ */

.ulm-retrieve .ulm-form--recover {
	margin: .5rem 0 0;
	padding: 1.25rem 1.25rem 1.5rem;
	background: #f3f0e7;
	border-radius: 4px;
}
.ulm-retrieve input[name="code"] {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	letter-spacing: .06em;
	text-transform: uppercase;
}
.ulm-retrieve input[name="code"]::placeholder { text-transform: none; letter-spacing: .04em; }

/* ------------------------------- counter ------------------------------ */

.ulm.ulm-counter {
	margin: 1.5rem auto;
	text-align: center;
	color: var(--ulm-muted);
}
.ulm .ulm-counter__num {
	margin-right: .25rem;
	font-family: var(--ulm-serif);
	font-size: 2.4rem;
	font-weight: 700;
	line-height: 1;
	color: var(--ulm-accent);
}
.ulm .ulm-counter__label { font-size: 1.05rem; }

/* ------------------------------- support ------------------------------ */

.ulm.ulm-support,
.ulm .ulm-support { font-size: .95rem; color: var(--ulm-muted); }
.ulm.ulm-support p,
.ulm .ulm-support p { margin: 0 0 .9rem; }
.ulm .ulm-support a { color: var(--ulm-accent); text-decoration: underline; text-underline-offset: 3px; }
.ulm .ulm-support__crisis strong { color: var(--ulm-ink); }

/* -------------------------------- small ------------------------------- */

@media (max-width: 480px) {
	.ulm .ulm-title { font-size: 1.3rem; }
	.ulm textarea { min-height: 31rem; padding-left: 1rem; padding-right: 1rem; }
	.ulm button.ulm-btn { width: 100%; }
	.ulm .ulm-code-wrap button.ulm-btn,
	.ulm .ulm-letter__actions button.ulm-btn { width: auto; }
	.ulm .ulm-code { font-size: 1.15rem; }
}

/* ------------------------- the postbox card (drop) ------------------------- */

.ulm { --ulm-red: #b8322a; --ulm-card: #f3eee2; }

.ulm.ulm-drop {
	position: relative;
	padding: 2.75rem 2rem 2rem;
	background: var(--ulm-card);
	border: 1px solid var(--ulm-border);
	border-radius: 6px;
	box-shadow: 0 12px 30px rgba(26, 26, 26, .09);
	overflow: hidden;
}

/* Airmail stripe along the top edge: postbox red and postcard blue. */
.ulm.ulm-drop::before {
	content: "";
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 12px;
	background: repeating-linear-gradient(-45deg,
		var(--ulm-red) 0 14px, var(--ulm-card) 14px 24px,
		var(--ulm-accent) 24px 38px, var(--ulm-card) 38px 48px);
}

.ulm .ulm-hero {
	display: flex;
	align-items: center;
	gap: 1.25rem 1.75rem;
	margin: 0 0 2rem;
}
.ulm .ulm-hero__text { min-width: 0; }
.ulm .ulm-grunge { flex: none; display: block; width: 190px; height: auto; overflow: visible; filter: drop-shadow(0 6px 7px rgba(60, 40, 15, .25)); }

.ulm .ulm-title--big {
	margin: 0 0 .4rem;
	font-size: 2.5rem;
	font-weight: 800;
	line-height: 1.08;
	letter-spacing: -.01em;
	color: var(--ulm-head);
}
.ulm .ulm-sub { margin: 0; font-size: 1.1rem; line-height: 1.5; color: var(--ulm-muted); text-wrap: pretty; }

/* When a letter is posted, a postmark stamps onto the envelope. */
.ulm .ulm-postmark { opacity: 0; transform-box: fill-box; transform-origin: center; }
.ulm-drop.is-dropped .ulm-postmark { animation: ulm-stamp .5s cubic-bezier(.2, .9, .3, 1.15) .15s forwards; }
@keyframes ulm-stamp {
	0%   { opacity: 0;   transform: scale(1.8) rotate(-14deg); }
	55%  { opacity: .95; }
	100% { opacity: .88; transform: scale(1) rotate(-6deg); }
}
@media (prefers-reduced-motion: reduce) {
	.ulm-drop.is-dropped .ulm-postmark { animation: none; opacity: .88; }
}

/* A bolder button for the main action. */
.ulm.ulm-drop .ulm-form button.ulm-btn[type="submit"] {
	min-height: 56px;
	margin-top: 1.5rem;
	padding: 1rem 2.5rem;
	font-size: 1.15rem;
	font-weight: 700;
	letter-spacing: .02em;
	box-shadow: 0 4px 0 var(--ulm-accent-dark);
	transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.ulm.ulm-drop .ulm-form button.ulm-btn[type="submit"]:hover { transform: translateY(2px); box-shadow: 0 2px 0 var(--ulm-accent-dark); }
.ulm.ulm-drop .ulm-form button.ulm-btn[type="submit"]:active { transform: translateY(4px); box-shadow: 0 0 0 var(--ulm-accent-dark); }
.ulm.ulm-drop .ulm-form button.ulm-btn[type="submit"]:disabled { transform: translateY(4px); box-shadow: none; }

@media (max-width: 480px) {
	.ulm.ulm-drop { padding: 2.25rem 1.1rem 1.5rem; }
	.ulm .ulm-hero { gap: 1rem; margin-bottom: 1.5rem; }
	.ulm .ulm-grunge { width: 130px; }
	.ulm .ulm-title--big { font-size: 1.95rem; }
	.ulm .ulm-sub { font-size: 1rem; }
}


/* ----------------------- pictures: photo, folk postbox ----------------------- */

.ulm .ulm-photo {
	flex: none;
	display: block;
	width: 150px;
	height: 180px;
	object-fit: cover;
	border: 6px solid #fffefb;
	border-radius: 2px;
	box-shadow: 0 8px 20px rgba(26, 26, 26, .2);
	transform: rotate(-3deg);
}

.ulm.ulm-counter--art {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1.75rem;
	text-align: left;
}
.ulm .ulm-counter__art { flex: none; line-height: 0; }
.ulm .ulm-folk { display: block; width: 84px; height: auto; overflow: visible; }
.ulm .ulm-photo--counter { width: auto; height: 210px; max-width: 120px; object-fit: contain; border: 0; border-radius: 0; box-shadow: none; transform: none; }
.ulm .ulm-counter__text { margin: 0; }
.ulm.ulm-counter--art .ulm-counter__num { display: block; margin: 0 0 .3rem; font-size: 3.6rem; }
.ulm.ulm-counter--art .ulm-counter__label { display: block; font-size: 1.1rem; }

@media (max-width: 480px) {
	.ulm .ulm-photo { width: 110px; height: 132px; }
	.ulm .ulm-photo--counter { width: auto; height: 180px; }
	.ulm.ulm-counter--art { flex-direction: column; gap: .75rem; text-align: center; }
	.ulm.ulm-counter--art .ulm-counter__num { font-size: 3rem; }
}
