/* H+RI Policy Tabs */

.hri-pt {
	--hri-primary: #ed1c24;
	--hri-muted: #616366;
	--hri-dark: #121212;
	--hri-offset: 120px;
	--hri-line: rgba(97, 99, 102, .18);
	--hri-soft: rgba(97, 99, 102, .06);
	--hri-tint: rgba(237, 28, 36, .07);
	--hri-radius: 14px;

	color: var(--hri-dark);
	font-size: 16px;
	line-height: 1.7;
	margin: 0 auto 2.5rem;
	max-width: 1240px;
	box-sizing: border-box;
	scroll-margin-top: var(--hri-offset);
}
.hri-pt *,
.hri-pt *::before,
.hri-pt *::after { box-sizing: border-box; }

/* ------------------------------------------------------------------
 * Layout
 * ---------------------------------------------------------------- */
.hri-pt--sidebar {
	display: grid;
	grid-template-columns: minmax(230px, 290px) minmax(0, 1fr);
	gap: 2.5rem;
	align-items: start;
}
.hri-pt--top { display: block; }

/* ------------------------------------------------------------------
 * Navigation
 * ---------------------------------------------------------------- */
.hri-pt { position: relative; }
.hri-pt__nav { position: relative; z-index: 20; }

/* Sticky (native). --hri-sticky-top is set by JS (offset + admin bar). */
.hri-pt--sticky .hri-pt__nav {
	position: -webkit-sticky;
	position: sticky;
	top: var(--hri-sticky-top, calc(var(--hri-offset) - 24px));
}

/* JS fallback when an ancestor (overflow: hidden, etc.) blocks CSS sticky.
   JS sets position:fixed / absolute inline; this is the resting state. */
.hri-pt--sticky.is-jssticky .hri-pt__nav {
	position: relative;
	top: 0;
}
.hri-pt__nav-ph { display: block; height: 0; margin: 0; padding: 0; pointer-events: none; }

/* Sidebar: placeholder and bar share the first grid cell. */
.hri-pt--sidebar > .hri-pt__nav-ph,
.hri-pt--sidebar > .hri-pt__nav { grid-column: 1; grid-row: 1; }
.hri-pt--sidebar > .hri-pt__panels { grid-column: 2; grid-row: 1; }

/* Sidebar: long tab lists scroll inside the sticky box. */
.hri-pt--sticky.hri-pt--sidebar .hri-pt__tablist {
	max-height: calc(100vh - var(--hri-sticky-top, 96px) - 24px);
	overflow-y: auto;
	scrollbar-width: thin;
}

/* Top layout: a bar that floats over the content while stuck. */
.hri-pt--top .hri-pt__nav { margin-bottom: 2rem; }
.hri-pt--sticky.hri-pt--top .hri-pt__nav { padding: .5rem 0; }
.hri-pt--sticky.hri-pt--top .hri-pt__nav .hri-pt__tablist { transition: box-shadow .25s ease; }

/* Elevated look while stuck. */
.hri-pt--sidebar .hri-pt__tablist { transition: box-shadow .25s ease; }
.hri-pt--sidebar .hri-pt__nav.is-stuck .hri-pt__tablist {
	box-shadow: 0 16px 40px -18px rgba(18, 18, 18, .45);
}
.hri-pt--top .hri-pt__nav.is-stuck .hri-pt__tablist {
	box-shadow: 0 10px 28px -12px rgba(18, 18, 18, .4);
}

.hri-pt__tablist {
	display: flex;
	gap: .375rem;
}

.hri-pt--sidebar .hri-pt__tablist {
	flex-direction: column;
	padding: .5rem;
	background: #fff;
	border: 1px solid var(--hri-line);
	border-radius: var(--hri-radius);
	box-shadow: 0 10px 30px -18px rgba(18, 18, 18, .35);
}

.hri-pt--top .hri-pt__tablist {
	flex-wrap: wrap;
	padding: .375rem;
	background: #f2f2f3; /* solid, so content doesn't show through when stuck */
	border: 1px solid var(--hri-line);
	border-radius: 999px;
	width: fit-content;
	max-width: 100%;
}

