/* ==========================================================================
   Hakan Interiors – interactive project map ([hakan_project_map])
   ========================================================================== */

.hakan-map {
	--hm-espresso: #361F1C;
	--hm-burgundy: #60211A;
	--hm-sand: #B2A591;
	--hm-cream: #F2EFEB;
	--hm-ease: cubic-bezier(.7, 0, .2, 1);

	position: relative;
	height: 88vh;
	min-height: 620px;
	max-height: 980px;
	background: var(--hm-espresso);
	font-family: 'Raleway', sans-serif;
}

.hakan-map__stage {
	position: absolute;
	inset: 0;
	overflow: hidden;
	background: var(--hm-espresso);
}

/* Expanded: the stage detaches and grows to fill the viewport */
.hakan-map.is-open .hakan-map__stage {
	position: fixed;
	z-index: 100000;
	transition: top .6s var(--hm-ease), left .6s var(--hm-ease), width .6s var(--hm-ease), height .6s var(--hm-ease);
}

html.hakan-map-lock,
html.hakan-map-lock body {
	overflow: hidden;
}

/* The theme's sticky header and back-to-top button sit above everything; hide them while the map is open */
html.hakan-map-lock #site-header-wrapper,
html.hakan-map-lock #site-header,
html.hakan-map-lock .scroll-top-button {
	visibility: hidden;
}

.hakan-map__canvas {
	position: absolute;
	inset: 0;
}

/* Espresso wash so the intro reads over the imagery */
.hakan-map__shade {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background:
		linear-gradient(90deg, rgba(54, 31, 28, .94) 0%, rgba(54, 31, 28, .82) 32%, rgba(54, 31, 28, .25) 68%, rgba(54, 31, 28, .1) 100%),
		linear-gradient(0deg, rgba(54, 31, 28, .55) 0%, rgba(54, 31, 28, 0) 30%);
	transition: opacity .6s ease;
}

.hakan-map.is-expanded .hakan-map__shade {
	opacity: 0;
}

/* ---- Intro ---- */
.hakan-map__intro {
	position: absolute;
	top: 50%;
	left: max(21px, calc((100% - 1170px) / 2 + 21px));
	z-index: 2;
	max-width: 520px;
	padding-right: 21px;
	transform: translateY(-50%);
	transition: opacity .4s ease, transform .6s var(--hm-ease);
}

.hakan-map.is-expanded .hakan-map__intro {
	opacity: 0;
	pointer-events: none;
	transform: translate(-40px, -50%);
}

.hakan-map__eyebrow {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 28px;
	color: var(--hm-sand);
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: .32em;
	text-transform: uppercase;
}

.hakan-map__eyebrow:before {
	content: '';
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--hm-burgundy);
	box-shadow: 0 0 0 2px var(--hm-cream);
}

.hakan-map .hakan-map__title {
	margin: 0 0 24px;
	color: var(--hm-cream);
	font-family: 'Raleway', sans-serif;
	font-size: clamp(32px, 3.8vw, 52px);
	font-weight: 300;
	line-height: 1.12;
	letter-spacing: .03em;
	text-transform: uppercase;
}

.hakan-map .hakan-map__lead {
	margin: 0 0 14px;
	color: var(--hm-sand);
	font-size: clamp(18px, 1.5vw, 21px);
	font-weight: 500;
	line-height: 1.5;
}

.hakan-map .hakan-map__text {
	margin: 0 0 40px;
	color: rgba(242, 239, 235, .8);
	font-size: 16px;
	line-height: 1.75;
}

.hakan-map__open {
	display: inline-flex;
	align-items: center;
	gap: 14px;
	padding: 17px 32px;
	border: 1px solid var(--hm-sand);
	border-radius: 0;
	background: var(--hm-sand);
	color: var(--hm-espresso);
	font-family: 'Raleway', sans-serif;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: .18em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color .25s ease, border-color .25s ease;
}

.hakan-map__open span {
	font-size: 16px;
	letter-spacing: 0;
	transition: transform .25s ease;
}

.hakan-map__open:hover,
.hakan-map__open:focus-visible {
	background: var(--hm-cream);
	border-color: var(--hm-cream);
}

.hakan-map__open:hover span {
	transform: translateX(5px);
}

/* ---- Top bar (expanded only) ---- */
.hakan-map__bar {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 72px;
	padding: 0 24px;
	background: rgba(54, 31, 28, .92);
	border-bottom: 1px solid rgba(178, 165, 145, .25);
	opacity: 0;
	pointer-events: none;
	transform: translateY(-100%);
	transition: opacity .4s ease, transform .5s var(--hm-ease);
}

.hakan-map.is-expanded .hakan-map__bar {
	opacity: 1;
	pointer-events: auto;
	transform: none;
	transition-delay: .35s;
}

.hakan-map__bar-title strong {
	display: block;
	color: var(--hm-cream);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .22em;
	text-transform: uppercase;
}

.hakan-map__bar-title span {
	color: var(--hm-sand);
	font-size: 12px;
	letter-spacing: .08em;
}

.hakan-map__bar-actions {
	display: flex;
	gap: 10px;
}

