/*
Theme Name: Narwik
Description: Motyw strony Zespołu Szkół im. Bohaterów Narwiku. Sześć wyglądów strony głównej do wyboru jednym przyciskiem.
Version: 0.9.0
Requires at least: 6.6
Requires PHP: 8.1
Text Domain: narwik
License: GPL-2.0-or-later
*/

:root {
	--gutter: clamp(16px, 4vw, 40px);
	--section: clamp(48px, 5vw, 72px);
	--tap: 48px;
	--radius-sm: 4px;
	--radius-md: 8px;
	--shadow-card: 0 1px 2px rgb(23 32 54 / 0.08), 0 4px 16px rgb(23 32 54 / 0.06);
	--shadow-raised: 0 2px 4px rgb(23 32 54 / 0.1), 0 12px 32px rgb(23 32 54 / 0.1);
	--ease: cubic-bezier(0.2, 0.6, 0.2, 1);
	--navy: var(--wp--preset--color--navy);
	--navy-dark: var(--wp--preset--color--navy-dark);
	--navy-light: var(--wp--preset--color--navy-light);
	--line: var(--wp--preset--color--line);
	--red: var(--wp--preset--color--red);
	--red-dark: var(--wp--preset--color--red-dark);
	--gold: var(--wp--preset--color--gold);
	--ink: var(--wp--preset--color--ink);
	--muted: var(--wp--preset--color--ink-muted);
	--white: var(--wp--preset--color--white);
	--font-display: var(--wp--preset--font-family--display);
	--page-bg: var(--white);
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-padding-bottom: 80px;
}

/* Header, page and footer follow each other with no white strip between them. */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* On a short page the footer still ends at the bottom of the window. */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
}

.wp-site-blocks > main {
	flex: 1 0 auto;
}

/* Also images placed inside a paragraph or a link. */
img {
	max-width: 100%;
	height: auto;
}

h1,
h2,
h3 {
	text-wrap: balance;
}

a {
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

a:hover {
	text-decoration-thickness: 2px;
}

/* Two-tone ring: visible on white, navy and photos alike. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--navy-dark);
	outline-offset: 2px;
	box-shadow: 0 0 0 5px var(--white);
}

.skip-link.screen-reader-text:focus {
	background: var(--navy-dark);
	color: var(--gold);
	font-family: var(--font-display);
	font-size: 18px;
	padding: 12px 20px;
}

.wp-element-button,
.wp-block-button__link {
	min-height: var(--tap);
	display: inline-flex;
	align-items: center;
	transition: background-color 150ms var(--ease);
}

/* Red stays for the main action (Rekrutacja, the home page); buttons in page text and the search button are quieter. */
:is(.wp-block-post-content, .wp-block-search) :is(.wp-block-button__link, .wp-element-button):not(.has-background) {
	color: var(--navy);
	background: transparent;
	border: 2px solid var(--navy);
}

:is(.wp-block-post-content, .wp-block-search) :is(.wp-block-button__link, .wp-element-button):not(.has-background):hover {
	color: var(--white);
	background: var(--navy);
}

/* Header */

/* The header's menus open over the page title and the photo below it. */
.site-header {
	position: relative;
	z-index: 10;
}

.site-header__actions {
	gap: 8px;
}

/* GTranslate's floating button; the language list in the header drives the same translation. */
.gtranslate_wrapper {
	display: none;
}

.language-switcher {
	position: relative;
}

.language-switcher__toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: var(--tap);
	padding: 0 12px;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: var(--white);
	color: var(--navy-dark);
	font-family: var(--font-display);
	font-size: 16px;
	font-weight: 600;
	letter-spacing: 0.04em;
	cursor: pointer;
	transition: background-color 150ms var(--ease), border-color 150ms var(--ease);
}

.language-switcher__toggle:hover {
	border-color: var(--navy);
	background: var(--navy-light);
}

.language-switcher__toggle::after {
	content: "";
	width: 7px;
	height: 7px;
	margin: 0 2px 4px 2px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
}

.language-switcher__toggle[aria-expanded="true"]::after {
	margin-bottom: 0;
	transform: rotate(-135deg);
}

.language-switcher__list {
	position: absolute;
	z-index: 3;
	top: calc(100% + 8px);
	left: 0;
	min-width: 200px;
	margin: 0;
	padding: 8px 0;
	list-style: none;
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-raised);
}

