:root {
  color-scheme: light;
  --page: #f4f6f3;
  --surface: #ffffff;
  --text: #1d2925;
  --muted: #68736e;
  --line: #dce2dd;
  --accent: #176b52;
  --accent-hover: #105541;
  --danger: #b23b3b;
  --danger-bg: #fff1f1;
  --focus: #e4a11b;
  --shadow: 0 12px 32px rgba(28, 55, 45, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--text);
  font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  line-height: 1.6;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.container {
  width: min(100% - 40px, 860px);
  margin-inline: auto;
}

.site-header {
  padding: 52px 0 34px;
  border-bottom: 1px solid var(--line);
  background: #e8efea;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: clamp(2rem, 7vw, 3.2rem);
  line-height: 1.2;
  letter-spacing: 0;
}

.subtitle {
  margin-bottom: 0;
  color: var(--muted);
}

.main-content {
  padding-block: 36px 64px;
}

.composer {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
  letter-spacing: 0;
}

.section-heading span {
  color: var(--muted);
  font-size: 0.875rem;
}

.field + .field {
  margin-top: 18px;
}

label {
  display: inline-block;
  margin-bottom: 7px;
  font-weight: 700;
}

input,
textarea {
  display: block;
  width: 100%;
  border: 1px solid #bdc7c0;
  border-radius: 6px;
  background: #fbfcfb;
  color: var(--text);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input {
  height: 48px;
  padding: 0 14px;
}

textarea {
  min-height: 144px;
  padding: 12px 14px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 107, 82, 0.14);
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--danger);
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 22px;
}

.form-message {
  min-height: 1.5em;
  margin-bottom: 0;
  color: var(--danger);
  font-size: 0.9rem;
}

.submit-button {
  flex: 0 0 auto;
  min-width: 112px;
  height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  transition: background 150ms ease, transform 150ms ease;
}

.submit-button:hover {
  background: var(--accent-hover);
}

.submit-button:disabled,
.delete-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.submit-button:active {
  transform: translateY(1px);
}

button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.posts-section {
  margin-top: 42px;
}

.posts-heading {
  margin-bottom: 16px;
  padding: 0 2px;
}

.empty-state {
  padding: 50px 24px;
  border: 1px dashed #b9c4bc;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.empty-icon {
  margin-bottom: 8px;
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 2rem;
}

.empty-state p {
  margin-bottom: 2px;
  color: var(--text);
  font-weight: 700;
}

.empty-state span {
  font-size: 0.9rem;
}

.post-list {
  display: grid;
  gap: 14px;
}

.post-card {
  padding: 22px 24px 24px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(28, 55, 45, 0.045);
}

.post-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.post-time {
  color: var(--muted);
  font-size: 0.8rem;
}

.delete-button {
  min-width: 54px;
  min-height: 34px;
  padding: 4px 10px;
  border: 1px solid #edcccc;
  border-radius: 5px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 700;
}

.delete-button:hover {
  border-color: var(--danger);
  background: #ffe4e4;
}

.post-title {
  margin-bottom: 8px;
  overflow-wrap: anywhere;
  font-size: 1.12rem;
  letter-spacing: 0;
}

.post-content {
  margin-bottom: 0;
  color: #3f4b46;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

@media (max-width: 600px) {
  .container {
    width: min(100% - 28px, 860px);
  }

  .site-header {
    padding: 38px 0 28px;
  }

  .main-content {
    padding-block: 24px 44px;
  }

  .composer {
    padding: 20px 18px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .form-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .submit-button {
    width: 100%;
  }

  .posts-section {
    margin-top: 34px;
  }

  .post-card {
    padding: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
