/**
 * GSD Events — front end.
 *
 * Colours come from the theme's brand custom properties (--color-2 navy,
 * --color-6 gold) with hard fallbacks, so this file drops into the Glacial
 * theme without a build step and still renders if the tokens are absent.
 * Typography is inherited deliberately — the theme owns the type scale.
 */

.gsd-events {
	--gsd-ev-navy: var(--color-2, #001543);
	--gsd-ev-gold: var(--color-6, #d29f13);
	--gsd-ev-ink: #333;
	--gsd-ev-muted: #5a6270;
	--gsd-ev-rule: #e3e6ec;
	--gsd-ev-panel: #f7f8fa;
}

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

.gsd-events__month,
.gsd-events__heading {
	margin: 2.5rem 0 1rem;
	padding-bottom: 0.5rem;
	border-bottom: 2px solid var(--gsd-ev-gold);
	color: var(--gsd-ev-navy);
	font-size: 1.5rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.gsd-events__month:first-child,
.gsd-events__heading:first-child {
	margin-top: 0;
}

/* The "Past Events" section under the upcoming list (or its empty notice). */
.gsd-events--past {
	margin-top: 3rem;
}

.gsd-event-card {
	display: grid;
	gap: 1.25rem;
	padding: 1.5rem 0;
	border-bottom: 1px solid var(--gsd-ev-rule);
}

.gsd-event-card--list {
	grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
	align-items: start;
}

.gsd-event-card--list.has-no-image {
	grid-template-columns: minmax(0, 1fr);
}

/*
 * A past card is marked by its section heading and a greyscale image — NOT
 * by opacity, which at 0.7 drops the grey date and venue lines to ~3.2:1
 * (SC 1.4.3).
 */
.gsd-event-card.is-past .gsd-event-card__media img {
	filter: grayscale(1);
}

.gsd-event-card__media img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 4px;
}

.gsd-event-card__when {
	margin: 0 0 0.25rem;
	color: var(--gsd-ev-muted);
	font-size: 0.9375rem;
	font-weight: 600;
}

.gsd-event-card__title {
	margin: 0 0 0.5rem;
	font-size: 1.375rem;
	line-height: 1.25;
}

.gsd-event-card__title a {
	color: var(--gsd-ev-navy);
	text-decoration: none;
}

.gsd-event-card__title a:hover,
.gsd-event-card__title a:focus {
	color: var(--gsd-ev-gold);
	text-decoration: underline;
}

.gsd-event-card__venue {
	margin: 0 0 0.5rem;
	color: var(--gsd-ev-muted);
	font-size: 0.9375rem;
}

.gsd-event-card__venue-name {
	font-weight: 600;
}

.gsd-event-card__venue-name::after {
	content: " · ";
}

.gsd-event-card__venue-name:last-child::after {
	content: none;
}

.gsd-event-card__repeat,
.gsd-event-card__excerpt {
	margin: 0 0 0.5rem;
	color: var(--gsd-ev-ink);
	font-size: 0.9375rem;
}

.gsd-event-card__repeat {
	color: var(--gsd-ev-muted);
}

.gsd-event-card__more {
	margin: 0;
}

.gsd-event-card__more a {
	color: var(--gsd-ev-navy);
	font-weight: 600;
	text-decoration: none;
}

.gsd-event-card__more a::after {
	content: " →";
}

.gsd-event-card__more a:hover,
.gsd-event-card__more a:focus {
	color: var(--gsd-ev-gold);
	text-decoration: underline;
}

/* ---------------------------------------------------------------- grid ---- */

.gsd-events--grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 1.75rem;
}

.gsd-events--grid .gsd-event-card {
	display: flex;
	flex-direction: column;
	gap: 0;
	padding: 0 0 1.25rem;
	border: 1px solid var(--gsd-ev-rule);
	border-radius: 6px;
	overflow: hidden;
}

.gsd-events--grid .gsd-event-card__body {
	padding: 1.25rem 1.25rem 0;
}

.gsd-events--grid .gsd-events__pagination {
	grid-column: 1 / -1;
}

.gsd-events--grid > .gsd-events__heading {
	grid-column: 1 / -1;
	margin-bottom: 0;
}

/* ---------------------------------------------------------- pagination ---- */

.gsd-events__pagination {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-top: 2rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--gsd-ev-rule);
}