.language-switcher__list button {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	width: 100%;
	min-height: 44px;
	padding: 0 16px;
	border: 0;
	background: none;
	color: var(--ink);
	font: inherit;
	font-size: 17px;
	text-align: left;
	cursor: pointer;
}

.language-switcher__list button:hover {
	background: var(--navy-light);
}

.language-switcher__list button[aria-current="true"] {
	color: var(--navy-dark);
	font-weight: 700;
}

.language-switcher__list button[aria-current="true"]::after {
	content: "✓";
}

.site-utility {
	font-size: var(--wp--preset--font-size--meta);
}

.site-utility a {
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	min-height: 40px;
}

.site-utility a:hover {
	text-decoration: underline;
}

/* The school's social profiles in the header bar and the footer, in the colour of the text around them. */
.wp-block-social-links.social {
	gap: 0;
	margin: 0;
	padding: 0;
}

.wp-block-social-links.is-style-logos-only.social .wp-social-link {
	color: inherit;
}

.wp-block-social-links.social .wp-social-link a {
	display: grid;
	place-items: center;
	min-width: var(--tap);
	min-height: var(--tap);
	padding: 0;
}

.wp-block-social-links.social .wp-social-link svg {
	width: 24px;
	height: 24px;
}

.site-utility .wp-block-social-links.social .wp-social-link a {
	min-width: 40px;
	min-height: 40px;
}

.site-utility .wp-block-social-links.social .wp-social-link svg {
	width: 18px;
	height: 18px;
}

.site-footer .wp-block-social-links.social {
	margin: 16px 0 0 -12px;
}

.site-header__main {
	border-bottom: 1px solid var(--line);
}

.site-brand {
	text-decoration: none;
	display: flex;
	align-items: center;
	gap: 12px;
	color: var(--navy-dark);
}

.site-brand img {
	width: 48px;
	height: 48px;
}

.site-brand__name {
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 17px;
	line-height: 1.15;
}

.site-brand__name span {
	display: block;
	font-weight: 500;
}

.site-header .wp-block-navigation {
	font-size: 18px;
}

.site-header .wp-block-navigation-item__content {
	min-height: var(--tap);
	display: inline-flex;
	align-items: center;
	text-decoration: none;
}

.site-header .wp-block-navigation .wp-block-navigation__submenu-container {
	border: 1px solid var(--line);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-raised);
	padding: 8px 0;
	min-width: 260px;
	font-size: 17px;
}

/* The three right-most menus open their second level to the left, so it stays on screen from 960 px up (the open phone menu is a plain list). */
.site-header .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item:nth-last-child(-n + 3) .wp-block-navigation__submenu-container .wp-block-navigation__submenu-container {
	left: auto;
	right: 100%;
}

/* The two right-most menus open their list from their right edge, so it stays on screen on tablets. */
.site-header .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item:nth-last-child(-n + 2) > .wp-block-navigation__submenu-container {
	left: auto;
	right: 0;
}

.site-header .wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 10px 16px;
	min-height: 44px;
}

.site-header .wp-block-navigation__responsive-container-open,
.site-header .wp-block-navigation__responsive-container-close {
	min-width: var(--tap);
	min-height: var(--tap);
	justify-content: center;
	align-items: center;
}

@media (min-width: 960px) {
	.site-brand img {
		width: 64px;
		height: 64px;
	}

	/* A list of nine or more items takes two columns, so it ends above the bottom of a laptop screen. */
	.site-header .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation__submenu-container:has(> :nth-child(9)) {
		display: grid;
		grid-template-columns: repeat(2, minmax(200px, 1fr));
	}

	/* In two columns the next level opens beside the whole list, never over its other column: left column to the left, right column to the right. */
	.site-header .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation__submenu-container:has(> :nth-child(9)) > .wp-block-navigation-item:nth-child(odd) > .wp-block-navigation__submenu-container {
		left: auto;
		right: 100%;
	}

	.site-header .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation__submenu-container:has(> :nth-child(9)) > .wp-block-navigation-item:nth-child(even) > .wp-block-navigation__submenu-container {
		left: 100%;
		right: auto;
	}
}

/* Below 1280 px there is no room on the right, so the right column's next level opens under its item. */
@media (min-width: 960px) and (max-width: 1279px) {
	.site-header .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation__submenu-container:has(> :nth-child(9)) > .wp-block-navigation-item:nth-child(even) > .wp-block-navigation__submenu-container {
		top: 100%;
		left: 0;
	}
}

