/* ==========================================================================
   NW Training — main styles
   ========================================================================== */

:root {
	--nw-red: #D71920;
	--nw-red-dark: #A3121A;
	--nw-red-tint: #FCE8E9;
	--nw-black: #000000;
	--nw-white: #FFFFFF;
	--nw-shelf: #F2F2F2;
	--nw-steel: #5E5E5E;
	--nw-line: #DADADA;
	--nw-green: #1E7B34;
	--nw-green-tint: #E6F3E9;
	--nw-amber-tint: #FFF4D6;

	--nw-font-head: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
	--nw-font-body: "Source Sans 3", "Segoe UI", Arial, sans-serif;

	--nw-wrap: 1200px;
	--nw-measure: 760px;
	--nw-gap: clamp(1rem, 3vw, 2rem);
	--nw-radius: 4px;
}

/* Reset-ish ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--nw-white);
	color: var(--nw-black);
	font-family: var(--nw-font-body);
	font-size: 1.0625rem;
	line-height: 1.6;
}
img, video, iframe { max-width: 100%; height: auto; }
figure { margin: 0 0 1.5rem; }

a { color: var(--nw-red-dark); text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
a:hover { color: var(--nw-red); text-decoration-thickness: 2px; }

:focus-visible {
	outline: 3px solid var(--nw-black);
	outline-offset: 2px;
	box-shadow: 0 0 0 6px var(--nw-white);
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--nw-font-head);
	font-weight: 700;
	line-height: 1.05;
	margin: 0 0 0.6em;
	letter-spacing: 0.005em;
}
h1 { font-size: clamp(2.25rem, 5vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.3rem; }
h5, h6 { font-size: 1.1rem; }

p, ul, ol, dl, blockquote, table { margin: 0 0 1.25rem; }

.screen-reader-text {
	border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%);
	height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0;
	position: absolute !important; word-wrap: normal !important;
}
.skip-link:focus {
	clip: auto; clip-path: none; height: auto; width: auto;
	top: 0.5rem; left: 0.5rem; z-index: 1000;
	background: var(--nw-white); color: var(--nw-black);
	padding: 0.75rem 1rem; font-weight: 700;
}

.wrap {
	width: 100%;
	max-width: var(--nw-wrap);
	margin: 0 auto;
	padding: 0 var(--nw-gap);
}

/* Buttons ------------------------------------------------------------------ */
.button,
button,
input[type="submit"],
input[type="button"],
.wp-block-button__link,
.wp-element-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-height: 48px;
	padding: 0.6rem 1.4rem;
	border: 2px solid var(--nw-red);
	border-radius: var(--nw-radius);
	background: var(--nw-red);
	color: var(--nw-white);
	font-family: var(--nw-font-head);
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.1;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s, border-color .15s, color .15s;
}
.button:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.wp-block-button__link:hover,
.wp-element-button:hover {
	background: var(--nw-red-dark);
	border-color: var(--nw-red-dark);
	color: var(--nw-white);
	text-decoration: none;
}
.button--ghost,
.is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--nw-red-dark);
	border-color: currentColor;
}
.button--ghost:hover,
.is-style-outline .wp-block-button__link:hover {
	background: var(--nw-red-tint);
	color: var(--nw-red-dark);
	border-color: var(--nw-red-dark);
}
.button--white { background: var(--nw-white); border-color: var(--nw-white); color: var(--nw-red-dark); }
.button--white:hover { background: var(--nw-black); border-color: var(--nw-black); color: var(--nw-white); }
.button--outline-white { background: transparent; border-color: var(--nw-white); color: var(--nw-white); }
.button--outline-white:hover { background: var(--nw-white); border-color: var(--nw-white); color: var(--nw-red-dark); }
.button-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* Forms -------------------------------------------------------------------- */
input[type="text"], input[type="email"], input[type="url"], input[type="password"],
input[type="search"], input[type="number"], input[type="tel"], input[type="date"],
select, textarea {
	width: 100%;
	min-height: 48px;
	padding: 0.6rem 0.8rem;
	border: 2px solid var(--nw-line);
	border-radius: var(--nw-radius);
	background: var(--nw-white);
	color: var(--nw-black);
	font: inherit;
}
input:focus, select:focus, textarea:focus { border-color: var(--nw-black); outline: none; }
label { font-weight: 600; }

