/* CatholicG33k Core 3.70 — Pope A–Z / Number browse interface */

.cg-pope-browse-ui {
	display: grid;
	gap: 18px;
	margin: 20px 0 0;
}

.cg-pope-browse-switch {
	display: inline-flex;
	align-items: center;
	gap: 0;
	width: fit-content;
	max-width: 100%;
	border: 1px solid rgba(205, 157, 18, 0.34);
	background: rgba(8, 9, 13, 0.35);
}

.cg-pope-browse-switch button {
	appearance: none;
	min-height: 40px;
	padding: 0 18px;
	border: 0;
	border-right: 1px solid rgba(205, 157, 18, 0.26);
	background: transparent;
	color: rgba(244, 239, 227, 0.72);
	font: inherit;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	cursor: pointer;
}

.cg-pope-browse-switch button:last-child {
	border-right: 0;
}

.cg-pope-browse-switch button:hover,
.cg-pope-browse-switch button:focus-visible,
.cg-pope-browse-switch button[aria-pressed="true"] {
	color: #08090d;
	background: #e2a900;
	outline: 0;
}

.cg-pope-az-bar {
	display: grid;
	grid-template-columns: repeat(26, minmax(0, 1fr));
	width: 100%;
	border-top: 1px solid rgba(205, 157, 18, 0.34);
	border-bottom: 1px solid rgba(205, 157, 18, 0.34);
	background: rgba(11, 13, 19, 0.42);
}

.cg-pope-az-letter {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
	min-height: 44px;
	padding: 0;
	border: 0;
	border-right: 1px solid rgba(205, 157, 18, 0.12);
	background: transparent;
	color: #e2a900;
	font-family: Georgia, "Times New Roman", serif;
	font-size: 0.9rem;
	font-weight: 600;
	text-decoration: none !important;
	cursor: pointer;
}

.cg-pope-az-letter:last-child {
	border-right: 0;
}

.cg-pope-az-letter:hover,
.cg-pope-az-letter:focus-visible {
	background: rgba(226, 169, 0, 0.09);
	color: #f2ecdf;
	outline: 1px solid rgba(226, 169, 0, 0.55);
	outline-offset: -1px;
}

.cg-pope-az-letter.is-disabled {
	color: rgba(118, 133, 157, 0.35);
	cursor: default;
	pointer-events: none;
}

.cg-pope-number-panel[hidden],
.cg-pope-az-bar[hidden] {
	display: none !important;
}

.cg-pope-number-panel {
	margin: 0 0 34px;
}

.cg-pope-number-ranges {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 20px;
}

.cg-pope-number-range {
	appearance: none;
	min-height: 36px;
	padding: 0 12px;
	border: 1px solid rgba(205, 157, 18, 0.28);
	background: rgba(14, 17, 24, 0.72);
	color: rgba(244, 239, 227, 0.76);
	font: inherit;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	cursor: pointer;
}

.cg-pope-number-range:hover,
.cg-pope-number-range:focus-visible,
.cg-pope-number-range[aria-pressed="true"] {
	border-color: #e2a900;
	background: rgba(226, 169, 0, 0.09);
	color: #e2a900;
	outline: 0;
}

.cg-pope-number-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cg-pope-number-entry {
	margin: 0;
	min-width: 0;
}

.cg-pope-number-entry[hidden] {
	display: none !important;
}

.cg-pope-number-entry > a {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr) auto;
	align-items: center;
	gap: 13px;
	min-height: 56px;
	padding: 10px 14px;
	border: 1px solid rgba(205, 157, 18, 0.22);
	background: linear-gradient(145deg, rgba(18, 21, 29, 0.9), rgba(13, 16, 23, 0.9));
	color: inherit;
	text-decoration: none !important;
	transition: border-color 0.18s ease, background 0.18s ease;
}

.cg-pope-number-entry > a:hover,
.cg-pope-number-entry > a:focus-visible {
	border-color: rgba(226, 169, 0, 0.7);
	background: rgba(226, 169, 0, 0.05);
	outline: 0;
}

.cg-pope-number-badge {
	color: #e2a900;
	font-family: var(--cg-font-mono, "Courier New"), monospace;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.08em;
}

