/**
 * Interactive Iran map shortcode.
 * Measurements and palette reproduce the supplied `map.jpg` reference.
 *
 * @package Agency
 */

.agency-iran-map {
	--agency-map-blue: #004c98;
	--agency-map-blue-dark: #003f7e;
	--agency-map-muted: #778ca1;
	--agency-map-card: #dbdbdb;
	--agency-map-white: #fff;
	--agency-map-text: #004c98;
	--agency-map-scroll-track: #ededed;
	--agency-map-scroll-thumb: #778ca1;
	box-sizing: border-box;
	clear: both;
	color: #333;
	direction: rtl;
	font-family: inherit;
	margin: 0 auto;
	max-width: 1500px;
	width: 100%;
}

.agency-iran-map *,
.agency-iran-map *::before,
.agency-iran-map *::after {
	box-sizing: border-box;
}

.agency-iran-map .screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.agency-iran-map__layout {
	display: grid;
	gap: clamp(32px, 4vw, 74px);
	grid-template-areas: "map panel";
	grid-template-columns: repeat(2, minmax(0, 1fr));
	min-height: 650px;
	width: 100%;
	padding-inline: var(--space-8);
}

.agency-iran-map__map {
	align-items: center;
	display: flex;
	grid-area: map;
	justify-content: center;
	min-height: 610px;
	min-width: 0;
	position: relative;
}

.agency-iran-map__svg {
	max-width: 650px;
	width: 100%;
}

.agency-iran-map__svg svg {
	display: block;
	height: auto;
	overflow: visible;
	width: 100%;
}

.agency-iran-map__svg .border .iran,
.agency-iran-map__svg .island path {
	fill: var(--agency-map-white);
}

.agency-iran-map__svg .province path {
	fill: var(--agency-map-muted);
	stroke: var(--agency-map-white);
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 2.5px;
	transition: fill 160ms ease, filter 160ms ease;
	vector-effect: non-scaling-stroke;
}

.agency-iran-map__svg .province a {
	cursor: pointer;
	outline: none;
}

.agency-iran-map__svg .province path.is-active,
.agency-iran-map__svg .province a:hover path,
.agency-iran-map__svg .province a:focus path {
	fill: var(--agency-map-blue);
	filter: brightness(0.98);
}

.agency-iran-map__svg .province a:focus-visible path {
	filter: drop-shadow(0 0 8px rgba(7, 90, 166, 0.42));
}

.agency-iran-map__svg .sea path,
.agency-iran-map__svg .lake path {
	fill: var(--agency-map-white);
}

.agency-iran-map__panel {
	align-self: center;
	display: flex;
	flex-direction: column;
	grid-area: panel;
	min-height: 610px;
	min-width: 0;
}

.agency-iran-map__search {
    align-items: center;
    background: var(--agency-map-muted);
    display: flex;
    height: 96px;
    justify-content: center;
    margin: 0 31px 14px 0;
    min-height: 96px;
    padding: 0 24px;
    width: calc(100% - 31px);
}

.agency-iran-map__search input[type="search"] {
	appearance: none;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: var(--agency-map-white);
	direction: rtl;
	font: inherit;
	font-size: 17px;
	font-weight: 700;
	height: 100%;
	line-height: 1.8;
	margin: 0;
	outline: none;
	padding: 0;
	text-align: center;
	width: 100%;
}

.agency-iran-map__search input[type="search"]::placeholder {
	color: var(--agency-map-white);
	opacity: 1;
}

.agency-iran-map__search input[type="search"]::-webkit-search-cancel-button {
	filter: brightness(0) invert(1);
	opacity: 0.88;
}

.agency-iran-map__search:focus-within {
	background: var(--agency-map-blue);
}

.agency-iran-map__list {
	direction: ltr;
	max-height: 510px;
	overflow-x: hidden;
	overflow-y: auto;
	padding: 0;
	scrollbar-color: var(--agency-map-scroll-thumb) var(--agency-map-scroll-track);
	scrollbar-width: thin;
}

.agency-iran-map__grid {
	direction: rtl;
	display: grid;
	gap: 14px 12px;
	grid-auto-rows: 82px;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	padding-right: 22px;
}

.agency-iran-map__grid [hidden],
.agency-iran-map__empty[hidden] {
	display: none !important;
}

.agency-iran-map__empty {
	direction: rtl;
}

.agency-iran-map__list::-webkit-scrollbar {
	width: 11px;
}

.agency-iran-map__list::-webkit-scrollbar-track {
	background: var(--agency-map-scroll-track);
	border-radius: 8px;
}

.agency-iran-map__list::-webkit-scrollbar-thumb {
	background: var(--agency-map-scroll-thumb);
	border: 2px solid var(--agency-map-scroll-track);
	border-radius: 8px;
}

.agency-iran-map__card {
	align-items: center;
	background: var(--color-primary);
	border: 0;
	border-radius: 0;
	color: #fff;
	display: flex;
	font-size: 15px;
	font-weight: 700;
	justify-content: center;
	line-height: 1.65;
	min-width: 0;
	padding: 12px;
	text-align: center;
	text-decoration: none;
	transition: background-color 160ms ease, color 160ms ease;
}

.agency-iran-map__card:hover,
.agency-iran-map__card:focus,
.agency-iran-map__card.is-active {
	background: var(--color-secondary);
	color:  var(--color-primary);
	outline: none;
	text-decoration: none;
}

.agency-iran-map__card:focus-visible {
	box-shadow: inset 0 0 0 3px var(--agency-map-white), 0 0 0 2px var(--agency-map-blue-dark);
}

.agency-iran-map__empty,
.agency-iran-map__notice {
	align-items: center;
	background: #f1f1f1;
	color: #555;
	display: flex;
	font-size: 15px;
	grid-column: 1 / -1;
	justify-content: center;
	line-height: 1.8;
	margin: 0;
	min-height: 82px;
	padding: 18px;
	text-align: center;
}

.agency-iran-map__notice.is-error {
	color: #8a1f1f;
	flex-wrap: wrap;
	gap: 10px;
}

.agency-iran-map__notice .dashicons {
	font-size: 24px;
	height: 24px;
	width: 24px;
}

.agency-iran-map__retry {
	background: var(--agency-map-blue);
	border: 0;
	border-radius: 0;
	color: var(--agency-map-white);
	cursor: pointer;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.8;
	padding: 7px 18px;
}

@media (max-width: 1080px) {
	.agency-iran-map__layout {
		gap: 34px;
		grid-template-columns: minmax(330px, 0.9fr) minmax(440px, 1.1fr);
	}

	.agency-iran-map__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 820px) {
	.agency-iran-map__layout {
		grid-template-areas:
			"panel"
			"map";
		grid-template-columns: minmax(0, 1fr);
		min-height: 0;
	}

	.agency-iran-map__map,
	.agency-iran-map__panel {
		min-height: 0;
	}

	.agency-iran-map__svg {
		max-width: 540px;
	}

	.agency-iran-map__list {
		max-height: 390px;
	}
}

@media (max-width: 520px) {
	.agency-iran-map__search {
		height: 72px;
		margin-right: 16px;
		min-height: 72px;
		width: calc(100% - 16px);
	}

	.agency-iran-map__search input[type="search"] {
		font-size: 15px;
	}

	.agency-iran-map__grid {
		gap: 10px;
		grid-auto-rows: 68px;
		padding-right: 16px;
	}

	.agency-iran-map__card {
		font-size: 13px;
		padding: 9px;
	}
}

@media (max-width: 360px) {
	.agency-iran-map__grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	.agency-iran-map__svg .province path,
	.agency-iran-map__card {
		transition: none;
	}
}
