/* =====================================================
   Ontario Festivals — main.css
   Brand: yellow #F7B32B buttons, orange accents, Poppins,
   soft rounded cards on a light grey canvas.
   ===================================================== */

:root {
	--of-yellow: #f7b32b;
	--of-yellow-dark: #e0a01e;
	--of-orange: #f08a24;
	--of-orange-deep: #d9530f;
	--of-ink: #1f2430;
	--of-text: #3a3f4b;
	--of-muted: #8a8f9c;
	--of-bg: #f4f5f7;
	--of-card: #ffffff;
	--of-line: #ececf1;
	--of-radius: 14px;
	--of-shadow: 0 2px 14px rgba(31, 36, 48, 0.07);
	--of-font: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

body {
	margin: 0;
	font-family: var(--of-font);
	font-size: 16px;
	line-height: 1.7;
	color: var(--of-text);
	background: var(--of-bg);
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: var(--of-orange-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: var(--of-ink); line-height: 1.3; font-weight: 700; }

/* Orange/black mixed titles: wrap a word in <span class="accent"> */
.accent { color: var(--of-yellow); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden; clip: rect(1px,1px,1px,1px);
}
.skip-link:focus {
	clip: auto; width: auto; height: auto;
	position: fixed; top: 8px; left: 8px; z-index: 9999;
	background: var(--of-yellow); color: var(--of-ink);
	padding: 8px 16px; border-radius: 6px;
}

:focus-visible { outline: 3px solid var(--of-orange); outline-offset: 2px; }

/* ---------- Header ---------- */
.site-header {
	background: #fff;
	box-shadow: 0 1px 0 var(--of-line);
	position: sticky; top: 0; z-index: 100;
}
.header-inner {
	display: flex; align-items: center; justify-content: space-between;
	gap: 24px; min-height: 78px;
}
.site-branding img { max-height: 56px; width: auto; display: block; }
.site-title { font-size: 1.5rem; font-weight: 700; color: var(--of-ink); }
.site-title:hover { text-decoration: none; }

.main-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.main-nav li { position: relative; }
.main-nav a {
	display: block; padding: 10px 14px;
	color: var(--of-ink); font-weight: 500; font-size: 0.95rem;
	border-radius: 8px;
}
.main-nav a:hover { background: #fff6e3; color: var(--of-orange-deep); text-decoration: none; }

/* dropdowns */
.main-nav .sub-menu {
	display: none; position: absolute; top: 100%; left: 0;
	background: #fff; min-width: 210px; padding: 8px;
	border-radius: 10px; box-shadow: var(--of-shadow);
	flex-direction: column;
}
@media (min-width: 821px) {
	.main-nav li:hover > .sub-menu,
	.main-nav li:focus-within > .sub-menu { display: flex; }
}

.menu-toggle { display: none; }
.sub-toggle { display: none; }

/* ---------- Buttons ---------- */
.ofc-btn {
	display: inline-block;
	padding: 12px 26px;
	border-radius: 999px;
	font-weight: 600;
	font-size: 0.9rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	border: 2px solid transparent;
	cursor: pointer;
	transition: transform 0.12s ease, box-shadow 0.12s ease;
	font-family: inherit;
}
.ofc-btn:hover { text-decoration: none; transform: translateY(-1px); }
.ofc-btn-primary { background: var(--of-yellow); color: var(--of-ink); }
.ofc-btn-primary:hover { background: var(--of-yellow-dark); color: var(--of-ink); }
.ofc-btn-outline { background: #fff; color: var(--of-ink); border-color: var(--of-line); }
.ofc-btn-outline:hover { border-color: var(--of-yellow); }

/* ---------- Single festival layout ---------- */
.single-event-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	gap: 32px;
	padding-top: 36px;
	padding-bottom: 60px;
	align-items: start;
}

.event-article {
	background: var(--of-card);
	border-radius: var(--of-radius);
	box-shadow: var(--of-shadow);
	padding: 32px;
	min-width: 0;
}
.event-article > *:first-child { margin-top: 0; }

/* your custom HTML hero often uses full-bleed styles; give it room */
.event-article .entry-content img { border-radius: 10px; }

/* ---------- Event details sidebar ---------- */
.event-sidebar { position: sticky; top: 98px; }

.event-details-card {
	background: var(--of-card);
	border-radius: var(--of-radius);
	box-shadow: var(--of-shadow);
	overflow: hidden;
	padding-bottom: 22px;
}
.event-details-title {
	margin: 0; padding: 20px 22px 14px;
	font-size: 1.15rem;
}

/* countdown — yellow strip like the current site */
.event-countdown {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	background: var(--of-yellow);
}
.cd-cell {
	text-align: center; padding: 14px 4px;
	border-right: 1px solid rgba(255,255,255,0.45);
}
.cd-cell:last-child { border-right: 0; }
.cd-num { display: block; font-size: 1.6rem; font-weight: 700; color: #fff; line-height: 1.1; }
.cd-label { display: block; font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; opacity: 0.9; }

.event-banner {
	text-align: center; padding: 16px; font-weight: 700;
	letter-spacing: 0.03em;
}
.event-banner-live { background: #23a55a; color: #fff; }
.event-banner-expired { background: #eef0f3; color: var(--of-muted); }

.event-meta-list { list-style: none; margin: 0; padding: 0 22px; }
.event-meta-list li {
	padding: 15px 0;
	border-bottom: 1px solid var(--of-line);
	display: flex; flex-direction: column; gap: 2px;
}
.meta-label {
	font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em;
	text-transform: uppercase; color: var(--of-yellow-dark);
}
.meta-value { color: var(--of-text); font-size: 0.95rem; }
.meta-value a { color: var(--of-ink); font-weight: 500; border-bottom: 1px solid var(--of-line); }
.meta-value a:hover { color: var(--of-orange-deep); border-color: var(--of-orange-deep); text-decoration: none; }
.status-value { font-weight: 600; }
.status-upcoming { color: var(--of-orange-deep); }
.status-happening { color: #23a55a; }
.status-expired { color: var(--of-muted); }
.status-canceled, .status-postponed { color: #c0392b; }

.add-to-calendar { display: block; width: calc(100% - 44px); margin: 20px 22px 0; text-align: center; }

/* Collapsible details: toggle is desktop-hidden; body always open on desktop */
.details-toggle { display: none; }

/* ---------- Map ---------- */
.event-map-section h2 { margin-top: 40px; }
.ofc-map {
	width: 100%;
	border-radius: 12px;
	overflow: hidden;
	background: #e9edf2;
	margin: 8px 0 4px;
	z-index: 1; /* keep Leaflet under the sticky header */
}
.ofc-map-actions {
	display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
	margin-top: 12px;
}
.ofc-map-address { color: var(--of-muted); font-size: 0.9rem; }

/* ---------- Tags ---------- */
.event-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 34px; }
.event-tag {
	display: inline-block; padding: 5px 12px;
	background: #eef0f3; color: var(--of-text);
	border-radius: 6px; font-size: 0.72rem; font-weight: 600;
	letter-spacing: 0.06em; text-transform: uppercase;
}
.event-tag:hover { background: var(--of-yellow); color: var(--of-ink); text-decoration: none; }

/* ---------- Share ---------- */
.event-share { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--of-line); }
.event-share-label {
	display: block; font-size: 0.72rem; font-weight: 700;
	letter-spacing: 0.1em; text-transform: uppercase; color: var(--of-ink);
	margin-bottom: 10px;
}
.event-share-links { display: flex; gap: 8px; flex-wrap: wrap; }
.share-btn {
	padding: 8px 16px; border-radius: 999px;
	background: #eef0f3; color: var(--of-text);
	font-size: 0.82rem; font-weight: 600;
}
.share-btn:hover { text-decoration: none; color: #fff; }
.share-facebook:hover { background: #1877f2; }
.share-x:hover { background: #111; }
.share-linkedin:hover { background: #0a66c2; }
.share-whatsapp:hover { background: #25d366; }
.share-email:hover { background: var(--of-orange); }

/* ---------- Expired notice ---------- */
.expired-notice {
	background: #fff6e3;
	border: 1px solid #f3ddae;
	border-radius: 12px;
	padding: 20px 22px;
	margin-bottom: 28px;
	display: flex; align-items: center; justify-content: space-between;
	gap: 16px; flex-wrap: wrap;
}
.expired-notice-text { margin: 0; color: var(--of-ink); }

/* ---------- Related festivals ---------- */
.related-festivals { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--of-line); }
.related-title { font-size: 1.3rem; margin: 0 0 18px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.related-card {
	display: block; background: var(--of-bg);
	border-radius: 12px; overflow: hidden;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.related-card:hover { transform: translateY(-2px); box-shadow: var(--of-shadow); text-decoration: none; }
.related-card-media { display: block; aspect-ratio: 3 / 2; overflow: hidden; }
.related-card-media img, .related-card-media .event-card-placeholder { width: 100%; height: 100%; object-fit: cover; display: block; }
.related-card-body { display: block; padding: 12px 14px 15px; }
.related-card-title { display: block; color: var(--of-ink); font-weight: 600; font-size: 0.95rem; line-height: 1.35; margin-top: 3px; }
@media (max-width: 640px) {
	.related-grid { grid-template-columns: 1fr; }
	.related-card { display: flex; align-items: center; }
	.related-card-media { flex: 0 0 110px; aspect-ratio: 1; }
}

/* ---------- Archive grid ---------- */
.archive-header { padding: 44px 0 10px; text-align: center; }
.archive-title { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 8px; }
.archive-description { color: var(--of-muted); max-width: 640px; margin: 0 auto; }

.event-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 26px;
	padding: 30px 0 20px;
}
.event-card {
	background: var(--of-card);
	border-radius: var(--of-radius);
	box-shadow: var(--of-shadow);
	overflow: hidden;
	display: flex; flex-direction: column;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.event-card:hover { transform: translateY(-3px); box-shadow: 0 8px 26px rgba(31,36,48,0.12); }
.event-card-media { display: block; position: relative; aspect-ratio: 3 / 2; overflow: hidden; }
.event-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.event-card-placeholder {
	display: block; width: 100%; height: 100%;
	background: linear-gradient(135deg, var(--of-yellow), var(--of-orange));
}
.card-badge {
	position: absolute; top: 12px; left: 12px;
	padding: 4px 12px; border-radius: 999px;
	font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em;
	text-transform: uppercase;
}
.badge-live { background: #23a55a; color: #fff; }
.badge-expired { background: rgba(31,36,48,0.75); color: #fff; }

.event-card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.event-card-date {
	font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
	text-transform: uppercase; color: var(--of-yellow-dark);
}
.event-card-title { margin: 0; font-size: 1.08rem; }
.event-card-title a { color: var(--of-ink); }
.event-card-title a:hover { color: var(--of-orange-deep); text-decoration: none; }
.event-card-location { color: var(--of-muted); font-size: 0.85rem; }
.event-card-btn { margin-top: auto; align-self: flex-start; padding: 9px 20px; font-size: 0.78rem; }

/* ---------- Pages / posts ---------- */
.post-container {
	max-width: 860px;
}
.page-container, .post-container {
	padding-top: 40px; padding-bottom: 60px;
}
/* Pages span the full 1200px container (aligned with the header) with no card box,
   so block/plugin layouts get the whole canvas. Blog posts keep the card. */
.page-container article { background: transparent; box-shadow: none; padding: 0; }
.post-container article {
	background: var(--of-card);
	border-radius: var(--of-radius);
	box-shadow: var(--of-shadow);
	padding: 36px;
}
.post-meta { color: var(--of-muted); font-size: 0.88rem; }

/* ---------- Pagination ---------- */
.pagination-wrap { padding: 20px 0 60px; text-align: center; }
.pagination-wrap .nav-links { display: inline-flex; gap: 6px; }
.pagination-wrap .page-numbers {
	display: inline-block; min-width: 42px; padding: 9px 12px;
	background: #fff; border-radius: 8px; color: var(--of-ink);
	font-weight: 600; box-shadow: var(--of-shadow);
}
.pagination-wrap .page-numbers.current { background: var(--of-yellow); }
.pagination-wrap a.page-numbers:hover { background: #fff6e3; text-decoration: none; }

/* ---------- Comments (default WP markup) ---------- */
.comments-area { margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--of-line); }
.comment-list { list-style: none; padding: 0; }
.comment-list .comment { padding: 16px 0; border-bottom: 1px solid var(--of-line); }
.comment-form input[type=text], .comment-form input[type=email], .comment-form input[type=url], .comment-form textarea {
	width: 100%; padding: 10px 14px;
	border: 1px solid var(--of-line); border-radius: 8px;
	font-family: inherit; font-size: 0.95rem;
}
.comment-form .submit {
	background: var(--of-yellow); color: var(--of-ink);
	border: 0; padding: 12px 28px; border-radius: 999px;
	font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
	cursor: pointer; font-family: inherit;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--of-ink); color: #cfd3dc; margin-top: 48px; }

.footer-columns {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr 1fr;
	gap: 40px;
	padding-top: 52px;
	padding-bottom: 44px;
}
.footer-brand { max-width: 320px; }
.footer-logo img { max-height: 46px; width: auto; filter: brightness(0) invert(1); opacity: 0.95; }
.footer-site-title { font-size: 1.3rem; font-weight: 700; color: #fff; }
.footer-tagline { margin: 12px 0 0; font-size: 0.9rem; color: #9aa0ad; line-height: 1.65; }

.footer-widget-title {
	color: #fff; font-size: 0.8rem; font-weight: 700;
	letter-spacing: 0.12em; text-transform: uppercase;
	margin: 0 0 16px;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--of-yellow);
	display: inline-block;
}
.footer-widget { margin-bottom: 26px; }
.footer-widget:last-child { margin-bottom: 0; }
.footer-widget ul { list-style: none; margin: 0; padding: 0; }
.footer-widget li { margin-bottom: 10px; }
.footer-widget a { color: #cfd3dc; font-size: 0.92rem; transition: color 0.12s ease; }
.footer-widget a:hover { color: var(--of-yellow); text-decoration: none; }
.footer-widget p { font-size: 0.9rem; color: #9aa0ad; margin: 0 0 10px; }

.footer-bottom { border-top: 1px solid rgba(255,255,255,0.09); }
.footer-bottom-inner {
	display: flex; align-items: center; justify-content: space-between;
	flex-wrap: wrap; gap: 12px;
	padding-top: 18px; padding-bottom: 18px;
}
.footer-credit { margin: 0; font-size: 0.83rem; color: #9aa0ad; }
.footer-sep { margin: 0 4px; opacity: 0.6; }
.footer-powered a { color: #cfd3dc; font-weight: 600; }
.footer-powered a:hover { color: var(--of-yellow); text-decoration: none; }
.footer-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 20px; margin: 0; padding: 0; }
.footer-nav a { color: #cfd3dc; font-size: 0.85rem; }
.footer-nav a:hover { color: var(--of-yellow); text-decoration: none; }

@media (max-width: 960px) {
	.footer-columns { grid-template-columns: 1fr 1fr; gap: 32px; padding-top: 40px; }
	.footer-brand { grid-column: 1 / -1; max-width: none; }
}
@media (max-width: 560px) {
	.footer-columns { grid-template-columns: 1fr; }
	.footer-bottom-inner { justify-content: center; text-align: center; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
	.single-event-layout { grid-template-columns: 1fr; gap: 20px; padding-top: 20px; }
	.event-sidebar { position: static; order: -1; } /* details card ABOVE content on mobile */

	/* Compact details card: no title, 2-column meta grid, smaller countdown */
	.event-details-title { display: none; }
	.event-details-card { padding-bottom: 14px; }
	.cd-cell { padding: 9px 4px; }
	.cd-num { font-size: 1.2rem; }
	.event-meta-list {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 0 18px;
		padding: 4px 18px 0;
	}
	.event-meta-list li { padding: 10px 0; }
	.event-meta-list li:nth-last-child(-n+2) { border-bottom: 0; }
	.meta-label { font-size: 0.62rem; }
	.meta-value { font-size: 0.88rem; }
	.event-banner { padding: 11px; font-size: 0.9rem; }
	.add-to-calendar { margin: 8px 18px 0; width: calc(100% - 36px); padding: 10px 20px; }

	/* Collapsed by default: one-line summary bar, tap to expand full details */
	.details-toggle {
		display: flex; align-items: center; gap: 10px;
		width: 100%; padding: 12px 18px;
		background: none; border: 0; border-top: 1px solid var(--of-line);
		font-family: inherit; font-size: 0.9rem; cursor: pointer;
		color: var(--of-ink); text-align: left;
	}
	.details-toggle-range { font-weight: 600; }
	.details-toggle-status { font-weight: 600; font-size: 0.78rem; }
	.details-toggle-chevron { margin-left: auto; color: var(--of-muted); transition: transform 0.15s ease; }
	.details-toggle[aria-expanded="true"] .details-toggle-chevron { transform: rotate(180deg); }

	.event-details-body { display: none; }
	.event-details-card.is-open .event-details-body { display: block; }
	.event-details-card { padding-bottom: 0; }
	.event-details-card.is-open { padding-bottom: 14px; }
}

@media (max-width: 820px) {
	.menu-toggle {
		display: inline-flex; flex-direction: column; gap: 5px;
		background: none; border: 0; padding: 10px; cursor: pointer;
	}
	.menu-toggle span { width: 24px; height: 3px; background: var(--of-ink); border-radius: 2px; }

	.main-nav { display: none; width: 100%; }
	.main-nav.is-open { display: block; }
	.header-inner { flex-wrap: wrap; }
	.main-nav ul { flex-direction: column; padding-bottom: 14px; }
	.main-nav li { display: flex; flex-wrap: wrap; align-items: center; }
	.main-nav li > a { flex: 1; }

	/* Submenus: collapsed until the chevron is tapped */
	.main-nav .sub-menu { position: static; box-shadow: none; display: none; padding-left: 16px; width: 100%; }
	.main-nav li.is-sub-open > .sub-menu { display: flex; }

	.sub-toggle {
		display: inline-flex; align-items: center; justify-content: center;
		width: 44px; height: 42px;
		background: none; border: 0; cursor: pointer;
		color: var(--of-muted); font-size: 1rem;
	}
	.sub-toggle span { transition: transform 0.15s ease; }
	.sub-toggle[aria-expanded="true"] span { transform: rotate(180deg); }

	.event-article { padding: 22px 18px; }
	.site-branding img { max-height: 40px; }
	.site-title { font-size: 1.2rem; }
}

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