.cg-pope-number-name {
	min-width: 0;
	color: #f2ecdf;
	font-family: var(--cg-font-serif, "Cormorant Garamond"), Georgia, "Times New Roman", serif;
	font-size: 1.08rem;
	line-height: 1.18;
}

.cg-pope-number-arrow {
	color: #e2a900;
	font-size: 1rem;
}

.cg-pope-native-letter-nav-hidden {
	display: none !important;
}

.cg-pope-number-mode .cg-pope-letter-section-browse-hidden {
	display: none !important;
}

@media (max-width: 980px) {
	.cg-pope-az-bar {
		grid-template-columns: repeat(13, minmax(0, 1fr));
	}

	.cg-pope-az-letter:nth-child(13) {
		border-right: 0;
	}
}

@media (max-width: 680px) {
	.cg-pope-browse-switch {
		width: 100%;
	}

	.cg-pope-browse-switch button {
		flex: 1 1 50%;
		padding: 0 12px;
	}

	.cg-pope-az-bar {
		grid-template-columns: repeat(7, minmax(0, 1fr));
	}

	.cg-pope-az-letter {
		min-height: 42px;
	}

	.cg-pope-number-list {
		grid-template-columns: 1fr;
	}

	.cg-pope-number-entry > a {
		grid-template-columns: 54px minmax(0, 1fr) auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cg-pope-number-entry > a {
		transition: none;
	}
}


/* ============================================================
   3.71 — remove the legacy oversized letter TOC completely
   ============================================================ */

.cg-pope-native-letter-nav-hidden {
	display: none !important;
	visibility: hidden !important;
	height: 0 !important;
	min-height: 0 !important;
	max-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	overflow: hidden !important;
}

.cg-pope-browse-ui + .cg-pope-number-panel {
	margin-top: 0;
}

/*
 * Number mode should show only the compact numbered directory,
 * not the alphabetical letter sections beneath it.
 */
.cg-pope-number-mode .cg-pope-letter-section {
	display: none !important;
}

/*
 * Keep the compact controls visually tight after removing the old TOC.
 */
.cg-pope-browse-ui {
	margin-bottom: 0;
}

.cg-pope-az-bar {
	margin-bottom: 10px;
}


/* ============================================================
   3.72 — Pope directory card facelift
   Quiet scholarly catalog; no content or behavior changes.
   ============================================================ */

.cg-pope-manuscript .cg-pope-letter-section {
	margin-top: clamp(54px, 6vw, 78px);
}

.cg-pope-manuscript .cg-pope-letter-section:first-of-type {
	margin-top: 38px;
}

.cg-pope-manuscript .cg-pope-letter-section > h2,
.cg-pope-manuscript .cg-pope-letter-section > h3,
.cg-pope-manuscript .cg-pope-letter-anchor {
	margin: 0 0 22px !important;
	color: #e2a900 !important;
	font-family:
		var(--cg-font-serif, "Cormorant Garamond"),
		Georgia,
		"Times New Roman",
		serif !important;
	font-size: clamp(2rem, 3vw, 2.65rem) !important;
	font-weight: 500 !important;
	line-height: 1 !important;
	letter-spacing: 0.02em !important;
	text-transform: none !important;
}

.cg-pope-manuscript .cg-pope-letter-section > h2::after,
.cg-pope-manuscript .cg-pope-letter-section > h3::after,
.cg-pope-manuscript .cg-pope-letter-anchor::after {
	display: block;
	width: 54px;
	height: 1px;
	margin-top: 16px;
	content: "";
	background:
		linear-gradient(
			90deg,
			rgba(226, 169, 0, 0.78),
			rgba(226, 169, 0, 0.08)
		);
}

.cg-pope-manuscript .cg-pope-grid {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	gap: 16px 18px !important;
	margin: 0 !important;
	padding: 0 !important;
}

.cg-pope-manuscript .cg-pope-card {
	position: relative;
	display: flex !important;
	align-items: stretch;
	min-width: 0;
	min-height: 112px !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden;
	background:
		linear-gradient(
			145deg,
			rgba(17, 20, 28, 0.92),
			rgba(10, 12, 18, 0.96)
		) !important;
	border:
		1px solid
		rgba(200, 157, 35, 0.18) !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	transition:
		transform 0.18s ease,
		border-color 0.18s ease,
		background 0.18s ease !important;
}

.cg-pope-manuscript .cg-pope-card::before {
	position: absolute;
	top: 0;
	left: 0;
	width: 2px;
	height: 100%;
	content: "";
	background:
		linear-gradient(
			180deg,
			rgba(226, 169, 0, 0.72),
			rgba(226, 169, 0, 0.08)
		);
	opacity: 0.72;
}

.cg-pope-manuscript .cg-pope-card:hover,
.cg-pope-manuscript .cg-pope-card:focus-within {
	transform: translateY(-2px);
	border-color:
		rgba(226, 169, 0, 0.46) !important;
	background:
		linear-gradient(
			145deg,
			rgba(20, 23, 31, 0.98),
			rgba(12, 14, 20, 0.98)
		) !important;
}

.cg-pope-manuscript .cg-pope-card > a {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-rows: auto auto;
	align-items: center;
	column-gap: 16px;
	row-gap: 10px;
	width: 100%;
	min-height: 112px;
	padding: 22px 22px 20px 24px !important;
	box-sizing: border-box;
	color: inherit !important;
	text-decoration: none !important;
}

.cg-pope-manuscript .cg-pope-name {
	grid-column: 1;
	grid-row: 1;
	min-width: 0;
	margin: 0 !important;
	color: #f2ecdf !important;
	font-family:
		var(--cg-font-serif, "Cormorant Garamond"),
		Georgia,
		"Times New Roman",
		serif !important;
	font-size: clamp(1.12rem, 1.45vw, 1.3rem) !important;
	font-weight: 600 !important;
	line-height: 1.18 !important;
	letter-spacing: 0.005em !important;
	text-transform: none !important;
}

.cg-pope-manuscript .cg-pope-meta {
	grid-column: 1;
	grid-row: 2;
	margin: 0 !important;
	color: rgba(210, 178, 91, 0.74) !important;
	font-family:
		var(--cg-font-mono, "Courier New"),
		monospace !important;
	font-size: 0.66rem !important;
	font-weight: 600 !important;
	line-height: 1.25 !important;
	letter-spacing: 0.08em !important;
	text-transform: uppercase !important;
}

.cg-pope-manuscript .cg-pope-card-arrow {
	grid-column: 2;
	grid-row: 1 / span 2;
	align-self: center;
	justify-self: end;
	margin: 0 !important;
	color: rgba(226, 169, 0, 0.82) !important;
	font-size: 1.15rem !important;
	line-height: 1 !important;
	transform: none !important;
	transition:
		transform 0.18s ease,
		color 0.18s ease !important;
}

.cg-pope-manuscript .cg-pope-card:hover .cg-pope-card-arrow,
.cg-pope-manuscript .cg-pope-card:focus-within .cg-pope-card-arrow {
	color: #e2a900 !important;
	transform: translateX(3px) !important;
}

.cg-pope-manuscript .cg-pope-card:hover .cg-pope-name,
.cg-pope-manuscript .cg-pope-card:focus-within .cg-pope-name {
	color: #ffffff !important;
}

/* Keep long papal names readable without making the card excessively tall. */
.cg-pope-manuscript .cg-pope-name br {
	display: none;
}

@media (max-width: 980px) {
	.cg-pope-manuscript .cg-pope-grid {
		grid-template-columns:
			repeat(2, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 640px) {
	.cg-pope-manuscript .cg-pope-letter-section {
		margin-top: 46px;
	}

	.cg-pope-manuscript .cg-pope-grid {
		grid-template-columns: 1fr !important;
		gap: 12px !important;
	}

	.cg-pope-manuscript .cg-pope-card,
	.cg-pope-manuscript .cg-pope-card > a {
		min-height: 96px !important;
	}

	.cg-pope-manuscript .cg-pope-card > a {
		padding: 18px 18px 17px 20px !important;
	}

	.cg-pope-manuscript .cg-pope-name {
		font-size: 1.16rem !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cg-pope-manuscript .cg-pope-card,
	.cg-pope-manuscript .cg-pope-card-arrow {
		transition: none !important;
	}

	.cg-pope-manuscript .cg-pope-card:hover,
	.cg-pope-manuscript .cg-pope-card:focus-within,
	.cg-pope-manuscript .cg-pope-card:hover .cg-pope-card-arrow,
	.cg-pope-manuscript .cg-pope-card:focus-within .cg-pope-card-arrow {
		transform: none !important;
	}
}


/* ============================================================
   3.73 — browse persistence / mobile range / directory note
   ============================================================ */

.cg-pope-back-to-directory {
	display: inline-flex;
	align-items: center;
	margin: 20px 0 0;
	color: rgba(210, 178, 91, 0.76) !important;
	font-family:
		var(--cg-font-mono, "Courier New"),
		monospace;
	font-size: 0.62rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-decoration: none !important;
	text-transform: uppercase;
}

.cg-pope-back-to-directory::before {
	margin-right: 7px;
	content: "↑";
	color: #e2a900;
}

.cg-pope-back-to-directory:hover,
.cg-pope-back-to-directory:focus-visible {
	color: #e2a900 !important;
	outline: 0;
}

/*
 * Existing WordPress "About This Directory" section is styled as a quiet
 * reference note. The prose remains normal editable Page content.
 */
.cg-pope-about-directory {
	position: relative;
	margin: clamp(44px, 5vw, 70px) 0 0;
	padding: clamp(26px, 3.5vw, 38px);
	background:
		linear-gradient(
			145deg,
			rgba(17, 20, 28, 0.72),
			rgba(10, 12, 18, 0.76)
		);
	border:
		1px solid
		rgba(200, 157, 35, 0.2);
}

.cg-pope-about-directory::before {
	position: absolute;
	top: 0;
	left: 0;
	width: 2px;
	height: 100%;
	content: "";
	background:
		linear-gradient(
			180deg,
			rgba(226, 169, 0, 0.75),
			rgba(226, 169, 0, 0.06)
		);
}

.cg-pope-about-directory h2,
.cg-pope-about-directory h3 {
	margin: 0 0 18px !important;
	color: #f2ecdf !important;
	font-family:
		var(--cg-font-serif, "Cormorant Garamond"),
		Georgia,
		"Times New Roman",
		serif !important;
	font-size: clamp(1.75rem, 2.8vw, 2.3rem) !important;
	font-weight: 500 !important;
	line-height: 1.1 !important;
	letter-spacing: 0.01em !important;
	text-transform: none !important;
}

.cg-pope-about-directory p {
	max-width: 78ch;
	margin: 0 0 14px !important;
	color: rgba(224, 226, 232, 0.82) !important;
	font-size: 0.96rem;
	line-height: 1.75;
}

.cg-pope-about-directory p:last-child {
	margin-bottom: 0 !important;
}

@media (max-width: 680px) {
	.cg-pope-number-ranges {
		flex-wrap: nowrap;
		overflow-x: auto;
		overscroll-behavior-inline: contain;
		scroll-snap-type: inline proximity;
		padding: 0 0 8px;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: thin;
	}

	.cg-pope-number-range {
		flex: 0 0 auto;
		scroll-snap-align: start;
		white-space: nowrap;
	}

	.cg-pope-back-to-directory {
		margin-top: 16px;
	}

	.cg-pope-about-directory {
		margin-top: 38px;
		padding: 24px 20px;
	}
}


/* ============================================================
   3.75 — dedicated Every Pope search results
   ============================================================ */

.cg-pope-search-results-panel {
	margin: 24px 0 42px;
	padding: clamp(24px, 3vw, 34px);
	scroll-margin-top: 96px;
	border: 1px solid rgba(200, 157, 35, 0.24);
	background:
		linear-gradient(
			145deg,
			rgba(15, 18, 25, 0.82),
			rgba(9, 11, 16, 0.9)
		);
}

.cg-pope-search-results-panel[hidden] {
	display: none !important;
}

.cg-pope-search-results-heading {
	margin: 0 0 22px !important;
	color: #f2ecdf !important;
	font-family:
		var(--cg-font-serif, "Cormorant Garamond"),
		Georgia,
		"Times New Roman",
		serif !important;
	font-size: clamp(1.7rem, 2.5vw, 2.15rem) !important;
	font-weight: 500 !important;
	line-height: 1.1 !important;
	letter-spacing: 0.01em !important;
	text-transform: none !important;
}

.cg-pope-search-results-heading::after {
	display: block;
	width: 54px;
	height: 1px;
	margin-top: 14px;
	content: "";
	background:
		linear-gradient(
			90deg,
			rgba(226, 169, 0, 0.78),
			rgba(226, 169, 0, 0.08)
		);
}

.cg-pope-search-results-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cg-pope-search-results-grid.is-single-result {
	grid-template-columns: minmax(0, 420px);
}

.cg-pope-search-result-card {
	position: relative;
	min-width: 0;
	margin: 0;
	background:
		linear-gradient(
			145deg,
			rgba(17, 20, 28, 0.96),
			rgba(10, 12, 18, 0.98)
		);
	border: 1px solid rgba(200, 157, 35, 0.2);
}

.cg-pope-search-result-card::before {
	position: absolute;
	top: 0;
	left: 0;
	width: 2px;
	height: 100%;
	content: "";
	background:
		linear-gradient(
			180deg,
			rgba(226, 169, 0, 0.74),
			rgba(226, 169, 0, 0.08)
		);
}

.cg-pope-search-result-card > a {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-rows: auto auto;
	align-items: center;
	column-gap: 16px;
	row-gap: 9px;
	min-height: 104px;
	padding: 20px 20px 18px 22px;
	color: inherit !important;
	text-decoration: none !important;
}

.cg-pope-search-result-card:hover,
.cg-pope-search-result-card:focus-within {
	border-color: rgba(226, 169, 0, 0.55);
	background: rgba(226, 169, 0, 0.04);
}

.cg-pope-search-result-card.is-exact-match {
	border-color: rgba(226, 169, 0, 0.46);
	box-shadow: inset 0 0 0 1px rgba(226, 169, 0, 0.08);
}

.cg-pope-search-result-card.is-exact-match::before {
	width: 3px;
	background: #e2a900;
}

.cg-pope-search-result-card.is-exact-match .cg-pope-search-result-meta {
	color: rgba(237, 196, 78, 0.92);
}

.cg-pope-search-result-name {
	grid-column: 1;
	grid-row: 1;
	min-width: 0;
	color: #f2ecdf;
	font-family:
		var(--cg-font-serif, "Cormorant Garamond"),
		Georgia,
		"Times New Roman",
		serif;
	font-size: 1.16rem;
	font-weight: 600;
	line-height: 1.2;
}

.cg-pope-search-result-meta {
	grid-column: 1;
	grid-row: 2;
	color: rgba(210, 178, 91, 0.76);
	font-family:
		var(--cg-font-mono, "Courier New"),
		monospace;
	font-size: 0.66rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	line-height: 1.25;
	text-transform: uppercase;
}

.cg-pope-search-result-arrow {
	grid-column: 2;
	grid-row: 1 / span 2;
	align-self: center;
	color: #e2a900;
	font-size: 1.05rem;
}

.cg-pope-search-results-empty {
	padding: 24px 4px 4px;
	text-align: left;
}

.cg-pope-search-results-empty[hidden] {
	display: none !important;
}

/*
 * Active search is a dedicated results mode.
 * Do not leave the filtered alphabet, numbered browser, directory note,
 * or 3.73 return links underneath the search result cards.
 */
.cg-pope-search-active .cg-pope-browse-heading,
.cg-pope-search-active .cg-pope-browse-ui,
.cg-pope-search-active .cg-pope-number-panel,
.cg-pope-search-active .cg-pope-letter-section,
.cg-pope-search-active .cg-pope-back-to-directory,
.cg-pope-search-active .cg-pope-numbering-note,
.cg-pope-search-active .cg-pope-about-directory {
	display: none !important;
}

@media (max-width: 980px) {
	.cg-pope-search-results-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.cg-pope-search-results-panel {
		margin-top: 18px;
		padding: 20px 16px;
	}

	.cg-pope-search-results-grid {
		grid-template-columns: 1fr;
		gap: 11px;
	}

	.cg-pope-search-result-card > a {
		min-height: 92px;
		padding: 17px 17px 16px 19px;
	}
}
