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

:root {
  --page: #f8f2e8;
  --paper: #fffaf3;
  --paper-soft: #f4eadc;
  --ink: #3a1b0b;
  --ink-soft: #674734;
  --coffee: #54230d;
  --coffee-deep: #3a1708;
  --line: #dfd0bf;
  --line-soft: rgba(84, 35, 13, 0.16);
  --field: #fffdf8;
  --focus: #8b5a35;
  --success: #517448;
  --danger: #9c4c43;
  --radius: 6px;
  --shadow: 0 12px 30px rgba(84, 35, 13, 0.10);
  --body-font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Segoe UI", sans-serif;
  --display-font: "Josefin Sans", "Noto Sans TC", sans-serif;
  --header-offset: 76px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

html {
  scroll-padding-top: var(--header-offset);
}

body {
  min-width: 320px;
  background: var(--page);
  color: var(--ink);
  font-family: var(--body-font);
  line-height: 1.55;
}

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

a {
  color: inherit;
}

.header {
  position: sticky;
  top: 0;
  z-index: 1200;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 243, 0.96);
  box-shadow: 0 3px 14px rgba(60, 29, 13, 0.08);
  backdrop-filter: blur(14px);
}

.topbar {
  width: min(100%, 1380px);
  min-height: 66px;
  margin: 0 auto;
  padding: 0 48px;
  display: grid;
  grid-template-columns: 320px 1fr auto;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand img {
  width: 236px;
  height: 54px;
  object-fit: contain;
  object-position: left center;
}

.nav {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 30px;
  min-width: 0;
}

.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 66px;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: transparent;
}

.nav a:hover::after,
.nav a:focus-visible::after,
.nav a.active::after {
  background: var(--coffee);
}

.lang-switch {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.lang-switch button {
  min-width: 54px;
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  background: #eee7de;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
}

.lang-switch button.active {
  background: var(--coffee);
  color: #fffaf3;
}

main {
  overflow: hidden;
}

.hero {
  position: relative;
  min-height: 292px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(248, 242, 232, 1) 0%, rgba(248, 242, 232, 0.96) 28%, rgba(248, 242, 232, 0.68) 50%, rgba(248, 242, 232, 0.03) 72%),
    var(--paper-soft);
  scroll-margin-top: var(--header-offset);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 250, 243, 0.56) 0%, rgba(255, 250, 243, 0.18) 38%, rgba(255, 250, 243, 0) 64%);
  pointer-events: none;
}

.hero-image {
  position: absolute;
  top: 0;
  right: 0;
  width: 58%;
  height: 100%;
  min-height: 292px;
  object-fit: cover;
  object-position: center;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(100%, 1380px);
  min-height: 292px;
  margin: 0 auto;
  padding: 42px 48px 34px;
  display: grid;
  align-items: center;
}

.hero-copy {
  width: min(420px, 42vw);
}

.hero h1 {
  margin: 0 0 14px;
  color: var(--coffee-deep);
  font-size: 2.28rem;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0;
  white-space: pre-line;
}

.hero p {
  width: min(380px, 100%);
  margin: 0 0 22px;
  color: var(--ink-soft);
  font-size: 1rem;
}

.ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.button {
  min-width: 138px;
  min-height: 39px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--coffee);
  border-radius: var(--radius);
  padding: 8px 22px;
  background: var(--coffee);
  color: #fffaf3;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary {
  background: transparent;
  color: var(--coffee);
}

.content-band {
  width: min(100%, 1380px);
  margin: 0 auto;
  display: grid;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 243, 0.42);
}

.story-contact-band {
  grid-template-columns: minmax(0, 1.47fr) minmax(390px, 0.93fr);
}

.lower-band {
  grid-template-columns: minmax(430px, 0.94fr) minmax(0, 1.06fr);
}

.panel {
  padding: 20px 30px;
  scroll-margin-top: var(--header-offset);
}

.story-contact-band .contact-panel,
.lower-band .map-panel {
  border-left: 1px solid var(--line);
}

.contact-panel {
  padding-top: 18px;
  padding-bottom: 18px;
}

.contact-panel .panel-heading {
  margin-bottom: 8px;
}

.contact-panel .section-subtitle {
  line-height: 1.35;
}

.contact-panel .form-grid {
  gap: 8px 18px;
}

.contact-panel .field {
  gap: 3px;
}

.contact-panel label {
  font-size: 0.84rem;
  line-height: 1.2;
}

.contact-panel input,
.contact-panel select {
  min-height: 31px;
  padding-top: 5px;
  padding-bottom: 5px;
}

.contact-panel textarea {
  min-height: 64px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.contact-panel .form-actions {
  margin-top: 8px;
}

.contact-panel .button {
  min-height: 36px;
}

.contact-panel .feedback {
  min-height: 36px;
  margin-top: 10px;
  padding-top: 7px;
  padding-bottom: 7px;
}

.panel-heading {
  margin-bottom: 12px;
}

.section-title {
  margin: 0;
  color: var(--coffee-deep);
  font-size: 1.38rem;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: 0;
}

.section-subtitle {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(360px, 1.04fr);
  gap: 30px;
  align-items: start;
}

.story-copy {
  color: var(--ink);
  font-size: 0.93rem;
}

.story-copy p {
  margin: 0 0 8px;
}

.story-copy strong {
  color: var(--coffee-deep);
  font-weight: 700;
}

.story-media,
.faq-art {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius);
}

.story-media img {
  width: 100%;
  aspect-ratio: 16 / 8;
  object-fit: cover;
}

.story-media figcaption {
  padding-top: 8px;
  color: var(--ink-soft);
  text-align: center;
  font-size: 0.82rem;
}