.hri-pt__tab {
	position: relative;
	display: flex;
	align-items: center;
	gap: .75rem;
	padding: .85rem 1rem;
	border-radius: 10px;
	color: var(--hri-muted) !important;
	text-decoration: none !important;
	font-weight: 600;
	font-size: .95rem;
	line-height: 1.3;
	transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
	-webkit-tap-highlight-color: transparent;
	border: 0 !important;
	box-shadow: none;
}
.hri-pt--top .hri-pt__tab { border-radius: 999px; padding: .7rem 1.2rem; }

.hri-pt__tab:hover { color: var(--hri-dark) !important; background: var(--hri-soft); }

.hri-pt__tab:focus-visible {
	outline: 2px solid var(--hri-primary);
	outline-offset: 2px;
}

.hri-pt__tab-num {
	flex: 0 0 auto;
	display: inline-grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	border-radius: 8px;
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .03em;
	color: var(--hri-muted);
	background: var(--hri-soft);
	transition: inherit;
}
.hri-pt--top .hri-pt__tab-num { display: none; }

.hri-pt__tab.is-active {
	color: var(--hri-dark) !important;
	background: var(--hri-tint);
}
.hri-pt--sidebar .hri-pt__tab.is-active::before {
	content: "";
	position: absolute;
	left: -.5rem;
	top: 22%;
	bottom: 22%;
	width: 4px;
	border-radius: 0 4px 4px 0;
	background: var(--hri-primary);
}
.hri-pt__tab.is-active .hri-pt__tab-num {
	background: var(--hri-primary);
	color: #fff;
}
.hri-pt--top .hri-pt__tab.is-active {
	background: var(--hri-dark);
	color: #fff !important;
	box-shadow: 0 6px 16px -8px rgba(18, 18, 18, .6);
}

/* ------------------------------------------------------------------
 * Panels
 * ---------------------------------------------------------------- */
.hri-pt__panels { min-width: 0; }

.hri-pt__panel {
	scroll-margin-top: var(--hri-offset);
	background: #fff;
	border: 1px solid var(--hri-line);
	border-radius: var(--hri-radius);
	box-shadow: 0 18px 40px -28px rgba(18, 18, 18, .35);
	overflow: hidden;
}
.hri-pt__panel:focus { outline: none; }
.hri-pt__panel:focus-visible { outline: 2px solid var(--hri-primary); outline-offset: 3px; }

/* Without JS every panel stays visible (stacked). */
.hri-pt.is-ready .hri-pt__panel { display: none; }
.hri-pt.is-ready .hri-pt__panel.is-active {
	display: block;
	animation: hriPtIn .35s ease both;
}
.hri-pt:not(.is-ready) .hri-pt__panel + .hri-pt__panel { margin-top: 2rem; }

@keyframes hriPtIn {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: none; }
}

.hri-pt__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1.25rem;
	padding: 2.25rem 2.5rem 1.75rem;
	border-bottom: 1px solid var(--hri-line);
	background:
		linear-gradient(90deg, var(--hri-primary) 0, var(--hri-primary) 64px, transparent 64px) top left / 100% 4px no-repeat,
		linear-gradient(180deg, var(--hri-soft), #fff);
}

.hri-pt__eyebrow {
	display: block;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--hri-primary);
	margin-bottom: .5rem;
}

.hri-pt .hri-pt__title {
	margin: 0;
	padding: 0;
	font-size: clamp(1.45rem, 1.1rem + 1.3vw, 2.1rem);
	line-height: 1.2;
	font-weight: 700;
	color: var(--hri-dark);
	letter-spacing: -.01em;
	border: 0;
}

.hri-pt__meta {
	margin: .6rem 0 0;
	font-size: .85rem;
	color: var(--hri-muted);
}

.hri-pt__tools {
	display: flex;
	gap: .5rem;
	flex: 0 0 auto;
}

.hri-pt .hri-pt__btn {
	display: inline-flex;
	align-items: center;
	gap: .45rem;
	padding: .55rem .95rem;
	margin: 0;
	font: inherit;
	font-size: .82rem;
	font-weight: 600;
	line-height: 1;
	color: var(--hri-muted);
	background: #fff;
	border: 1px solid var(--hri-line);
	border-radius: 999px;
	cursor: pointer;
	transition: color .2s ease, border-color .2s ease, background-color .2s ease;
	text-transform: none;
	letter-spacing: 0;
	box-shadow: none;
	min-height: 0;
}
.hri-pt .hri-pt__btn:hover {
	color: var(--hri-primary);
	border-color: var(--hri-primary);
	background: #fff;
}
.hri-pt .hri-pt__btn:focus-visible { outline: 2px solid var(--hri-primary); outline-offset: 2px; }
.hri-pt .hri-pt__btn.is-done {
	color: #fff;
	background: var(--hri-dark);
	border-color: var(--hri-dark);
}

