/*
Theme Name: DANDS Base Block Theme
Author: DANDS
Description: Shared block theme foundation for the DANDS multisite.
Version: 0.5.5
Requires at least: 6.6
Requires PHP: 8.0
Text Domain: dands-base
*/

html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }
body { margin: 0; }
img { max-width: 100%; height: auto; }

/* Shared semantic colour tokens. The palette values are defaults; each
 * multisite site can override the three Site-* colours through Global Styles.
 */
:root {
	--dands-site-primary: var(--wp--preset--color--site-primary);
	--dands-site-light: var(--wp--preset--color--site-light);
	--dands-site-primary-hover: var(--wp--preset--color--site-primary-hover);
	--dands-site-white: var(--wp--preset--color--white);
	--dands-site-text: var(--wp--preset--color--dands-charcoal);
	--dands-site-border: var(--wp--preset--color--neutral-border);
}

/* Header layout: full-width outer header with a constrained inner container. */
.dands-site-header {
	width: 100%;
	max-width: none;
	background-color: var(--dands-site-primary) !important;
	color: var(--dands-site-white) !important;
}

.dands-site-header > .dands-header-inner {
	width: min(1200px, calc(100% - 32px));
	max-width: none;
	margin-inline: auto;
}

.dands-site-header,
.dands-site-header .dands-site-identity,
.dands-site-header .dands-site-identity *,
.dands-site-header .wp-block-site-title,
.dands-site-header .wp-block-site-tagline {
	color: var(--dands-site-white);
}

.dands-site-header .dands-site-logo img {
	max-height: 72px;
}

/* Keep the site title white even though shared link rules colour ordinary links. */
.dands-site-header .wp-block-site-title a,
.dands-site-header .wp-block-site-title a:visited,
.dands-site-header .wp-block-site-title a:hover,
.dands-site-header .wp-block-site-title a:focus-visible {
	color: var(--dands-site-white) !important;
	text-decoration: none;
}

/* Header logo has deliberate vertical breathing room inside the header. */
.dands-site-header .dands-site-logo {
	padding-block: 12px;
}

/* Default minimum heights; these remain editable on the Header/Footer Group
 * blocks in Appearance > Editor > Patterns > Template Parts. */
.dands-site-header {
	min-height: 120px;
}

.dands-site-footer {
	min-height: 100px;
}


/* Keep the existing logo size while preventing the identity/navigation from collapsing. */
.dands-site-identity {
	min-width: 0;
	flex-shrink: 1;
}

.dands-header-navigation {
	flex-shrink: 0;
	margin-left: 24px;
}

.dands-header-navigation .wp-block-navigation__container {
	gap: 24px;
}

.dands-header-navigation .wp-block-navigation-item {
	margin: 0;
}

/* Header navigation: primary by default, light text on the site-hover colour. */
.dands-header-navigation .wp-block-navigation-item__content,
.dands-header-navigation .wp-block-navigation-submenu__toggle {
	color: var(--dands-site-white) !important;
	background-color: transparent;
	border-radius: 4px;
	transition: background-color 120ms ease, color 120ms ease;
}

.dands-header-navigation .wp-block-navigation-item__content:hover,
.dands-header-navigation .wp-block-navigation-item__content:focus-visible,
.dands-header-navigation .wp-block-navigation-submenu__toggle:hover,
.dands-header-navigation .wp-block-navigation-submenu__toggle:focus-visible {
	color: var(--dands-site-light) !important;
	background-color: var(--dands-site-primary-hover) !important;
}

.dands-header-navigation .wp-block-navigation-item__content:hover,
.dands-header-navigation .wp-block-navigation-submenu__toggle:hover {
	text-decoration: none;
}

.dands-header-navigation .wp-block-navigation-item__content:focus-visible,
.dands-header-navigation .wp-block-navigation-submenu__toggle:focus-visible {
	outline: 3px solid var(--dands-site-light);
	outline-offset: 2px;
}

