/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --cream:   #ffffff;
  --paper:   #f7f5f2;
  --ink:     #2c2c2c;
  --muted:   #9a9690;
  --accent:  #a07850;
  --gold:    #c8a97a;
  --rule:    #ede9e3;
  --max:     1100px;
  --serif:   'EB Garamond', Georgia, serif;
  --sans:    'Inter', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.75;
  min-height: 100vh;
}

/* ── Typography ── */
h1, h2, h3 { line-height: 1.2; font-weight: 400; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h3 { font-size: 1.2rem; }

a { color: var(--accent); text-decoration: none; transition: opacity .18s; }
a:hover { opacity: .7; }

p { margin-bottom: 1.2em; }
p:last-child { margin-bottom: 0; }

blockquote {
  border-left: 2px solid var(--gold);
  padding: .25em 0 .25em 1.5em;
  margin: 2em 0;
  color: var(--muted);
  font-style: italic;
  font-size: 1.1em;
}

/* ── Layout ── */
.container { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }

/* ── Site Header ── */
.site-header {
  background: var(--cream);
  padding: 3.5rem 0 3rem;
  text-align: center;
  position: relative;
  border-bottom: 1px solid var(--rule);
}

.site-header::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 50%;
  transform: translateX(-50%);
  width: 48px;
  height: 2px;
  background: var(--gold);
}

.site-title {
  font-size: clamp(2rem, 6vw, 3.2rem);
  letter-spacing: .04em;
  color: var(--ink);
  font-weight: 400;
}

.site-title a { color: inherit; }
.site-title a:hover { opacity: .75; }

.site-tagline {
  font-family: var(--sans);
  font-size: .7rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: .85rem;
}

/* ── Nav ── */
.site-nav {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  padding: 1.1rem 0;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.site-nav a { color: var(--muted); transition: color .18s; }
.site-nav a:hover { color: var(--ink); opacity: 1; }

/* ── Search ── */
.search-wrap {
  padding: 2rem 0 0;
  max-width: 420px;
}

.search-wrap input {
  width: 100%;
  padding: .7rem 1rem .7rem 2.6rem;
  background: var(--cream);
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-family: var(--sans);
  font-size: .9rem;
  color: var(--ink);
  outline: none;
  transition: border-color .18s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239a9690' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: .75rem center;
}

.search-wrap input:focus { border-color: var(--accent); }
.search-wrap input::placeholder { color: var(--muted); }

.search-no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: .9rem;
}

/* ── Post List (3-column board) ── */
.post-list {
  padding: 3rem 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  align-items: start;
}

.post-card {
  display: block;
  background: var(--cream);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  color: var(--ink);
  transition: box-shadow .2s, transform .2s;
}

.post-card:hover {
  opacity: 1;
  box-shadow: 0 6px 24px rgba(0,0,0,.07);
  transform: translateY(-3px);
}

.post-card:hover .post-title { color: var(--accent); }
.post-card:hover .post-cover { transform: scale(1.04); }

.post-cover-wrap {
  overflow: hidden;
  aspect-ratio: 16/10;
}

.post-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}

.post-card-body { padding: 1.25rem 1.25rem 1.5rem; }

.post-meta {
  font-family: var(--sans);
  font-size: .68rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .5rem;
}

.post-title {
  transition: color .18s;
  margin-bottom: .5rem;
  color: var(--ink);
  font-size: 1.2rem;
}

.post-excerpt {
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.65;
  margin-bottom: 0;
}

/* ── Read more hint ── */
.post-read-more {
  display: inline-block;
  margin-top: .85rem;
  font-family: var(--sans);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ── Single Post ── */
.post-page { padding: 3.5rem 0 6rem; }

.post-page .post-cover-wrap {
  margin-bottom: 2.5rem;
  border-radius: 3px;
}

.post-page .post-cover {
  height: 420px;
  transition: none;
}

.post-page .post-meta { margin-bottom: 1rem; }
.post-page h1 { margin-bottom: 2rem; }

.post-divider {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
  position: relative;
}

.post-divider::after {
  content: '✦';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--cream);
  padding: 0 .75rem;
  color: var(--gold);
  font-size: .65rem;
  letter-spacing: .1em;
}

.post-body {
  font-size: 1.175rem;
  line-height: 1.9;
}

.post-body p { margin-bottom: 1.5em; }
.post-body h2 { margin: 2.5em 0 .8em; }
.post-body h3 { margin: 2em 0 .6em; }

/* ── Back link ── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--sans);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3rem;
  transition: color .18s;
}

.back-link:hover { color: var(--ink); opacity: 1; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 6rem 0;
  color: var(--muted);
}

.empty-state p {
  font-family: var(--sans);
  font-size: .9rem;
  letter-spacing: .05em;
}

/* ── Footer ── */
.site-footer {
  background: var(--paper);
  border-top: 1px solid var(--rule);
  padding: 2rem 0;
  text-align: center;
  font-family: var(--sans);
  font-size: .7rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Admin ── */
.admin-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.admin-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.admin-header h1 { font-size: 1.5rem; }
.admin-header p { color: var(--muted); font-size: .95rem; margin-top: .4rem; }

.form-group { margin-bottom: 1.5rem; }

label {
  display: block;
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .45rem;
}

input[type="text"],
input[type="password"],
input[type="date"],
textarea {
  width: 100%;
  padding: .75rem 1rem;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 3px;
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink);
  outline: none;
  transition: border-color .18s;
}

input:focus, textarea:focus { border-color: var(--accent); }

textarea { min-height: 340px; resize: vertical; line-height: 1.7; }

.btn {
  display: inline-block;
  padding: .7rem 1.75rem;
  background: var(--ink);
  color: #faf8f4;
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background .18s;
}

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

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
}

.btn-outline:hover { background: var(--paper); }

.btn-danger { background: #b03a2e; }
.btn-danger:hover { background: #8c2e24; }

.btn-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: .5rem;
}

.cover-preview {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 3px;
  margin-top: .75rem;
  display: none;
}

.cover-preview.show { display: block; }

/* ── Admin post list ── */
.admin-posts { margin-top: 3.5rem; }
.admin-posts h2 { font-size: 1.1rem; margin-bottom: 1rem; }

.admin-post-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .9rem 0;
  border-bottom: 1px solid var(--rule);
  gap: 1rem;
}

.admin-post-row:last-child { border-bottom: none; }
.admin-post-title { font-size: 1rem; flex: 1; }

.admin-post-date {
  font-family: var(--sans);
  font-size: .72rem;
  color: var(--muted);
  white-space: nowrap;
}

.flash {
  padding: .75rem 1rem;
  border-radius: 3px;
  font-family: var(--sans);
  font-size: .85rem;
  margin-bottom: 1.5rem;
  display: none;
}

.flash.success { background: #eaf4ea; color: #2d6a2d; display: block; }
.flash.error   { background: #faeaea; color: #8b2020; display: block; }

/* ── Login ── */
.login-wrap {
  max-width: 360px;
  margin: 8rem auto;
  padding: 0 1.5rem;
  text-align: center;
}

.login-wrap h1 { font-size: 1.5rem; margin-bottom: .4rem; }
.login-wrap p { color: var(--muted); font-size: .9rem; margin-bottom: 2rem; }

/* ── About page ── */
.about-intro {
  font-size: 1.2rem;
  line-height: 1.85;
  color: var(--ink);
}

@media (max-width: 860px) {
  .post-list { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .post-list { grid-template-columns: 1fr; }
  .post-page .post-cover { height: 220px; }
  .btn-row { flex-direction: column; align-items: flex-start; }
}