.search-form { display: flex; gap: 0.5rem; max-width: 560px; margin: 1.5rem 0; }
.search-form__field { flex: 1; }

/* Top bar ------------------------------------------------------------------ */
.topbar {
	background: var(--nw-black);
	color: var(--nw-white);
	font-size: 0.9rem;
}
.topbar__inner {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 1.5rem;
	min-height: 36px;
}
.topbar ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.25rem; align-items: center; }
.topbar__menu { margin-right: auto !important; }
.topbar a { color: var(--nw-white); text-decoration: none; font-weight: 600; }
.topbar a:hover { text-decoration: underline; color: var(--nw-white); }
.topbar__hello { color: #BDBDBD; }
@media (max-width: 600px) { .topbar__hello { display: none; } }

/* Header ------------------------------------------------------------------- */
.site-header {
	background: var(--nw-red);
	color: var(--nw-white);
	position: relative;
}
.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	min-height: 84px;
}
.custom-logo-link { display: block; line-height: 0; }
.custom-logo { max-height: 60px; width: auto; }

/* Wordmark used until a logo is uploaded */
.wordmark {
	display: inline-flex;
	align-items: stretch;
	font-family: var(--nw-font-head);
	font-weight: 800;
	font-size: 1.9rem;
	line-height: 1;
	text-decoration: none;
	color: var(--nw-white);
}
.wordmark:hover { color: var(--nw-white); text-decoration: none; }
.wordmark__nw {
	background: var(--nw-white);
	color: var(--nw-red);
	padding: 0.25rem 0.45rem 0.2rem;
	border-radius: var(--nw-radius) 0 0 var(--nw-radius);
}
.wordmark__name {
	padding: 0.25rem 0.55rem 0.2rem;
	border: 2px solid var(--nw-white);
	border-left: 0;
	border-radius: 0 var(--nw-radius) var(--nw-radius) 0;
	font-weight: 700;
}

/* Navigation */
.main-navigation ul { list-style: none; margin: 0; padding: 0; }
.main-navigation > ul { display: flex; gap: 0.25rem; }
.main-navigation li { position: relative; }
.main-navigation a {
	display: block;
	padding: 0.65rem 0.9rem;
	color: var(--nw-white);
	font-family: var(--nw-font-head);
	font-size: 1.3rem;
	font-weight: 700;
	text-decoration: none;
	border-radius: var(--nw-radius);
}
.main-navigation a:hover { background: var(--nw-red-dark); color: var(--nw-white); }
.main-navigation .current-menu-item > a,
.main-navigation .current-menu-ancestor > a,
.main-navigation .current_page_item > a {
	background: var(--nw-white);
	color: var(--nw-red-dark);
}
.main-navigation .sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 220px;
	background: var(--nw-white);
	border-top: 4px solid var(--nw-black);
	box-shadow: 0 8px 20px rgba(0,0,0,.18);
	z-index: 50;
	padding: 0.4rem 0;
}
.main-navigation li:hover > .sub-menu,
.main-navigation li:focus-within > .sub-menu { display: block; }
.main-navigation .sub-menu a { color: var(--nw-black); font-size: 1.15rem; border-radius: 0; }
.main-navigation .sub-menu a:hover { background: var(--nw-red-tint); color: var(--nw-red-dark); }

.menu-toggle { display: none; }

