/* Startup Editions: styles for the site and the editor. */

/* ---------------------------------------------------------------- People */

.sae-people {
	display: grid;
	grid-template-columns: repeat(var(--sae-columns, 2), minmax(0, 1fr));
	gap: var(--wp--preset--spacing--40, 2rem) var(--wp--preset--spacing--40, 2rem);
	margin-block: var(--wp--preset--spacing--30, 1.5rem);
}

@media (max-width: 781px) {
	.sae-people {
		grid-template-columns: minmax(0, 1fr);
	}
}

.sae-person {
	scroll-margin-top: 5rem; /* below the sticky header when jumped to from the program */
}

.sae-person p {
	margin-block: 0 0.6em;
}

.sae-person__photo {
	margin: 0;
}

.sae-person__photo img {
	display: block;
	width: 100%;
	height: auto;
}

.sae-person__name a {
	color: inherit;
}

/* Rows: photo left (26%), text right; stacked on phones. */
.sae-people--rows .sae-person {
	display: grid;
	grid-template-columns: 26% minmax(0, 1fr);
	column-gap: 1.75rem;
	align-items: start;
}

.sae-people--rows .sae-person:not(:has(.sae-person__photo)) {
	grid-template-columns: minmax(0, 1fr);
}

/* Same rhythm as the media-text blocks used before. */
.sae-people--rows .sae-person__text {
	padding-inline-end: 8%;
}

.sae-people--rows .sae-person__name {
	margin-block-start: 1em;
}

@media (max-width: 600px) {
	.sae-people--rows .sae-person__text {
		padding-inline-end: 0;
	}

	.sae-people--rows .sae-person__name {
		margin-block-start: 0;
	}

	.sae-people--rows .sae-person {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 1rem;
	}
}

/* Cards: large round photo on top. */
.sae-people--cards .sae-person__photo img {
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 9999px;
	margin-bottom: 24px;
}

.sae-people--cards .sae-person__name {
	margin-block: 0 0.2em;
}

.sae-people--cards .sae-person__bio {
	padding-block: var(--wp--preset--spacing--20, 1rem);
}

/* ----------------------------------------------------------------- Logos */

.sae-logos {
	container-type: inline-size;
	margin-block: var(--wp--preset--spacing--20, 1rem) var(--wp--preset--spacing--30, 1.5rem);
}

.sae-logos__row {
	--gap: clamp(12px, 4cqi, 40px);
	display: flex;
	flex-wrap: nowrap;
	justify-content: center;
	align-items: center;
	gap: var(--gap);
}

.sae-logo {
	display: block;
	flex: 0 0 auto;
}

/* Each logo keeps its set width on large screens; on small screens all
   logos shrink by the same factor so the row always fits on one line. */
.sae-logo img {
	display: block;
	height: auto;
	width: min(
		calc(var(--w) * 1px),
		calc((100cqi - (var(--n) - 1) * var(--gap)) * var(--w) / var(--sum))
	);
}

.sae-logo__text {
	font-size: var(--wp--preset--font-size--small);
	white-space: nowrap;
}

/* ---------------------------------------------------------- Program slot */

.sae-slot {
	display: grid;
	grid-template-columns: 20% minmax(0, 1fr);
	column-gap: 2em;
	font-size: var(--wp--preset--font-size--medium);
}

