/* ==========================================================================
   lightdesign 2026
   斷點：手機 ≤ 799px，桌機 ≥ 800px（與 2015 版相同）。
   ========================================================================== */

/* 1. 設計變數
   ========================================================================== */

:root {
	--ld-red: #aa171d;
	--ld-gray: #474644;
	--ld-tile: #444;
	--ld-black: #000;
	--ld-white: #fff;
	--ld-overlay: rgb(10 0 0 / 0.5);
	--ld-overlay-strong: rgb(10 0 0 / 0.8);
	--ld-facebook: #3b5998;

	--ld-container: 1280px;
	--ld-gutter: 10px;
	--ld-bar: 65px;          /* 頁首色條高度（桌機） */
	--ld-bar-mobile: 50px;   /* 頁首色條高度（手機） */

	--ld-font-sans: Arial, Helvetica, "Microsoft JhengHei", "Microsoft YaHei", sans-serif;
	--ld-font-serif: Georgia, "Adobe Garamond Pro", "Adobe Garamond", "Times New Roman", Times, "Times Roman", "Microsoft JhengHei", "Microsoft YaHei", serif;
}

/* 2. 基礎重設
   ========================================================================== */

*,
*::before,
*::after {
	box-sizing: border-box;
}

:where(html, body, div, span, iframe, object, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strong, sub, sup, var, b, u, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, menu, nav, output, section, summary, time, mark, audio, video, main) {
	margin: 0;
	padding: 0;
	border: 0;
	font: inherit;
	vertical-align: baseline;
}

:where(article, aside, details, figcaption, figure, footer, header, main, menu, nav, section, summary) {
	display: block;
}

:where(ol, ul) {
	list-style: none;
}

table {
	border-collapse: separate;
	border-spacing: 0;
}

:where(caption, th, td) {
	text-align: left;
	font-weight: normal;
	vertical-align: middle;
}

:where(q, blockquote) {
	quotes: none;
}

:where(input, textarea, button) {
	font-family: inherit;
}

button {
	cursor: pointer;
	border: none;
}

[hidden] {
	display: none !important;
}

/* 3. 版面基礎
   ========================================================================== */

