/**
 * Bastian School Portfolio – EduBlink compatible
 */

.bsp-portfolio-wrap {
	--bsp-primary: #1ab69d;
	--bsp-primary-dark: #15967f;
	--bsp-accent: #ee4a62;
	--bsp-text: #181818;
	--bsp-muted: #808080;
	--bsp-border: #e5e5e5;
	--bsp-bg: #f0f4f5;
	--bsp-text-base: clamp(0.9375rem, 2.2vw, 1.0625rem);
	--bsp-text-sm: clamp(0.875rem, 2vw, 1rem);
	--bsp-text-lg: clamp(1rem, 2.4vw, 1.1875rem);
	--bsp-section-y: clamp(48px, 8vw, 85px);
	--bsp-container-x: clamp(16px, 4vw, 24px);
	--bsp-touch: 44px;
	font-family: inherit;
	font-size: var(--bsp-text-base);
	color: var(--bsp-text);
	overflow-x: hidden;
}

.bsp-portfolio-wrap,
.bsp-portfolio-wrap *,
.bsp-lightbox,
.bsp-lightbox *,
.bsp-video-modal,
.bsp-video-modal * {
	box-sizing: border-box;
}

.bsp-container {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 var(--bsp-container-x);
}

.bsp-section {
	padding: var(--bsp-section-y) 0;
}

.bsp-section-head {
	margin-bottom: clamp(28px, 5vw, 48px);
}

.bsp-text-center {
	text-align: center;
}

.bsp-pre-heading {
	display: block;
	color: var(--bsp-primary);
	font-size: clamp(13px, 2.5vw, 16px);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-bottom: 10px;
}

.bsp-heading {
	font-size: clamp(2rem, 4.5vw, 2.65rem);
	font-weight: 700;
	margin: 0 0 18px;
	line-height: 1.25;
	color: var(--bsp-text);
}

.bsp-lead {
	font-size: clamp(1rem, 2.5vw, 1.15rem);
	line-height: 1.75;
	color: var(--bsp-muted);
	max-width: min(780px, 100%);
	margin: 0 auto;
	padding: 0 var(--bsp-container-x);
}

/* Hero */
.bsp-hero {
	position: relative;
	min-height: clamp(280px, 50vw, 440px);
	max-height: min(560px, 70dvh);
	display: flex;
	align-items: center;
	background: var(--bsp-bg) center/cover no-repeat;
	background-color: #1a3a4a;
}

.bsp-hero-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, rgba(24,24,24,0.72) 0%, rgba(26,182,157,0.35) 100%);
}

.bsp-hero-inner {
	position: relative;
	z-index: 1;
	text-align: center;
	color: #fff;
	padding: clamp(40px, 8vw, 70px) var(--bsp-container-x);
}

.bsp-hero-title {
	font-size: clamp(2.35rem, 5.5vw, 3.35rem);
	font-weight: 700;
	margin: 0 0 20px;
	color: #fff;
}

.bsp-hero-subtitle {
	font-size: clamp(1rem, 2.5vw, 1.15rem);
	line-height: 1.75;
	max-width: min(740px, 100%);
	margin: 0 auto;
	opacity: 0.95;
}

/* Intro highlights */
.bsp-highlights {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
	gap: clamp(16px, 3vw, 28px);
	margin-top: clamp(32px, 6vw, 56px);
}

.bsp-highlight-item {
	text-align: center;
	padding: 32px 24px;
	background: #fff;
	border: 1px solid var(--bsp-border);
	border-radius: 5px;
	transition: border-color 0.25s, box-shadow 0.25s;
}

.bsp-highlight-item:hover {
	border-color: var(--bsp-primary);
	box-shadow: 0 8px 24px rgba(26,182,157,0.1);
}

.bsp-highlight-icon {
	display: block;
	width: 56px;
	height: 56px;
	margin: 0 auto 16px;
	border-radius: 50%;
	background: rgba(26,182,157,0.12);
	position: relative;
}

