/* Only the selected Native Book / Category template loads this stylesheet. */
.ph-native-book-category {
	color: #333;
	direction: inherit;
	font-family: var(--ph-ploni-font, "ploni-aaa", Arial, sans-serif);
	line-height: 1.5;
	margin-inline: auto;
	padding-block-end: 48px;
	text-align: start;
	width: 100%;
}

.ph-native-book-category .ph-book-category__layout {
	margin-inline: auto;
	max-width: 960px;
	min-width: 0;
}

.ph-native-book-category .ph-book-category__layout {
	box-sizing: border-box;
	padding: 24px 20px;
}
.ph-native-book-category .ph-book-category__layout--list { max-width: 680px; }

.ph-native-book-category .ph-book-category__listing {
	min-width: 0;
	overflow-wrap: anywhere;
}

.ph-native-book-category .ph-book-category__items {
	display: grid;
	gap: 12px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.ph-native-book-category .ph-book-category__items a {
	border: 1px solid #ddd;
	border-inline-start: 3px solid #a31e23;
	display: block;
	font-size: 1.15rem;
	padding: 14px 18px;
	text-decoration: none;
}

/* Links hierarchy only: lists keep full width; indentation is applied to each
   label/link and capped, so arbitrarily deep branches cannot accumulate gutters. */
.ph-native-book-category--chapter .ph-book-category__items[data-ph-chapter-links] .ph-book-category__subchapter-items {
	display: grid;
	gap: 12px;
	list-style: none;
	margin: 0;
	padding: 0;
	min-width: 0;
}
.ph-native-book-category--chapter .ph-book-category__items[data-ph-chapter-links] li { min-width: 0; }
.ph-native-book-category--chapter .ph-book-category__items[data-ph-chapter-links] li > a,
.ph-native-book-category--chapter .ph-book-category__items[data-ph-chapter-links] .ph-book-category__subchapter-title {
	margin-inline-start: min(calc(var(--ph-subchapter-depth, 0) * 1rem), 20%);
	overflow-wrap: anywhere;
}
.ph-native-book-category--chapter .ph-book-category__items[data-ph-chapter-links] .ph-book-category__subchapter-title {
	font-family: inherit;
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.4;
	margin-block: 12px;
}
.ph-native-book-category--chapter .ph-book-category__items[data-ph-chapter-links] .ph-book-category__subchapter-title > a {
	border: 0;
	display: inline;
	font-size: inherit;
	padding: 0;
	text-decoration: underline;
}

.ph-native-book-category a { color: #a31e23; }
.ph-native-book-category a:hover { text-decoration: underline; }
.ph-native-book-category a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.ph-native-book-category p { overflow: visible; text-overflow: clip; }
.ph-native-book-category .ph-book-category__halakha {
	margin-block: 28px;
}
.ph-native-book-category--chapter .ph-book-category__halakha-title[id] {
	scroll-margin-top: var(--ph-notes-scroll-offset, calc(var(--ph-pilot-header-height, 72px) + var(--wp-admin--admin-bar--height, 0px) + 16px));
}
@media (min-width: 901px) {
	/* Only a panel that fits below fixed UI stays sticky. Taller panels use document scrolling. */
	.ph-native-book-category--chapter .ph-book-category__layout--with-sidebar > .ph-book-category__sidebar--fits-viewport {
		position: sticky;
		top: var(--ph-chapter-sidebar-offset, var(--ph-notes-scroll-offset, calc(var(--ph-pilot-header-height, 72px) + var(--wp-admin--admin-bar--height, 0px) + 16px)));
	}
}
.ph-native-book-category--chapter .ph-book-category__layout--with-sidebar {
	display: grid;
	grid-template-columns: minmax(210px, 255px) minmax(0, 680px) minmax(88px, 126px);
	align-items: start;
	gap: 22px;
	justify-content: center;
	padding-inline: 16px;
	max-width: 1180px;
}
.ph-native-book-category--chapter .ph-book-category__sidebar { min-width: 0; border: 0; padding: 0; }
.ph-native-book-category--chapter .ph-book-category__sidebar-title {
	color: #a31e23; font-size: 26px; font-weight: 600; line-height: 1.35;
	padding: 1rem 0.75rem 0.15rem; background: #f1f5f7;
	border: 1px solid #0001; border-block-end: 0; border-radius: 16px 16px 0 0; margin: 0;
}
.ph-native-book-category--chapter .ph-book-category__layout--with-sidebar > .ph-book-category__listing { padding-inline: 24px; }
.ph-native-book-category--chapter .ph-book-category__layout--with-sidebar .ph-book-category__content { max-width: 640px; margin-inline: auto; }
.ph-native-book-category--chapter .ph-book-category__menu-toggle { display: none; }
.ph-native-book-category--chapter .ph-book-category__halakha > .ph-book-category__halakha-title {
	font-family: inherit;
	font-size: 26px;
	line-height: 1.3;
	margin-block: 0 16px;
}
.ph-native-book-category--chapter .ph-book-category__halakha-menu {
	display: grid;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 0.65rem 0.75rem;
	background: #f1f5f7;
	border: 1px solid #0001;
	border-block-start: 0;
	border-radius: 0 0 16px 16px;
}
.ph-native-book-category--chapter .ph-book-category__halakha-menu > li {
	list-style: none;
	margin: 0;
	padding: 0;
	min-width: 0;
	max-width: 100%;
}
.ph-native-book-category--chapter .ph-book-category__halakha-menu > li > a {
	display: block;
	border-block-end: 1px solid #eee;
	font-size: 16px;
	color: #070707;
	line-height: 1.4;
	padding: 10px 0;
	overflow-wrap: anywhere;
	text-decoration: none;
}
.ph-native-book-category--chapter .ph-book-category__halakha-menu > li > a:hover,
.ph-native-book-category--chapter .ph-book-category__halakha-menu > li > a:focus-visible {
	color: #891202;
	text-decoration: underline;
}
.ph-native-book-category .ph-book-category__pagination { display: flex; flex-wrap: wrap; gap: 14px; margin-block-start: 24px; }
/* Full-content prose has its own base; it never inherits a heading/container size.
   Keep authored inline styles and shortcode-specific rules available: no universal reset. */
.ph-native-book-category--chapter .ph-book-category__halakha > .ph-book-category__content {
	font-family: inherit;
	font-size: 20px;
	font-weight: 400;
	line-height: 1.6;
	overflow-wrap: anywhere;
}
.ph-native-book-category--chapter .ph-book-category__content :where(p, div, span, blockquote, ul, ol, li, dl, dt, dd) {
	font-size: inherit;
	line-height: inherit;
}
.ph-native-book-category--chapter .ph-book-category__content :where(h1, h2, h3, h4, h5, h6) {
	font-family: inherit;
	font-weight: 700;
	line-height: 1.3;
	margin-block: 1.3em 0.6em;
}
.ph-native-book-category--chapter .ph-book-category__content h1 { font-size: 1.8em; }
.ph-native-book-category--chapter .ph-book-category__content h2 { font-size: 1.6em; }
.ph-native-book-category--chapter .ph-book-category__content h3 { font-size: 1.3em; }
.ph-native-book-category--chapter .ph-book-category__content h4 { font-size: 1.15em; }
.ph-native-book-category--chapter .ph-book-category__content :where(h5, h6) { font-size: 1em; }
.ph-native-book-category--chapter .ph-book-category__content :where(ul, ol) { padding-inline-start: 1.5em; }
.ph-native-book-category--chapter .ph-book-category__content blockquote {
	border-inline-start: 3px solid #ddd;
	margin-inline: 0;
	padding-inline-start: 1em;
}
.ph-native-book-category :where(img, video, iframe, svg) { max-width: 100%; }

/* Shared Single note classes, scoped here without loading the Single stylesheet. */
.ph-native-book-category--chapter .ph-halakha-notes-toggle {
	background: #fff; border: 1px solid #ddd; border-radius: 4px;
	color: #333; cursor: pointer; font: inherit; font-size: 0.9rem;
	margin: 12px 0; padding: 7px 12px;
}
.ph-native-book-category--chapter .ph-halakha-notes-toggle:hover,
.ph-native-book-category--chapter .ph-halakha-notes-toggle:focus-visible { border-color: #a31e23; color: #a31e23; }
.ph-native-book-category--chapter .ph-halakha-notes-collapsed,
.ph-native-book-category--chapter .ph-halakha-notes-separator-hidden { display: none; }

@media (max-width: 900px) {
	.ph-native-book-category--chapter .ph-book-category__layout--with-sidebar { display: flex; flex-direction: column; gap: 20px; }
	.ph-native-book-category--chapter .ph-book-category__sidebar,
	.ph-native-book-category--chapter .ph-book-category__listing { width: 100%; }
	.ph-native-book-category--chapter .ph-book-category__layout--with-sidebar > .ph-book-category__listing { padding-inline: 0; }
	.ph-native-book-category--chapter .ph-book-category__layout--with-sidebar .ph-book-category__content { max-width: none; }
	.ph-native-book-category--chapter .ph-book-category__sidebar--enhanced .ph-book-category__sidebar-title { display: none; }
	.ph-native-book-category--chapter .ph-book-category__sidebar--enhanced .ph-book-category__menu-toggle {
		display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; background: #f1f5f7; border: 1px solid #0001; border-radius: 16px;
		/* Single navigation's accent, weight and panel palette, at compact menu scale. */
		color: #891102; cursor: pointer; font: inherit; font-size: 16px; font-weight: 600; line-height: 1.3;
		box-sizing: border-box; min-height: 44px; padding: 8px 12px; text-align: start;
	}
	.ph-native-book-category--chapter .ph-book-category__menu-label { flex: 1 1 auto; text-align: start; }
	/* Same border-chevron and ARIA-driven rotation as Single's mmyhb toggle. */
	.ph-native-book-category--chapter .ph-book-category__menu-chevron {
		flex: 0 0 auto; margin-inline-start: auto; border: 0;
		border-bottom: 1.5px solid currentColor; border-right: 1.5px solid currentColor;
		width: 0.45rem; height: 0.45rem; transform: rotate(45deg);
	}
	.ph-native-book-category--chapter .ph-book-category__menu-toggle[aria-expanded="true"] .ph-book-category__menu-chevron { transform: rotate(225deg); }
	.ph-native-book-category--chapter .ph-book-category__menu-toggle[aria-expanded="true"] { border-radius: 16px 16px 0 0; border-block-end: 0; }
	.ph-native-book-category--chapter .ph-book-category__menu-toggle:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
	.ph-native-book-category--chapter .ph-book-category__sidebar--enhanced .ph-book-category__menu-toggle[aria-expanded="false"] + .ph-book-category__halakha-navigation { display: none; }
}

@media (max-width: 640px) {
	.ph-native-book-category { padding-block-end: 24px; }
	.ph-native-book-category .ph-book-category__layout { padding: 18px 14px; }
	.ph-native-book-category .ph-book-category__items a { padding: 12px; }
}
