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

:root {
  --white:   #FFFFFF;
  --ink:     #111111;
  --accent:  #1A4FCC;
  --meta:    #888888;
  --line:    #E8E8E8;
  --hover-bg:#F5F7FC;
  --danger:  #B3261E;
  --col:     680px;
  --serif:   'DM Serif Display', Georgia, serif;
  --sans:    'Inter', system-ui, sans-serif;
}

html { font-size: 16px; }
body {
  background: var(--white); color: var(--ink);
  font-family: var(--sans); font-weight: 400; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.container { max-width: var(--col); margin: 0 auto; padding: 0 24px; }
.hidden { display: none !important; }

/* ── MASTHEAD ── */
header.site { padding: 56px 0 0; }
.masthead { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.site-title {
  font-family: var(--serif); font-size: 1.75rem; font-weight: 400;
  letter-spacing: -0.02em; color: var(--ink); transition: color 0.15s;
}
.site-title:hover { color: var(--accent); }
.masthead-right { display: flex; align-items: baseline; gap: 18px; }
.site-subtitle {
  font-size: 0.72rem; font-weight: 300; color: var(--meta);
  letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap;
}
.owner-btn {
  font-family: var(--sans); font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--white); background: var(--accent); border: none; border-radius: 3px;
  padding: 6px 12px; cursor: pointer; white-space: nowrap;
}
.owner-btn:hover { background: #143FA6; }
.owner-btn.danger { background: var(--danger); }
.owner-btn:disabled { opacity: 0.45; cursor: default; }
.datum-line { width: 100%; height: 2px; background: var(--ink); margin-top: 20px; }

/* ── FILTERS ── */
.filter-bar { display: flex; padding: 18px 0 0; border-bottom: 1px solid var(--line); }
.filter-tab {
  font-family: var(--sans); font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--meta);
  padding: 8px 18px 12px; cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.filter-tab:first-child { padding-left: 0; }
.filter-tab:hover { color: var(--ink); }
.filter-tab.active { color: var(--ink); border-bottom-color: var(--ink); }

.controls {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 16px 0 0; margin-bottom: 36px;
}
.search-wrap { position: relative; flex: 1 1 220px; }
.search {
  width: 100%; font-family: var(--sans); font-size: 0.85rem; color: var(--ink);
  border: 1px solid var(--line); border-radius: 3px; padding: 7px 30px 7px 10px; background: var(--white);
}
.search:focus, .select:focus, .sort-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.search-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: none; color: var(--meta); cursor: pointer; font-size: 1rem; line-height: 1; padding: 2px 4px;
}
.select, .sort-btn {
  font-family: var(--sans); font-size: 0.78rem; color: var(--ink);
  border: 1px solid var(--line); border-radius: 3px; padding: 7px 8px; background: var(--white); cursor: pointer;
}
.sort-btn:hover, .select:hover { border-color: #CCCCCC; }
.result-count { font-size: 0.75rem; color: var(--meta); font-weight: 300; width: 100%; }

/* ── POST LIST ── */
#post-list { display: flex; flex-direction: column; }
.post-row {
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto;
  column-gap: 24px; padding: 22px 12px; margin: 0 -12px;
  border-radius: 3px; transition: background 0.12s; color: inherit;
}
.post-row:hover { background: var(--hover-bg); }
.post-row + .post-row { border-top: 1px solid #EBEBEB; }
.post-title {
  font-family: var(--serif); font-size: 1.18rem; font-weight: 400; line-height: 1.3;
  color: var(--ink); grid-column: 1; grid-row: 1; letter-spacing: -0.01em;
}
.post-excerpt {
  font-size: 0.85rem; color: var(--meta); grid-column: 1; grid-row: 2; margin-top: 5px;
  line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 480px;
}
.post-meta {
  grid-column: 2; grid-row: 1 / 3; display: flex; flex-direction: column;
  align-items: flex-end; gap: 4px; padding-top: 2px;
}
.post-date { font-size: 0.75rem; color: var(--meta); white-space: nowrap; font-weight: 300; }
.post-tag { font-size: 0.65rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
mark { background: #E3EAFB; color: inherit; padding: 0 1px; border-radius: 2px; }
.empty-state { padding: 48px 0; color: var(--meta); font-size: 0.9rem; }

/* ── SINGLE ENTRY ── */
.entry { padding-top: 40px; }
.entry-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 40px; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--meta); transition: color 0.15s;
}
.back-link:hover { color: var(--ink); }
.back-link::before { content: '←'; font-size: 1rem; }
.post-header { margin-bottom: 36px; }
.post-header-tag { font-size: 0.68rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }
.post-header-title {
  font-family: var(--serif); font-size: 2.2rem; font-weight: 400; line-height: 1.18;
  letter-spacing: -0.025em; color: var(--ink); margin-bottom: 14px;
}
.post-header-date { font-size: 0.78rem; color: var(--meta); font-weight: 300; }
.post-divider { width: 32px; height: 2px; background: var(--ink); margin: 28px 0; }
.post-body { font-size: 1.02rem; line-height: 1.78; color: var(--ink); }
.post-body p { margin-bottom: 1.5em; }
.post-body p:last-child { margin-bottom: 0; }
.post-body h2.day {
  font-family: var(--sans); font-size: 1.02rem; font-weight: 600; text-decoration: underline;
  text-underline-offset: 3px; margin: 2.2em 0 0.9em;
}
.post-body h2.day:first-child { margin-top: 0; }

/* ── FOOTER ── */
footer.site {
  margin-top: 80px; padding: 28px 0 40px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center;
}
.footer-name, .footer-copy { font-size: 0.72rem; font-weight: 300; color: var(--meta); letter-spacing: 0.06em; }

@media (max-width: 600px) {
  header.site { padding-top: 36px; }
  .site-title { font-size: 1.4rem; }
  .site-subtitle { display: none; }
  .post-excerpt { display: none; }
  .post-row { grid-template-rows: auto; padding: 18px 8px; margin: 0 -8px; }
  .post-header-title { font-size: 1.7rem; }
  .post-body { font-size: 0.97rem; }
  .filter-tab { padding: 8px 12px 12px; }
  footer.site { flex-direction: column; gap: 6px; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
