/* GTAC archive viewer — boring, dense, fast. */

:root {
  --fg: #1b1b1b;
  --fg-dim: #6b6b6b;
  --bg: #fafaf8;
  --card: #ffffff;
  --line: #e6e6e2;
  --accent: #2c5f4f;       /* forest green */
  --accent-bg: #e8f1ec;
  --pin: #b87333;
  --mark: #fff3a8;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font: 12px/1 ui-monospace, "SF Mono", Consolas, monospace; background: #f2f2ee; padding: 1px 4px; border-radius: 3px; }
mark { background: var(--mark); padding: 0 1px; }

.site-header {
  display: flex; align-items: center; gap: 16px;
  padding: 8px 18px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.site-header .brand {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--accent); white-space: nowrap; text-decoration: none;
}
.site-header .brand:hover { text-decoration: none; }
.site-header .brand-logo {
  height: 40px; max-height: 40px; width: auto; max-width: 240px;
  display: block; object-fit: contain;
}
.site-header .brand-sub {
  display: inline-block; font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-dim); border-left: 1px solid var(--line);
  padding-left: 8px;
}
.site-header nav {
  margin-left: auto; display: flex; gap: 4px; align-items: center;
}
.site-header nav a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 4px;
  color: var(--fg); font-size: 13px;
}
.site-header nav a:hover {
  background: var(--accent-bg); text-decoration: none;
}
.site-header nav a.active { background: var(--accent-bg); font-weight: 600; }
.site-header nav a.logout, .site-header nav a.adm {
  padding: 6px 8px; color: var(--fg-dim);
}
.site-header nav a.logout:hover { color: #b04d4d; background: #fbecec; }
.site-header nav a.adm:hover { color: var(--accent); }
.site-header nav .me-tag {
  font-size: 12px; color: var(--fg-dim); padding: 0 6px;
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  margin: 0 2px;
}
@media (max-width: 760px) {
  .site-header nav a span { display: none; }  /* icon-only on small screens */
}
/* Page-head <header> elements inside <main> get plain block layout — they're
   NOT the sticky site header. Make that explicit so future styles don't leak. */
main header.page-head {
  display: block; position: static; padding: 0; background: none;
  border: none; box-shadow: none;
}

.topsearch {
  flex: 1; max-width: 520px; display: flex; gap: 6px;
}
.topsearch input {
  flex: 1; padding: 7px 10px; border: 1px solid var(--line); border-radius: 4px;
  font-size: 14px;
}
.topsearch button {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 12px; background: var(--accent); color: white;
  border: 0; border-radius: 4px; cursor: pointer;
}
.filters button {
  padding: 6px 14px; background: var(--accent); color: white;
  border: 0; border-radius: 4px; cursor: pointer; font-size: 14px;
}

/* Inline SVG icons baseline */
svg.i {
  display: inline-block; vertical-align: -2px; flex-shrink: 0;
}

main {
  max-width: 920px; margin: 0 auto; padding: 18px;
}
footer {
  text-align: center; color: var(--fg-dim); padding: 30px 18px 50px;
}

h1 { font-size: 22px; margin: 0 0 6px; }
h2 { font-size: 17px; margin: 22px 0 10px; color: var(--fg-dim); font-weight: 600; }
h2 small { color: var(--fg-dim); font-weight: 400; margin-left: 8px; font-size: 13px; }

.dash .stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px; background: var(--card); border: 1px solid var(--line);
  border-radius: 6px; padding: 14px;
}
.dash .stats div { font-size: 13px; color: var(--fg-dim); }
.dash .stats strong { font-size: 22px; color: var(--fg); display: block; line-height: 1.1; }
.dash .stats .span { grid-column: 1 / -1; font-size: 12px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 6px;
  padding: 10px 14px; margin: 8px 0;
}
.card .meta {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  font-size: 12px; color: var(--fg-dim);
}
.card .meta .ts { font-variant-numeric: tabular-nums; }
.card .meta .grouptag,
.card .meta .topic,
.card .meta .author,
.post-meta .topic,
.post-meta .origurl,
.post-meta .print-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 7px; border-radius: 3px; font-weight: 500;
}
.card .meta .grouptag { background: var(--accent-bg); color: var(--accent); }
.card .meta .grouptag:hover { background: #d6e8de; text-decoration: none; }
.card .meta .topic, .post-meta .topic {
  background: #fdf1e1; color: var(--pin);
}
.card .meta .topic:hover, .post-meta .topic:hover { background: #fbe4c5; text-decoration: none; }
.card .meta .author { color: var(--fg); }
.card .meta .author:hover { background: #f0f0eb; text-decoration: none; }
.card .meta .ts { display: inline-flex; align-items: center; gap: 3px; }
.card .card-foot span { display: inline-flex; align-items: center; gap: 3px; }
nav a.active { font-weight: 600; }
nav a.logout { color: var(--fg-dim); font-size: 16px; padding: 0 4px; }

/* Login page */
body.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  max-width: 380px; padding: 32px 32px 28px; background: var(--card);
  border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.04);
  text-align: center;
}
.login-card .login-logo {
  max-width: 100%; max-height: 90px; width: auto; height: auto;
  margin: 0 auto 12px; display: block;
}
.login-card h1 { color: var(--accent); margin-bottom: 4px; }
.login-card form { text-align: left; }
.login-card form { margin: 18px 0 12px; display: flex; flex-direction: column; gap: 10px; }
.login-card label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--fg-dim); }
.login-card input[type=password] {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px; font-size: 16px;
}
.login-card button {
  padding: 8px; background: var(--accent); color: white; border: 0;
  border-radius: 4px; cursor: pointer; font-size: 14px; font-weight: 500;
}
.login-card .warn { background: #fdf1e1; border: 1px solid #f0c889; color: #8a4a0c; padding: 8px 10px; border-radius: 4px; font-size: 13px; }
.login-card .small { font-size: 11px; }

.card .meta .author { font-weight: 500; color: var(--fg); }
.card .meta .pin { color: var(--pin); }
.card .body { margin: 6px 0; white-space: pre-wrap; word-wrap: break-word; }
.card .card-foot {
  display: flex; gap: 12px; font-size: 12px; color: var(--fg-dim);
}
.card .card-foot .permalink { font-weight: 500; }
.card.comment { background: #fafaf6; }

.empty { color: var(--fg-dim); font-style: italic; }
.dim { color: var(--fg-dim); }
.tag { background: #eee; color: var(--fg-dim); padding: 1px 6px; border-radius: 3px; font-size: 11px; }

/* Search filters */
.filters {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 6px; padding: 12px; margin-bottom: 16px;
}
.filters .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters .row.tight { margin-top: 8px; }
.filters input.big {
  flex: 1; padding: 8px 10px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 4px;
}
.filters label {
  font-size: 12px; color: var(--fg-dim); display: flex; flex-direction: column; gap: 2px;
}
.filters select, .filters input[type=date] {
  padding: 4px 6px; border: 1px solid var(--line); border-radius: 3px; font-size: 13px;
}

/* Page heads */
.page-head { margin-bottom: 16px; }
.page-head p { margin: 2px 0; font-size: 13px; }

/* Full post */
.post-full { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 18px 22px; }
.post-full .post-head { border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 14px; }
.post-full h1 { font-size: 18px; font-weight: 600; }
.post-full .post-meta {
  display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px;
  color: var(--fg-dim); margin-top: 6px;
}
.post-full .post-meta .origurl { color: var(--accent); }
.post-full .post-meta .print-btn {
  background: var(--accent-bg); color: var(--accent);
  padding: 2px 8px; border-radius: 3px; font-weight: 500;
}
.post-full .post-meta .print-btn:hover { background: #d6e8de; text-decoration: none; }

/* Loading status indicator (e.g. the map page) — clear and bold while loading. */
.loading-status {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 8px 0 14px; padding: 6px 12px;
  border-radius: 18px; font-size: 13px;
}
.loading-status .dot {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}
.loading-status.is-loading {
  background: #fdf1e1; color: var(--pin);
  font-weight: 700;
}
.loading-status.is-loading .dot {
  background: var(--pin);
  animation: pulse 1.1s ease-in-out infinite;
}
.loading-status.is-done {
  background: var(--accent-bg); color: var(--accent);
  font-weight: 500;
}
.loading-status.is-done .dot { background: var(--accent); }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.7); }
}
@media print { .loading-status { display: none; } }

/* Tab bar — used on author page to switch between posts / comments-made / etc. */
.tab-bar {
  display: flex; gap: 4px; margin: 14px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.tab-bar a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; color: var(--fg-dim);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-size: 13px;
}
.tab-bar a:hover { color: var(--fg); text-decoration: none; }
.tab-bar a.active {
  color: var(--accent); border-bottom-color: var(--accent);
  font-weight: 600;
}
.tab-bar a .num-badge {
  background: var(--line); color: var(--fg-dim);
  padding: 1px 6px; border-radius: 10px; font-size: 11px; font-weight: 500;
}
.tab-bar a.active .num-badge { background: var(--accent-bg); color: var(--accent); }

/* Time-log table — structured entries parsed from a post body */
.time-log { margin-top: 18px; }
.time-log h2 { margin-bottom: 6px; }
.time-log h2 small { font-weight: 400; }
.time-entries { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.time-entries th, .time-entries td {
  padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--line);
  font-size: 13px; vertical-align: top;
}
.time-entries th {
  background: #f4f4f0; font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
  color: var(--fg-dim); font-weight: 600;
}
.time-entries td.ts { font-variant-numeric: tabular-nums; white-space: nowrap; width: 90px; }
.time-entries td.num { font-variant-numeric: tabular-nums; white-space: nowrap; width: 60px; }
.time-entries tr:last-child td { border-bottom: 0; }
.time-entries .topic { font-size: 12px; }
@media print {
  .time-entries { border: 1px solid #999; }
  .time-entries th { background: #eee; }
}

/* Photo search results — grid of thumbs with AI caption snippets */
.photo-results {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.photo-card {
  display: block; background: var(--card); border: 1px solid var(--line);
  border-radius: 6px; overflow: hidden; color: var(--fg);
}
.photo-card:hover { border-color: var(--accent); text-decoration: none; }
.photo-card img {
  width: 100%; height: 160px; object-fit: cover; display: block; background: #eee;
}
.photo-card .photo-meta { padding: 6px 8px; }
.photo-card .snip { font-size: 12px; line-height: 1.35; }
.photo-card .dim { margin-top: 4px; }
.post-full .post-body {
  font-size: 16px; line-height: 1.55; white-space: pre-wrap; word-wrap: break-word;
  margin: 14px 0;
}
.post-full .post-body.empty { color: var(--fg-dim); font-size: 13px; font-style: italic; }
.pin.big { background: #fdf1e1; color: var(--pin); padding: 2px 8px; border-radius: 3px; font-size: 12px; display: inline-block; margin-bottom: 6px; }

/* Media gallery */
.media .gallery {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px; margin: 8px 0;
}
.media figure { margin: 0; }
.media img, .media video {
  width: 100%; height: auto; max-height: 320px; object-fit: cover;
  border-radius: 4px; background: #eee; display: block;
}
.media figcaption {
  font-size: 11px; color: var(--fg-dim); padding-top: 4px; line-height: 1.35;
}
.media figcaption a { color: var(--accent); }
.media figcaption .ai-caption {
  background: #f3f0e6; border-left: 2px solid #b87333;
  padding: 4px 6px; font-size: 12px; color: var(--fg);
  margin-bottom: 4px; line-height: 1.35;
}

/* Reactions */
.reactions ul { list-style: none; padding: 0; margin: 0; }
.reactions li { padding: 3px 0; font-size: 13px; }

/* Comments thread */
.comments .comment {
  border-left: 3px solid var(--line);
  padding: 8px 12px; margin: 8px 0; background: #fafaf6;
}
.comments .comment .meta { font-size: 12px; color: var(--fg-dim); }
.comments .comment .body { white-space: pre-wrap; word-wrap: break-word; }

/* Listing tables */
.listing { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.listing th, .listing td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
.listing th { background: #f4f4f0; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--fg-dim); }
.listing td.num, .listing th.num { text-align: right; font-variant-numeric: tabular-nums; }
.listing tr:last-child td { border-bottom: 0; }

/* Pager */
.pager { display: flex; justify-content: space-between; align-items: center; margin: 20px 0; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 6px; }
.pager .dim { font-size: 12px; }

/* Inline admin forms */
.inline-form { display: inline-flex; gap: 4px; align-items: center; }
.inline-form input[type=text] {
  padding: 4px 6px; border: 1px solid var(--line); border-radius: 3px;
  font-size: 12px; width: 140px;
}
.inline-form button {
  padding: 4px 10px; background: var(--accent); color: white; border: 0;
  border-radius: 3px; cursor: pointer; font-size: 12px;
}
.inline-form button.danger { background: #b04d4d; }
.inline-form button.danger:hover { background: #993939; }
.small { font-size: 12px; }
.admin-topics td { vertical-align: middle; }
.admin-log { margin-top: 28px; }
.admin-log h2 { margin-bottom: 8px; }
.reverted-row { opacity: 0.55; }
.reverted-row td { text-decoration: line-through; }

/* ============================================================
   PRINT STYLES — File → Print → Save as PDF produces a clean
   record-of-document suitable for legal/financial/insurance use.
   Strips chrome, expands all photos inline, surfaces all metadata.
   ============================================================ */
@media print {
  /* Hide everything that's chrome */
  header, footer, nav, .topsearch, .filters, .pager,
  .card-foot .permalink, .inline-form, .admin-log {
    display: none !important;
  }

  body {
    background: white;
    color: black;
    font-size: 11pt;
    line-height: 1.4;
  }

  main {
    max-width: none;
    padding: 0;
    margin: 0;
  }

  a { color: black; text-decoration: none; }
  a[href]:after { content: ""; }  /* no auto-appending URLs everywhere */
  .post-full a.origurl[href]:after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }

  /* Post page: emphasize evidentiary metadata */
  .post-full {
    border: none;
    padding: 0;
    box-shadow: none;
  }
  .post-full .post-head {
    border-bottom: 2px solid black;
    padding-bottom: 8pt;
    margin-bottom: 10pt;
  }
  .post-full h1 { font-size: 14pt; }
  .post-full .post-meta {
    font-size: 9pt;
    color: #333;
    display: block;
  }
  .post-full .post-meta > span,
  .post-full .post-meta > a { display: block; margin: 2pt 0; }
  .post-full .post-meta .ids code { background: transparent; }

  /* Document-style title at top of each printed post for record indexing */
  .post-full::before {
    content: "Greene Tree and Construction — Archive Record";
    display: block;
    font-size: 9pt;
    color: #555;
    border-bottom: 1px solid #ccc;
    padding-bottom: 4pt;
    margin-bottom: 8pt;
  }

  .post-body {
    font-size: 11pt;
    margin: 8pt 0 14pt;
  }

  /* Media: expand the gallery so every photo prints inline with full EXIF */
  .media h2 { font-size: 11pt; margin-top: 14pt; }
  .media .gallery {
    display: block;
  }
  .media figure {
    page-break-inside: avoid;
    break-inside: avoid;
    margin: 10pt 0 14pt;
    border-top: 1px solid #ddd;
    padding-top: 8pt;
  }
  .media img {
    max-width: 100%;
    max-height: 4.5in;
    object-fit: contain;
    page-break-inside: avoid;
  }
  .media figcaption {
    font-size: 9pt;
    color: #333;
    margin-top: 4pt;
  }
  .media video { display: none; }  /* video doesn't print; the figcaption still shows metadata */
  .media video + figcaption::before {
    content: "[VIDEO — not shown in print] ";
    font-style: italic;
  }

  /* Comments: keep them, but compact */
  .comments h2 { font-size: 11pt; margin-top: 14pt; }
  .comments .comment {
    background: none;
    border-left: 2pt solid #999;
    padding: 4pt 8pt;
    margin: 4pt 0;
    page-break-inside: avoid;
  }
  .comments .comment .meta { font-size: 9pt; }

  /* Reactions: keep compact */
  .reactions h2 { font-size: 11pt; margin-top: 14pt; }
  .reactions ul { font-size: 9pt; padding-left: 16pt; }
  .reactions li { padding: 1pt 0; }

  /* Print footer (page-level note) */
  @page {
    margin: 0.5in 0.6in;
    @bottom-right { content: "Page " counter(page) " of " counter(pages); font-size: 8pt; color: #666; }
  }
}


