@view-transition { navigation: auto; }

:root {
	--gallery-accent: #376098;
	--gallery-accent-strong: #234a7d;
	--gallery-warm: #b45f38;
	--gallery-panel: #f6f7f9;
	--gallery-panel-strong: #eef1f5;
	--gallery-border: rgba(44, 58, 76, 0.15);
	--gallery-shadow: 0 20px 55px rgba(38, 47, 61, 0.11);
}

.gallery-page .container { max-width: 64rem; }
.gallery-page h1, .gallery-page h2, .gallery-page h3 { text-transform: none; text-shadow: none; letter-spacing: -0.025em; }
.gallery-page h1 { font-size: clamp(2.5rem, 6vw, 4.8rem); line-height: 0.98; }
.gallery-page h2 { border: 0; }

.gallery-hero { max-width: 49rem; margin: 1rem auto 5rem; text-align: center; }
.gallery-hero h1 { margin: 0.15em 0 0.3em; text-align: center; }
.gallery-hero-summary { max-width: 42rem; margin: 0 auto; color: var(--secondary-text-color); font-size: clamp(1.05rem, 2vw, 1.28rem); line-height: 1.55; }
.gallery-eyebrow { margin: 0; color: var(--gallery-warm); font-size: 0.75rem; font-weight: 750; letter-spacing: 0.13em; line-height: 1.2; text-transform: uppercase; }