/* Give nested navigation levels consistent spacing without hard-coding menu items. */
.dands-header-navigation .wp-block-navigation__submenu-container {
	gap: 8px;
	padding: 8px;
	background-color: var(--dands-site-primary) !important;
}

@media (max-width: 782px) {
	.dands-site-header > .dands-header-inner {
		width: calc(100% - 24px);
	}

	.dands-header-navigation {
		margin-left: 16px;
	}

	.dands-header-navigation .wp-block-navigation__container {
		gap: 16px;
	}
}

/* Sticky full-width footer. */
.wp-site-blocks {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.wp-site-blocks > main {
	flex: 1 0 auto;
	width: 100%;
}

/* Keep the main content aligned with the 12px mobile gutters used by the
 * shared header and footer. This is theme-level so it works independently
 * of page type or plugin name. */
@media (max-width: 782px) {
	.wp-site-blocks > main {
		padding-inline: 12px;
		box-sizing: border-box;
	}
}

.dands-site-footer {
	width: 100%;
	margin-block-start: auto;
	background-color: var(--dands-site-primary) !important;
	color: var(--dands-site-white) !important;
}

.dands-site-footer > .dands-footer-inner {
	width: min(1200px, calc(100% - 32px));
	max-width: none;
	margin-inline: auto;
}

.dands-site-footer .dands-footer-content,
.dands-site-footer .dands-footer-content * {
	color: var(--dands-site-white);
}

.dands-site-footer a {
	color: var(--dands-site-white) !important;
}

.dands-site-footer a:hover,
.dands-site-footer a:focus-visible {
	color: var(--dands-site-light) !important;
}

.dands-site-footer a:focus-visible {
	outline: 3px solid var(--dands-site-light);
	outline-offset: 2px;
}

.dands-footer-content {
	width: 100%;
}

.dands-footer-inner > .wp-block-shortcode:last-child {
	margin-inline-start: auto;
}

@media (max-width: 782px) {
	.dands-site-footer > .dands-footer-inner {
		width: calc(100% - 24px);
	}

	.dands-footer-content {
		gap: 8px 16px;
	}

	.dands-footer-inner > .wp-block-shortcode:last-child {
		margin-inline-start: 0;
	}
}

/* Front-page navigation card component. */
.dands-front-page-cards {
	width: 100%;
	margin-block: 32px;
	gap: 24px;
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dands-front-page-card {
	display: flex;
	flex-direction: column;
	min-height: 180px;
	padding: 24px;
	border: 1px solid var(--dands-site-border);
	border-radius: 4px;
	background-color: var(--dands-site-light) !important;
	color: var(--dands-site-text) !important;
}

.dands-front-page-card .wp-block-buttons {
	margin-block: 0 20px;
}

.dands-front-page-card .wp-block-button__link {
	padding: 12px 20px;
	border: 1px solid transparent;
	border-radius: 4px;
	background-color: var(--dands-site-primary) !important;
	color: var(--dands-site-white) !important;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
}

.dands-front-page-card .wp-block-button__link:hover {
	background-color: var(--dands-site-primary-hover) !important;
	color: var(--dands-site-light) !important;
}

.dands-front-page-card .wp-block-button__link:focus-visible {
	background-color: var(--dands-site-primary-hover) !important;
	color: var(--dands-site-light) !important;
	outline: 3px solid var(--dands-site-light);
	outline-offset: 3px;
}

.dands-front-page-card__description {
	margin-block: 0;
	font-size: 16px;
	line-height: 1.5;
	color: inherit;
	text-align: center !important;
}

.dands-front-page-card__description a {
	color: var(--dands-site-primary);
}

.dands-front-page-card__description a:hover,
.dands-front-page-card__description a:focus-visible {
	color: var(--dands-site-primary-hover);
}

@media (max-width: 991px) {
	.dands-front-page-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 575px) {
	.dands-front-page-cards {
		grid-template-columns: 1fr;
		gap: 16px;
		margin-block: 24px;
	}

	.dands-front-page-card {
		min-height: 0;
	}
}

/* Shared links, excluding Button block links. */
.wp-site-blocks a:not(.wp-element-button) {
	color: var(--dands-site-primary);
}

.wp-site-blocks a:not(.wp-element-button):hover,
.wp-site-blocks a:not(.wp-element-button):focus-visible {
	color: var(--dands-site-primary-hover);
}


/* Shared RFA table and pagination presentation.
 * Data/query logic remains in the RFA plugin; these styles are theme-level so
 * every RFA index/event block receives the same visual treatment.
 */
.rfa-index,
.rfa-event-details,
.rfa-event-victims,
.rfa-statistics {
	font-size: 16px;
	line-height: 1.4;
}

.rfa-index .table-responsive,
.rfa-event-details .table-responsive,
.rfa-event-victims .table-responsive,
.rfa-statistics .table-responsive,
.rfa-a-z-navigation,
.rfa-daterange-navigation {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin-block: 16px;
}

.rfa-index .table,
.rfa-event-details .table,
.rfa-event-victims .table,
.rfa-statistics .table,
.rfa-a-z-navigation .table,
.rfa-daterange-navigation .table {
	width: 100%;
	min-width: 100%;
	border-collapse: collapse;
	border-spacing: 0;
	font-size: 16px;
	line-height: 1.4;
}

.rfa-index .table th,
.rfa-index .table td,
.rfa-event-details .table th,
.rfa-event-details .table td,
.rfa-event-victims .table th,
.rfa-event-victims .table td,
.rfa-statistics .table th,
.rfa-statistics .table td,
.rfa-a-z-navigation .table th,
.rfa-daterange-navigation .table th,
.rfa-a-z-navigation .table td,
.rfa-daterange-navigation .table td {
	padding: 8px 12px;
	border: 1px solid var(--dands-site-border);
	vertical-align: top;
	text-align: left;
}

.rfa-a-z-navigation .table,
.rfa-daterange-navigation .table {
	width: max-content;
	min-width: 100%;
}

.rfa-index .table thead th,
.rfa-event-victims .table thead th,
.rfa-statistics .table thead th {
	font-weight: 600;
}

.rfa-event-details .table th[scope="row"],
.rfa-statistics .table th[scope="row"] {
	font-weight: 600;
}

.rfa-index .table a,
.rfa-event-details .table a,
.rfa-event-victims .table a,
.rfa-statistics .table a,
.rfa-a-z-navigation .table a,
.rfa-daterange-navigation .table a {
	color: var(--dands-site-primary);
}

.rfa-index .table a:hover,
.rfa-index .table a:focus-visible,
.rfa-event-details .table a:hover,
.rfa-event-details .table a:focus-visible,
.rfa-event-victims .table a:hover,
.rfa-event-victims .table a:focus-visible,
.rfa-statistics .table a:hover,
.rfa-statistics .table a:focus-visible,
.rfa-a-z-navigation .table a:hover,
.rfa-daterange-navigation .table a:hover,
.rfa-a-z-navigation .table a:focus-visible,
.rfa-daterange-navigation .table a:focus-visible {
	color: var(--dands-site-primary-hover);
}

.rfa-index .table a:focus-visible,
.rfa-event-details .table a:focus-visible,
.rfa-event-victims .table a:focus-visible,
.rfa-statistics .table a:focus-visible,
.rfa-a-z-navigation .table a:focus-visible,
.rfa-daterange-navigation .table a:focus-visible {
	outline: 3px solid var(--dands-site-text);
	outline-offset: 2px;
	border-radius: 2px;
}

.rfa-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-block: 24px;
}

.rfa-pagination ul {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rfa-pagination li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.rfa-pagination a,
.rfa-pagination span,
.rfa-pagination strong {
	display: inline-flex;
	min-width: 44px;
	min-height: 44px;
	padding: 8px 12px;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--dands-site-border);
	border-radius: 4px;
	font-size: 16px;
	line-height: 1.4;
	text-decoration: none;
}

.rfa-pagination a {
	background: transparent;
	color: var(--dands-site-primary);
}

.rfa-pagination a:hover {
	background: var(--dands-site-primary-hover);
	border-color: var(--dands-site-primary-hover);
	color: var(--dands-site-light);
	text-decoration: none;
}

.rfa-pagination a:focus-visible {
	background: var(--dands-site-primary-hover);
	border-color: var(--dands-site-text);
	color: var(--dands-site-light);
	outline: 3px solid var(--dands-site-text);
	outline-offset: 2px;
}

.rfa-pagination [aria-current="page"] {
	border-color: var(--dands-site-primary);
	background: var(--dands-site-primary);
	color: var(--dands-site-white);
	font-weight: 600;
}

.rfa-pagination a:active {
	background: var(--dands-site-primary-hover);
	color: var(--dands-site-light);
}

.rfa-pagination a[aria-disabled="true"] {
	background: transparent;
	border-color: var(--dands-site-border);
	color: var(--dands-site-text);
	opacity: 0.55;
	pointer-events: none;
}

@media (max-width: 575px) {
	.rfa-pagination ul {
		gap: 6px;
	}

	.rfa-pagination a,
	.rfa-pagination span,
	.rfa-pagination strong {
		min-width: 44px;
		min-height: 44px;
		padding: 8px 10px;
	}
}


/* DANDS Gallery presentation. The gallery plugin supplies semantic markup;
 * the theme owns layout, spacing, colours, typography and breakpoints.
 * Collection navigation and pagination intentionally follow the same
 * interaction geometry used by the RFA components above. */
.dands-gallery {
	font-size: 16px;
	line-height: 1.4;
}

.dands-gallery__collections {
	width: 100%;
	margin-block: 16px 24px;
}

.dands-gallery__collection-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.dands-gallery__collection-item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.dands-gallery__collection-link {
	display: inline-flex;
	min-height: 44px;
	padding: 8px 12px;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--dands-site-border);
	border-radius: 4px;
	background: transparent;
	color: var(--dands-site-primary) !important;
	font-size: 16px;
	line-height: 1.4;
	text-decoration: none;
}

