:root {
  --ink: #111111;
  --paper: #ffffff;
  --grey: #6b6b6b;
  --line: #111111;
  --line-soft: #d9d9d9;
  --accent: #c1451f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.site-header {
  position: relative;
  padding: 20px 0 24px;
  text-align: center;
  border-bottom: 3px solid var(--line);
}

.hidden-trigger {
  position: absolute;
  top: 10px;
  right: 16px;
  width: 28px;
  height: 28px;
  display: block;
  text-decoration: none;
}

.eyebrow {
  margin: 0 0 14px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--grey);
}

.logo {
  display: block;
  font-family: "Newsreader", Georgia, serif;
  font-weight: 300;
  font-size: clamp(2rem, 6vw, 3.6rem);
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}


/* Filters */
.filters {
  position: sticky;
  top: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  z-index: 10;
}

.filters .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
  padding-top: 0;
  padding-bottom: 0;
}

.filter-btn {
  border: none;
  background: transparent;
  color: var(--ink);
  padding: 14px 28px;
  position: relative;
  font-family: "Inter", sans-serif;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.filter-btn:hover {
  background: #f2f2f2;
  color: var(--accent);
}

.filter-btn.active {
  background: var(--paper);
  color: var(--ink);
}

.filter-btn.active::before,
.filter-btn.active::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 14px;
  background: var(--ink);
}

.filter-btn.active::before {
  left: 10px;
}

.filter-btn.active::after {
  right: 10px;
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border-top: 1px solid var(--line-soft);
  margin-top: -1px;
}

.card {
  cursor: pointer;
  background: var(--paper);
  display: flex;
  flex-direction: column;
}

.card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  filter: grayscale(0.55) contrast(1.05);
}

.card-body {
  padding: 20px 22px 26px;
  border-top: 1px solid var(--line);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tag {
  display: inline-block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 10px;
}

.tag::before {
  content: "— ";
}

.card h3 {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 700;
  font-size: 1.4rem;
  margin: 0 0 8px;
  line-height: 1.22;
}

.card .date {
  margin: 0 0 12px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grey);
}

.card .excerpt {
  margin: 0;
  font-size: 0.92rem;
  color: #333;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}

.modal.hidden {
  display: none;
}

.modal-inner {
  background: var(--paper);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  padding-bottom: 8px;
  border: 1px solid var(--line);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0;
  width: 34px;
  height: 34px;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

.modal-inner img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  filter: grayscale(0.55) contrast(1.05);
}

.modal-tag {
  margin: 24px 24px 0;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 700;
}

.modal-tag::before {
  content: "— ";
}

.modal-inner h2 {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 700;
  margin: 8px 24px 6px;
  font-size: 1.9rem;
  line-height: 1.2;
}

.modal-date {
  margin: 0 24px 18px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grey);
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}

.modal-body {
  margin: 0 24px 24px;
  font-size: 1.02rem;
  color: #222;
}

/* Footer */
.site-footer {
  border-top: 3px solid var(--line);
  padding: 22px 0;
  text-align: center;
  color: var(--grey);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Admin */
.admin-wrap {
  max-width: 560px;
  padding-top: 48px;
  padding-bottom: 80px;
}

.admin-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  font-size: 0.8rem;
}

.admin-topline a {
  color: var(--ink);
  text-decoration: none;
}

.admin-topline a:hover {
  color: var(--accent);
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--grey);
  font-family: inherit;
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
}

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

.admin-form h2,
.admin-entries h2 {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 700;
  font-size: 1.6rem;
  margin: 0 0 8px;
}

.admin-entries {
  margin-bottom: 40px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.stat-numbers {
  display: flex;
  gap: 28px;
  margin-bottom: 20px;
}

.stat-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-value {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 600;
  font-size: 1.8rem;
  line-height: 1;
}

.stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grey);
}

.stat-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 48px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 1px;
}

.stat-bar {
  flex: 1;
  background: var(--ink);
  min-width: 2px;
}

.stat-referrers {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.82rem;
}

.stat-referrers li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-top: 1px solid var(--line-soft);
}

.stat-empty {
  color: var(--grey);
}

.stat-section-label {
  margin: 16px 0 0;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--grey);
}

.entry-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
}

.entry-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.entry-title {
  font-family: "Newsreader", Georgia, serif;
  font-weight: 600;
  font-size: 1.02rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-meta {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grey);
}

.entry-delete {
  flex-shrink: 0;
  background: none;
  border: 1px solid var(--line-soft);
  border-radius: 0;
  padding: 7px 14px;
  font-family: "Inter", sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--grey);
  cursor: pointer;
}

.entry-delete:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.admin-hint {
  margin: 0 0 24px;
  color: var(--grey);
  font-size: 0.88rem;
}

.admin-hint-inline {
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--grey);
}

.admin-form label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 18px;
}

.admin-form input[type="text"],
.admin-form input[type="password"],
.admin-form input[type="date"],
.admin-form textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}

.admin-form input[type="file"] {
  display: block;
  margin-top: 8px;
  font-size: 0.85rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
}

.admin-form textarea {
  resize: vertical;
  line-height: 1.5;
}

.admin-form input:focus,
.admin-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.admin-preview {
  display: block;
  max-width: 100%;
  max-height: 240px;
  object-fit: cover;
  margin: -8px 0 18px;
  border: 1px solid var(--line);
}

.admin-form button[type="submit"] {
  background: var(--ink);
  color: var(--paper);
  border: none;
  border-radius: 0;
  padding: 12px 24px;
  font-family: "Inter", sans-serif;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  cursor: pointer;
}

.admin-form button[type="submit"]:hover {
  background: var(--accent);
}

.admin-error {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  margin: -8px 0 18px;
}

.admin-success {
  color: #2a6b3d;
  font-size: 0.85rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  margin: -8px 0 18px;
}
