:root {
  --bg: #f4f1ea;
  --ink: #211f1c;
  --accent: #6c848d; /* 和色・藍鼠 */
  --font-latin: "Jost", "Noto Serif TC", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Serif TC", "Songti TC", "PingFang TC", "PMingLiU", serif;
  opacity: 1;
  transition: opacity 0.35s ease;
}

html.js-preload body {
  opacity: 0;
}

body.fade-out {
  opacity: 0;
}

img {
  max-width: 100%;
}

/* ---------- 首頁 ---------- */

.home-entry {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6vh 6vw;
}

.tagline {
  margin: 0 0 30px;
  font-size: clamp(1.05rem, 0.55rem + 2.6vw, 1.75rem);
  letter-spacing: 0.05em;
  line-height: 1.7;
}

.home-logo-link {
  display: inline-block;
  margin: 0 0 28px;
}

.home-logo {
  display: block;
  width: clamp(120px, 34vw, 188px);
  height: auto;
}

.home-wordmark {
  display: block;
  width: clamp(96px, 27vw, 150px);
  height: auto;
  margin: 0 auto;
}

/* ---------- 理念頁 ---------- */

.back-logo {
  position: fixed;
  top: 24px;
  left: 24px;
  width: 44px;
  height: 44px;
  z-index: 20;
  display: block;
}

.back-logo img {
  width: 100%;
  height: 100%;
  display: block;
}

.hamburger {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  z-index: 20;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

.concept-stage {
  height: 100vh;
  overflow: hidden;
  box-sizing: border-box;
  padding: 12vh 8vw 10vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.creed-lines {
  width: 100%;
  font-size: clamp(1rem, 0.6rem + 0.85vw, 1.1875rem);
}

.creed-lines .line {
  margin: 0 0 0.4em;
  line-height: 1.9;
  letter-spacing: 0.04em;
  text-align: center;
}

.creed-lines .line.tail {
  margin-top: 0.9em;
  opacity: 0.4;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
}

/* ---------- 選單覆蓋層 ---------- */

.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: #ddbb99; /* 和色・白茶色 */
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: clamp(28px, 13vw, 220px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

.menu-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: var(--ink);
  font-family: var(--font-latin);
  font-weight: 300;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.menu-panel {
  display: none;
  position: relative;
  text-align: left;
}

.menu-panel.active {
  display: block;
}

.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 44px;
}

.menu-caption {
  display: block;
  font-family: "Noto Sans TC", sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  opacity: 0.6;
  margin: 0 0 6px;
}

.menu-item {
  display: inline-block;
  background: none;
  border: none;
  color: var(--ink);
  font-family: var(--font-latin);
  font-weight: 300;
  font-size: clamp(1.7rem, 1.1rem + 2.4vw, 2.75rem);
  letter-spacing: 0.1em;
  text-decoration: none;
  cursor: pointer;
  padding: 2px 14px;
  margin-left: -14px;
  border-radius: 1px;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.menu-item.active {
  background: var(--accent);
  color: var(--bg);
}

.company-blocks {
  display: flex;
  flex-direction: column;
  gap: 30px;
  max-width: 620px;
  margin: 0 auto;
  text-align: left;
}

.company-blocks .block {
  display: flex;
  gap: 32px;
  align-items: baseline;
}

.company-blocks .block-label {
  flex: 0 0 5.5em;
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  opacity: 0.5;
  white-space: nowrap;
}

.company-blocks .block-value {
  flex: 1;
  font-size: 1rem;
  letter-spacing: 0.03em;
  line-height: 1.9;
  opacity: 0.92;
}

/* ---------- 分類頁：左側常駐導覽列 ---------- */

.side-nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 220px;
  padding: 40px 32px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 120px;
  z-index: 20;
  border-right: 1px solid rgba(33, 31, 28, 0.1);
}

.side-nav-logo {
  display: block;
  width: 40px;
}

.side-nav-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.side-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.side-nav-list a {
  display: inline-block;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-latin);
  font-weight: 300;
  font-size: 0.95rem;
  letter-spacing: 0.12em;
  opacity: 0.55;
  padding: 3px 10px;
  margin-left: -10px;
  border-radius: 1px;
  transition: opacity 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.side-nav-list a:hover {
  opacity: 0.85;
}

.side-nav-list a.active {
  opacity: 1;
  background: var(--accent);
  color: var(--bg);
}

/* ---------- 分類頁：內容區 ---------- */

.category-stage {
  min-height: 100vh;
  box-sizing: border-box;
  padding: 14vh 8vw 10vh calc(220px + 8vw);
}

.category-title {
  margin: 0 0 0.6em;
  font-family: var(--font-latin);
  font-size: clamp(1.6rem, 1rem + 2vw, 2.4rem);
  font-weight: 300;
  letter-spacing: 0.14em;
}

.category-intro {
  margin: 0 0 3em;
  max-width: 46em;
  font-size: 1rem;
  line-height: 2;
  letter-spacing: 0.03em;
  opacity: 0.75;
}

.category-loading,
.category-error {
  opacity: 0.55;
  letter-spacing: 0.08em;
}

.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 40px 32px;
}

.series-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  transition: opacity 0.25s ease;
}