.dands-gallery__collection-link:hover {
	border-color: var(--dands-site-primary-hover);
	background: var(--dands-site-primary-hover);
	color: var(--dands-site-light) !important;
	text-decoration: none;
}

.dands-gallery__collection-link:focus-visible {
	border-color: var(--dands-site-text);
	background: var(--dands-site-primary-hover);
	color: var(--dands-site-light) !important;
	outline: 3px solid var(--dands-site-text);
	outline-offset: 2px;
}

.dands-gallery__collection-item.is-current .dands-gallery__collection-link {
	border-color: var(--dands-site-primary);
	background: var(--dands-site-primary);
	color: var(--dands-site-white) !important;
	font-weight: 600;
}

.dands-gallery__header {
	margin-block: 0 24px;
}

.dands-gallery__title {
	margin-block: 0;
}

.dands-gallery__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.dands-gallery__item {
	min-width: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.dands-gallery__figure {
	display: flex;
	flex-direction: column;
	height: 100%;
	margin: 0;
}

.dands-gallery__image-link {
	display: block;
	border-radius: 4px;
	line-height: 0;
}

.dands-gallery__image-link:focus-visible {
	outline: 3px solid var(--dands-site-text);
	outline-offset: 3px;
}

.dands-gallery__image {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 4px;
}

.dands-gallery__caption {
	margin-block: 8px 0;
	font-weight: 600;
	line-height: 1.4;
}

.dands-gallery__pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-block: 24px;
}

