@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;600&family=Noto+Serif+TC:wght@400;500;600&display=swap");

:root {
  --paper: #f7f4ed;
  --paper-deep: #eee9df;
  --ink: #171817;
  --muted: #686964;
  --line: #d6d1c7;
  --red: #c82f24;
  --red-dark: #a9231c;
  --blue: #344b5f;
  --content: 1220px;
  --reading: 760px;
  --serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --sans: "Noto Sans TC", "PingFang TC", sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 3%, rgb(255 255 255 / 55%), transparent 32rem),
    var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.28em;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 4px;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 64px, 1360px);
  min-height: 72px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 1.22rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.site-navigation {
  display: flex;
  align-items: center;
  gap: 42px;
  font-family: var(--sans);
  font-size: 0.92rem;
  letter-spacing: 0.1em;
}

.site-navigation a {
  text-decoration: none;
  transition: color 150ms ease;
}

.site-navigation a:hover { color: var(--red); }

.search-link {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.search-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 1.7px solid currentColor;
  border-radius: 50%;
  vertical-align: -2px;
}

.search-icon::after {
  content: "";
  display: block;
  width: 7px;
  border-top: 1.7px solid currentColor;
  transform: translate(11px, 12px) rotate(45deg);
}

.menu-button { display: none; }

.hero {
  display: grid;
  grid-template-columns: minmax(400px, 42%) 1fr;
  width: min(100% - 64px, 1360px);
  min-height: 570px;
  margin: 0 auto;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 68px clamp(40px, 5vw, 90px) 68px clamp(20px, 3vw, 52px);
}

.hero h1 {
  margin: 0;
  font-size: clamp(3rem, 4.7vw, 5.35rem);
  font-weight: 500;
  line-height: 1.24;
  letter-spacing: 0.06em;
}

.hero-dates {
  margin: 31px 0 26px;
  font-family: var(--sans);
  font-size: 0.88rem;
  letter-spacing: 0.08em;
}

.route-line {
  position: relative;
  height: 11px;
  margin-right: 34px;
  border-top: 1px solid var(--red);
}

.route-line::before,
.route-line::after {
  content: "";
  position: absolute;
  top: -5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.route-line::before { left: 0; background: var(--red); }
.route-line::after { right: 0; border: 1px solid var(--red); background: var(--paper); }

.hero-actions {
  display: flex;
  align-items: center;
  gap: 34px;
  margin-top: 22px;
  font-family: var(--sans);
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 54px;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.primary-action {
  padding: 0 24px;
  background: var(--red);
  color: #fff;
  border: 1px solid var(--red);
  transition: background 150ms ease, transform 150ms ease;
}

.primary-action:hover { background: var(--red-dark); transform: translateY(-2px); }

.secondary-action {
  border-bottom: 1px solid var(--ink);
}

.secondary-action:hover { color: var(--red); border-color: var(--red); }

.hero-image {
  margin: 0;
  overflow: hidden;
  background: var(--paper-deep);
}

.hero-image picture,
.hero-image img {
  width: 100%;
  height: 100%;
}

.hero-image img { object-fit: cover; object-position: center; }

.month-archive {
  width: min(100% - 64px, var(--content));
  margin: 0 auto;
  padding: 38px 0 72px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.section-heading a {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--sans);
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.month-list {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.month-list::before {
  content: "";
  position: absolute;
  top: 22px;
  bottom: 22px;
  left: 11px;
  border-left: 1px solid var(--red);
}

.month-list li { position: relative; }

.month-list a {
  display: grid;
  grid-template-columns: 24px 135px minmax(0, 1fr) 144px 24px;
  align-items: center;
  min-height: 62px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: color 150ms ease, padding 150ms ease;
}

.month-list a:hover { color: var(--red); padding-left: 6px; }

.month-dot {
  position: relative;
  z-index: 1;
  width: 8px;
  height: 8px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--red);
}

.month-label {
  color: var(--red);
  font-family: var(--sans);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
}

.month-places {
  overflow: hidden;
  padding-right: 20px;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-thumbnail {
  width: 124px;
  height: 52px;
  margin-left: auto;
  object-fit: cover;
}

.month-arrow { justify-self: end; font-family: var(--sans); }

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 64px, var(--content));
  min-height: 104px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.site-footer nav { display: flex; gap: 30px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--red); }

.entry {
  width: min(100% - 40px, 980px);
  margin: 0 auto;
  padding: 30px 0 70px;
}

.entry-header { margin-bottom: 42px; }

.entry-progress-meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--sans);
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.09em;
}

