/*
Theme Name: Careers Canada
Theme URI: https://example.com/careers-canada
Author: Custom Build
Author URI: https://example.com
Description: A magazine-style job-listings theme with built-in AdSense & Google Ad Manager ad management, a rewarded "watch an ad to unlock" Offerwall gate, and in-app browser handling. A clean-room visual replica for a Canada careers / jobs site. Replace the placeholder branding and sample content with your own.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: careers-canada
Tags: blog, news, two-columns, right-sidebar, custom-logo, custom-menu, featured-images
*/

/* -------------------------------------------------------------------------
 * Design tokens
 * ---------------------------------------------------------------------- */
:root {
	--c-red: #ed0000;
	--c-blue: #0549e8;
	--c-text: #222222;
	--c-muted: #777777;
	--c-line: #e6e6e6;
	--c-bg: #ffffff;
	--font-body: 'Lato', Arial, sans-serif;
	--font-head: 'Work Sans', 'Lato', sans-serif;
	--wrap: 1200px;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.6;
	color: var(--c-text);
	background: var(--c-bg);
}

a { color: var(--c-red); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* -------------------------------------------------------------------------
 * Header
 * ---------------------------------------------------------------------- */
.careers-header {
	border-bottom: 1px solid var(--c-line);
	position: sticky;
	top: 0;
	z-index: 500;
	background: #fff;
	box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);
}
.careers-header-inner {
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 10px 20px;
	display: flex;
	align-items: center;
	gap: 18px;
}
.careers-logo { flex: 0 0 auto; }
.careers-logo img { max-height: 50px; width: auto; }
.careers-logo-text {
	display: inline-flex;
	align-items: center;
	font-family: var(--font-head);
	font-weight: 800;
	font-size: 30px;
	color: var(--c-red);
	letter-spacing: -0.5px;
	font-style: italic;
	line-height: 1;
}
.careers-logo-text:hover { text-decoration: none; }
.careers-logo-glyph {
	width: 16px;
	height: 16px;
	border: 3px solid var(--c-red);
	border-radius: 50%;
	margin-left: 3px;
	position: relative;
	transform: translateY(2px);
	font-style: normal;
}
.careers-logo-glyph::after {
	content: "";
	position: absolute;
	right: -4px;
	bottom: -3px;
	width: 7px;
	height: 3px;
	background: var(--c-red);
	border-radius: 2px;
	transform: rotate(45deg);
}

/* Left hamburger (opens the slide-out drawer) - visible on all sizes */
.careers-drawer-toggle {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	width: 30px;
	height: 30px;
	background: none;
	border: 0;
	cursor: pointer;
	padding: 0;
}
.careers-drawer-toggle span {
	display: block;
	height: 2.5px;
	width: 22px;
	background: var(--c-red);
	border-radius: 2px;
}