html {
	width: 100%;
	height: 100%;
	font-size: 62.5%;
	line-height: 1;
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body {
	width: 100%;
	height: 100%;
	min-width: 100%;
	background-color: var(--ld-white);
	color: var(--ld-black);
	font-family: var(--ld-font-sans);
	font-size: 1.4rem;
	line-height: 1.5;
}

a {
	color: var(--ld-black);
	text-decoration: none;
	outline: none;
	transition: all 200ms;

	&:is(:hover, :active, :focus) {
		color: var(--ld-red);
		text-decoration: none;
	}
}

/* 用鍵盤操作時顯示焦點框（滑鼠點擊不顯示，外觀與原本相同）。 */
:is(a, button):focus-visible {
	outline: 2px solid var(--ld-red);
	outline-offset: 2px;
}

::selection {
	background: var(--ld-red);
	color: var(--ld-black);
	text-shadow: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: var(--ld-font-serif);

	& .cht {
		font-family: var(--ld-font-sans);
	}
}

/* 表單 */
input {
	padding: 0 10px;
	font-size: 1.5rem;
	line-height: 2;
	color: var(--ld-black);
}

:is(input[type="text"], input[type="email"], input[type="password"]),
textarea {
	width: 100%;
	border: none;
	border-bottom: 1px solid var(--ld-red);
	background-color: var(--ld-white);
	color: var(--ld-black);

	&::placeholder {
		color: var(--ld-black);
	}
}

:is(input[type="text"], input[type="email"], input[type="password"]) {
	padding: 0;
}

textarea {
	padding: 10px 0;
	font-size: 1.5rem;
}

:is(input[type="button"], input[type="submit"], input[type="search"], input[type="reset"], input[type="image"]) {
	cursor: pointer;
	outline: none;
	border: 1px solid transparent;
	background-color: transparent;

	&:hover {
		background-color: var(--ld-red);
	}

	&:active {
		background-color: var(--ld-gray);
	}
}

:is(input[type="radio"], input[type="checkbox"]) {
	vertical-align: -1px;
}

/* 4. 共用元件
   ========================================================================== */

.vh {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	border: 0;
	clip-path: inset(50%);
	overflow: hidden;
	white-space: nowrap;
}

.color-1 {
	color: var(--ld-red);
}

.color-2 {
	color: var(--ld-gray);
}

ol.list,
ul.list {
	margin: 0;
	padding: 0 0 15px 25px;
}

ol.list {
	list-style: decimal;
}

ul.list {
	list-style: square;
}

.list li {
	margin: 0;
	padding: 0 0 2px;
}

/* 圖示字型 */
@font-face {
	font-family: "icon-font";
	src:
		url("../fonts/icon-font.woff") format("woff"),
		url("../fonts/icon-font.ttf") format("truetype");
	font-weight: normal;
	font-style: normal;
	font-display: block;
}

[class^="icon-"],
[class*=" icon-"],
#menu-btn,
#facebook-link,
.scroll-top span {
	font-family: "icon-font";
	font-style: normal;
	font-weight: normal;
	font-variant: normal;
	text-transform: none;
	speak: never;
	line-height: 1;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.icon-menu::before { content: "\e600"; }
.icon-arrow-left::before { content: "\e601"; }
.icon-arrow-right::before { content: "\e602"; }
.icon-arrow-up::before { content: "\e603"; }
.icon-arrow-down::before { content: "\e604"; }
.icon-fb::before { content: "\e605"; }
.icon-history::before { content: "\e606"; }
.icon-vision::before { content: "\e607"; }
.icon-service::before { content: "\e608"; }
.icon-tel::before { content: "\e609"; }
.icon-fax::before { content: "\e60a"; }
.icon-email::before { content: "\e60b"; }
.icon-address::before { content: "\e60c"; }
.icon-work::before { content: "\e60d"; }

/* 大括號標題：{ 文字 } */
.intro h4,
#colophon h4,
:is(#intro-work, #work-list-primary) .label {
	display: inline-block;

	&::before,
	&::after {
		display: inline-block;
	}

	&::before {
		content: "{";
		padding-right: 25px;
	}

	&::after {
		content: "}";
		padding-left: 25px;
	}

	@media (width <= 799px) {
		&::before {
			padding-right: 5px;
		}

		&::after {
			padding-left: 5px;
		}
	}
}

/* 圓形圖示的黑色方塊標題（首頁「關於」三區塊、作品列表第一格） */
#intro-about .section-header .title,
#work-taxonomy-title .title {
	position: absolute;
	inset: 25%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	color: var(--ld-white);
	text-align: center;

	& .icon-main {
		border-bottom: 1px solid var(--ld-white);
		margin-bottom: 10px;
	}

	& .icon {
		display: inline-block;
		width: 60px;
		height: 60px;
		margin: 0 auto 20px;
		line-height: 60px;
		text-align: center;
		font-size: 3.2rem;
		border: 2px solid var(--ld-white);
		border-radius: 60px;
	}
}

/* 照片方格（首頁作品分類、作品列表） */
#intro-work .content ul,
#work-list-primary #main ul {
	/* 用 Grid 排列：每格等寬、上下左右間距一律 10px。
	   （2015 版用 nth-child 邊框當間距，第二列以後會錯位。） */
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: var(--ld-gutter);
	margin-bottom: var(--ld-gutter);

	@media (width <= 799px) {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	& > li {
		position: relative;
		aspect-ratio: 10 / 13;
		background-color: var(--ld-tile);
	}

	& > li > a {
		position: absolute;
		inset: 0;
		display: block;
		overflow: hidden;

		& > .cover {
			position: absolute;
			inset: 0;
			width: 100%;
			height: 100%;
			object-fit: cover;
			object-position: center;
		}

		& > span {
			position: absolute;
			right: 0;
			bottom: 0;
			left: 0;
			display: flex;
			align-items: center;
			justify-content: center;
			height: 100px;
			text-align: center;
			background-color: var(--ld-overlay);

			@media (width <= 799px) {
				height: 50px;
			}
		}

		&:hover > span {
			background-color: var(--ld-overlay-strong);
		}

		& .label {
			display: inline-block;
			color: var(--ld-white);
			font-size: 2rem;

			@media (width <= 799px) {
				font-size: 1.5rem;
			}
		}
	}
}

/* 5. 頁首
   ========================================================================== */

#page {
	width: 100%;
}

