/* ==========================================================================
   瑞穗牧場 — 共用樣式
   Used by the contact / privacy / terms pages and the rebuilt guestbook.
   The home page loads it too, with home.css layered on top.
   ========================================================================== */

:root {
  --brand:       #b4996a;
  --brand-dark:  #8f7550;
  --brand-deep:  #4c4326;
  --brand-light: #e9d9b0;
  --ink:         #2b2b2b;
  --ink-soft:    #5f5f5f;
  --paper:       #fffdf8;
  --surface:     #fff;
  --rule:        rgba(0, 0, 0, .12);
  --radius:      12px;
  --measure:     70ch;
  --font: "Helvetica Neue", Arial, "PingFang TC", "Noto Sans TC",
          "Microsoft JhengHei", "微軟正黑體", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: clamp(15px, .95rem + .2vw, 17px);
  line-height: 1.8;
  color: var(--ink);
  background: var(--brand);
  overflow-wrap: break-word;
}

img { max-width: 100%; height: auto; display: block; border: 0; }
a { color: var(--brand-dark); }
a:hover, a:focus-visible { color: var(--ink); }
:focus-visible { outline: 2px solid var(--brand-dark); outline-offset: 2px; }

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

/* ---------- Shell ------------------------------------------------------- */

.wrap { max-width: 1080px; margin: 0 auto; background: var(--paper); }

/* ---------- Masthead ---------------------------------------------------- */

.masthead {
  position: relative;
  background: var(--brand-deep);
  color: #fff;
  padding: clamp(2rem, 6vw, 3.5rem) clamp(1.25rem, 4vw, 3rem);
}

.masthead h1 {
  margin: 0;
  font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.4rem);
  line-height: 1.25;
  letter-spacing: .02em;
}

.crumb {
  margin-top: .6rem;
  font-size: .875rem;
  color: rgba(255, 255, 255, .8);
}
.crumb a { color: rgba(255, 255, 255, .9); text-decoration: none; }
.crumb a:hover { text-decoration: underline; color: #fff; }
.crumb span { margin: 0 .4rem; opacity: .6; }

/* ---------- Top navigation ---------------------------------------------- */

.topbar {
  background: var(--brand);
  border-bottom: 1px solid rgba(0, 0, 0, .1);
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .25rem;
  padding: .5rem clamp(1rem, 3vw, 2rem);
}

.topbar a {
  color: #fff;
  text-decoration: none;
  padding: .55rem .8rem;
  border-radius: 6px;
  font-size: .95rem;
}
.topbar a:hover, .topbar a:focus-visible { background: var(--brand-dark); }
.topbar a[aria-current="page"] { background: var(--paper); color: var(--brand-dark); font-weight: 700; }

/* ---------- Content ----------------------------------------------------- */

.main { padding: clamp(1.5rem, 4vw, 3rem); }

.prose { max-width: var(--measure); }
.prose h2 {
  font-size: clamp(1.15rem, 1rem + .6vw, 1.4rem);
  margin: 2.5rem 0 .75rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--brand);
  color: var(--brand-dark);
}
.prose h3 {
  font-size: 1.05rem;
  margin: 1.75rem 0 .5rem;
  color: var(--brand-dark);
}
.prose p { margin: 0 0 1.1rem; }
.prose ul, .prose ol { margin: 0 0 1.2rem; padding-left: 1.4rem; }
.prose li { margin-bottom: .5rem; }
.prose strong { color: var(--brand-dark); }

.updated {
  font-size: .875rem;
  color: var(--ink-soft);
  padding: .6rem .9rem;
  background: var(--brand-light);
  border-radius: var(--radius);
  display: inline-block;
  margin-bottom: 1.5rem;
}

/* ---------- Contact layout ---------------------------------------------- */

.contact-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 1.2fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.contact-list { list-style: none; margin: 0; padding: 0; }

.contact-list li {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: .9rem 0;
  border-bottom: 1px solid var(--rule);
}
.contact-list li:last-child { border-bottom: 0; }

.contact-ico {
  flex: 0 0 auto;
  width: 2.1rem; height: 2.1rem;
  display: grid; place-items: center;
  background: var(--brand-light);
  color: var(--brand-dark);
  border-radius: 50%;
  font-size: .95rem;
}

.contact-list .label {
  display: block;
  font-size: .8rem;
  color: var(--ink-soft);
  letter-spacing: .04em;
}
.contact-list .value { font-size: 1.02rem; }
.contact-list a { text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }

.map-frame {
  border: 0;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  background: var(--brand-light);
}

.map-note { font-size: .85rem; color: var(--ink-soft); margin-top: .6rem; }

/* ---------- Guestbook --------------------------------------------------- */

.gb-intro {
  background: var(--brand-light);
  border-left: 4px solid var(--brand);
  padding: 1rem 1.2rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 2rem;
  max-width: var(--measure);
}
.gb-intro p { margin: 0 0 .5rem; }
.gb-intro p:last-child { margin: 0; }

.thread { margin-bottom: 2rem; }

.msg {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-bottom: .75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}

.msg-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem .75rem;
  margin-bottom: .6rem;
}

.msg-no {
  font-size: .78rem;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  padding: .15rem .5rem;
  border-radius: 999px;
}

.msg-subject {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--brand-dark);
  margin: 0;
  flex: 1 1 12rem;
  min-width: 0;
}

.msg-body { margin: 0 0 .8rem; white-space: pre-line; }

.msg-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .9rem;
  font-size: .85rem;
  color: var(--ink-soft);
  padding-top: .6rem;
  border-top: 1px solid var(--rule);
}
.msg-author { font-weight: 700; color: var(--ink); }

/* Staff replies */
.msg.is-reply {
  margin-left: clamp(0px, 4vw, 2.5rem);
  border-left: 3px solid var(--brand);
  background: #fdfaf3;
}
.msg.is-reply .msg-subject { font-size: .98rem; }

.reply-tag {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--brand-dark);
  background: var(--brand-light);
  padding: .15rem .5rem;
  border-radius: 999px;
}

/* Pager */
.pager {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
  margin: 2.5rem 0 1rem;
}
.pager a, .pager span {
  padding: .55rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  font-size: .95rem;
  border: 1px solid var(--rule);
  background: var(--surface);
}
.pager a:hover { background: var(--brand-light); }
.pager [aria-current="page"] {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  font-weight: 700;
}

/* ---------- Footer ------------------------------------------------------ */

.site-foot {
  background: var(--brand-deep);
  color: rgba(255, 255, 255, .85);
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.25rem, 4vw, 3rem);
  font-size: .9rem;
  line-height: 1.8;
}
.site-foot a { color: #fff; }
.foot-links {
  display: flex; flex-wrap: wrap; gap: .5rem 1.25rem;
  margin: 0 0 1rem; padding: 0; list-style: none;
}
.foot-legal { font-size: .82rem; color: rgba(255, 255, 255, .6); margin: 1rem 0 0; }

/* ---------- Responsive -------------------------------------------------- */

@media (max-width: 820px) {
  .contact-grid { grid-template-columns: 1fr; }
  .map-frame { aspect-ratio: 1 / 1; }
}

@media (max-width: 560px) {
  .topbar-inner { gap: 0; }
  .topbar a { padding: .5rem .6rem; font-size: .88rem; }
  .msg { padding: .9rem 1rem; }
  .msg.is-reply { margin-left: .75rem; }
}

@media print {
  body { background: #fff; }
  .topbar, .pager, .site-foot { display: none; }
  .msg { break-inside: avoid; box-shadow: none; }
}