.bsp-highlight-icon::after {
	content: '';
	position: absolute;
	inset: 12px;
	background: var(--bsp-primary);
	border-radius: 50%;
	opacity: 0.35;
}

.bsp-highlight-label {
	font-weight: 600;
	font-size: var(--bsp-text-base);
	color: var(--bsp-text);
}

/* Filter */
.bsp-filter-bar {
	display: flex;
	flex-wrap: nowrap;
	gap: 10px;
	justify-content: flex-start;
	margin-bottom: clamp(24px, 4vw, 40px);
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding-bottom: 4px;
}

.bsp-filter-bar::-webkit-scrollbar {
	display: none;
}

.bsp-filter-btn {
	flex: 0 0 auto;
	padding: 12px 20px;
	border: 1px solid var(--bsp-border);
	background: #fff;
	border-radius: 5px;
	font-size: clamp(14px, 2.5vw, 16px);
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s;
	color: var(--bsp-text);
	min-height: var(--bsp-touch);
	white-space: nowrap;
}

.bsp-filter-btn:hover,
.bsp-filter-btn.is-active {
	background: var(--bsp-primary);
	border-color: var(--bsp-primary);
	color: #fff;
}

/* Masonry gallery */
.bsp-masonry {
	column-count: 3;
	column-gap: 24px;
}

.bsp-gallery-item {
	break-inside: avoid;
	margin-bottom: 24px;
	opacity: 1;
	transform: scale(1);
	transition: opacity 0.3s, transform 0.3s;
}

.bsp-gallery-item.is-hidden {
	display: none;
}

.bsp-gallery-trigger {
	display: block;
	width: 100%;
	padding: 0;
	border: none;
	background: none;
	cursor: pointer;
	position: relative;
	border-radius: 5px;
	overflow: hidden;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}

.bsp-gallery-trigger img {
	width: 100%;
	height: auto;
	display: block;
	vertical-align: middle;
}

.bsp-gallery-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 60%);
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 20px;
	text-align: left;
	opacity: 0;
	transition: opacity 0.25s;
	color: #fff;
}

.bsp-gallery-trigger:hover .bsp-gallery-overlay,
.bsp-gallery-trigger:focus .bsp-gallery-overlay {
	opacity: 1;
}

.bsp-gallery-cat {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	opacity: 0.85;
}

.bsp-gallery-overlay strong {
	font-size: 17px;
	margin-top: 6px;
}

.bsp-empty {
	text-align: center;
	color: var(--bsp-muted);
	padding: 48px 20px;
	background: var(--bsp-bg);
	border-radius: 5px;
}

/* Featured stories */
.bsp-stories-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
	gap: clamp(20px, 4vw, 36px);
}

.bsp-story-card {
	background: #fff;
	border: 1px solid var(--bsp-border);
	border-radius: 5px;
	overflow: hidden;
	transition: box-shadow 0.25s;
}

.bsp-story-card:hover {
	box-shadow: 0 12px 32px rgba(0,0,0,0.08);
}

.bsp-story-image img {
	width: 100%;
	height: clamp(200px, 40vw, 260px);
	object-fit: cover;
	display: block;
}

.bsp-story-body {
	padding: clamp(20px, 4vw, 28px);
}

.bsp-story-cat {
	font-size: 13px;
	font-weight: 600;
	color: var(--bsp-primary);
	text-transform: uppercase;
}

.bsp-story-body h3 {
	margin: 10px 0 14px;
	font-size: 1.4rem;
}

.bsp-story-body p {
	color: var(--bsp-muted);
	line-height: 1.65;
	margin: 0 0 14px;
	font-size: var(--bsp-text-base);
}

.bsp-story-body time {
	display: block;
	font-size: 14px;
	color: var(--bsp-muted);
	margin-bottom: 18px;
}

/* Video */
.bsp-video-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
	gap: clamp(16px, 3vw, 28px);
}

.bsp-video-card {
	position: relative;
	border: none;
	padding: 0;
	cursor: pointer;
	border-radius: 5px;
	overflow: hidden;
	background: var(--bsp-text);
	text-align: left;
}