.dands-gallery__page-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.dands-gallery__page-item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.dands-gallery__pagination-link,
.dands-gallery__page-link {
	display: inline-flex;
	min-width: 44px;
	min-height: 44px;
	padding: 8px 12px;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--dands-site-border);
	border-radius: 4px;
	background: transparent;
	color: var(--dands-site-primary) !important;
	font-size: 16px;
	line-height: 1.4;
	text-decoration: none;
}

.dands-gallery__pagination-link:hover,
.dands-gallery__page-link:hover {
	border-color: var(--dands-site-primary-hover);
	background: var(--dands-site-primary-hover);
	color: var(--dands-site-light) !important;
	text-decoration: none;
}

.dands-gallery__pagination-link:focus-visible,
.dands-gallery__page-link:focus-visible {
	border-color: var(--dands-site-text);
	background: var(--dands-site-primary-hover);
	color: var(--dands-site-light) !important;
	outline: 3px solid var(--dands-site-text);
	outline-offset: 2px;
}

.dands-gallery__page-link.is-current,
.dands-gallery__page-link[aria-current="page"] {
	border-color: var(--dands-site-primary);
	background: var(--dands-site-primary);
	color: var(--dands-site-white) !important;
	font-weight: 600;
}

.dands-gallery__detail {
	margin-block: 0 24px;
}

