/*
 * Structure for the components Berge Core renders.
 *
 * Layout only - what the boxes are made of, not what they look like. These
 * rules belong to the plugin because the markup does: a theme that only wrote
 * colours would otherwise inherit an unstyled ordered list where the events
 * box should be, which is exactly what happened when the second design was
 * switched on.
 *
 * Themes override colour, type and spacing on top of this.
 */

/* ---------------------------------------------------------------------------
   "Was kommt als Nächstes" - the front page's events box.

   Full width at the top, but capped in height: it answers one question at a
   glance and keeps the rest a flick away instead of pushing the page down.
   --------------------------------------------------------------------------- */

.berge-next {
	background: #fff;
	border: 1px solid var(--berge-rule);
	border-top: 4px solid var(--berge-green);
	padding: 1.4em 1.6em 1.1em;
	margin-bottom: 2.5em;
}

.berge-next__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5em 1em;
	margin-bottom: 0.9em;
}

.berge-next__title {
	margin: 0;
	font-size: 1.5rem;
	color: #000;
}

.berge-next__all {
	font-weight: 600;
	white-space: nowrap;
}

.berge-next__list {
	list-style: none;
	margin: 0;
	padding: 0;

	/* Roughly four entries stay visible; the rest scrolls inside the box. */
	max-height: 21em;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.berge-next__item {
	display: flex;
	align-items: flex-start;
	gap: 1em;
	padding: 0.7em 0.2em;
	border-bottom: 1px solid var(--berge-rule);
}

.berge-next__item:last-child {
	border-bottom: 0;
}

.berge-next__date {
	flex: 0 0 3.4em;
	display: flex;
	flex-direction: column;
	align-items: center;
	line-height: 1.1;
	padding: 0.35em 0;
	background: var(--berge-green);
	color: #fff;
	border-radius: 3px;
}

.berge-next__day {
	font-size: 1.35rem;
	font-weight: 700;
}

.berge-next__month {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.berge-next__year {
	font-size: 0.65rem;
	opacity: 0.85;
}

.berge-next__body {
	min-width: 0;
}

.berge-next__link {
	display: block;
	font-weight: 600;
	color: #000;
	line-height: 1.3;
}

.berge-next__link:hover {
	color: var(--berge-green-dark);
}

.berge-next__meta {
	margin: 0.15em 0 0;
	font-size: 0.85rem;
	color: #5c5c5c;
}

.berge-next__subscribe {
	margin: 0.9em 0 0;
	font-size: 0.85rem;
}

.berge-next__empty {
	margin: 0;
	color: #5c5c5c;
}

@media (max-width: 480px) {
	.berge-next {
		padding: 1.1em 1em 0.9em;
	}

	.berge-next__list {
		max-height: 17em;
	}
}

/* The Abteilungen entry keeps its place in the first row as the label for the
   row below, but its dropdown would now duplicate that row. */
@media (min-width: 769px) {
	.main-navigation .menu-item-berge-departments > .sub-menu {
		display: none;
	}

	.main-navigation .menu-item-berge-departments > a .dropdown-menu-toggle {
		display: none;
	}

	.main-navigation .menu-item-berge-departments > a {
		cursor: default;
	}
}

/* The Abteilungen entry is only a hook for the row below - the row speaks for
   itself, so the label is dropped from the first line on wide screens. The
   mobile menu keeps it, because there the branch is nested underneath it. */
@media (min-width: 769px) {
	/* GeneratePress lays these out with
	   `.nav-aligned-center .main-navigation:not(.toggled) .menu>li{display:inline-block}`
	   at specificity 0,4,1. This selector reaches 0,5,1 without depending on
	   which alignment is configured. */
	.main-navigation:not(.toggled) .main-nav .menu > li.berge-hide-in-primary {
		display: none;
	}
}

/* ---------------------------------------------------------------------------
   Membership application form and the sheet it produces.
   --------------------------------------------------------------------------- */

.berge-form fieldset {
	border: 1px solid var(--berge-rule);
	padding: 1.1em 1.3em 0.6em;
	margin: 0 0 1.4em;
}

.berge-form legend {
	padding: 0 0.5em;
	font-weight: 700;
	color: #000;
}

.berge-form__row {
	margin: 0 0 1em;
}

.berge-form__row label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.25em;
}

.berge-form__row input[type="text"],
.berge-form__row input[type="email"],
.berge-form__row input[type="tel"],
.berge-form__row input[type="date"] {
	width: 100%;
	max-width: 30rem;
}

.berge-form__check {
	display: flex;
	gap: 0.65em;
	align-items: flex-start;
	font-weight: 400;
}

.berge-form__check input {
	margin-top: 0.3em;
	flex: 0 0 auto;
}

.berge-form__row--error input {
	border-color: #b32d2e;
}

.berge-form__error {
	display: block;
	margin-top: 0.25em;
	color: #b32d2e;
	font-size: 0.88rem;
}

.berge-form__error--top {
	padding: 0.7em 0.9em;
	border-left: 4px solid #b32d2e;
	background: #fdf3f3;
}

.berge-form__hint,
.berge-form__note {
	font-size: 0.88rem;
	color: #5c5c5c;
}

.berge-form__note {
	border-left: 4px solid var(--berge-green);
	padding: 0.7em 0.9em;
	background: #f4faf7;
}

/* Visible only to bots that fill in everything they can find. */
.berge-form__trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.berge-sheet {
	border: 1px solid var(--berge-rule);
	padding: 1.6em;
	background: #fff;
}

.berge-sheet__table {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 1.2em;
}

.berge-sheet__table th,
.berge-sheet__table td {
	border-bottom: 1px solid var(--berge-rule);
	padding: 0.5em 0.3em;
	text-align: left;
	vertical-align: bottom;
}

.berge-sheet__table th {
	width: 38%;
	font-weight: 600;
}

.berge-sheet__table--blank td {
	height: 2.4em;
}

.berge-sheet__small {
	font-size: 0.8rem;
	line-height: 1.45;
	color: #444;
}

.berge-sheet__sign {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0.4em 1.2em;
	margin: 2em 0 1.4em;
	font-size: 0.85rem;
}

.berge-sheet__line {
	display: inline-block;
	width: 8em;
	border-bottom: 1px solid #333;
	height: 1.8em;
}

.berge-sheet__line--wide {
	width: 16em;
}

@media print {
	.no-print,
	.top-bar,
	.site-header,
	.main-navigation,
	.berge-subnav,
	.site-footer,
	#cookie-law-info-bar {
		display: none !important;
	}

	.berge-sheet {
		border: 0;
		padding: 0;
	}
}

