/**
 * Pontiac Ouest — single council meeting page.
 *
 * Restyles My Municipality's own meeting template (templates/single-council-meeting.php
 * → MMD_Council_Meeting_View::render) on municipalities listed in
 * po_restyled_meeting_municipalities(). Loaded only on those pages. The plugin
 * CSS also prints in the footer, so selectors are prefixed with the body class.
 */

body.po-meeting-single {
	--po-accent: #222233;
	--po-accent-ink: #222233;
	--po-accent-soft: color-mix(in srgb, var(--po-accent) 10%, #fff);
	--po-ink: #222233;
	--po-muted: #5c5f6e;
	--po-line: #e3e5ea;
	--po-band: #f5f7f9;
	--po-radius: 10px;
	--po-shadow: 0 1px 2px rgba(34, 34, 51, 0.05), 0 4px 14px rgba(34, 34, 51, 0.06);
	--po-shadow-hover: 0 2px 4px rgba(34, 34, 51, 0.06), 0 10px 28px rgba(34, 34, 51, 0.1);
	--po-heading-font: "Fjalla One", var(--e-global-typography-primary-font-family, sans-serif);
	--po-hero-image: url("/wp-content/uploads/2024/05/chamber02-1-scaled.jpg");
}

body.po-meeting-single--allumettes  { --po-accent: #16bdf3; --po-accent-ink: #0a6f91; }
body.po-meeting-single--chichester  { --po-accent: #ef2424; --po-accent-ink: #b01515; }
body.po-meeting-single--sheenboro   { --po-accent: #63c93b; --po-accent-ink: #357a1a; }
body.po-meeting-single--waltham     { --po-accent: #750d0c; --po-accent-ink: #750d0c; }

body.po-meeting-single .mmd-council-meeting-page__main {
	min-height: 0;
	overflow-x: clip;
}

/* —— Layout —— */

body.po-meeting-single .mmd-council-meeting {
	--mmd-cm-text: var(--po-ink);
	--mmd-cm-muted: var(--po-muted);
	--mmd-cm-accent: var(--po-accent-ink);
	--mmd-cm-border: var(--po-line);
	--mmd-cm-surface: var(--po-band);
	--mmd-cm-link: var(--po-accent-ink);
	--mmd-cm-icon: var(--po-accent-ink);

	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	column-gap: 56px;
	align-items: start;
	max-width: 1280px;
	padding: 0 20px 48px;
	font-family: inherit;
	font-size: 17px;
	line-height: 1.6;
	color: var(--po-ink);
}

/* No video / image: documents take the full width. */
body.po-meeting-single .mmd-council-meeting:not(:has(.mmd-council-meeting__media)) {
	grid-template-columns: minmax(0, 1fr);
}

/* —— Header → full-bleed banner, like the rest of the site —— */

body.po-meeting-single .mmd-council-meeting__header {
	grid-column: 1 / -1;
	margin: 0 calc(50% - 50vw) 56px;
	padding: 120px max(20px, calc(50vw - 620px)) 56px;
	border: 0;
	border-bottom: 6px solid var(--po-accent);
	background:
		linear-gradient(180deg, rgba(34, 34, 51, 0.55) 0%, rgba(34, 34, 51, 0.88) 100%),
		var(--po-hero-image) center / cover no-repeat,
		var(--po-ink);
	color: #fff;
}

body.po-meeting-single .mmd-council-meeting__date {
	display: inline-block;
	margin: 0 0 14px;
	padding: 6px 14px;
	border-radius: 999px;
	background: var(--po-accent);
	color: #fff;
	font-family: var(--po-heading-font);
	font-size: 1rem;
	font-weight: 400;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	opacity: 1;
}

body.po-meeting-single .mmd-council-meeting__title {
	max-width: 28ch;
	margin: 0;
	font-family: var(--po-heading-font);
	font-size: clamp(2.2rem, 5vw, 4rem);
	font-weight: 400;
	line-height: 1.05;
	letter-spacing: 0.005em;
	text-transform: uppercase;
	color: #fff;
}

body.po-meeting-single .mmd-council-meeting__intro {
	max-width: 62ch;
	margin-top: 16px;
	color: rgba(255, 255, 255, 0.85);
	font-size: 1.05rem;
}

body.po-meeting-single .mmd-council-meeting__intro a {
	color: #fff;
}

/* Add to calendar */

body.po-meeting-single .mmd-council-meeting__calendar {
	margin-top: 24px;
	font-family: inherit;
}

body.po-meeting-single .mmd-council-meeting__calendar-toggle {
	gap: 8px;
	padding: 10px 18px;
	border: 1px solid rgba(255, 255, 255, 0.55);
	border-radius: 999px;
	background: transparent;
	color: #fff;
	font-family: var(--po-heading-font);
	font-size: 0.95rem;
	font-weight: 400;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

body.po-meeting-single .mmd-council-meeting__calendar-toggle::before {
	content: "";
	width: 16px;
	height: 16px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18M12 14v4M10 16h4'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18M12 14v4M10 16h4'/%3E%3C/svg%3E") center / contain no-repeat;
}

body.po-meeting-single .mmd-council-meeting__calendar-toggle:hover,
body.po-meeting-single .mmd-council-meeting__calendar-toggle:focus-visible,
body.po-meeting-single .mmd-council-meeting__calendar-toggle[aria-expanded="true"] {
	border-color: #fff;
	background: #fff;
	color: var(--po-ink);
}

body.po-meeting-single .mmd-council-meeting__calendar-toggle:focus-visible {
	outline: 2px solid var(--po-accent);
	outline-offset: 2px;
}

body.po-meeting-single .mmd-council-meeting__calendar-menu {
	top: calc(100% + 8px);
	min-width: 14rem;
	padding: 6px;
	border: 0;
	border-radius: var(--po-radius);
	box-shadow: var(--po-shadow-hover);
}

body.po-meeting-single .mmd-council-meeting__calendar-menu a {
	border-radius: 6px;
	color: var(--po-ink);
	font-size: 0.95rem;
}

body.po-meeting-single .mmd-council-meeting__calendar-menu a:hover,
body.po-meeting-single .mmd-council-meeting__calendar-menu a:focus-visible {
	background: var(--po-accent-soft);
	color: var(--po-accent-ink);
}

/* —— Section titles —— */

body.po-meeting-single .mmd-council-meeting__section-title {
	position: relative;
	margin: 0 0 24px;
	padding-bottom: 12px;
	font-family: var(--po-heading-font);
	font-size: 1.75rem;
	font-weight: 400;
	line-height: 1.15;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	color: var(--po-ink);
}

body.po-meeting-single .mmd-council-meeting__section-title::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 56px;
	height: 4px;
	border-radius: 2px;
	background: var(--po-accent);
}

/* —— Documents —— */

body.po-meeting-single .mmd-council-meeting__downloads {
	grid-column: 1;
	margin: 0;
}

body.po-meeting-single .mmd-council-meeting__download-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

body.po-meeting-single .mmd-council-meeting__download-item {
	flex: none;
	max-width: none;
	margin: 0;
}

body.po-meeting-single .mmd-council-meeting__download-link {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 16px;
	height: 100%;
	padding: 18px 20px;
	background: #fff;
	border: 1px solid var(--po-line);
	border-radius: var(--po-radius);
	color: var(--po-ink);
	text-align: left;
	text-decoration: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

body.po-meeting-single .mmd-council-meeting__download-link:hover,
body.po-meeting-single .mmd-council-meeting__download-link:focus-visible {
	border-color: var(--po-accent);
	box-shadow: var(--po-shadow-hover);
	transform: translateY(-2px);
	outline: none;
}

body.po-meeting-single .mmd-council-meeting__download-icon {
	display: grid;
	place-items: center;
	flex: 0 0 52px;
	width: 52px;
	height: 52px;
	margin: 0;
	border-radius: 10px;
	background: var(--po-accent-soft);
	color: var(--po-accent-ink);
}

body.po-meeting-single .mmd-council-meeting__download-item[data-mmd-doc-type="recording"] .mmd-council-meeting__download-icon {
	color: var(--po-accent-ink);
}

body.po-meeting-single .mmd-council-meeting__icon-svg {
	width: 30px;
	height: 30px;
}

body.po-meeting-single .mmd-council-meeting__download-text {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	min-width: 0;
}

body.po-meeting-single .mmd-council-meeting__download-label {
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.35;
	color: var(--po-ink);
}

body.po-meeting-single .mmd-council-meeting__download-action {
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--po-accent-ink);
}

/* No documents yet: a quiet placeholder where the list would be. */
body.po-meeting-single .mmd-council-meeting:not(:has(.mmd-council-meeting__downloads))::after {
	content: var(--po-no-docs, "Les documents de cette séance (ordre du jour, procès-verbal) seront publiés ici dès qu’ils seront disponibles.");
	grid-column: 1;
	grid-row: 2;
	display: block;
	padding: 22px 24px;
	border: 1px dashed var(--po-line);
	border-radius: var(--po-radius);
	background: var(--po-band);
	color: var(--po-muted);
}

body.po-meeting-single:lang(en) .mmd-council-meeting {
	--po-no-docs: "Documents for this meeting (agenda, minutes) will be posted here as soon as they are available.";
}

/* —— Video / image —— */

body.po-meeting-single .mmd-council-meeting__media {
	grid-column: 2;
	grid-row: 2;
	margin: 0;
}

body.po-meeting-single .mmd-council-meeting:not(:has(.mmd-council-meeting__downloads)) .mmd-council-meeting__media {
	grid-column: 2;
}

body.po-meeting-single .mmd-council-meeting__player,
body.po-meeting-single .mmd-council-meeting__default-image {
	border-radius: var(--po-radius);
	box-shadow: var(--po-shadow);
}

body.po-meeting-single .mmd-council-meeting__youtube {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	border-radius: 999px;
	background: var(--po-accent);
	color: #fff;
	font-family: var(--po-heading-font);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
}

/* —— Back link (printed by the child theme on get_footer) —— */

body.po-meeting-single .po-meeting-back {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 20px 80px;
}

body.po-meeting-single .po-meeting-back a {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--po-accent-ink);
	font-family: var(--po-heading-font);
	font-size: 1.05rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
}

body.po-meeting-single .po-meeting-back a::before {
	content: "←";
	transition: transform 0.15s ease;
}

body.po-meeting-single .po-meeting-back a:hover::before,
body.po-meeting-single .po-meeting-back a:focus-visible::before {
	transform: translateX(-4px);
}

body.po-meeting-single .po-meeting-back a:hover,
body.po-meeting-single .po-meeting-back a:focus-visible {
	color: var(--po-ink);
}

/* —— Responsive —— */

@media (max-width: 1024px) {
	body.po-meeting-single .mmd-council-meeting {
		grid-template-columns: minmax(0, 1fr);
	}

	body.po-meeting-single .mmd-council-meeting__downloads,
	body.po-meeting-single .mmd-council-meeting__media,
	body.po-meeting-single .mmd-council-meeting:not(:has(.mmd-council-meeting__downloads))::after {
		grid-column: 1;
		grid-row: auto;
	}

	body.po-meeting-single .mmd-council-meeting__media {
		margin-top: 40px;
	}
}

@media (max-width: 767px) {
	body.po-meeting-single .mmd-council-meeting {
		padding: 0 16px 36px;
		font-size: 16px;
	}

	body.po-meeting-single .po-meeting-back {
		padding: 0 16px 56px;
	}

	body.po-meeting-single .mmd-council-meeting__header {
		margin-bottom: 36px;
		padding: 72px 16px 36px;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.po-meeting-single .mmd-council-meeting * {
		transition: none !important;
	}
}