.bsp-video-card img {
	width: 100%;
	aspect-ratio: 16/9;
	object-fit: cover;
	display: block;
	opacity: 0.85;
}

.bsp-video-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 64px;
	height: 64px;
	background: var(--bsp-primary);
	border-radius: 50%;
}

.bsp-video-play::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 54%;
	transform: translate(-50%, -50%);
	border: 10px solid transparent;
	border-left-color: #fff;
}

.bsp-video-title {
	display: block;
	padding: 14px 18px;
	color: #fff;
	font-weight: 600;
	font-size: 16px;
}

.bsp-video-modal {
	position: fixed;
	inset: 0;
	z-index: 999998;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s;
}

.bsp-video-modal.is-open {
	opacity: 1;
	visibility: visible;
}

.bsp-video-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.85);
}

.bsp-video-player-wrap {
	position: relative;
	width: 90%;
	max-width: 900px;
	z-index: 1;
}

.bsp-video-close {
	position: absolute;
	top: -40px;
	right: 0;
	background: none;
	border: none;
	color: #fff;
	font-size: 32px;
	cursor: pointer;
}

#bsp-video-embed {
	position: relative;
	padding-bottom: 56.25%;
	height: 0;
	background: #000;
}

#bsp-video-embed iframe,
#bsp-video-embed video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Testimonials */
.bsp-testimonials-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
	gap: clamp(16px, 3vw, 28px);
}

.bsp-testimonial-card {
	margin: 0;
	padding: clamp(20px, 4vw, 32px);
	background: #fff;
	border: 1px solid var(--bsp-border);
	border-radius: 5px;
}

.bsp-testimonial-photo img {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	object-fit: cover;
	margin-bottom: 18px;
}

.bsp-testimonial-text {
	font-style: italic;
	line-height: 1.75;
	color: var(--bsp-muted);
	margin: 0 0 18px;
	font-size: var(--bsp-text-base);
}

.bsp-testimonial-card cite {
	font-style: normal;
	font-weight: 700;
	color: var(--bsp-text);
}

.bsp-testimonial-meta {
	display: block;
	font-size: 14px;
	color: var(--bsp-muted);
	margin-top: 4px;
}

/* CTA */
.bsp-cta {
	background: var(--bsp-bg);
	text-align: center;
}

.bsp-cta-title {
	font-size: clamp(1.75rem, 3.5vw, 2.35rem);
	margin: 0 0 14px;
}

.bsp-cta-text {
	color: var(--bsp-muted);
	max-width: 620px;
	margin: 0 auto 32px;
	line-height: 1.75;
	font-size: var(--bsp-text-base);
}

.bsp-cta-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: center;
}

.bsp-cta-buttons .edu-btn {
	flex: 1 1 auto;
	min-width: min(100%, 220px);
	text-align: center;
}

/* Lightbox */
.bsp-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s;
}

.bsp-lightbox.is-open {
	opacity: 1;
	visibility: visible;
}

.bsp-lightbox-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.9);
}

.bsp-lightbox-panel {
	position: relative;
	z-index: 1;
	max-width: min(92vw, 900px);
	max-height: 90dvh;
	width: 100%;
	padding: 0 var(--bsp-container-x);
}

.bsp-lightbox-figure {
	margin: 0;
}

.bsp-lightbox-figure img {
	max-width: 100%;
	max-height: min(75dvh, 600px);
	width: auto;
	height: auto;
	display: block;
	margin: 0 auto;
	border-radius: 4px;
}

.bsp-lightbox-figure figcaption {
	color: #fff;
	text-align: center;
	padding: 18px 24px 0;
	font-size: 16px;
	line-height: 1.55;
}

.bsp-lightbox-close,
.bsp-lightbox-prev,
.bsp-lightbox-next {
	position: absolute;
	background: rgba(255,255,255,0.15);
	border: none;
	color: #fff;
	cursor: pointer;
	border-radius: 4px;
	transition: background 0.2s;
	min-width: var(--bsp-touch);
	min-height: var(--bsp-touch);
	display: flex;
	align-items: center;
	justify-content: center;
}

