/**
 * Guides for trainers (page 10870): "Pick your route" (G1, G2, G5), the
 * feature card grid (G3) and the hub's core block layout. Paired with
 * front-end/onlysecurity-guides-routes.php, assets/js/onlysecurity-routes.js
 * and assets/js/onlysecurity-explainer.js.
 *
 * DEV-398, operator 2026-11-19 ("Flat tabs, grouped cards"): the pinned dark
 * stage is gone. The chooser is a light section with flat tabs on every
 * screen and the steps as a numbered row. Without JavaScript every route
 * shows as a headed list.
 *
 * Feature cards come in two shapes, both styled here: the old Spectra
 * container (.wp-block-uagb-container.os-hub-card, in .os-hub-features) and
 * the core group card (.os-hub-card in .os-hub-grid, in .os-hub-group).
 */

.os-rt {
	--os-rt-gold: #fcb900;
	--os-rt-ink: #1e293b;
	--os-rt-muted: #64748b;
	--os-rt-line: #e2e8f0;
	max-width: 1120px;
	margin: 0 auto;
	padding: 24px 16px 8px;
	box-sizing: border-box;
	color: var(--os-rt-ink);
}
.os-rt *,
.os-rt *::before,
.os-rt *::after { box-sizing: border-box; }
.os-rt h2 { color: var(--os-rt-ink); font-size: clamp(26px, 3.2vw, 34px); line-height: 1.15; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.os-rt__prompt { color: var(--os-rt-muted); margin: 8px 0 0; font-size: 17px; line-height: 1.5; }

/* Tabs: flat pills. */
.os-rt__tabs { position: relative; display: none; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
html.os-rt-js .os-rt__tabs { display: flex; }
.os-rt__tab {
	all: unset;
	box-sizing: border-box;
	cursor: pointer;
	padding: 10px 18px;
	display: grid;
	gap: 1px;
	min-height: 44px;
	color: var(--os-rt-muted);
	border-radius: 999px;
	box-shadow: inset 0 0 0 1px var(--os-rt-line);
	background: #fff;
	transition: color .2s, background-color .2s, box-shadow .2s;
}
.os-rt__tab b { font-size: 15px; font-weight: 600; color: var(--os-rt-ink); }
.os-rt__tab span { font-size: 13px; line-height: 1.3; }
.os-rt__tab:hover { box-shadow: inset 0 0 0 1px #94a3b8; }
.os-rt__tab[aria-selected="true"] { background: var(--os-rt-ink); color: #cbd5e1; box-shadow: none; }
.os-rt__tab[aria-selected="true"] b { color: #fff; }
.os-rt__tab:focus-visible { outline: 3px solid var(--os-rt-gold); outline-offset: 2px; }

/* Panels: stacked without the script, one at a time with it. */
.os-rt__panels { margin-top: 18px; }
.os-rt__panel { padding: 8px 0; }
.os-rt__panel + .os-rt__panel { border-top: 1px solid var(--os-rt-line); margin-top: 12px; }
.os-rt__route { color: var(--os-rt-ink); font-size: 20px; margin: 0 0 14px; }
.os-rt__route span { display: block; font-size: 14px; font-weight: 400; color: var(--os-rt-muted); margin-top: 2px; }
html.os-rt-js .os-rt__panel { display: none; border: 0; margin: 0; }
html.os-rt-js .os-rt__panel.is-on { display: block; }
html.os-rt-js .os-rt__route { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Steps: a numbered row. */
.os-rt__steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 14px; }
.os-rt__step { margin: 0; min-width: 0; display: flex; }
.os-rt__card { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 16px; background: #f8fafc; border: 1px solid var(--os-rt-line); min-width: 0; }
.os-rt__node { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 700; background: var(--os-rt-gold); color: #1a1300; }
.os-rt__ico { display: none; }
.os-rt__card h4 { font-size: 17px; line-height: 1.25; color: var(--os-rt-ink); margin: 4px 0 0; font-weight: 600; }
.os-rt__card p { margin: 0; color: var(--os-rt-muted); font-size: 14.5px; line-height: 1.5; }
.os-rt__src { font-size: 13px; color: var(--os-rt-muted); margin-top: auto; padding-top: 6px; }
.os-rt__src b { color: var(--os-rt-ink); font-weight: 600; }
.os-rt__links { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.os-rt__links a { color: #1e293b; font-weight: 600; font-size: 14px; text-decoration: underline; text-decoration-color: var(--os-rt-gold); text-decoration-thickness: 2px; text-underline-offset: 3px; padding: 4px 0; }
.os-rt__links a:hover { text-decoration-color: var(--os-rt-ink); }
.os-rt__links a.os-rt__also { color: var(--os-rt-muted); font-weight: 500; font-size: 13px; text-decoration-color: #cbd5e1; }
.os-rt a:focus-visible { outline: 3px solid var(--os-rt-gold); outline-offset: 3px; border-radius: 6px; }
@media (max-width: 1100px) {
	.os-rt__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
	html.os-rt-js .os-rt__tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
	.os-rt__tabs::-webkit-scrollbar { display: none; }
	.os-rt__tab { flex: none; }
	.os-rt__tab span { display: none; }
	.os-rt__steps { grid-template-columns: minmax(0, 1fr); gap: 10px; }
	.os-rt__card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
	.os-rt *,
	.os-rt *::before,
	.os-rt *::after { animation: none !important; transition: none !important; }
}

/* G2: the card a route step jumps to. */
.os-rt-target { scroll-margin-top: calc(var(--os-rt-top, 0px) + 24px); outline: 3px solid transparent; outline-offset: 4px; border-radius: 12px; }
.os-rt-target:focus { outline: 3px solid transparent; }
.os-rt-target.is-os-rt-hl { animation: os-rt-hl 1.2s ease-out; }
@keyframes os-rt-hl { 0%, 70% { outline-color: #fcb900; } 100% { outline-color: transparent; } }

/* G3: the feature cards in four columns from 1280px (DEV-272), three below
 * that, two on tablets, one on phones.
 * The block rows of four become transparent, so the cards flow as one grid.
 * The section's own block styles set the wrapper's gap, alignment and a
 * 1300px width with higher specificity, hence the !important. */
.os-hub-features > .uagb-container-inner-blocks-wrap {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px !important;
	align-items: stretch !important;
	max-width: 1200px !important;
	margin-left: auto;
	margin-right: auto;
}
.os-hub-features > .uagb-container-inner-blocks-wrap > * { grid-column: 1 / -1; }
.os-hub-features > .uagb-container-inner-blocks-wrap > .wp-block-uagb-container:not(.os-hub-card) { display: contents !important; }
.os-hub-features .os-hub-card { grid-column: auto; width: auto !important; max-width: none !important; min-width: 0; margin: 0 !important; }
.os-hub-features .os-hub-more { grid-column: 1 / -1; }
@media (max-width: 1024px) {
	.os-hub-features > .uagb-container-inner-blocks-wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
	.os-hub-features > .uagb-container-inner-blocks-wrap { grid-template-columns: minmax(0, 1fr); }
}
/* DEV-272, approved 2026-11-11: four columns from 1280px, with 32px between
 * cards and 24px inside them. A wrapping flex row rather than the grid, so a
 * short last row (18 cards leave two) sits centred for any card count. The
 * section's block styles set the wrapper to a nowrap column with higher
 * specificity, hence the !important; the card padding ties with each card's
 * own block rule, so it carries one too. The section heading takes a full
 * row. Each card's link sits at the card foot, so the links in a row line up. */
@media (min-width: 1280px) {
	.os-hub-features > .uagb-container-inner-blocks-wrap { display: flex !important; flex-direction: row !important; flex-wrap: wrap !important; justify-content: center !important; gap: 32px !important; }
	.os-hub-features > .uagb-container-inner-blocks-wrap > * { flex: 0 0 100%; }
	.os-hub-features .os-hub-card { flex: 0 0 calc((100% - 96px) / 4); padding: 24px !important; }
	.os-hub-features .os-hub-card > .wp-block-uagb-buttons:last-child { margin-top: auto; }
}


/* The hub's core block layout (body.os-hub-page, DEV-398). */
body.os-hub-page .osg.osg--head { max-width: none; padding: 0; }
body.os-hub-page .osg .osg-hero {
	max-width: 760px;
	margin: 0 auto;
	padding: 48px 16px 24px;
	background: none;
	border-radius: 0;
	text-align: center;
	color: #1e293b;
}
body.os-hub-page .osg .osg-hero h1 { color: #1e293b; font-size: clamp(32px, 5vw, 44px); line-height: 1.12; font-weight: 600; margin: 0 0 12px; letter-spacing: -.01em; }
body.os-hub-page .osg .osg-hero p { color: #64748b; font-size: 17px; line-height: 1.55; max-width: 640px; margin: 0 auto; }
body.os-hub-page .osg-hero .wp-block-buttons { justify-content: center; gap: 12px; margin-top: 24px; }
body.os-hub-page .osg-hero .wp-block-button__link { border-radius: 999px; padding: 13px 24px; font-weight: 600; font-size: 16px; text-decoration: none; background: #fcb900; color: #1e293b; border: 2px solid #fcb900; }
body.os-hub-page .osg-hero .is-style-outline > .wp-block-button__link { background: #fff; border-color: #cbd5e1; }
body.os-hub-page .osg-hero .wp-block-button__link:hover { border-color: #1e293b; }
body.os-hub-page .osg-crumbs { display: none; }

body.os-hub-page .os-hub-start,
body.os-hub-page .os-hub-trainer,
body.os-hub-page .os-hub-tips,
body.os-hub-page .os-hub-groups { max-width: 1120px; margin: 40px auto; padding: 0 16px; box-sizing: border-box; }
body.os-hub-page .os-hub-start > h2,
body.os-hub-page .os-hub-trainer > h2,
body.os-hub-page .os-hub-tips > h2 { text-align: left; color: #1e293b; font-size: clamp(26px, 3.2vw, 34px); font-weight: 600; margin: 0 0 6px; }
body.os-hub-page .os-hub-start > p,
body.os-hub-page .os-hub-trainer > p,
body.os-hub-page .os-hub-tips > p { text-align: left; color: #64748b; font-size: 17px; max-width: 640px; margin: 0 0 20px; }
body.os-hub-page .os-hub-start h3 { color: #1e293b; font-weight: 600; }

/* Feature groups: a details block per job, open on screens 768px and wider
 * (the script keeps it open there and closes it on phones). Open in the
 * saved content, so every card shows without the script. */
.os-hub-group { margin: 0 0 36px; border: 0; padding: 0; }
.os-hub-group > summary { list-style: none; cursor: pointer; color: #1e293b; font-size: clamp(22px, 2.6vw, 28px); font-weight: 600; line-height: 1.2; padding: 0; }
.os-hub-group > summary::-webkit-details-marker { display: none; }
.os-hub-group > summary:focus-visible { outline: 3px solid #fcb900; outline-offset: 4px; border-radius: 6px; }
.os-hub-group > p.os-hub-group__lead { color: #64748b; font-size: 16px; margin: 6px 0 18px; max-width: 640px; }
@media (min-width: 768px) {
	.os-hub-group > summary { pointer-events: none; cursor: default; }
}
@media (max-width: 767.98px) {
	html.os-rt-js details.os-hub-group:not(.is-os-set) > :not(summary) { display: none; }
	.os-hub-group { margin: 0 0 12px; border: 1px solid #e2e8f0; border-radius: 16px; padding: 0 16px; background: #fff; }
	.os-hub-group > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; font-size: 20px; }
	.os-hub-group > summary::after { content: ""; flex: none; width: 10px; height: 10px; border-right: 2px solid #64748b; border-bottom: 2px solid #64748b; transform: rotate(45deg); transition: transform .2s; }
	.os-hub-group[open] > summary::after { transform: rotate(-135deg); }
	.os-hub-group[open] { padding-bottom: 16px; }
}
.os-hub-grid { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
.os-hub-grid > .os-hub-card { margin: 0 !important; min-width: 0; }
@media (max-width: 1024px) { .os-hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .os-hub-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; } }
.os-hub-group .os-hub-card {
	display: flex;
	flex-direction: column;
	padding: 20px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	box-sizing: border-box;
}
.os-hub-group .os-hub-card > * { margin-block: 0; }
.os-hub-group .os-hub-card .os-xv,
.os-hub-group .os-hub-card > figure { margin-bottom: 16px; }
.os-hub-group .os-hub-card > figure img { width: 100%; height: auto; border-radius: 8px; display: block; }
.os-hub-group .os-hub-card h3 { color: #1e293b; font-size: 19px; line-height: 1.25; font-weight: 600; margin: 0 0 6px; }
.os-hub-group .os-hub-card p { color: #64748b; font-size: 15px; line-height: 1.55; margin: 0; }
.os-hub-group .os-hub-card p.os-hub-link { margin-top: auto; padding-top: 14px; }
.os-hub-group .os-hub-card p.os-hub-link a { color: #1e293b; font-weight: 600; text-decoration: underline; text-decoration-color: #fcb900; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.os-hub-group .os-hub-card p.os-hub-link a:hover { text-decoration-color: #1e293b; }

#pick-your-route,
.os-hub-start { scroll-margin-top: calc(var(--os-rt-top, 0px) + 24px); }

/* Tips: posts as cards. */
.os-hub-tips .wp-block-post-template { gap: 24px; }
.os-hub-tips .wp-block-post { border: 1px solid #e2e8f0; border-radius: 16px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.os-hub-tips .wp-block-post > * { margin-block: 0; }
.os-hub-tips .wp-block-post-featured-image img { width: 100%; height: auto; display: block; }
.os-hub-tips .wp-block-post-title { font-size: 18px; line-height: 1.3; font-weight: 600; padding: 16px 18px 0; }
.os-hub-tips .wp-block-post-title a { color: #1e293b; text-decoration: none; }
.os-hub-tips .wp-block-post-title a:hover { text-decoration: underline; }
.os-hub-tips .wp-block-post-excerpt { color: #64748b; font-size: 15px; line-height: 1.55; padding: 8px 18px 18px; }
.os-hub-tips .wp-block-post-excerpt p { margin: 0; }