.dands-gallery__detail-title {
	margin-block: 0 16px;
}

.dands-gallery__detail-media {
	width: 100%;
}

.dands-gallery__detail-image {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	border-radius: 4px;
}

.dands-gallery__detail-close {
	margin-block: 16px 0;
}

.dands-gallery__close {
	display: inline-flex;
	min-height: 44px;
	padding: 8px 16px;
	align-items: center;
	justify-content: center;
	border: 1px solid transparent;
	border-radius: 4px;
	background: var(--dands-site-primary);
	color: var(--dands-site-white) !important;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
}

.dands-gallery__close:hover {
	background: var(--dands-site-primary-hover);
	color: var(--dands-site-light) !important;
	text-decoration: none;
}

.dands-gallery__close:focus-visible {
	background: var(--dands-site-primary-hover);
	color: var(--dands-site-light) !important;
	outline: 3px solid var(--dands-site-text);
	outline-offset: 3px;
}

@media (max-width: 991px) {
	.dands-gallery__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 575px) {
	.dands-gallery__collection-list,
	.dands-gallery__page-list {
		gap: 6px;
	}

	.dands-gallery__collection-link,
	.dands-gallery__pagination-link,
	.dands-gallery__page-link {
		min-height: 44px;
		padding: 8px 10px;
	}

	.dands-gallery__grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}
}


/* Mobile navigation overlay.
 * WordPress supplies the open/close behaviour. These rules keep the overlay
 * visually consistent with the site header and ensure its links remain visible
 * when the responsive menu is opened on phones.
 */
@media (max-width: 782px) {
	.dands-header-navigation .wp-block-navigation__responsive-container.is-menu-open {
		display: flex;
		flex-direction: column;
		background-color: var(--dands-site-primary) !important;
		color: var(--dands-site-white) !important;
		padding: 24px;
		z-index: 100000;
	}

	.dands-header-navigation .wp-block-navigation__responsive-container.is-menu-open
		.wp-block-navigation__responsive-container-content {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		width: 100%;
		margin-top: 48px;
	}

	.dands-header-navigation .wp-block-navigation__responsive-container.is-menu-open
		.wp-block-navigation__container {
		display: flex;
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
		width: 100%;
	}

	.dands-header-navigation .wp-block-navigation__responsive-container.is-menu-open
		.wp-block-navigation-item__content,
	.dands-header-navigation .wp-block-navigation__responsive-container.is-menu-open
		.wp-block-navigation-submenu__toggle {
		display: block;
		width: 100%;
		padding: 12px 16px;
		color: var(--dands-site-white) !important;
		background-color: transparent !important;
	}

	.dands-header-navigation .wp-block-navigation__responsive-container.is-menu-open
		.wp-block-navigation-item__content:hover,
	.dands-header-navigation .wp-block-navigation__responsive-container.is-menu-open
		.wp-block-navigation-item__content:focus-visible,
	.dands-header-navigation .wp-block-navigation__responsive-container.is-menu-open
		.wp-block-navigation-submenu__toggle:hover,
	.dands-header-navigation .wp-block-navigation__responsive-container.is-menu-open
		.wp-block-navigation-submenu__toggle:focus-visible {
		color: var(--dands-site-light) !important;
		background-color: var(--dands-site-primary-hover) !important;
	}

	.dands-header-navigation .wp-block-navigation__responsive-container.is-menu-open
		.wp-block-navigation__responsive-container-close {
		color: var(--dands-site-white) !important;
		background: transparent !important;
	}

	.dands-header-navigation .wp-block-navigation__responsive-container.is-menu-open
		.wp-block-navigation__responsive-container-close:focus-visible {
		outline: 3px solid var(--dands-site-light);
		outline-offset: 2px;
	}

	.dands-header-navigation .wp-block-navigation__responsive-container.is-menu-open
		.wp-block-navigation__submenu-container {
		background: transparent !important;
		padding: 0 0 0 16px;
	}
}