@media (max-width: 599px) {
	.site-brand__name {
		font-size: 14px;
	}

	.site-header__actions {
		gap: 4px;
	}

	.language-switcher__toggle {
		justify-content: center;
		min-width: 44px;
		padding: 0;
		border-color: transparent;
	}

	.language-switcher__code,
	.language-switcher__toggle::after {
		display: none;
	}

	.site-header__cta .wp-block-button__link {
		padding: 10px 14px;
		font-size: 16px;
		min-height: 44px;
	}
}

/* Hidden from sight only on the narrowest phones (the students look keeps it on the photo): screen readers still read the school's name in the home link. */
@media (max-width: 379px) {
	:root:not([data-look="students"]) .site-brand__name {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}
}

/* Cards and news */

.news-card {
	position: relative;
	background: var(--white);
	border: 1px solid var(--line);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-card);
	overflow: hidden;
	transition: box-shadow 200ms var(--ease);
	height: 100%;
}

.news-card:hover {
	box-shadow: var(--shadow-raised);
}

.news-card .wp-block-post-featured-image {
	margin: 0;
}

.news-card > * {
	margin-block-start: 0;
}

.news-card .wp-block-post-title a {
	text-decoration: none;
	color: var(--navy-dark);
}

.news-card .wp-block-post-title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.news-card:hover .wp-block-post-title a {
	text-decoration: underline;
}

.news-card:focus-within {
	outline: 3px solid var(--navy-dark);
	outline-offset: 2px;
}

.news-card .wp-block-post-title a:focus-visible {
	outline: none;
	box-shadow: none;
}

