/*
Theme Name: Bonzon Studio
Theme URI: https://bonzon.tw
Author: Bonzon Studio
Description: Portfolio theme for Bonzon Studio — black, work-first, Archivo. Home with per-project slideshows, Info page, and case studies built from block patterns.
Version: 1.8.4
Requires at least: 6.3
Requires PHP: 7.4
License: All rights reserved
Text Domain: bonzon
*/

/* ---------- Tokens ---------- */
:root {
	--bg: #000000;
	--fg: #F2F2F2;
	--grey: #8C8C8C;
	--grey-2: #B3B3B3;
	--tile: #161616;
	--rule: rgba(242, 242, 242, 0.2);
	--rule-soft: rgba(242, 242, 242, 0.12);
	--pill: rgba(242, 242, 242, 0.08);
	--g: 24px;          /* gutter */
	--gap: 24px;        /* column gap */
	--header: 72px;
	--font: 'Archivo', system-ui, sans-serif;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--fg);
	font-family: var(--font);
	font-size: 14px;
	line-height: 1.4;
	-webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--grey-2); }
img, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 300; }

/* ---------- Shared type ---------- */
.bz-label { font-size: 11px; letter-spacing: .02em; color: var(--grey); }
.bz-small { font-size: 10px; letter-spacing: .02em; color: var(--grey); }
.bz-body { font-size: 20px; line-height: 1.5; font-weight: 300; color: var(--grey); max-width: 820px; }
.bz-h1 { font-stretch: 112%; font-weight: 300; font-size: 104px; line-height: 1; }
.bz-h2 { font-stretch: 112%; font-weight: 300; font-size: 52px; line-height: 1.1; }
.bz-rule { border-top: 1px solid var(--rule); padding-top: 16px; }
.bz-pill { display: inline-block; font-size: 13px; padding: 6px 14px; background: var(--pill); border-radius: 4px; }
.bz-logo { display: inline-flex; align-items: center; color: var(--fg); line-height: 0; }
.bz-logo svg { display: block; height: 14px; width: auto; }

/* 3-column row: label | content (span 2) */
.bz-row {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: var(--gap);
	padding: 0 var(--g);
}
.bz-row > :nth-child(2) { grid-column: span 2; }

/* Visually hidden, still read by search engines & screen readers */
.bz-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------- Header ---------- */
.bz-header {
	height: var(--header);
	padding: 0 var(--g);
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: var(--gap);
	align-items: center;
	font-size: 14px;
}
.bz-nav { letter-spacing: .02em; color: var(--grey); }
.bz-nav.is-active, .bz-nav:hover { color: var(--fg); }
.bz-nav--works { grid-column: 1; grid-row: 1; justify-self: start; }
.bz-header .bz-logo { grid-column: 2; grid-row: 1; justify-self: center; }
.bz-nav--info { grid-column: 3; grid-row: 1; justify-self: end; }
.bz-header .bz-logo:hover { color: var(--fg); }
.bz-burger { display: none; }