/* ------------------------------------------------------------------
 * Typography inside policies
 * ---------------------------------------------------------------- */
.hri-pt__content {
	padding: 2rem 2.5rem 2.5rem;
	color: #2a2b2d;
}
.hri-pt__content > *:first-child { margin-top: 0; }
.hri-pt__content > *:last-child { margin-bottom: 0; }

.hri-pt__content p { margin: 0 0 1.05em; }

.hri-pt__content h2,
.hri-pt__content h3 {
	position: relative;
	margin: 2.25em 0 .75em;
	padding: 0 0 0 1rem;
	font-size: 1.22rem;
	line-height: 1.35;
	font-weight: 700;
	color: var(--hri-dark);
	scroll-margin-top: var(--hri-offset);
	text-transform: none;
	letter-spacing: 0;
}
.hri-pt__content h2::before,
.hri-pt__content h3::before {
	content: "";
	position: absolute;
	left: 0;
	top: .2em;
	bottom: .2em;
	width: 4px;
	border-radius: 4px;
	background: var(--hri-primary);
}

.hri-pt__content h4 {
	margin: 1.6em 0 .5em;
	font-size: 1.02rem;
	font-weight: 700;
	color: var(--hri-dark);
	scroll-margin-top: var(--hri-offset);
	text-transform: none;
	letter-spacing: 0;
}

.hri-pt__content a {
	color: var(--hri-primary);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	word-break: break-word;
}
.hri-pt__content a:hover { color: var(--hri-dark); }

.hri-pt__content strong { color: var(--hri-dark); }

.hri-pt__content ul,
.hri-pt__content ol {
	margin: 0 0 1.2em;
	padding: 0;
	list-style: none;
}
.hri-pt__content li {
	position: relative;
	margin: 0 0 .5em;
	padding-left: 1.6rem;
}
.hri-pt__content ul > li::before {
	content: "";
	position: absolute;
	left: .3rem;
	top: .68em;
	width: 7px;
	height: 7px;
	border-radius: 2px;
	background: var(--hri-primary);
	transform: rotate(45deg);
}
.hri-pt__content ol { counter-reset: hri-ol; }
.hri-pt__content ol > li { counter-increment: hri-ol; padding-left: 2.2rem; }
.hri-pt__content ol > li::before {
	content: counter(hri-ol);
	position: absolute;
	left: 0;
	top: .15em;
	display: grid;
	place-items: center;
	width: 1.5rem;
	height: 1.5rem;
	border-radius: 50%;
	font-size: .75rem;
	font-weight: 700;
	color: #fff;
	background: var(--hri-dark);
}

.hri-pt__content .hri-pt-card {
	margin: 2em 0 1.2em;
	padding: 1.25rem 1.5rem;
	border-radius: 12px;
	background: var(--hri-soft);
	border-left: 4px solid var(--hri-primary);
}
.hri-pt__content > .hri-pt-card:first-child { margin-top: 0; }
.hri-pt__content .hri-pt-card p:last-child { margin-bottom: 0; }

.hri-pt__content table {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 1.2em;
	font-size: .92rem;
	display: block;
	overflow-x: auto;
}
.hri-pt__content th,
.hri-pt__content td { padding: .6rem .8rem; border: 1px solid var(--hri-line); text-align: left; }
.hri-pt__content th { background: var(--hri-soft); color: var(--hri-dark); }

/* ------------------------------------------------------------------
 * Toast
 * ---------------------------------------------------------------- */
.hri-pt-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	z-index: 99999;
	padding: .7rem 1.1rem;
	border-radius: 999px;
	background: #121212;
	color: #fff;
	font-size: .85rem;
	font-weight: 600;
	box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5);
	transform: translate(-50%, 20px);
	opacity: 0;
	transition: opacity .25s ease, transform .25s ease;
	pointer-events: none;
}
.hri-pt-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------------
 * Tablet
 * ---------------------------------------------------------------- */
