:root {
  --bg: #f5f0e6;
  --paper: #ffffff;
  --ink: #1a1814;
  --muted: #6b6358;
  --rule: #d9cfbf;
  --accent: #1a4f7a;
  --gallery-gap: 1.5rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1814;
    --paper: #221f1a;
    --ink: #e8dfd0;
    --muted: #8a8174;
    --rule: #3a342c;
    --accent: #6ea8d8;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}
h1, h2, h3 {
  font-family: "Iowan Old Style", "Charter", Georgia, serif;
  letter-spacing: -0.01em;
}
.muted { color: var(--muted); }
a { color: var(--accent); text-underline-offset: 0.15em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip-link {
  position: absolute; top: -40px; left: 0;
  background: var(--accent); color: #fff;
  padding: 0.5rem 1rem; z-index: 100; text-decoration: none;
}
.skip-link:focus { top: 0; }

/* Navigation */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
  gap: 0.5rem;
}
.nav-brand {
  font-family: "Iowan Old Style", "Charter", Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
}
.nav-links a {
  text-decoration: none;
  color: var(--ink);
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.nav-links a:hover {
  color: var(--accent);
}

/* Hero */
.hero {
  margin: 4rem 0 5rem;
  max-width: 50rem;
}
.hero-title {
  font-size: 3.5rem;
  line-height: 1.05;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}
.hero-subtitle {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
  color: var(--muted);
}
.hero-description {
  font-size: 1.05rem;
  max-width: 40rem;
  line-height: 1.7;
}

/* Section labels */
.section-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}

/* Gallery */
.gallery-section {
  margin-bottom: 4rem;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gallery-gap);
}
.gallery-item {
  margin: 0;
  break-inside: avoid;
}
.gallery-img {
  aspect-ratio: 4 / 3;
  width: 100%;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}
.gallery-item figcaption {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.gallery-title {
  font-family: "Iowan Old Style", "Charter", Georgia, serif;
  font-size: 1rem;
  font-weight: 600;
}
.gallery-meta {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* About */
.about-section {
  margin-bottom: 4rem;
  max-width: 50rem;
}
.about-content {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}
.about-text p {
  margin: 0 0 1em;
  font-size: 1.05rem;
  line-height: 1.7;
}

/* Contact */
.contact-section {
  margin-bottom: 4rem;
}
.contact-link {
  font-size: 1.2rem;
  font-weight: 500;
}

/* Footer */
footer {
  margin-top: 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
footer .attribution {
  font-size: 0.75rem;
  opacity: 0.7;
}
footer .attribution a {
  color: var(--muted);
}

/* Blog index */
.page-title {
  font-size: 2.5rem;
  margin: 3rem 0 0.5rem;
  line-height: 1.1;
}
.page-description {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0 0 2.5rem;
  max-width: 40rem;
}
.post-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 4rem;
}
.post-card {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1.5rem;
}
.post-card-title {
  font-size: 1.3rem;
  margin: 0 0 0.35rem;
}
.post-card-title a {
  text-decoration: none;
  color: var(--ink);
}
.post-card-title a:hover {
  color: var(--accent);
}
.post-card-excerpt {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  line-height: 1.6;
}
.post-card-date {
  font-size: 0.85rem;
  margin: 0;
}

/* Blog post */
.blog-post {
  margin: 3rem 0 4rem;
  max-width: 50rem;
}
.breadcrumb {
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
}
.post-title {
  font-size: 2.2rem;
  margin: 0 0 0.5rem;
  line-height: 1.15;
}
.post-date {
  font-size: 0.9rem;
  margin: 0 0 2rem;
}
.post-body {
  font-size: 1.05rem;
  line-height: 1.8;
}
.post-body p {
  margin: 0 0 1.25em;
}

/* Admin login */
.admin-login {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 2rem;
}
.admin-login-form {
  background: var(--paper);
  padding: 2.5rem;
  border-radius: 6px;
  max-width: 360px;
  width: 100%;
  border: 1px solid var(--rule);
}
.admin-login-title {
  font-size: 1.5rem;
  margin: 0 0 1.5rem;
}
.admin-login-form label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.admin-login-form input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--bg);
  color: var(--ink);
  font-size: 1rem;
  margin-bottom: 1rem;
}
.admin-login-form button {
  width: 100%;
  padding: 0.65rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
}
.admin-login-form button:hover {
  opacity: 0.9;
}
.admin-error {
  color: #c0392b;
  font-size: 0.85rem;
  margin: -0.5rem 0 1rem;
}

/* Admin dashboard */
.admin-dashboard {
  max-width: 60rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}
.admin-title {
  font-size: 1.5rem;
  margin: 0;
}
.admin-link {
  margin-right: 1rem;
  font-size: 0.9rem;
}
.admin-logout-btn {
  background: none;
  border: 1px solid var(--rule);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  color: var(--ink);
  font-size: 0.85rem;
}
.admin-logout-btn:hover {
  background: var(--rule);
}

/* Admin form */
.admin-form-section {
  margin-bottom: 3rem;
}
.admin-form-section h2 {
  font-size: 1.2rem;
  margin: 0 0 1rem;
}
.admin-field {
  margin-bottom: 1rem;
}
.admin-field label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.admin-field input,
.admin-field textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.95rem;
  font-family: inherit;
}
.admin-field textarea {
  resize: vertical;
}
.admin-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.admin-actions button {
  padding: 0.55rem 1.2rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.95rem;
  cursor: pointer;
}
.admin-actions button:hover {
  opacity: 0.9;
}
.admin-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.admin-cancel-btn {
  background: transparent !important;
  color: var(--muted) !important;
  border: 1px solid var(--rule) !important;
}
.admin-cancel-btn:hover {
  background: var(--rule) !important;
  opacity: 1 !important;
}
.admin-message {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--accent);
}

/* Admin post list */
.admin-posts-section h2 {
  font-size: 1.2rem;
  margin: 0 0 1rem;
}
.admin-post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.admin-post-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
  gap: 1rem;
}
.admin-post-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.admin-edit-btn,
.admin-delete-btn {
  background: none;
  border: 1px solid var(--rule);
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--ink);
}
.admin-edit-btn:hover {
  background: var(--rule);
}
.admin-delete-btn:hover {
  background: #c0392b;
  color: #fff;
  border-color: #c0392b;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Mobile */
@media (max-width: 600px) {
  body { padding: 0 1rem; }
  .hero-title { font-size: 2.2rem; }
  .hero { margin: 2.5rem 0 3rem; }
  .gallery { grid-template-columns: 1fr; }
  .nav { flex-direction: column; align-items: flex-start; }
  footer { flex-direction: column; gap: 0.25rem; }
  .page-title { font-size: 1.8rem; }
  .post-title { font-size: 1.6rem; }
  .admin-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .admin-post-item { flex-direction: column; align-items: flex-start; }
}
