/**
 * Portfolio screen styles — תיק עבודות
 * Font is declared in front-page.css (always loaded first).
 */

h1, h2, h3, h4, h5, h6 {
	font-family: 'talent', sans-serif;
}

/* Override screen-1: full bleed, no centering */
.screen-1 {
	align-items: flex-start !important;
	justify-content: flex-start !important;
	padding: 0 !important;
	overflow: hidden;
}

.portfolio-section {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	padding: 28px 30px 300px;
	box-sizing: border-box;
}

/* ── Header ─────────────────────────────────── */
.portfolio-header {
	flex-shrink: 0;
	margin-bottom: 10px;
	position: relative;
	z-index: 5;
}

.portfolio-header h1 {
	font-size: 3.2em;
    color: var(--dark-blue);
    font-weight: 400;
    margin: 62px 0 18px;
    letter-spacing: -1px;
    text-align: center;
}

/* ── Tabs ────────────────────────────────────── */
.portfolio-tabs {
	flex-shrink: 0;
	display: flex;
	gap: 8px;
	margin-bottom: 18px;
	direction: rtl;
	position: relative;
	z-index: 5;
	align-items: center;
    justify-content: center;
}

.portfolio-tab-btn {
	display: inline-flex;
	align-items: center;
	gap: 0;
	padding: 8px;
	border: 2px solid var(--primary-blue);
	border-radius: 25px;
	background: transparent;
	color: var(--primary-blue);
	font-size: 0.9em;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	overflow: hidden;
	transition: background 0.22s ease, color 0.22s ease,
	            padding 0.3s ease, gap 0.3s ease;
	white-space: nowrap;
	direction: rtl;
}

.tab-icon {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

.tab-label {
	max-width: 0;
	overflow: hidden;
	opacity: 0;
	transition: max-width 0.3s ease, opacity 0.25s ease 0.05s, margin 0.3s ease;
	display: inline-block;
}

.portfolio-tab-btn:hover .tab-label,
.portfolio-tab-btn.active .tab-label {
	max-width: 160px;
	opacity: 1;
	margin-right: 6px;
}

.portfolio-tab-btn:hover,
.portfolio-tab-btn.active {
	background: var(--primary-blue);
	color: white;
	padding: 8px 14px;
	gap: 0;
}

/* ── Grid wrapper — full screen, fade at edges ── */
.portfolio-grid-wrapper {
	position: absolute;
	top: 10vh;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	justify-content: center;
	overflow: hidden;
	z-index: 2;
	mask-image: linear-gradient(
		to bottom,
		transparent 0%,
		black 12%,
		black 82%,
		transparent 100%
	);
	-webkit-mask-image: linear-gradient(
		to bottom,
		transparent 0%,
		black 12%,
		black 82%,
		transparent 100%
	);
	max-height: 70vh;
}

/* ── Grid: vertical chain of circles ── */
.portfolio-grid {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 38vh 60px 38vh;
	direction: rtl;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	height: 100%;
	width: auto;
}

.portfolio-grid::-webkit-scrollbar { display: none; }

/* Dot navigation */
.portfolio-dots {
	position: fixed;
	left: 30%;
	top: 50%;
	transform: translateY(-50%);
	z-index: 200;
	display: flex;
	flex-direction: column;
	gap: 12px;
	align-items: center;
}

.portfolio-dot {
	    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgb(205 220 57 / 84%);
	border: none;
	cursor: pointer;
	padding: 0;
	box-shadow: 0 1px 4px rgba(0,0,0,0.3);
	transition: background 0.25s ease, transform 0.25s ease;
}

.portfolio-dot.active {
	background: #fff;
	transform: scale(1.7);
	box-shadow: 0 0 8px rgba(255,255,255,0.6);
}

.portfolio-dot:hover:not(.active) {
	background: rgba(255,255,255,0.7);
	transform: scale(1.35);
}

@keyframes cardPulse {
	0%   { box-shadow: 0 0 0 14px rgba(255,255,255,0.75), 0 0 50px rgba(255,255,255,0.45); }
	100% { box-shadow: 0 0 0 0px  rgba(255,255,255,0),    0 0 0px  rgba(255,255,255,0); }
}

.portfolio-card.card-pulse {
	animation: cardPulse 0.75s ease-out forwards;
}

/* Vertical connecting line behind all cards */
.portfolio-grid::before {
	content: '';
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 2px;
	height: 100%;
	background: linear-gradient(
		to bottom,
		transparent 2%,
		rgba(255,255,255,0.45) 8%,
		rgba(255,255,255,0.45) 92%,
		transparent 98%
	);
	z-index: 0;
	pointer-events: none;
}


/* ── Card ring wrapper — perspective scale + orbit host ── */
.card-ring-wrap {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	scroll-snap-align: center;
	z-index: 1;
	transform: scale(var(--ps, 1));
	transition: transform 0.18s ease;
}

/* ── Card — submarine porthole ───────────────── */
.portfolio-card {
	    position: relative;
    width: 460px;
    height: 360px;
    overflow: hidden;
    cursor: pointer;
}

/* Glass refraction shine — top-left quadrant */
.portfolio-card::before {
	content: '';
	position: absolute;
	top: 7%;
	left: 10%;
	width: 42%;
	height: 32%;
	background: radial-gradient(
		ellipse at 38% 38%,
		rgba(255, 255, 255, 0.48) 0%,
		rgba(255, 255, 255, 0.16) 45%,
		transparent 72%
	);
	border-radius: 50%;
	z-index: 10;
	pointer-events: none;
}

.portfolio-card:hover {
}

/* Thumbnail fills the full circle */
.card-image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	flex: unset;
}