.news-card .wp-block-post-excerpt__excerpt {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.news-card .wp-block-post-excerpt__more-text {
	display: none;
}

.wp-block-post-featured-image img {
	object-fit: cover;
}

.more-link a {
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 18px;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	min-height: var(--tap);
	gap: 8px;
}

.more-link a::after {
	content: "→";
	transition: transform 150ms var(--ease);
}

.more-link a:hover::after {
	transform: translateX(3px);
}

/* Home sections */

.label {
	font-family: var(--font-display);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--label);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.ranking {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 32px;
	align-items: center;
}

.ranking__badges {
	display: flex;
	gap: 12px;
	align-items: center;
}

.ranking__badges img {
	display: block;
	height: auto;
	border-radius: var(--radius-sm);
}

.ranking__list {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

.ranking__list li {
	padding: 8px 24px;
	border-left: 1px solid rgb(255 255 255 / 0.25);
	font-size: 20px;
	line-height: 1.3;
}

.ranking__list strong {
	display: block;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: clamp(40px, 4vw, 56px);
	line-height: 1;
	color: var(--gold);
}

@media (max-width: 959px) {
	.ranking {
		grid-template-columns: 1fr;
	}

	.ranking__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		row-gap: 16px;
	}
}

.poster-card {
	display: grid;
	grid-template-columns: 160px minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}

.poster-card img {
	width: 160px;
	height: auto;
	border-radius: var(--radius-sm);
	border: 1px solid var(--line);
}

.poster-card details {
	margin-top: 12px;
}

.poster-card summary {
	cursor: pointer;
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 18px;
	color: var(--navy);
	min-height: var(--tap);
	display: flex;
	align-items: center;
}

.poster-card:not(:has(> img)) {
	grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 639px) {
	.poster-card {
		grid-template-columns: 1fr;
	}

	.poster-card img {
		width: 100%;
		max-width: 320px;
	}
}

.open-day-photos {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}

.open-day-photos img {
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: var(--radius-md);
	display: block;
}

/* Pages and posts */

.wp-block-post-content :where(h2, h3, h4, h5, h6):not(.wp-block-post-title) {
	margin-block-start: 1.6em;
}

.wp-block-post-content > :where(h2, h3, h4, h5, h6):first-child {
	margin-block-start: 0;
}

/* A long address written out as the link text breaks onto the next line instead of widening the page. */
.wp-block-post-content a {
	overflow-wrap: anywhere;
}

.wp-block-table table {
	border-collapse: collapse;
	font-size: 16px;
	font-variant-numeric: tabular-nums;
}

/* Columns take the width of their content: WordPress's default equal "fixed" columns break words mid-word. */
.wp-block-table table.has-fixed-layout {
	table-layout: auto;
}

.wp-block-table table.has-fixed-layout :is(td, th) {
	word-break: normal;
}

/* Six or more columns do not fit the text column, so such a table takes the wide width. */
.is-layout-constrained > .wp-block-table:has(tr > :nth-child(6)) {
	max-width: var(--wp--style--global--wide-size);
}

/* Narrower than that, a column keeps a readable width and the table scrolls sideways. */
.wp-block-table:has(tr > :nth-child(6)) :is(td, th):not(:first-child) {
	min-width: 7em;
}

/* A table wider than the screen shows a shadow on the side that has more to scroll to. */
.wp-block-table {
	background:
		linear-gradient(to right, var(--page-bg) 30%, transparent) left / 40px 100% no-repeat local,
		linear-gradient(to left, var(--page-bg) 30%, transparent) right / 40px 100% no-repeat local,
		radial-gradient(farthest-side at 0 50%, rgb(23 32 54 / 0.2), transparent) left / 14px 100% no-repeat scroll,
		radial-gradient(farthest-side at 100% 50%, rgb(23 32 54 / 0.2), transparent) right / 14px 100% no-repeat scroll;
}

.wp-block-table :where(th, td) {
	border: 1px solid var(--line);
	padding: 10px 14px;
	text-align: left;
	vertical-align: top;
}

.wp-block-table :where(td, th) :where(ul, ol) {
	margin: 0;
	padding-inline-start: 1.2em;
}

.wp-block-table :where(td, th) > p {
	margin-block: 0;
}

/* Stacked on a phone, the text of a media-text block lines up with the image above it. */
@media (max-width: 599px) {
	.wp-block-media-text.is-stacked-on-mobile > .wp-block-media-text__content {
		padding: 16px 0 0;
	}
}

.wp-block-table th {
	background: var(--navy-light);
	color: var(--navy-dark);
	font-family: var(--font-display);
	font-weight: 600;
}

.wp-block-table thead {
	border-bottom: 2px solid var(--navy);
}

.wp-block-table tbody tr:has(td):nth-child(even) {
	background: rgb(232 236 246 / 0.4);
}

.wp-block-details {
	border-top: 1px solid var(--line);
}

.wp-block-details + .wp-block-details {
	margin-block-start: 0;
}

.wp-block-details:not(:has(+ .wp-block-details)) {
	border-bottom: 1px solid var(--line);
}

.wp-block-details > summary {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	min-height: 60px;
	padding-block: 12px;
	list-style: none;
	color: var(--navy-dark);
	font-family: var(--font-display);
	font-size: 20px;
	font-weight: 600;
	cursor: pointer;
}

.wp-block-details > summary::-webkit-details-marker {
	display: none;
}

.wp-block-details > summary::after {
	content: "";
	flex: none;
	width: 9px;
	height: 9px;
	margin: 0 6px 6px 0;
	border-right: 2px solid var(--navy);
	border-bottom: 2px solid var(--navy);
	transform: rotate(45deg);
	transition: transform 150ms var(--ease);
}

.wp-block-details[open] > summary::after {
	margin-bottom: 0;
	transform: rotate(-135deg);
}

.wp-block-details > summary:hover {
	text-decoration: underline;
	text-underline-offset: 4px;
}

.wp-block-details[open] {
	padding-bottom: 24px;
}

.wp-block-gallery img,
.wp-block-media-text__media img {
	border-radius: var(--radius-sm);
}

/* A short last row keeps the column width instead of stretching one photo across the text. */
.wp-block-gallery.has-nested-images figure.wp-block-image {
	flex-grow: 0;
}

/* Every cropped photo has the same shape, so a portrait photo does not stretch its row (the lightbox shows it whole). */
.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) img {
	flex: none;
	aspect-ratio: 4 / 3;
	height: auto;
}

/* One or two photos share the whole width instead of sitting as small thumbnails. */
.wp-block-gallery.has-nested-images:not(:has(> figure:nth-of-type(3))) figure.wp-block-image {
	flex-grow: 1;
}

.wp-block-gallery.has-nested-images figure.wp-block-image figcaption,
.wp-block-image figcaption {
	font-size: 15px;
}

.wp-block-query-pagination {
	gap: 8px;
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 18px;
}

