/*
 * Ontario Conference — Adventist Logo Creator
 * Scoped under #oc-logo-creator so nothing leaks into the rest of the theme.
 * (The tool styles text inputs and buttons heavily; unscoped, those rules would
 * hit every form on the site.)
 *
 * Mobile-first: preview on top, controls below; two-column grid from 900px up.
 * Every :hover is paired with :focus and focus outlines are never removed —
 * .stylelintrc.json enforces both via stylelint-a11y.
 */

#oc-logo-creator {
	--lc-ink: #1c2430;
	--lc-muted: #55627a;
	--lc-line: #d5dae2;
	--lc-panel: #fff;
	--lc-accent: #003a5d;          /* theme --sda-blue */
	--lc-accent-hover: #00293f;
	--lc-focus: #007681;           /* NAD Nile, meets contrast on white */
	--lc-nad-denim: #003b5c;
	--lc-radius: 14px;
	--lc-font-display: Claritycity, "Helvetica Neue", helvetica, arial, sans-serif;

	color: var(--lc-ink);
	font-size: 1rem;
}

/* The tool toggles whole control blocks with the `hidden` attribute. Several of
   those elements are also given an explicit `display` below (labels, grids),
   which would otherwise beat the UA stylesheet's [hidden] rule and leave orphan
   labels on screen — e.g. "Department" showing in Logo-only mode. */
#oc-logo-creator [hidden] {
	display: none !important;
}

#oc-logo-creator .lc-status {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ------------------------------------------------------------------- tabs */

#oc-logo-creator .lc-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1.25rem;
	border-bottom: 1px solid var(--lc-line);
}

#oc-logo-creator .lc-tabs button {
	padding: 0.65rem 0.2rem;
	margin-bottom: -1px;
	font-family: var(--lc-font-display);
	font-size: 1rem;
	font-weight: 500;
	letter-spacing: 0.04em;
	color: var(--lc-muted);
	cursor: pointer;
	background: none;
	border: 0;
	border-bottom: 2px solid transparent;
}

#oc-logo-creator .lc-tabs button:hover,
#oc-logo-creator .lc-tabs button:focus {
	color: var(--lc-ink);
}

#oc-logo-creator .lc-tabs button:focus-visible {
	outline: 2px solid var(--lc-focus);
	outline-offset: 2px;
}

#oc-logo-creator .lc-tabs button.is-active {
	color: var(--lc-ink);
	border-bottom-color: var(--lc-accent);
}

/* ------------------------------------------------------------------ layout */

#oc-logo-creator .lc-body {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.25rem;
	align-items: start;
}

#oc-logo-creator .lc-controls,
#oc-logo-creator .lc-preview {
	padding: 1.15rem;
	background: var(--lc-panel);
	border: 1px solid var(--lc-line);
	border-radius: calc(var(--lc-radius) + 4px);
}

#oc-logo-creator .lc-controls {
	display: flex;
	flex-direction: column;
	gap: 1.35rem;
	order: 2;
}

#oc-logo-creator .lc-preview {
	order: 1;
}

#oc-logo-creator .lc-block__title {
	margin: 0 0 0.65rem;
	font-family: var(--lc-font-display);
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--lc-muted);
	text-transform: uppercase;
	letter-spacing: 0.16em;
}

#oc-logo-creator .lc-block__title--icon {
	display: inline-flex;
	gap: 0.45rem;
	align-items: center;
	text-transform: none;
	letter-spacing: 0.02em;
}

#oc-logo-creator .lc-block__title--icon svg {
	flex-shrink: 0;
	color: var(--lc-accent);
}

#oc-logo-creator .lc-block--language {
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--lc-line);
}

#oc-logo-creator .lc-block + .lc-block {
	margin-top: 1.35rem;
}

/* ------------------------------------------------------- generic controls */

#oc-logo-creator .lc-langs,
#oc-logo-creator .lc-cards,
#oc-logo-creator .lc-choices {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.55rem;
}

#oc-logo-creator .lc-choices--2 {
	grid-template-columns: 1fr 1fr;
}

