/* ==========================================================================
   Master's Year — main stylesheet
   ========================================================================== */

:root {
	--ink: #1b1e26;
	--muted: #5d6270;
	--paper: #f7f4ee;
	--card: #ffffff;
	--line: #ddd5c6;
	--navy: #15213a;
	--navy-2: #1d2c4b;
	--accent: #a8843f;
	--radius: 14px;
	--shadow: 0 1px 2px rgba(21, 33, 58, .06), 0 8px 24px rgba(21, 33, 58, .07);
	--shadow-hover: 0 2px 4px rgba(21, 33, 58, .08), 0 16px 40px rgba(21, 33, 58, .13);
	--serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
	--sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--wrap: 1180px;
	--narrow: 740px;
	--date-w: 112px;
	--rail: 32px;
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 1.0625rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
[hidden] { display: none !important; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.wrap--narrow { width: min(100% - 2.5rem, var(--narrow)); }

.skip-link {
	position: absolute; left: -9999px; top: 0; z-index: 100;
	background: #fff; color: var(--ink); padding: .6rem 1rem;
}
.skip-link:focus { left: 1rem; top: 1rem; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.kicker {
	margin: 0 0 .6rem;
	font-size: .8rem;
	font-weight: 700;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--accent);
}

/* ---------- Header ---------- */

.site-header { background: var(--navy); color: #fff; }
.site-header__inner {
	display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
	min-height: 76px; padding-block: .9rem;
}
.brand { display: flex; align-items: center; gap: .9rem; text-decoration: none; }
.brand__logo { width: auto; max-height: 52px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__name { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; letter-spacing: .01em; }
.brand__tag { font-size: .8rem; opacity: .7; letter-spacing: .04em; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; }
.site-nav a { text-decoration: none; font-weight: 600; font-size: .95rem; opacity: .85; }
.site-nav a:hover, .site-nav .current-menu-item a { opacity: 1; color: var(--accent); }

/* ---------- Hero ---------- */

.hero {
	background:
		radial-gradient(1200px 400px at 85% -10%, rgba(168, 132, 63, .22), transparent 60%),
		linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
	color: #fff;
	padding: clamp(3rem, 8vw, 6rem) 0 clamp(3.5rem, 8vw, 6.5rem);
}
.hero__inner { display: grid; gap: 3rem; align-items: center; }
.hero--with-image .hero__inner { grid-template-columns: 1.25fr .75fr; }
.hero__title {
	font-family: var(--serif);
	font-weight: 600;
	font-size: clamp(2.8rem, 7vw, 5.2rem);
	line-height: .98;
	margin: 0 0 1.2rem;
	letter-spacing: -.01em;
}
.hero__intro { font-size: clamp(1.1rem, 1.8vw, 1.3rem); max-width: 38em; margin: 0; opacity: .86; }
.hero__figure { margin: 0; }
.hero__img {
	width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
	border-radius: var(--radius);
	box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 30px 60px rgba(0,0,0,.35);
}
@media (max-width: 820px) {
	.hero--with-image .hero__inner { grid-template-columns: 1fr; }
	.hero__figure { max-width: 320px; order: -1; }
}

/* ---------- Filter / sort bar ---------- */

.timeline__bar {
	position: sticky; top: 0; z-index: 20;
	background: rgba(247, 244, 238, .92);
	backdrop-filter: saturate(140%) blur(10px);
	-webkit-backdrop-filter: saturate(140%) blur(10px);
	border-bottom: 1px solid var(--line);
}
.admin-bar .timeline__bar { top: 32px; }
@media (max-width: 782px) { .admin-bar .timeline__bar { top: 46px; } }
@media (max-width: 600px) { .admin-bar .timeline__bar { top: 0; } }

.timeline__bar-inner {
	display: flex; align-items: center; justify-content: space-between; gap: .75rem 1.5rem;
	padding-block: .85rem;
	flex-wrap: wrap;
}

.filters { display: flex; flex-wrap: wrap; gap: .45rem; }
.filter {
	--c: var(--navy);
	display: inline-flex; align-items: center; gap: .45rem;
	padding: .42rem .85rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: #fff;
	font-size: .9rem; font-weight: 600;
	text-decoration: none;
	color: var(--ink);
	transition: background .15s, border-color .15s, color .15s;
	white-space: nowrap;
}
.filter:hover { border-color: var(--c); }
.filter__dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--c); }
.filter__count {
	font-size: .75rem; font-weight: 700; color: var(--muted);
	background: var(--paper); border-radius: 999px; padding: 0 .45rem; min-width: 1.5rem; text-align: center;
}
.filter[aria-current="true"] { background: var(--c); border-color: var(--c); color: #fff; }
.filter[aria-current="true"] .filter__dot { background: #fff; }
.filter[aria-current="true"] .filter__count { background: rgba(255,255,255,.2); color: #fff; }

.sort {
	display: inline-flex; padding: 3px;
	background: #fff; border: 1px solid var(--line); border-radius: 999px;
}
.sort__btn {
	padding: .32rem .8rem; border-radius: 999px;
	font-size: .85rem; font-weight: 600; text-decoration: none; color: var(--muted);
}
.sort__btn[aria-current="true"] { background: var(--navy); color: #fff; }

@media (max-width: 700px) {
	.filters { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; scrollbar-width: none; }
	.filters::-webkit-scrollbar { display: none; }
}

/* ---------- Timeline ---------- */

.timeline { padding-bottom: 5rem; }
.timeline__status { color: var(--muted); font-size: .9rem; margin: 1.6rem 0 .5rem; }
.timeline__empty {
	text-align: center; color: var(--muted); padding: 4rem 1rem;
	font-family: var(--serif); font-size: 1.5rem;
}

.timeline__list { position: relative; list-style: none; margin: 0; padding: 0; }
.timeline__list::before {
	content: "";
	position: absolute; top: .5rem; bottom: 0;
	left: calc(var(--date-w) + var(--rail) / 2 - 1px);
	width: 2px;
	background: linear-gradient(var(--line), var(--line) 92%, transparent);
}

.tl-month {
	position: relative;
	padding: 2.4rem 0 1rem calc(var(--date-w) + var(--rail) + 1.5rem);
}
.tl-month::before {
	content: "";
	position: absolute;
	left: calc(var(--date-w) + var(--rail) / 2 - 7px);
	top: calc(2.4rem + .95rem);
	width: 14px; height: 14px;
	background: var(--accent);
	transform: rotate(45deg);
	box-shadow: 0 0 0 5px var(--paper);
}
.tl-month__label {
	margin: 0;
	font-family: var(--serif);
	font-weight: 600;
	font-size: clamp(1.7rem, 3vw, 2.3rem);
	line-height: 1.2;
}

.tl-item {
	position: relative;
	display: grid;
	grid-template-columns: var(--date-w) var(--rail) 1fr;
	align-items: start;
	padding: .75rem 0;
	animation: tl-in .35s ease both;
}
@keyframes tl-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.tl-date {
	display: grid;
	justify-items: end;
	padding-top: 1.1rem;
	padding-right: .9rem;
	line-height: 1;
	text-align: right;
}
.tl-date__day { font-family: var(--serif); font-size: 2.3rem; font-weight: 600; }
.tl-date__month { font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-top: .25rem; }
.tl-date__weekday { font-size: .78rem; color: var(--muted); margin-top: .35rem; }

.tl-dot {
	justify-self: center;
	margin-top: 1.6rem;
	width: 14px; height: 14px; border-radius: 50%;
	background: var(--paper);
	border: 3px solid var(--navy);
	box-shadow: 0 0 0 4px var(--paper);
	position: relative; z-index: 1;
}

/* ---------- Card ---------- */

.card {
	position: relative;
	margin-left: 1.5rem;
	display: grid;
	grid-template-columns: minmax(200px, 40%) 1fr;
	background: var(--card);
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: var(--shadow);
	transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card--no-image { grid-template-columns: 1fr; }

.card__media { display: block; overflow: hidden; background: #e9e4da; }
.card__media img {
	width: 100%; height: 100%; min-height: 220px;
	object-fit: cover;
	transition: transform .5s ease;
}
.card:hover .card__media img { transform: scale(1.04); }

.card__body { padding: 1.4rem 1.6rem 1.5rem; display: flex; flex-direction: column; gap: .55rem; }
.card__title {
	margin: 0;
	font-family: var(--serif);
	font-size: 1.65rem;
	font-weight: 600;
	line-height: 1.15;
}
.card__title a { text-decoration: none; }
/* Whole card clickable */
.card__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card__excerpt { margin: 0; color: var(--muted); font-size: 1rem; }
.card__more { margin-top: auto; padding-top: .35rem; font-weight: 700; font-size: .9rem; color: var(--accent); }

.type-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.type-chip {
	--c: var(--navy);
	display: inline-block;
	padding: .18rem .6rem;
	border-radius: 999px;
	font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
	color: var(--c);
	background: color-mix(in srgb, var(--c) 11%, white);
	text-decoration: none;
	position: relative; z-index: 2;
}
a.type-chip:hover { background: var(--c); color: #fff; }

@media (max-width: 960px) {
	.card { grid-template-columns: 1fr; }
	.card__media img { aspect-ratio: 3 / 2; min-height: 0; height: auto; }
}
@media (max-width: 640px) {
	:root { --date-w: 52px; --rail: 22px; }
	.tl-date { padding-right: .5rem; }
	.tl-date__day { font-size: 1.7rem; }
	.tl-date__weekday { display: none; }
	.card { margin-left: .8rem; }
	.card__body { padding: 1.1rem 1.15rem 1.2rem; }
	.card__title { font-size: 1.4rem; }
	.tl-month { padding-left: calc(var(--date-w) + var(--rail) + .8rem); }
}

/* ---------- Single event ---------- */

.event { padding-bottom: 4rem; }
.event__header { padding: clamp(2.2rem, 6vw, 4rem) 0 2rem; }
.back-link {
	display: inline-block; margin-bottom: 1.6rem;
	font-weight: 600; font-size: .95rem; text-decoration: none; color: var(--muted);
}
.back-link:hover { color: var(--ink); }
.event__title {
	margin: 0 0 1rem;
	font-family: var(--serif);
	font-weight: 600;
	font-size: clamp(2.4rem, 6vw, 4rem);
	line-height: 1.04;
}
.event__hero { margin-top: 0; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.event__hero img {
	width: 100%; max-height: 78vh; object-fit: cover;
	border-radius: var(--radius); box-shadow: var(--shadow);
}
.event__hero figcaption, .entry-content figcaption {
	font-size: .88rem; color: var(--muted); margin-top: .6rem; text-align: center;
}

/* ---------- Post content ---------- */

.entry-content > * { margin-block: 0 1.3em; }
.entry-content > p:first-child { font-size: 1.22rem; line-height: 1.6; }
.entry-content h2, .entry-content h3, .entry-content h4 {
	font-family: var(--serif); font-weight: 600; line-height: 1.2; margin-top: 2em; margin-bottom: .5em;
}
.entry-content h2 { font-size: 2rem; }
.entry-content h3 { font-size: 1.6rem; }
.entry-content a { color: var(--navy); text-decoration-color: var(--accent); text-underline-offset: 3px; }
.entry-content blockquote {
	margin-inline: 0; padding: .4rem 0 .4rem 1.4rem;
	border-left: 3px solid var(--accent);
	font-family: var(--serif); font-size: 1.5rem; line-height: 1.35; font-style: italic;
}
.entry-content figure { margin-inline: 0; }
.entry-content img { border-radius: 10px; }
.entry-content .alignwide { width: min(100vw - 2.5rem, var(--wrap)); margin-inline: calc(50% - min(100vw - 2.5rem, var(--wrap)) / 2); max-width: none; }
.entry-content .alignfull { width: 100vw; margin-inline: calc(50% - 50vw); max-width: none; }
.entry-content .alignfull img { border-radius: 0; }
.entry-content hr { border: 0; height: 1px; background: var(--line); margin-block: 2.5em; }

.entry-content .wp-block-gallery { gap: .6rem; }
.entry-content .wp-block-gallery img { border-radius: 8px; }
.entry-content img.is-zoomable { cursor: zoom-in; }

/* ---------- Prev / next ---------- */

.event-nav {
	display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
	border-top: 1px solid var(--line); padding-top: 2rem; margin-top: 3rem;
}
.event-nav__link {
	display: flex; gap: 1rem; align-items: center;
	padding: 1rem; border-radius: var(--radius);
	background: var(--card); box-shadow: var(--shadow);
	text-decoration: none;
}
.event-nav__link:hover { box-shadow: var(--shadow-hover); }
.event-nav__link--next { flex-direction: row-reverse; text-align: right; }
.event-nav__link img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; flex: none; }
.event-nav__link > span { display: flex; flex-direction: column; gap: .15rem; }
.event-nav__label { font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.event-nav__title { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; line-height: 1.2; }
.event-nav__date { font-size: .85rem; color: var(--muted); }
@media (max-width: 640px) {
	.event-nav { grid-template-columns: 1fr; }
	.event-nav__link img { width: 64px; height: 64px; }
}

/* ---------- Footer ---------- */

.site-footer { background: var(--navy); color: rgba(255,255,255,.75); font-size: .92rem; }
.site-footer__inner {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem;
	padding-block: 2.2rem;
}
.site-footer p { margin: 0; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer__org { font-family: var(--serif); font-size: 1.2rem; color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.2rem; flex-wrap: wrap; }

/* ---------- Lightbox ---------- */

.lightbox {
	position: fixed; inset: 0; z-index: 1000;
	display: grid; place-items: center;
	background: rgba(10, 14, 24, .94);
	padding: 3.5rem 4rem;
	animation: tl-fade .2s ease;
}
@keyframes tl-fade { from { opacity: 0; } to { opacity: 1; } }
.lightbox__figure { margin: 0; display: grid; gap: .8rem; justify-items: center; max-height: 100%; }
.lightbox__img { max-width: 100%; max-height: calc(100vh - 9rem); width: auto; object-fit: contain; border-radius: 6px; }
.lightbox__caption { color: rgba(255,255,255,.8); font-size: .92rem; text-align: center; }
.lightbox button {
	position: absolute;
	width: 48px; height: 48px; border-radius: 50%;
	border: 0; background: rgba(255,255,255,.1); color: #fff;
	font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.lightbox button:hover { background: rgba(255,255,255,.22); }
.lightbox__close { top: 1rem; right: 1rem; }
.lightbox__prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox__count { position: absolute; top: 1.5rem; left: 1.5rem; color: rgba(255,255,255,.6); font-size: .85rem; }
@media (max-width: 640px) {
	.lightbox { padding: 4rem .75rem; }
	.lightbox__prev, .lightbox__next { top: auto; bottom: 1rem; transform: none; }
}
body.lightbox-open { overflow: hidden; }