.wp-block-query-pagination-numbers {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.wp-block-query-pagination :where(.page-numbers, .wp-block-query-pagination-previous, .wp-block-query-pagination-next) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: var(--tap);
	min-height: var(--tap);
	padding: 0 12px;
	border-radius: var(--radius-sm);
	text-decoration: none;
}

.wp-block-query-pagination :where(a.page-numbers, .wp-block-query-pagination-previous, .wp-block-query-pagination-next):hover {
	background: var(--navy-light);
}

.wp-block-query-pagination .page-numbers.current {
	background: var(--navy);
	color: var(--white);
}

/* On a phone the page numbers take one row, with Nowsze and Starsze side by side under them. */
@media (max-width: 599px) {
	.wp-block-query-pagination-numbers {
		order: -1;
		flex: 1 0 100%;
		flex-wrap: nowrap;
		justify-content: center;
		gap: 0;
	}

	.wp-block-query-pagination .page-numbers {
		min-width: 40px;
		padding: 0 4px;
	}
}

/* Footer */

.site-footer a {
	text-decoration: none;
}

.site-footer a:hover {
	text-decoration: underline;
}

.site-footer :where(a, button):focus-visible {
	outline-color: var(--gold);
	box-shadow: none;
}

.site-footer ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.site-footer li a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
}