#oc-logo-creator .lc-langs button,
#oc-logo-creator .lc-cards button,
#oc-logo-creator .lc-choices button {
	display: flex;
	gap: 0.45rem;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0.75rem 0.65rem;
	font-family: inherit;
	font-size: 0.92rem;
	color: var(--lc-ink);
	text-align: center;
	cursor: pointer;
	background: #fff;
	border: 1px solid var(--lc-line);
	border-radius: var(--lc-radius);
}

#oc-logo-creator .lc-cards button {
	flex-direction: column;
	gap: 0.55rem;
}

#oc-logo-creator .lc-langs button {
	font-weight: 700;
}

#oc-logo-creator .lc-langs button:hover,
#oc-logo-creator .lc-langs button:focus,
#oc-logo-creator .lc-cards button:hover,
#oc-logo-creator .lc-cards button:focus,
#oc-logo-creator .lc-choices button:hover,
#oc-logo-creator .lc-choices button:focus {
	border-color: var(--lc-accent);
}

#oc-logo-creator .lc-langs button:focus-visible,
#oc-logo-creator .lc-cards button:focus-visible,
#oc-logo-creator .lc-choices button:focus-visible {
	outline: 2px solid var(--lc-focus);
	outline-offset: 2px;
}

#oc-logo-creator .lc-langs button.is-active {
	color: #fff;
	background: var(--lc-accent);
	border-color: var(--lc-accent);
}

#oc-logo-creator .lc-cards button.is-active,
#oc-logo-creator .lc-choices button.is-active {
	border-color: var(--lc-ink);
	box-shadow: inset 0 0 0 1px var(--lc-ink);
}

#oc-logo-creator .lc-langs button[disabled],
#oc-logo-creator .lc-cards button[disabled],
#oc-logo-creator .lc-choices button[disabled] {
	cursor: not-allowed;
	opacity: 0.4;
}

/* Little wireframe glyphs on the layout cards. */
#oc-logo-creator .lc-glyph {
	position: relative;
	width: 42px;
	height: 28px;
	border: 1.5px solid;
	border-radius: 3px;
	opacity: 0.75;
}

#oc-logo-creator .lc-glyph::before,
#oc-logo-creator .lc-glyph::after {
	position: absolute;
	content: "";
	background: currentColor;
}

#oc-logo-creator .lc-glyph--h::before {
	top: 8px;
	left: 5px;
	width: 10px;
	height: 10px;
	border-radius: 1px;
}

#oc-logo-creator .lc-glyph--h::after {
	top: 12px;
	right: 6px;
	width: 16px;
	height: 2px;
	box-shadow: 0 4px;
}

#oc-logo-creator .lc-glyph--v::before {
	top: 4px;
	left: 15px;
	width: 10px;
	height: 10px;
	border-radius: 1px;
}

#oc-logo-creator .lc-glyph--v::after {
	bottom: 5px;
	left: 11px;
	width: 18px;
	height: 2px;
	box-shadow: 0 -4px;
}

/* Small colour chips inside the department / logo-only colour buttons. */
#oc-logo-creator .lc-chip {
	flex-shrink: 0;
	width: 0.85rem;
	height: 0.85rem;
	background: var(--lc-nad-denim);
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 3px;
}

#oc-logo-creator .lc-chip--outline {
	background: #fff;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

#oc-logo-creator .lc-chip--checker {
	background-color: #e6eaee;
	background-image:
		linear-gradient(45deg, #f7f8fa 25%, transparent 25%),
		linear-gradient(-45deg, #f7f8fa 25%, transparent 25%),
		linear-gradient(45deg, transparent 75%, #f7f8fa 75%),
		linear-gradient(-45deg, transparent 75%, #f7f8fa 75%);
	background-position: 0 0, 0 3px, 3px -3px, -3px 0;
	background-size: 6px 6px;
}

/* ------------------------------------------------------------ text inputs */

#oc-logo-creator .lc-label {
	display: block;
	margin-bottom: 0.5rem;
	font-size: 0.86rem;
	font-weight: 700;
	color: var(--lc-accent);
}

#oc-logo-creator .lc-label--mt {
	margin-top: 1rem;
}

#oc-logo-creator input[type="text"] {
	box-sizing: border-box;
	width: 100%;
	padding: 0.85rem 0.95rem;
	font: inherit;
	font-size: 1rem;
	color: var(--lc-ink);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	background: #fff;
	border: 1px solid var(--lc-line);
	border-radius: 10px;
}