.hakan-map__bar button {
	padding: 11px 18px;
	border: 1px solid rgba(242, 239, 235, .45);
	border-radius: 0;
	background: transparent;
	color: var(--hm-cream);
	font-family: 'Raleway', sans-serif;
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: .18em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease;
}

.hakan-map__bar button:hover,
.hakan-map__bar button:focus-visible {
	background: var(--hm-cream);
	color: var(--hm-espresso);
}

/* ---- Project list panel (expanded only) ---- */
.hakan-map__panel {
	position: absolute;
	top: 72px;
	right: 0;
	bottom: 0;
	z-index: 3;
	display: flex;
	flex-direction: column;
	width: 340px;
	background: rgba(54, 31, 28, .94);
	border-left: 1px solid rgba(178, 165, 145, .2);
	transform: translateX(100%);
	transition: transform .5s var(--hm-ease);
}

.hakan-map.is-expanded .hakan-map__panel {
	transform: none;
	transition-delay: .45s;
}

.hakan-map__panel-toggle {
	display: none;
}

.hakan-map__list {
	flex: 1;
	margin: 0;
	padding: 8px 0;
	overflow-y: auto;
	list-style: none;
	scrollbar-width: thin;
	scrollbar-color: rgba(178, 165, 145, .4) transparent;
}

.hakan-map__list li {
	margin: 0;
	padding: 0;
}

.hakan-map__list button {
	display: flex;
	align-items: baseline;
	gap: 16px;
	width: 100%;
	padding: 15px 24px;
	border: 0;
	border-bottom: 1px solid rgba(242, 239, 235, .07);
	background: transparent;
	color: var(--hm-cream);
	font-family: 'Raleway', sans-serif;
	text-align: left;
	cursor: pointer;
	transition: background-color .2s ease;
}

.hakan-map__list button:hover,
.hakan-map__list button:focus-visible,
.hakan-map__list li.is-active button {
	background: rgba(242, 239, 235, .06);
}

.hakan-map__list li.is-active em {
	color: var(--hm-cream);
}

.hakan-map__list em {
	flex: none;
	width: 22px;
	color: var(--hm-sand);
	font-size: 11px;
	font-style: normal;
	font-weight: 600;
	letter-spacing: .1em;
}

.hakan-map__list strong {
	display: block;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.35;
}

.hakan-map__list small {
	display: block;
	margin-top: 3px;
	color: var(--hm-sand);
	font-size: 12px;
	line-height: 1.3;
}

/* ---- Pins ---- */
/* No position here: MapLibre positions markers absolutely (.maplibregl-marker) */
.hakan-map__pin {
	width: 14px;
	height: 14px;
	padding: 0;
	border: 2px solid var(--hm-cream);
	border-radius: 50%;
	background: var(--hm-burgundy);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .45);
	cursor: pointer;
	pointer-events: none;
	transition: width .25s ease, height .25s ease, background-color .25s ease;
}

/* Soft pulse ring */
.hakan-map__pin span {
	position: absolute;
	inset: -8px;
	border-radius: 50%;
	border: 1px solid rgba(242, 239, 235, .7);
	animation: hakan-map-pulse 2.6s ease-out infinite;
}

.hakan-map.is-expanded .hakan-map__pin {
	width: 18px;
	height: 18px;
	pointer-events: auto;
}

.hakan-map__pin:hover,
.hakan-map__pin.is-active {
	background: var(--hm-sand);
}

.hakan-map__pin.is-active {
	width: 24px !important;
	height: 24px !important;
}

@keyframes hakan-map-pulse {
	0%   { opacity: .9; transform: scale(.5); }
	100% { opacity: 0;  transform: scale(1.6); }
}

@media (prefers-reduced-motion: reduce) {
	.hakan-map__pin span { animation: none; display: none; }
	.hakan-map.is-open .hakan-map__stage { transition: none; }
}