.site-footer .wp-block-column {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.site-footer .wp-block-column > * {
	margin: 0;
}

/* On a tablet the four footer columns sit two by two instead of in one long column. */
@media (min-width: 600px) and (max-width: 781px) {
	.site-footer .wp-block-columns {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* The e-delivery address breaks only between its parts. */
.footer-edelivery {
	white-space: nowrap;
}

.site-footer .label {
	margin-bottom: 8px;
}

.footer-schools {
	display: grid;
	gap: 16px;
}

.footer-school {
	margin: 0;
}

.footer-school {
	display: flex;
	gap: 12px;
	align-items: center;
	font-family: var(--font-display);
	font-weight: 600;
	font-size: 16px;
	line-height: 1.2;
}

.footer-school img {
	width: 56px;
	height: 56px;
	padding: 6px;
	background: var(--white);
	border-radius: 50%;
	object-fit: contain;
	flex: none;
}

/* Bells and lesson plan card, the first thing under the photo: the lesson on now and a way to a class plan. */
.home-section--today {
	padding-block: 32px 0;
}

.today {
	display: grid;
	gap: 16px;
}

.today__bells,
.today-plan {
	display: grid;
	align-content: start;
	gap: 12px;
	box-sizing: border-box;
	padding: 24px;
	border-radius: var(--radius-md);
}

.today__bells {
	background: var(--navy);
	color: var(--white);
}

.today-plan {
	border: 1px solid var(--line);
	background: var(--white);
}

.home-section .today h2 {
	margin: 0;
	font-size: 24px;
}

.home-section .today .today__bells h2 {
	color: var(--white);
}

.today .bells-now {
	margin: 0;
	padding: 0;
}

.today__more {
	margin: 0;
	font-size: 15px;
}

.today__bells .today__more a {
	color: var(--white);
}

.today-plan label {
	font-weight: 600;
}

.today-plan__row {
	display: flex;
	gap: 8px;
}

.today-plan__row select {
	flex: 1;
	min-width: 0;
	min-height: var(--tap);
	padding: 0 12px;
	border: 1px solid var(--muted);
	border-radius: var(--radius-sm);
	background: var(--white);
	color: var(--ink);
	font: inherit;
}

.today-plan__row button {
	min-height: var(--tap);
	padding: 0 20px;
	border: 0;
	border-radius: var(--radius-sm);
	background: var(--navy);
	color: var(--white);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.today-plan__row button:hover {
	background: var(--navy-dark);
}

@media (min-width: 960px) {
	.today {
		grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
	}
}

/* Shortcuts under the photo: the pages the school survey says people look for most. */
.home-section--quick {
	padding-block: 24px 0;
}

.quick-links {
	list-style: none;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
}

.quick-links li {
	margin: 0;
}

.quick-links a {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 100%;
	min-height: 96px;
	box-sizing: border-box;
	padding: 12px 8px;
	border-radius: var(--radius-md);
	background: var(--navy-light);
	color: var(--navy-dark);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	transition: background-color 150ms var(--ease), color 150ms var(--ease);
}

.quick-links svg {
	flex: none;
	color: var(--navy);
}

.quick-links a:hover {
	background: var(--navy);
	color: var(--white);
}

.quick-links a:hover svg {
	color: var(--gold);
}

@media (min-width: 960px) {
	.quick-links {
		grid-template-columns: repeat(8, minmax(0, 1fr));
	}
}

@media (max-width: 639px) {
	.quick-links {
		gap: 8px;
	}

	.quick-links a {
		min-height: 84px;
		padding: 10px 4px;
		font-size: 13px;
	}
}

/* Calendar card on the home page and the school year on the Kalendarz page, both from the school's Google calendar. */
.day-off {
	display: grid;
	gap: 2px;
	margin: 0 0 12px;
	padding: 14px 16px;
	border-left: 4px solid var(--gold);
	border-radius: var(--radius-sm);
	background: var(--white);
}

.day-off__label {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--muted);
}

.day-off__date {
	font-size: 20px;
	line-height: 1.3;
	color: var(--navy-dark);
}

.day-off__title {
	font-size: 14px;
	color: var(--muted);
}

.upcoming__list,
.school-year__month ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.upcoming__list li,
.school-year__month li {
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr);
	gap: 12px;
	align-items: start;
	margin: 0;
	padding-block: 12px;
}

.upcoming__list li + li,
.school-year__month li {
	border-top: 1px solid var(--line);
}

.date-badge {
	display: grid;
	justify-items: center;
	padding: 4px 0 6px;
	border-radius: var(--radius-sm);
	background: var(--navy);
	color: var(--white);
	line-height: 1.1;
}

.date-badge__day {
	font-size: 20px;
	font-weight: 700;
}

.date-badge__month {
	font-size: 12px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.upcoming__text,
.school-year__text {
	display: grid;
	gap: 2px;
}

.upcoming__title,
.school-year__title {
	font-weight: 600;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.upcoming__when,
.school-year__when {
	font-size: 14px;
	color: var(--muted);
}

.upcoming__empty {
	color: var(--muted);
}

.upcoming .more-link {
	margin: 12px 0 0;
}

.school-year__add {
	box-sizing: border-box;
	margin-bottom: 32px;
	padding: 20px 24px;
	border-radius: var(--radius-md);
	background: var(--navy-light);
}

.school-year__add p {
	margin: 0 0 12px;
}

.school-year__add .school-year__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 0;
}

.school-year__button {
	display: inline-flex;
	align-items: center;
	min-height: var(--tap);
	box-sizing: border-box;
	padding: 0 20px;
	border: 2px solid var(--navy);
	border-radius: var(--radius-sm);
	background: var(--navy);
	color: var(--white);
	font-weight: 600;
	text-decoration: none;
}

.school-year__button--outline {
	background: var(--white);
	color: var(--navy);
}

.school-year__button:hover {
	border-color: var(--navy-dark);
	background: var(--navy-dark);
	color: var(--white);
}

.school-year__month h3 {
	margin: 32px 0 4px;
	font-size: 22px;
}

.school-year__month .is-past .date-badge {
	background: var(--line);
	color: var(--navy-dark);
}

.school-year__month .is-past .school-year__title {
	font-weight: 400;
}

.school-year__month .is-day-off:not(.is-past) .date-badge {
	background: var(--gold);
	color: var(--navy-dark);
}

/* Kalendarz page: the list from the current month on; beside it the next days off, a month grid and the add buttons. */
.school-calendar {
	display: grid;
	gap: 24px;
	align-items: start;
}

.school-calendar .day-off {
	margin: 0;
	background: var(--navy-light);
}

.school-calendar .school-year > h2,
.school-calendar .school-year__add > h2 {
	margin: 0;
}

.school-year__add h2 {
	margin-bottom: 8px;
	font-size: 20px;
}

.school-calendar .school-year__add {
	margin: 0;
}

.school-year__earlier {
	margin-top: 20px;
	border-block: 1px solid var(--line);
}

.school-year__earlier summary {
	display: flex;
	align-items: center;
	min-height: var(--tap);
	color: var(--navy);
	font-weight: 600;
	cursor: pointer;
}

.school-year__earlier[open] summary {
	border-bottom: 1px solid var(--line);
}

.school-year__earlier .school-year__month h3 {
	margin-top: 20px;
}

.school-year__month li:target {
	background: var(--navy-light);
	outline: 8px solid var(--navy-light);
}

.school-year__picture {
	margin-top: 32px;
}

.month-grid {
	padding: 16px;
	border: 1px solid var(--line);
	border-radius: var(--radius-md);
	background: var(--white);
}

.month-grid__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 0 0 8px;
}

.month-grid__name {
	font-size: 18px;
	font-weight: 700;
	color: var(--navy-dark);
}

.month-grid__head button {
	width: var(--tap);
	height: var(--tap);
	border: 1px solid var(--line);
	border-radius: 50%;
	background: var(--white);
	color: var(--navy);
	font: inherit;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.month-grid__head button:hover {
	border-color: var(--navy);
}

.month-grid__head button:disabled {
	opacity: 0.35;
	cursor: default;
}

.month-grid table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
	text-align: center;
}

.month-grid th {
	padding: 4px 0;
	font-size: 12px;
	font-weight: 700;
	color: var(--muted);
}

.month-grid td {
	padding: 2px;
}

.month-grid td > * {
	position: relative;
	display: grid;
	place-items: center;
	height: 38px;
	border-radius: var(--radius-sm);
	font-size: 15px;
	color: var(--ink);
}

.month-grid td.is-weekend > * {
	color: var(--muted);
}

.month-grid td a {
	font-weight: 700;
	color: var(--navy-dark);
	text-decoration: none;
}

.month-grid td a::after {
	content: "";
	position: absolute;
	bottom: 4px;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--navy);
}

.month-grid td a:hover {
	background: var(--navy-light);
}

.month-grid td.is-off > * {
	background: var(--gold);
	color: var(--navy-dark);
}

.month-grid td.is-today > * {
	box-shadow: inset 0 0 0 2px var(--navy);
}

.month-grid__legend {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 8px;
	margin: 12px 0 0;
	font-size: 13px;
	color: var(--muted);
}

.month-grid__key {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 3px;
}

.month-grid__key--off {
	background: var(--gold);
}

.month-grid__key--event {
	width: 6px;
	height: 6px;
	margin-left: 8px;
	border-radius: 50%;
	background: var(--navy);
}

@media (min-width: 960px) {
	.school-calendar {
		grid-template-columns: minmax(0, 1fr) 340px;
		grid-template-areas: "list off" "list grid" "list add" "list .";
		grid-template-rows: auto auto auto 1fr;
		column-gap: 48px;
	}

	.school-calendar > .day-off {
		grid-area: off;
	}

	.school-calendar > .month-grid {
		grid-area: grid;
	}

	.school-calendar > .school-year {
		grid-area: list;
	}

	.school-calendar > .school-year__add {
		grid-area: add;
	}

	.school-calendar .school-year__button {
		width: 100%;
		justify-content: center;
		text-align: center;
	}
}

/* Galeria: one card per event with photos, grouped by school year. */
.gallery-year + .gallery-year {
	margin-top: 48px;
}

.gallery-year h2 {
	margin: 0 0 16px;
	font-size: 26px;
}

.gallery-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
	gap: 20px;
}