.card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Gradient overlay — appears on hover */
.card-body {
	position: absolute;
	inset: 0;
	flex: unset;
	min-height: unset;
	display: flex;
	align-items: stretch;
	padding: 0;
	opacity: 0;
	transition: opacity 0.32s ease;
	border-radius: 50%;
	z-index: 3;
}

.portfolio-card:hover .card-body {
	opacity: 1;
}

/* Button covers the entire circle */
.card-expand-btn {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	z-index: 2;
}

/* Title — centered at bottom of circle, visible on hover */
.btn-title {
	position: absolute;
    bottom: 104px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 23px;
    font-weight: 400;
    color: #ffffffa1;
    line-height: 1.3;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.55);
    padding: 0 14px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.3s ease 0.05s, transform 0.3s ease 0.05s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: 'talent';
}

.portfolio-card:hover .btn-title {
	opacity: 1;
	transform: translateY(0);
}

.btn-icon { display: none; }

/* ── Taxonomy orbit label ────────────────────── */
.card-tax-orbit {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 0;
	height: 0;
	transform-origin: 0 0;
	pointer-events: none;
	z-index: 20;
}

.card-tax-label {
	position: absolute;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 9px;
	border-radius: 50%;
	background: #CDDC39;
	color: #fff;
	box-shadow: 0 2px 10px rgba(0,0,0,0.32);
	transform: translateX(-50%) translateY(-155px);
}

