/* ============================================================
   Alan大叔的職場真心話 — 職場文章策展館
   色彩：暖灰 + 紙感 + 克制的陶土橘
   字體：Noto Serif TC（情感標題）/ Noto Sans TC（理性內文）
   ============================================================ */

:root {
  --bg:        #F4EFE7;   /* 暖米白：紙感（略降亮度、減少刺眼） */
  --ink:       #221E1A;   /* 暖黑：文字主色（加深，內文更清晰） */
  --ink-soft:  #605850;   /* 暖灰：段落次要文字（加深至約 6:1 對比） */
  --ink-faint: #8A8177;   /* 更淡：純 metadata（日期 / 篇數） */
  --accent:    #A6543D;   /* 陶土橘：連結 / hover / CTA（加深，小字更好讀） */
  --accent-dk: #8C4531;
  --line:      #E1D9CD;   /* 分隔線 */
  --dark:      #26221E;   /* 深咖啡黑：反白區塊 */
  --dark-soft: #d3c6b6;   /* 深底上的次要文字（提亮，反白更清楚） */

  --serif: "Noto Serif TC", serif;
  --sans:  "Noto Sans TC", "Inter", sans-serif;

  --maxw: 1180px;
  --readw: 720px;
  --pad-y: clamp(88px, 12vw, 168px);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 20px;
  line-height: 1.95;
  letter-spacing: 0.025em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent); color: #fff; }

/* 中文閱讀優化：標題平衡斷行避免孤字、段落避免尾行單字 */
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

/* ---------- 共用容器 ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--pad-y) 28px;
}
.section-head { margin-bottom: clamp(40px, 5vw, 64px); }
.section-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.3;
  letter-spacing: 0.01em;
}
.section-kicker {
  color: var(--ink-soft);
  font-size: 16px;
  margin-top: 10px;
}

/* ---------- header ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(20px, 4vw, 48px);
  transition: background .4s var(--ease), box-shadow .4s var(--ease), padding .4s var(--ease);
}
.site-header.scrolled {
  background: rgba(244, 239, 231, 0.88);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.03em;
}
.nav { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); }
.nav a { font-size: 15px; transition: color .25s var(--ease); }

/* 未捲動時在照片 Hero 上：淺色 */
.brand { color: #fff; transition: color .4s var(--ease); }
.nav a { color: rgba(255,255,255,.82); }
.nav a:hover { color: #fff; }
.nav-cta {
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 999px;
  padding: 7px 16px;
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease) !important;
}
.nav-cta:hover { background: #fff; color: var(--ink) !important; border-color: #fff; }

/* 捲動後 header 變紙色底：文字轉深色 */
.site-header.scrolled .brand { color: var(--ink); }
.site-header.scrolled .nav a { color: var(--ink-soft); }
.site-header.scrolled .nav a:hover { color: var(--ink); }
.site-header.scrolled .nav-cta { color: var(--accent) !important; border-color: var(--accent); }
.site-header.scrolled .nav-cta:hover { background: var(--accent); color: #fff !important; border-color: var(--accent); }

/* ---------- 1. hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 28px 100px;
  color: #fff;
  background-image: var(--hero-bg, url("images/photos/p13.jpg"));
  background-size: cover;
  background-position: center;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(30,27,23,.42) 0%, rgba(30,27,23,.34) 42%, rgba(30,27,23,.78) 100%);
  z-index: 0;
}
.hero-inner { max-width: 940px; position: relative; z-index: 1; }
.hero-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(38px, 6.4vw, 88px);
  line-height: 1.28;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 24px rgba(0,0,0,.32);
}
.hero-sub {
  margin-top: clamp(24px, 3vw, 38px);
  font-size: clamp(17px, 2vw, 22px);
  color: rgba(255,255,255,.9);
  line-height: 2;
  text-shadow: 0 1px 16px rgba(0,0,0,.3);
}
.hero-sub span { display: block; }
.hero-actions {
  margin-top: clamp(36px, 4vw, 52px);
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* buttons */
.btn {
  display: inline-block;
  font-size: 16px;
  padding: 13px 26px;
  border-radius: 999px;
  transition: transform .3s var(--ease), background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dk); transform: translateY(-2px); }
.btn-ghost {
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-2px); }
/* hero 上的 ghost 按鈕（照片背景）改淺色 */
.hero .btn-ghost {
  border-color: rgba(255,255,255,.5);
  color: #fff;
}
.hero .btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,.12); }
.btn-lg { font-size: 18px; padding: 16px 34px; }

