/*
 * Home page sections (they are also used on other pages: tiles, text + photo, quotes).
 */

/* Featured (pinned) posts: hidden completely when no post is marked as sticky. */
.polecany-wpis:not(:has(.wp-block-post)) {
	display: none;
}

.polecany-wpis:not(:has(.wp-block-post)) + * {
	margin-block-start: 0;
}

.polecany-wpis__tekst {
	flex: 1 1 20rem;
	min-width: 0;
}

/* "Termin wydarzenia" (field in the post editor): small red capitals with a calendar icon
   (look: podstawy.css, small labels). Hidden when the post has none.
   The icon sits in the first line of text (also when a long date wraps on phones).
   -0.35em puts its middle on the middle of the capital letters:
   (cap height 0.656em of Source Sans 3 − icon 1.35em) / 2. Change both together. */
.termin-wydarzenia::before {
	content: "";
	display: inline-block;
	width: 1.35em;
	height: 1.35em;
	margin-inline-end: var(--wp--preset--spacing--x-small);
	vertical-align: -0.35em;
	background: currentColor;
	mask: url("../icons/calendar_month.svg") center / contain no-repeat;
}

.termin-wydarzenia:empty {
	display: none;
}

/* Cards side by side, both as tall as the taller one; the buttons / PDF link sit at the
   bottom of the card. Home page (announcements + plan) and "rowne-kolumny" anywhere else
   (e.g. Msze i nabożeństwa: Mass times + plan). */
.rowne-kolumny > .wp-block-column,
.aktualne-kolumny > .wp-block-column,
.aktualne-kolumny .najnowsze-ogloszenia,
.aktualne-kolumny .najnowsze-ogloszenia :is(.wp-block-post-template, .wp-block-post, .wp-block-query-no-results) {
	display: flex;
	flex-direction: column;
}

.rowne-kolumny > .wp-block-column > *,
.aktualne-kolumny > .wp-block-column > *,
.aktualne-kolumny .najnowsze-ogloszenia :is(.wp-block-post-template, .wp-block-query-no-results, .wp-block-post, .is-style-karta) {
	flex: 1 1 auto;
}

.aktualne-kolumny .najnowsze-ogloszenia .is-style-karta > :last-child,
:is(.aktualne-kolumny, .rowne-kolumny) .plan-tygodnia__action {
	margin-top: auto;
}

.link-archiwum a {
	color: var(--wp--preset--color--muted);
}

/* Sunday Mass times (synced pattern "Godziny Mszy – niedziela"): in the dark strip below the
   announcements: label, times (taking the free space), link. */
.msze-godziny {
	font-weight: 600; /* see the times in rozklady.css */
	line-height: var(--wp--custom--line-height--body);
}

.msze-pasek .msze-godziny {
	flex: 1 1 auto;
	margin: 0;
}

.is-style-karta-ciemna .msze-godziny {
	color: var(--wp--preset--color--surface);
	font-size: var(--wp--preset--font-size--medium);
}

/* Text + photo sections: a column whose photo is still missing disappears,
   so the text uses the full width until a photo is added. */
.tekst-z-obrazem > .wp-block-column:not(:has(*)) {
	display: none;
}

.tekst-z-obrazem:has(> .wp-block-column:not(:has(*))) > .wp-block-column {
	max-width: var(--wp--style--global--content-size);
}

/* Centred quotes */
.cytat .wp-block-pullquote {
	max-width: var(--wp--style--global--content-size);
	text-align: center;
}

.is-style-karta-ciemna .wp-block-pullquote {
	color: var(--wp--preset--color--base);
}

.is-style-karta-ciemna .wp-block-pullquote cite {
	color: var(--wp--preset--color--accent-on-dark);
}

/* "Kafelek z linkiem" (paragraph style): the whole tile is the link, with an arrow on the
   right ("Często szukane" on the home page, 404 page). */
.is-style-kafelek {
	margin: 0;
}

.is-style-kafelek a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--medium);
	min-height: 4rem;
	padding: var(--wp--preset--spacing--medium) var(--wp--preset--spacing--large);
	border: 1px solid var(--wp--preset--color--border-light);
	border-radius: var(--wp--preset--border-radius--medium);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--ink);
	font-weight: 600;
	line-height: var(--wp--custom--line-height--snug);
	text-decoration: none;
}

.is-style-kafelek a::after {
	content: "→";
	flex: none;
	color: var(--wp--preset--color--accent);
}

.is-style-kafelek a:hover {
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent);
}