.gallery-card {
	margin: 0;
}

.gallery-card a {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	border-radius: var(--radius-md);
	background: var(--white);
	box-shadow: var(--shadow-card);
	color: var(--ink);
	text-decoration: none;
	transition: box-shadow 150ms var(--ease);
}

.gallery-card a:hover {
	box-shadow: var(--shadow-raised);
}

.gallery-card img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	background: var(--navy-light);
}

.gallery-card__body {
	display: grid;
	gap: 6px;
	padding: 14px 16px 16px;
}

.gallery-card__title {
	font-weight: 600;
	line-height: 1.3;
	color: var(--navy-dark);
}

.gallery-card a:hover .gallery-card__title {
	text-decoration: underline;
}

.gallery-card__meta {
	font-size: 14px;
	color: var(--muted);
}

/* Plan lekcji: classes as buttons, teachers and rooms as lists; a week table, on phones one list per day. */
.plan-picker {
	display: grid;
	gap: 20px;
	margin-bottom: 40px;
}

.plan-picker__label,
.plan-picker__form label {
	display: block;
	margin: 0 0 8px;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--muted);
}

.plan-picker__classes {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.plan-picker__classes li {
	margin: 0;
}

.plan-picker__classes a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 56px;
	min-height: var(--tap);
	box-sizing: border-box;
	padding: 0 12px;
	border: 1px solid var(--line);
	border-radius: var(--radius-sm);
	background: var(--white);
	color: var(--navy-dark);
	font-weight: 600;
	text-decoration: none;
}

