@import url('https://fonts.googleapis.com/css2?family=Patrick+Hand&family=Space+Mono:wght@400;700&display=swap');

:root {
  --line: #1a1a1a;
  --paper: #ffffff;
  --grid-blue: #2f9ee0;
  --ink: #1d1d1d;
  --muted: #6b6b6b;
  --accent: #2f9ee0;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: 'Space Mono', monospace;
  color: var(--ink);
}

body {
  background-image: url('../images/bg.png');
  background-repeat: repeat;
  background-size: 360px 360px;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

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

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 24px 80px;
}

/* ---------- Logo ---------- */
.site-logo {
  display: block;
  margin: 0 auto 30px;
  max-width: 460px;
  width: 100%;
}

.site-logo img { width: 100%; }

/* ---------- Top nav (used on all sub-pages) ---------- */
.stickernav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
  margin-bottom: 40px;
}

.stickernav .sticker {
  text-align: center;
  width: 92px;
}

.stickernav .sticker img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin: 0 auto 6px;
  transition: transform .15s ease;
}

.stickernav .sticker:hover img { transform: rotate(-4deg) scale(1.06); }

.stickernav .sticker.active img {
  filter: drop-shadow(0 0 0 var(--accent));
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 8px;
}

/* ---------- Homepage scattered layout ---------- */
.home-layout {
  display: grid;
  grid-template-columns: 180px 1fr 180px;
  gap: 20px;
  align-items: start;
}

.home-col {
  display: flex;
  flex-direction: column;
  gap: 60px;
  padding-top: 20px;
}

.home-col.col-right { align-items: flex-end; text-align: right; }

.home-sticker {
  width: 150px;
}

.home-sticker img {
  width: 130px;
  margin: 0 auto 8px;
  transition: transform .15s ease;
}

.home-col.col-right .home-sticker img { margin-left: auto; margin-right: 0; }

.home-sticker:hover img { transform: rotate(-5deg) scale(1.05); }

/* ---------- Note panel ---------- */
.note {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 4px;
  box-shadow: 6px 6px 0 rgba(0,0,0,0.08);
  padding: 28px 34px;
  position: relative;
  min-height: 640px;
  max-height: 900px;
  overflow-y: auto;
}

.note::-webkit-scrollbar { width: 10px; }
.note::-webkit-scrollbar-thumb { background: #d8d8d8; border-radius: 6px; }

.note h1, .note h2 { margin-top: 0; }
.note h1 { font-size: 28px; }
.note .post-date {
  color: var(--accent);
  font-size: 13px;
  margin-bottom: 18px;
  display: block;
}
.note p { line-height: 1.7; margin: 0 0 16px; font-size: 15px; }

.note-entry + .note-entry {
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px dashed #ddd;
}

/* ---------- Generic page card (journal/photolog/goodies/about/contact) ---------- */
.page-title {
  font-family: 'Patrick Hand', cursive;
  font-size: 30px;
  margin: 0 0 20px;
  text-align: center;
}

.card {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 4px;
  box-shadow: 6px 6px 0 rgba(0,0,0,0.08);
  padding: 28px 32px;
  margin-bottom: 24px;
}

/* Journal list */
.post-list-item { padding: 18px 0; border-bottom: 1px dashed #ddd; }
.post-list-item:last-child { border-bottom: none; }
.post-list-item h2 { margin: 0 0 4px; font-size: 21px; }
.post-list-item .post-date { color: var(--accent); font-size: 13px; }
.post-list-item p { color: var(--muted); margin: 8px 0 0; line-height: 1.6; }
.read-more { font-size: 13px; color: var(--accent); font-weight: bold; }

/* Photolog grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.photo-card {
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.07);
}
.photo-card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.photo-card figcaption {
  padding: 10px 12px;
  font-family: 'Patrick Hand', cursive;
  font-size: 14px;
  color: var(--muted);
}

/* Goodies list */
.goodie-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px dashed #ddd;
}
.goodie-item:last-child { border-bottom: none; }
.goodie-item h2 { margin: 0 0 4px; font-size: 18px; }
.goodie-item p { margin: 0; color: var(--muted); font-size: 14px; }
.goodie-download {
  font-family: 'Patrick Hand', cursive;
  font-size: 16px;
  border: 2px solid var(--line);
  border-radius: 4px;
  padding: 6px 14px;
  white-space: nowrap;
}
.goodie-download:hover { background: var(--accent); color: #fff; text-decoration: none; }

/* About page */
.about-layout { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.about-layout img { width: 200px; }
.about-layout .about-text { flex: 1; min-width: 240px; }

/* Contact form */
.field { margin-bottom: 18px; }
.field label { display: block; font-family: 'Patrick Hand', cursive; font-size: 16px; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%;
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: #fafafa;
}
.field textarea { resize: vertical; min-height: 130px; }
.btn {
  font-family: 'Patrick Hand', cursive;
  font-size: 17px;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: #fff;
  padding: 10px 24px;
  cursor: pointer;
}
.btn:hover { background: var(--accent); color: #fff; }
.notice {
  border: 2px solid var(--line);
  background: #eaf6ff;
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 14px;
}
.notice.error { background: #ffeaea; }

footer.site-footer {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 50px;
}

/* ---------- Admin ---------- */
.admin-bar {
  background: var(--ink);
  color: #fff;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.admin-bar a { color: #9fd6ff; }
.admin-wrap { max-width: 900px; margin: 30px auto; padding: 0 20px 60px; }
table.admin-table { width: 100%; border-collapse: collapse; background: #fff; }
table.admin-table th, table.admin-table td {
  border: 1px solid #ddd; padding: 10px 12px; text-align: left; font-size: 14px;
}
table.admin-table th { background: #f4f4f4; }
.admin-actions a { margin-right: 10px; font-size: 13px; }
.login-box {
  max-width: 360px; margin: 80px auto; background: #fff; border: 2px solid var(--line);
  border-radius: 4px; padding: 30px; box-shadow: 6px 6px 0 rgba(0,0,0,0.08);
}

@media (max-width: 760px) {
  .wrap { padding: 24px 16px 60px; }
  .site-logo { max-width: 320px; margin-bottom: 20px; }

  .stickernav { gap: 16px; margin-bottom: 28px; }
  .stickernav .sticker { width: 72px; }
  .stickernav .sticker img { width: 56px; height: 56px; }

  .home-layout { grid-template-columns: 1fr; }
  .home-col {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 18px;
    justify-content: center;
    padding-top: 0;
    margin-bottom: 20px;
  }
  .home-col.col-right { align-items: center; text-align: center; }
  .home-sticker { width: 86px; }
  .home-sticker img { width: 76px; }
  .home-col.col-right .home-sticker img { margin: 0 auto; }

  .note { padding: 22px 20px; min-height: 420px; max-height: 70vh; }
  .note h1 { font-size: 22px; }

  .page-title { font-size: 24px; }
  .card { padding: 20px 18px; }

  .about-layout { flex-direction: column; text-align: center; }
  .about-layout img { width: 150px; margin: 0 auto; }

  .goodie-item { flex-direction: column; align-items: flex-start; gap: 10px; }

  .admin-bar { flex-direction: column; align-items: flex-start; gap: 6px; }
  .admin-wrap { padding: 0 14px 50px; }
  table.admin-table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (max-width: 420px) {
  .stickernav { gap: 10px; }
  .stickernav .sticker { width: 60px; }
  .stickernav .sticker img { width: 46px; height: 46px; }
  .home-sticker { width: 70px; }
  .home-sticker img { width: 60px; }
}
