/**
 * Self Help directory (page-templates/self-help.php).
 *
 * Built for finding a number fast: each entry is a compact card with the
 * first letter of its title, the title (the service), then one full-width row
 * per contact (initial avatar, name above the number) ending in a round call
 * button. Entries
 * follow their Display Order. One column on phones, two from tablets, three
 * on wide screens.
 */

.self-help-section {
	padding-block: var(--nscb-space-7) var(--nscb-space-section);
}

/* Introduction: a quiet note above the directory. */
.self-help-directory .nscb-page-intro {
	max-width: 52rem;
	margin-bottom: var(--nscb-space-6);
	padding: var(--nscb-space-5);
	border: 1px solid var(--nscb-edge);
	border-radius: var(--nscb-radius-xl);
	background-color: color-mix(in srgb, var(--nscb-color-bg-secondary) 70%, transparent);
}

.self-help-directory .nscb-page-intro p:first-child {
	font-size: var(--nscb-text-lg);
}

.self-help-directory__list {
	display: grid;
	gap: var(--nscb-space-3);
	padding: 0;
	list-style: none;
}

.self-help-entry {
	display: flex;
	flex-direction: column;
	gap: var(--nscb-space-4);
	min-width: 0;
	padding: var(--nscb-space-4);
	border: 1px solid var(--nscb-edge);
	border-radius: var(--nscb-radius-xl);
	background: var(--nscb-surface-card);
	box-shadow: var(--nscb-edge-light), var(--nscb-shadow-card);
}

.self-help-entry__head {
	display: flex;
	align-items: flex-start;
	gap: var(--nscb-space-3);
}

.self-help-entry__mark {
	display: grid;
	flex: none;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	border: 1px solid var(--nscb-edge-strong);
	border-radius: 50%;
	background-color: var(--nscb-color-bg);
	color: var(--nscb-color-highlight);
	font-family: var(--nscb-font-heading);
	font-size: var(--nscb-text-lg);
	font-weight: 800;
	line-height: 1;
}

.self-help-entry__text {
	display: grid;
	gap: var(--nscb-space-1);
	min-width: 0;
	padding-top: 0.45rem;
}

.self-help-entry__title {
	font-size: var(--nscb-text-lg);
	font-weight: 700;
	letter-spacing: -0.015em;
	line-height: var(--nscb-leading-snug);
}

.self-help-entry__phones {
	display: grid;
	gap: var(--nscb-space-2);
	padding: 0;
	list-style: none;
}

/* A contact row: initial avatar, the name with the number beneath it (in the
   highlight color: it is what gets tapped), then a round call button that
   fills with the highlight color on hover and focus. */
.self-help-call {
	display: flex;
	align-items: center;
	gap: var(--nscb-space-3);
	min-height: 4.25rem;
	padding: var(--nscb-space-3);
	border: 1px solid var(--nscb-edge);
	border-radius: var(--nscb-radius-lg);
	background-color: var(--nscb-color-bg);
	box-shadow: var(--nscb-edge-light);
	color: var(--nscb-color-text);
	text-decoration: none;
	-webkit-tap-highlight-color: transparent;
	transition:
		border-color var(--nscb-duration-fast) var(--nscb-ease-standard),
		background-color var(--nscb-duration-fast) var(--nscb-ease-standard),
		transform var(--nscb-duration-fast) var(--nscb-ease-standard);
}

.self-help-call:hover,
.self-help-call:focus-visible {
	border-color: var(--nscb-color-highlight);
	background-color: color-mix(in srgb, var(--nscb-color-highlight) 6%, var(--nscb-color-bg));
	color: var(--nscb-color-text);
}

.self-help-call:focus-visible {
	border-radius: var(--nscb-radius-lg);
}

.self-help-call:active {
	transform: scale(0.98);
}

.self-help-call__avatar {
	display: grid;
	flex: none;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	background-color: var(--nscb-surface-raised);
	box-shadow: var(--nscb-edge-light);
	color: var(--nscb-color-text-secondary);
	font-family: var(--nscb-font-heading);
	font-size: var(--nscb-text-md);
	font-weight: 700;
	line-height: 1;
}

.self-help-call__avatar .nscb-icon {
	width: 1.0625rem;
	height: 1.0625rem;
}

/* Name above the number, with room between them. */
.self-help-call__who {
	display: grid;
	flex: 1;
	gap: 0.3rem;
	min-width: 0;
}

.self-help-call__name {
	color: var(--nscb-color-text);
	font-size: var(--nscb-text-md);
	font-weight: 700;
	line-height: 1.25;
	overflow-wrap: anywhere;
}

.self-help-call__number {
	color: var(--nscb-color-highlight);
	font-size: var(--nscb-text-md);
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em;
	line-height: 1.25;
	overflow-wrap: anywhere;
}

/* 3D phone tile (inc/icons-3d.php): lifts and tilts like a ringing handset. */
.self-help-call__icon {
	flex: none;
	width: 2.75rem;
	margin-inline-start: auto;
}

.self-help-call__icon .nscb-icon3d--tile {
	width: 100%;
}

.self-help-call:hover .self-help-call__icon .nscb-icon3d--tile,
.self-help-call:focus-visible .self-help-call__icon .nscb-icon3d--tile {
	transform: translateY(-2px) rotate(-8deg);
}

/* A number that cannot be dialled: same layout, not a link. */
.self-help-entry__phone-text {
	display: flex;
	align-items: center;
	min-height: 4.25rem;
	padding: var(--nscb-space-3) var(--nscb-space-4);
	border: 1px dashed var(--nscb-edge-strong);
	border-radius: var(--nscb-radius-lg);
}

.self-help-entry__phone-text .self-help-call__number {
	color: var(--nscb-color-text-secondary);
}

@media (min-width: 48rem) {
	.self-help-directory__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--nscb-space-4);
	}

	.self-help-entry {
		padding: var(--nscb-space-5);
	}
}

@media (min-width: 64rem) {
	.self-help-section {
		padding-top: var(--nscb-space-8);
	}

	.self-help-directory .nscb-page-intro {
		padding: var(--nscb-space-6);
	}
}

@media (min-width: 80rem) {
	.self-help-directory__list {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (prefers-reduced-motion: reduce) {
	.self-help-call:hover .self-help-call__icon .nscb-icon3d--tile {
		transform: none;
	}
}