@media (max-width: 860px) {
	.menu-toggle {
		display: inline-flex;
		background: transparent;
		border-color: var(--nw-white);
		min-height: 44px;
		padding: 0.4rem 0.9rem;
	}
	.menu-toggle:hover { background: var(--nw-red-dark); border-color: var(--nw-white); }
	.menu-toggle__bars,
	.menu-toggle__bars::before,
	.menu-toggle__bars::after {
		display: block; width: 18px; height: 2px; background: var(--nw-white); position: relative;
	}
	.menu-toggle__bars::before, .menu-toggle__bars::after { content: ""; position: absolute; left: 0; }
	.menu-toggle__bars::before { top: -6px; }
	.menu-toggle__bars::after { top: 6px; }

	.site-header__inner { flex-wrap: wrap; }
	.main-navigation { display: none; width: 100%; padding-bottom: 1rem; }
	.main-navigation.is-open { display: block; }
	.main-navigation > ul { flex-direction: column; }
	.main-navigation .sub-menu {
		display: block; position: static; box-shadow: none; border: 0;
		background: transparent; padding-left: 1rem;
	}
	.main-navigation .sub-menu a { color: var(--nw-white); }
	.main-navigation .sub-menu a:hover { background: var(--nw-red-dark); color: var(--nw-white); }
}

/* Shelf edge: the strip under the red header, like the rail on a supermarket shelf */
.shelf-edge {
	height: 10px;
	background:
		linear-gradient(var(--nw-white), var(--nw-white)) top / 100% 3px no-repeat,
		var(--nw-black);
}

/* Page band (page titles) -------------------------------------------------- */
.page-band {
	background: var(--nw-shelf);
	padding: clamp(2rem, 5vw, 3.25rem) 0 clamp(1.5rem, 4vw, 2.5rem);
	border-bottom: 1px solid var(--nw-line);
}
.page-band__title { margin: 0; max-width: 22ch; }
.page-band__intro, .page-band__meta { margin: 0.75rem 0 0; color: var(--nw-steel); max-width: 60ch; }
.page-band__intro p:last-child { margin: 0; }
.page-band--slim { padding: 0; height: 1.25rem; border: 0; background: transparent; }

/* Layout ------------------------------------------------------------------- */
.layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: clamp(2rem, 5vw, 4rem);
	padding-top: clamp(2rem, 4vw, 3rem);
	padding-bottom: clamp(3rem, 6vw, 5rem);
}
.no-sidebar .layout { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 900px) { .layout { grid-template-columns: minmax(0, 1fr); } }

.site-main--page,
.site-main--wide,
.sensei-main {
	padding-top: clamp(2rem, 4vw, 3rem);
	padding-bottom: clamp(3rem, 6vw, 5rem);
}
.site-main--page { max-width: var(--nw-measure); }

/* Entry content */
.entry-content > * { max-width: var(--nw-measure); }
.site-main--wide .entry-content > *,
.entry-content > .alignwide { max-width: var(--nw-wrap); }
.entry-content > .alignfull { max-width: none; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.entry-content blockquote {
	margin-left: 0;
	padding: 0.25rem 0 0.25rem 1.25rem;
	border-left: 6px solid var(--nw-red);
	font-size: 1.15rem;
}
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--nw-line); text-align: left; }
.entry-content th { background: var(--nw-black); color: var(--nw-white); font-family: var(--nw-font-head); font-size: 1.1rem; }
.entry-content ul li::marker { color: var(--nw-red); }
.entry-content hr, hr { border: 0; border-top: 2px solid var(--nw-line); margin: 2.5rem 0; }
.entry__image img { border-radius: var(--nw-radius); }

/* Post cards */
.post-list { display: grid; gap: 1.5rem; }
.card {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
	gap: 1.25rem;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid var(--nw-line);
}
.card:not(:has(.card__image)) { grid-template-columns: minmax(0, 1fr); }
.card__image img { display: block; border-radius: var(--nw-radius); aspect-ratio: 16/9; object-fit: cover; }
.card__title { font-size: 1.7rem; margin-bottom: 0.4rem; }
.card__title a { color: var(--nw-black); text-decoration: none; }
.card__title a:hover { color: var(--nw-red); }
.card__meta { color: var(--nw-steel); font-size: 0.95rem; margin: 0 0 0.25rem; }
.card__excerpt p { margin: 0; }
@media (max-width: 600px) { .card { grid-template-columns: minmax(0, 1fr); } }