.gsd-events__page {
	color: var(--gsd-ev-navy);
	font-weight: 600;
	text-decoration: none;
}

.gsd-events__page.is-disabled {
	color: #9aa1ad;
	font-weight: 400;
}

.gsd-events__page-of {
	color: var(--gsd-ev-muted);
	font-size: 0.9375rem;
}

.gsd-events--empty p {
	margin: 0;
	padding: 2rem;
	background: var(--gsd-ev-panel);
	border-left: 4px solid var(--gsd-ev-gold);
	color: var(--gsd-ev-muted);
}

/* -------------------------------------------------------- single event ---- */

.gsd-event {
	--gsd-ev-navy: var(--color-2, #001543);
	--gsd-ev-gold: var(--color-6, #d29f13);
	--gsd-ev-muted: #5a6270;
	--gsd-ev-rule: #e3e6ec;
	/* Used by the past-event notice and the other-dates chips, not the sidebar. */
	--gsd-ev-panel: #f7f8fa;
}

.gsd-event__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
	gap: 2.5rem;
	align-items: start;
}

.gsd-event__image {
	margin: 0 0 1.5rem;
}

.gsd-event__image img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 6px;
}

.gsd-event__when {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	margin: 0 0 0.5rem;
	color: var(--gsd-ev-navy);
	font-size: 1.25rem;
	font-weight: 700;
}

/* Inline SVG calendar (was the 📅 emoji, which renders in each platform's own
 * colours). Gold outline, decorative, sized to the line. */
.gsd-event__when-icon {
	flex: none;
	width: 1.25em;
	height: 1.25em;
	color: var(--gsd-ev-gold);
}

/* A photo inside a glacial/grid cell of the description — the Grand Opening's
 * provider headshots — is capped, or a 2-column grid in this column blows a
 * portrait up to ~350px wide. (A 3-column grid would not help: gl-cols-3 is
 * auto-fit, so two cells stretch back to halves.) */
.gsd-event__content .gl-grid > * > .wp-block-image img {
	width: auto;
	max-width: min(100%, 200px);
	height: auto;
}

/* A glacial/emphasis box in the description: inside .entry the box already has
 * 15px bottom padding (style.css, `.entry .emph-div.btm-mar`), so its last
 * paragraph's own margin made the bottom gap bigger than the 15px top. Scoped
 * to events; the ~40 other pages using the box are untouched. */
.gsd-event__content .emph-div > :last-child {
	margin-bottom: 0;
}

.gsd-event__repeat {
	margin: 0 0 1.25rem;
	color: var(--gsd-ev-muted);
}

.gsd-event__past-notice {
	margin: 0 0 1.5rem;
	padding: 0.875rem 1.25rem;
	background: var(--gsd-ev-panel);
	border-left: 4px solid var(--gsd-ev-gold);
}

.gsd-event__dates {
	margin-top: 2.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--gsd-ev-rule);
}