.card-tax-label.tax-games { background: #e91e63; }

.card-tax-label span { display: none; }

.card-tax-label svg {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

/* Hover: orbit animation */
.card-ring-wrap:hover .card-tax-orbit {
	animation: taxOrbitPath 70s linear infinite;
}
.card-ring-wrap:hover .card-tax-label {
	animation: taxOrbitLabel 70s linear infinite;
}

@keyframes taxOrbitPath {
	from { transform: rotate(0deg); }
	to   { transform: rotate(360deg); }
}
@keyframes taxOrbitLabel {
	from { transform: translateX(-50%) translateY(-155px) rotate(0deg); }
	to   { transform: translateX(-50%) translateY(-155px) rotate(-360deg); }
}

/* Fallback — cards with no modal */
.card-title-text {
	position: absolute;
	bottom: 20px;
	left: 0;
	right: 0;
	text-align: center;
	font-size: 0.76em;
	font-weight: 700;
	color: white;
	padding: 0 14px;
	text-shadow: 0 1px 5px rgba(0,0,0,0.55);
	line-height: 1.3;
	pointer-events: none;
}

/* Empty state */
.portfolio-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--secondary-blue);
	font-size: 1.1em;
	opacity: 0.6;
	grid-column: 1 / span 3;
	grid-row: 1 / span 2;
}

/* ═══════════════════════════════════════════════════════════════
   Modal — two columns: image left · title + process + content right
   ═══════════════════════════════════════════════════════════════ */

.portfolio-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: none;
	align-items: center;
	justify-content: center;
	direction: rtl;
}

.portfolio-modal.open {
	display: flex;
}

.modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.68);
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
	cursor: pointer;
}

.modal-content {
	position: relative;
	background: #fff;
	border-radius: 20px;
	width: 92%;
	max-width: 900px;
	max-height: 70vh;
	overflow: hidden;
	box-shadow: 0 28px 80px rgba(0, 0, 0, 0.4);
	z-index: 1;
	will-change: transform, opacity;
}

.modal-body {
	display: flex;
	max-height: 50vh;
	direction: rtl;
}

/* Left column — image / video */
.modal-left-col {
	flex: 0 0 42%;
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	background: #e8eff5;
}

.modal-image-wrap {
	flex: 1;
	overflow: hidden;
}

.modal-image {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	min-height: 0;
}

.modal-video {
	flex-shrink: 0;
}

.modal-video iframe {
	display: block;
	width: 100%;
	height: 260px;
	border: none;
}

/* Right column — title + process + content */
.modal-right-col {
	flex: 1;
	padding: 48px 36px 36px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 22px;
	direction: rtl;
	scrollbar-width: thin;
	scrollbar-color: rgba(18, 44, 59, 0.5) rgba(220, 232, 239, 0.3);
}

.modal-right-col::-webkit-scrollbar {
	width: 8px;
}

.modal-right-col::-webkit-scrollbar-track {
	background: rgba(220, 232, 239, 0.3);
	border-radius: 999px;
}

.modal-right-col::-webkit-scrollbar-thumb {
	background: linear-gradient(180deg, rgba(18, 44, 59, 0.6), rgba(18, 44, 59, 0.4));
	border-radius: 999px;
}

.modal-close-btn {
	position: absolute;
	top: 14px;
	left: 14px;
	background: rgba(0, 0, 0, 0.10);
	border: none;
	border-radius: 50%;
	width: 34px;
	height: 34px;
	font-size: 1em;
	cursor: pointer;
	color: #333;
	line-height: 1;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease;
	z-index: 10;
}

.modal-close-btn:hover {
	background: rgba(0, 0, 0, 0.2);
}

.modal-title {
	font-size: 1.9em;
	color: var(--dark-blue);
	font-weight: 800;
	margin: 0;
	line-height: 1.2;
}

.modal-process-section {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.modal-process-label {
	font-size: 1em;
	font-weight: 700;
	color: var(--primary-blue);
	margin: 0;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--primary-blue);
	letter-spacing: 0.4px;
}

.modal-long-desc {
	font-size: 1em;
	line-height: 1.88;
	color: #333;
	margin: 0;
}

.modal-long-desc p {
	margin: 0 0 12px;
}

.modal-long-desc p:last-child {
	margin-bottom: 0;
}

/* Promo — short lines (project type etc.) right under the title */
.modal-promo {
	font-size: 0.95em;
	line-height: 1.6;
	color: var(--secondary-blue);
	margin: 0;
}

.modal-promo p {
	margin: 0 0 4px;
}