.sae-slot__time {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.sae-slot__body > * {
	margin-block: 0;
}

.sae-slot__body > * + * {
	margin-block-start: 0.15em;
}

@media (max-width: 600px) {
	.sae-slot {
		grid-template-columns: 4.5em minmax(0, 1fr);
		column-gap: 1em;
	}
}

/* -------------------------------------------- Gallery "Slideshow" style */

.wp-block-gallery.is-style-sa-slideshow.has-nested-images {
	flex-wrap: nowrap !important;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
	--sae-slide: min(85%, 960px);
}

.wp-block-gallery.is-style-sa-slideshow.has-nested-images::-webkit-scrollbar {
	display: none;
}

.wp-block-gallery.is-style-sa-slideshow.has-nested-images figure.wp-block-image:not(#sae):not(#sae) {
	flex: 0 0 var(--sae-slide) !important;
	width: var(--sae-slide) !important;
	max-width: none;
	scroll-snap-align: center;
}

.wp-block-gallery.is-style-sa-slideshow.has-nested-images figure.wp-block-image img {
	aspect-ratio: 3 / 2;
	width: 100%;
	height: auto;
	object-fit: cover;
}

@media (max-width: 600px) {
	.wp-block-gallery.is-style-sa-slideshow.has-nested-images {
		--sae-slide: 92%;
	}
}

.sae-slideshow-nav {
	display: flex;
	justify-content: center;
	gap: 0.75rem;
	margin-block-start: 1rem !important;
}

.sae-slideshow-nav[hidden] {
	display: none;
}

.sae-slideshow-nav__btn {
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 999px;
	border: 1px solid currentColor;
	background: transparent;
	color: inherit;
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
}

.sae-slideshow-nav__btn:disabled {
	opacity: 0.35;
	cursor: default;
}

.sae-slideshow-nav__btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* ---------------------------------------------------------------- Editor */

.sae-empty {
	padding: 1rem;
	border: 1px dashed currentColor;
	opacity: 0.7;
	font-size: 0.9rem;
}

.sae-slot__time:empty::before {
	opacity: 0.5;
}

/* ------------------------------------------------------------------ Menu */

/* One "Menu" button on every page; its panel holds the current symposium,
   the sections of this page and About. */
.sae-global-nav {
	position: relative;
	font-size: var(--wp--preset--font-size--small, 0.95rem);
}

.sae-global-nav a {
	color: inherit;
	text-decoration: none;
}

.sae-global-nav__toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	min-height: 44px;
	padding: 0.4em 1.1em;
	border: 1px solid currentColor;
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

.sae-global-nav__toggle:hover,
.sae-global-nav.is-open .sae-global-nav__toggle {
	background: rgba(255, 255, 255, 0.18);
}

.sae-global-nav__list {
	display: none;
	position: absolute;
	right: 0;
	top: calc(100% + 0.5rem);
	z-index: 300;
	flex-direction: column;
	align-items: stretch;
	width: min(22rem, calc(100vw - 2rem));
	max-height: calc(100vh - var(--sae-header-h, 5rem) - 1.5rem);
	overflow-y: auto;
	overscroll-behavior: contain;
	margin: 0;
	padding: 0.5rem 0;
	list-style: none;
	background: rgba(15, 23, 42, 0.97);
	color: #fff;
	border-radius: 10px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
	font-size: 1rem;
}

.sae-global-nav.is-open .sae-global-nav__list {
	display: flex;
}

.sae-global-nav__list > li > a,
.sae-past summary,
.sae-global-nav__sections a {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 0 1.1rem;
}

.sae-global-nav__list > li > a:hover,
.sae-global-nav__sections a:hover,
.sae-past summary:hover {
	background: rgba(255, 255, 255, 0.08);
}

.sae-global-nav__list > li > a.is-active:not(.sae-global-nav__current) {
	box-shadow: inset 3px 0 0 currentColor;
}

/* The upcoming edition stands out. */
.sae-global-nav .sae-global-nav__current {
	justify-content: center;
	margin: 0.4rem 1.1rem 0.5rem;
	border: 1px solid currentColor;
	border-radius: 999px;
	font-weight: 600;
}

.sae-global-nav .sae-global-nav__current.is-active,
.sae-global-nav .sae-global-nav__current:hover {
	background: rgba(255, 255, 255, 0.16);
}

/* On older years: first thing in the panel. */
.sae-global-nav__notice {
	order: -1;
	margin: 0 0.6rem 0.4rem;
}

.sae-global-nav__notice a {
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.14);
	font-weight: 600;
	line-height: 1.3;
	padding-block: 0.5rem;
}

.sae-global-nav__sections {
	margin-block: 0.2rem 0.4rem;
	padding-block: 0.4rem;
	border-block: 1px solid rgba(255, 255, 255, 0.2);
}

.sae-global-nav__heading {
	margin: 0.3rem 1.1rem 0.2rem;
	font-size: 0.75rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.65;
}