/* PCI Custom Code blocks.
 * The PCI plugin supplies data and semantic markup; the shared theme owns
 * the presentation, matching the existing RFA index/detail components.
 */
.pci-index,
.pci-name-details {
	font-size: 16px;
	line-height: 1.4;
}

.pci-index .table-responsive,
.pci-name-details .table-responsive,
.pci-a-z-navigation {
	width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin-block: 16px;
}

.pci-index .table,
.pci-name-details .table,
.pci-a-z-navigation .table {
	width: 100%;
	min-width: 100%;
	border-collapse: collapse;
	border-spacing: 0;
	font-size: 16px;
	line-height: 1.4;
}

.pci-index .table th,
.pci-index .table td,
.pci-name-details .table th,
.pci-name-details .table td,
.pci-a-z-navigation .table th,
.pci-a-z-navigation .table td {
	padding: 8px 12px;
	border: 1px solid var(--dands-site-border);
	vertical-align: top;
	text-align: left;
}

.pci-a-z-navigation .table {
	width: max-content;
	min-width: 100%;
}

.pci-index .table thead th {
	font-weight: 600;
}

.pci-name-details .table th[scope="row"] {
	width: 20%;
	font-weight: 600;
}

.pci-index .table a,
.pci-name-details .table a,
.pci-a-z-navigation .table a,
.pci-a-z-navigation > p a {
	color: var(--dands-site-primary);
}

.pci-index .table a:hover,
.pci-index .table a:focus-visible,
.pci-name-details .table a:hover,
.pci-name-details .table a:focus-visible,
.pci-a-z-navigation .table a:hover,
.pci-a-z-navigation .table a:focus-visible,
.pci-a-z-navigation > p a:hover,
.pci-a-z-navigation > p a:focus-visible {
	color: var(--dands-site-primary-hover);
}

.pci-index .table a:focus-visible,
.pci-name-details .table a:focus-visible,
.pci-a-z-navigation .table a:focus-visible,
.pci-a-z-navigation > p a:focus-visible {
	outline: 3px solid var(--dands-site-text);
	outline-offset: 2px;
	border-radius: 2px;
}

.pci-a-z-navigation > p {
	margin-block: 12px 0;
}

.pci-a-z-navigation .table td {
	text-align: center;
	white-space: nowrap;
}

.pci-a-z-navigation .table a {
	display: inline-block;
	min-width: 24px;
	text-decoration: none;
}

.pci-a-z-navigation .table a[aria-current="true"] {
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.pci-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-block: 24px;
}

.pci-pagination ul {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pci-pagination li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.pci-pagination a,
.pci-pagination span {
	display: inline-flex;
	min-width: 44px;
	min-height: 44px;
	padding: 8px 12px;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--dands-site-border);
	border-radius: 4px;
	font-size: 16px;
	line-height: 1.4;
	text-decoration: none;
}