/* scroll hint */
.scroll-hint {
  position: absolute;
  bottom: 34px; left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 42px;
  border: 1px solid rgba(255,255,255,.6);
  border-radius: 999px;
  z-index: 1;
}
.scroll-hint span {
  position: absolute;
  top: 9px; left: 50%;
  width: 3px; height: 8px;
  margin-left: -1.5px;
  background: rgba(255,255,255,.8);
  border-radius: 2px;
  animation: scrollDot 1.8s var(--ease) infinite;
}
@keyframes scrollDot {
  0% { opacity: 0; transform: translateY(0); }
  40% { opacity: 1; }
  80% { opacity: 0; transform: translateY(14px); }
  100% { opacity: 0; }
}

/* ---------- 2. 最新文章（作品式清單） ---------- */
.article-list { list-style: none; border-top: 1px solid var(--line); }
.article-item { border-bottom: 1px solid var(--line); }
.article-item a {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  align-items: baseline;
  gap: 20px;
  padding: 26px 8px;
  transition: padding-left .35s var(--ease), color .35s var(--ease);
}
.article-item a:hover { padding-left: 22px; color: var(--accent); }
.a-index {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-soft);
  transition: color .35s var(--ease);
}
.article-item a:hover .a-index { color: var(--accent); }
.a-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(20px, 2.6vw, 30px);
  line-height: 1.4;
}
.a-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-faint);
  font-size: 14px;
  white-space: nowrap;
}
.a-tag {
  font-size: 13px;
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 11px;
}
.link-more {
  display: inline-block;
  margin-top: 34px;
  color: var(--accent);
  font-size: 16px;
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.link-more:hover { border-color: var(--accent); }
.link-more-center { display: block; text-align: center; margin-top: 56px; }

/* featured 大卡 */
.feat {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
  margin-bottom: clamp(48px, 6vw, 88px);
}
.feat-cover {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 16 / 10;
  background: var(--line);
}
.feat-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .8s var(--ease);
}
.feat:hover .feat-cover img { transform: scale(1.04); }
.feat-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(24px, 3.2vw, 38px);
  line-height: 1.4;
  margin: 16px 0 18px;
}
.feat-title a { transition: color .3s var(--ease); }
.feat-title a:hover { color: var(--accent); }
.feat-abstract {
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.95;
  margin-bottom: 22px;
}

/* 文章卡片格 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 3vw, 40px);
}
.card { display: flex; flex-direction: column; }
.card-cover {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 16 / 10;
  background: var(--line);
  margin-bottom: 18px;
}
.card-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .7s var(--ease);
}
.card:hover .card-cover img { transform: scale(1.05); }
.card .a-meta { margin-bottom: 10px; }
.card-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.5;
  margin-bottom: 12px;
}
.card-title a { transition: color .3s var(--ease); }
.card-title a:hover { color: var(--accent); }
.card-abstract {
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.9;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 3. 主題策展 ---------- */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.theme-card {
  background: var(--bg);
  padding: clamp(28px, 3vw, 44px);
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: background .4s var(--ease);
}
.theme-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.theme-card h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.35;
  transition: color .35s var(--ease), transform .4s var(--ease);
}
.theme-count {
  flex: none;
  font-size: 13px;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  transition: color .35s var(--ease);
}
.theme-card:hover .theme-count { color: var(--dark-soft); }
.theme-card p {
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.8;
  margin-top: 18px;
  transition: color .35s var(--ease);
}
.theme-card:hover { background: var(--dark); }
.theme-card:hover h3 { color: #fff; }
.theme-card:hover p { color: var(--dark-soft); }

/* ---------- 4. 品牌理念（深色 + 山路照背景） ---------- */
.manifesto {
  color: #fff;
  max-width: none;
  margin: 0;
  padding-left: 28px;
  padding-right: 28px;
  background:
    linear-gradient(rgba(30,27,23,.82), rgba(30,27,23,.9)),
    url("images/photos/p05.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}
.manifesto-inner { max-width: var(--readw); margin: 0 auto; position: relative; }
.manifesto-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(26px, 3.6vw, 40px);
  line-height: 1.5;
  margin-bottom: 36px;
}
.manifesto-body p {
  color: var(--dark-soft);
  font-size: 18px;
  line-height: 2.1;
  margin-bottom: 22px;
}
.signature {
  font-family: var(--serif);
  font-size: 20px;
  margin-top: 30px;
  color: #fff;
}

/* ---------- 5. 從這裡開始（手風琴） ---------- */
.path-list { border-top: 1px solid var(--line); }
.path-item { border-bottom: 1px solid var(--line); }
.path-q {
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--serif);
  color: var(--ink);
  font-size: clamp(19px, 2.4vw, 26px);
  text-align: left;
  padding: 28px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  transition: color .3s var(--ease);
}
.path-q:hover { color: var(--accent); }
.path-icon {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 26px;
  color: var(--ink-soft);
  transition: transform .35s var(--ease), color .3s var(--ease);
}
.path-item.open .path-icon { transform: rotate(45deg); color: var(--accent); }
.path-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height .45s var(--ease), padding .45s var(--ease);
  padding: 0 8px;
}
.path-item.open .path-a { padding: 0 8px 28px; }
.path-a a {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 18px;
  color: var(--ink-soft);
  padding: 10px 0;
  transition: color .3s var(--ease), transform .3s var(--ease);
}
.path-a a:hover { color: var(--accent); transform: translateX(6px); }