.modal-promo p:last-child {
	margin-bottom: 0;
}

/* Customer — small label + name, right under promo */
.modal-customer-row {
	display: flex;
	align-items: baseline;
	gap: 6px;
	font-size: 0.92em;
}

.modal-customer-label {
	color: #888;
	font-weight: 600;
}

.modal-customer {
	color: var(--dark-blue);
	font-weight: 700;
}

/* Link button — round, opens the project in a new tab.
   Sticky + margin-top:auto so it always sits at the bottom of the scrollable
   column: pinned in place while scrolling through a long description, and
   pushed down to the visible bottom edge when there isn't enough content to scroll. */
.modal-link-btn {
	display: none;
	bottom: 0;
	align-self: center;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 90px;
	height: 90px;
	flex-shrink: 0;
	border-radius: 50%;
	background: var(--primary-blue);
	color: #fff;
	text-decoration: none;
	box-shadow: 0 4px 16px rgba(6, 39, 56, 0.35);
	transition: background 0.2s ease, transform 0.15s ease;
	margin-top: auto;
}

.modal-link-btn:hover {
	background: var(--secondary-blue);
	color: #fff;
	transform: translateY(-2px);
}

.modal-link-icon {
	width: 28px;
	height: 28px;
	background: #fff;
	-webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M14 3h7v7h-2V6.41l-9.29 9.3-1.42-1.42 9.3-9.29H14V3ZM5 5h6v2H5v12h12v-6h2v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2Z'/></svg>") center / contain no-repeat;
	mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M14 3h7v7h-2V6.41l-9.29 9.3-1.42-1.42 9.3-9.29H14V3ZM5 5h6v2H5v12h12v-6h2v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2Z'/></svg>") center / contain no-repeat;
}

.modal-link-label {
	font-size: 0.78em;
	font-weight: 700;
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 1024px) {
	.portfolio-section {
		padding: 22px 20px 240px;
	}

	.portfolio-grid {
		gap: 26px;
		padding: 16px 40px 50px;
	}

	.portfolio-card {
		width: 170px;
		height: 170px;
	}

	.portfolio-header h1 {
		font-size: 1.8em;
	}

	.modal-left-col {
		flex: 0 0 38%;
	}
}

@media (max-width: 768px) {
	.portfolio-section {
		padding: 16px 14px 185px;
	}

	.portfolio-header h1 {
		font-size: 1.5em;
	}

	.portfolio-grid {
		gap: 22px;
		padding: 14px 30px 40px;
	}

	.portfolio-card {
		width: 150px;
		height: 150px;
	}

	/* Modal stacks vertically on mobile */
	.modal-body {
		flex-direction: column;
	}

	.modal-left-col {
		flex: 0 0 130px;
	}

	.modal-image {
		min-height: 0;
	}

	.modal-right-col {
		padding: 24px 20px 24px;
	}

	.modal-video iframe {
		height: 200px;
	}

	.modal-title {
		font-size: 1.5em;
	}
}

@media (max-width: 480px) {
	.portfolio-grid {
		gap: 18px;
		padding: 12px 20px 36px;
	}

	.portfolio-card {
		width: 130px;
		height: 130px;
	}

	.modal-content {
		width: 96%;
		max-height: 70vh;
		border-radius: 14px;
	}

	.modal-right-col {
		padding: 18px 16px;
	}

	.modal-title {
		font-size: 1.3em;
	}

	.portfolio-header h1 {
		font-size: 1.3em;
		margin: 36px 0 14px;
	}

	.portfolio-tabs {
		flex-wrap: wrap;
	}

	/* left:30% sits under the centered card column on narrow phones —
	   pin the dots to the edge instead, clear of the ~130px card. */
	.portfolio-dots {
		left: 8px;
		gap: 9px;
	}

	.portfolio-dot {
		width: 14px;
		height: 14px;
	}
}