.entry-progress {
  position: relative;
  height: 1px;
  margin: 15px 0 62px;
  background: var(--line);
}

.entry-progress::before,
.entry-progress::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--red);
}

.entry-progress::before { left: 0; background: var(--red); }
.entry-progress::after { right: 0; }

.entry-progress span {
  display: block;
  height: 1px;
  background: var(--red);
}

.entry-header h1 {
  width: var(--reading);
  max-width: 100%;
  margin: 0 auto 30px;
  font-size: clamp(2rem, 4.2vw, 3.55rem);
  font-weight: 500;
  line-height: 1.36;
  letter-spacing: 0.035em;
}

.entry-metadata {
  width: var(--reading);
  max-width: 100%;
  margin: 0 auto;
  border-top: 1px solid var(--line);
}

.entry-metadata div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.entry-metadata dt {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
}

.entry-metadata dd {
  margin: 0;
  color: #3e403d;
  font-size: 0.9rem;
  line-height: 1.7;
}

.entry-body {
  width: var(--reading);
  max-width: 100%;
  margin: 0 auto;
  font-size: 1.08rem;
  line-height: 2.05;
  letter-spacing: 0.035em;
}

.entry-body p { margin: 0 0 1.45em; }

.entry-body picture {
  display: block;
  margin: 40px calc((min(980px, 100vw - 40px) - min(760px, 100vw - 40px)) / -2) 14px;
}

.entry-body picture img {
  width: 100%;
  background: var(--paper-deep);
}

.entry-body picture + p { margin-top: 34px; }

.entry-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 62px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.entry-navigation > * {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 120px;
  padding: 20px 26px;
  text-decoration: none;
}

.entry-navigation > *:first-child { border-right: 1px solid var(--line); }
.entry-navigation a:hover { color: var(--red); }
.entry-navigation small { display: block; margin-bottom: 7px; color: var(--muted); font-family: var(--sans); }
.next-entry { text-align: right; }
.disabled { color: #aaa69c; }

.return-link {
  display: flex;
  justify-content: center;
  gap: 24px;
  width: fit-content;
  margin: 34px auto 0;
  font-family: var(--sans);
  font-size: 0.88rem;
  text-decoration: none;
}

.return-link:hover { color: var(--red); }

.archive-header,
.search-shell,
.not-found {
  width: min(100% - 40px, 920px);
  margin: 0 auto;
}

.archive-header { padding: 86px 0 46px; }

.archive-header > p:first-child,
.search-shell header > p:first-child {
  font-family: var(--sans);
  font-size: 0.85rem;
}

.archive-header a,
.search-shell a { text-decoration: none; }
.archive-header a:hover,
.search-shell a:hover { color: var(--red); }

.archive-header h1,
.search-shell h1 {
  margin: 42px 0 12px;
  font-size: clamp(3rem, 7vw, 5.6rem);
  font-weight: 500;
  letter-spacing: 0.06em;
}

.archive-header > p:last-child,
.search-shell header > p:last-child {
  color: var(--muted);
  font-family: var(--sans);
  letter-spacing: 0.06em;
}

.entry-list {
  width: min(100% - 40px, 920px);
  margin: 0 auto 90px;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.entry-list a {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) minmax(160px, 32%) 24px;
  gap: 20px;
  align-items: center;
  min-height: 82px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: color 150ms ease, transform 150ms ease;
}

.entry-list a:hover { color: var(--red); transform: translateX(5px); }
.entry-list time { color: var(--red); font-family: var(--sans); font-size: 1.1rem; }
.entry-list-title { font-size: 1.05rem; }
.entry-list-city { overflow: hidden; color: var(--muted); font-size: 0.82rem; text-overflow: ellipsis; white-space: nowrap; }

.search-shell { min-height: 70vh; padding: 84px 0; }
.search-shell header { margin-bottom: 44px; }

.pagefind-ui__search-input {
  width: 100%;
  padding: 19px 54px 19px 0 !important;
  border: 0 !important;
  border-bottom: 1px solid var(--ink) !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--ink) !important;
  font-family: var(--serif) !important;
  font-size: 1.35rem !important;
}

.pagefind-ui__search-clear { font-family: var(--sans) !important; }
.pagefind-ui__drawer { margin-top: 38px; }
.pagefind-ui__result { border-top: 1px solid var(--line) !important; }
.pagefind-ui__result:last-child { border-bottom: 1px solid var(--line); }
.pagefind-ui__result-title { font-family: var(--serif) !important; }
.pagefind-ui__result-link { color: var(--ink) !important; }
.pagefind-ui__result-link:hover { color: var(--red) !important; }
.pagefind-ui__result-excerpt { font-family: var(--serif) !important; line-height: 1.8 !important; }
.pagefind-ui__button { border: 1px solid var(--ink) !important; border-radius: 0 !important; background: transparent !important; font-family: var(--sans) !important; }

