/* Guru & Giri 日常 — 自然毛孩風 */
:root {
  --cream: #f7f1e8;
  --cream-deep: #efe6d8;
  --linen: #faf7f2;
  --sage: #7a9a7a;
  --sage-deep: #5f7d5f;
  --sage-soft: #d8e4d6;
  --terracotta: #c4785a;
  --terracotta-soft: #e8c4b4;
  --wood: #8b6b4a;
  --ink: #3a342c;
  --ink-soft: #5c5348;
  --muted: #8a7f72;
  --card: #fffdf9;
  --shadow: 0 8px 28px rgba(58, 52, 44, 0.08);
  --shadow-hover: 0 14px 36px rgba(58, 52, 44, 0.14);
  --radius: 22px;
  --radius-sm: 14px;
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Heiti TC",
    system-ui, -apple-system, sans-serif;
  --max: 1100px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #e8f0e6 0%, transparent 55%),
    radial-gradient(ellipse 70% 40% at 100% 0%, #f3e4db 0%, transparent 50%),
    linear-gradient(180deg, var(--linen) 0%, var(--cream) 40%, var(--cream-deep) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--sage-deep);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Decorative paw watermark */
.paw-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cellipse cx='60' cy='78' rx='18' ry='22' fill='%233a342c'/%3E%3Ccircle cx='38' cy='48' r='10' fill='%233a342c'/%3E%3Ccircle cx='56' cy='38' r='10' fill='%233a342c'/%3E%3Ccircle cx='76' cy='38' r='10' fill='%233a342c'/%3E%3Ccircle cx='90' cy='50' r='10' fill='%233a342c'/%3E%3C/svg%3E");
  background-size: 140px 140px;
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

/* Header / Hero */
.site-header {
  padding: 2.5rem 0 1.5rem;
}

.hero {
  background: var(--card);
  border: 1px solid rgba(122, 154, 122, 0.22);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
  padding: 2rem 1.5rem 1.75rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--sage-soft) 0%, transparent 70%);
  opacity: 0.7;
}

.hero::after {
  content: "";
  position: absolute;
  left: -30px;
  bottom: -50px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--terracotta-soft) 0%, transparent 70%);
  opacity: 0.55;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--sage-deep);
  background: var(--sage-soft);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  margin: 0 0 0.85rem;
}

.hero h1 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.85rem, 5vw, 2.55rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  line-height: 1.25;
}

.hero-lead {
  margin: 0;
  max-width: 36rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.35rem;
}

.cat-pill {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  background: var(--cream);
  border: 1px solid rgba(139, 107, 74, 0.15);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  flex: 1 1 220px;
}

.cat-pill .avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
}

.cat-pill.guru .avatar {
  background: linear-gradient(145deg, #c4a882, #8b6b4a);
}

.cat-pill.giri .avatar {
  background: linear-gradient(145deg, #f0ebe3, #b8c9b5);
}

.cat-pill strong {
  display: block;
  font-size: 1rem;
  color: var(--ink);
}

.cat-pill span {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

/* Filters */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  margin: 1.75rem 0 1.1rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  appearance: none;
  border: 1.5px solid rgba(122, 154, 122, 0.35);
  background: rgba(255, 253, 249, 0.85);
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.filter-btn:hover {
  border-color: var(--sage);
  color: var(--sage-deep);
  transform: translateY(-1px);
}

.filter-btn:focus-visible {
  outline: 3px solid var(--sage-soft);
  outline-offset: 2px;
}

.filter-btn.is-active {
  background: var(--sage);
  border-color: var(--sage);
  color: #fff;
}

.count-label {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Journal grid */
.journal {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.35rem;
  padding-bottom: 3rem;
}

@media (min-width: 720px) {
  .journal {
    grid-template-columns: repeat(2, 1fr);
  }
}

.entry {
  background: var(--card);
  border: 1px solid rgba(139, 107, 74, 0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.entry:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.entry-media {
  position: relative;
  background: var(--cream-deep);
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.entry-media.has-multi .media-track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.entry-media.has-multi .media-track > * {
  flex: 0 0 100%;
  scroll-snap-align: start;
  height: 100%;
}

.entry-media img,
.entry-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-btn {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
  background: transparent;
}

.photo-btn:focus-visible {
  outline: 3px solid var(--sage);
  outline-offset: -3px;
}

.placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem;
  background:
    radial-gradient(circle at 30% 30%, rgba(216, 228, 214, 0.9), transparent 55%),
    radial-gradient(circle at 75% 70%, rgba(232, 196, 180, 0.55), transparent 50%),
    var(--cream);
  color: var(--muted);
  text-align: center;
}

.placeholder svg {
  width: 88px;
  height: 88px;
  opacity: 0.85;
}

.placeholder p {
  margin: 0;
  font-size: 0.9rem;
  max-width: 14rem;
}

.entry-body {
  padding: 1.15rem 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.date {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--wood);
  letter-spacing: 0.02em;
}

.tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.tag-guru {
  background: #efe0cf;
  color: #6b4e32;
}

.tag-giri {
  background: #e4efe2;
  color: #3f5f3f;
}

.tag-both {
  background: #f0ddd4;
  color: #8a4d38;
}

.entry h2 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.35;
  color: var(--ink);
}

.entry p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
}

.media-badge {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  background: rgba(58, 52, 44, 0.72);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1.5rem;
  background: rgba(255, 253, 249, 0.7);
  border-radius: var(--radius);
  border: 1px dashed rgba(122, 154, 122, 0.4);
  color: var(--muted);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(30, 26, 22, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.lightbox.is-open {
  display: flex;
}

.lightbox img {
  max-height: min(88vh, 900px);
  max-width: min(94vw, 1100px);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  background: rgba(255, 255, 255, 0.28);
}

.lightbox-caption {
  position: absolute;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  color: #f5efe6;
  font-size: 0.92rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  max-width: 90vw;
  text-align: center;
}

/* Footer */
.site-footer {
  border-top: 1px solid rgba(139, 107, 74, 0.12);
  padding: 1.75rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.site-footer p {
  margin: 0.35rem 0;
}

.leaf {
  display: inline-block;
  transform: translateY(1px);
}

/* Loading */
.loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .entry,
  .filter-btn {
    transition: none;
  }
  .entry:hover,
  .filter-btn:hover {
    transform: none;
  }
}