.pci-pagination a {
	background: transparent;
	color: var(--dands-site-primary);
}

.pci-pagination a:hover {
	background: var(--dands-site-primary-hover);
	border-color: var(--dands-site-primary-hover);
	color: var(--dands-site-light);
	text-decoration: none;
}

.pci-pagination a:focus-visible {
	background: var(--dands-site-primary-hover);
	border-color: var(--dands-site-text);
	color: var(--dands-site-light);
	outline: 3px solid var(--dands-site-text);
	outline-offset: 2px;
}

.pci-pagination [aria-current="page"] {
	border-color: var(--dands-site-primary);
	background: var(--dands-site-primary);
	color: var(--dands-site-white);
	font-weight: 600;
}

.pci-no-results,
.pci-index-intro {
	margin-block: 16px;
}

@media (max-width: 575px) {
	.pci-pagination ul {
		gap: 6px;
	}

	.pci-pagination a,
	.pci-pagination span {
		min-width: 44px;
		min-height: 44px;
		padding: 8px 10px;
	}

	.pci-name-details .table th[scope="row"] {
		width: auto;
	}
}

/* NFOPS presentation — migrated unchanged from NFOPS Custom Code v1.0.21.
 * Owned by DANDS Base Block Theme from v0.5.4 onward.
 */
/* NFOPS census presentation.
 * Mirrors the PCI Custom Code presentation in dands-base-block-theme.
 * Colours are inherited from the theme's Site Identity palette via its
 * --dands-site-* semantic tokens; no site colours are hard-coded here.
 */
.nfops-surname-index,
.nfops-schedule-details,
.nfops-occupants {
    font-size: 16px;
    line-height: 1.4;
}

.nfops-surname-index .table-responsive,
.nfops-schedule-details .table-responsive,
.nfops-occupants .table-responsive,
.nfops-a-z-navigation {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-block: 16px;
}

.nfops-surname-index .table,
.nfops-schedule-details .table,
.nfops-occupants .table,
.nfops-a-z-navigation .table {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 16px;
    line-height: 1.4;
}

.nfops-surname-index .table th,
.nfops-surname-index .table td,
.nfops-schedule-details .table th,
.nfops-schedule-details .table td,
.nfops-occupants .table th,
.nfops-occupants .table td,
.nfops-a-z-navigation .table th,
.nfops-a-z-navigation .table td {
    padding: 8px 12px;
    border: 1px solid var(--dands-site-border);
    vertical-align: top;
    text-align: left;
}

.nfops-a-z-navigation .table {
    width: max-content;
    min-width: 100%;
}

.nfops-surname-index .table thead th,
.nfops-occupants .table thead th {
    font-weight: 600;
}

.nfops-schedule-details .table th[scope="row"] {
    width: 20%;
    font-weight: 600;
}

.nfops-surname-index .table a,
.nfops-schedule-details .table a,
.nfops-occupants .table a,
.nfops-a-z-navigation .table a,
.nfops-a-z-navigation > p a {
    color: var(--dands-site-primary);
}

.nfops-surname-index .table a:hover,
.nfops-surname-index .table a:focus-visible,
.nfops-schedule-details .table a:hover,
.nfops-schedule-details .table a:focus-visible,
.nfops-occupants .table a:hover,
.nfops-occupants .table a:focus-visible,
.nfops-a-z-navigation .table a:hover,
.nfops-a-z-navigation .table a:focus-visible,
.nfops-a-z-navigation > p a:hover,
.nfops-a-z-navigation > p a:focus-visible {
    color: var(--dands-site-primary-hover);
}

.nfops-surname-index .table a:focus-visible,
.nfops-schedule-details .table a:focus-visible,
.nfops-occupants .table a:focus-visible,
.nfops-a-z-navigation .table a:focus-visible,
.nfops-a-z-navigation > p a:focus-visible {
    outline: 3px solid var(--dands-site-text);
    outline-offset: 2px;
    border-radius: 2px;
}

