body.home {

	.contact-details-block {

		.contact-detail-item {
			padding: 5px 0;
			border-bottom: 0 !important;

			.icon-wrapper {
				width: 20px;
			}

			.contact-detail-heading {
				display: none;
			}

			.contact-detail-value {
				*,
				a {
					color: var(--wp--preset--color--white);
				}
			}

		}

	}

}

.contact-details-block {
	color: var(--wp--preset--color--black);
	display: flex;
	flex-direction: column;
	margin-bottom: var(--padding-y) !important;
	width: 100%;

	/* .has-background is only added (with the actual colour set inline)
	   when Background Color isn't "None" - left as "None", the block is a
	   bare, unpadded list rather than a standalone card, for dropping onto
	   a section that already has its own background. See
	   contact-details-block-render.php. */
	&.has-background {
		border-radius: 16px;
		box-shadow: 0 10px 40px 0 rgba(0, 0, 0, 0.05);
		padding: 32px;
		@media(width <= 662px) {
			padding: calc(var(--padding-y) / 2);
		}
	}

	&.has-icon-background {
			.contact-detail-item {
				padding: 20px 0;
			}
	}

	.contact-detail-item {
		align-items: center;
		display: flex;
		gap: 16px;
		padding: 5px 0;

		/* Adapts to whatever text colour this block ends up with (its own
		   black default, or the contrast colour housing_get_contrasting_text_color()
		   picked for a custom background - see contact-details-block-render.php),
		   rather than a fixed light-grey that would vanish on a dark card.
		   Turned off entirely by .no-separators below, when "Show Separators"
		   is unticked. */
		&:not(:last-child) {
			border-bottom: 1px solid color-mix(in srgb, currentColor 15%, transparent);
		}

		&:first-child {
			padding-top: 0;
		}

		&:last-child {
			padding-bottom: 0;
		}

		.icon-wrapper {
			align-items: center;
			display: flex;
			flex-shrink: 0;
			height: 44px;
			justify-content: center;
			width: 44px;

			.icon-svg {
				/* Recolours the uploaded SVG by using it as a mask over a solid
				   fill, since an <img>'s own colours can't be overridden with
				   CSS - same technique as icon-stat-list-block.css. */
				background-color: var(--cd-icon-color, var(--wp--preset--color--green));
				display: inline-block;
				height: 20px;
				width: 20px;
				-webkit-mask-image: var(--cd-icon-mask);
				mask-image: var(--cd-icon-mask);
				-webkit-mask-position: center;
				mask-position: center;
				-webkit-mask-repeat: no-repeat;
				mask-repeat: no-repeat;
				-webkit-mask-size: contain;
				mask-size: contain;
			}
		}

		.contact-detail-text {
			display: flex;
			flex-direction: column;
			gap: 10px;

			.contact-detail-heading {
				font-weight: 700;
				margin: 0;
			}

			.contact-detail-value {
				font-weight: 400;
				margin: 0;
				/* Plain-text values (opening hours, or a Manual row with no
				   link) get the same colour as linked ones, so every row's
				   line 2 reads the same whether or not it's clickable. */
				color: var(--cd-link-color, var(--cd-icon-color, var(--wp--preset--color--green)));
				/* --cd-link-color is only set (contact-details-block-render.php)
				   when "Link Color" isn't left at "None" - unset, the var()
				   falls through to each case's own previous default below. */
				a {
					color: var(--cd-link-color, var(--cd-icon-color, var(--wp--preset--color--green)));
					text-decoration: none;

					&:hover {
						text-decoration: none;
					}
				}

				/* Added when a row's "Show Heading" is off
				   (contact-details-block-render.php) — with no heading label
				   above it, the value takes over the heading's own look
				   (bold, block text colour) instead of the smaller green
				   link style, so the row doesn't read as demoted. An explicit
				   "Link Color" still wins over that inherited colour. */
				&.no-heading {
					color: var(--cd-link-color, inherit);
					font-weight: 400;

					a {
						color: var(--cd-link-color, inherit);
					}
				}
			}

			/* Optional line 3 ("Sub Text" on each row) - smaller and muted.
			   Mixed from currentColor so it stays readable on any card
			   background rather than a fixed grey. */
			.contact-detail-subtext {
				color: color-mix(in srgb, currentColor 65%, transparent);
				font-size: 0.875em;
				margin: 0;
			}
		}
	}

	/* "Show Separators" off (contact-details-block-render.php adds
	   .no-separators to the block wrapper): drop both the divider line and
	   the padding it was separating from the next row, so rows sit at one
	   even gap (each row's own padding-top) instead of leaving a blank gap
	   where the border used to be. &.no-separators here resolves to
	   .contact-details-block.no-separators — as specific as the
	   .contact-detail-item:not(:last-child) border rule above (three
	   classes each), so this reliably wins on the same element rather than
	   depending on source order. */
	&.no-separators .contact-detail-item {
		border-bottom: none;
		padding-bottom: 0;

		/* .icon-wrapper {
			height: auto;
		} */
	}

	/* Icon Background Color set to "None" leaves a bare icon (e.g. for a
	   dark block background); any other choice gets a tinted circle behind
	   it - see contact-details-block-render.php, which only adds this class
	   + the --cd-icon-bg-color variable when that field isn't "None". */
	&.has-icon-background .icon-wrapper {
		background-color: color-mix(in srgb, var(--cd-icon-bg-color) 12%, transparent);
		border-radius: 50%;
	}
}