/* ---- Popups ---- */
.hakan-map__popup .maplibregl-popup-content {
	padding: 14px 18px;
	border-radius: 0;
	background: var(--hm-espresso, #361F1C);
	box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
	font-family: 'Raleway', sans-serif;
}

.hakan-map__popup strong {
	display: block;
	color: #F2EFEB;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
}

.hakan-map__popup span {
	display: block;
	margin: 2px 0 6px;
	color: #B2A591;
	font-size: 12px;
}

.hakan-map__popup span:last-child {
	margin-bottom: 0;
}

/* "View project →" (pins that come from Work projects) */
.hakan-map__popup a {
	display: inline-flex;
	gap: 8px;
	margin: 4px 0 8px;
	color: #F2EFEB;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .16em;
	text-transform: uppercase;
	text-decoration: none;
	border-bottom: 1px solid #B2A591;
}

.hakan-map__popup a:last-child {
	margin-bottom: 0;
}

.hakan-map__popup a i {
	font-style: normal;
}

.hakan-map__popup a:hover {
	color: #B2A591;
}

.hakan-map__popup.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: #361F1C; }
.hakan-map__popup.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: #361F1C; }
.hakan-map__popup.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: #361F1C; }
.hakan-map__popup.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: #361F1C; }

/* ---- Map controls: only while exploring ---- */
.hakan-map .maplibregl-ctrl-bottom-left {
	opacity: 0;
	pointer-events: none;
	transition: opacity .4s ease;
}

.hakan-map.is-expanded .maplibregl-ctrl-bottom-left {
	opacity: 1;
	pointer-events: auto;
	transition-delay: .5s;
}

.hakan-map .maplibregl-ctrl-group {
	border-radius: 0;
	box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
}

.hakan-map .maplibregl-ctrl-attrib {
	font-size: 10px;
}

/* ---- Mobile ---- */
@media (max-width: 767px) {
	.hakan-map {
		height: 92vh;
		min-height: 560px;
	}

	.hakan-map__shade {
		background:
			linear-gradient(0deg, rgba(54, 31, 28, .96) 0%, rgba(54, 31, 28, .85) 55%, rgba(54, 31, 28, .2) 100%);
	}

	.hakan-map__intro {
		top: auto;
		bottom: 48px;
		transform: none;
	}

	.hakan-map.is-expanded .hakan-map__intro {
		transform: translateY(30px);
	}

	.hakan-map__open {
		justify-content: center;
		width: 100%;
	}

	.hakan-map__bar {
		height: 64px;
		padding: 0 16px;
	}

	.hakan-map__bar-title strong {
		font-size: 11px;
		letter-spacing: .16em;
	}

	.hakan-map__overview {
		display: none;
	}

	/* Project list becomes a bottom sheet */
	.hakan-map__panel {
		top: auto;
		left: 0;
		width: auto;
		height: 56px;
		border-left: 0;
		border-top: 1px solid rgba(178, 165, 145, .25);
		transform: translateY(100%);
		transition: transform .5s var(--hm-ease), height .4s var(--hm-ease);
	}

	.hakan-map.is-panel-open .hakan-map__panel {
		height: 60vh;
	}

	.hakan-map__panel-toggle {
		display: flex;
		flex: none;
		align-items: center;
		justify-content: space-between;
		height: 56px;
		padding: 0 20px;
		border: 0;
		background: transparent;
		color: var(--hm-cream);
		font-family: 'Raleway', sans-serif;
		font-size: 12px;
		font-weight: 600;
		letter-spacing: .2em;
		text-transform: uppercase;
		cursor: pointer;
	}

	.hakan-map__panel-toggle span {
		color: var(--hm-sand);
	}

	.hakan-map .maplibregl-ctrl-bottom-left {
		bottom: 56px;
	}
}

/* ==========================================================================
   Page mode – [hakan_project_map mode="page"] on the Explore the Map page.
   Fills the first screen under the transparent header; bar, list and pins are live
   from the start. "Full screen" reuses the expanded state above.
   ========================================================================== */

.hakan-map--page {
	height: 100vh;
	min-height: 640px;
	max-height: none;
}

.hakan-map--page:not(.is-open) .hakan-map__stage {
	top: var(--hm-top, 0);
}

.hakan-map--page .hakan-map__bar,
.hakan-map--page .hakan-map__panel,
.hakan-map--page .maplibregl-ctrl-bottom-left {
	opacity: 1;
	pointer-events: auto;
	transform: none;
	transition-delay: 0s;
}

.hakan-map--page .hakan-map__pin {
	width: 18px;
	height: 18px;
	pointer-events: auto;
}

/* Page heading in the bar */
.hakan-map--page .hakan-map__bar-title h1 {
	margin: 0 0 3px;
	color: var(--hm-cream);
	font-family: 'Raleway', sans-serif;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: .2em;
	text-transform: uppercase;
}

/* Inline: show Full screen; expanded: show Exit */
.hakan-map--page:not(.is-open) .hakan-map__close,
.hakan-map--page.is-open .hakan-map__fullscreen {
	display: none;
}

/* Keep the imagery credit clear of the project list */
.hakan-map--page .maplibregl-ctrl-bottom-right,
.hakan-map.is-expanded .maplibregl-ctrl-bottom-right {
	right: 340px;
}

/* "Use Ctrl + scroll to zoom" hint */
.hakan-map--page .maplibregl-cooperative-gesture-screen {
	background: rgba(54, 31, 28, .55);
	color: var(--hm-cream);
	font-family: 'Raleway', sans-serif;
	font-size: 16px;
	letter-spacing: .04em;
}

@media (max-width: 767px) {
	.hakan-map--page {
		height: 100svh;
		min-height: 560px;
	}

	.hakan-map--page .hakan-map__bar-title h1 {
		font-size: 11px;
		letter-spacing: .16em;
	}

	.hakan-map--page .hakan-map__bar-title span {
		font-size: 11px;
	}

	/* Full screen isn't needed on phones – the map already fills the screen */
	.hakan-map--page .hakan-map__fullscreen {
		display: none;
	}

	.hakan-map--page.is-panel-open .hakan-map__panel {
		height: 60%;
	}

	.hakan-map--page .maplibregl-ctrl-bottom-right,
	.hakan-map.is-expanded .maplibregl-ctrl-bottom-right {
		right: 0;
		bottom: 56px;
	}
}