.gallery-heading {
  margin-top: 6px;
}

.gallery-heading h3 {
  margin: 0;
  color: var(--coffee-deep);
  font-size: 1.18rem;
}

.gallery-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.gallery-card,
.image-card {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--paper);
}

.image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--paper-soft);
}

.image-wrap.ratio-16-9 {
  aspect-ratio: 16 / 9;
}

.image-wrap.ratio-1-1 {
  aspect-ratio: 1 / 1;
}

.image-wrap.ratio-4-3 {
  aspect-ratio: 4 / 3;
}

.image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 220ms ease;
}

.image-card:hover .image-wrap img {
  transform: scale(1.025);
}

.image-card-body {
  display: none;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
}

.form-wide {
  grid-column: 1 / -1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

label {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
}

.field label::after {
  content: " *";
  color: var(--danger);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #d4c3b2;
  border-radius: 4px;
  background: var(--field);
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
  font-size: 0.88rem;
  line-height: 1.35;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input,
select {
  min-height: 35px;
}

textarea {
  min-height: 78px;
  resize: vertical;
}

select {
  appearance: none;
  padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%),
    linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%;
  background-repeat: no-repeat;
  background-size: 6px 6px;
}

select option {
  color: var(--ink);
  background: var(--field);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 2px rgba(139, 90, 53, 0.14);
  outline: none;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  margin-top: 12px;
}

.form-actions .button {
  width: 100%;
}

.feedback {
  min-height: 40px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 12px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.feedback.ok {
  border-color: rgba(81, 116, 72, 0.42);
  background: rgba(81, 116, 72, 0.08);
  color: var(--success);
}

.feedback.err {
  border-color: rgba(156, 76, 67, 0.38);
  background: rgba(156, 76, 67, 0.08);
  color: var(--danger);
}

.faq-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(220px, 0.9fr);
  gap: 22px;
  align-items: stretch;
}

.faq-list {
  display: grid;
  gap: 0;
}

.faq-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: rgba(255, 250, 243, 0.84);
}

.faq-item:first-child {
  border-radius: var(--radius) var(--radius) 0 0;
}

.faq-item:last-child {
  border-bottom: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
}

.faq-question {
  width: 100%;
  min-height: 39px;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 9px 14px;
  text-align: left;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
}

.faq-question::after {
  content: "⌄";
  float: right;
  color: var(--ink-soft);
}

.faq-answer {
  max-height: 0;
  margin: 0;
  overflow: hidden;
  color: var(--ink-soft);
  padding: 0 14px;
  font-size: 0.88rem;
  transition: max-height 0.24s ease, padding 0.24s ease;
}

.faq-answer.open {
  padding-bottom: 12px;
}

.faq-art img {
  width: 100%;
  height: 100%;
  min-height: 175px;
  object-fit: cover;
  object-position: center;
}

.map-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.68fr);
  gap: 0;
  min-height: 235px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
}

#partnerMap {
  min-height: 235px;
  height: 235px;
}

#mapStatus {
  display: none;
}

.partner-panel {
  border-left: 1px solid var(--line);
  background: rgba(255, 250, 243, 0.86);
}

.partner-list {
  max-height: 235px;
  overflow: auto;
}

.partner-item {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  background: transparent;
}

.partner-item p {
  margin: 2px 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.35;
}

.partner-item strong {
  color: var(--coffee-deep);
}

.leaflet-container {
  font-family: var(--body-font);
}

footer {
  width: min(100%, 1380px);
  margin: 0 auto;
  padding: 18px 48px 28px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  text-align: center;
}

.section {
  width: min(100%, 760px);
  margin: 24px auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 243, 0.76);
  padding: 24px;
  box-shadow: var(--shadow);
}

.login-standalone {
  min-height: calc(100dvh - 90px);
  display: grid;
  place-items: center;
  margin-top: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.login-auth {
  width: min(540px, 100%);
}

.login-auth form {
  display: grid;
  gap: 14px;
}

.login-auth .form-actions {
  gap: 14px;
}

@media (max-width: 1120px) {
  .topbar {
    grid-template-columns: 260px 1fr auto;
    padding: 0 24px;
    gap: 16px;
  }

  .brand img {
    width: 220px;
  }

  .nav {
    gap: 18px;
  }

  .story-contact-band,
  .lower-band {
    grid-template-columns: 1fr;
  }

  .story-contact-band .contact-panel,
  .lower-band .map-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .hero-inner {
    padding-right: 24px;
    padding-left: 24px;
  }

  .panel {
    padding-right: 24px;
    padding-left: 24px;
  }
}

@media (max-width: 820px) {
  :root {
    --header-offset: 140px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    padding: 10px 18px;
  }

  .brand img {
    width: 210px;
    height: 48px;
  }

  .nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    gap: 18px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav a {
    min-height: 42px;
  }

  .hero {
    min-height: 0;
    display: flex;
    flex-direction: column-reverse;
  }

  .hero-image {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 7;
  }

  .hero::after {
    display: none;
  }

  .hero-inner {
    align-items: start;
    min-height: 0;
    padding-top: 34px;
    padding-bottom: 24px;
  }

  .hero-copy {
    width: 100%;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .story-grid,
  .faq-layout,
  .map-wrap {
    grid-template-columns: 1fr;
  }

  .partner-panel {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .gallery-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .lang-switch {
    justify-self: start;
  }

  .hero-inner,
  .panel,
  footer {
    padding-right: 16px;
    padding-left: 16px;
  }

  .hero h1 {
    font-size: 1.74rem;
  }

  .ctas,
  .form-actions {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .gallery-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
