/* Bodeguu — Writing list (kelvinzhang.ca/blog layout, light mono) */

:root {
  --bg: #ffffff;
  --text: #000000;
  --body: #000000;
  --subtext: #666666;
  --muted: #555555;
  --line: #e5e5e5;
  --highlight: #e5e5e5;
  --max: 680px;
  --font: "Source Serif 4", "Noto Serif KR", "Apple SD Gothic Neo", "Malgun Gothic", Georgia, "Times New Roman", serif;
}

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

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--body);
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: #000; }

.skip {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  background: #fff;
  color: #000;
  z-index: 100;
}

.skip:focus,
.skip:focus-visible {
  width: auto;
  height: auto;
  margin: 8px;
  padding: 8px 12px;
  overflow: visible;
  clip: auto;
  white-space: normal;
  outline: 2px solid #000;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  flex: 1 0 auto;
}

/* Nav tabs — About | Writing */
#nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 28px 0 8px;
  position: relative;
}

.nav-item {
  font-family: var(--font);
  color: var(--subtext);
  padding: 8px 14px;
  font-size: 14px;
  text-decoration: none;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}

.nav-item:hover,
.nav-item-active {
  color: #000;
}

.nav-item-active {
  background: #f0f0f0;
  font-weight: 500;
}

.nav-item:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
}

.content {
  padding: 24px 0 64px;
}

.page-title,
.home-title {
  margin: 0 0 28px;
  font-family: var(--font);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #000;
  line-height: 1.25;
}

/* Post list: title left, date right */
.post-list {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--line);
}

.post-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: #000;
  width: 100%;
}

.post-item-closed {
  cursor: default;
  pointer-events: none;
}

a.post-item:hover .post-title,
a.post-item:focus-visible .post-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

a.post-item:focus-visible {
  outline: 2px solid #000;
  outline-offset: 4px;
}

.post-title {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  color: #000;
}

.post-date {
  flex-shrink: 0;
  font-size: 14px;
  color: var(--subtext);
  white-space: nowrap;
}

.post-date-status {
  font-style: italic;
}


.empty {
  margin: 24px 0 0;
  color: var(--subtext);
}

/* About */
.about {
  max-width: 36em;
  font-size: 16px;
  line-height: 1.7;
  color: #000;
}

.about p {
  margin: 0 0 1.15em;
}

.about p:last-child {
  margin-bottom: 0;
}

.about code {
  font-size: 0.92em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.link {
  color: #000;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link:hover {
  text-decoration-thickness: 2px;
}

/* Single post */
.back {
  margin: 0 0 28px;
  font-size: 14px;
}

.back a {
  color: var(--subtext);
  text-decoration: none;
}

.back a:hover,
.back a:focus-visible {
  color: #000;
  text-decoration: underline;
}

.post-page-title {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 3.5vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #000;
}

.post-page-date {
  margin: 0 0 32px;
  font-size: 14px;
  color: var(--subtext);
}

.post-body {
  font-size: 16px;
  line-height: 1.75;
  max-width: 38em;
  color: #000;
}

.post-body p {
  margin: 0 0 1.25em;
}

.post-body p:last-child {
  margin-bottom: 0;
}

.post-admin {
  margin-top: 40px;
  font-size: 13px;
  color: var(--subtext);
}

.quiet {
  color: var(--subtext);
  opacity: 0.7;
}

.quiet:hover {
  opacity: 1;
  color: #000;
}

.linkish {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* Writer (discreet) */
.write-hint {
  margin: -12px 0 24px;
  font-size: 14px;
  color: var(--subtext);
}

form label {
  display: block;
  font-weight: 500;
  margin: 0 0 6px;
  font-size: 14px;
}

form input[type="text"],
form textarea {
  display: block;
  width: 100%;
  margin: 0 0 20px;
  padding: 10px 12px;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  font: inherit;
  resize: vertical;
  line-height: 1.5;
}

form textarea { min-height: 280px; }

form input:focus-visible,
form textarea:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  display: inline-block;
  background: #000;
  color: #fff;
  border: 1px solid #000;
  padding: 10px 18px;
  font-size: 14px;
  font-family: var(--font);
  text-decoration: none;
  cursor: pointer;
}

.btn:hover { background: #000; color: #fff; }

.btn:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
}

.btn-outline {
  background: #fff;
  color: #000;
  border: 1px solid #000;
  padding: 10px 18px;
  font-size: 14px;
  font-family: var(--font);
  text-decoration: none;
  cursor: pointer;
}

/* Footer */
.footer {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  padding: 16px 0 32px;
  margin-top: auto;
}

.footer-container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--subtext);
}

.socials {
  display: flex;
  gap: 16px;
}

.socials a {
  color: var(--subtext);
  text-decoration: none;
  font-size: 13px;
}

.socials a:hover,
.socials a:focus-visible {
  color: #000;
  text-decoration: underline;
}

@media (max-width: 560px) {
  .post-item {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }

  .post-date {
    white-space: normal;
  }

  #nav {
    padding-top: 20px;
  }
}


/* Landing photo */
.landing-photo {
  margin: 0 0 36px;
  padding: 0;
}
.landing-photo img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}


/* Password gate */
html.locked body > :not(#gate):not(script) {
  visibility: hidden;
}
.gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: #fff;
  padding: 24px;
  font-family: var(--font);
}
.gate-card {
  width: 100%;
  max-width: 320px;
}
.gate-card h1 {
  margin: 0 0 28px;
  font-size: 28px;
  font-weight: 600;
}
.gate-card label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--subtext);
}
.gate-card input {
  width: 100%;
  font: inherit;
  font-size: 16px;
  padding: 10px 12px;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  margin-bottom: 12px;
}
.gate-card button {
  font: inherit;
  font-size: 15px;
  padding: 10px 16px;
  border: 1px solid #000;
  background: #000;
  color: #fff;
  cursor: pointer;
}
.gate-error {
  color: #000;
  font-size: 14px;
  margin: 0 0 12px;
}