/* ---------- 6. 關於大叔 ---------- */
.about-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.about-text { max-width: var(--readw); }
.about-text p { margin-top: 20px; color: var(--ink-soft); font-size: 18px; }
.about-punch {
  font-family: var(--serif);
  color: var(--ink) !important;
  font-size: 22px !important;
  margin-top: 26px !important;
}
.about-text .link-more { margin-top: 26px; }
.about-figure {
  aspect-ratio: 4 / 5;
  background: linear-gradient(160deg, #efe7d9, #e3d4c1);
  border-radius: 6px;
  overflow: hidden;
}
.about-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  transition: transform .8s var(--ease);
}
.about-figure:hover img { transform: scale(1.03); }

/* ---------- 7. 訂閱追蹤（港口夕陽照背景） ---------- */
.subscribe {
  text-align: center;
  max-width: none;
  margin: 0;
  color: #fff;
  background:
    linear-gradient(rgba(30,27,23,.52), rgba(30,27,23,.72)),
    url("images/photos/p03.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}
.subscribe-inner { max-width: 820px; margin: 0 auto; }
.subscribe-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1.4;
  text-shadow: 0 2px 20px rgba(0,0,0,.35);
}
.subscribe-sub {
  color: rgba(255,255,255,.9);
  font-size: 18px;
  margin: 22px auto 38px;
  max-width: 560px;
}
.subscribe-social {
  margin-top: 28px;
  font-size: 15px;
  color: rgba(255,255,255,.85);
}
.subscribe-social a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.subscribe-social a:hover { color: var(--accent); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 56px 28px;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.footer-brand { font-family: var(--serif); font-weight: 600; font-size: 17px; }
.footer-nav { display: flex; gap: 22px; }
.footer-nav a { color: var(--ink-soft); font-size: 15px; transition: color .25s var(--ease); }
.footer-nav a:hover { color: var(--accent); }
.footer-meta {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  color: var(--ink-soft);
  font-size: 14px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.visits { color: var(--ink-soft); font-size: 14px; }
.visits #visitCount { color: var(--accent); font-variant-numeric: tabular-nums; }
.back-top { color: var(--ink-soft); transition: color .25s var(--ease); }
.back-top:hover { color: var(--accent); }

/* ---------- hover 縮圖預覽 ---------- */
.hover-preview {
  position: fixed;
  top: 0; left: 0;
  width: 200px; height: 130px;
  border-radius: 6px;
  background: var(--dark) center/cover no-repeat;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.9);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
  z-index: 60;
  box-shadow: 0 16px 40px rgba(38, 34, 30, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dark-soft);
  font-family: var(--serif);
  font-size: 15px;
}
.hover-preview.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ---------- scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  transition-delay: var(--d, 0s);
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- RWD ---------- */
@media (max-width: 860px) {
  body { font-size: 18px; }
  .nav a:not(.nav-cta) { display: none; }
  .theme-grid { grid-template-columns: 1fr 1fr; }
  .about-inner { grid-template-columns: 1fr; }
  .about-figure { max-width: 320px; order: -1; }
  .feat { grid-template-columns: 1fr; }
  .feat-cover { order: -1; }
  .card-grid { grid-template-columns: 1fr 1fr; }
  /* 行動裝置關閉固定視差，避免 iOS 縮放跳動 */
  .manifesto, .subscribe { background-attachment: scroll; }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .theme-grid { grid-template-columns: 1fr; }
  .article-item a { grid-template-columns: 1fr; gap: 8px; padding: 20px 4px; }
  .article-item a:hover { padding-left: 10px; }
  .a-index { display: none; }
  .a-meta { margin-top: 4px; }
  .footer-meta { flex-direction: column; align-items: flex-start; }
  .hover-preview { display: none; }
  .card-grid { grid-template-columns: 1fr; }
}

/* ---------- 尊重降低動態偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