.sae-global-nav__sections ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* "All editions" (on About and other non-year pages). */
.sae-global-nav__editions a {
	gap: 0.6em;
	padding-block: 0.5rem;
	line-height: 1.3;
}

.sae-global-nav__theme {
	opacity: 0.75;
}

.sae-global-nav__tag {
	margin-inline-start: auto;
	padding: 0.1em 0.6em;
	border: 1px solid currentColor;
	border-radius: 999px;
	font-size: 0.75rem;
	white-space: nowrap;
}

.sae-global-nav__sections a.is-active {
	background: rgba(255, 255, 255, 0.12);
	box-shadow: inset 3px 0 0 currentColor;
}

.sae-past summary {
	cursor: pointer;
	list-style: none;
}

.sae-past summary::-webkit-details-marker {
	display: none;
}

.sae-past summary::after {
	content: " ▾";
	font-size: 0.8em;
	margin-inline-start: 0.3em;
}

.sae-past ul {
	margin: 0;
	padding: 0 0 0 0.75rem;
	list-style: none;
}

.sae-past li a {
	display: block;
	padding: 0.55rem 1.1rem;
}

.sae-past li a span {
	opacity: 0.7;
	margin-inline-start: 0.4em;
}

/* ------------------------------------------- "Go to the current year" */

/* Slim notice on older year pages, under the header. */
.sae-section-nav__notice {
	display: block;
	margin-block: 0 0.6rem;
	padding: 0.4em 0.9em;
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.16);
	color: inherit;
	text-decoration: none;
	font-size: var(--wp--preset--font-size--small, 0.95rem);
	font-weight: 600;
	line-height: 1.3;
}

.sae-section-nav__notice:hover {
	background: rgba(255, 255, 255, 0.26);
}

/* Big button to the current symposium (About page). */
.sae-current-button {
	display: flex;
	justify-content: center;
	margin-block: var(--wp--preset--spacing--30, 1.5rem);
}

.sae-current-button .sae-current-button__link {
	/* Explicit colours: the theme's button text colour is transparent inside the page. */
	background: #000;
	color: #fff;
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 0.3em;
	padding: 1em 2.2em;
	border-radius: 999px;
	text-decoration: none;
	text-align: center;
}

.sae-current-button .sae-current-button__link:hover {
	background: #1e1e1e;
	color: #fff;
}

.sae-current-button__title,
.sae-current-button__meta {
	color: inherit;
}

.sae-current-button__title {
	font-size: var(--wp--preset--font-size--large, 1.4rem);
	font-weight: 600;
	line-height: 1.2;
}

.sae-current-button__meta {
	font-size: var(--wp--preset--font-size--small, 0.9rem);
	opacity: 0.85;
}

/* Transparent header at the top (as designed); frosted once scrolling, so
   the menus stay readable over the content. Remove this rule to keep it
   always transparent. */
header.wp-block-template-part {
	transition: background-color 0.25s, backdrop-filter 0.25s;
}

header.wp-block-template-part.sae-scrolled {
	background-color: rgba(10, 10, 40, 0.28);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
}

/* Jump links land below the (taller) header. */
h1[id],
h2[id],
h3[id],
.sae-person {
	scroll-margin-top: calc(var(--sae-header-h, 5rem) + 1rem);
}

/* -------------------------------------------------------- Editions list */

.sae-editions {
	margin: var(--wp--preset--spacing--30, 1.5rem) 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid currentColor;
}

.sae-edition a {
	display: grid;
	grid-template-columns: 6.5rem minmax(0, 1fr) auto auto;
	align-items: center;
	gap: 1rem 1.5rem;
	padding: 1.1rem 0.25rem;
	border-bottom: 1px solid currentColor;
	color: inherit;
	text-decoration: none;
}

.sae-edition a:hover {
	background: rgba(255, 255, 255, 0.08);
}

