/*
 * Single "What's On" post — Figma "Single Post Page" (node 211:946).
 *
 * Colour note: the Figma file uses two slightly different colour sets for
 * the same category badge/link across its two "What's On" frames (the
 * archive frame's Competition badge is navy #051a40, but this single-post
 * frame's is dark green #2d4a2d; "Read More"/back-link colours differ the
 * same way). Rather than reproduce that inconsistency, every category
 * colour here comes from the one shared source of truth in
 * inc/whats-on.php (fairfield_whats_on_category_style()) — the same
 * colours the archive block's cards use — and every link/CTA uses this
 * site's one established navy (#051a40), matching every other block.
 */

.whats-on-post {
	--navy: #051a40;
	--gold: #ca9f3e;
	--ink: #1e2419;
	--muted: #8a8a7a;
	--line: #e8dfc8;
	--cream: #f5f0e8;
	--section-bg: #ede6d6;
}

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

.whats-on-post__hero {
	background-image: linear-gradient(100deg, #041129 2%, #051a40 45%);
	color: var(--cream);
}

.whats-on-post__hero-inner {
	max-width: 1400px;
	margin: 0 auto;
	padding: 4.5rem 32px 3.5rem;
}

.whats-on-post__breadcrumb {
	display: inline-block;
	margin-bottom: 1.75rem;
	font-family: "DM Mono", "SFMono-Regular", Menlo, monospace;
	font-size: 0.7rem;
	letter-spacing: 0.13em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--gold);
	opacity: 0.85;
}

.whats-on-post__breadcrumb:hover,
.whats-on-post__breadcrumb:focus-visible {
	opacity: 1;
}

.whats-on-post__meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 1rem;
	margin-bottom: 1.25rem;
}

.whats-on-post__badge {
	padding: 0.25rem 0.65rem;
	font-family: "DM Mono", "SFMono-Regular", Menlo, monospace;
	font-size: 0.65rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.whats-on-post__date {
	font-family: "DM Mono", "SFMono-Regular", Menlo, monospace;
	font-size: 0.7rem;
	letter-spacing: 0.08em;
	color: rgba(245, 240, 232, 0.65);
}

.whats-on-post__title {
	max-width: 46rem;
	margin: 0;
	font-family: "Lora", Georgia, serif;
	font-weight: 600;
	font-size: clamp(1.9rem, 4vw, 3rem);
	line-height: 1.15;
	color: var(--cream);
}

/* --- Body ----------------------------------------------------------------- */

.whats-on-post__body {
	background-color: var(--cream);
	padding: 4rem 32px;
}

.whats-on-post__body-inner {
	max-width: 42rem;
	margin: 0 auto;
}

.whats-on-post__image {
	margin-bottom: 2rem;
}

.whats-on-post__image img {
	width: 100%;
	height: auto;
	display: block;
}

.whats-on-post__back {
	margin-top: 2.5rem;
	padding-top: 1.75rem;
	border-top: 1px solid var(--line);
}

.whats-on-post__back a {
	font-family: "DM Mono", "SFMono-Regular", Menlo, monospace;
	font-size: 0.68rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--navy);
}

.whats-on-post__back a:hover,
.whats-on-post__back a:focus-visible {
	text-decoration: underline;
}

/* --- entry-content: generic styling for whatever an editor pastes in ----
 * Covers plain semantic HTML (classic-editor / pasted content) AND the
 * common Gutenberg block wrapper classes (wp-block-image,
 * wp-block-quote, wp-block-table, wp-block-embed, alignment classes),
 * since either authoring path is possible on this site (every core block
 * stays available — see inc/blocks.php).
 * ------------------------------------------------------------------------- */

.whats-on-post__content {
	font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, sans-serif;
	font-size: 1rem;
	line-height: 1.85;
	color: var(--ink);
}

.whats-on-post__content > *:first-child {
	margin-top: 0;
}

.whats-on-post__content > *:last-child {
	margin-bottom: 0;
}

.whats-on-post__content p {
	margin: 0 0 1.5em;
}

.whats-on-post__content h2,
.whats-on-post__content h3,
.whats-on-post__content h4,
.whats-on-post__content h5,
.whats-on-post__content h6 {
	margin: 1.8em 0 0.75em;
	font-family: "Lora", Georgia, serif;
	font-weight: 600;
	line-height: 1.3;
	color: var(--ink);
}

.whats-on-post__content h2 {
	font-size: 1.6rem;
}

.whats-on-post__content h3 {
	font-size: 1.3rem;
}

.whats-on-post__content h4 {
	font-size: 1.1rem;
}