/* The entity name keeps its capitalisation — "Ontario Conference", not shouted. */
#oc-logo-creator #lc-entity-name {
	letter-spacing: 0.01em;
	text-transform: none;
}

/* Church picker. Native select on purpose: it gets the platform's own long-list
   behaviour (type-to-jump, proper scrolling, a usable wheel on phones) for 185
   congregations, which a custom listbox would have to reimplement badly. */
#oc-logo-creator .lc-select {
	box-sizing: border-box;
	width: 100%;
	padding: 0.85rem 2.2rem 0.85rem 0.95rem;
	font: inherit;
	font-size: 1rem;
	color: var(--lc-ink);
	appearance: none;
	background-color: #fff;
	/* Chevron, inlined so there is no extra request and no CSP concern. */
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%2355627a' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4Z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.95rem center;
	background-size: 12px 8px;
	border: 1px solid var(--lc-line);
	border-radius: 10px;
}

#oc-logo-creator .lc-select:hover,
#oc-logo-creator .lc-select:focus {
	border-color: var(--lc-accent);
}

#oc-logo-creator .lc-select:focus {
	outline: 2px solid var(--lc-focus);
	outline-offset: 1px;
}

#oc-logo-creator input[type="text"]:hover,
#oc-logo-creator input[type="text"]:focus {
	border-color: var(--lc-accent);
}

#oc-logo-creator input[type="text"]:focus {
	outline: 2px solid var(--lc-focus);
	outline-offset: 1px;
}

#oc-logo-creator .lc-help,
#oc-logo-creator .lc-warn,
#oc-logo-creator .lc-error {
	margin: 0.55rem 0 0;
	font-size: 0.86rem;
	line-height: 1.45;
	color: var(--lc-muted);
}

#oc-logo-creator .lc-warn {
	color: #7a4110;
}

#oc-logo-creator .lc-error {
	font-weight: 700;
	color: #8a1c1c;
}

/* -------------------------------------------------------------- swatches */

#oc-logo-creator .lc-swatches {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
}

#oc-logo-creator .lc-swatch {
	display: flex;
	gap: 0.55rem;
	align-items: center;
	width: 100%;
	min-height: 44px;
	padding: 0.45rem 0.55rem;
	font-family: inherit;
	color: var(--lc-ink);
	text-align: left;
	cursor: pointer;
	background: #fff;
	border: 1px solid var(--lc-line);
	border-radius: 10px;
}

#oc-logo-creator .lc-swatch:hover,
#oc-logo-creator .lc-swatch:focus {
	border-color: var(--lc-accent);
}

#oc-logo-creator .lc-swatch:focus-visible {
	outline: 2px solid var(--lc-focus);
	outline-offset: 2px;
}

#oc-logo-creator .lc-swatch.is-active {
	border-color: var(--lc-ink);
	box-shadow: inset 0 0 0 1px var(--lc-ink);
}

#oc-logo-creator .lc-swatch__chip {
	flex-shrink: 0;
	width: 1.35rem;
	height: 1.35rem;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 999px;
}

#oc-logo-creator .lc-swatch--white .lc-swatch__chip {
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

#oc-logo-creator .lc-swatch__label {
	font-size: 0.78rem;
	line-height: 1.2;
}

/* ------------------------------------------------------------- downloads */

#oc-logo-creator .lc-block--actions {
	padding: 1.15rem 1.1rem;
	margin-top: 0.5rem;
	background: #eef4f7;
	border: 1px solid rgba(0, 58, 93, 0.22);
	border-radius: var(--lc-radius);
}

#oc-logo-creator .lc-block--actions .lc-block__title {
	color: var(--lc-accent);
	letter-spacing: 0.18em;
}

#oc-logo-creator .lc-help--download {
	margin: 0 0 0.85rem;
	font-size: 0.82rem;
}

#oc-logo-creator .lc-downloads {
	display: grid;
	gap: 0.65rem;
}