@media (max-width: 1024px) {
	.hri-pt--sidebar { grid-template-columns: minmax(200px, 240px) minmax(0, 1fr); gap: 1.5rem; }
	.hri-pt__head { padding: 1.75rem 1.75rem 1.4rem; }
	.hri-pt__content { padding: 1.6rem 1.75rem 2rem; }
}

/* ------------------------------------------------------------------
 * Mobile: both layouts become a sticky, swipeable tab bar
 * ---------------------------------------------------------------- */
@media (max-width: 782px) {
	.hri-pt { font-size: 15.5px; }

	.hri-pt--sidebar { display: block; }

	.hri-pt .hri-pt__nav,
	.hri-pt--top .hri-pt__nav,
	.hri-pt--sticky.hri-pt--top .hri-pt__nav {
		margin: 0 -16px 1.25rem;
		padding: .5rem 16px;
		background: rgba(255, 255, 255, .94);
		-webkit-backdrop-filter: blur(10px);
		backdrop-filter: blur(10px);
		transition: box-shadow .25s ease;
	}
	.hri-pt .hri-pt__nav.is-stuck {
		box-shadow: 0 8px 20px -14px rgba(18, 18, 18, .5);
	}
	.hri-pt .hri-pt__nav.is-stuck .hri-pt__tablist,
	.hri-pt--top .hri-pt__nav.is-stuck .hri-pt__tablist { box-shadow: none; }
	.hri-pt--sticky.hri-pt--sidebar .hri-pt__tablist { max-height: none; overflow-y: hidden; }
	.hri-pt__nav::after {
		content: "";
		position: absolute;
		top: 0;
		right: 0;
		bottom: 0;
		width: 32px;
		background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff);
		pointer-events: none;
	}

	.hri-pt .hri-pt__tablist,
	.hri-pt--sidebar .hri-pt__tablist,
	.hri-pt--top .hri-pt__tablist {
		flex-direction: row;
		flex-wrap: nowrap;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x proximity;
		scrollbar-width: none;
		width: auto;
		margin: 0;
		padding: .3rem;
		gap: .3rem;
		border: 0;
		border-radius: 999px;
		box-shadow: none;
		background: var(--hri-soft);
	}
	.hri-pt__tablist::-webkit-scrollbar { display: none; }

	.hri-pt .hri-pt__tab {
		flex: 0 0 auto;
		scroll-snap-align: start;
		padding: .6rem 1rem;
		border-radius: 999px;
		font-size: .86rem;
		white-space: nowrap;
	}
	.hri-pt .hri-pt__tab-num { display: none; }
	.hri-pt--sidebar .hri-pt__tab.is-active::before { display: none; }
	.hri-pt .hri-pt__tab.is-active {
		background: var(--hri-dark);
		color: #fff !important;
	}

	.hri-pt__panel { border-radius: 12px; }
	.hri-pt__head {
		flex-direction: column;
		align-items: flex-start;
		padding: 1.4rem 1.2rem 1.2rem;
	}
	.hri-pt__tools { width: 100%; }
	.hri-pt .hri-pt__btn { flex: 1 1 0; justify-content: center; padding: .7rem .9rem; }
	.hri-pt__content { padding: 1.3rem 1.2rem 1.6rem; }
	.hri-pt__content h2,
	.hri-pt__content h3 { font-size: 1.1rem; margin-top: 1.9em; }
}

@media (prefers-reduced-motion: reduce) {
	.hri-pt *,
	.hri-pt-toast { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------------
 * Print: only the active policy, clean
 * ---------------------------------------------------------------- */
@media print {
	body.hri-pt-printing * { visibility: hidden !important; }
	body.hri-pt-printing .hri-pt__panel.is-printing,
	body.hri-pt-printing .hri-pt__panel.is-printing * { visibility: visible !important; }
	body.hri-pt-printing .hri-pt__panel.is-printing {
		position: absolute;
		left: 0;
		top: 0;
		width: 100%;
		border: 0;
		box-shadow: none;
		animation: none;
	}
	.hri-pt__tools,
	.hri-pt__nav { display: none !important; }
	.hri-pt__head { background: none; padding: 0 0 1rem; }
	.hri-pt__content { padding: 1rem 0 0; }
	.hri-pt__content a { color: #121212; }
}