/* The measure cap is meant for prose. On a page that is mostly a form or a
   printable sheet it only makes the intro look indented next to full-width
   blocks, so it steps aside there. */
.no-sidebar .entry-content:has(.berge-form) > p,
.no-sidebar .entry-content:has(.berge-print) > p {
	max-width: none;
}

/* ---------------------------------------------------------------------------
   News section: Instagram feed, or the site's own posts standing in for it.

   Both are styled the same on purpose - a reader should not be able to tell
   which one they are looking at, and the page must not change shape when the
   feed lapses.
   --------------------------------------------------------------------------- */

.berge-news__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 1.6em;
}

.berge-news__item {
	border: 1px solid var(--berge-rule);
	background: #fff;
}

.berge-news__link {
	display: grid;
	grid-template-columns: minmax(0, 12rem) minmax(0, 1fr);
	gap: 0 1.2em;
	color: inherit;
	text-decoration: none;
}

.berge-news__link:hover .berge-news__title,
.berge-news__link:focus-visible .berge-news__title {
	color: var(--berge-green-dark);
}

.berge-news__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	aspect-ratio: 4 / 3;
}

.berge-news__body {
	padding: 1em 1.2em 1.1em 0;
	min-width: 0;
}

.berge-news__title {
	margin: 0;
	font-size: 1.15rem;
	line-height: 1.3;
	color: #000;
}

.berge-news__meta {
	margin: 0.25em 0 0.5em;
	font-size: 0.82rem;
	color: #5c5c5c;
}

.berge-news__excerpt {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.5;
}

@media (max-width: 600px) {
	.berge-news__link {
		grid-template-columns: 1fr;
	}

	.berge-news__body {
		padding: 1em 1.1em 1.1em;
	}

	.berge-news__media img {
		aspect-ratio: 16 / 9;
	}
}

/* Without an image there is no media column to reserve - otherwise the text
   is squeezed into the narrow half that was meant for a picture. */
.berge-news__link--textonly {
	grid-template-columns: 1fr;
}

.berge-news__link--textonly .berge-news__body {
	padding: 1em 1.2em 1.1em;
}