.sae-edition__year {
	font-size: var(--wp--preset--font-size--x-large, 2.5rem);
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.sae-edition__text {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
}

.sae-edition__theme {
	font-size: var(--wp--preset--font-size--large, 1.4rem);
	line-height: 1.25;
}

.sae-edition__date {
	font-size: var(--wp--preset--font-size--small, 0.95rem);
	opacity: 0.8;
}

.sae-edition__badge {
	padding: 0.25em 0.75em;
	border: 1px solid currentColor;
	border-radius: 999px;
	font-size: var(--wp--preset--font-size--small, 0.9rem);
	white-space: nowrap;
}

.sae-edition__arrow {
	font-size: 1.4rem;
}

@media (max-width: 600px) {
	.sae-edition a {
		grid-template-columns: minmax(0, 1fr) auto;
	}

	.sae-edition__year {
		grid-column: 1;
	}

	.sae-edition__text {
		grid-column: 1 / -1;
		grid-row: 2;
	}

	.sae-edition__arrow {
		display: none;
	}
}

/* Editor only: names in a program line that match nobody under People. */
.sae-slot__warning {
	grid-column: 2;
	margin-top: 0.4em;
	padding: 0.4em 0.7em;
	border-left: 3px solid #f0b849;
	background: rgba(255, 244, 214, 0.92);
	color: #1e1e1e;
	font-size: 13px;
	line-height: 1.4;
}

.sae-slot__warning a {
	color: #1e1e1e;
	font-weight: 600;
}

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

.sae-archive-nav {
	/* The footer's own text colour is transparent on this site; set a real one.
	   Change --sae-archive-color if the footer background changes. */
	color: var(--sae-archive-color, #fff);
	margin-block: var(--wp--preset--spacing--40, 2rem) 0;
	padding-block-start: var(--wp--preset--spacing--30, 1.5rem);
	border-top: 1px solid rgba(255, 255, 255, 0.35);
	text-align: center;
	font-size: var(--wp--preset--font-size--small, 0.95rem);
}

.sae-archive-nav__title,
.sae-archive-nav li {
	color: inherit;
}

.sae-archive-nav__title {
	margin: 0 0 0.5em;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	font-size: 0.85em;
}

.sae-archive-nav ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem 2rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sae-archive-nav li a {
	color: inherit; /* beats the footer's own (transparent) link colour */
	text-decoration: none;
}

.sae-archive-nav a:hover .sae-archive-nav__theme,
.sae-archive-nav a[aria-current] .sae-archive-nav__theme {
	text-decoration: underline;
	text-underline-offset: 0.3em;
}

.sae-archive-nav__year {
	font-weight: 600;
	margin-inline-end: 0.4em;
}

.sae-archive-nav__theme {
	opacity: 0.85;
}

/* ------------------------------------------------------ Site background */

/* One full fade per screen: the site's gradient (set in the Site Editor →
   Styles → Background) stays put while the content scrolls over it.
   A fixed layer instead of background-attachment: fixed, which iPhones
   ignore. It copies the body's own gradient, so colours are changed in one
   place only. Delete this block to go back to one fade over the whole page. */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	background-image: inherit;
	background-size: 100% 100%;
	background-repeat: no-repeat;
	pointer-events: none;
}

/* ------------------------------------------- Edit buttons (team only) */

/* Shown only to logged-in team members; WordPress blue, so they are
   clearly not part of the design. */
.sae-edit {
	display: inline-flex;
	align-items: center;
	gap: 0.3em;
	padding: 0.3em 0.8em;
	border-radius: 999px;
	background: #2271b1;
	color: #fff !important;
	font: 600 13px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	text-decoration: none !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	white-space: nowrap;
}

.sae-edit:hover,
.sae-edit:focus-visible {
	background: #135e96;
}

.sae-edit--quiet {
	background: rgba(15, 23, 42, 0.85);
}

.sae-person {
	position: relative;
}

.sae-edit--person {
	position: absolute;
	top: 0.4rem;
	left: 0.4rem;
	z-index: 2;
}

.sae-edit-row {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 0.5rem;
	margin-block: 0.75rem 1.5rem;
}

.sae-edit-row--empty {
	padding: 1rem;
	border: 1px dashed currentColor;
	border-radius: 8px;
}

.sae-edit-bar {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	z-index: 400;
	display: flex;
	gap: 0.5rem;
}

@media print {
	.sae-edit,
	.sae-edit-bar,
	.sae-edit-row {
		display: none !important;
	}
}