.bsp-lightbox-close {
	top: -48px;
	right: 0;
	font-size: 28px;
	width: 40px;
	height: 40px;
}

.bsp-lightbox-prev,
.bsp-lightbox-next {
	top: 50%;
	transform: translateY(-50%);
	font-size: 36px;
	width: 48px;
	height: 48px;
}

.bsp-lightbox-prev { left: -60px; }
.bsp-lightbox-next { right: -60px; }

.bsp-lightbox-close:hover,
.bsp-lightbox-prev:hover,
.bsp-lightbox-next:hover {
	background: var(--bsp-primary);
}

/* EduBlink button fallbacks inside portfolio */
.bsp-portfolio-wrap .edu-btn.btn-medium {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: clamp(14px, 3vw, 18px) clamp(24px, 5vw, 36px);
	font-size: clamp(15px, 2.8vw, 17px);
	font-weight: 600;
	border-radius: 5px;
	text-decoration: none;
	transition: all 0.25s;
	min-height: var(--bsp-touch);
}

.bsp-edublink .bsp-portfolio-wrap .edu-btn.btn-medium,
.bsp-portfolio-page .edu-btn.btn-medium {
	background: var(--bsp-primary);
	color: #fff !important;
	border: 2px solid var(--bsp-primary);
}

.bsp-portfolio-wrap .edu-btn.btn-border.btn-medium {
	background: transparent;
	color: var(--bsp-primary) !important;
	border: 2px solid var(--bsp-primary);
}

@media (min-width: 768px) {
	.bsp-filter-bar {
		flex-wrap: wrap;
		justify-content: center;
		overflow-x: visible;
	}
}

@media (max-width: 900px) {
	.bsp-masonry { column-count: 2; column-gap: 16px; }
	.bsp-gallery-item { margin-bottom: 16px; }
	.bsp-lightbox-prev { left: 4px; }
	.bsp-lightbox-next { right: 4px; }
	.bsp-lightbox-close { top: 8px; right: 8px; }
	.bsp-video-player-wrap { width: 95%; }
	.bsp-video-close { top: -36px; font-size: 28px; min-width: var(--bsp-touch); min-height: var(--bsp-touch); }
}

@media (max-width: 600px) {
	.bsp-masonry { column-count: 1; }
	.bsp-hero { min-height: clamp(240px, 55vw, 320px); max-height: none; }
	.bsp-highlight-item { padding: 24px 16px; }
	.bsp-gallery-overlay {
		opacity: 1;
		padding: 14px;
		background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 70%);
	}
	.bsp-gallery-overlay strong { font-size: 15px; }
	.bsp-story-body h3 { font-size: clamp(1.2rem, 4vw, 1.4rem); }
	.bsp-story-body .edu-btn,
	.bsp-cta-buttons .edu-btn {
		width: 100%;
	}
	.bsp-cta-buttons {
		flex-direction: column;
		align-items: stretch;
		padding: 0 var(--bsp-container-x);
	}
	.bsp-lightbox-prev,
	.bsp-lightbox-next {
		top: auto;
		bottom: -56px;
		transform: none;
		width: var(--bsp-touch);
		height: var(--bsp-touch);
		font-size: 24px;
	}
	.bsp-lightbox-prev { left: calc(50% - 52px); }
	.bsp-lightbox-next { right: calc(50% - 52px); left: auto; }
	.bsp-lightbox-close {
		top: max(12px, env(safe-area-inset-top));
		right: max(12px, env(safe-area-inset-right));
	}
	.bsp-lightbox-figure figcaption {
		font-size: 14px;
		padding: 12px 8px 48px;
	}
}

@media (hover: hover) and (pointer: fine) {
	.bsp-gallery-overlay { opacity: 0; }
	.bsp-gallery-trigger:hover .bsp-gallery-overlay,
	.bsp-gallery-trigger:focus .bsp-gallery-overlay { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.bsp-gallery-item,
	.bsp-gallery-overlay,
	.bsp-lightbox,
	.bsp-video-modal { transition: none; }
}
