/**
 * Mt. Hermon Bulletin Board
 *
 * Rendered directly into the page - no iframe, so nothing needs to measure
 * or resize itself. Columns are balanced by CSS multi-column layout, which
 * fills to equal height on its own.
 */

.mthbb {
	--mthbb-cork: #c69a5f;
	--mthbb-frame: #1b3a52;
	--mthbb-ink: #16324a;
	--mthbb-body: #3c4753;
	--mthbb-muted: #6d7683;
	--mthbb-brass: #a9803a;
	--mthbb-max: 1160px;
	max-width: var(--mthbb-max);
	margin: 0 auto;
	font-family: Bitter, Georgia, serif;
	color: var(--mthbb-body);
	font-size: 15px;
	line-height: 1.55;
	box-sizing: border-box;
}
.mthbb *, .mthbb *::before, .mthbb *::after { box-sizing: inherit; }
.mthbb .screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Header */
.mthbb-head {
	display: flex; align-items: flex-start; justify-content: space-between;
	gap: 20px; flex-wrap: wrap; margin-bottom: 18px;
}
.mthbb-eyebrow {
	margin: 0 0 2px; font-family: Caveat, cursive; font-size: 15px;
	font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
	color: var(--mthbb-brass);
}
.mthbb-title {
	margin: 0 0 6px; font-family: Bitter, Georgia, serif;
	font-size: clamp(26px, 3.4vw, 34px); font-weight: 700;
	line-height: 1.15; color: var(--mthbb-ink);
}
.mthbb-sub { margin: 0; max-width: 46ch; font-size: 14.5px; color: var(--mthbb-muted); }

