/* Block styles “Cards” and “Link cards” (columns): white boxes with a fine
   frame, their text, how many sit in a row and how their parts line up.
   Moved out of sections.css on 2026-10-20 to keep files small.
   Part of the RUB Chair theme. */

/* Block style “Cards” and “Link cards” (columns): white boxes with a fine
   frame, e.g. the contact persons. Corners 12px (components.css). The professorship cards
   are Hellblau teasers instead (components-professorships.css). */
.is-style-rub-cards .wp-block-column,
.is-style-rub-link-cards .wp-block-column {
	background-color: #fff;
	border: 1px solid var(--rub-frame);
	padding: var(--wp--preset--spacing--40);
}

/* Text in cards as the library's teasers: Body Small 16/24 (an e-mail address
   then fits a card on a 320px phone). */
:is(.is-style-rub-cards, .is-style-rub-link-cards) > .wp-block-column :is(p, li) {
	font-size: 1rem;
	line-height: 1.5rem;
}

/* Three cards or more in a row: two per row below 1180px (tablets, small
   laptops), otherwise an e-mail address would break in the middle. */
@media (min-width: 782px) and (max-width: 1179.98px) {
	.wp-block-columns:is(.is-style-rub-cards, .is-style-rub-link-cards):has(> .wp-block-column:nth-child(3)) {
		flex-wrap: wrap !important;
	}

	:is(.is-style-rub-cards, .is-style-rub-link-cards):has(> .wp-block-column:nth-child(3)) > .wp-block-column {
		box-sizing: border-box;
		flex-basis: calc(50% - var(--wp--style--block-gap, 1.5rem)) !important;
		flex-grow: 1;
	}
}

/* Contact cards side by side line up inside: role, name and contact lines
   start at the same height in every card, even when one name needs two lines
   (subgrid: the cards share the rows of their row). Only rows of cards with
   small labels (roles), built alike – cards built differently would line up
   row by row and get gaps. (:has() may not be nested, so “every card” cannot
   be asked.) */
@media (min-width: 1180px) {
	.wp-block-columns.is-style-rub-cards:not(.rub-professorships):has(.rub-eyebrow) {
		display: grid;
		grid-auto-columns: minmax(0, 1fr);
		grid-auto-flow: column;
		grid-template-rows: repeat(6, auto);
		row-gap: 0 !important;
	}

	.is-style-rub-cards:not(.rub-professorships):has(.rub-eyebrow) > .wp-block-column {
		display: grid;
		grid-row: span 6;
		grid-template-rows: subgrid;
		align-content: start;
	}

	/* A plain group around a card's content (e.g. on Contact) takes part, too. */
	.is-style-rub-cards:not(.rub-professorships):has(.rub-eyebrow) > .wp-block-column > .wp-block-group:only-child:not([class*="is-style-"]) {
		display: contents;
	}
}