/* Post navigation / pagination */
.post-navigation .nav-links,
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: space-between; margin-top: 2.5rem; }
.nav-label { display: block; color: var(--nw-steel); font-size: 0.9rem; }
.pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 44px; min-height: 44px; padding: 0 0.75rem;
	border: 2px solid var(--nw-line); border-radius: var(--nw-radius);
	font-family: var(--nw-font-head); font-weight: 700; font-size: 1.15rem;
	color: var(--nw-black); text-decoration: none;
}
.pagination .page-numbers.current { background: var(--nw-red); border-color: var(--nw-red); color: var(--nw-white); }
.pagination a.page-numbers:hover { border-color: var(--nw-red); color: var(--nw-red); }

/* Sidebar & widgets */
.sidebar .widget { margin-bottom: 2.5rem; }
.widget-title {
	font-size: 1.4rem;
	padding-bottom: 0.4rem;
	border-bottom: 3px solid var(--nw-red);
}
.widget ul { list-style: none; padding: 0; }
.widget li { padding: 0.4rem 0; border-bottom: 1px solid var(--nw-line); }

/* Ticket: the price-tag label used on course categories */
.ticket {
	display: inline-block;
	padding: 0.2rem 0.75rem 0.2rem 1.1rem;
	background: var(--nw-red);
	color: var(--nw-white);
	font-family: var(--nw-font-head);
	font-weight: 700;
	font-size: 1rem;
	line-height: 1.3;
	clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);
}

/* Hero --------------------------------------------------------------------- */
.hero {
	background: var(--nw-red);
	color: var(--nw-white);
	border-top: 1px solid var(--nw-red-dark);
}
.hero__inner { padding-top: clamp(3rem, 8vw, 6rem); padding-bottom: clamp(3rem, 7vw, 5rem); }
.hero__title {
	font-size: clamp(2.75rem, 8vw, 5.75rem);
	font-weight: 800;
	line-height: 0.95;
	max-width: 14ch;
	margin-bottom: 1.25rem;
}
.hero__text { font-size: clamp(1.1rem, 2vw, 1.3rem); max-width: 48ch; margin-bottom: 2rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.hero :focus-visible { outline-color: var(--nw-white); box-shadow: 0 0 0 6px var(--nw-black); }
.shelf-edge--hero { height: 14px; }

/* Home course list --------------------------------------------------------- */
.home-courses { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.home-content { padding-bottom: clamp(3rem, 6vw, 5rem); }
.section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	margin-bottom: 1.75rem;
}
.section-head__title { margin: 0; }
.section-head__link { font-weight: 700; }

.course-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
	gap: 1.75rem;
}
.course-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: var(--nw-white);
	border: 1px solid var(--nw-line);
	border-bottom: 4px solid var(--nw-black);
	border-radius: var(--nw-radius) var(--nw-radius) 0 0;
	overflow: hidden;
}
.course-card:hover { border-bottom-color: var(--nw-red); }
.course-card:focus-within { outline: 3px solid var(--nw-black); outline-offset: 2px; }
.course-card__image { display: block; text-decoration: none; aspect-ratio: 16/9; background: var(--nw-shelf); }
.course-card__image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.course-card__placeholder {
	display: flex; align-items: center; justify-content: center;
	width: 100%; height: 100%;
	background: var(--nw-black); color: var(--nw-red);
	font-family: var(--nw-font-head); font-weight: 800; font-size: 5rem;
}
.course-card .ticket { position: absolute; top: 1rem; right: 0; }
.course-card__body { display: flex; flex-direction: column; flex: 1; padding: 1.25rem 1.25rem 1.1rem; }
.course-card__title { font-size: 1.7rem; margin-bottom: 0.5rem; }
.course-card__title a { color: var(--nw-black); text-decoration: none; }
.course-card__title a::after { content: ""; position: absolute; inset: 0; } /* whole card clickable */
.course-card__title a:hover { color: var(--nw-red); }
.course-card__title a:focus-visible { outline: none; box-shadow: none; }
.course-card__excerpt { color: var(--nw-steel); font-size: 1rem; }
.course-card__excerpt p { margin: 0 0 1rem; }
.course-card__foot {
	margin-top: auto;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1rem;
	padding-top: 0.9rem;
	border-top: 1px dashed var(--nw-line);
	font-weight: 600;
	font-size: 0.95rem;
}
.course-card__status { color: var(--nw-red-dark); }
.mini-progress { flex: 1 1 100%; height: 8px; background: var(--nw-shelf); border-radius: 99px; overflow: hidden; }
.mini-progress__bar { display: block; height: 100%; background: var(--nw-red); }