.plan-picker__classes a:hover {
	border-color: var(--navy);
}

.plan-picker__classes a[aria-current] {
	border-color: var(--navy);
	background: var(--navy);
	color: var(--white);
}

.plan-picker__forms {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
	gap: 20px;
}

.plan-picker__row {
	display: flex;
	gap: 8px;
}

.plan-picker__row select {
	flex: 1;
	min-width: 0;
	min-height: var(--tap);
	padding: 0 12px;
	border: 1px solid var(--muted);
	border-radius: var(--radius-sm);
	background: var(--white);
	color: var(--ink);
	font: inherit;
}

.plan-picker__row button {
	min-height: var(--tap);
	padding: 0 20px;
	border: 0;
	border-radius: var(--radius-sm);
	background: var(--navy);
	color: var(--white);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.plan-picker__row button:hover {
	background: var(--navy-dark);
}

.plan {
	container-type: inline-size;
}

.plan h2 {
	margin: 0 0 4px;
}

.plan__source {
	margin: 0 0 20px;
	font-size: 15px;
	color: var(--muted);
}

.plan-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
	font-size: 14px;
}

.plan-table th,
.plan-table td {
	padding: 8px;
	border: 1px solid var(--line);
	text-align: left;
	vertical-align: top;
}

.plan-table thead th,
.plan-table tbody th {
	background: var(--navy-light);
	color: var(--navy-dark);
}

.plan-table thead th {
	font-size: 13px;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.plan-table thead th:first-child {
	width: 96px;
}

.plan-table tbody th {
	font-weight: 400;
}

.plan-table__bell {
	display: block;
	font-size: 18px;
	font-weight: 700;
}

.plan-table .is-today {
	background: var(--navy-light);
}

.plan-table__today {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--navy);
}

.plan-table__hours {
	display: block;
	font-size: 13px;
	font-weight: 400;
	color: var(--muted);
	white-space: nowrap;
}

.plan-lesson + .plan-lesson {
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px dashed var(--line);
}

.plan-lesson__subject {
	display: block;
	font-weight: 600;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.plan-lesson__details {
	display: block;
	font-size: 13px;
	line-height: 1.35;
	color: var(--muted);
}

.plan__days {
	display: none;
}

@container (max-width: 760px) {
	.plan__table {
		display: none;
	}

	.plan__days {
		display: grid;
		gap: 28px;
	}
}

.plan-day h3 {
	margin: 0 0 8px;
	font-size: 22px;
}

.plan-day--today h3 {
	color: var(--navy);
}

.plan-day ol {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: 2px solid var(--navy);
}

.plan-day li {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr);
	gap: 12px;
	margin: 0;
	padding-block: 10px;
	border-bottom: 1px solid var(--line);
}

.plan-day__bell {
	font-size: 18px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--navy-dark);
}

.plan-day .plan-day__free {
	display: block;
	color: var(--muted);
}

/* Dzwonki: what is on now, filled by assets/js/bells.js. */
.bells-now {
	display: grid;
	gap: 12px;
	box-sizing: border-box;
	margin: 0 0 32px;
	padding: 20px 24px;
	border-radius: var(--radius-md);
	background: var(--navy);
	color: var(--white);
}

.bells-now[hidden] {
	display: none;
}

.bells-now__status {
	margin: 0;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.35;
}

.bells-now__plans {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.bells-now__plans button {
	min-height: 44px;
	padding: 0 16px;
	border: 1px solid rgb(255 255 255 / 0.6);
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--white);
	font: inherit;
	font-size: 15px;
	cursor: pointer;
}

.bells-now__plans button[aria-pressed="true"] {
	border-color: var(--white);
	background: var(--white);
	color: var(--navy-dark);
	font-weight: 600;
}

.wp-block-table tr.is-now td {
	background: var(--gold);
	color: var(--navy-dark);
	font-weight: 700;
}

.wp-block-table tr.is-next td {
	background: var(--navy-light);
	font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition: none !important;
		animation: none !important;
		scroll-behavior: auto !important;
	}
}