.careers-primary-nav { flex: 1 1 auto; }
.careers-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 26px;
}
.careers-menu li { position: relative; }
.careers-menu > li > a {
	font-family: var(--font-head);
	font-weight: 600;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.4px;
	color: var(--c-red);
	display: block;
	padding: 6px 0;
	white-space: nowrap;
}
.careers-menu a { color: var(--c-red); }
.careers-menu a:hover { color: #b00000; text-decoration: none; }

/* Dropdown sub-menus */
.careers-menu .sub-menu {
	list-style: none;
	margin: 0;
	padding: 6px 0;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 220px;
	background: #fff;
	border: 1px solid var(--c-line);
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
	border-radius: 4px;
	display: none;
	z-index: 60;
}
.careers-menu li.menu-item-has-children > a::after {
	content: "\25BE";
	font-size: 10px;
	margin-left: 5px;
	color: inherit;
}
.careers-menu li:hover > .sub-menu { display: block; }
.careers-menu .sub-menu li { display: block; }
.careers-menu .sub-menu a {
	display: block;
	padding: 8px 16px;
	font-family: var(--font-head);
	font-weight: 500;
	font-size: 13px;
	text-transform: none;
	letter-spacing: 0;
	color: var(--c-text);
	white-space: nowrap;
}
.careers-menu .sub-menu a:hover { background: #f6f6f6; color: var(--c-red); }
.careers-menu .sub-menu .sub-menu { top: 0; left: 100%; }

.careers-search-toggle {
	flex: 0 0 auto;
	background: none;
	border: 0;
	cursor: pointer;
	color: var(--c-red);
	padding: 4px;
	display: inline-flex;
	align-items: center;
}
.careers-search-toggle svg { display: block; }

.careers-search-bar {
	border-top: 1px solid var(--c-line);
	background: #fafafa;
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.25s ease;
}
.careers-search-bar-inner {
	max-width: var(--wrap);
	margin: 0 auto;
	padding: 0 20px;
}
.careers-search-open .careers-search-bar { max-height: 100px; }
.careers-search-open .careers-search-bar-inner { padding-top: 12px; padding-bottom: 14px; }
.careers-search-bar input[type="search"],
.careers-search-bar input[type="text"] {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--c-line);
	border-radius: 4px;
	font-size: 15px;
}
.careers-search-bar input[type="submit"] { display: none; }

/* -------------------------------------------------------------------------
 * Off-canvas drawer (left hamburger menu)
 * ---------------------------------------------------------------------- */
.careers-drawer-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
	z-index: 1000;
}
.careers-drawer-open { overflow: hidden; }
.careers-drawer-open .careers-drawer-overlay { opacity: 1; visibility: visible; }
.careers-drawer {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	width: 300px;
	max-width: 84vw;
	background: #fff;
	z-index: 1001;
	transform: translateX(-100%);
	transition: transform 0.28s ease;
	overflow-y: auto;
	box-shadow: 2px 0 18px rgba(0, 0, 0, 0.15);
	padding: 56px 0 30px;
}
.careers-drawer-open .careers-drawer { transform: translateX(0); }
.careers-drawer-close {
	position: absolute;
	top: 10px;
	right: 12px;
	width: 34px;
	height: 34px;
	border: 0;
	background: none;
	font-size: 28px;
	line-height: 1;
	color: #333;
	cursor: pointer;
}
.careers-drawer-menu { display: block; flex-direction: column; }
.careers-drawer-menu li { display: block; border-bottom: 1px solid var(--c-line); }
.careers-drawer-menu > li > a { padding: 13px 22px; white-space: normal; }
.careers-drawer-menu .sub-menu {
	position: static;
	display: none;
	border: 0;
	box-shadow: none;
	min-width: 0;
	padding: 0 0 6px 18px;
}
.careers-drawer-menu li.careers-sub-open > .sub-menu { display: block; }
.careers-drawer-menu li:hover > .sub-menu { display: none; }
.careers-drawer-menu li.careers-sub-open > .sub-menu { display: block; }
.careers-drawer-menu .sub-menu a { padding: 10px 22px; }
.careers-drawer-menu li.menu-item-has-children > a::after {
	content: "\25BE";
	float: right;
	font-size: 11px;
	transition: transform 0.2s ease;
}
.careers-drawer-menu li.careers-sub-open.menu-item-has-children > a::after { transform: rotate(180deg); }

/* -------------------------------------------------------------------------
 * Layout
 * ---------------------------------------------------------------------- */
.careers-container { max-width: var(--wrap); margin: 0 auto; padding: 24px 20px; }
.careers-main {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 36px;
	align-items: start;
}
.careers-feed { min-width: 0; }
.careers-sidebar { min-width: 0; }

/* -------------------------------------------------------------------------
 * Post cards (magazine feed)
 * ---------------------------------------------------------------------- */