#masthead {
	position: relative;
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
	padding-top: var(--ld-bar);
	background-color: var(--ld-white);

	/* 左半紅色、右半黑色色條 */
	&::before,
	&::after {
		content: "";
		position: absolute;
		top: 0;
		display: block;
		width: 50%;
		height: var(--ld-bar);
	}

	&::before {
		left: 0;
		background-color: var(--ld-red);
	}

	&::after {
		right: 0;
		background-color: var(--ld-black);
	}

	@media (width >= 800px) {
		height: 200px;
	}

	@media (width <= 799px) {
		padding-top: var(--ld-bar-mobile);

		&::before {
			position: fixed;
			z-index: 10000;
			width: 100%;
			height: var(--ld-bar-mobile);
		}

		&::after {
			display: none;
		}
	}
}

#masthead-main {
	position: relative;
	width: var(--ld-container);
	max-width: 100%;
	margin: 0 auto;

	/* 色條上紅黑交界的白色分隔 */
	&::before {
		content: "";
		position: absolute;
		top: calc(var(--ld-bar) * -1);
		right: 0;
		display: block;
		width: calc(100% / 3 * 2);
		height: var(--ld-bar);
		border-left: var(--ld-gutter) solid var(--ld-white);
		background-color: var(--ld-black);

		@media (width <= 799px) {
			display: none;
		}
	}
}

#logo {
	@media (width >= 800px) {
		position: absolute;
		top: 0;
		left: 0;
		width: calc(100% / 3);
		max-width: 100%;
	}

	@media (width <= 799px) {
		position: relative;
		top: -10px;
	}

	& a {
		display: block;
		width: 275px;
		max-width: 90%;
		height: 50px;
		margin: 25px auto auto;
	}

	& img {
		width: 275px;
		height: 50px;
	}

	@media (width <= 799px) {
		& a,
		& img {
			width: 165px;
			height: 50px;
		}
	}
}

#menu-btn {
	position: fixed;
	top: 0;
	right: 50px;
	z-index: 10002;
	display: block;
	width: 50px;
	height: 50px;
	font-size: 2.4rem;
	line-height: 50px;
	text-align: center;
	color: var(--ld-white);
	background-color: transparent;

	&[aria-expanded="true"] {
		color: var(--ld-red);
		background-color: var(--ld-white);
	}

	@media (hover: hover) {
		&:hover {
			color: var(--ld-red);
			background-color: var(--ld-white);
		}
	}

	@media (width >= 800px) {
		display: none;
	}
}

#facebook-link {
	position: absolute;
	top: 15px;
	right: 15px;
	z-index: 30;
	display: block;
	width: 35px;
	height: 35px;
	font-size: 2.5rem;
	line-height: 35px;
	text-align: right;
	color: var(--ld-white);

	&:hover {
		color: var(--ld-facebook);
		background-color: var(--ld-white);
	}

	@media (width <= 799px) {
		position: fixed;
		top: 0;
		right: 0;
		z-index: 10002;
		width: 50px;
		height: 50px;
		font-size: 2.4rem;
		line-height: 50px;
		text-align: center;
	}
}