/* Buttons */
.mthbb-btn {
	display: inline-flex; align-items: center; gap: 7px; padding: 11px 20px;
	border: 1px solid transparent; border-radius: 999px;
	font-family: Bitter, Georgia, serif; font-size: 14px; font-weight: 600;
	line-height: 1; cursor: pointer;
	transition: background-color 0.15s ease, transform 0.1s ease;
}
.mthbb-btn--primary {
	background: var(--mthbb-frame); color: #fff;
	box-shadow: 0 2px 8px rgba(20, 40, 58, 0.25);
}
.mthbb-btn--primary:hover, .mthbb-btn--primary:focus-visible {
	background: #16324a; transform: translateY(-1px);
}
.mthbb-btn--ghost { background: transparent; border-color: #c8ccd2; color: var(--mthbb-body); }
.mthbb-btn--ghost:hover, .mthbb-btn--ghost:focus-visible { background: #eef0f3; }
.mthbb-btn__icon { font-size: 13px; }
.mthbb :is(button, input, textarea, select):focus-visible {
	outline: 3px solid #7aa7c7; outline-offset: 2px;
}

/* Notices */
.mthbb-notice {
	margin: 0 0 18px; padding: 14px 18px; border-radius: 10px;
	border-left: 5px solid; font-size: 14.5px;
}
.mthbb-notice strong { display: block; margin-bottom: 2px; }
.mthbb-notice--ok { background: #e8f2e9; border-color: #4a7d4f; color: #23472a; }
.mthbb-notice--bad { background: #fbeceb; border-color: #9c463c; color: #6b2c25; }

/* Filters and search */
.mthbb-tools {
	display: flex; align-items: center; justify-content: space-between;
	gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
}
.mthbb-filters { display: flex; flex-wrap: wrap; gap: 7px; }
.mthbb-chip {
	padding: 7px 15px; border: 1px solid #d3d7dd; border-radius: 999px;
	background: #fff; font-family: Bitter, Georgia, serif; font-size: 13px;
	font-weight: 600; color: var(--mthbb-body); cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.mthbb-chip:hover { border-color: var(--mthbb-frame); }
.mthbb-chip.is-active {
	background: var(--mthbb-frame); border-color: var(--mthbb-frame); color: #fff;
}
.mthbb-search input {
	width: min(280px, 60vw); padding: 9px 16px; border: 1px solid #d3d7dd;
	border-radius: 999px; background: #fff;
	font-family: Bitter, Georgia, serif; font-size: 14px; color: var(--mthbb-body);
}

/* Form */
.mthbb-form {
	margin: 0 0 20px; padding: 22px 24px; background: #fff;
	border: 1px solid #e2e5e9; border-radius: 14px;
	box-shadow: 0 6px 20px rgba(20, 40, 58, 0.07);
}
.mthbb-form[hidden] { display: none; }
.mthbb-form__head {
	display: flex; align-items: baseline; justify-content: space-between;
	gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.mthbb-form__title {
	margin: 0; font-family: Bitter, Georgia, serif; font-size: 18px;
	font-weight: 700; color: var(--mthbb-ink);
}
.mthbb-form__hint {
	margin: 0; font-family: Caveat, cursive; font-size: 16px; color: var(--mthbb-brass);
}
.mthbb-form__hp {
	position: absolute !important; left: -9999px !important;
	width: 1px; height: 1px; overflow: hidden;
}
.mthbb-form__cats {
	margin: 0 0 14px; padding: 0; border: 0;
	display: flex; flex-wrap: wrap; gap: 7px;
}
.mthbb-radio { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mthbb-chip--radio { display: inline-block; user-select: none; }
.mthbb-radio:checked + .mthbb-chip--radio {
	background: var(--mthbb-frame); border-color: var(--mthbb-frame); color: #fff;
}
.mthbb-radio:focus-visible + .mthbb-chip--radio {
	outline: 3px solid #7aa7c7; outline-offset: 2px;
}
.mthbb-field { margin: 0 0 12px; }
.mthbb-field input[type="text"], .mthbb-field textarea {
	width: 100%; padding: 11px 15px; border: 1px solid #d3d7dd;
	border-radius: 10px; font-family: Bitter, Georgia, serif;
	font-size: 15px; color: var(--mthbb-body); background: #fff;
}
.mthbb-field textarea { resize: vertical; min-height: 96px; }
.mthbb-form__foot {
	display: flex; align-items: center; justify-content: space-between;
	gap: 14px; flex-wrap: wrap; margin-top: 4px;
}
.mthbb-field--name { margin: 0; flex: 1 1 200px; max-width: 260px; }
.mthbb-form__actions { display: flex; gap: 10px; margin-left: auto; }

/* Cork board */
.mthbb-cork {
	position: relative; padding: 22px; border: 12px solid var(--mthbb-frame);
	border-radius: 9px; background-color: var(--mthbb-cork);
	background-image:
		radial-gradient(circle at 15% 25%, rgba(90, 55, 15, 0.10) 1.5px, transparent 2px),
		radial-gradient(circle at 65% 70%, rgba(90, 55, 15, 0.08) 1.5px, transparent 2px),
		radial-gradient(circle at 40% 90%, rgba(90, 55, 15, 0.07) 1.5px, transparent 2px),
		radial-gradient(circle at 85% 15%, rgba(90, 55, 15, 0.09) 1.5px, transparent 2px);
	background-size: 46px 46px, 62px 62px, 38px 38px, 54px 54px;
	box-shadow:
		0 18px 40px rgba(20, 40, 58, 0.3),
		inset 0 0 0 2px rgba(0, 0, 0, 0.18),
		inset 0 0 0 3px rgba(176, 128, 58, 0.45);
}

/*
 * Balanced masonry. CSS multi-column distributes content to equal column
 * heights on its own, which is what the old build got wrong - it chunked
 * notes by index (3/3/4) and left a third of the board empty.
 */
.mthbb-grid { column-count: 3; column-gap: 20px; }
.mthbb-note {
	display: inline-block; width: 100%; margin: 0 0 20px;
	break-inside: avoid; page-break-inside: avoid;
	-webkit-column-break-inside: avoid;
	position: relative; padding-top: 10px;
}
.mthbb-note[hidden] { display: none; }
.mthbb-note__inner {
	position: relative; padding: 20px 20px 16px;
	background: var(--mthbb-paper, #f4f1ea); border-radius: 3px;
	box-shadow: 0 6px 14px rgba(30, 20, 5, 0.22), 0 1px 2px rgba(30, 20, 5, 0.18);
}
.mthbb-note:nth-child(4n + 1) .mthbb-note__inner { transform: rotate(-0.5deg); }
.mthbb-note:nth-child(4n + 2) .mthbb-note__inner { transform: rotate(0.6deg); }
.mthbb-note:nth-child(4n + 3) .mthbb-note__inner { transform: rotate(-0.35deg); }
.mthbb-note:nth-child(4n + 4) .mthbb-note__inner { transform: rotate(0.4deg); }
.mthbb-pin {
	position: absolute; top: 0; left: 50%; transform: translateX(-50%);
	width: 15px; height: 15px; border-radius: 50%;
	background:
		radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.85) 0 18%, transparent 42%),
		var(--mthbb-pin, #1b3a52);
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4); z-index: 2;
}
.mthbb-tab {
	display: inline-block; margin-bottom: 9px; padding: 3px 10px;
	border-radius: 999px; background: var(--mthbb-tab, #1b3a52); color: #fff;
	font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em;
	text-transform: uppercase;
}
.mthbb-note__title {
	margin: 0 0 8px; font-family: Caveat, cursive; font-size: 24px;
	font-weight: 700; line-height: 1.15; color: var(--mthbb-ink);
}
.mthbb-note__body {
	font-size: 14.5px; color: var(--mthbb-body); overflow-wrap: break-word;
}
.mthbb-note__body p { margin: 0 0 0.85em; }
.mthbb-note__body p:last-child { margin-bottom: 0; }
.mthbb-note__body.is-clamped {
	max-height: 300px; overflow: hidden;
	-webkit-mask-image: linear-gradient(#000 76%, transparent 100%);
	mask-image: linear-gradient(#000 76%, transparent 100%);
}
.mthbb-more {
	margin-top: 8px; padding: 0; border: 0; background: none;
	font-family: Bitter, Georgia, serif; font-size: 13.5px; font-weight: 700;
	color: var(--mthbb-tab, #1b3a52); text-decoration: underline; cursor: pointer;
}
.mthbb-note__foot {
	display: flex; align-items: baseline; justify-content: space-between;
	gap: 12px; margin-top: 14px; padding-top: 10px;
	border-top: 1px dashed rgba(0, 0, 0, 0.16); font-size: 12.5px;
}
.mthbb-note__author {
	font-family: Caveat, cursive; font-size: 16px; color: var(--mthbb-muted);
}
.mthbb-note__date { color: var(--mthbb-muted); white-space: nowrap; }
.mthbb-empty, .mthbb-noresults {
	margin: 0; padding: 46px 20px; text-align: center;
	font-family: Caveat, cursive; font-size: 22px; color: #5b4526;
}
.mthbb-noresults[hidden] { display: none; }
.mthbb-count {
	margin: 14px 0 0; text-align: center; font-size: 13px; color: var(--mthbb-muted);
}

/* Dialog */
.mthbb-dialog {
	width: min(620px, 92vw); padding: 0; border: 0; border-radius: 12px;
	background: var(--mthbb-paper, #f4f1ea);
	box-shadow: 0 24px 60px rgba(20, 40, 58, 0.4);
	color: var(--mthbb-body); font-family: Bitter, Georgia, serif;
}
.mthbb-dialog::backdrop { background: rgba(16, 30, 42, 0.6); }
.mthbb-dialog__inner { padding: 26px 28px 24px; max-height: 78vh; overflow-y: auto; }
.mthbb-dialog__close {
	position: absolute; top: 12px; right: 14px; width: 32px; height: 32px;
	border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.08);
	font-size: 18px; line-height: 1; color: var(--mthbb-ink); cursor: pointer;
}
.mthbb-dialog__close:hover { background: rgba(0, 0, 0, 0.16); }

/* Responsive */
@media (max-width: 1000px) { .mthbb-grid { column-count: 2; } }
@media (max-width: 640px) {
	.mthbb-grid { column-count: 1; }
	.mthbb-cork { padding: 14px; border-width: 8px; }
	.mthbb-head { flex-direction: column; }
	.mthbb-tools { flex-direction: column; align-items: stretch; }
	.mthbb-search input { width: 100%; }
	.mthbb-form__foot { flex-direction: column; align-items: stretch; }
	.mthbb-field--name { max-width: none; }
	.mthbb-form__actions { margin-left: 0; }
	.mthbb-form__actions .mthbb-btn { flex: 1; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
	.mthbb * { transition: none !important; }
	.mthbb-note__inner { transform: none !important; }
}
@media print {
	.mthbb-tools, .mthbb-form, .mthbb-head .mthbb-btn, .mthbb-more { display: none !important; }
	.mthbb-cork { border: 1px solid #999; background: none; box-shadow: none; }
	.mthbb-note__inner { transform: none !important; box-shadow: none; border: 1px solid #ccc; }
}
/*
 * JS-driven masonry. When board.js runs it moves each note into whichever
 * column is currently shortest, which balances far better than multi-column
 * can around blocks that must not be split. Without JS the column-count
 * rules above still apply, so the board degrades cleanly.
 */
.mthbb-grid.is-js {
	column-count: auto;
	display: flex;
	align-items: flex-start;
	gap: 0 20px;
}
.mthbb-col {
	flex: 1 1 0;
	min-width: 0;
}
.mthbb-grid.is-js .mthbb-note {
	display: block;
}
/* Must out-specify the rule above, or filtered-out notes keep their box. */
.mthbb-grid.is-js .mthbb-note[hidden] {
	display: none;
}