.nfops-a-z-navigation > p {
    margin-block: 12px 0;
}

.nfops-a-z-navigation .table td {
    text-align: center;
    white-space: nowrap;
}

.nfops-a-z-navigation .table a {
    display: inline-block;
    min-width: 24px;
    text-decoration: none;
}

.nfops-a-z-navigation .table a[aria-current="true"] {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.nfops-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-block: 24px;
}

.nfops-pagination ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nfops-pagination li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.nfops-pagination a,
.nfops-pagination span {
    display: inline-flex;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--dands-site-border);
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.4;
    text-decoration: none;
}

.nfops-pagination a {
    background: transparent;
    color: var(--dands-site-primary);
}

.nfops-pagination a:hover {
    background: var(--dands-site-primary-hover);
    border-color: var(--dands-site-primary-hover);
    color: var(--dands-site-light);
    text-decoration: none;
}

.nfops-pagination a:focus-visible {
    background: var(--dands-site-primary-hover);
    border-color: var(--dands-site-text);
    color: var(--dands-site-light);
    outline: 3px solid var(--dands-site-text);
    outline-offset: 2px;
}

.nfops-pagination [aria-current="page"] {
    border-color: var(--dands-site-primary);
    background: var(--dands-site-primary);
    color: var(--dands-site-white);
    font-weight: 600;
}

.nfops-no-results,
.nfops-index-intro {
    margin-block: 16px;
}

/* Household navigation uses the same control geometry as PCI pagination. */
.nfops-schedule-navigation {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-block: 24px;
}

.nfops-schedule-navigation a,
.nfops-schedule-navigation span {
    display: inline-flex;
    min-height: 44px;
    padding: 8px 12px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--dands-site-border);
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.4;
    text-decoration: none;
}

.nfops-schedule-navigation a {
    background: transparent;
    color: var(--dands-site-primary);
}

.nfops-schedule-navigation a:hover {
    background: var(--dands-site-primary-hover);
    border-color: var(--dands-site-primary-hover);
    color: var(--dands-site-light);
    text-decoration: none;
}

.nfops-schedule-navigation a:focus-visible {
    background: var(--dands-site-primary-hover);
    border-color: var(--dands-site-text);
    color: var(--dands-site-light);
    outline: 3px solid var(--dands-site-text);
    outline-offset: 2px;
}

.nfops-schedule-navigation span {
    color: var(--dands-site-text);
    opacity: 0.55;
}

@media (max-width: 575px) {
    .nfops-pagination ul {
        gap: 6px;
    }

    .nfops-pagination a,
    .nfops-pagination span {
        min-width: 44px;
        min-height: 44px;
        padding: 8px 10px;
    }

    .nfops-schedule-details .table th[scope="row"] {
        width: auto;
    }
}


/* NFOPS News subject-tag navigation — mirrors the surname index letter boxes. */
.nfops-news-subject-navigation { margin-block: 16px 20px; }
.nfops-news-subject-navigation > p { margin-block: 0 8px; }
.nfops-news-subject-links { display: flex; flex-wrap: wrap; gap: 8px; }
.nfops-news-subject-links a {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 40px; padding: 7px 12px; border: 1px solid var(--dands-site-border);
    border-radius: 4px; color: var(--dands-site-primary); text-decoration: none;
    line-height: 1.4;
}
.nfops-news-subject-links a:hover { background: var(--dands-site-primary-hover); border-color: var(--dands-site-primary-hover); color: var(--dands-site-light); }
.nfops-news-subject-links a:focus-visible { outline: 3px solid var(--dands-site-text); outline-offset: 2px; }
.nfops-news-subject-links a[aria-current="true"] { border-color: var(--dands-site-primary); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.nfops-news-selected-subject { margin-block: 20px 12px; }