/* Empty state */
.empty-state {
	padding: 2rem;
	background: var(--nw-shelf);
	border-left: 6px solid var(--nw-red);
}
.empty-state__title { font-size: 1.8rem; }
.empty-state p:last-child { margin-bottom: 0; }

/* Comments */
.comments-area { margin-top: 3rem; padding-top: 2rem; border-top: 3px solid var(--nw-black); }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 1.5rem; border-left: 2px solid var(--nw-line); }
.comment-body { padding: 1rem 0; border-bottom: 1px solid var(--nw-line); }
.comment-author .avatar { border-radius: 50%; float: left; margin-right: 0.75rem; }
.comment-metadata { font-size: 0.9rem; color: var(--nw-steel); }

/* Footer ------------------------------------------------------------------- */
.site-footer {
	background: var(--nw-black);
	color: #D6D6D6;
	border-top: 6px solid var(--nw-red);
	padding: clamp(2.5rem, 5vw, 3.5rem) 0 2rem;
	font-size: 0.95rem;
}
.site-footer a { color: var(--nw-white); }
.site-footer a:hover { color: var(--nw-white); }
.site-footer .widget-title { color: var(--nw-white); border-bottom-color: var(--nw-red); }
.site-footer .widget li { border-bottom-color: #333; }
.footer-widgets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 2rem;
	margin-bottom: 2rem;
}
.site-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem 2rem;
}
.site-footer .wordmark { font-size: 1.5rem; }
.site-footer .wordmark__nw { color: var(--nw-black); }
.site-footer .custom-logo { max-height: 44px; }
.footer-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1.25rem; }
.footer-menu a { text-decoration: none; font-weight: 600; }
.footer-menu a:hover { text-decoration: underline; }
.site-footer__copy { margin: 0; color: #9E9E9E; }

/* WordPress core alignment & captions */
.alignleft { float: left; margin: 0 1.5rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.5rem; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption-text, figcaption { font-size: 0.9rem; color: var(--nw-steel); margin-top: 0.4rem; }
.sticky .card__title::before { content: "Pinned: "; color: var(--nw-red); }

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Login page template ------------------------------------------------------ */
.login-panel {
	max-width: 460px;
	padding: clamp(1.25rem, 4vw, 2rem);
	border: 1px solid var(--nw-line);
	border-top: 6px solid var(--nw-red);
	border-radius: 0 0 var(--nw-radius) var(--nw-radius);
	background: var(--nw-white);
}
.login-intro { margin-bottom: 1.25rem; }
.login-intro > *:last-child { margin-bottom: 0; }
#nw-loginform p { margin: 0 0 1.1rem; }
#nw-loginform label { display: block; margin-bottom: 0.35rem; }
#nw-loginform .login-remember label {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-weight: 400;
	cursor: pointer;
}
#nw-loginform input[type="checkbox"] { width: 20px; height: 20px; margin: 0; accent-color: var(--nw-red); }
#nw-loginform .login-submit { margin-bottom: 0; }
#nw-loginform .login-submit .button { width: 100%; }
.login-panel__links {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.5rem 1rem;
	margin: 1.25rem 0 0;
	padding-top: 1rem;
	border-top: 1px dashed var(--nw-line);
	font-weight: 600;
}
.login-notice {
	margin-bottom: 1.25rem;
	padding: 0.85rem 1rem;
	background: var(--nw-green-tint);
	border-left: 6px solid var(--nw-green);
	font-weight: 600;
}
.login-notice--error { background: var(--nw-red-tint); border-left-color: var(--nw-red); }
