/* Szkoła Języka Polskiego im. św. Wojciecha — site styles */

@font-face {
	font-family: Fraunces;
	src: url(fonts/fraunces-latin.woff2) format("woff2");
	font-weight: 100 900;
	font-display: swap;
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: Fraunces;
	src: url(fonts/fraunces-latin-ext.woff2) format("woff2");
	font-weight: 100 900;
	font-display: swap;
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
	--red: #c8102e;
	--red-d: #9e0c25;
	--red-l: #fcebee;
	--ink: #1f1a24;
	--ink-2: #463f4e;
	--muted: #6e6677;
	--paper: #fffdf9;
	--cream: #f8f2e9;
	--sand: #efe5d6;
	--line: #e8decf;
	--green: #24773f; /* darker than the first #2f8f4e: small green text needs 4.5:1 (WCAG AA) */
	--gold: #d99a0f;
	--blue: #2457a6;
	--pink: #d63f73;
	--radius: 12px;
	--radius-s: 10px;
	--shadow: 0 1px 2px rgb(60 30 10 / .05);
	--shadow-h: 0 2px 4px rgb(60 30 10 / .06), 0 14px 32px -18px rgb(60 30 10 / .3);
	--serif: Fraunces, "Iowan Old Style", Georgia, "Times New Roman", serif;
	--sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--wrap: 1200px;
	--gut: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 17px/1.6 var(--sans);
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
img, svg { max-width: 100%; }
img { height: auto; }
a { color: var(--red-d); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; font-optical-sizing: auto; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); }
h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 1.95rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gut)); margin-inline: auto; padding-inline: var(--gut); }
[hidden] { display: none !important; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: .6em 1em; border-radius: 8px; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- buttons, chips, cards */

.btn {
	display: inline-flex; align-items: center; gap: .55em;
	padding: .78em 1.35em; border-radius: 999px; border: 1.5px solid var(--red);
	background: var(--red); color: #fff; font: 600 1rem/1.2 var(--sans);
	text-decoration: none; cursor: pointer;
	transition: background .15s, transform .15s, box-shadow .15s;
	box-shadow: 0 6px 16px -8px rgb(200 16 46 / .7);
}
.btn:hover { background: var(--red-d); border-color: var(--red-d); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: rgb(31 26 36 / .2); box-shadow: none; }
.btn-ghost:hover { background: #fff; color: var(--ink); border-color: var(--ink); }
.btn-small { padding: .55em 1em; font-size: .92rem; }
.more { display: inline-flex; align-items: center; gap: .4em; font-weight: 600; text-decoration: none; font-size: .95rem; }
.more .i { transition: transform .15s; }
.more:hover .i { transform: translateX(3px); }

.chips { display: flex; flex-wrap: wrap; gap: .45rem; list-style: none; padding: 0; margin: 0 0 1rem; }
.chip {
	display: inline-block; padding: .38em .9em; border-radius: 999px;
	border: 1.5px solid var(--line); background: #fff; color: var(--ink-2);
	font-size: .9rem; font-weight: 600; text-decoration: none; line-height: 1.3;
	transition: border-color .15s, background .15s, color .15s;
}
.chip:hover { border-color: var(--green); color: var(--green); }
.chip[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; box-shadow: var(--shadow); }
.card > h2 { display: flex; align-items: center; gap: .5em; font-size: 1.3rem; }
.card > h2 .i { display: none; }
.card > h2::before { content: "◆"; color: var(--red); font-size: .6em; flex: none; }
.note { background: var(--cream); border-left: 4px solid var(--gold); padding: .7em 1em; border-radius: 0 var(--radius-s) var(--radius-s) 0; font-size: .95rem; color: var(--ink-2); }
.lead { font-size: 1.2rem; color: var(--ink-2); }
.eyebrow { font-weight: 700; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--red); margin-bottom: .8rem; }

/* ---------- header */

.top {
	position: sticky; top: 0; z-index: 50;
	background: rgb(255 253 249 / .94);
	backdrop-filter: saturate(1.4) blur(10px);
	-webkit-backdrop-filter: saturate(1.4) blur(10px);
	border-top: 4px solid var(--red);
	border-bottom: 1px solid var(--line);
}
.top-in { display: flex; align-items: center; gap: 1rem; min-height: 76px; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--ink); margin-right: auto; min-width: 0; }
.brand img { width: 56px; height: 56px; flex: none; }
.brand-t { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-t b { font: 650 1.12rem/1.15 var(--serif); }
.brand-t small { color: var(--muted); font-size: .84rem; }

.nav { display: flex; align-items: center; gap: .5rem; }
.nav > ul { display: flex; align-items: center; gap: .15rem; list-style: none; margin: 0; padding: 0; }
.nav a, .nav summary {
	display: block; padding: .55em .8em; border-radius: 10px;
	color: var(--ink); text-decoration: none; font-weight: 600; font-size: .97rem;
	cursor: pointer; white-space: nowrap;
}
.nav summary { list-style: none; display: flex; align-items: center; gap: .3em; }
.nav summary::-webkit-details-marker { display: none; }
.nav summary::after { content: ""; width: .45em; height: .45em; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); opacity: .6; transition: transform .15s; }
.nav details[open] summary::after { transform: rotate(225deg) translate(-2px, 0); }
.nav a:hover, .nav summary:hover { background: var(--cream); color: var(--red-d); }
.nav [aria-current="page"] { color: var(--red); }
.nav [aria-current="page"]:not(summary) { background: var(--red-l); }
.has-sub { position: relative; }
.has-sub ul {
	list-style: none; margin: 0; padding: .45rem;
	position: absolute; top: calc(100% + 8px); left: -.4rem; min-width: 250px;
	background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-h);
}
.has-sub ul a { font-weight: 500; }
.lang {
	display: inline-flex !important; align-items: center; gap: .45em;
	border: 1.5px solid var(--line); border-radius: 999px !important; padding: .42em .9em !important;
	font-size: .9rem !important;
}
.lang-flag { width: 18px; height: 12px; border-radius: 2px; box-shadow: 0 0 0 1px rgb(0 0 0 / .12); flex: none; }
html[lang="pl"] .lang-flag { background: linear-gradient(#b22234 0 0) 0 0 / 100% 2px repeat-y, #fff; background: repeating-linear-gradient(#b22234 0 1.71px, #fff 1.71px 3.42px); position: relative; }
html[lang="pl"] .lang-flag::before { content: ""; position: absolute; left: 0; top: 0; width: 45%; height: 55%; background: #3c3b6e; border-radius: 2px 0 0 0; }
html[lang="en"] .lang-flag { background: linear-gradient(#fff 50%, #dc143c 50%); }

.menu-btn {
	display: none; align-items: center; gap: .55em;
	border: 1.5px solid var(--line); background: #fff; border-radius: 999px;
	padding: .55em 1em; font: 600 .95rem var(--sans); color: var(--ink); cursor: pointer;
}
.burger, .burger::before, .burger::after { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform .2s, background .2s; }
.burger::before, .burger::after { content: ""; position: absolute; left: 0; }
.burger::before { top: -6px; }
.burger::after { top: 6px; }
.menu-btn[aria-expanded="true"] .burger { background: transparent; }
.menu-btn[aria-expanded="true"] .burger::before { transform: translateY(6px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .burger::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1100px) {
	.menu-btn { display: inline-flex; }
	.nav { display: none; }
	.nav {
		position: absolute; left: 0; right: 0; top: 100%;
		flex-direction: column; align-items: stretch; gap: .75rem;
		background: var(--paper); border-bottom: 1px solid var(--line);
		padding: .75rem var(--gut) 1.25rem; box-shadow: 0 20px 30px -20px rgb(0 0 0 / .25);
		max-height: calc(100vh - 80px); overflow-y: auto;
	}
	.nav.open { display: flex; }
	.nav > ul { flex-direction: column; align-items: stretch; }
	.nav a, .nav summary { padding: .75em .8em; font-size: 1.05rem; }
	.has-sub ul { position: static; box-shadow: none; border: 0; padding: 0 0 .3rem .9rem; min-width: 0; background: none; }
	.lang { align-self: flex-start; }
}
@media (max-width: 520px) {
	.brand img { width: 46px; height: 46px; }
	.brand-t b { font-size: 1rem; }
	.brand-t small { font-size: .76rem; }
	.menu-btn { padding: .55em .8em; }
	.top-in { min-height: 66px; gap: .6rem; }
}

.crumbs { display: flex; flex-wrap: wrap; gap: .45em; padding-top: 1.1rem; font-size: .88rem; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--red); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink-2); }

/* ---------- home: hero */

.hero { position: relative; overflow: hidden; background: radial-gradient(1200px 500px at 85% 10%, #fff 0, transparent 60%), linear-gradient(180deg, var(--cream), var(--paper)); border-bottom: 1px solid var(--line); }
.hero-in { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(1.5rem, 4vw, 4rem); align-items: center; padding-block: clamp(2.2rem, 6vw, 5rem); }
.hero h1 { font-size: clamp(2.2rem, 1.3rem + 3.6vw, 4rem); font-weight: 650; margin-bottom: .35em; }
.hero-tag { font: italic 500 clamp(1.15rem, 1rem + .6vw, 1.45rem)/1.4 var(--serif); color: var(--red-d); margin-bottom: 1.6rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .75rem; margin: 0; }
.hero-photo { position: relative; z-index: 1; margin: 0; aspect-ratio: 4 / 3.4; border-radius: 999px 999px var(--radius) var(--radius); overflow: hidden; box-shadow: var(--shadow-h); background: var(--sand); border: 6px solid #fff; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-rosette { position: absolute; right: -90px; bottom: -110px; width: 340px; height: 340px; background: url(img/rosette.svg) center / contain no-repeat; opacity: .16; pointer-events: none; }
.hero-text { position: relative; z-index: 1; }
@media (max-width: 860px) {
	.hero-in { grid-template-columns: 1fr; }
	.hero h1 { font-size: clamp(1.9rem, 1.2rem + 3.6vw, 2.6rem); }
	.hero-tag { margin-bottom: 1.1rem; }
	.hero-photo { max-width: 520px; aspect-ratio: 4 / 3; border-radius: 220px 220px var(--radius) var(--radius); }
	.hero-rosette { width: 240px; height: 240px; right: -70px; bottom: auto; top: -60px; }
}

/* ---------- home: quick tiles */

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: -2rem; position: relative; z-index: 2; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-h); overflow: hidden; }
.tiles.wrap { width: calc(100% - 2 * var(--gut)); max-width: var(--wrap); padding-inline: 0; }
.tile, .tile-ev { display: flex; align-items: center; gap: .9rem; min-width: 0; }
.tile { padding: .9rem 1.1rem; text-decoration: none; color: var(--ink); transition: background .15s; }
.tile + .tile { border-left: 1px solid var(--line); }
.tile:hover { background: var(--cream); color: var(--ink); }
.tile-evs { display: block; min-width: 0; flex: 1; }
.tile-ev.past { display: none; }
/* picture: newest poster / newest album */
.tile-vis { flex: none; width: 60px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--cream); box-shadow: 0 0 0 1px var(--line); transition: transform .2s; }
.tile-vis img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile:hover .tile-vis, .tile:hover .leaf { transform: rotate(-3deg) scale(1.04); }
/* calendar leaf: a torn-off page with the day */
.leaf { --c: var(--gold); flex: none; width: 60px; height: 64px; display: flex; flex-direction: column; border-radius: 8px; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px var(--line), 0 3px 0 -1px #fff, 0 3px 0 0 var(--line); text-align: center; transition: transform .2s; }
.leaf small { display: block; background: var(--c); color: #fff; font: 700 .68rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; padding: .32rem 0 .28rem; }
.leaf b { flex: 1; display: grid; place-items: center; font: 650 1.6rem/1 var(--serif); color: var(--ink); }
.leaf-hw { --c: var(--green); }
.leaf-mass { --c: var(--blue); }
.leaf-off { --c: var(--red); }
.tile-txt { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.tile-txt small { font: 700 .72rem/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.tile-txt strong { font: 600 1.02rem/1.25 var(--serif); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tile:hover strong { color: var(--red-d); }
@media (max-width: 960px) {
	.tiles { grid-template-columns: repeat(2, 1fr); }
	.tile:nth-child(odd) { border-left: 0; }
	.tile:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 480px) {
	.tiles { grid-template-columns: 1fr; margin-top: -1.4rem; }
	.tile { padding: .75rem .9rem; }
	.tile + .tile { border-left: 0; border-top: 1px solid var(--line); }
	.tile-vis, .leaf { width: 52px; height: 56px; }
}

/* ---------- home: greeting */

.greeting { margin-top: clamp(2rem, 5vw, 3.5rem); }
.greeting-card {
	position: relative; max-width: 760px; margin-inline: auto; text-align: center;
	padding: 2.4rem clamp(1.2rem, 4vw, 3rem) 2rem;
	background: var(--cream); border-radius: var(--radius);
	font: italic 450 1.15rem/1.65 var(--serif); color: var(--ink-2);
}
.greeting-card::before, .greeting-card::after { content: ""; position: absolute; left: 1.5rem; right: 1.5rem; height: 28px; background: url(img/folk-strip.svg) center / auto 100% repeat-x; opacity: .9; }
.greeting-card::before { top: -14px; }
.greeting-card::after { bottom: -14px; }
.greeting-card h2 { font-style: normal; color: var(--red); letter-spacing: .02em; }
.greeting-card p:last-child { margin-bottom: 0; }

/* ---------- home: news + side */

.home-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: clamp(1.5rem, 3vw, 2.5rem); margin-top: clamp(2.5rem, 6vw, 4rem); align-items: start; }
.home-side { display: grid; gap: 1.25rem; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.sec-head h2 { margin: 0; }
@media (max-width: 900px) { .home-grid { grid-template-columns: 1fr; } }

.post-list { display: grid; gap: 1rem; }
.post-card { display: grid; grid-template-columns: 132px 1fr; gap: 1.1rem; align-items: start; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; box-shadow: var(--shadow); transition: box-shadow .18s, transform .18s; position: relative; }
.post-card:hover { box-shadow: var(--shadow-h); transform: translateY(-2px); }
.post-img { display: block; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--cream); }
.post-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-img-none, .album-img-none { background: var(--cream) url(img/logo-192.webp) center / auto 66% no-repeat !important; }
.post-body { padding: .2rem .3rem .2rem 0; min-width: 0; }
.post-body time { font-size: .82rem; font-weight: 700; color: var(--red); letter-spacing: .04em; text-transform: uppercase; }
.post-body :is(h2, h3) { margin: .2rem 0 .35rem; font-size: 1.18rem; }
.post-body :is(h2, h3) a { color: var(--ink); text-decoration: none; }
.post-body :is(h2, h3) a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.post-body p { color: var(--muted); font-size: .94rem; margin: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.post-list-wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 1.2rem; }
.post-list-wide .post-card { grid-template-columns: 1fr; padding: 0; overflow: hidden; }
.post-list-wide .post-img { aspect-ratio: 16 / 10; border-radius: 0; }
.post-list-wide .post-body { padding: .9rem 1.2rem 1.2rem; }
@media (max-width: 480px) { .post-card { grid-template-columns: 92px 1fr; gap: .8rem; } }

.event-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.event-list .ev { display: grid; grid-template-columns: 52px 1fr; gap: .8rem; align-items: center; }
.event-list time { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 52px; border-radius: 12px; background: var(--cream); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); line-height: 1; border-left: 4px solid var(--gold); }
.event-list time b { font: 650 1.35rem/1 var(--serif); color: var(--ink); letter-spacing: 0; margin-bottom: 2px; }
.event-list .ev-mass time { border-color: var(--blue); }
.event-list .ev-off time { border-color: var(--red); }
.event-list span { font-size: .95rem; line-height: 1.35; }
.event-list small { color: var(--muted); }
.event-list .past { display: none; }

.hw-card .hw-date { font-weight: 600; margin-bottom: .7rem; }
.hw-card .hw-date a { color: var(--ink); text-decoration: none; }
.hw-card .hw-date a:hover { color: var(--green); }

/* ---------- albums */

.home-gallery { margin-top: clamp(2.5rem, 6vw, 4rem); }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 1.25rem; }
.album-card { display: flex; flex-direction: column; gap: .3rem; text-decoration: none; color: var(--ink); }
.album-img { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; margin-bottom: .45rem; box-shadow: var(--shadow); }
.album-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.album-card:hover .album-img img { transform: scale(1.05); }
.album-n { position: absolute; right: .6rem; bottom: .6rem; display: inline-flex; align-items: center; gap: .35em; padding: .25em .65em; border-radius: 999px; background: rgb(20 15 25 / .66); color: #fff; font-size: .8rem; font-weight: 600; backdrop-filter: blur(4px); }
.album-card strong { font: 600 1.08rem/1.25 var(--serif); }
.album-card:hover strong { color: var(--red); }
.album-card time { font-size: .86rem; color: var(--muted); }
.gal-year { margin-bottom: 2.6rem; }
.gal-year h2 { display: flex; align-items: baseline; gap: .7rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); margin-bottom: 1.2rem; }
.gal-year h2 small { font: 500 .9rem var(--sans); color: var(--muted); }

/* ---------- about band */

.about-band { position: relative; overflow: hidden; margin-top: clamp(3rem, 7vw, 5rem); background: var(--red); color: #fff; }
.about-band::before { content: ""; position: absolute; width: 520px; height: 520px; left: -160px; top: -140px; background: url(img/rosette.svg) center / contain no-repeat; opacity: .1; filter: grayscale(1) brightness(3); }
.about-in { position: relative; display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(1.5rem, 4vw, 4rem); align-items: center; padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.about-band h2 { color: #fff; }
.about-band .lead { color: rgb(255 255 255 / .9); }
.about-band .btn { background: #fff; color: var(--red-d); border-color: #fff; box-shadow: none; }
.about-band .btn:hover { background: var(--cream); }
.about-band .btn-ghost { background: transparent; color: #fff; border-color: rgb(255 255 255 / .5); }
.about-band .btn-ghost:hover { background: rgb(255 255 255 / .12); color: #fff; border-color: #fff; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1.7rem 2.2rem; margin: 0; }
.facts div { border-top: 1px solid rgb(255 255 255 / .4); padding-top: .9rem; }
.facts dt { font: 650 1.8rem/1.1 var(--serif); margin-bottom: .35rem; }
.facts dd { margin: 0; font-size: .92rem; color: rgb(255 255 255 / .85); line-height: 1.4; }
@media (max-width: 860px) { .about-in { grid-template-columns: 1fr; } }
@media (max-width: 400px) { .facts { grid-template-columns: 1fr; } }

/* ---------- funding */

.funding { margin-top: clamp(2.5rem, 6vw, 4rem); text-align: center; }
.funding h2 { margin-bottom: 1.4rem; }
.funding-grid { display: flex; align-items: flex-end; gap: 1rem; }
/* One justified row: each poster's width follows its shape, together they fill the line. */
.funding figure { margin: 0; flex: var(--r, .75) 1 0; min-width: 0; }
.funding a { display: block; border-radius: 10px; overflow: hidden; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; }
.funding a:hover { transform: translateY(-3px); box-shadow: var(--shadow-h); }
.funding img { display: block; width: 100%; height: auto; }
.funding figcaption { font-size: .85rem; color: var(--muted); margin-top: .5rem; }
@media (max-width: 700px) {
	.funding-grid { flex-wrap: wrap; justify-content: center; gap: .7rem; }
	.funding figure { flex: none; }
	.funding img { width: auto; height: 130px; }
}

/* ---------- inner pages */

main { min-height: 50vh; }
.page { padding-top: 1.4rem; padding-bottom: clamp(3rem, 7vw, 5rem); }
.page-head { margin-bottom: 1.8rem; }
.page-head h1 { margin-bottom: .2rem; }
.page-head time { display: block; font-size: .9rem; font-weight: 700; color: var(--red); letter-spacing: .05em; text-transform: uppercase; margin-bottom: .5rem; }
.page-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
.page-cols:has(> aside) { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; column-gap: clamp(2rem, 5vw, 4.5rem); }
.page-contact .page-cols, .page-enroll .page-cols { grid-template-columns: minmax(0, 1fr) 340px; }
@media (max-width: 900px) { .page-cols:has(> aside), .page-contact .page-cols, .page-enroll .page-cols { grid-template-columns: 1fr; } }
.page-side { position: sticky; top: 100px; display: grid; gap: 1.1rem; }
.page-logo { width: 150px; height: 150px; justify-self: center; filter: drop-shadow(0 10px 18px rgb(60 30 10 / .18)); }
.side-nav { padding: 1.1rem 1rem; }
.side-nav h2 { font-size: 1.05rem; margin: 0 .5rem .5rem; }
.side-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side-nav a { display: block; padding: .45rem .6rem; border-radius: 9px; color: var(--ink); text-decoration: none; font-size: .96rem; }
.side-nav a:hover { background: var(--cream); color: var(--red-d); }
.side-nav a[aria-current] { background: var(--red-l); color: var(--red); font-weight: 600; }
.side-contact { padding: 1rem 1.2rem; font-size: .95rem; }
.side-contact p { display: flex; gap: .6rem; align-items: center; margin: 0 0 .5rem; }
.side-contact .i { color: var(--red); }
@media (max-width: 900px) { .page-side { position: static; } .page-logo { display: none; } }
.contact-card { position: sticky; top: 100px; }
.contact-card h2 { font-size: 1.15rem; display: block; }
.contact-card p { display: flex; gap: .7rem; align-items: flex-start; }
.contact-card p .i { color: var(--red); margin-top: .2em; }

.prose { max-width: 74ch; font-size: 1.05rem; }
.prose h2 { font-size: 1.55rem; margin-top: 1.6em; }
.prose h3 { font-size: 1.25rem; margin-top: 1.4em; }
.prose h4 { font-size: 1.08rem; margin-top: 1.2em; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: .3em; }
.prose li::marker { color: var(--red); }
.prose u { text-decoration: none; font-weight: 700; color: var(--ink); }
.prose blockquote { margin: 1.2em 0; padding: .9em 1.2em; border-left: 4px solid var(--gold); background: var(--cream); border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: 0; height: 28px; background: url(img/folk-strip.svg) center / auto 100% repeat-x; opacity: .55; margin: 1.8em 0; }
.prose img { border-radius: 12px; display: block; margin: .5em auto; box-shadow: var(--shadow); }
.prose a:has(img) { display: inline-block; max-width: 100%; }
.prose p:has(> a > img) { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.prose figure { margin: 1.5em 0; text-align: center; }
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: .97rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: .5em .7em; text-align: left; vertical-align: top; }
.prose th { background: var(--cream); }
.page .prose { margin-inline: 0; }

.post .prose, .post .note { max-width: 74ch; }
.post-poster { margin: 0 0 2rem; max-width: 760px; }
.post-poster a { display: inline-block; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-h); background: #fff; }
.post-poster img { display: block; max-height: 80vh; width: auto; }
.post-poster figcaption { font-size: .85rem; color: var(--muted); margin-top: .5rem; }
.post-gallery { display: flex; align-items: flex-end; gap: 1.5rem; flex-wrap: wrap; margin: 2rem 0; padding: 1.2rem; background: var(--cream); border-radius: var(--radius); max-width: 760px; }
.post-gallery .album-card { width: min(100%, 300px); }

.prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.prevnext a { display: flex; flex-direction: column; gap: .2rem; text-decoration: none; color: var(--ink); font: 600 1.05rem/1.3 var(--serif); padding: .9rem 1.1rem; border-radius: 14px; border: 1px solid var(--line); background: #fff; }
.prevnext a:hover { border-color: var(--red); color: var(--red-d); }
.prevnext small { display: inline-flex; align-items: center; gap: .4em; font: 700 .78rem var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.prevnext .next { text-align: right; align-items: flex-end; }
@media (max-width: 600px) { .prevnext { grid-template-columns: 1fr; } }

.pager { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: .6rem; margin-top: 2.5rem; }
.pager > a { display: inline-flex; align-items: center; gap: .4em; font-weight: 600; text-decoration: none; padding: .5em .9em; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; }
.pager-nums { display: flex; gap: .3rem; }
.pager-nums a, .pager-nums span { min-width: 2.4em; height: 2.4em; display: inline-grid; place-items: center; border-radius: 999px; text-decoration: none; font-weight: 600; }
.pager-nums a { color: var(--ink); }
.pager-nums a:hover { background: var(--cream); }
.pager-nums [aria-current] { background: var(--red); color: #fff; }

/* ---------- staff: principal on top, then a directory grouped by school stage */

.staff-page .page-head .lead { max-width: 62ch; color: var(--muted); font-size: 1.08rem; margin: .3rem 0 0; }
.lead-card { position: relative; overflow: hidden; display: flex; align-items: center; gap: 1.5rem; padding: 1.5rem 1.8rem; margin-bottom: 2.6rem; background: var(--cream); border-radius: var(--radius); border: 1px solid var(--line); }
.lead-card::after { content: ""; position: absolute; right: -70px; top: -70px; width: 260px; height: 260px; background: url(img/rosette.svg) center / contain no-repeat; opacity: .13; pointer-events: none; }
.lead-card img { flex: none; width: 104px; height: 104px; border-radius: 50%; background: #fff; padding: 4px; box-shadow: 0 0 0 1px var(--line), 0 0 0 6px #fff, 0 0 0 7px var(--line); }
.lead-role { margin: 0 0 .15rem; font: 700 .78rem/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.lead-card h2 { margin: 0 0 .5rem; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
.lead-contact { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: 0; position: relative; z-index: 1; }
.lead-contact a { display: inline-flex; align-items: center; gap: .45em; font-weight: 600; text-decoration: none; }
.lead-contact a:hover { text-decoration: underline; }
@media (max-width: 560px) { .lead-card { flex-direction: column; align-items: flex-start; padding: 1.3rem; } .lead-card img { width: 80px; height: 80px; } }

.staff-group { margin-bottom: 2.4rem; }
.staff-group h2 { display: flex; align-items: center; gap: .55rem; font-size: 1.35rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line); margin-bottom: .2rem; }
.staff-group h2::before { content: "◆"; color: var(--red); font-size: .55em; }
.people { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); column-gap: 2.5rem; }
.person { display: flex; align-items: center; gap: 1rem; padding: 1rem 0; border-bottom: 1px dashed var(--line); }
.medal { flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: #fff; color: var(--red); font: 650 1.2rem/1 var(--serif); letter-spacing: .02em; box-shadow: inset 0 0 0 1.5px var(--red), inset 0 0 0 4px #fff, inset 0 0 0 5px rgb(200 16 46 / .3); }
.medal-board { font-size: 1.05rem; }
.person-txt { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.person-name { font: 600 1.18rem/1.25 var(--serif); }
.person-role { font-size: .9rem; color: var(--muted); }
.person-mail { display: inline-flex; align-items: center; gap: .4em; font-size: .9rem; margin-top: .15rem; word-break: break-all; text-decoration: none; }
.person-mail:hover { text-decoration: underline; }
.people-board { margin-top: 1rem; }

/* ---------- calendar */

.cal-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; }
.cal-head h1 span { color: var(--red); white-space: nowrap; }
.cal-legend { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; padding: 0; margin: 0; font-size: .92rem; }
.cal-legend li { display: flex; align-items: center; gap: .45em; }
.cal-legend li::before { content: ""; width: .8em; height: .8em; border-radius: 3px; background: var(--gold); }
.cal-legend .ev-mass::before { background: var(--blue); }
.cal-legend .ev-off::before { background: var(--red); }
.cal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 1.25rem; align-items: start; }
.cal-month { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cal-month h2 { margin: 0; padding: 1rem 1.2rem .8rem; background: var(--cream); font-size: 1.35rem; border-bottom: 2px solid var(--gold); display: flex; align-items: baseline; gap: .5rem; }
.cal-month h2 small { font: 600 .85rem var(--sans); color: var(--muted); }
.cal-note { margin: 0; padding: .55rem 1.2rem; font: italic .95rem var(--serif); color: var(--ink-2); background: #fcf8f1; border-bottom: 1px solid var(--line); }
.cal-note::before { content: "◆ "; color: var(--gold); font-style: normal; }
.cal-month ol { list-style: none; margin: 0; padding: .3rem 0; }
.cal-month .ev { display: grid; grid-template-columns: 54px 1fr; gap: .6rem; padding: .6rem 1.2rem .6rem .9rem; border-left: 4px solid var(--gold); margin-left: 0; font-size: .97rem; line-height: 1.4; }
.cal-month .ev + .ev { border-top: 1px dashed var(--line); }
.cal-month .ev-mass { border-left-color: var(--blue); }
.cal-month .ev-off { border-left-color: var(--red); background: #fff7f8; }
.cal-month .ev-none { border-left-color: var(--line); color: var(--muted); }
.cal-month time { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.cal-month time b { font: 650 1.45rem/1 var(--serif); color: var(--red-d); }
.cal-month .ev-none time b { color: #bbb; }
.cal-month time small { font-size: .72rem; color: var(--muted); margin-top: 3px; }
.cal-month .ev-star { text-align: center; color: var(--gold); font-size: 1.2rem; }
.cal-month .past { opacity: .45; }
.cal-month .next { background: #fffbea; box-shadow: inset 0 0 0 2px var(--gold); }
.cal-foot { margin-top: 1.5rem; color: var(--muted); font-style: italic; }

/* ---------- homework */

.hw-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; }
.hw-years { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; font-size: .92rem; }
.hw-years span { color: var(--muted); margin-right: .3rem; }
.hw-years a { padding: .3em .7em; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 600; }
.hw-years a:hover { background: var(--cream); }
.hw-years [aria-current] { background: var(--ink); color: #fff; }
.hw-filter { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; margin-bottom: 1.5rem; position: sticky; top: 80px; z-index: 5; padding: .6rem 0; background: rgb(255 253 249 / .95); }
.hw-filter > span { font-weight: 600; font-size: .92rem; margin-right: .2rem; }
.hw-days { display: grid; gap: 1.25rem; max-width: 860px; }
.hw-day h2 { font-size: 1.4rem; margin-bottom: .9rem; }
.hw-day h2 a { color: var(--ink); text-decoration: none; }
.hw-day h2 a:hover { color: var(--green); }
.hw-item { padding: .9rem 0 .3rem; border-top: 1px solid var(--line); }
.hw-item h3 { display: inline-block; font: 700 .8rem/1 var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--green); background: #eaf5ee; padding: .45em .8em; border-radius: 999px; margin: 0 0 .7rem; }
.hw-general h3 { color: var(--red-d); background: var(--red-l); }
.hw-item .prose { font-size: 1rem; }
.hw-item .prose p { margin-bottom: .45em; }

/* ---------- album / justified grid */

.album-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; }
.album-count { color: var(--muted); margin: 0; }
.album-desc { margin-bottom: 1.5rem; }
.jg { display: flex; flex-wrap: wrap; gap: 6px; }
.jg::after { content: ""; flex-grow: 1e6; }
.jg a { position: relative; display: block; flex-grow: calc(var(--r) * 100); width: calc(var(--r) * 230px); aspect-ratio: var(--r); border-radius: 6px; overflow: hidden; }
.jg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s, filter .2s; }
.jg a:hover img { transform: scale(1.04); filter: brightness(1.05); }
@media (max-width: 600px) { .jg { gap: 4px; } .jg a { width: calc(var(--r) * 130px); border-radius: 4px; } }
.album-others { margin-top: 3.5rem; }

/* ---------- 404 */

.notfound { position: relative; text-align: center; padding-block: clamp(3rem, 10vw, 7rem); overflow: hidden; }
.notfound .lead { max-width: 560px; margin-inline: auto; }
.notfound .hero-cta { justify-content: center; margin-top: 1.5rem; }
.notfound .hero-rosette { position: absolute; left: 50%; top: 50%; right: auto; bottom: auto; transform: translate(-50%, -50%); width: 480px; height: 480px; opacity: .07; }

/* ---------- footer */

.foot { margin-top: clamp(3rem, 8vw, 5rem); background: var(--ink); color: rgb(255 255 255 / .78); font-size: .95rem; }
.folk-strip { height: 28px; background: var(--paper) url(img/folk-strip.svg) center / auto 100% repeat-x; border-bottom: 4px solid var(--red); }
.funding + .foot, .about-band + .foot { margin-top: clamp(3rem, 8vw, 5rem); }
.foot-in { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; padding-block: 3rem 2rem; }
.foot h2 { font: 700 .8rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: #fff; margin-bottom: 1rem; }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.foot a { color: rgb(255 255 255 / .85); text-decoration: none; display: inline-flex; align-items: center; gap: .5em; }
.foot a:hover { color: #fff; text-decoration: underline; }
.foot address { font-style: normal; line-height: 1.8; margin: 1rem 0; }
.foot-brand { font: 600 1.15rem/1.3 var(--serif) !important; color: #fff !important; gap: .8rem !important; }
.foot-brand img { width: 64px; height: 64px; background: #fff; border-radius: 50%; padding: 3px; }
.foot-map { font-weight: 600; color: #fff !important; }
.foot-bottom { border-top: 1px solid rgb(255 255 255 / .12); padding-block: 1.2rem; font-size: .85rem; color: rgb(255 255 255 / .55); }
.foot-bottom p { margin: 0; }
@media (max-width: 800px) { .foot-in { grid-template-columns: 1fr 1fr; } .foot-school { grid-column: 1 / -1; } }
@media (max-width: 480px) { .foot-in { grid-template-columns: 1fr; } }

.adminbar { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; gap: 2px; background: var(--ink); border-radius: 999px; padding: 4px; box-shadow: var(--shadow-h); }
.adminbar a { color: #fff; text-decoration: none; font-size: .85rem; font-weight: 600; padding: .45em 1em; border-radius: 999px; }
.adminbar a:hover { background: rgb(255 255 255 / .15); color: #fff; }

/* ---------- lightbox */

.lb { position: fixed; inset: 0; z-index: 1000; background: #0c0b0e; color: #fff; display: flex; align-items: center; justify-content: center; user-select: none; -webkit-user-select: none; touch-action: pan-y pinch-zoom; }
.lb-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.lb-img { position: absolute; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; opacity: 0; transition: opacity .6s ease; }
.lb-img.on { opacity: 1; }
/* Zoomed: only the current photo takes space (the other slot held the previous one and left a
   black band above or below), centred while smaller than the screen; margin:auto in a grid
   keeps a bigger photo scrollable from its top-left corner. */
.lb.zoom .lb-stage { overflow: auto; display: grid; cursor: zoom-out; touch-action: auto; }
.lb.zoom .lb-img { position: static; max-width: none; max-height: none; margin: auto; display: block; }
.lb.zoom .lb-img:not(.on) { display: none; }
.lb:not(.zoom) .lb-img.on { cursor: zoom-in; }
.lb-bar { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: .35rem; padding: .7rem .8rem; background: linear-gradient(rgb(0 0 0 / .6), transparent); transition: opacity .3s; z-index: 2; }
.lb-count { margin-right: auto; font-size: .92rem; font-variant-numeric: tabular-nums; padding-left: .4rem; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb button, .lb a.lb-btn { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 .7rem; border: 0; border-radius: 999px; background: rgb(255 255 255 / .1); color: #fff; font: 600 .88rem var(--sans); cursor: pointer; text-decoration: none; transition: background .15s; }
.lb button:hover, .lb a.lb-btn:hover { background: rgb(255 255 255 / .22); color: #fff; }
.lb button[aria-pressed="true"] { background: #fff; color: #111; }
.lb .lb-play { display: inline-flex; align-items: center; gap: .45rem; padding: 0 1.05rem 0 .85rem; }
.lb .i { width: 20px; height: 20px; }
.lb-speed { appearance: none; background: rgb(255 255 255 / .1); color: #fff; border: 0; border-radius: 999px; height: 44px; padding: 0 .9rem; font: 600 .88rem var(--sans); cursor: pointer; }
.lb-speed option { color: #000; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 56px !important; height: 56px !important; background: rgb(255 255 255 / .08) !important; transition: opacity .3s, background .15s; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-progress { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--red); z-index: 2; }
.lb-progress.run { animation: lb-progress var(--t, 5s) linear forwards; }
@keyframes lb-progress { to { width: 100%; } }
.lb-spin { position: absolute; width: 38px; height: 38px; border: 3px solid rgb(255 255 255 / .2); border-top-color: #fff; border-radius: 50%; animation: lb-spin .8s linear infinite; opacity: 0; transition: opacity .2s .25s; }
.lb.loading .lb-spin { opacity: 1; }
@keyframes lb-spin { to { transform: rotate(360deg); } }
.lb.idle { cursor: none; }
.lb.idle .lb-bar, .lb.idle .lb-nav { opacity: 0; pointer-events: none; }
@media (max-width: 640px) {
	.lb-nav { display: none !important; }
	.lb-bar { flex-wrap: wrap; justify-content: flex-end; }
	.lb-count { flex: 1 0 100%; padding-bottom: .2rem; }
	.lb-hide-s { display: none !important; }
}
html.lb-open { overflow: hidden; }

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

@media print {
	.top, .foot, .crumbs, .hw-filter, .hw-years, .adminbar, .prevnext, .hero-cta, .album-others { display: none !important; }
	body { font-size: 12pt; background: #fff; }
	.card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
	a { color: inherit; text-decoration: none; }
}

/* small screens: two albums per row, tighter footer line */
@media (max-width: 600px) {
	.album-grid { grid-template-columns: 1fr 1fr; gap: 1rem .8rem; }
	.album-card strong { font-size: .97rem; }
	.album-card time { font-size: .8rem; }
	.album-img { border-radius: 12px; margin-bottom: .25rem; }
}
.foot-bottom { border-top: 0; }
.foot-bottom p { border-top: 1px solid rgb(255 255 255 / .12); padding-top: 1.2rem; }

/* Patron: the painting floats beside the text */
.page-patron .prose > figure:first-child { float: right; width: min(32%, 210px); margin: .3rem 0 1rem 1.8rem; }
.page-patron .prose > figure:first-child img { margin: 0; }
.prose figcaption { font-size: .82rem; line-height: 1.4; color: var(--muted); margin-top: .5rem; }
@media (max-width: 600px) { .page-patron .prose > figure:first-child { width: 38%; margin: .2rem 0 .8rem 1rem; } .page-patron .prose > figure:first-child figcaption { font-size: .72rem; } }
.hw-lang { color: var(--muted); max-width: 60ch; margin: .2rem 0 0; }

/* Home arch: photos from the gallery fade slowly one into another */
.hero-slides { isolation: isolate; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.8s ease; }
.hero-slide.on { opacity: 1; z-index: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.06); transition: transform 9s linear; }
.hero-slide.on img { transform: scale(1); }
.hero-cap { position: absolute; left: 50%; bottom: .9rem; transform: translateX(-50%); display: inline-flex; align-items: center; gap: .4em; max-width: calc(100% - 2rem); padding: .3em .8em; border-radius: 999px; background: rgb(20 15 25 / .62); color: #fff; font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; backdrop-filter: blur(4px); }
.hero-slide:hover .hero-cap { background: var(--red); }

/* ---------- "Szkoła" section: tabs instead of a sidebar, page-specific layouts */

.sec-tabs { display: flex; gap: .2rem; margin-top: 1.1rem; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.sec-tabs::-webkit-scrollbar { display: none; }
.sec-tabs a { flex: none; padding: .55rem .9rem .65rem; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .95rem; border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.sec-tabs a:hover { color: var(--red-d); }
.sec-tabs a[aria-current] { color: var(--red); border-bottom-color: var(--red); }
.staff-page .page-head .lead { margin-top: 1.2rem; }

.school-cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
@media (max-width: 900px) { .school-cols { grid-template-columns: 1fr; } }
.school-side { position: sticky; top: 100px; display: grid; gap: 1.2rem; }
@media (max-width: 900px) { .school-side { position: static; } }
.side-card { display: flex; flex-direction: column; gap: .35rem; padding: 1.2rem 1.3rem; background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); }
.side-card strong { font: 600 1.25rem/1.25 var(--serif); margin-bottom: .2rem; }
.side-card a { display: inline-flex; align-items: center; gap: .45em; font-weight: 600; text-decoration: none; font-size: .95rem; }
.side-card a:hover { text-decoration: underline; }
.facts-light { grid-template-columns: 1fr 1fr; gap: 1.1rem 1.3rem; }
.facts-light div { border-top-color: var(--line); }
.facts-light dt { font-size: 1.35rem; color: var(--red-d); }
.facts-light dd { color: var(--muted); font-size: .86rem; }
.prose-lead > p:first-child { font-size: 1.18rem; line-height: 1.6; color: var(--ink); }
.school-more { margin-top: clamp(2.5rem, 6vw, 4rem); padding-top: 1.6rem; border-top: 1px solid var(--line); }

/* History: the year headings in the text become a timeline */
.timeline { position: relative; max-width: 78ch; padding-left: 2.2rem; }
.timeline::before { content: ""; position: absolute; left: .45rem; top: .6rem; bottom: .6rem; width: 2px; background: linear-gradient(var(--red), var(--gold) 60%, var(--line)); border-radius: 2px; }
.timeline h3 { position: relative; display: inline-block; margin: 1.9rem 0 .55rem; padding: .25em .75em; font: 650 1.05rem/1.2 var(--serif); color: #fff; background: var(--red); border-radius: 999px; }
.timeline h3:first-child { margin-top: 0; }
.timeline h3::before { content: ""; position: absolute; left: calc(-2.2rem + .45rem - 6px); top: 50%; width: 14px; height: 14px; margin-top: -7px; background: var(--paper); border: 3px solid var(--red); border-radius: 50%; box-sizing: border-box; }
.timeline h3:last-of-type { background: var(--ink); }
.timeline h3:last-of-type::before { border-color: var(--ink); }

/* Patron: painting floats beside the text, dates in a side card */
.page-patron .prose-patron > figure:first-child { float: left; width: min(40%, 250px); margin: .3rem 1.8rem 1rem 0; }
.page-patron .prose-patron > figure:first-child img { margin: 0; box-shadow: var(--shadow-h); }
.page-patron .prose-patron > p:first-of-type::first-letter, .page-about .prose-lead > p:first-child::first-letter { float: left; font: 650 3.4em/.8 var(--serif); color: var(--red); margin: .08em .12em 0 0; }
@media (max-width: 600px) { .page-patron .prose-patron > figure:first-child { width: 42%; margin: .2rem 1rem .8rem 0; } }
.glance h2 { display: flex; align-items: center; gap: .5rem; font-size: 1.15rem; margin: 0 0 .4rem; }
.glance h2::before { content: "◆"; color: var(--red); font-size: .6em; }
.glance ol { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.glance li { display: grid; grid-template-columns: 4.2rem 1fr; gap: .6rem; font-size: .92rem; line-height: 1.4; }
.glance b { font: 650 1.05rem/1.3 var(--serif); color: var(--red-d); }

/* Affiliated organisations use the directory look of the staff page */
.orgs { margin-top: .4rem; }
.orgs .person-mail .i { transform: rotate(-45deg); }

/* ---------- Zapisy and Kontakt: facts, numbered steps, contact cards */

.info-main { display: grid; gap: 2rem; min-width: 0; }
.info-sec h2 { display: flex; align-items: center; gap: .55rem; font-size: 1.35rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line); margin: 0 0 1rem; }
.info-sec h2::before { content: "◆"; color: var(--red); font-size: .55em; }
.info-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 1rem; margin: 0; }
.info-facts div { padding: 1rem 1.1rem; background: var(--cream); border-radius: var(--radius); border: 1px solid var(--line); }
.info-facts dt { font: 700 .76rem/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--red); margin-bottom: .35rem; }
.info-facts dd { margin: 0; font-size: .98rem; line-height: 1.45; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.steps li { display: flex; gap: 1rem; align-items: flex-start; padding: .9rem 0; border-bottom: 1px dashed var(--line); }
.steps li:last-child { border-bottom: 0; }
.steps .medal { width: 44px; height: 44px; font-size: 1.15rem; }
.steps li > div { min-width: 0; padding-top: .55rem; }
.steps p { margin: 0 0 .6rem; }
.steps .btn .i { transform: rotate(90deg); }

.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 2.6rem; }
@media (max-width: 700px) { .contact-grid { grid-template-columns: 1fr; } }
.c-card { display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.2rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; transition: border-color .15s, background .15s; min-width: 0; }
.c-card:hover { border-color: var(--red); background: var(--cream); color: var(--ink); }
.c-card .medal .i { width: 22px; height: 22px; }
.c-card > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.c-card small { font: 700 .74rem/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.c-card strong { font: 600 1.15rem/1.3 var(--serif); overflow-wrap: break-word; }
.contact-cols .prose { max-width: 62ch; }

.contact-card h2::before { content: none; }
.buildings { display: grid; gap: 1rem; }
.building { max-width: none; padding: 1.1rem 1.3rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.building h3 { margin: 0 0 .4rem; font-size: 1.15rem; }
.building p { margin: 0 0 .7rem; }
.building p:last-child { margin-bottom: 0; }
.building .btn { color: #fff; text-decoration: none; }
.buildings { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.contact-cols .building { max-width: none; display: flex; flex-direction: column; }
.building p:last-child { margin-top: auto; padding-top: .3rem; }


/* Footer: school badge centred on top, then three equal columns that all start with the same kind of heading */
.foot-top { display: flex; justify-content: center; padding-block: 2.6rem 0; }
.foot-top .foot-brand { flex-direction: column; text-align: center; gap: .7rem !important; font-size: 1.25rem !important; }
.foot-top .foot-brand img { width: 88px; height: 88px; background: none; padding: 0; border-radius: 0; }
.foot-in { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-block: 2.2rem 2rem; margin-top: 2rem; border-top: 1px solid rgb(255 255 255 / .12); }
.foot address { margin: 0 0 .9rem; line-height: 1.75; }
@media (max-width: 800px) { .foot-in { grid-template-columns: 1fr 1fr; } .foot-school { grid-column: 1 / -1; } }
@media (max-width: 480px) { .foot-in { grid-template-columns: 1fr; } }
.foot-in.wrap { width: calc(100% - 2 * var(--gut)); max-width: var(--wrap); padding-inline: 0; }
/* Header and footer: white header, light footer in the page's own warm tones (no extra colours) */
.top { background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; border-top: 3px solid var(--red); border-bottom: 1px solid var(--line); box-shadow: 0 6px 18px -16px rgb(60 30 10 / .5); }
.foot { background: var(--cream); color: var(--ink-2); }
.folk-strip { background-color: var(--paper); border-bottom: 1px solid var(--line); }
.foot h2 { color: var(--red); }
.foot a { color: var(--ink-2); }
.foot a:hover { color: var(--red-d); }
.foot-brand, .foot-top .foot-brand { color: var(--ink) !important; }
.foot-map { color: var(--red-d) !important; }
.foot-in { border-top-color: var(--line); }
.foot-bottom { color: var(--muted); }
.foot-bottom p { border-top-color: var(--line) !important; }
/* The footer starts in the page colour and fades into its own cream, no hard edge */
.foot { background: linear-gradient(180deg, var(--paper) 0, var(--cream) 260px) var(--cream); }
.folk-strip { background-color: transparent; border-bottom: 0; }

/* Compact footer (~25% lower): badge beside the name, tighter spacing, two link lists side by side on phones */
.foot-top { padding-block: 1.8rem 0; }
.foot-top .foot-brand { flex-direction: row; text-align: left; gap: .9rem !important; font-size: 1.15rem !important; }
.foot-top .foot-brand img { width: 60px; height: 60px; }
.foot-in { margin-top: 1.4rem; padding-block: 1.5rem 1.2rem; }
.foot h2 { margin-bottom: .6rem; }
.foot ul { gap: .3rem; }
.foot address { line-height: 1.6; margin-bottom: .6rem; }
.foot-bottom { padding-block: .9rem; font-size: .82rem; }
.foot-bottom p { padding-top: .9rem; }
@media (max-width: 480px) {
	.foot-in { grid-template-columns: 1fr 1fr; column-gap: 1rem; row-gap: 1.4rem; }
	.foot-school { grid-column: 1 / -1; }
	.foot a, .foot address { font-size: .92rem; }
	.foot-top .foot-brand { font-size: 1rem !important; }
	.foot-top .foot-brand img { width: 52px; height: 52px; }
}
/* readable month labels on small date badges */
.leaf small { font-size: .74rem; }
.event-list time { font-size: .74rem; }

/* Footer on phones: centred and symmetric (badge over the name, contact, two link lists of equal height) */
@media (max-width: 600px) {
	.foot-top { padding-top: 1.6rem; }
	.foot-top .foot-brand { flex-direction: column; text-align: center; gap: .55rem !important; max-width: 17rem; }
	.foot-in { grid-template-columns: 1fr 1fr; column-gap: 1rem; row-gap: 1.6rem; text-align: center; margin-top: 1.2rem; padding-top: 1.4rem; }
	.foot-school { grid-column: 1 / -1; }
	.foot-in h2 { display: flex; align-items: flex-end; justify-content: center; margin-bottom: .55rem; }
	.foot-in section:not(.foot-school) h2 { min-height: 2.6em; }
	.foot ul { justify-items: center; }
	.foot a, .foot address { font-size: .93rem; }
	.foot-map { justify-content: center; }
	.foot-bottom { text-align: center; }
}
/* Footer on tablets: three columns like on desktop; headings share one baseline even when one wraps */
@media (min-width: 601px) and (max-width: 1060px) {
	.foot-in { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 1.5rem; }
	.foot-school { grid-column: auto; }
	.foot-in h2 { min-height: 2.6em; display: flex; align-items: flex-end; }
}
/* section tabs: soft fade at the edges hints that the bar scrolls sideways on phones */
@media (max-width: 900px) { .sec-tabs { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent); } }

/* ---------- phones: tidy, symmetric layout (review 3.12) */
.post-list-wide .post-img img { object-position: 50% 15%; } /* posters: keep their title in the crop */
@media (max-width: 600px) {
	/* buttons in a row share the width equally; one button alone fills the line */
	.hero-cta { display: grid; grid-template-columns: 1fr; gap: .65rem; }
	.hero-cta .btn { justify-content: center; }
	.album-head .btn { width: 100%; justify-content: center; }
	/* homework classes on the home page: an even grid instead of a ragged line */
	.chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.chips .chip { display: block; text-align: center; padding-inline: .3em; }
	/* homework filter stays one line (it sticks to the top while scrolling) and slides sideways */
	.hw-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--gut)); padding-inline: var(--gut);
		-webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); }
	.hw-filter::-webkit-scrollbar { display: none; }
	.hw-filter > * { flex: none; }
	/* album photos: two or three per row instead of one by one */
	.jg a { width: calc(var(--r) * 95px); }
	/* funding: posters two by two, wide pictures across */
	.funding-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; }
	.funding figure { flex: none; width: calc(50% - .35rem); }
	.funding figure.wide { width: 100%; }
	.funding figure:not(.wide) a { aspect-ratio: 3 / 4; display: flex; align-items: center; } /* equal tiles side by side */
	.funding img { width: 100%; height: auto; }
	.funding figure:not(.wide) img { height: 100%; object-fit: contain; }
	/* announcement with an album: the album card fills its box */
	.post-gallery { flex-direction: column; align-items: stretch; gap: 1rem; padding: 1rem; }
	.post-gallery .album-card { width: 100%; }
	.post-gallery .btn { justify-content: center; }
	/* newer / older: both aligned the same way when stacked */
	.prevnext .next { text-align: left; align-items: flex-start; }
	/* patron painting: centred above the text rather than squeezing it into a narrow column */
	.page-patron .prose > figure:first-child, .page-patron .prose-patron > figure:first-child { float: none; width: min(50%, 210px); margin: .3rem auto 1.4rem; text-align: center; }
	.page-patron .prose > figure:first-child figcaption, .page-patron .prose-patron > figure:first-child figcaption { font-size: .78rem; }
}
/* narrow phones (360 px): the school name keeps to two lines beside the menu button */
@media (max-width: 380px) {
	.brand { gap: .55rem; }
	.brand-t b { font-size: .92rem; }
	.brand-t small { font-size: .7rem; }
	.menu-btn { padding-inline: .8rem; }
}