.gsd-event__dates h2 {
	margin: 0 0 0.75rem;
	color: var(--gsd-ev-navy);
	font-size: 1.125rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.gsd-event__dates ul {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 0.5rem;
}

.gsd-event__dates a {
	display: block;
	padding: 0.625rem 0.875rem;
	background: var(--gsd-ev-panel);
	border-radius: 4px;
	color: var(--gsd-ev-navy);
	text-decoration: none;
}

.gsd-event__dates a:hover,
.gsd-event__dates a:focus {
	background: var(--gsd-ev-navy);
	color: #fff;
}

.gsd-event__back {
	margin-top: 2.5rem;
}

.gsd-event__back a {
	color: var(--gsd-ev-navy);
	font-weight: 600;
	text-decoration: none;
}

/* --------------------------------------------------------- details panel -- */

/*
 * NO box of its own. style.css styles the bare `aside` ELEMENT as the page
 * sidebar — cream background, 3px gold border-top, 1.5rem padding, sticky —
 * and the panel sits inside one, so painting its own background, padding and
 * gold rule drew a second box within the first. The theme owns that chrome;
 * this file only lays out what goes inside it.
 */
.gsd-event-panel__block + .gsd-event-panel__block {
	margin-top: 1.25rem;
	padding-top: 1.25rem;
	/* Navy at low opacity reads better on the cream sidebar than a cool grey. */
	border-top: 1px solid rgba(0, 21, 67, 0.12);
}

.gsd-event-panel__heading {
	margin: 0 0 0.5rem;
	color: var(--gsd-ev-navy);
	font-size: 0.8125rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.gsd-event-panel__venue {
	margin: 0 0 0.25rem;
	font-size: 1.0625rem;
	font-weight: 700;
}

.gsd-event-panel__venue a {
	color: var(--gsd-ev-navy);
	text-decoration: none;
}

.gsd-event-panel__venue a:hover,
.gsd-event-panel__venue a:focus {
	text-decoration: underline;
}

.gsd-event-panel__affiliate {
	margin: 0 0 0.5rem;
	color: var(--gsd-ev-muted);
	font-size: 0.875rem;
	font-style: italic;
}

.gsd-event-panel__address {
	margin: 0 0 0.5rem;
	font-style: normal;
	line-height: 1.5;
}

.gsd-event-panel__directions,
.gsd-event-panel__cost {
	margin: 0;
}

.gsd-event-panel__list,
.gsd-event-panel__hours {
	margin: 0;
	padding: 0;
	list-style: none;
}

.gsd-event-panel__list li,
.gsd-event-panel__hours li {
	margin-bottom: 0.25rem;
	line-height: 1.5;
}

.gsd-event-panel__label {
	display: inline-block;
	min-width: 3rem;
	color: var(--gsd-ev-muted);
	font-size: 0.8125rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.gsd-event-panel__cta {
	margin: 1.5rem 0 0;
}

/*
 * The theme styles a.wp-block-button__link as a navy OUTLINE button. As the
 * one primary action in the sidebar this wants to be filled, which is exactly
 * what [gsd_region_schedule] does for its own Book Online — same treatment
 * here so the two agree.
 */
.gsd-event-panel__book .wp-block-button__link {
	display: block;
	width: 100%;
	background: var(--gsd-ev-navy);
	border-color: var(--gsd-ev-navy);
	color: #fff;
	text-align: center;
}

.gsd-event-panel__book .wp-block-button__link:hover,
.gsd-event-panel__book .wp-block-button__link:focus {
	background: var(--gsd-ev-gold);
	border-color: var(--gsd-ev-gold);
	color: var(--gsd-ev-navy);
	/* The theme's default button hover scales down; a full-width block should not. */
	transform: none;
}

.gsd-event-panel__calendar {
	margin-top: 1rem;
	font-size: 0.875rem;
}

.gsd-event-panel__calendar .gsd-event-panel__label {
	display: block;
	min-width: 0;
	margin-bottom: 0.25rem;
}

.gsd-event-panel__calendar a {
	color: var(--gsd-ev-navy);
}

.gsd-event-panel__calendar a + a {
	margin-left: 0.75rem;
}

/* --------------------------------------------------------------- small ---- */

@media (max-width: 900px) {
	.gsd-event__layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 2rem;
	}
}

@media (max-width: 600px) {
	.gsd-event-card--list {
		grid-template-columns: minmax(0, 1fr);
	}

	.gsd-event-card__media img {
		max-height: 220px;
		object-fit: cover;
	}

	.gsd-events__pagination {
		flex-wrap: wrap;
	}
}
