/* Projects page map — Figma 745:7217. Copy on the right, Figma's Iran map on the left with a green dot per project.
   Dots that would overlap are merged (by the view script) into a numbered circle that lists its projects.
   A dot opens a small card next to it; on phones the card becomes a bottom sheet. */
.wp-block-post-content > .scico-projects-map { margin-block-start: 0; }

.scico-projects-map { --projects-map-ring: color-mix(in srgb, var(--projects-map-accentColor, #4c504a) 24%, transparent); position: relative; box-sizing: border-box; margin-block-start: 0; padding: 32px 96px 96px; background: #fff; }
.scico-projects-map__inner { display: flex; width: min(100%, var(--projects-map-contentWidth, 1248px)); align-items: center; justify-content: space-between; gap: 48px; margin-inline: auto; }

.scico-projects-map__copy { display: flex; flex: 0 1 440px; flex-direction: column; gap: 20px; text-align: right; }
.scico-projects-map__copy h2 { margin: 0; color: var(--projects-map-headingColor, #000); font-size: var(--projects-map-headingSize, 32px); font-weight: var(--projects-map-headingWeight, 800); line-height: 1.45; }
.scico-projects-map__copy > p { margin: 0; color: var(--projects-map-textColor, #000); font-size: var(--projects-map-textSize, 16px); font-weight: 400; line-height: 1.9; }
.scico-projects-map__copy > p.scico-projects-map__legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: #4c504a; font-size: 13px; line-height: 1.5; }
.scico-projects-map__legend-dot { width: 12px; height: 12px; box-sizing: border-box; border: 2px solid #fff; border-radius: 50%; background: var(--projects-map-accentColor, #4c504a); box-shadow: 0 0 0 3px var(--projects-map-ring); }
.scico-projects-map__legend-cluster { display: inline-flex; width: 22px; height: 22px; box-sizing: border-box; align-items: center; justify-content: center; margin-inline-start: 12px; border: 2px solid #fff; border-radius: 50%; background: var(--projects-map-accentColor, #4c504a); box-shadow: 0 0 0 3px var(--projects-map-ring); color: #fff; font-size: 11px; font-weight: 800; }

.scico-projects-map__cities { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.scico-projects-map__city { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 6px 12px; border: 1px solid #e3e3e3; border-radius: 20px; background: #fff; color: #2a2e28; cursor: pointer; font: inherit; font-size: 14px; font-weight: 500; line-height: 1.5; transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease; }
.scico-projects-map__city span { display: inline-flex; min-width: 20px; height: 20px; box-sizing: border-box; align-items: center; justify-content: center; padding: 0 6px; border-radius: 10px; background: color-mix(in srgb, var(--projects-map-accentColor, #4c504a) 12%, #fff); color: var(--projects-map-accentColor, #4c504a); font-size: 12px; font-weight: 700; transition: background-color 200ms ease, color 200ms ease; }
.scico-projects-map__city[aria-expanded="true"] { border-color: var(--projects-map-accentColor, #4c504a); background: var(--projects-map-accentColor, #4c504a); color: #fff; }
.scico-projects-map__city[aria-expanded="true"] span { background: rgb(255 255 255 / 22%); color: #fff; }

.scico-projects-map__map { position: relative; flex: 0 1 var(--projects-map-mapWidth, 600px); width: min(100%, var(--projects-map-mapWidth, 600px)); aspect-ratio: 647 / 587; }
.scico-projects-map__image { display: block; width: 100%; height: auto; }

/* One project: a 14px green dot with a white rim and a soft ring, centred on its place (--x/--y, % of the map). */
.scico-projects-map__dot,
.scico-projects-map__cluster { position: absolute; top: var(--y); left: var(--x); z-index: 2; display: flex; align-items: center; justify-content: center; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; translate: -50% -50%; transition: opacity 250ms ease; }
.scico-projects-map__dot { width: 26px; height: 26px; }
.scico-projects-map__dot[hidden] { display: none; }
.scico-projects-map__dot::before { width: 14px; height: 14px; box-sizing: border-box; border: 2px solid #fff; border-radius: 50%; background: var(--projects-map-accentColor, #4c504a); box-shadow: 0 0 0 4px var(--projects-map-ring), 0 1px 3px rgb(0 0 0 / 22%); content: ""; transition: transform 250ms cubic-bezier(.2, .7, .2, 1), box-shadow 250ms ease; }
/* Several projects close together: a bigger numbered circle (size set by the script from the count). */
.scico-projects-map__cluster { z-index: 3; width: var(--size, 32px); height: var(--size, 32px); box-sizing: border-box; border: 2px solid #fff; border-radius: 50%; background: var(--projects-map-accentColor, #4c504a); box-shadow: 0 0 0 6px var(--projects-map-ring), 0 2px 6px rgb(0 0 0 / 18%); color: #fff; font: inherit; font-size: 13px; font-weight: 800; line-height: 1; transition: opacity 250ms ease, transform 250ms cubic-bezier(.2, .7, .2, 1), box-shadow 250ms ease; }
.scico-projects-map__dot.is-active { z-index: 4; }
.scico-projects-map__dot.is-active::before { transform: scale(1.35); box-shadow: 0 0 0 6px var(--projects-map-ring), 0 2px 6px rgb(0 0 0 / 25%); }
.scico-projects-map__cluster.is-active { z-index: 4; transform: scale(1.12); box-shadow: 0 0 0 9px var(--projects-map-ring), 0 3px 8px rgb(0 0 0 / 22%); }
.scico-projects-map.has-open .scico-projects-map__dot:not(.is-active),
.scico-projects-map.has-open .scico-projects-map__cluster:not(.is-active) { opacity: .4; }
.scico-projects-map__dot:focus-visible,
.scico-projects-map__cluster:focus-visible { outline: 2px solid #2a2e28; outline-offset: 2px; border-radius: 50%; }

/* Small card next to its dot; position, side and arrow are set by the view script. */
.scico-projects-map__card { position: absolute; top: var(--card-y, 0); left: var(--card-x, 0); z-index: 10; display: flex; width: 290px; box-sizing: border-box; flex-direction: column; gap: 12px; padding: 16px; border-radius: 12px; background: #fff; box-shadow: 0 18px 40px rgb(19 22 17 / 16%), 0 0 0 1px rgb(0 0 0 / 5%); color: #000; text-align: right; animation: scico-map-card 220ms ease-out; }
.scico-projects-map__card[hidden] { display: none; }
.scico-projects-map__card::before { position: absolute; bottom: -6px; left: var(--arrow-x, 50%); width: 12px; height: 12px; background: #fff; box-shadow: 2px 2px 3px rgb(0 0 0 / 6%); content: ""; transform: translateX(-50%) rotate(45deg); }
.scico-projects-map__card.is-below::before { top: -6px; bottom: auto; box-shadow: -2px -2px 3px rgb(0 0 0 / 4%); }
@keyframes scico-map-card { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.scico-projects-map__card-head { display: flex; align-items: flex-start; gap: 10px; }
.scico-projects-map__card-titles { min-width: 0; flex: 1 1 auto; }
.scico-projects-map__card h3 { margin: 0; font-size: 15px; font-weight: 800; line-height: 1.6; }
.scico-projects-map__card-city { display: flex; align-items: center; gap: 6px; margin: 2px 0 0; color: #4c504a; font-size: 13px; font-weight: 500; line-height: 1.5; }
.scico-projects-map__card-city::before { width: 8px; height: 8px; border-radius: 50%; background: var(--projects-map-accentColor, #4c504a); content: ""; }
.scico-projects-map__close,
.scico-projects-map__back { display: flex; width: 28px; height: 28px; flex: 0 0 auto; align-items: center; justify-content: center; margin: 0; padding: 0; border: 0; border-radius: 50%; background: #f3efe5; color: #4c504a; cursor: pointer; font: inherit; font-size: 18px; line-height: 1; transition: background-color 200ms ease; }
.scico-projects-map__back { font-size: 15px; }
.scico-projects-map__back[hidden] { display: none; }
.scico-projects-map__close:focus-visible,
.scico-projects-map__back:focus-visible,
.scico-projects-map__city:focus-visible,
.scico-projects-map__item:focus-visible,
.scico-projects-map__link:focus-visible { outline: 2px solid #2a2e28; outline-offset: 2px; }
.scico-projects-map__card-image { display: block; width: 100%; aspect-ratio: 16 / 10; border-radius: 8px; object-fit: cover; }
.scico-projects-map__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.scico-projects-map__tags span { padding: 2px 8px; border: 1px solid #d6d6d6; border-radius: 4px; color: #4c504a; font-size: 12px; font-weight: 500; line-height: 1.5; }
.scico-projects-map__tags span.is-status { border-color: transparent; background: color-mix(in srgb, var(--projects-map-accentColor, #4c504a) 12%, #fff); color: color-mix(in srgb, var(--projects-map-accentColor, #4c504a) 80%, #000); }
.scico-projects-map__specs { display: flex; gap: 8px; margin: 0; }
.scico-projects-map__specs div { flex: 1 1 0; padding: 8px 10px; border-radius: 8px; background: #f6f6f6; }
.scico-projects-map__specs dt { color: #767676; font-size: 11px; font-weight: 500; line-height: 1.5; }
.scico-projects-map__specs dd { margin: 0; color: #000; font-size: 13px; font-weight: 700; line-height: 1.6; }
.scico-projects-map__card-text { margin: 0; color: #4c504a; font-size: 13px; font-weight: 400; line-height: 1.8; }
.scico-projects-map__link { display: inline-flex; align-items: center; align-self: flex-end; gap: 8px; color: #000; font-size: 13px; font-weight: 600; line-height: 1.5; text-decoration: none; }
.scico-projects-map__arrow { display: flex; width: 16px; height: 16px; align-items: center; justify-content: center; transition: transform 250ms ease; }
.scico-projects-map__arrow img { display: block; transform: rotate(-90deg) scaleX(-1); }

/* List of the projects in a numbered circle or a city. */
.scico-projects-map__list { display: flex; max-height: 260px; flex-direction: column; gap: 2px; margin: 0 -6px; padding: 0; overflow-y: auto; list-style: none; }
.scico-projects-map__item { display: flex; width: 100%; box-sizing: border-box; align-items: center; gap: 10px; margin: 0; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: #000; cursor: pointer; font: inherit; text-align: right; transition: background-color 200ms ease; }
.scico-projects-map__item::before { width: 10px; height: 10px; flex: 0 0 auto; box-sizing: border-box; border: 2px solid #fff; border-radius: 50%; background: var(--projects-map-accentColor, #4c504a); box-shadow: 0 0 0 2px var(--projects-map-ring); content: ""; }
.scico-projects-map__item-text { display: flex; min-width: 0; flex: 1 1 auto; flex-direction: column; }
.scico-projects-map__item-title { font-size: 14px; font-weight: 700; line-height: 1.5; }
.scico-projects-map__item-meta { color: #767676; font-size: 12px; font-weight: 500; line-height: 1.5; }
.scico-projects-map__item-arrow { flex: 0 0 auto; color: #4c504a; font-size: 14px; transition: transform 200ms ease; }

.scico-projects-map__backdrop { position: fixed; inset: 0; z-index: 999; background: rgb(19 22 17 / 35%); }
.scico-projects-map__backdrop[hidden] { display: none; }

/* Dots and circles pop in one after another when the map scrolls into view (only when the view script runs). */
.scico-projects-map.is-animated:not(.is-visible) .scico-projects-map__dot,
.scico-projects-map.is-animated:not(.is-visible) .scico-projects-map__cluster { opacity: 0; }
.scico-projects-map.is-visible .scico-projects-map__dot::before,
.scico-projects-map.is-visible .scico-projects-map__cluster { animation: scico-map-pop 520ms cubic-bezier(.2, .7, .2, 1) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes scico-map-pop { from { opacity: 0; scale: .2; } 70% { opacity: 1; scale: 1.12; } to { opacity: 1; scale: 1; } }

@media (hover: hover) {
	.scico-projects-map__dot:hover::before { transform: scale(1.3); }
	.scico-projects-map__cluster:not(.is-active):hover { transform: scale(1.08); }
	.scico-projects-map__city:not([aria-expanded="true"]):hover { border-color: #c9c9c9; background: #f3efe5; }
	.scico-projects-map__close:hover,
	.scico-projects-map__back:hover { background: #e7e7e7; }
	.scico-projects-map__item:hover { background: #f3efe5; }
	.scico-projects-map__item:hover .scico-projects-map__item-arrow { transform: translateX(-3px); }
	.scico-projects-map__link:hover .scico-projects-map__arrow { transform: translateX(-4px); }
}
@media (prefers-reduced-motion: reduce) {
	.scico-projects-map__card,
	.scico-projects-map.is-visible .scico-projects-map__dot::before,
	.scico-projects-map.is-visible .scico-projects-map__cluster { animation: none; }
	.scico-projects-map__dot::before,
	.scico-projects-map__cluster { transition: none; }
}

@media (max-width: 1100px) {
	.scico-projects-map { padding: 24px 32px 80px; }
	.scico-projects-map__inner { gap: 32px; }
	.scico-projects-map__copy h2 { font-size: min(var(--projects-map-headingSize, 32px), 28px); }
	.scico-projects-map__map { flex-basis: 52%; }
}

@media (max-width: 860px) {
	.scico-projects-map__inner { flex-direction: column; align-items: stretch; }
	.scico-projects-map__copy { flex-basis: auto; }
	.scico-projects-map__map { flex-basis: auto; width: min(100%, 560px); align-self: center; }
}

/* Phones: the card is a bottom sheet over a dimmed page. */
@media (max-width: 600px) {
	.scico-projects-map { padding: 16px 16px 64px; }
	.scico-projects-map__copy { gap: 16px; }
	.scico-projects-map__copy h2 { font-size: min(var(--projects-map-headingSize, 32px), 24px); }
	.scico-projects-map__copy > p { font-size: min(var(--projects-map-textSize, 16px), 15px); }
	.scico-projects-map__dot { width: 24px; height: 24px; }
	.scico-projects-map__dot::before { width: 12px; height: 12px; }
	.scico-projects-map__card { position: fixed; top: auto; right: 0; bottom: 0; left: 0; z-index: 1000; width: auto; max-height: calc(100dvh - 48px); overflow-y: auto; overscroll-behavior: contain; padding: 32px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; box-shadow: 0 -12px 40px rgb(19 22 17 / 18%); transform: translateY(var(--scico-sheet-drag, 0px)); transition: transform 260ms cubic-bezier(.2, .8, .2, 1); animation: scico-sheet-in 320ms cubic-bezier(.2, .8, .2, 1); }
	.scico-projects-map__card::before { display: none; }
	.scico-projects-map__card.is-dragging { transition: none; }
	.scico-projects-map__card.is-closing { transform: translateY(100%); transition: transform 200ms cubic-bezier(.4, 0, 1, 1); }
	.scico-projects-map__card > .scico-sheet__handle { display: block; color: #4c504a; }
	.scico-projects-map__list { max-height: none; }
}

/* Editor: no clustering, every dot is shown as is. */
.scico-projects-map.is-editing .scico-projects-map__dot { cursor: default; }

@media (prefers-reduced-motion: reduce) and (max-width: 600px) {
	.scico-projects-map__card, .scico-projects-map__card.is-closing { animation: none; transition: none; }
}