/* Mobile menu overlay */
.bz-menu {
	position: fixed; inset: 0; z-index: 100000;
	background: var(--bg);
	display: flex; flex-direction: column;
	opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s;
}
body.bz-menu-open { overflow: hidden; }
body.bz-menu-open .bz-menu { opacity: 1; visibility: visible; }
.bz-menu__top { height: 56px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.bz-close { width: 44px; height: 44px; margin-right: -8px; position: relative; z-index: 2; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.bz-close span { pointer-events: none; }
.bz-burger { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
/* Logged-in: keep the menu below the WordPress admin bar so the close button stays tappable */
body.admin-bar .bz-menu { top: 46px; }
@media (min-width: 783px) { body.admin-bar .bz-menu { top: 32px; } }
.bz-close span { position: absolute; right: 11px; top: 21px; width: 22px; height: 1px; background: var(--fg); transform: rotate(45deg); }
.bz-close span + span { transform: rotate(-45deg); }
.bz-menu__nav { flex: 1; padding: 48px 16px 0; display: flex; flex-direction: column; }
.bz-menu__nav a {
	font-stretch: 112%; font-weight: 300; font-size: 44px; line-height: 1;
	padding: 20px 0; border-top: 1px solid var(--rule); color: var(--grey);
}
.bz-menu__nav a:last-child { border-bottom: 1px solid var(--rule); }
.bz-menu__nav a.is-active, .bz-menu__nav a:active, .bz-menu__nav a:hover { color: var(--fg); }
.bz-menu__foot { padding: 0 16px 32px; display: flex; flex-direction: column; gap: 12px; font-size: 13px; }
.bz-menu__foot a { color: var(--grey); }
.bz-menu__foot a:hover, .bz-menu__foot a:active { color: var(--fg); }
.bz-menu__foot div { display: flex; gap: 16px; }

/* ---------- Home: hero ---------- */
.bz-hero {
	position: relative;
	height: min(840px, calc(100vh - var(--header)));
	min-height: 480px;
	background: #111111;
	display: flex; flex-direction: column; justify-content: flex-end;
	overflow: hidden;
}
.bz-hero__track {
	position: absolute; inset: 0;
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	cursor: grab;
}
.bz-hero__track::-webkit-scrollbar { display: none; }
.bz-hero__track.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.bz-hero__slide { position: relative; overflow: hidden; flex: 0 0 100%; height: 100%; scroll-snap-align: start; display: block; background: #111111; }
.bz-hero__slide video, .bz-hero__slide img { width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; pointer-events: none; }
/* Video keeps its original ratio (e.g. a vertical reel) with black bars on the sides */
.bz-hero__video { display: block; object-fit: cover; background: #000; }
/* Vertical (portrait) films are shown whole instead of being cropped to a thin band. */
.bz-hero__video.is-portrait { object-fit: contain; }
/* Photo slides: the project's images cross-fade */
.bz-hero__imgs { position: absolute; inset: 0; }
.bz-hero__imgs img { position: absolute; inset: 0; object-fit: cover; opacity: 0; transition: opacity .9s ease; }
.bz-hero__imgs img.is-on { opacity: 1; }
.bz-hero__slide::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 180px; background: linear-gradient(to top, rgba(0,0,0,.45), rgba(0,0,0,0)); pointer-events: none; }
.bz-hero__track { z-index: 0; }
.bz-hero__list {
	position: relative; z-index: 1; pointer-events: none;
	padding: 0 var(--g) 32px;
	display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--gap);
}
.bz-hero__item {
	position: relative;
	border-top: 1px solid rgba(242, 242, 242, .3);
	padding-top: 12px;
	display: flex; flex-direction: column; gap: 4px;
	color: var(--grey);
}
.bz-hero__item::before {
	content: ''; position: absolute; left: 0; top: -1px; height: 1px; width: 100%;
	background: var(--fg); transform: scaleX(0); transform-origin: left;
}
.bz-hero__item.is-active { color: var(--fg); }
.bz-hero__item.is-active::before { animation: bz-progress var(--bz-interval, 5000ms) linear forwards; }
button.bz-hero__item { pointer-events: auto; text-align: left; width: 100%; cursor: pointer; }
button.bz-hero__item:hover { color: var(--fg); }
.bz-hero__item.is-soon { opacity: .7; }
@keyframes bz-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.bz-hero__name { font-size: 14px; }
.bz-hero__cat { font-size: 10px; letter-spacing: .02em; color: var(--grey-2); }
.bz-hero__item:not(.is-active) .bz-hero__cat { color: inherit; }

/* ---------- Home: selected work ---------- */
.bz-work { padding: 20px var(--g); display: flex; flex-direction: column; gap: 30px; }
.bz-work__head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 0; margin-bottom: -14px; }
.bz-project { display: flex; flex-direction: column; gap: 16px; }
.bz-slider { position: relative; border-radius: 4px; overflow: hidden; background: #000; }
.bz-slider__track {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	cursor: grab;
}
.bz-slider__track::-webkit-scrollbar { display: none; }
.bz-slider__track.is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.bz-slide { flex: 0 0 100%; scroll-snap-align: start; aspect-ratio: 1392 / 720; display: block; background: #000; }
/* Whole image always visible (no cropping); empty space is black, like the hero film. */
.bz-slide img { width: 100%; height: 100%; object-fit: contain; object-position: center; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.bz-bars { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 8px; }
.bz-bar { height: 12px; position: relative; }
.bz-bar::before { content: ''; position: absolute; left: 0; right: 0; top: 5px; height: 2px; background: rgba(242, 242, 242, .2); transition: background .2s; }
.bz-bar.is-active::before { background: var(--fg); }
.bz-bars { margin: -5px 0; }
.bz-project__caption { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.bz-project__caption .bz-small { text-align: right; }
.bz-project__name { font-size: 14px; }

/* ---------- Works: all projects ---------- */
.bz-archive { padding: 20px var(--g) 120px; display: flex; flex-direction: column; gap: 30px; }
.bz-archive__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: -14px; }
.bz-archive__head h1 { margin: 0; font-weight: inherit; }
.bz-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 48px var(--gap); }
.bz-card { display: flex; flex-direction: column; gap: 16px; }
.bz-card__media { aspect-ratio: 7 / 4; border-radius: 4px; overflow: hidden; background: var(--tile); display: flex; align-items: center; justify-content: center; }
/* Whole image visible (no cropping), like the Selected Work slides. */
.bz-card__media img { width: 100%; height: 100%; object-fit: contain; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
a.bz-card:hover .bz-card__media img { transform: scale(1.04); }
a.bz-card:hover .bz-project__name { color: var(--fg); }

/* ---------- Home: expertise ---------- */
.bz-expertise { padding-bottom: 120px; }
.bz-expertise__list { padding-top: 0; display: flex; flex-direction: column; }
.bz-expertise__row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 32px 0; border-bottom: 1px solid var(--rule-soft); }
.bz-expertise__name { font-stretch: 112%; font-weight: 300; font-size: 46px; line-height: 1; color: var(--grey); }

/* ---------- Contact ---------- */
.bz-contact { min-height: 300px; align-content: start; }
.bz-contact__email { font-stretch: 112%; font-weight: 300; font-size: 104px; line-height: 1; overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.bz-footer {
	min-height: 200px;
	padding: var(--g);
	border-top: 1px solid var(--rule);
	display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--gap);
	align-items: start;
	color: var(--grey);
}
.bz-footer a { color: var(--grey); }
.bz-footer a:hover, .bz-footer a:active { color: var(--fg); }
.bz-footer__col { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.bz-footer__label, .bz-footer__copy { font-size: 9px; letter-spacing: .02em; }
.bz-footer__links { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.bz-footer .bz-pill { font-size: 12px; }
.bz-footer__text { font-size: 12px; }

/* ---------- Case study ---------- */
.bz-case-head { min-height: 720px; padding: 120px 0 64px; display: flex; flex-direction: column; justify-content: space-between; gap: 64px; }
.bz-case-head__title { display: flex; flex-direction: column; gap: 32px; }
.bz-back { align-self: start; }
.bz-back:hover { color: var(--fg); }
.bz-case-meta { margin: 0 var(--g); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.bz-case-meta > div { display: flex; flex-direction: column; gap: 8px; }
.bz-case-meta__v { font-size: 14px; line-height: 1.4; }
.bz-case-hero { margin: 0; padding: 0 var(--g) var(--g); }
.bz-case-hero img { display: block; width: 100%; height: auto; border-radius: 4px; background: var(--tile); }

/* Block content (case studies + pages) */
.bz-content .wp-block-group__inner-container { display: contents; }
.bz-content > * { margin: 0; }
.bz-text {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: var(--gap);
	padding: 120px var(--g);
	align-content: start;
}
.bz-text > *, .bz-text > .wp-block-group__inner-container > * { grid-column: 2 / span 2; margin: 0; }
.bz-text > .bz-label, .bz-text > .wp-block-group__inner-container > .bz-label { grid-column: 1; grid-row: 1 / span 20; align-self: start; border-top: 1px solid var(--rule); padding-top: 16px; }
.bz-text > .bz-h2, .bz-text > .wp-block-group__inner-container > .bz-h2, .bz-text > h2, .bz-text > .wp-block-group__inner-container > h2 { border-top: 1px solid var(--rule); padding-top: 16px; font-stretch: 112%; font-weight: 300; font-size: 52px; line-height: 1.1; margin-bottom: 32px; }
.bz-text > p:not(.bz-label), .bz-text > .wp-block-group__inner-container > p:not(.bz-label) { font-size: 20px; line-height: 1.5; font-weight: 300; color: var(--grey); max-width: 820px; }
.bz-text > p:not(.bz-label) + p, .bz-text > .wp-block-group__inner-container > p:not(.bz-label) + p { margin-top: 28px; }
.bz-text a { text-decoration: underline; text-underline-offset: 3px; }
.bz-text--first > .bz-label, .bz-text--first > .wp-block-group__inner-container > .bz-label, .bz-text--first > .bz-h2, .bz-text--first > .wp-block-group__inner-container > .bz-h2, .bz-text--first > h2, .bz-text--first > .wp-block-group__inner-container > h2 { border-top: 0; padding-top: 0; }
.bz-page > .bz-text + .bz-text { padding-top: 0; }

.bz-img-full, .bz-img-pair, .bz-img-trio { padding: 0 var(--g) var(--g); display: flex; align-items: flex-start; gap: var(--gap); }
/* Behance-style: every image keeps its original proportion (no cropping).
   Side-by-side images share one row height; widths follow each image's ratio (--r, set in main.js). */
.bz-img-full > figure, .bz-img-pair > figure, .bz-img-trio > figure,
.bz-img-full > .wp-block-group__inner-container > figure, .bz-img-pair > .wp-block-group__inner-container > figure, .bz-img-trio > .wp-block-group__inner-container > figure { flex: var(--r, 1) 1 0; min-width: 0; }
/* Full-width and three-image blocks: always stacked vertically, each full width (even if more images are dropped in) */
.bz-img-full, .bz-img-trio { flex-direction: column; align-items: stretch; }
.bz-img-full figure, .bz-img-trio figure { flex: none !important; width: 100%; }
.bz-content figure.wp-block-image { margin: 0; }
.bz-content figure.wp-block-image img { display: block; width: 100%; height: auto; border-radius: 4px; background: var(--tile); }
.bz-content figure.wp-block-image:has(img:not([src])),
.bz-content figure.wp-block-image:has(img[src=""]) { display: none; }
.bz-content figcaption { font-size: 10px; color: var(--grey); margin-top: 8px; }
/* Plain images placed outside our groups */
.bz-content > figure.wp-block-image { padding: 0 var(--g) var(--g); }
.bz-content > .wp-block-video, .bz-content > .wp-block-embed { margin: 0 var(--g) var(--g); }

.bz-next { height: 240px; display: flex; align-items: center; justify-content: center; padding: 0 var(--g); }
.bz-next a { font-stretch: 112%; font-weight: 300; font-size: 52px; line-height: 1; text-align: center; }


/* ---------- Videos + sound button ---------- */
.bz-sound {
	font-size: 11px; letter-spacing: .02em; color: var(--grey);
	padding: 6px 12px; border-radius: 4px; background: rgba(0, 0, 0, .45);
	-webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
	transition: color .2s ease;
}
.bz-sound:hover, .bz-sound[aria-pressed="true"] { color: var(--fg); }
.bz-sound[hidden] { display: none; }
.bz-hero__sound { position: absolute; z-index: 2; right: var(--g); top: 24px; }

.bz-content figure.wp-block-video { position: relative; margin: 0 var(--g) var(--g); background: #000; border-radius: 4px; overflow: hidden; }
.bz-content figure.wp-block-video video { display: block; width: 100%; height: auto; max-height: 90vh; object-fit: contain; background: #000; }
.bz-content figure.wp-block-video .bz-sound { position: absolute; right: 16px; bottom: 16px; }
.bz-content figure.wp-block-video:has(video:not([src])):not(:has(source)) { display: none; }

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
	:root { --g: 16px; --gap: 16px; --header: 56px; }

	.bz-header { display: flex; justify-content: space-between; }
	.bz-nav { display: none; }
	.bz-header .bz-logo svg, .bz-menu .bz-logo svg { height: 12px; }
	.bz-burger { display: flex; width: 28px; height: 28px; flex-direction: column; justify-content: center; align-items: flex-end; gap: 6px; }
	.bz-burger span { display: block; width: 22px; height: 1px; background: var(--fg); }

	.bz-row { display: flex; flex-direction: column; gap: 16px; }
	.bz-label { font-size: 11px; }
	.bz-rule { padding-top: 12px; }

	.bz-hero { height: 560px; min-height: 0; }
	.bz-hero__list { padding: 0 16px 24px; gap: 12px; }
	.bz-hero__item { padding-top: 10px; }
	.bz-hero__name { font-size: 13px; }
	.bz-hero__cat { display: none; }

	.bz-work { padding: 20px 16px; gap: 32px; }
	.bz-archive { padding: 20px 16px 80px; gap: 32px; }
	.bz-archive__head { margin-bottom: -16px; }
	.bz-grid { grid-template-columns: 1fr; gap: 32px; }
	.bz-card { gap: 12px; }
	.bz-work__head { margin-bottom: -16px; }
	.bz-project { gap: 12px; }
	.bz-bars { gap: 6px; }
	.bz-project__caption { gap: 16px; }

	.bz-expertise { padding-top: 40px; padding-bottom: 80px; gap: 0; }
	.bz-expertise > .bz-label { padding-bottom: 4px; }
	.bz-expertise__list { border-top: 0; }
	.bz-expertise__row { flex-direction: column; align-items: flex-start; gap: 8px; padding: 20px 0; }
	.bz-expertise__name { font-size: 28px; }

	.bz-contact { min-height: 200px; }
	.bz-contact__email { font-size: 36px; border-top: 0; padding-top: 0; }

	.bz-footer { display: flex; flex-direction: column; align-items: flex-start; gap: 28px; padding: 16px 16px 24px; min-height: 0; }
	.bz-footer__links--social { flex-direction: row; gap: 8px; }
	.bz-footer__copy { order: 99; align-self: stretch; border-top: 1px solid var(--rule); padding-top: 16px; margin-top: 12px; text-align: center; }

	.bz-case-head { min-height: 0; padding: 48px 0 32px; gap: 48px; }
	.bz-case-head__top { gap: 20px; }
	.bz-case-head__title { gap: 20px; }
	.bz-h1 { font-size: 44px; }
	.bz-body { font-size: 16px; }
	.bz-case-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
	.bz-case-meta > div { gap: 6px; }

	.bz-text { display: flex; flex-direction: column; gap: 20px; padding: 56px 16px 64px; }
.bz-text > .bz-label, .bz-text > .wp-block-group__inner-container > .bz-label { padding-top: 12px; align-self: stretch; }
.bz-text > .bz-h2, .bz-text > .wp-block-group__inner-container > .bz-h2, .bz-text > h2, .bz-text > .wp-block-group__inner-container > h2 { border-top: 0; padding-top: 0; font-size: 28px; margin-bottom: 0; }
.bz-text > p:not(.bz-label), .bz-text > .wp-block-group__inner-container > p:not(.bz-label) { font-size: 16px; }
.bz-text > p:not(.bz-label) + p, .bz-text > .wp-block-group__inner-container > p:not(.bz-label) + p { margin-top: 0; }
.bz-page > .bz-text--first { padding-top: 64px; }
.bz-page > .bz-text + .bz-text { padding-top: 24px; }

	.bz-img-pair, .bz-img-trio { flex-direction: column; align-items: stretch; gap: 16px; }
	.bz-img-pair figure, .bz-img-trio figure { flex: none !important; }
	.bz-img-full, .bz-img-pair, .bz-img-trio { padding-bottom: 16px; }

	.bz-next { height: 140px; }
	.bz-hero__sound { top: 16px; }
	.bz-content figure.wp-block-video .bz-sound { right: 12px; bottom: 12px; }
	.bz-next a { font-size: 28px; }
}

/* Screen-reader helper */
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