#oc-logo-creator .lc-downloads__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.65rem;
}

#oc-logo-creator .lc-dl {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	align-items: flex-start;
	width: 100%;
	min-height: 44px;
	padding: 0.95rem 1rem;
	font-family: inherit;
	font-size: 0.92rem;
	color: var(--lc-ink);
	text-align: left;
	cursor: pointer;
	background: #fff;
	border: 1px solid var(--lc-line);
	border-radius: 12px;
}

#oc-logo-creator .lc-dl--primary {
	color: #fff;
	background: var(--lc-accent);
	border-color: var(--lc-accent);
}

#oc-logo-creator .lc-dl:hover,
#oc-logo-creator .lc-dl:focus {
	color: #fff;
	background: var(--lc-ink);
	border-color: var(--lc-ink);
}

#oc-logo-creator .lc-dl--primary:hover,
#oc-logo-creator .lc-dl--primary:focus {
	background: var(--lc-accent-hover);
	border-color: var(--lc-accent-hover);
}

#oc-logo-creator .lc-dl:focus-visible {
	outline: 2px solid var(--lc-focus);
	outline-offset: 2px;
}

#oc-logo-creator .lc-dl:hover .lc-dl__hint,
#oc-logo-creator .lc-dl:focus .lc-dl__hint {
	color: rgba(255, 255, 255, 0.8);
}

#oc-logo-creator .lc-dl__label {
	line-height: 1.25;
}

#oc-logo-creator .lc-dl__hint {
	font-size: 0.75rem;
	line-height: 1.2;
	color: var(--lc-muted);
}

#oc-logo-creator .lc-dl--primary .lc-dl__hint {
	color: rgba(255, 255, 255, 0.8);
}

#oc-logo-creator .lc-dl[disabled] {
	cursor: wait;
	opacity: 0.55;
}

/* --------------------------------------------------------------- preview */

#oc-logo-creator .lc-preview__head {
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
	align-items: flex-start;
	margin-bottom: 0.85rem;
}

#oc-logo-creator .lc-preview__head .lc-block__title {
	margin: 0;
}

#oc-logo-creator .lc-preview__on {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 0.75rem;
	align-items: center;
	width: 100%;
}

#oc-logo-creator .lc-preview__on-label {
	font-size: 0.8rem;
	color: var(--lc-muted);
}

#oc-logo-creator .lc-surfaces {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

#oc-logo-creator .lc-surfaces button {
	display: inline-flex;
	gap: 0.4rem;
	align-items: center;
	min-height: 36px;
	padding: 0.45rem 0.8rem;
	font-family: inherit;
	font-size: 0.8rem;
	color: var(--lc-muted);
	cursor: pointer;
	background: #fff;
	border: 1px solid var(--lc-line);
	border-radius: 999px;
}

#oc-logo-creator .lc-surfaces button:hover,
#oc-logo-creator .lc-surfaces button:focus {
	color: var(--lc-ink);
	border-color: var(--lc-accent);
}

#oc-logo-creator .lc-surfaces button:focus-visible {
	outline: 2px solid var(--lc-focus);
	outline-offset: 2px;
}

#oc-logo-creator .lc-surfaces button.is-active {
	color: var(--lc-ink);
	border-color: var(--lc-ink);
}

#oc-logo-creator .lc-surfaces button[disabled] {
	cursor: not-allowed;
	opacity: 0.4;
}

#oc-logo-creator .lc-surface__chip {
	flex-shrink: 0;
	width: 0.85rem;
	height: 0.85rem;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 999px;
}

#oc-logo-creator .lc-surface__chip--white {
	background: #fff;
}

#oc-logo-creator .lc-surface__chip--denim {
	background: var(--lc-nad-denim);
}

