/* Janamax — Projects page (ported from the "Janamax Projects" design). Builds on home.css (header, dock, footer, buttons). */

body.jm { background: radial-gradient(120% 60% at 50% 0%, #0b2136 0%, #061422 42%, #030a12 100%) no-repeat, #030a12; }
.jm-projects button { font: inherit; color: inherit; }

/* ---------- Filters (tab styles live in home.css) ---------- */
.jm-pfilters { padding-top: clamp(20px, 2.5vw, 32px); }


/* ---------- List + detail ---------- */
.jm-pmain {
	padding-top: clamp(18px, 2vw, 26px); padding-bottom: clamp(60px, 6.5vw, 100px);
	display: flex; gap: 18px; align-items: flex-start;
}
.jm-pempty { padding-top: 40px; padding-bottom: 80px; color: #a9bdc7; }

.jm-plist { flex: 0 0 clamp(260px, 26vw, 340px); display: flex; flex-direction: column; gap: 12px; }
/* Desktop: the list sticks below the fixed header and scrolls on its own, so a project can be picked from anywhere on the page. */
@media (min-width: 800px) {
	.jm-plist {
		--jm-plist-top: 96px;
		position: sticky; top: var(--jm-plist-top); max-height: calc(100vh - var(--jm-plist-top) - 16px);
		overflow-y: auto; overscroll-behavior: contain; padding-right: 6px;
		scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
	}
	.jm-plist::-webkit-scrollbar { width: 6px; }
	.jm-plist::-webkit-scrollbar-thumb { border-radius: 3px; background: rgba(255, 255, 255, 0.18); }
	.jm .jm-plist__item { flex: none; }
}
.jm .jm-plist__item {
	display: flex; align-items: center; gap: 16px; padding: 10px 16px 10px 10px; border-radius: 12px;
	border-right: 1px solid var(--jm-accent); background: var(--jm-card); color: inherit;
}
.jm .jm-plist__item.is-active { background: linear-gradient(90deg, #243646 0%, #0f2030 100%); }
.jm-plist__thumb {
	flex: none; width: 118px; height: 80px; border-radius: 8px; overflow: hidden; background: #0a1620;
	display: flex; align-items: center; justify-content: center; color: #3f5667;
}
.jm .jm-plist__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s ease; }
.jm-plist__item:hover .jm-plist__thumb img { transform: scale(1.1); }
.jm-plist__text { flex: 1; min-width: 0; }
.jm-plist__code { display: block; font-weight: 500; font-size: 13px; letter-spacing: 0.08em; color: #7d919c; }
.jm-plist__name {
	display: block; margin-top: 5px; font-family: var(--jm-display); font-weight: 300; font-size: 18px; letter-spacing: 0.04em; line-height: 1.2;
	color: #e6eef3; transition: color 0.25s ease;
}
.jm-plist__item:hover .jm-plist__name, .jm-plist__item.is-active .jm-plist__name { color: var(--jm-accent); }
.jm-plist__arrow { flex: none; width: 18px; height: 18px; fill: #cfdbe2; transform: rotate(-45deg); transition: transform 0.3s ease, fill 0.25s ease; }
.jm-plist__item:hover .jm-plist__arrow, .jm-plist__item.is-active .jm-plist__arrow { transform: none; fill: var(--jm-accent); }

.jm-pdetail-col { flex: 1 1 0; min-width: 0; }
.jm-pdetail-col__bar { display: none; }
.jm-pdetail { border-radius: 12px; border-right: 1px solid var(--jm-accent); background: var(--jm-card); padding: clamp(14px, 1.6vw, 22px); }
.jm-pdetail[hidden] { display: none; }

.jm-pdetail__stage { position: relative; height: clamp(260px, 30vw, 460px); border-radius: 8px; background: #0a1620; overflow: hidden; }
.jm .jm-pdetail__img { width: 100%; height: 100%; object-fit: contain; display: block; }
.jm .jm-pdetail__video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.jm-pdetail__play {
	position: absolute; top: 50%; left: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; padding: 0; cursor: pointer; border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.4); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
	background: rgba(9, 23, 36, 0.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23eef4f8' d='M8 5v14l11-7z'/%3E%3C/svg%3E") 54% 50% / 32px no-repeat;
	transition: border-color 0.2s ease, background-color 0.2s ease;
}
.jm-pdetail__play:hover { border-color: var(--jm-accent); background-color: rgba(231, 77, 15, 0.35); }
.jm .jm-pdetail__stage [hidden], .jm .jm-lightbox [hidden] { display: none; }
.jm-pdetail__placeholder { height: 100%; display: flex; align-items: center; justify-content: center; color: #3f5667; }
.jm-pdetail__btn {
	position: absolute; display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; color: #eef4f8;
	border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 6px; background: rgba(9, 23, 36, 0.55);
	-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: border-color 0.2s ease, background 0.2s ease;
}
.jm-pdetail__btn:hover { border-color: var(--jm-accent); background: rgba(231, 77, 15, 0.25); }
.jm-pdetail__btn svg { width: 20px; height: 20px; fill: #eef4f8; }
.jm-pdetail__expand { top: 14px; right: 14px; width: 44px; height: 44px; }
.jm-pdetail__expand svg { width: 16px; height: 16px; fill: none; }
.jm-pdetail__nav { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; }
.jm-pdetail__nav--prev { left: 14px; }
.jm-pdetail__nav--prev svg { transform: scaleX(-1); }
.jm-pdetail__nav--next { right: 14px; }

.jm-pdetail__strip {
	display: flex; gap: 12px; margin-top: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
	scrollbar-width: none; -webkit-overflow-scrolling: touch; cursor: grab; user-select: none;
}
.jm-pdetail__strip::-webkit-scrollbar { display: none; }
.jm-pdetail__shot {
	flex: 0 0 calc((100% - 48px) / 5); min-width: 88px; height: 96px; padding: 0; scroll-snap-align: start; cursor: pointer; overflow: hidden;
	border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.14); background: #0a1620; transition: border-color 0.2s ease;
}
.jm-pdetail__shot:hover, .jm-pdetail__shot.is-active { border-color: var(--jm-accent); }
.jm-pdetail__shot span { display: block; width: 100%; height: 100%; transition: transform 0.5s ease; }
.jm-pdetail__shot:hover span { transform: scale(1.1); }
.jm .jm-pdetail__shot img, .jm .jm-pdetail__shot video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.jm-pdetail__shot.is-video { position: relative; }
.jm-pdetail__shot.is-video::after {
	content: ""; position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; pointer-events: none;
	background: rgba(9, 23, 36, 0.6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23eef4f8' d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / 16px no-repeat;
	border: 1px solid rgba(255, 255, 255, 0.4);
}

.jm-pdetail__head { margin-top: clamp(24px, 3vw, 40px); }
.jm-pdetail__code { font-weight: 500; font-size: 14px; letter-spacing: 0.08em; color: #7d919c; }
.jm-pdetail__title { margin: 6px 0 0; font-family: var(--jm-display); font-weight: 300; font-size: clamp(26px, 2.6vw, 36px); letter-spacing: 0.03em; line-height: 1.1; overflow-wrap: anywhere; }

.jm-pdetail__info { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: clamp(28px, 3.5vw, 56px); margin-top: 28px; }
.jm-pdetail__copy, .jm-pdetail__data { min-width: 0; }
.jm-pdetail__block + .jm-pdetail__block { margin-top: 26px; }
.jm-pdetail__label { margin: 0 0 12px; font-family: var(--jm-display); font-size: 16px; letter-spacing: 0.16em; color: var(--jm-accent); }
.jm-pdetail__copy p { margin: 0; font-size: 18px; line-height: 1.6; color: #93a7b1; text-wrap: pretty; }
.jm-pdetail__data dl { margin: 0; }
.jm-pdetail__row { display: flex; align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.jm-pdetail__row dt { flex: 0 0 42%; font-weight: 500; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: #7d919c; }
.jm-pdetail__row dd { flex: 1; min-width: 0; margin: 0; font-size: 16px; color: #dbe7ee; text-wrap: pretty; }

/* ---------- Lightbox ---------- */
.jm-lightbox {
	position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center;
	padding: 70px clamp(12px, 6vw, 90px); background: rgba(3, 10, 18, 0.95);
}
.jm-lightbox[hidden] { display: none; }
.jm .jm-lightbox__img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; border-radius: 8px; }
.jm-lightbox__close, .jm-lightbox__nav {
	position: absolute; display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; color: #eef4f8;
	border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 6px; background: rgba(9, 23, 36, 0.7);
}
.jm-lightbox__close:hover, .jm-lightbox__nav:hover { border-color: var(--jm-accent); background: rgba(231, 77, 15, 0.25); }
.jm-lightbox__close { top: 16px; right: 16px; width: 48px; height: 48px; }
.jm-lightbox__nav { top: 50%; right: 16px; transform: translateY(-50%); width: 52px; height: 52px; }
.jm-lightbox__nav svg { width: 20px; height: 20px; fill: #eef4f8; }
.jm-lightbox__nav--prev { left: 16px; right: auto; }
.jm-lightbox__nav--prev svg { transform: scaleX(-1); }
.jm-lightbox__nav[hidden] { display: none; }
.jm-lightbox__count { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; font-size: 13px; letter-spacing: 0.12em; color: #a9bdc7; }
body.jm-noscroll { overflow: hidden; }

/* ---------- Below 800px: stacked list, detail as a popup ---------- */
@media (max-width: 799px) {
	.jm-pmain { flex-wrap: wrap; }
	.jm-plist { flex: 1 1 100%; }
	.jm-plist__thumb { width: clamp(150px, 38vw, 240px); height: clamp(100px, 25vw, 160px); }
	.jm-plist__name { font-size: 20px; }
	.jm .jm-plist__item.is-active { background: var(--jm-card); }
	.jm-plist__item.is-active .jm-plist__name { color: #e6eef3; }
	.jm-plist__item.is-active .jm-plist__arrow { transform: rotate(-45deg); fill: #cfdbe2; }

	.jm-pdetail-col { display: none; }
	.jm-pdetail-col.is-open {
		display: block; position: fixed; inset: 0; z-index: 200; overflow-y: auto;
		padding: 16px clamp(12px, 4vw, 32px) 32px;
		background: rgba(6, 12, 20, 0.94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
	}
	.jm-pdetail-col__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
	.jm-pback {
		display: inline-flex; align-items: center; gap: 10px; padding: 0; border: 0; background: transparent; cursor: pointer;
		font-family: var(--jm-display); font-size: 16px; letter-spacing: 0.16em; color: var(--jm-accent) !important;
	}
	.jm-pback svg { width: 18px; height: 18px; fill: var(--jm-accent); transform: scaleX(-1); }
	.jm-pclose {
		width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer;
		border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 6px; background: transparent; color: #eef4f8;
	}
	.jm-pclose:hover { border-color: var(--jm-accent); color: var(--jm-accent); }
}

/* Phones: a smaller thumb and title so long words in project names fit; they can still break rather than widen the page. */
@media (max-width: 699px) {
	.jm-plist { min-width: 0; }
	.jm .jm-plist__item { gap: 12px; padding-right: 12px; }
	.jm-plist__thumb { width: 30vw; height: 20vw; }
	.jm-plist__name { font-size: 16px; overflow-wrap: anywhere; }
}