.whats-on-post__content h5,
.whats-on-post__content h6 {
	font-size: 1rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.whats-on-post__content strong,
.whats-on-post__content b {
	font-weight: 700;
}

.whats-on-post__content em,
.whats-on-post__content i {
	font-style: italic;
}

.whats-on-post__content a {
	color: var(--navy);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.whats-on-post__content a:hover,
.whats-on-post__content a:focus-visible {
	color: #0d3789;
}

.whats-on-post__content ul,
.whats-on-post__content ol {
	margin: 0 0 1.5em;
	padding-left: 1.4em;
}

.whats-on-post__content li {
	margin-bottom: 0.5em;
}

.whats-on-post__content li > ul,
.whats-on-post__content li > ol {
	margin-top: 0.5em;
	margin-bottom: 0;
}

.whats-on-post__content blockquote {
	margin: 2em 0;
	padding: 0.2em 0 0.2em 1.5em;
	border-left: 3px solid var(--gold);
	font-style: italic;
	color: var(--muted);
}

.whats-on-post__content blockquote p:last-child {
	margin-bottom: 0;
}

.whats-on-post__content cite {
	display: block;
	margin-top: 0.5em;
	font-style: normal;
	font-size: 0.85rem;
	color: var(--muted);
}

.whats-on-post__content hr {
	border: none;
	border-top: 1px solid var(--line);
	margin: 2.5em 0;
}

.whats-on-post__content img {
	max-width: 100%;
	height: auto;
}

.whats-on-post__content figure {
	margin: 2em 0;
}

.whats-on-post__content figure img {
	width: 100%;
}

.whats-on-post__content figcaption {
	margin-top: 0.6em;
	font-size: 0.85rem;
	font-style: italic;
	text-align: center;
	color: var(--muted);
}

.whats-on-post__content .alignleft {
	float: left;
	margin: 0.3em 1.5em 1em 0;
}

.whats-on-post__content .alignright {
	float: right;
	margin: 0.3em 0 1em 1.5em;
}

.whats-on-post__content .aligncenter {
	margin-left: auto;
	margin-right: auto;
}

.whats-on-post__content table {
	/* display:block + its own overflow-x lets a wide table scroll
	   horizontally within itself on a narrow viewport — the_content()'s
	   raw markup can't be wrapped in a dedicated scroll container the way
	   a hand-written table elsewhere in this theme could be. */
	display: block;
	width: 100%;
	max-width: 100%;
	overflow-x: auto;
	border-collapse: collapse;
	margin: 2em 0;
	font-size: 0.92rem;
}

.whats-on-post__content table tbody,
.whats-on-post__content table thead {
	display: table;
	width: 100%;
	table-layout: auto;
}

.whats-on-post__content th,
.whats-on-post__content td {
	padding: 0.6em 0.9em;
	border: 1px solid var(--line);
	text-align: left;
	vertical-align: top;
}

.whats-on-post__content thead th {
	background-color: #f0ece2;
	font-family: "DM Mono", "SFMono-Regular", Menlo, monospace;
	font-size: 0.7rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.whats-on-post__content code {
	font-family: "SFMono-Regular", Menlo, Consolas, monospace;
	font-size: 0.88em;
	background-color: #f0ece2;
	padding: 0.15em 0.4em;
}

.whats-on-post__content pre {
	margin: 2em 0;
	padding: 1.25em;
	overflow-x: auto;
	background-color: var(--ink);
	color: var(--cream);
}

.whats-on-post__content pre code {
	background: none;
	padding: 0;
	color: inherit;
}

.whats-on-post__content iframe,
.whats-on-post__content video,
.whats-on-post__content embed,
.whats-on-post__content object {
	max-width: 100%;
}

/* --- Related posts -------------------------------------------------------- */

.whats-on-post__related {
	background-color: var(--section-bg);
	padding: 4rem 32px;
}

.whats-on-post__related-inner {
	max-width: 56rem;
	margin: 0 auto;
}

.whats-on-post__related-eyebrow {
	margin: 0 0 0.5rem;
	font-family: "DM Mono", "SFMono-Regular", Menlo, monospace;
	font-size: 0.65rem;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: var(--gold);
}

.whats-on-post__related-heading {
	margin: 0 0 2rem;
	font-family: "Lora", Georgia, serif;
	font-weight: 600;
	font-size: clamp(1.4rem, 2.5vw, 1.7rem);
	color: var(--ink);
}

.whats-on-post__related-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	border: 1px solid var(--line);
}

.whats-on-related-card {
	display: flex;
	flex-direction: column;
	background-color: #fff;
	text-decoration: none;
	color: inherit;
	border-left: 1px solid var(--line);
}

.whats-on-related-card:first-child {
	border-left: none;
}

.whats-on-related-card__image {
	height: 180px;
	background-color: var(--line);
	background-size: cover;
	background-position: center;
}

.whats-on-related-card__body {
	padding: 1.5rem;
}

.whats-on-related-card__date {
	display: block;
	margin-bottom: 0.6rem;
	font-family: "DM Mono", "SFMono-Regular", Menlo, monospace;
	font-size: 0.58rem;
	letter-spacing: 0.05em;
	color: var(--muted);
}

.whats-on-related-card__title {
	margin: 0 0 0.75rem;
	font-family: "Lora", Georgia, serif;
	font-weight: 600;
	font-size: 1rem;
	line-height: 1.3;
	color: var(--ink);
}

.whats-on-related-card__link {
	font-family: "DM Mono", "SFMono-Regular", Menlo, monospace;
	font-size: 0.62rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--navy);
}

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 720px) {
	.whats-on-post__hero-inner {
		padding: 3.5rem 20px 2.5rem;
	}

	.whats-on-post__body,
	.whats-on-post__related {
		padding: 3rem 20px;
	}

	.whats-on-post__related-grid {
		grid-template-columns: 1fr;
	}

	.whats-on-related-card {
		border-left: none;
		border-top: 1px solid var(--line);
	}

	.whats-on-related-card:first-child {
		border-top: none;
	}
}