.gallery-not-found { margin: 0 auto 3rem; padding: 1.1rem 1.3rem; max-width: 44rem; border: 1px solid #d99981; border-radius: 12px; background: rgba(180, 95, 56, 0.08); }
.gallery-not-found h2 { margin: 0 0 0.35rem; font-size: 1.1rem; }
.gallery-not-found p { margin: 0; color: var(--secondary-text-color); }

.gallery-list { max-width: 60rem; margin: 0 auto; }
.gallery-list-item { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(22rem, 1.08fr); gap: clamp(2rem, 7vw, 5.8rem); align-items: center; padding: clamp(2.8rem, 7vw, 5.5rem) 0; border-top: 1px solid var(--gallery-border); }
.gallery-list-item:last-child { border-bottom: 1px solid var(--gallery-border); }
.gallery-list-copy h2 { margin: 0.3rem 0 1rem; padding: 0; text-align: left; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.03; }
.gallery-list-copy h2 a { color: var(--text-color); text-decoration: none; }
.gallery-list-copy h2 a:hover { color: var(--gallery-accent); }
.gallery-list-copy > p { margin: 0 0 1.2rem; color: var(--secondary-text-color); font-size: clamp(1rem, 1.8vw, 1.18rem); line-height: 1.5; }
.gallery-list-meta { color: var(--meta-text-color); font-size: 0.75rem; font-weight: 650; letter-spacing: 0.035em; text-transform: uppercase; }
.gallery-list-more { display: inline-block; margin-top: 1.35rem; color: var(--gallery-accent); font-size: 0.88rem; font-weight: 700; text-decoration: none; }
.gallery-list-more:hover { text-decoration: underline; }
.gallery-list-visual { display: block; overflow: hidden; border: 1px solid var(--gallery-border); border-radius: 3px; background: #f4f4f4; box-shadow: var(--gallery-shadow); transition: transform 180ms ease, box-shadow 180ms ease; }
.gallery-list-visual:hover { transform: translateY(-3px); box-shadow: 0 24px 65px rgba(38, 47, 61, 0.16); }
.gallery-list-visual img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
.gallery-list-item:first-child .gallery-list-visual img { object-position: center top; }

.gallery-badges { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.gallery-badge { display: inline-flex; align-items: center; min-height: 1.65rem; padding: 0.18rem 0.62rem; border: 1px solid var(--gallery-border); border-radius: 999px; background: var(--gallery-panel); color: var(--secondary-text-color); font-size: 0.69rem; font-weight: 670; line-height: 1.2; }
.gallery-badge.safe { border-color: rgba(31, 122, 75, 0.28); background: rgba(31, 122, 75, 0.09); color: #17633b; }
.gallery-badge.live { border-color: rgba(55, 96, 152, 0.3); background: rgba(55, 96, 152, 0.09); color: #2d568b; }

.gallery-breadcrumb { display: flex; gap: 0.55rem; align-items: center; margin: 0 0 3rem; color: var(--meta-text-color); font-size: 0.78rem; }
.gallery-breadcrumb a { color: var(--gallery-accent); text-decoration: none; }
.gallery-breadcrumb a:hover { text-decoration: underline; }
.gallery-detail-header {
	position: static;
	z-index: auto !important;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 12rem;
	gap: 4rem;
	align-items: end;
	padding-bottom: 1.8rem;
	background: transparent;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
}
.gallery-detail-heading h1 { margin: 0.18em 0 0.25em; text-align: left; }
.gallery-detail-summary { max-width: 46rem; margin: 0; color: var(--secondary-text-color); font-size: clamp(1.08rem, 2vw, 1.32rem); line-height: 1.5; }
.gallery-detail-meta { display: grid; gap: 0.8rem; margin: 0; }
.gallery-detail-meta div { padding-bottom: 0.65rem; border-bottom: 1px solid var(--gallery-border); }
.gallery-detail-meta dt { color: var(--meta-text-color); font-size: 0.65rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; }
.gallery-detail-meta dd { margin: 0.18rem 0 0; font-size: 0.86rem; }
.gallery-detail-badges { padding: 1rem 0 2rem; border-top: 1px solid var(--gallery-border); }

.gallery-prerequisite { display: flex; justify-content: space-between; gap: 2rem; align-items: center; margin: 0 0 1.2rem; padding: 1.2rem 1.35rem; border: 1px solid rgba(55, 96, 152, 0.28); border-radius: 12px; background: rgba(55, 96, 152, 0.07); }
.gallery-prerequisite strong { color: var(--gallery-accent-strong); font-size: 0.95rem; }
.gallery-prerequisite p { max-width: 45rem; margin: 0.22rem 0 0; color: var(--secondary-text-color); font-size: 0.85rem; line-height: 1.45; }
.gallery-prerequisite .gallery-text-link { margin-left: 0; white-space: nowrap; }
.gallery-prerequisite .gallery-secondary-button { flex: 0 0 auto; min-width: 7rem; white-space: nowrap; }
.gallery-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin: 0 0 4rem; }
.gallery-primary-button, .gallery-secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.55rem; box-sizing: border-box; padding: 0.55rem 1rem; border-radius: 8px; font-size: 0.82rem; font-weight: 700; line-height: 1.2; text-decoration: none; }
.gallery-primary-button { border: 1px solid var(--gallery-accent-strong); background: var(--gallery-accent); color: #fff; }
.gallery-primary-button:hover { background: var(--gallery-accent-strong); color: #fff; }
.gallery-primary-button .gallery-download-size { position: relative; top: 0.08rem; margin-left: 0.5rem; opacity: 0.75; font-size: 0.7rem; }
.gallery-secondary-button { border: 1px solid var(--gallery-border); background: var(--gallery-panel); color: var(--text-color); }
.gallery-secondary-button:hover { border-color: rgba(55, 96, 152, 0.45); color: var(--gallery-accent); }
.gallery-text-link { margin-left: 0.2rem; color: var(--gallery-accent); font-size: 0.78rem; font-weight: 650; text-decoration: none; }
.gallery-text-link:hover { text-decoration: underline; }

.media-gallery { margin: 0 calc(50% - 50vw) 5rem; padding: 3rem max(2rem, calc(50vw - 32rem)); background: var(--gallery-panel); border-top: 1px solid var(--gallery-border); border-bottom: 1px solid var(--gallery-border); }
.gallery-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 2rem; margin-bottom: 1rem; }
.gallery-section-heading h2 { margin: 0; padding: 0; text-align: left; font-size: clamp(1.65rem, 3vw, 2.25rem); }
.gallery-section-heading > span { color: var(--meta-text-color); font-size: 0.75rem; }
.media-gallery-controls { display: flex; gap: 0.45rem; }
.media-gallery-control { width: 2rem; height: 2rem; padding: 0; border: 0; border-radius: 999px; background-color: #dde2e8; background-position: center; background-repeat: no-repeat; background-size: 46%; cursor: pointer; }
.media-gallery-control.prev { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233d4856' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E"); }
.media-gallery-control.next { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233d4856' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E"); }
.media-gallery-control:disabled { opacity: 0.36; cursor: default; }
.media-gallery-track { display: flex; gap: 1.25rem; overflow-x: auto; overscroll-behavior-inline: contain; padding: 0.3rem 0 1rem; scroll-behavior: smooth; scroll-snap-type: x mandatory; scrollbar-color: #9aa2ac transparent; }
.media-gallery-card { flex: 0 0 min(72vw, 36rem); margin: 0; scroll-snap-align: start; }
.media-gallery-open { display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; text-align: inherit; }
.media-gallery-frame { position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; width: 100%; aspect-ratio: 16 / 10; border: 1px solid var(--gallery-border); border-radius: 10px; background: #fff; }
.media-gallery-frame img, .media-gallery-frame video { display: block; width: 100%; height: 100%; object-fit: contain; }
.media-gallery-card p { margin: 0.75rem 0.5rem 0; color: var(--secondary-text-color); font-size: 0.8rem; line-height: 1.4; }
.media-play { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 3.5rem; height: 3.5rem; padding-left: 0.15rem; border-radius: 999px; transform: translate(-50%, -50%); background: rgba(0, 0, 0, 0.68); color: #fff; font-size: 1.2rem; }

.gallery-markdown { max-width: 46rem; margin: 0 auto 5rem; font-size: 0.98rem; line-height: 1.7; }
.gallery-markdown h2 { margin: 2.5rem 0 0.8rem; padding: 0; text-align: left; font-size: clamp(1.55rem, 3vw, 2.1rem); line-height: 1.16; }
.gallery-markdown h3 { margin: 2rem 0 0.6rem; font-size: 1.2rem; }
.gallery-markdown p { margin: 0.75rem 0 1rem; }
.gallery-markdown li { margin: 0.32rem 0; }
.gallery-markdown a { color: var(--gallery-accent); }
.gallery-markdown code { padding: 0.12em 0.3em; border-radius: 4px; background: var(--gallery-panel-strong); font-size: 0.83em; }
.gallery-markdown pre { overflow: auto; margin: 1.2rem 0; border: 1px solid var(--gallery-border); border-radius: 9px; background: #f6f8fa; }
.gallery-markdown pre code { display: block; padding: 1rem 1.1rem; background: transparent; font-size: 0.78rem; line-height: 1.55; }
.gallery-code-shell { position: relative; margin: 1.2rem 0; }
.gallery-markdown .gallery-code-shell pre, .gallery-source-file .gallery-code-shell pre { margin: 0; }
.gallery-source-file .gallery-code-shell { margin: 0; }
.gallery-copy-code {
	position: absolute;
	top: 0.55rem;
	right: 0.55rem;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 1.8rem;
	height: 1.8rem;
	padding: 0;
	border: 1px solid var(--gallery-border);
	border-radius: 6px;
	background: var(--background-color);
	color: var(--secondary-text-color);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
	cursor: pointer;
	opacity: 0;
	transition: opacity 120ms ease, color 120ms ease, border-color 120ms ease;
}
.gallery-copy-code:before {
	width: 0.9rem;
	height: 0.9rem;
	background: currentColor;
	content: "";
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='14' height='14' x='8' y='8' rx='2'/%3E%3Cpath d='M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='14' height='14' x='8' y='8' rx='2'/%3E%3Cpath d='M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2'/%3E%3C/svg%3E") center / contain no-repeat;
}
.gallery-code-shell:hover .gallery-copy-code, .gallery-copy-code:focus-visible, .gallery-copy-code.copied, .gallery-copy-code.copy-failed { opacity: 1; }
.gallery-copy-code:hover { border-color: var(--gallery-accent); color: var(--gallery-accent); }
.gallery-copy-code:focus-visible { outline: 2px solid var(--gallery-accent); outline-offset: 2px; }
.gallery-copy-code.copied { border-color: #24935c; color: #167747; }
.gallery-copy-code.copied:before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 4 4L19 6'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 4 4L19 6'/%3E%3C/svg%3E");
}
.gallery-copy-code.copy-failed { border-color: #b43b3b; color: #a52f2f; }
.gallery-markdown blockquote { margin: 1.3rem 0; padding: 0.2rem 0 0.2rem 1.2rem; border-left: 3px solid #aeb8c5; color: var(--secondary-text-color); }
.markdown-callout { display: grid; grid-template-columns: 6.5rem 1fr; gap: 1rem; margin: 1.5rem 0; padding: 1rem 1.1rem; border: 1px solid rgba(55, 96, 152, 0.25); border-radius: 9px; background: rgba(55, 96, 152, 0.07); }
.markdown-callout.warning, .markdown-callout.caution { border-color: rgba(176, 113, 19, 0.32); background: rgba(176, 113, 19, 0.08); }
.markdown-callout-label { color: var(--gallery-accent); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; }
.markdown-callout.warning .markdown-callout-label, .markdown-callout.caution .markdown-callout-label { color: #8c570c; }
.markdown-callout p { margin: 0; }

.gallery-source { margin: 5rem 0; padding-top: 4rem; border-top: 1px solid var(--gallery-border); scroll-margin-top: 1rem; }
.gallery-source-intro { max-width: 42rem; margin: 0 0 1.5rem; color: var(--secondary-text-color); font-size: 0.9rem; }
.gallery-source-files { overflow: hidden; border: 1px solid var(--gallery-border); border-radius: 10px; }
.gallery-source-file { border-bottom: 1px solid var(--gallery-border); background: var(--background-color); }
.gallery-source-file:last-child { border-bottom: 0; }
.gallery-source-file summary { display: flex; justify-content: space-between; gap: 2rem; align-items: center; padding: 0.72rem 1rem; cursor: pointer; list-style-position: inside; }
.gallery-source-file summary code { font-size: 0.72rem; font-weight: 620; }
.gallery-source-file summary span { color: var(--meta-text-color); font-size: 0.67rem; }
.gallery-source-file pre { max-height: 34rem; overflow: auto; margin: 0; border-top: 1px solid var(--gallery-border); background: #f6f8fa; }
.gallery-source-file pre code { display: block; padding: 1rem; background: transparent; font-size: 0.7rem; line-height: 1.5; }
.gallery-checksum { display: grid; grid-template-columns: auto 1fr; gap: 0.8rem; margin-top: 1rem; align-items: baseline; color: var(--meta-text-color); font-size: 0.68rem; }
.gallery-checksum code { overflow-wrap: anywhere; }


.gallery-lightbox { width: min(92vw, 88rem); height: min(90vh, 60rem); margin: auto; padding: 0; border: 0; border-radius: 12px; background: #11161d; color: #fff; box-shadow: 0 30px 120px rgba(0, 0, 0, 0.55); }
.gallery-lightbox:focus { outline: none; }
.gallery-lightbox::backdrop { background: rgba(3, 7, 12, 0.82); backdrop-filter: blur(8px); }
.gallery-lightbox-stage { position: absolute; inset: 2.8rem 4.5rem 4.2rem; display: flex; align-items: center; justify-content: center; }
.gallery-lightbox-stage img, .gallery-lightbox-stage video { max-width: 100%; max-height: 100%; object-fit: contain; }
.gallery-lightbox-close, .gallery-lightbox-nav { position: absolute; z-index: 2; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.13); color: #fff; cursor: pointer; }
.gallery-lightbox-close:focus-visible, .gallery-lightbox-nav:focus-visible { outline: 2px solid #8fc4ff; outline-offset: 3px; }
.gallery-lightbox-close { top: 0.8rem; right: 0.8rem; width: 2rem; height: 2rem; font-size: 1.3rem; line-height: 1; }
.gallery-lightbox-nav { top: 50%; width: 2.5rem; height: 2.5rem; transform: translateY(-50%); font-size: 2rem; line-height: 1; }
.gallery-lightbox-nav.prev { left: 0.75rem; }
.gallery-lightbox-nav.next { right: 0.75rem; }
.gallery-lightbox-caption { position: absolute; right: 2rem; bottom: 0.8rem; left: 2rem; margin: 0; color: rgba(255, 255, 255, 0.83); font-size: 0.78rem; text-align: center; }

@media (max-width: 760px) {
	.gallery-page section.content { padding-left: 1.3rem; padding-right: 1.3rem; }
	.gallery-hero { margin-bottom: 3rem; }
	.gallery-list-item { grid-template-columns: 1fr; gap: 1.8rem; }
	.gallery-list-copy { grid-row: 2; }
	.gallery-list-visual { grid-row: 1; }
	.gallery-detail-header { grid-template-columns: 1fr; gap: 1.8rem; }
	.gallery-detail-meta { grid-template-columns: repeat(3, 1fr); }
	.gallery-prerequisite { align-items: flex-start; flex-direction: column; gap: 1rem; }
	.media-gallery { padding-right: 1.3rem; padding-left: 1.3rem; }
	.media-gallery-card { flex-basis: 84vw; }
	.markdown-callout { grid-template-columns: 1fr; gap: 0.35rem; }
	.gallery-lightbox-stage { right: 1rem; left: 1rem; }
}

@media (hover: none) {
	.gallery-copy-code { opacity: 0.82; }
}

@media (prefers-color-scheme: dark) {
	:root {
		--gallery-accent: #82b0eb;
		--gallery-accent-strong: #b1cff4;
		--gallery-warm: #e99570;
		--gallery-panel: #202731;
		--gallery-panel-strong: #29323e;
		--gallery-border: rgba(164, 177, 195, 0.2);
		--gallery-shadow: 0 20px 55px rgba(0, 0, 0, 0.32);
	}
	.gallery-badge.safe { color: #7fe0aa; }
	.gallery-badge.live { color: #9bc6fb; }
	.markdown-callout.warning .markdown-callout-label, .markdown-callout.caution .markdown-callout-label { color: #efbd72; }
	.gallery-list-visual, .media-gallery-frame { background: #171c23; }
	.media-gallery-control { background-color: #3a4452; }
	.media-gallery-control.prev { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f2f5f8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E"); }
	.media-gallery-control.next { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f2f5f8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E"); }
	.gallery-markdown pre, .gallery-source-file pre { background: #0d1117; }
	.gallery-copy-code.copied { color: #73d7a4; }
	.gallery-copy-code.copy-failed { color: #ff9292; }
}

@media (prefers-reduced-motion: reduce) {
	.gallery-list-visual { transition: none; }
	.media-gallery-track { scroll-behavior: auto; }
}