/* 主選單 */
#site-navigation {
	position: absolute;
	z-index: 1001;

	/* 手機：點選單按鈕展開 */
	@media (width <= 799px) {
		right: 0;
		left: 0;
		overflow: hidden;
		background-color: var(--ld-white);

		&:not(.is-open) {
			display: none;
		}

		& #site-menu {
			padding: 0 30px 20px;

			& li {
				font-size: 1.8rem;
			}

			& > li {
				margin-bottom: 8px;
			}

			& li > ul {
				margin-left: 20px;
			}
		}
	}

	/* 桌機：橫向選單，滑過顯示子選單 */
	@media (width >= 800px) {
		top: 0;
		right: 0;
		width: calc(100% / 3 * 2 - var(--ld-gutter));

		& #site-menu {
			margin-top: 35px;
			margin-left: 35px;
			font-size: 0;
			white-space: nowrap;

			& li {
				position: relative;
				display: inline-block;
				font-size: 2rem;
				line-height: 1;
			}

			& li a {
				display: inline-block;
				margin-inline: 15px;
				padding-bottom: 9px;
				border-bottom: 1px solid transparent;

				&:hover {
					color: var(--ld-black);
					border-bottom-color: var(--ld-black);
				}
			}

			& > li {
				margin-right: 62px;
				margin-bottom: 15px;

				& > ul {
					position: absolute;
					display: none;
					padding-top: 15px;
					font-size: 0;
					white-space: nowrap;
					background-color: var(--ld-white);

					& li {
						display: block;
						margin-bottom: 15px;
					}
				}

				&:is(:hover, :focus-within) > a {
					color: var(--ld-black);
					border-bottom-color: var(--ld-black);
				}

				&:is(:hover, :focus-within) > ul {
					display: block;
				}
			}
		}

		/* 目前所在區塊 */
		:is(.single-work, .tax-work_categories, .post-type-archive-work) & #menu-item-work > a,
		.page-template-template-contact & #menu-item-contact > a {
			color: var(--ld-black);
			border-bottom-color: var(--ld-black);
		}
	}
}

/* 6. 首頁
   ========================================================================== */

/* 輪播：滿版寬，高度為視窗高度扣掉頁首 */
#banner {
	width: 100%;
}

#banner-slider {
	position: relative;
	height: calc(100svh - 200px);
	overflow: hidden;
	background-color: #111;

	@media (width <= 799px) {
		height: calc(100svh - 140px);
	}

	& .banner-img {
		position: absolute;
		inset: 0;
		display: block;
		opacity: 0;
		transition: opacity var(--ld-fade, 3000ms) ease-in-out;

		&.is-active {
			z-index: 2;
			opacity: 1;
		}

		&.is-leaving {
			z-index: 1;
			opacity: 1;
			transition: none;
		}
	}

	& .banner-photo {
		display: block;
		width: 100%;
		height: 100%;
		object-fit: cover;
		object-position: center;
	}

	/* 標題文字在 2015 版即為隱藏，保留給螢幕報讀器。 */
	& .banner-title {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}
}

@media (prefers-reduced-motion: reduce) {
	#banner-slider .banner-img {
		transition: none;
	}
}

/* 區塊標題 */
.intro {
	& .article-title {
		position: relative;
		display: flex;
		align-items: center;
		justify-content: center;
		height: 100px;
		text-align: center;

		@media (width <= 799px) {
			padding-inline: 20px;
		}
	}

	& .scroll-top {
		position: absolute;
		top: 50%;
		right: 40px;
		display: inline-block;
		width: 40px;
		height: 40px;
		margin-top: -20px;
		line-height: 37px;
		text-align: center;
		font-size: 2rem;
		color: var(--ld-black);
		background-color: transparent;
		border: 1px solid var(--ld-black);
		border-radius: 60px;

		@media (width <= 799px) {
			display: none;
			right: 20px;
			width: 30px;
			height: 30px;
			margin-top: -15px;
			line-height: 27px;
			font-size: 1.6rem;
		}
	}

	& :is(h2, h4) .cht {
		padding-right: 20px;

		@media (width <= 799px) {
			padding-right: 15px;
		}
	}

	& :is(h2, h4) .en {
		text-transform: uppercase;
		letter-spacing: 5px;

		@media (width <= 799px) {
			letter-spacing: 2px;
		}
	}

	& h2 {
		display: inline-block;
		font-size: 2.8rem;

		@media (width <= 799px) {
			font-size: 1.6rem;
		}
	}

	& h3 {
		font-size: 2rem;

		@media (width <= 799px) {
			font-size: 1.5rem;
		}
	}

	& h4 {
		font-size: 2rem;

		@media (width <= 799px) {
			font-size: 1.5rem;
		}
	}
}

