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

body {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.6;
  color: #222;
  background: #fafaf8;
}

a { color: #8b1a1a; }
a:hover { color: #c0392b; }

/* ── Header ───────────────────────────────────────────────────────────────── */
header {
  background: #1a1a1a;
  color: #eee;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-title {
  color: #e8d5a3;
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: bold;
  letter-spacing: 0.02em;
}
.site-title:hover { color: #fff; }

nav { display: flex; gap: 1.25rem; }
nav a { color: #aaa; text-decoration: none; font-size: 0.9rem; font-family: sans-serif; }
nav a:hover { color: #fff; }

/* ── Main ────────────────────────────────────────────────────────────────── */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

h1 { font-size: 1.8rem; margin-bottom: 0.5rem; }
h2 { font-size: 1.2rem; margin: 1.75rem 0 0.5rem; color: #444; }

.back { font-family: sans-serif; font-size: 0.85rem; display: inline-block; margin-bottom: 1rem; }
.count { color: #666; font-size: 0.9rem; font-family: sans-serif; }
.muted { color: #888; font-style: italic; font-family: sans-serif; }

/* ── Flash messages ───────────────────────────────────────────────────────── */
.flash {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  padding: 0.6rem 1rem;
  margin-bottom: 1.25rem;
  font-family: sans-serif;
  font-size: 0.9rem;
}

/* ── Filterbank ───────────────────────────────────────────────────────────── */
.filterbank {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.filterbank label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-family: sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
}

.filter-select {
  padding: 0.45rem 0.65rem;
  font-size: 0.9rem;
  font-family: sans-serif;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #fff;
  min-width: 160px;
}
.filter-select:focus { outline: none; border-color: #8b1a1a; }

/* ── Search ───────────────────────────────────────────────────────────────── */
#search {
  display: block;
  width: 100%;
  max-width: 480px;
  padding: 0.5rem 0.75rem;
  margin: 1rem 0 1.25rem;
  font-size: 1rem;
  font-family: sans-serif;
  border: 1px solid #ccc;
  border-radius: 4px;
}
#search:focus { outline: none; border-color: #8b1a1a; }

/* ── Tables ───────────────────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  font-family: sans-serif;
  font-size: 0.9rem;
}

th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  background: #eee;
  border-bottom: 2px solid #ccc;
  font-weight: 600;
}

td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid #e8e8e8;
}

tr:hover td { background: #f5f0e8; }

.info-table { width: auto; margin-bottom: 1rem; }
.info-table th { background: none; border: none; color: #666; font-weight: normal; padding-left: 0; }
.info-table td { border: none; padding-left: 1rem; }

/* ── Entry detail ─────────────────────────────────────────────────────────── */
.entry-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.record-text {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f5f2ed;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 1rem;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ── Photo grid ───────────────────────────────────────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.photo-grid a { display: block; }

.photo-grid img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid #ddd;
  display: block;
  transition: opacity 0.15s;
}
.photo-grid a:hover img { opacity: 0.85; }

.photo-item { display: flex; flex-direction: column; gap: 0.25rem; }
.delete-label { font-family: sans-serif; font-size: 0.8rem; color: #c0392b; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn, .btn-secondary, .btn-danger, button[type="submit"] {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  font-family: sans-serif;
  font-size: 0.85rem;
  border-radius: 3px;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
}

button[type="submit"], .btn {
  background: #8b1a1a;
  color: #fff;
  border-color: #8b1a1a;
}
button[type="submit"]:hover, .btn:hover { background: #a52020; }

.btn-secondary {
  background: #f5f5f5;
  color: #333;
  border-color: #ccc;
}
.btn-secondary:hover { background: #e8e8e8; }

.btn-danger {
  background: #c0392b;
  color: #fff;
  border-color: #c0392b;
}
.btn-danger:hover { background: #e74c3c; }

/* ── Admin ────────────────────────────────────────────────────────────────── */
.admin-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.login-box {
  max-width: 360px;
  margin: 3rem auto;
}

/* ── Forms ────────────────────────────────────────────────────────────────── */
.field {
  margin-bottom: 1.1rem;
}

.field label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-family: sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
}

.hint {
  font-weight: normal;
  color: #888;
  font-size: 0.8rem;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.login-box input[type="password"],
.field textarea {
  padding: 0.45rem 0.65rem;
  font-size: 0.95rem;
  font-family: sans-serif;
  border: 1px solid #ccc;
  border-radius: 3px;
  width: 100%;
  max-width: 560px;
}

.field textarea {
  resize: vertical;
  font-family: "Courier New", Courier, monospace;
  font-size: 0.85rem;
  max-width: 100%;
}

.field input:focus, .field textarea:focus,
.login-box input:focus {
  outline: none;
  border-color: #8b1a1a;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
}

hr { border: none; border-top: 1px solid #ddd; margin: 2rem 0; }