.not-found { min-height: 68vh; padding: 110px 0; text-align: center; }
.not-found-code { margin: 0; color: var(--red); font-family: var(--sans); letter-spacing: 0.2em; }
.not-found h1 { margin: 22px 0; font-size: clamp(2.5rem, 6vw, 5rem); font-weight: 500; }
.not-found > .primary-action { margin-top: 28px; }

@media (max-width: 900px) {
  .site-header { width: min(100% - 40px, 1360px); }

  .menu-button {
    display: grid;
    width: 42px;
    height: 42px;
    padding: 9px 5px;
    border: 0;
    background: transparent;
    cursor: pointer;
  }

  .menu-button span:not(.visually-hidden) {
    display: block;
    width: 30px;
    border-top: 2px solid var(--ink);
  }

  .site-navigation {
    position: absolute;
    top: 71px;
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 20px 22px;
    border-bottom: 1px solid var(--line);
    background: var(--paper);
  }

  .site-navigation.is-open { display: flex; }
  .site-navigation a { padding: 14px 0; border-bottom: 1px solid var(--line); }

  .hero {
    display: flex;
    flex-direction: column;
    width: min(100% - 40px, 740px);
    min-height: 0;
    padding: 62px 0 50px;
  }

  .hero-copy { display: contents; }
  .hero h1 { order: 1; font-size: clamp(3.1rem, 12vw, 5.3rem); line-height: 1.35; }
  .hero-dates { order: 2; margin: 23px 0 34px; font-size: 0.84rem; }
  .hero-image { order: 3; width: 100%; aspect-ratio: 4 / 3; }
  .route-line { order: 4; margin: 40px 10px 0; }
  .hero-actions { order: 5; margin-top: 20px; }

  .month-archive { width: min(100% - 40px, 740px); padding-top: 38px; }
  .month-list a { grid-template-columns: 28px 125px minmax(0, 1fr) 24px; min-height: 72px; }
  .month-thumbnail { display: none; }

  .entry-body picture { margin-right: 0; margin-left: 0; }
}

@media (max-width: 620px) {
  .site-header { min-height: 68px; }
  .brand { font-size: 1.05rem; }
  .site-navigation { top: 67px; }

  .hero { padding-top: 48px; }
  .hero h1 { font-size: clamp(2.8rem, 13vw, 4rem); }
  .hero-dates span { display: none; }
  .hero-dates { line-height: 1.9; }
  .hero-actions { justify-content: space-between; gap: 18px; }
  .primary-action,
  .secondary-action { min-height: 52px; gap: 12px; font-size: 0.86rem; }
  .primary-action { padding: 0 16px; }

  .section-heading h2 { font-size: 1.35rem; }
  .month-list::before { left: 7px; }
  .month-list a { grid-template-columns: 22px 100px minmax(0, 1fr) 18px; min-height: 86px; }
  .month-dot { margin-left: 4px; }
  .month-label { font-size: 0.82rem; }
  .month-places { overflow: visible; padding-right: 8px; font-size: 0.84rem; line-height: 1.65; white-space: normal; }

  .site-footer { display: block; width: calc(100% - 40px); padding: 25px 0; }
  .site-footer nav { margin-top: 18px; }

  .entry { padding-top: 24px; }
  .entry-progress { margin-bottom: 46px; }
  .entry-header h1 { font-size: 2.25rem; }
  .entry-metadata div { display: block; padding: 12px 0; }
  .entry-metadata dt { margin-bottom: 5px; }
  .entry-body { font-size: 1.02rem; line-height: 2; }
  .entry-body picture { margin-top: 32px; }
  .entry-navigation { grid-template-columns: 1fr; }
  .entry-navigation > * { min-height: 96px; padding: 18px 10px; }
  .entry-navigation > *:first-child { border-right: 0; border-bottom: 1px solid var(--line); }

  .archive-header { padding: 58px 0 32px; }
  .archive-header h1,
  .search-shell h1 { margin-top: 34px; font-size: 3rem; }
  .entry-list a { grid-template-columns: 38px 1fr 18px; gap: 13px; min-height: 88px; }
  .entry-list-city { display: none; }
  .entry-list-title { font-size: 0.96rem; line-height: 1.55; }
  .search-shell { padding-top: 58px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