/* 關於 */
#intro-about {
	& .article-title h2 {
		display: none;
	}

	& .sections {
		width: var(--ld-container);
		max-width: 100%;
		margin: 0 auto;

		@media (width >= 800px) {
			display: flex;
		}
	}

	& section {
		flex: 1;

		@media (width >= 800px) {
			&:first-child {
				border-right: var(--ld-gutter) solid var(--ld-white);
			}

			&:last-child {
				border-left: var(--ld-gutter) solid var(--ld-white);
			}
		}

		&:hover > .section-header {
			background-color: var(--ld-red);
		}
	}

	& .section-header {
		position: relative;
		overflow: hidden;
		background-color: var(--ld-black);

		&::before {
			content: "";
			display: block;
			padding-top: 75%;

			@media (width <= 799px) {
				padding-top: 50%;
			}
		}

		& .title {
			@media (width <= 1024px) {
				inset: 15%;
			}

			& h3 {
				border-top: 1px solid var(--ld-white);
				padding-top: 30px;

				@media (width <= 799px) {
					font-size: 2rem;
				}
			}

			& .icon {
				@media (width <= 1200px) {
					width: 40px;
					height: 40px;
					line-height: 40px;
					font-size: 1.8rem;
				}
			}
		}
	}

	& section > .content {
		padding: 40px;
		font-size: 1.6rem;

		&.text-center {
			text-align: center;
		}

		& p {
			padding-bottom: 10px;
		}
	}
}

/* 團隊 */
#intro-team {
	width: var(--ld-container);
	max-width: 100%;
	margin: 0 auto;

	& > div {
		display: block;
		color: var(--ld-white);

		@media (width >= 800px) {
			position: relative;
			display: flex;
			align-items: center;
			justify-content: flex-end;
			width: 100%;
			overflow: hidden;

			&::before {
				content: "";
				display: block;
				padding-top: 65%;
			}

			& > .content {
				position: absolute;
				inset: 0;
				display: block;
			}
		}
	}

	& .content {
		z-index: -1;
	}

	& img {
		display: block;
		width: 100%;
		height: auto;
	}

	& .article-title {
		background-color: var(--ld-black);

		@media (width >= 800px) {
			justify-content: flex-start;
			width: calc(100% / 3 * 2);
			max-width: 100%;
			height: 280px;
			padding-left: 100px;
			background-color: var(--ld-overlay-strong);
		}

		& .scroll-top {
			top: 30px;
			margin-top: 0;
			color: var(--ld-white);
			border-color: var(--ld-white);
		}

		& h2 {
			width: 250px;
			height: 100px;
			line-height: 100px;
			border: 1px solid var(--ld-white);

			& .cht {
				padding: 0;
				font-size: 6rem;
			}

			& .en {
				display: none;
			}

			@media (width <= 799px) {
				display: block;
				width: auto;
				height: auto;
				margin-right: 20px;
				padding: 0 5px;
				line-height: 1.5;

				& .cht {
					font-size: 2rem;
				}
			}
		}

		& h4 {
			padding-left: 30px;
			text-align: left;

			@media (width <= 799px) {
				display: block;
				padding: 0;
			}

			& > span {
				display: block;
			}

			&::before,
			&::after {
				display: none;
			}
		}
	}
}

/* 作品分類 */
#intro-work {
	& .article-title {
		margin-top: 40px;

		@media (width <= 799px) {
			margin-top: 0;
		}

		& h2 {
			margin-right: 50px;
			border-bottom: 1px solid var(--ld-black);

			@media (width <= 799px) {
				margin: 0 20px 0 0;
			}
		}

		& h4 {
			margin: 0;
			padding: 0;
		}
	}

	& .content {
		width: var(--ld-container);
		max-width: 100%;
		margin: 0 auto;
	}
}

/* 7. 作品列表
   ========================================================================== */