#oc-logo-creator .lc-surface__chip--checkerboard {
	background-color: #e6eaee;
	background-image:
		linear-gradient(45deg, #f7f8fa 25%, transparent 25%),
		linear-gradient(-45deg, #f7f8fa 25%, transparent 25%),
		linear-gradient(45deg, transparent 75%, #f7f8fa 75%),
		linear-gradient(-45deg, transparent 75%, #f7f8fa 75%);
	background-position: 0 0, 0 3px, 3px -3px, -3px 0;
	background-size: 6px 6px;
}

/* ----------------------------------------------------------------- stage */

#oc-logo-creator .lc-stage {
	display: grid;
	place-items: center;
	min-height: 260px;
	padding: 1.25rem;
	overflow: auto;
	border: 1px solid var(--lc-line);
	border-radius: var(--lc-radius);
}

#oc-logo-creator .lc-stage[data-surface="checkerboard"] {
	background-color: #e6eaee;
	background-image:
		linear-gradient(45deg, #f7f8fa 25%, transparent 25%),
		linear-gradient(-45deg, #f7f8fa 25%, transparent 25%),
		linear-gradient(45deg, transparent 75%, #f7f8fa 75%),
		linear-gradient(-45deg, transparent 75%, #f7f8fa 75%);
	background-position: 0 0, 0 12px, 12px -12px, -12px 0;
	background-size: 24px 24px;
}

#oc-logo-creator .lc-stage[data-surface="white"] {
	background: #fff;
}

#oc-logo-creator .lc-stage[data-surface="denim"] {
	background: var(--lc-nad-denim);
}

#oc-logo-creator .lc-stage__lockup {
	display: grid;
	place-items: center;
	width: min(100%, 720px);
	height: clamp(180px, 30vh, 320px);
}

#oc-logo-creator .lc-stage__lockup svg {
	display: block;
	width: 100%;
	max-width: 100%;
	height: 100%;
	max-height: 100%;
	object-fit: contain;
}

#oc-logo-creator .lc-preview__tip {
	min-height: 1.35rem;
	margin: 0.65rem 0 0;
	font-size: 0.86rem;
	color: var(--lc-muted);
}

.lc-noscript {
	padding: 1rem 1.15rem;
	margin: 1rem 0;
	background: #fdf6e6;
	border: 1px solid #e0c67a;
	border-radius: 10px;
}

/* While the font and the eight lockup templates are still downloading, keep the
   stage from collapsing so the panel does not jump when artwork lands. */
#oc-logo-creator[data-ready="false"] .lc-stage__lockup::after {
	font-size: 0.86rem;
	color: var(--lc-muted);
	content: "Loading official artwork…";
}

/* ---------------------------------------------------------- 900px and up */

@media (min-width: 900px) {

	#oc-logo-creator .lc-body {
		grid-template-columns: minmax(280px, 380px) 1fr;
	}

	#oc-logo-creator .lc-controls {
		order: 1;
	}

	#oc-logo-creator .lc-preview {
		position: sticky;
		top: 1.25rem;
		order: 2;
	}

	#oc-logo-creator .lc-stage {
		min-height: 420px;
		padding: 1.5rem;
	}

	#oc-logo-creator .lc-stage__lockup {
		height: clamp(220px, 36vh, 360px);
	}

	#oc-logo-creator .lc-preview__head {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 0.75rem 1rem;
		align-items: center;
	}

	#oc-logo-creator .lc-preview__on {
		width: auto;
	}
}

/* ------------------------------------------------------------ below 480px */

@media (max-width: 480px) {

	#oc-logo-creator .lc-swatches {
		grid-template-columns: repeat(5, minmax(0, 1fr));
		gap: 0.45rem;
	}

	#oc-logo-creator .lc-swatch {
		justify-content: center;
		padding: 0.4rem;
	}

	#oc-logo-creator .lc-swatch__label {
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}

	#oc-logo-creator .lc-swatch__chip {
		width: 1.6rem;
		height: 1.6rem;
	}

	/* The language buttons stay two-up: four full-width buttons pushes the church
	   name field below the fold on a phone, and they fit comfortably at 2x180px. */
	#oc-logo-creator .lc-downloads__row {
		grid-template-columns: 1fr;
	}

	#oc-logo-creator .lc-dl__hint {
		display: none;
	}
}

/* Respect a reduced-motion preference: this tool has no essential animation,
   but the theme sets transitions globally on some elements. */
@media (prefers-reduced-motion: reduce) {

	#oc-logo-creator * {
		transition: none !important;
	}
}
