/* 天一生活 — site stylesheet */
:root {
  --green: #3a5a40;
  --green-dark: #2d4732;
  --accent: #588157;
  --text: #222;
  --muted: #667;
  --line: #d9dee4;
  --bg: #f5f6f4;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Helvetica Neue", Arial, "Noto Sans TC", "PingFang TC",
               "Microsoft JhengHei", sans-serif;
  line-height: 1.7;
}

.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px; }

/* header (logo is dark calligraphy on white, so the header stays light) */
.site-header { background: #fff; border-bottom: 3px solid var(--green); }
.header-inner {
  display: flex; align-items: center; gap: 16px;
  padding-top: 14px; padding-bottom: 14px;
}
.brand { display: block; min-width: 0; }
.brand img { display: block; width: auto; max-width: 100%; height: auto; }

/* main nav */
.main-nav { background: var(--green); }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.main-nav li a {
  display: block; padding: 12px 18px; color: #fff; text-decoration: none;
  font-size: 1rem;
}
.main-nav li a:hover { background: var(--green-dark); }
.main-nav li.current a { background: var(--green-dark); font-weight: 700; }
.menu-toggle { display: none; }

/* layout */
.layout { padding-top: 28px; padding-bottom: 48px; }
main {
  background: #fff; border: 1px solid var(--line);
  border-radius: 6px; padding: 28px 32px;
}
main h1, main h2 { color: var(--green-dark); line-height: 1.4; }
main h1 { font-size: 1.5rem; }
main h2 { font-size: 1.3rem; }
main img { max-width: 100%; height: auto; }
main a { color: var(--accent); }
main hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

main table { border-collapse: collapse; max-width: 100%; margin: 12px 0; }
main table td, main table th {
  border: 1px solid #b9c2cc; padding: 6px 10px; vertical-align: top;
}

/* Weebly multicol layout tables: plain side-by-side columns, not data
   tables (fragments keep the construct with class="multicol") */
main .multicol > table { width: 100%; margin: 0; table-layout: fixed; }
main .multicol > table > tbody > tr { background: none; }
main .multicol > table > tbody > tr > td { border: 0; padding: 0 5px; }

/* photo gallery (replaces Weebly's script-driven slideshows) */
main .gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px; margin: 16px 0;
}
main .gallery figure { margin: 0; }
main .gallery img {
  width: 100%; height: 200px; object-fit: cover;
  border-radius: 4px; display: block;
}
main .gallery figcaption { font-size: .85rem; color: var(--muted); padding: 4px 2px; }

/* click-to-zoom lightbox (assets/lightbox.js) */
main .gallery a { display: block; cursor: zoom-in; }
.lightbox-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0, 0, 0, .88);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.lightbox-overlay > img {
  max-width: 94vw; max-height: 86vh;
  border-radius: 4px; box-shadow: 0 4px 30px rgba(0, 0, 0, .6);
}
.lightbox-caption {
  color: #eee; font-size: .9rem; padding: 8px 16px;
  text-align: center; min-height: 1.5em;
}
.lightbox-overlay button {
  position: absolute; background: none; border: 0; color: #fff;
  font-size: 2.4rem; line-height: 1; padding: 12px 18px;
  cursor: pointer; opacity: .8;
}
.lightbox-overlay button:hover { opacity: 1; }
.lightbox-close { top: 6px; right: 6px; }
.lightbox-prev { left: 0; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 0; top: 50%; transform: translateY(-50%); }

/* embedded video (YouTube) */
main .video { margin: 16px 0; }
main .video iframe { border: 0; width: 100%; max-width: 720px; aspect-ratio: 16 / 9; }

/* article list (文章分享) */
.news-list { list-style: none; padding: 0; }
.news-list li { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.news-date { color: var(--muted); font-size: .9rem; margin-right: 10px; }

/* back link on sub-pages and posts */
main .back { margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--line); }

/* footer */
.site-footer {
  background: var(--green); color: #dbe5db; padding: 20px 0; font-size: .9rem;
}
.site-footer a { color: #fff; }

/* mobile */
@media (max-width: 900px) {
  main { padding: 20px 16px; }
  /* stack multicol layout columns (inline widths need the override) */
  main .multicol > table,
  main .multicol > table > tbody,
  main .multicol > table > tbody > tr,
  main .multicol > table > tbody > tr > td {
    display: block; width: auto !important;
  }
  .menu-toggle {
    display: block; background: none; border: 1px solid rgba(255,255,255,.4);
    color: #fff; font-size: 1rem; padding: 8px 14px; margin: 8px 0;
    border-radius: 4px;
  }
  .main-nav ul { display: none; }
  body.nav-open .main-nav ul { display: block; }
}
