/* =====================================================
   Kiera & Laufey — 前台樣式
   設計風格：極簡白底攝影展示
   ===================================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: 'Noto Sans TC', system-ui, -apple-system, sans-serif;
  color: #1a1a1a;
  background: #fff;
  line-height: 1.6;
}
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; transition: opacity .2s; }
a:hover { opacity: .6; }

/* ----- Header ----- */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2.5rem 3rem;
  max-width: 1500px;
  margin: 0 auto;
}
.brand {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.site-header nav ul {
  list-style: none;
  display: flex;
  gap: 2.5rem;
  align-items: center;
}
.site-header nav a {
  font-size: .95rem;
  letter-spacing: .05em;
  padding-bottom: 4px;
}
.site-header nav a.active {
  border-bottom: 1px solid #1a1a1a;
}

/* ----- Hero Clock ----- */
.hero-clock {
  padding: 4rem 1.5rem 7rem;
  text-align: center;
}
.clock-title {
  font-size: .85rem;
  letter-spacing: .3em;
  color: #888;
  margin-bottom: 3rem;
  text-transform: uppercase;
}
.clock-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2rem;
  max-width: 1100px;
  margin: 0 auto;
}
.clock-grid > div {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.clock-grid span {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: clamp(3rem, 8vw, 6.5rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.clock-grid label {
  font-size: .7rem;
  letter-spacing: .3em;
  color: #999;
  margin-top: 1.2rem;
}
.clock-sub {
  margin-top: 3rem;
  font-size: .85rem;
  letter-spacing: .15em;
  color: #aaa;
}

/* ----- Section title ----- */
.section-title { text-align: center; margin: 2rem 0 3rem; }
.section-title h2 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400;
  font-size: 2rem;
  letter-spacing: .1em;
}
.section-title p {
  font-size: .85rem; color: #888;
  letter-spacing: .15em; text-transform: uppercase;
  margin-top: .5rem;
}
.page-title {
  max-width: 900px; margin: 4rem auto 2rem; padding: 0 2rem; text-align: center;
}
.page-title h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400; font-size: 2.5rem; letter-spacing: .05em;
  margin-bottom: .5rem;
}
.page-title time { color: #888; font-size: .9rem; letter-spacing: .1em; }
.album-desc { margin-top: 1rem; color: #555; }

/* ----- Masonry ----- */
.masonry {
  column-count: 4;
  column-gap: 20px;
  padding: 0 3rem 6rem;
  max-width: 1500px;
  margin: 0 auto;
}
.masonry .photo {
  break-inside: avoid;
  margin-bottom: 20px;
  display: block;
  overflow: hidden;
}
.masonry .photo img {
  width: 100%;
  transition: transform .4s ease, opacity .3s;
}
.masonry .photo:hover img { transform: scale(1.02); opacity: .9; }

/* ----- Album grid ----- */
.album-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3rem 2rem;
  padding: 0 3rem 6rem;
  max-width: 1300px;
  margin: 0 auto;
}
.album-card { display: block; }
.album-cover {
  aspect-ratio: 4/3;
  overflow: hidden;
  margin-bottom: 1rem;
  background: #f5f5f5;
}
.album-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.album-card:hover .album-cover img { transform: scale(1.03); }
.album-cover-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #e8e8ec, #f5f5f7);
}
.album-title { font-size: 1rem; letter-spacing: .05em; }
.album-date { color: #888; font-size: .8rem; letter-spacing: .1em; }

/* ----- Photo Detail ----- */
.photo-detail {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.5rem 4rem;
}
.photo-nav-top {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 1rem;
  font-size: .9rem; color: #666;
}
.back-link { letter-spacing: .05em; }
.photo-counter { letter-spacing: .15em; }

.photo-stage {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  background: #fafafa;
  min-height: 60vh;
}
.photo-main {
  max-width: 100%; max-height: 80vh; object-fit: contain;
  margin: 0 auto;
}
.photo-arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-size: 3rem; line-height: 1;
  color: #1a1a1a;
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(4px);
  transition: background .2s;
}
.photo-arrow:hover { background: rgba(255,255,255,.95); opacity: 1; }
.photo-prev { left: 1rem; }
.photo-next { right: 1rem; }

.photo-caption {
  text-align: center;
  margin: 1.5rem auto;
  max-width: 700px;
  color: #555;
}

/* ----- Dot navigation ----- */
.photo-dots {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 8px; margin: 2rem 0;
}
.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ccc;
  transition: background .2s, transform .2s;
}
.dot:hover { background: #888; opacity: 1; }
.dot.active { background: #1a1a1a; transform: scale(1.4); }

/* ----- Comments ----- */
.comments {
  max-width: 700px;
  margin: 4rem auto 0;
  padding-top: 3rem;
  border-top: 1px solid #eaeaea;
}
.comments h3 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400; font-size: 1.5rem; letter-spacing: .05em;
  margin-bottom: 1.5rem;
}
.comment-list { list-style: none; margin-bottom: 2rem; }
.comment {
  padding: 1rem 0;
  border-bottom: 1px solid #f0f0f0;
}
.comment.is-admin { background: #fafaf5; padding-left: 1rem; padding-right: 1rem; }
.comment-meta {
  display: flex; align-items: baseline; gap: .75rem;
  margin-bottom: .25rem;
  font-size: .85rem;
}
.comment-meta strong { font-weight: 500; }
.comment-meta time { color: #999; font-size: .75rem; margin-left: auto; }
.tag-admin {
  display: inline-block; padding: 1px 8px;
  background: #1a1a1a; color: #fff; font-size: .7rem;
  letter-spacing: .1em;
}
.comment-content { color: #444; }

.comment-form { margin-top: 1.5rem; }
.form-row { margin-bottom: 1rem; position: relative; }
.form-row input[type=text],
.form-row textarea {
  width: 100%;
  padding: .75rem;
  border: 1px solid #e0e0e0;
  background: #fafafa;
  font-family: inherit; font-size: .95rem;
  transition: border-color .2s;
}
.form-row textarea { resize: vertical; min-height: 80px; }
.form-row input:focus, .form-row textarea:focus {
  outline: none; border-color: #1a1a1a; background: #fff;
}
.form-meta {
  position: absolute; bottom: 8px; right: 12px;
  font-size: .75rem; color: #999;
}
.captcha-row {
  display: flex; gap: .75rem; align-items: center; flex-wrap: wrap;
}
.captcha-row label { font-size: .9rem; color: #555; }
.captcha-row input[type=text] {
  width: 80px; text-align: center;
}
.btn-submit {
  margin-left: auto;
  padding: .75rem 2rem;
  background: #1a1a1a; color: #fff;
  border: none; cursor: pointer;
  font-family: inherit; font-size: .9rem;
  letter-spacing: .1em;
  transition: opacity .2s;
}
.btn-submit:hover { opacity: .8; }

/* ----- Flash ----- */
.flash {
  max-width: 700px; margin: 1rem auto;
  padding: .75rem 1rem;
  font-size: .9rem;
  text-align: center;
}
.flash-success { background: #f0f9f4; color: #1a6f3c; border: 1px solid #c8e6d4; }
.flash-error   { background: #fdf2f2; color: #b91c1c; border: 1px solid #f8c8c8; }

/* ----- Empty / Error ----- */
.empty-state {
  text-align: center; padding: 6rem 1rem; color: #888;
}
.error-page {
  text-align: center; padding: 6rem 1rem;
}
.error-page h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: 6rem; line-height: 1;
}
.error-page p { color: #888; margin: 1rem 0 2rem; }
.btn-primary {
  display: inline-block;
  padding: .75rem 2rem;
  background: #1a1a1a; color: #fff;
  letter-spacing: .1em; font-size: .9rem;
}
.btn-primary:hover { opacity: .85; }

/* ----- Footer ----- */
.site-footer {
  border-top: 1px solid #eaeaea;
  padding: 3rem;
  text-align: center;
  font-size: .85rem;
  color: #999;
  letter-spacing: .1em;
}

/* ----- Install page ----- */
.install-page {
  min-height: 80vh;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
}
.install-card {
  max-width: 500px; width: 100%;
  padding: 3rem 2rem;
  border: 1px solid #eaeaea;
}
.install-card h1 {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 400; font-size: 2rem; margin-bottom: .5rem;
}
.install-intro { color: #666; margin-bottom: 2rem; }
.install-form label {
  display: block; margin-bottom: 1rem;
  font-size: .85rem; color: #666;
}
.install-form input {
  display: block; width: 100%; margin-top: .5rem;
  padding: .75rem; border: 1px solid #e0e0e0;
  font-family: inherit; font-size: 1rem;
}
.install-form input:focus { outline: none; border-color: #1a1a1a; }
.install-form button { width: 100%; margin-top: 1rem; }

/* ===================================================
   訪客通關（Visitor Gate）
   =================================================== */
.gate-page {
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: #fff;
}
.gate-stage {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 3rem 1.5rem;
}
.gate-card {
  width: 100%;
  max-width: 420px;
  text-align: center;
  padding: 3rem 2rem;
}
.gate-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem; letter-spacing: .25em;
  text-transform: uppercase;
  color: #1a1a1a;
  margin-bottom: 2.5rem;
}
.gate-title {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  font-size: 2rem;
  letter-spacing: .1em;
  margin-bottom: 1rem;
}
.gate-message {
  color: #777;
  font-size: .9rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}
.gate-error {
  color: #b91c1c;
  background: #fdf2f2;
  border: 1px solid #f8c8c8;
  padding: .65rem;
  font-size: .85rem;
  margin-bottom: 1rem;
}
.gate-form { text-align: left; }
.gate-input {
  display: block;
  margin-bottom: 1rem;
}
.gate-input span {
  display: block;
  font-size: .75rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: #999;
  margin-bottom: .5rem;
}
.gate-input input {
  width: 100%;
  padding: .8rem;
  border: 1px solid #e0e0e0;
  background: #fafafa;
  font-family: inherit;
  font-size: 1rem;
  letter-spacing: .15em;
  text-align: center;
}
.gate-input input:focus {
  outline: none;
  border-color: #1a1a1a;
  background: #fff;
}
.gate-remember {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  color: #666;
  margin-bottom: 1.5rem;
  cursor: pointer;
}
.gate-submit {
  width: 100%;
  padding: .9rem;
  background: #1a1a1a;
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: .9rem;
  letter-spacing: .25em;
  cursor: pointer;
  transition: opacity .2s;
}
.gate-submit:hover { opacity: .85; }
.gate-footer {
  text-align: center;
  padding: 1.5rem;
  color: #aaa;
  font-size: .8rem;
  letter-spacing: .1em;
}

/* ----- RWD ----- */
@media (max-width: 1100px) {
  .masonry { column-count: 3; }
  .album-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .site-header { padding: 1.5rem; flex-direction: column; gap: 1rem; }
  .site-header nav ul { gap: 1.5rem; }
  .clock-grid { grid-template-columns: repeat(3, 1fr); gap: 1.5rem 2rem; }
  .clock-grid > div:nth-child(4) { grid-column: 1 / 3; }
  .clock-grid > div:nth-child(5) { grid-column: 3 / 4; }
  .masonry { column-count: 2; padding: 0 1rem 4rem; }
  .album-grid { grid-template-columns: 1fr; padding: 0 1.5rem 4rem; }
  .photo-arrow { width: 40px; height: 40px; font-size: 2.2rem; }
}
@media (max-width: 480px) {
  .masonry { column-count: 1; }
}