/* --- Event details panel (template-parts/event-panel.php) ---------------- */

.event-panel {
	display: grid;
	grid-template-columns: 6.5rem 1fr;
	margin-bottom: 2.5rem;
	background-color: #fff;
	border: 1px solid var(--line);
	border-top: 3px solid var(--gold);
}

.event-panel__date {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.2rem;
	padding: 1.5rem 0.5rem;
	background-color: var(--navy);
	color: var(--cream);
	text-align: center;
}

.event-panel__dow,
.event-panel__month {
	font-family: "DM Mono", "SFMono-Regular", Menlo, monospace;
	font-size: 0.65rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--gold);
}

.event-panel__day {
	font-family: "Lora", Georgia, serif;
	font-weight: 600;
	font-size: 2.6rem;
	line-height: 1;
}

.event-panel__body {
	padding: 1.5rem 1.75rem;
}

.event-panel__eyebrow {
	margin: 0 0 1rem;
	font-family: "DM Mono", "SFMono-Regular", Menlo, monospace;
	font-size: 0.65rem;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	color: var(--gold);
}

.event-panel__facts {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem 1.5rem;
	margin: 0;
}

.event-panel__facts dt {
	margin-bottom: 0.2rem;
	font-family: "DM Mono", "SFMono-Regular", Menlo, monospace;
	font-size: 0.6rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--muted);
}

.event-panel__facts dd {
	margin: 0;
	font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, sans-serif;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.4;
	color: var(--ink);
}

.event-panel__sub {
	display: block;
	font-weight: 400;
	font-size: 0.9rem;
	color: var(--muted);
}

.event-panel__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 1.5rem;
}

.event-panel__btn {
	display: inline-flex;
	align-items: center;
	padding: 0.8rem 1.4rem;
	background-color: var(--navy);
	border: 1px solid var(--navy);
	font-family: "DM Mono", "SFMono-Regular", Menlo, monospace;
	font-size: 0.68rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--cream);
	transition: background-color 0.15s ease, color 0.15s ease;
}

.event-panel__btn:hover,
.event-panel__btn:focus-visible {
	background-color: #0d3789;
	border-color: #0d3789;
}

.event-panel__btn--ghost {
	background-color: transparent;
	color: var(--navy);
}

.event-panel__btn--ghost:hover,
.event-panel__btn--ghost:focus-visible {
	color: var(--cream);
}

.event-panel__calendar {
	margin-top: 1rem;
	font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, sans-serif;
	font-size: 0.9rem;
}

.event-panel__calendar summary {
	display: inline-block;
	cursor: pointer;
	color: var(--navy);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.event-panel__calendar-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.25rem;
	margin-top: 0.6rem;
}

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

.event-panel__note {
	margin: 1rem 0 0;
	padding-top: 1rem;
	border-top: 1px solid var(--line);
	font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, sans-serif;
	font-size: 0.95rem;
	font-style: italic;
	color: var(--muted);
}

.event-panel--past .event-panel__date {
	background-color: var(--muted);
}

.event-panel--past .event-panel__date,
.event-panel--past .event-panel__facts dd {
	opacity: 0.85;
}

@media (max-width: 540px) {
	.event-panel {
		grid-template-columns: 1fr;
	}

	.event-panel__date {
		flex-direction: row;
		gap: 0.6rem;
		padding: 0.9rem 1rem;
	}

	.event-panel__day {
		font-size: 1.6rem;
	}

	.event-panel__body {
		padding: 1.25rem;
	}

	.event-panel__facts {
		grid-template-columns: 1fr;
	}
}
