/* The page's own text keeps the browser's default font; the controls use the system's */
.top-bar,
.dialog,
.message {
	font-family: system-ui, sans-serif;
}

button {
	font: 16px system-ui, sans-serif;
	padding: 6px 14px;
	border: 1px solid #bbb;
	border-radius: 8px;
	background: #f4f4f4;
	cursor: pointer;
}

button:hover {
	background: #e8e8e8;
}

button.primary {
	background: #2463eb;
	border-color: #2463eb;
	color: white;
}

button.primary:hover {
	background: #1d4fc4;
}

button:disabled {
	opacity: 0.6;
	cursor: default;
}

/* The bar along the top: every page on the left (admin only), Log in / Sign out on the right */
.top-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	min-height: 40px;
}

.page-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.page-nav a {
	font-size: 16px;
	font-weight: normal;
	padding: 4px 10px;
	border-radius: 8px;
}

.page-nav a:hover {
	background: #eee;
}

.page-nav a.current {
	background: #dde7fd;
	font-weight: bold;
}

.account {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-left: auto;
}

.user-name {
	font-weight: bold;
}

.test-badge {
	background: #fff3b0;
	border: 1px solid #e6cf5a;
	border-radius: 6px;
	padding: 2px 8px;
	font-size: 14px;
}

h1 {
	margin-top: 4px;
}

.message {
	font-size: 20px;
	color: #555;
}

.error {
	color: #b42318;
}

.divider {
	width: 100%;
	border: 1px solid #ccc;
}

/* Pop-up boxes (sign in, and the admin's editors) */
.dialog {
	border: none;
	border-radius: 14px;
	padding: 24px;
	width: min(420px, calc(100vw - 32px));
	box-sizing: border-box;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.dialog::backdrop {
	background: rgba(0, 0, 0, 0.35);
}

.dialog h2 {
	margin: 0 0 16px;
}

.dialog form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.dialog label {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 15px;
	font-weight: 600;
}

.dialog input,
.dialog select {
	font: inherit;
	font-weight: normal;
	padding: 8px;
	border: 1px solid #bbb;
	border-radius: 8px;
}

.dialog .hint {
	margin: 0;
	font-size: 14px;
	color: #666;
}

.dialog .error {
	margin: 0;
}

.dialog .buttons {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 4px;
}

.flex {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
}

.link-div {
	margin: 5px 20px;
	text-align: center;
}

a {
	font-size: 24px;
	font-weight: bold;
	text-decoration: none;
	color: inherit;
}

img {
	height: 200px;
}

.br-20 {
	border-radius: 20px;
}

.br-10 {
	border-radius: 10px;
}

.br-5 {
	border-radius: 5px;
}

.section-title {
	list-style: none;
	cursor: pointer;
	user-select: none;
	text-align: left;
	font-size: 32px;
	font-weight: bold;
	margin: 10px 0;
}

.section-title::-webkit-details-marker {
	display: none;
}

.section-title::before {
	content: "\25B6";
	display: inline-block;
	margin-right: 12px;
	font-size: 0.7em;
	transition: transform 0.15s;
}

.section[open] > .section-title::before {
	transform: rotate(90deg);
}

/* The admin's edit mode */
button.danger {
	color: #b42318;
}

.edit-bar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin: 12px 0 4px;
	padding: 8px 12px;
	border: 2px dashed #9db5ef;
	border-radius: 10px;
	background: #f3f6fe;
	font-family: system-ui, sans-serif;
}

.edit-bar button {
	padding: 4px 10px;
	font-size: 15px;
}

.edit-bar .section-name {
	font-weight: bold;
}

.edit-bar .shared {
	font-size: 14px;
	color: #555;
}

.edit-bar .spacer,
.dialog .spacer {
	flex: 1;
}

.page-bar {
	background: #fff8db;
	border-color: #e6cf5a;
}

.add-existing {
	font: 15px system-ui, sans-serif;
	padding: 4px 8px;
	border-radius: 8px;
	max-width: 100%;
}

.link-tools {
	display: flex;
	justify-content: center;
	gap: 4px;
	margin-top: 6px;
}

.link-tools button {
	padding: 2px 8px;
	font-size: 14px;
}

.add-link {
	align-self: center;
	margin: 5px 20px;
	width: 180px;
	height: 200px;
	border: 2px dashed #9db5ef;
	background: #f3f6fe;
	font-size: 18px;
}

.dialog fieldset {
	border: 1px solid #ddd;
	border-radius: 8px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
}

.dialog legend {
	font-size: 15px;
	font-weight: 600;
}

.dialog label.checkbox {
	flex-direction: row;
	align-items: center;
	gap: 6px;
	font-weight: normal;
}

.link-dialog {
	width: min(560px, calc(100vw - 32px));
}

.picture-field {
	display: flex;
	gap: 12px;
	align-items: flex-start;
}

.picture-preview {
	flex: none;
	width: 140px;
	height: 120px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f4f4f4;
	border-radius: 8px;
	color: #888;
	font-size: 14px;
}

.picture-preview img {
	max-width: 140px;
	max-height: 120px;
	height: auto;
}

.picture-inputs {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.dialog label.upload input {
	font-size: 14px;
	padding: 4px;
}