.careers-card-post {
	display: grid;
	grid-template-columns: 290px minmax(0, 1fr);
	gap: 22px;
	padding-bottom: 22px;
	margin-bottom: 22px;
	border-bottom: 1px solid var(--c-line);
	align-items: start;
}
.careers-card-thumb { display: block; overflow: hidden; border-radius: 3px; }
.careers-card-thumb img { width: 100%; height: 196px; object-fit: cover; display: block; transition: transform 0.3s ease; }
.careers-card-thumb:hover img { transform: scale(1.04); }
.careers-card-noimg { display: block; width: 100%; height: 196px; background: #f0f0f0; border-radius: 3px; }

.careers-cat {
	display: inline-block;
	font-family: var(--font-head);
	font-weight: 700;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: var(--c-red);
	margin-bottom: 8px;
}
.careers-cat:hover { text-decoration: none; color: #b00000; }

.careers-card-title { margin: 0 0 8px; line-height: 1.25; }
.careers-card-title a {
	font-family: var(--font-head);
	font-weight: 700;
	font-size: 22px;
	color: var(--c-blue);
}
.careers-card-title a:hover { color: #0335ad; text-decoration: none; }

.careers-meta {
	font-size: 12px;
	color: var(--c-muted);
	margin-bottom: 10px;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}
.careers-meta .careers-author { color: var(--c-red); font-weight: 700; }
.careers-meta .careers-time { margin-left: 10px; }

.careers-card-excerpt { font-size: 15px; color: #444; }
.careers-card-excerpt p { margin: 0; }

/* Single + page */
.careers-single { padding-bottom: 10px; }
.careers-single-title {
	font-family: var(--font-head);
	font-weight: 700;
	font-size: 30px;
	line-height: 1.2;
	color: var(--c-blue);
	margin: 6px 0 10px;
}
.careers-single-thumb { margin: 16px 0; }
.careers-content { font-size: 17px; line-height: 1.75; }
.careers-content p { margin: 0 0 1.1em; }
.careers-content h2, .careers-content h3 { font-family: var(--font-head); color: var(--c-text); }
.careers-content a { color: var(--c-blue); text-decoration: underline; }

.careers-archive-head { margin-bottom: 22px; border-bottom: 2px solid var(--c-red); padding-bottom: 10px; }
.careers-archive-title { font-family: var(--font-head); font-size: 24px; margin: 0; color: var(--c-text); }
.careers-archive-title span { color: var(--c-red); }

/* Pagination */
.careers-pagination ul { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 10px 0 0; }
.careers-pagination a, .careers-pagination span {
	display: inline-block;
	padding: 8px 14px;
	border: 1px solid var(--c-line);
	border-radius: 3px;
	font-family: var(--font-head);
	font-weight: 600;
	color: var(--c-text);
}
.careers-pagination .current { background: var(--c-red); color: #fff; border-color: var(--c-red); }
.careers-pagination a:hover { background: #f6f6f6; text-decoration: none; }

/* -------------------------------------------------------------------------
 * Sidebar / In Demand Jobs
 * ---------------------------------------------------------------------- */
.widget { margin-bottom: 28px; }
.widget-title {
	font-family: var(--font-head);
	font-weight: 700;
	font-size: 18px;
	color: var(--c-red);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin: 0 0 14px;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--c-red);
}
.careers-indemand-list { list-style: none; margin: 0; padding: 0; }
.careers-indemand-item {
	display: grid;
	grid-template-columns: 76px minmax(0, 1fr);
	gap: 14px;
	align-items: center;
	padding: 12px 0;
	border-bottom: 1px solid var(--c-line);
}
.careers-indemand-media { position: relative; width: 72px; height: 72px; flex: 0 0 auto; }
.careers-indemand-thumb { display: block; width: 72px; height: 72px; }
.careers-indemand-thumb img { width: 72px; height: 72px; object-fit: cover; border-radius: 50%; }
.careers-indemand-noimg { display: block; width: 72px; height: 72px; border-radius: 50%; background: #e9e9e9; }
.careers-indemand-num {
	position: absolute;
	left: -3px;
	bottom: -3px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--c-red);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--font-head);
	font-weight: 700;
	font-size: 14px;
	border: 2px solid #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.careers-indemand-text .careers-cat { margin-bottom: 4px; font-size: 11px; }
.careers-indemand-title { display: block; font-family: var(--font-head); font-weight: 600; font-size: 14px; color: var(--c-blue); line-height: 1.35; }
.careers-indemand-title:hover { text-decoration: none; color: #0335ad; }
.careers-indemand-heading { font-size: 20px; }

.careers-sticky-wrap { position: sticky; top: 20px; }

/* -------------------------------------------------------------------------
 * Ad slots
 * ---------------------------------------------------------------------- */
.careers-ad { margin: 22px auto; text-align: center; clear: both; position: relative; }
.careers-ad-label {
	display: block;
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: #aaa;
	margin-bottom: 4px;
}
.careers-ad-header_billboard { max-width: var(--wrap); padding: 14px 20px 0; }
.careers-ad-infeed { padding: 8px 0 24px; margin-bottom: 24px; border-bottom: 1px solid var(--c-line); }

/* Device targeting */
@media (max-width: 767px) { .careers-dev-desktop { display: none !important; } }
@media (min-width: 768px) { .careers-dev-mobile { display: none !important; } }

/* Sticky anchor */
.careers-ad-anchor {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	margin: 0;
	background: #fff;
	border-top: 1px solid var(--c-line);
	box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.12);
	z-index: 9000;
	padding: 6px 0 4px;
}
.careers-anchor-close {
	position: absolute;
	top: -26px;
	right: 8px;
	width: 26px;
	height: 26px;
	border: 0;
	border-radius: 50% 50% 0 0;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 18px;
	line-height: 22px;
	cursor: pointer;
}

/* -------------------------------------------------------------------------
 * Offerwall gate
 * ---------------------------------------------------------------------- */
.careers-blur #careers-page { filter: blur(5px); pointer-events: none; user-select: none; }
.careers-locked { overflow: hidden; }

.careers-ow {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(20, 20, 20, 0.55);
	transition: opacity 0.3s ease;
}
.careers-ow-hide { opacity: 0; }
.careers-ow-card {
	background: #fff;
	width: 100%;
	max-width: 460px;
	border-radius: 14px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
	padding: 28px 26px 24px;
	text-align: center;
}
.careers-ow-logo { margin-bottom: 14px; }
.careers-ow-logo img { max-height: 42px; width: auto; margin: 0 auto; }
.careers-ow-brand { font-family: var(--font-head); font-weight: 700; font-size: 26px; color: var(--c-red); font-style: italic; }
.careers-ow-headline { font-family: var(--font-head); font-weight: 700; font-size: 21px; color: #111; margin: 0 0 6px; }
.careers-ow-subtext { font-size: 14px; color: #666; margin: 0 0 20px; }

.careers-ow-button {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	width: 100%;
	text-align: left;
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 10px;
	padding: 14px 16px;
	cursor: pointer;
	transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.careers-ow-button:hover { border-color: #cfcfcf; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08); }
.careers-ow-btn-texts { display: flex; flex-direction: column; }
.careers-ow-btn-title { font-family: var(--font-head); font-weight: 600; font-size: 15px; color: #111; }
.careers-ow-btn-sub { font-size: 12.5px; color: #777; }
.careers-ow-play {
	flex: 0 0 auto;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--c-blue);
	position: relative;
}
.careers-ow-play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 54%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 6px 0 6px 10px;
	border-color: transparent transparent transparent #fff;
}

/* -------------------------------------------------------------------------
 * Interstitial overlay (custom full-screen ad)
 * ---------------------------------------------------------------------- */
.careers-interstitial {
	position: fixed;
	inset: 0;
	z-index: 99000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(0, 0, 0, 0.8);
}
.careers-interstitial-inner {
	position: relative;
	background: #fff;
	padding: 30px 18px 18px;
	border-radius: 8px;
	max-width: 100%;
	max-height: 90vh;
	overflow: auto;
}
.careers-interstitial-close {
	position: absolute;
	top: 6px;
	right: 8px;
	width: 30px;
	height: 30px;
	border: 0;
	border-radius: 50%;
	background: #111;
	color: #fff;
	font-size: 20px;
	line-height: 28px;
	cursor: pointer;
}

/* -------------------------------------------------------------------------
 * In-app browser banner
 * ---------------------------------------------------------------------- */
.careers-inapp-bar {
	position: sticky;
	top: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	gap: 12px;
	background: #111;
	color: #fff;
	padding: 10px 14px;
	font-size: 14px;
}
.careers-inapp-msg { flex: 1 1 auto; }
.careers-inapp-open {
	flex: 0 0 auto;
	background: var(--c-red);
	color: #fff;
	border: 0;
	border-radius: 4px;
	padding: 8px 14px;
	font-family: var(--font-head);
	font-weight: 600;
	cursor: pointer;
}
.careers-inapp-x {
	flex: 0 0 auto;
	background: none;
	border: 0;
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	padding: 0 4px;
}

/* -------------------------------------------------------------------------
 * Footer
 * ---------------------------------------------------------------------- */
.careers-footer { background: #111; color: #bbb; margin-top: 30px; }
.careers-footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 30px 20px; text-align: center; }
.careers-footer-menu { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; }
.careers-footer-menu a {
	color: #fff;
	font-family: var(--font-head);
	font-weight: 600;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}
.careers-copyright { font-size: 12.5px; color: #888; margin: 0; line-height: 1.7; }

/* -------------------------------------------------------------------------
 * Responsive
 * ---------------------------------------------------------------------- */
@media (max-width: 1024px) {
	.careers-main { grid-template-columns: minmax(0, 1fr) 280px; gap: 26px; }
	.careers-card-post { grid-template-columns: 200px minmax(0, 1fr); }
	.careers-card-thumb img, .careers-card-noimg { height: 140px; }
}

@media (max-width: 880px) {
	.careers-main { grid-template-columns: 1fr; }
	.careers-sidebar { margin-top: 20px; }
	.careers-sticky-wrap { position: static; }
}

@media (max-width: 860px) {
	/* On smaller screens the inline nav is replaced by the slide-out drawer. */
	.careers-primary-nav { display: none; }
	.careers-logo { margin-right: auto; }
}

@media (max-width: 767px) {
	/* Full-bleed, contiguous image feed (home / archive / search) like the reference. */
	.home .careers-feed,
	.blog .careers-feed,
	.archive .careers-feed,
	.search .careers-feed {
		margin-left: -20px;
		margin-right: -20px;
	}

	.careers-card-post {
		grid-template-columns: 108px minmax(0, 1fr);
		gap: 0;
		margin: 0;
		padding: 0;
		border-bottom: 0;
		align-items: stretch;
	}
	.careers-card-thumb {
		height: 100%;
		border-radius: 0;
		overflow: hidden;
		position: relative;
	}
	.careers-card-thumb img,
	.careers-card-noimg {
		height: 100%;
		width: 100%;
		min-height: 84px;
		border-radius: 0;
		object-fit: cover;
	}
	.careers-card-thumb:hover img { transform: none; }
	/* Dark-blue demarcation strip with the site name inscribed. */
	.careers-card-thumb::after {
		content: attr(data-site);
		position: absolute;
		left: 0;
		right: 0;
		bottom: 0;
		height: 16px;
		line-height: 16px;
		background: #0a2a66;
		color: #fff;
		font-family: var(--font-head);
		font-size: 7px;
		font-weight: 600;
		letter-spacing: 0.2px;
		text-transform: uppercase;
		text-align: center;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		padding: 0 3px;
		box-sizing: border-box;
		z-index: 2;
	}

	.careers-card-body {
		display: flex;
		flex-direction: column;
		justify-content: center;
		padding: 9px 16px 10px 13px;
		border-bottom: 1px solid var(--c-line);
	}
	.careers-cat { font-size: 10.5px; margin-bottom: 5px; letter-spacing: 0.5px; }
	.careers-card-title { margin: 0; }
	.careers-card-title a { font-size: 14px; line-height: 1.18; display: block; }
	.careers-meta { display: none; }       /* hide author + time on mobile */
	.careers-card-excerpt { display: none; } /* hide excerpt on mobile */

	/* Keep non-card feed elements padded when the feed goes full-bleed. */
	.careers-archive-head,
	.careers-pagination,
	.careers-empty { padding-left: 20px; padding-right: 20px; }

	.careers-single-title { font-size: 24px; }
	.careers-header-inner { gap: 12px; }
	.careers-logo-text { font-size: 26px; }
}

@media (min-width: 861px) {
	/* Push the inline nav to sit between logo and search like the reference. */
	.careers-primary-nav { flex: 1 1 auto; display: flex; justify-content: flex-start; }
	.careers-primary-nav .careers-menu { margin-left: 20px; }
}
