/* site.css: the module picker. Colours are the deck's palette (assets/css/deck.css). */

@font-face { font-family: "Source Sans Pro"; font-weight: 400; font-style: normal; src: url(../../vendor/reveal/theme/fonts/source-sans-pro-regular.woff) format("woff"); }
@font-face { font-family: "Source Sans Pro"; font-weight: 400; font-style: italic; src: url(../../vendor/reveal/theme/fonts/source-sans-pro-italic.woff) format("woff"); }
@font-face { font-family: "Source Sans Pro"; font-weight: 600; font-style: normal; src: url(../../vendor/reveal/theme/fonts/source-sans-pro-semibold.woff) format("woff"); }

:root {
	--midnight: #2C3E50;
	--wisteria: #8E44AD;
	--belize: #2980B9;
	--greensea: #16A085;
	--pomegranate: #C0392B;
	--clouds: #ECF0F1;
	--muted: #5D6D7E;
	--line: #D5DBDF;
	--card: #fff;
}

* { box-sizing: border-box; }
html { background: var(--clouds); }
body {
	margin: 0;
	padding: 0 16px 110px;
	background: var(--clouds);
	color: var(--midnight);
	font: 400 18px/1.45 "Source Sans Pro", Helvetica, Arial, sans-serif;
}
.top, main { max-width: 760px; margin: 0 auto; }
.top { padding: 40px 0 20px; }
h1 { margin: 0 0 6px; font-size: 32px; line-height: 1.15; font-weight: 600; }
.top p { margin: 0; color: var(--muted); }
h2 { margin: 0; font-size: 20px; line-height: 1.25; font-weight: 600; }

:focus-visible { outline: 3px solid var(--belize); outline-offset: 2px; }

/* ---------------------------------------------------------------- the list */
#modules { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.module {
	display: grid;
	grid-template-columns: auto auto 1fr auto;
	align-items: center;
	gap: 14px;
	padding: 14px 14px 14px 10px;
	background: var(--card);
	border: 1px solid var(--line);
	border-left: 6px solid var(--line);
	border-radius: 10px;
	transition: border-color 0.15s, box-shadow 0.15s;
}
.module.on { border-left-color: var(--greensea); box-shadow: 0 1px 6px rgba(44, 62, 80, 0.12); }
.module:not(.on) .body { opacity: 0.78; }
.module.dragging { opacity: 0.4; }
.grip { cursor: grab; color: var(--muted); font-size: 22px; line-height: 1; padding: 4px 2px; user-select: none; touch-action: none; }
.body { min-width: 0; }
.desc { margin: 2px 0 0; color: var(--muted); font-size: 16px; }
.meta { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.meta .tag { color: var(--wisteria); font-weight: 600; }

/* The on/off switch */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 13px; background: #B2BABB; transition: background 0.15s; }
.switch .track::after {
	content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
	border-radius: 50%; background: #fff; transition: transform 0.15s;
}
.switch input:checked + .track { background: var(--greensea); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 3px solid var(--belize); outline-offset: 2px; }

.tools { display: flex; gap: 4px; }
.tools button {
	min-width: 32px; height: 32px; padding: 0 8px;
	border: 1px solid var(--line); border-radius: 6px;
	background: #fff; color: var(--midnight); font: inherit; font-size: 15px; cursor: pointer;
}
.tools button:hover:not(:disabled) { border-color: var(--belize); color: var(--belize); }
.tools button:disabled { opacity: 0.35; cursor: default; }
.tools .danger:hover:not(:disabled) { border-color: var(--pomegranate); color: var(--pomegranate); }

#status { color: var(--muted); }
#status:empty { display: none; }

/* ---------------------------------------------------------------- bottom bar */
.bar {
	position: fixed; left: 0; right: 0; bottom: 0;
	display: flex; justify-content: center; gap: 12px;
	padding: 14px 16px;
	background: rgba(236, 240, 241, 0.94);
	border-top: 1px solid var(--line);
	backdrop-filter: blur(6px);
}

button.primary, button.secondary {
	min-height: 44px; padding: 0 22px; border-radius: 8px;
	font: 600 17px/1 "Source Sans Pro", Helvetica, Arial, sans-serif; cursor: pointer;
}
button.primary { background: var(--belize); border: 2px solid var(--belize); color: #fff; }
button.primary:hover:not(:disabled) { background: #20638f; border-color: #20638f; }
button.primary:disabled { background: #B2BABB; border-color: #B2BABB; cursor: not-allowed; }
button.secondary { background: #fff; border: 2px solid var(--midnight); color: var(--midnight); }
button.secondary:hover { background: var(--midnight); color: #fff; }
button.small { min-height: 34px; padding: 0 14px; font-size: 15px; }

/* ---------------------------------------------------------------- the editor */
dialog {
	width: min(640px, calc(100vw - 24px)); max-height: calc(100vh - 24px);
	padding: 22px; border: 0; border-radius: 12px; overflow: auto;
	background: #fff; color: var(--midnight);
	box-shadow: 0 10px 40px rgba(44, 62, 80, 0.35);
}
dialog::backdrop { background: rgba(44, 62, 80, 0.5); }
dialog h2 { margin-bottom: 14px; }
.field { display: block; margin-bottom: 14px; font-weight: 600; }
.field .optional { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
	display: block; width: 100%; margin-top: 4px; padding: 8px 10px;
	border: 1px solid #aab4b8; border-radius: 6px;
	font: 400 17px/1.4 "Source Sans Pro", Helvetica, Arial, sans-serif; color: var(--midnight);
}
.field textarea { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 15px; resize: vertical; }
.images { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.images ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.images li { display: flex; align-items: center; gap: 6px; padding: 2px 4px 2px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; }
.images li button { border: 0; background: none; color: var(--muted); font-size: 16px; cursor: pointer; }
.images li button:hover { color: var(--pomegranate); }
.syntax { margin-bottom: 12px; font-size: 15px; color: var(--muted); }
.syntax summary { cursor: pointer; font-weight: 600; color: var(--midnight); }
.syntax ul { margin: 8px 0 0; padding-left: 20px; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9em; background: var(--clouds); padding: 0 4px; border-radius: 4px; }
.count { min-height: 1.45em; margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.count.warn { color: var(--pomegranate); }
.buttons { display: flex; justify-content: flex-end; gap: 10px; }

@media (max-width: 520px) {
	.module { grid-template-columns: auto 1fr; }
	.module .grip { display: none; }
	.module .tools { grid-column: 1 / -1; justify-content: flex-end; }
	h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; }
}
