:root {
  --paper: #f3f2ef;
  --paper-2: #ebe9e4;
  --line: #d8d5ce;
  --ink: #3b3a37;
  --muted: #8d8a83;
  --faint: #b9b5ad;
  --serif: 'Gowun Batang', serif;
  --sans: 'Inter', -apple-system, 'Apple SD Gothic Neo', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.8 var(--serif); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2 { font-weight: 400; margin: 0; }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 22px 80px; }

/* Header */
.top { max-width: 640px; margin: 0 auto; padding: 26px 22px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); margin-bottom: 36px; }
.brand { font: 500 13px/1 var(--sans); letter-spacing: .22em; text-transform: uppercase; color: var(--ink); }
.top nav { display: flex; align-items: center; gap: 18px; font: 400 13px/1 var(--sans); color: var(--muted); }
.top nav form { margin: 0; }
.btn { display: inline-block; font: 400 13px/1 var(--sans); color: var(--ink); background: transparent; border: 1px solid var(--ink); border-radius: 999px; padding: 9px 16px; cursor: pointer; }
.btn:hover { background: var(--ink); color: var(--paper); }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; }
.link:hover { color: var(--ink); }
.danger { color: #a0645a; margin-left: auto; }

/* Calendar */
.cal { margin-bottom: 40px; }
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.cal-head h1 { font: 400 22px/1 var(--serif); letter-spacing: .04em; }
.cal-head a { font: 300 22px/1 var(--sans); color: var(--muted); padding: 4px 10px; }
.cal-head a:hover { color: var(--ink); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-grid > * { aspect-ratio: 1; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: flex-start; padding: 6px 7px; font: 400 12px/1 var(--sans); color: var(--faint); }
.cal-wd { aspect-ratio: auto !important; padding: 8px 7px !important; color: var(--muted) !important; font-size: 11px !important; letter-spacing: .1em; }
.cal-day.has { color: var(--ink); position: relative; }
.cal-day.has::after { content: ""; position: absolute; left: 50%; bottom: 22%; width: 5px; height: 5px; border-radius: 50%; background: var(--ink); transform: translateX(-50%); }
.cal-day.has:hover { background: var(--paper-2); }

/* List */
.list { border-top: 1px solid var(--line); }
.item { display: grid; grid-template-columns: 52px 1fr 76px; gap: 18px; align-items: start; padding: 22px 0; border-bottom: 1px solid var(--line); }
.item:hover { background: linear-gradient(90deg, transparent, var(--paper-2) 30%, transparent); }
.item-date { font: 400 17px/1.2 var(--serif); text-align: center; }
.item-date small { display: block; font: 400 11px/1.6 var(--sans); color: var(--muted); letter-spacing: .1em; }
.item-body h2 { font: 400 16px/1.5 var(--serif); margin-bottom: 4px; }
.item-body p { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--muted); }
.item-body p.lead { font-size: 15px; color: var(--ink); }
.item img { width: 76px; height: 76px; object-fit: cover; filter: saturate(.85); }
.tag { font: 400 10px/1 var(--sans); letter-spacing: .1em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 7px; margin-left: 8px; vertical-align: 2px; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; font-size: 14px; }

/* Entry */
.entry-date { font: 400 12px/1 var(--sans); letter-spacing: .08em; color: var(--muted); margin: 0 0 22px; }
.entry-date a:hover { color: var(--ink); }
.entry h1 { font: 400 24px/1.4 var(--serif); padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.entry-body { font-size: 16px; line-height: 2; margin-bottom: 34px; }
.entry-photo { width: 100%; margin: 0 0 18px; }
.entry-actions { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 30px; font: 400 12px/1 var(--sans); color: var(--muted); }
.entry-actions a { color: var(--ink); border-bottom: 1px solid var(--line); padding-bottom: 2px; }

/* Forms */
.write, .auth { display: flex; flex-direction: column; gap: 16px; }
.write input[type=text], .write input[type=date], .write textarea, .auth input { font: 400 15px/1.7 var(--serif); color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 10px 0; width: 100%; outline: none; border-radius: 0; }
.write input:focus, .write textarea:focus, .auth input:focus { border-bottom-color: var(--ink); }
.write-date { font-family: var(--sans) !important; font-size: 13px !important; color: var(--muted) !important; }
.write-title { font-size: 20px !important; }
.write-body { resize: vertical; min-height: 260px; border: 1px solid var(--line) !important; padding: 16px !important; line-height: 2 !important; }
.write-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.write-photos label { font: 400 12px/1 var(--sans); color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.write-photos img { aspect-ratio: 1; object-fit: cover; }
.write-file, .write-public { font: 400 13px/1.4 var(--sans); color: var(--muted); display: flex; flex-direction: column; gap: 8px; }
.write-public { flex-direction: row; align-items: center; gap: 8px; }
.write-file input { font: 400 13px var(--sans); color: var(--muted); }
.write-file input::file-selector-button { font: 400 13px var(--sans); color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; margin-right: 10px; cursor: pointer; }
.write-actions { display: flex; align-items: center; gap: 18px; font: 400 13px/1 var(--sans); color: var(--muted); border-top: 1px solid var(--line); padding-top: 20px; margin-top: 6px; }
.auth { max-width: 340px; margin: 40px auto 0; }
.auth h1 { font: 400 22px/1.4 var(--serif); margin-bottom: 6px; }
.auth label { display: flex; flex-direction: column; gap: 2px; font: 400 12px/1.4 var(--sans); color: var(--muted); letter-spacing: .04em; }
.auth .btn { align-self: flex-start; margin-top: 10px; }
.muted { color: var(--muted); font-size: 13px; margin: 0; }
.error { color: #a0645a; font: 400 13px/1.5 var(--sans); margin: 0; }

@media (max-width: 520px) {
  .item { grid-template-columns: 44px 1fr 64px; gap: 14px; }
  .item img { width: 64px; height: 64px; }
  .cal-grid > * { padding: 4px 5px; font-size: 11px; }
}