.series-card:hover {
  opacity: 0.75;
}

.series-cover {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.series-name {
  font-size: 1.05rem;
  letter-spacing: 0.06em;
}

.series-intro {
  font-size: 0.85rem;
  line-height: 1.8;
  opacity: 0.6;
}

/* ---------- 系列詳情頁 ---------- */

.series-back {
  display: inline-block;
  margin: 0 0 40px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  opacity: 0.6;
  transition: opacity 0.25s ease;
}

.series-back:hover {
  opacity: 1;
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 8vh;
  max-width: 720px;
}

.article-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.article-cover {
  display: block;
  width: 100%;
  max-height: 50vh;
  object-fit: cover;
  margin-bottom: 8px;
}

.article-title {
  margin: 0;
  font-family: var(--font-latin);
  font-weight: 400;
  font-size: 1.3rem;
  letter-spacing: 0.06em;
}

.article-date {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  opacity: 0.5;
}

.article-summary {
  margin: 0;
  font-size: 1rem;
  line-height: 1.9;
  letter-spacing: 0.03em;
}

.article-profile {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.9;
  opacity: 0.8;
}

.article-body {
  display: flex;
  flex-direction: column;
  gap: 1.1em;
  font-size: 1rem;
  line-height: 2;
  letter-spacing: 0.02em;
}

.article-body p {
  margin: 0;
}

.article-body .article-heading {
  font-family: var(--font-latin);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
}

.article-body blockquote {
  margin: 0;
  padding-left: 20px;
  border-left: 2px solid rgba(33, 31, 28, 0.25);
  opacity: 0.85;
}

.article-body hr {
  border: none;
  border-top: 1px solid rgba(33, 31, 28, 0.15);
  margin: 0.4em 0;
}

.article-body-img {
  display: block;
  width: 100%;
  cursor: zoom-in;
}

.article-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.article-gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  cursor: zoom-in;
  transition: opacity 0.2s ease;
}

.article-gallery img:hover {
  opacity: 0.85;
}

/* ---------- 圖片燈箱 ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(33, 31, 28, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6vh 6vw;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.open {
  opacity: 1;
  visibility: visible;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: var(--bg);
  font-family: var(--font-latin);
  font-weight: 300;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.article-link {
  display: inline-block;
  align-self: flex-start;
  margin-top: 4px;
  padding: 8px 18px;
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}

.page-category .company-blocks {
  max-width: 620px;
  margin: 0;
}

.category-hero {
  margin: 0 0 8vh;
}

.category-hero-img {
  display: block;
  width: 100%;
  max-height: 44vh;
  object-fit: cover;
}

@media (max-width: 900px) {
  .side-nav {
    display: none;
  }

  .category-stage {
    padding: 13vh 7vw 9vh;
  }
}

@media (max-width: 640px) {
  .back-logo,
  .hamburger {
    top: 16px;
  }

  .back-logo {
    left: 16px;
    width: 36px;
    height: 36px;
  }

  .hamburger {
    right: 16px;
    width: 36px;
    height: 36px;
  }

  .concept-stage {
    padding: 11vh 7vw 9vh;
  }

  .menu-back {
    top: -7vh;
  }
}
