/* Global layout */
html {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f7;
  padding: 2rem;
}

body {
  max-width: 960px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

/* Typography & links */
h1, h2, h3, h4 {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.03em;
}

h1 {
  color: #0f172a;
  margin: 1.5rem 0 0.75rem;
  font-size: 2rem;
  font-weight: 700;
}

a {
  color: #2563eb;
  text-decoration: none;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover,
a:focus-visible {
  color: #1d4ed8;
  text-decoration: underline;
  text-decoration-thickness: 1px;
}

/* Separators */
hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 2rem 0;
}

/* Top navigation */
nav {
  background: rgba(248, 250, 252, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  padding: 0.5rem 1.25rem;
}

nav h1 {
  flex: auto;
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
}

nav h1 a {
  text-decoration: none;
  padding: 0.25rem 0.25rem;
  border-radius: 999px;
}

nav h1 a:hover {
  background: #e5edff;
}

nav ul  {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.25rem;
}

nav ul li a,
nav ul li span,
header .action {
  display: block;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.9rem;
}

nav ul li a {
  background: transparent;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

nav ul li a:hover {
  background: #e5edff;
  border-color: #d1d9ff;
}

/* Main content area */
.content {
  padding: 1.5rem 1.75rem 2rem;
}

.content > header {
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: flex-end;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.content > header h1 {
  flex: auto;
  margin: 0;
  margin-bottom: 0.25rem;
}

.content:last-child {
  margin-bottom: 0;
}

/* Flash messages */
.flash {
  margin: 1.25em 0;
  padding: 0.85em 1em;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  font-size: 0.95rem;
  color: #1e3a8a;
}

/* Posts */
.post {
  padding: 1.25rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.post:last-of-type {
  border-bottom: none;
}

.post > header {
  display: flex;
  align-items: flex-end;
  font-size: 0.85em;
  gap: 0.75rem;
}

.post > header > div:first-of-type {
  flex: auto;
}

.post > header h1 {
  font-size: 1.4em;
  margin-bottom: 0;
  margin-top: 0;
}

.post .about {
  color: #6b7280;
  font-style: normal;
}

.post .body {
  margin-top: 0.75rem;
  color: #111827;
  line-height: 1.7;
  white-space: pre-line;
}

/* Forms */
.content form {
  margin: 1.5em 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.content label {
  font-weight: 600;
  margin-bottom: 0.25em;
  font-size: 0.95rem;
  color: #374151;
}

.content input,
.content textarea {
  margin-bottom: 0.25em;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  padding: 0.6rem 0.75rem;
  font-size: 0.95rem;
  font-family: inherit;
  background: #f9fafb;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.content input:focus,
.content textarea:focus {
  outline: none;
  border-color: #2563eb;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.15);
}

.content textarea {
  min-height: 12em;
  resize: vertical;
}

/* Buttons */
input.danger {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}

input.danger:hover {
  background: #fee2e2;
}

input[type=submit] {
  align-self: flex-start;
  min-width: 9em;
  border-radius: 999px;
  border: none;
  padding: 0.6rem 1.4rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  background: #111827;
  color: #f9fafb;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
}

input[type=submit]:hover {
  background: #020617;
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
}

input[type=submit]:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

/* Small-screen tweaks */
@media (max-width: 640px) {
  html {
    padding: 0.75rem;
  }

  body {
    border-radius: 12px;
  }

  nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }

  nav ul {
    width: 100%;
    flex-wrap: wrap;
  }

  .content {
    padding: 1.25rem 1.25rem 1.75rem;
  }

  h1 {
    font-size: 1.6rem;
  }
}