#work-list-primary #main {
	width: var(--ld-container);
	max-width: 100%;
	margin: 0 auto;
}

#work-list-primary #main #work-taxonomy-title {
	overflow: hidden;
	background-color: var(--ld-black);

	& .title {
		& h2 {
			font-size: 2rem;
			border-top: 1px solid var(--ld-white);
			padding-top: 30px;

			@media (width <= 799px) {
				font-size: 1.6rem;
				padding-top: 20px;
			}
		}

		& .icon {
			@media (width <= 799px) {
				width: 40px;
				height: 40px;
				line-height: 40px;
				font-size: 2.2em;
			}
		}
	}
}

/* 8. 單一作品、聯絡、一般頁面
   ========================================================================== */

:is(.page, .single, .single-work) #main {
	width: var(--ld-container);
	max-width: 100%;
	margin: 0 auto;

	& article {
		font-size: 1.6rem;

		@media (width >= 800px) {
			display: flex;
			flex-wrap: wrap;
		}
	}

	& .entry-content {
		flex: 1;
		padding: 20px;

		@media (width >= 800px) {
			padding: 60px 0 0 20px;
		}
	}

	& :is(.entry-photos, .entry-map) {
		flex: 4;
		padding: 20px;

		@media (width >= 800px) {
			padding: 0 0 0 20px;
		}

		& img {
			display: block;
			width: 100%;
			height: auto;
		}
	}

	& :is(.the-taxonomy, .company-name, h2) {
		font-size: 2rem;
		line-height: 1.2;

		& .en {
			letter-spacing: 1px;
		}

		@media (width >= 800px) {
			padding-bottom: 40px;
		}

		@media (width <= 799px) {
			padding-bottom: 20px;
		}
	}

	& :is(ul.the-info, ul.the-meta) {
		@media (width >= 800px) {
			padding-bottom: 50px;
		}

		@media (width <= 799px) {
			padding-bottom: 20px;
		}

		& li {
			display: flex;
		}
	}

	& ul.the-info li {
		padding-bottom: 8px;

		& > h4 {
			width: 35px;
		}

		& > p {
			width: calc(100% - 35px);
		}

		& .icon {
			display: block;
			width: 27px;
			height: 27px;
			line-height: 27px;
			font-size: 1.6rem;
			text-align: center;
			color: var(--ld-white);
			background-color: var(--ld-black);
		}
	}

	& ul.the-meta li {
		padding-bottom: 5px;

		& > h4 {
			width: 50px;
		}

		& > p {
			width: calc(100% - 50px);
		}
	}

	/* 作品照片 */
	& .main-photo {
		width: 100%;
		margin-bottom: var(--ld-gutter);
	}

	& .main-photo-img {
		transition: opacity 250ms;

		&.is-fading {
			opacity: 0;
		}
	}

	& .photo-thumb ul {
		display: flex;
		flex-wrap: wrap;

		& li {
			position: relative;
			width: calc((100% - 40px) / 5);
			margin: 0 var(--ld-gutter) var(--ld-gutter) 0;
			background-color: var(--ld-white);

			&:nth-child(5n) {
				margin-right: 0;
			}
		}
	}
}

/* 9. 頁尾
   ========================================================================== */

#colophon {
	& .article-title {
		display: flex;
		align-items: center;
		justify-content: center;
		height: 100px;
		margin-top: 40px;
		text-align: center;
	}

	& h4 {
		font-size: 2rem;
		text-transform: uppercase;

		@media (width <= 799px) {
			font-size: 1.3rem;
		}

		& .cht {
			padding-right: 20px;
		}

		& .en {
			letter-spacing: 5px;

			@media (width <= 799px) {
				letter-spacing: 2px;
			}
		}
	}

	& #copyright {
		display: flex;
		align-items: center;
		justify-content: center;
		min-height: 100px;
		padding: 20px;
		color: var(--ld-white);
		background-color: var(--ld-black);
		text-align: center;
		text-transform: uppercase;
		font-size: 1.3rem;
		letter-spacing: 1px;

		@media (width <= 799px) {
			font-size: 1.2rem;
		}
	}
}
