:root {
  --ink: #22252a;
  --muted: #6b7078;
  --border: #dcdfe4;
  --bg: #fafafa;
  --card: #ffffff;
  --accent: #3d5a80;
  --accent-bg: #eaf0f7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.brand { font-size: 20px; font-weight: 700; color: var(--ink); }
.brand:hover { text-decoration: none; }
.site-header nav { display: flex; gap: 24px; }
.site-header nav a { color: var(--muted); font-weight: 500; }
.site-header nav a.active { color: var(--accent); }
.user-menu { display: flex; align-items: center; gap: 12px; }
.link-btn {
  background: none; border: none; color: var(--accent); cursor: pointer;
  padding: 0; font-size: 14px; font-family: inherit;
}
.link-btn:hover { text-decoration: underline; }

.container { max-width: 1080px; margin: 0 auto; padding: 32px; }

h1 { font-size: 28px; margin: 0 0 8px; }
h2 { font-size: 20px; margin: 0 0 16px; }

.back-link { margin-bottom: 16px; display: inline-block; }

.stat-row { display: flex; gap: 16px; margin: 20px 0; flex-wrap: wrap; }
.stat-box {
  flex: 1; min-width: 160px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--card); padding: 16px 20px; text-align: center;
}
.stat-box .label { font-size: 13px; color: var(--muted); }
.stat-box .value { font-size: 26px; font-weight: 700; margin-top: 4px; }

.card-grid { display: flex; gap: 20px; flex-wrap: wrap; }
.card {
  width: 260px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--card); padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.card img, .thumb-ph {
  width: 100%; height: 140px; object-fit: cover; border-radius: 6px; background: #eee;
}
.thumb-ph {
  display: flex; align-items: center; justify-content: center; color: #999; font-size: 13px;
  border: 1px dashed var(--border);
}
.card .name { font-weight: 600; font-size: 17px; }
.card .meta { color: var(--muted); font-size: 14px; }
.card.add-card {
  align-items: center; justify-content: center; border-style: dashed; color: var(--muted);
}

.list { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--card); padding: 14px 18px;
}
.list-row.add-row { justify-content: center; border-style: dashed; color: var(--muted); }
.list-row .left { display: flex; align-items: center; gap: 14px; }
.list-row .meta { color: var(--muted); font-size: 14px; text-align: right; }

.badge {
  display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
}
.badge.rv_journey { background: #e8eef5; color: #2c4b73; }
.badge.vehicle_road_trip { background: #f3ecdd; color: #7a5a1e; }
.badge.other_travel { background: #eae5f0; color: #5a3f79; }

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--accent-bg); color: var(--accent);
}
.tag-pill:hover { text-decoration: none; opacity: 0.85; }
.tag-pill.active { background: var(--accent); color: #fff; }
.tag-count { opacity: 0.7; font-weight: 400; }

.chip-row { display: flex; gap: 14px; margin: 16px 0; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border); border-radius: 10px; background: var(--card);
  padding: 10px 16px; display: flex; align-items: center; gap: 10px;
}
.chip.dashed { border-style: dashed; color: var(--muted); }
.chip .label { font-size: 12px; color: var(--muted); }
.chip .value { font-weight: 600; }

.map-image, .map-ph {
  width: 100%; max-height: 420px; object-fit: cover; border-radius: 10px; margin: 16px 0;
}
.map-ph {
  height: 240px; display: flex; align-items: center; justify-content: center;
  background: #f0f0ee; border: 1px dashed var(--border); color: #999;
}

.photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 12px 0;
}
.photo-grid img { width: 100%; height: 150px; object-fit: cover; border-radius: 6px; }

.day-breadcrumb {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; margin-bottom: 12px; border-bottom: 1px solid var(--border);
}

/* The full-album view (album.php): each photo shown at full aspect ratio
   (never cropped) and reflowing into more/fewer columns as the browser
   window resizes — no media queries needed, auto-fill does that. */
.album-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; margin: 16px 0;
}
.album-item {
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: var(--card); display: flex; flex-direction: column;
}
.album-item .photo-frame {
  display: flex; align-items: center; justify-content: center; background: #14161a;
}
.album-item .photo-frame img { width: 100%; max-height: 70vh; object-fit: contain; display: block; }
.album-item .caption-area { padding: 12px 14px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.field input[type=text], .field input[type=date], .field input[type=number],
.field textarea, .field select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 15px;
  font-family: inherit;
}
.field textarea { min-height: 100px; }
.field-row { display: flex; gap: 16px; }
.field-row .field { flex: 1; }
.hint { color: var(--muted); font-size: 13px; margin-top: 4px; }

.bulk-table-wrap { overflow-x: auto; margin: 16px 0; }
.bulk-table { width: 100%; min-width: 700px; border-collapse: collapse; }
.bulk-table th, .bulk-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.bulk-table th { font-size: 13px; color: var(--muted); font-weight: 600; }
.bulk-table input, .bulk-table textarea {
  width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; font-family: inherit; box-sizing: border-box;
}
.bulk-table textarea { min-height: 44px; resize: vertical; }

.btn {
  display: inline-block; padding: 10px 18px; border-radius: 8px; border: none;
  background: var(--accent); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn:hover { opacity: 0.92; text-decoration: none; }

.type-fields { display: none; border-top: 1px solid var(--border); padding-top: 16px; margin-top: 8px; }
.type-fields.active { display: block; }
