/* ── Variables & Reset ─────────────────────────────────────────────────────── */
:root {
  /* RTP / Bootstrap 3 colour palette */
  --accent:       #d9534f;   /* Bootstrap danger red — RTP brand */
  --accent-dark:  #c9302c;
  --accent-light: #f2dede;
  /* keep --amber aliases for compatibility */
  --amber:        #d9534f;
  --amber-dark:   #c9302c;
  --amber-light:  #f2dede;

  --text:         #333333;   /* Bootstrap body text */
  --text-muted:   #777777;
  --surface:      #ffffff;
  --surface-2:    #f8f8f8;   /* Bootstrap navbar-default bg */
  --border:       #e7e7e7;   /* Bootstrap navbar border */
  --bg:           #ffffff;
  --header-h:     50px;      /* Bootstrap navbar height */
  --banner-h:     220px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text:       #e0e0e0;
    --text-muted: #aaaaaa;
    --surface:    #1e1e1e;
    --surface-2:  #2a2a2a;
    --border:     #3a3a3a;
    --bg:         #181818;
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  font-size: 15px;
}

a { color: inherit; }
img { max-width: 100%; }

/* ── Header — Bootstrap navbar-default style ────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 900;
  height: var(--header-h);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 15px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 4px;
}
.logo {
  display: flex; align-items: center; gap: 6px;
  text-decoration: none;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  line-height: var(--header-h);
}
.logo-icon { font-size: 18px; }
.nav { display: flex; align-items: center; gap: 0; margin-left: auto; }
.nav-link {
  padding: 0 14px;
  line-height: var(--header-h);
  display: inline-block;
  text-decoration: none;
  font-size: 14px;
  color: #555555;
  transition: color .12s, background .12s;
}
.nav-link:hover { color: #333333; background: #e8e8e8; }
.nav-link--submit {
  background: var(--accent);
  color: #fff !important;
  font-weight: 600;
  margin-left: 6px;
}
.nav-link--submit:hover { background: var(--accent-dark) !important; }
.nav-toggle {
  display: none;
  background: none; border: 1px solid #cccccc;
  border-radius: 4px; padding: 6px 10px;
  font-size: 18px; cursor: pointer;
  color: #555; margin-left: auto;
}

@media (max-width: 767px) {
  .nav { display: none; }
  .nav-toggle { display: block; }
}

/* ── Mobile nav ─────────────────────────────────────────────────────────────── */
.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 4px 0;
  position: sticky; top: var(--header-h); z-index: 899;
}
.mobile-nav.open { display: flex; }
.mobile-nav-link {
  padding: 12px 20px;
  font-size: 15px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.mobile-nav-link:hover { background: var(--surface-2); }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all .15s;
  border: 1px solid transparent;
}
.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn--primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn--ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.6);
}
.btn--ghost:hover { background: rgba(255,255,255,.15); }

/* ── Banner ──────────────────────────────────────────────────────────────────── */
.site-banner {
  display: block;
  position: relative;
  overflow: hidden;
  max-height: var(--banner-h);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.site-banner-img {
  width: 100%;
  height: var(--banner-h);
  object-fit: cover;
  display: block;
  filter: brightness(0.7);
  transition: filter .3s;
}
.site-banner:hover .site-banner-img { filter: brightness(0.6); }
.site-banner-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  padding: 0 5px 5px;
}
.site-banner-text {
  font-size: clamp(8px, 1.2vw, 13px);
  font-weight: 200;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0,0,0,.6);
  margin-bottom: 8px;
}
.site-banner-sub {
  font-size: 8px;
  color: rgba(255,255,255,.85);
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
}

/* Hide banner on map page (full-screen map) */
body.page-map .site-banner { display: none; }

/* ── Footer ──────────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  text-align: center;
  margin-top: 40px;
  background: var(--surface-2);
}
.footer-inner { max-width: 700px; margin: 0 auto; }
.footer-inner p { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.footer-inner a { color: var(--accent); text-decoration: none; }
.footer-inner a:hover { text-decoration: underline; }
.footer-meta { font-size: 12px; color: var(--text-muted); }
.footer-links a { color: var(--accent); text-decoration: none; margin: 0 4px; }
.footer-links a:hover { text-decoration: underline; }


/* ════════════════════════════════════════════════════════════
   Page-specific styles
   ════════════════════════════════════════════════════════════ */

/* ── index.html ──────────────────────────────────────────── */

/* ── Featured plaque hero ─────────────────────────────────── */
.featured {
  max-width: 900px;
  margin: 32px auto 0;
  padding: 0 20px;
}
.featured-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  margin-bottom: 10px;
}
.featured-card {
  display: block;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--surface);
  transition: box-shadow .15s;
}
.featured-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.10); }

.featured-img {
  width: 100%; max-height: 420px;
  object-fit: cover; display: block;
}
.featured-body { padding: 20px 24px 24px; }
.featured-body h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(20px, 3vw, 28px);
  margin: 0 0 10px;
  line-height: 1.25;
  font-weight: 700;
}
.featured-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Search ───────────────────────────────────────────────── */
.search-section {
  max-width: 900px;
  margin: 24px auto 0;
  padding: 0 20px;
  position: relative;
  z-index: 500;
  isolation: isolate;
}
.search-box {
  display: flex; align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0 14px;
  transition: border-color .15s;
}
.search-box:focus-within { border-color: var(--accent); }
.search-icon { font-size: 14px; opacity: .4; flex-shrink: 0; }
.search-box input {
  flex: 1; border: none; background: transparent;
  padding: 12px 10px; font-size: 14px;
  color: var(--text); outline: none;
  font-family: inherit;
}
.search-box input::placeholder { color: var(--text-muted); }
.search-clear {
  background: none; border: none; cursor: pointer;
  font-size: 13px; color: var(--text-muted); padding: 4px;
}
.search-clear:hover { color: var(--text); }
.search-results-overlay {
  position: fixed;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,.10);
  z-index: 9000; max-height: 360px; overflow-y: auto;
}
.sr-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; text-decoration: none; color: var(--text);
  border-bottom: 1px solid var(--border); transition: background .12s;
}
.sr-item:last-child { border-bottom: none; }
.sr-item:hover { background: var(--surface-2); }
.sr-item img { width: 48px; height: 36px; object-fit: cover; flex-shrink: 0; }
.sr-info strong { display: block; font-size: 14px; font-weight: 600; }
.sr-info span { font-size: 11px; color: var(--text-muted); }
.sr-empty { padding: 14px 16px; font-size: 14px; color: var(--text-muted); }

/* ── Map promo section ────────────────────────────────────── */
.map-section {
  max-width: 900px;
  margin: 28px auto 0;
  padding: 0 20px;
}
.map-section-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 10px;
}
.map-section-header h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px; font-weight: 700; margin: 0;
}
.map-section-header a { font-size: 13px; color: var(--accent); text-decoration: none; }
.map-section-header a:hover { text-decoration: underline; }
#home-map {
  height: 300px;
  overflow: hidden;
  border: 1px solid var(--border);
}

/* Popup */
.leaflet-popup-content-wrapper { border-radius: 0 !important; padding: 0 !important; overflow: hidden; }
.leaflet-popup-content { margin: 0 !important; width: auto !important; }
.hp-popup img { width: 200px; height: 120px; object-fit: cover; display: block; }
.hp-popup-body { padding: 8px 12px; }
.hp-popup-title { font-size: 13px; font-weight: 700; color: var(--text); margin: 0 0 4px; }
.hp-popup-link { font-size: 11px; color: var(--accent); text-decoration: none; font-weight: 600; }
.hp-popup-link:hover { text-decoration: underline; }

/* ── Recent plaques grid ──────────────────────────────────── */
.recent-section {
  max-width: 900px;
  margin: 28px auto 0;
  padding: 0 20px 48px;
}
.recent-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
}
.recent-header h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px; font-weight: 700;
  margin: 0;
}
.recent-header a { font-size: 13px; color: var(--accent); text-decoration: none; }
.recent-header a:hover { text-decoration: underline; }

.plaque-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}
.plaque-card {
  display: block; text-decoration: none; color: var(--text);
}
.plaque-card:hover .card-title { color: var(--accent); }
.card-img-wrap {
  position: relative; padding-top: 100%;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.card-img-wrap img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .25s;
}
.plaque-card:hover .card-img-wrap img { transform: scale(1.04); }
.card-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px; font-weight: 700;
  margin: 7px 0 2px;
  line-height: 1.35;
  transition: color .12s;
}
.card-location { font-size: 11px; color: var(--text-muted); margin: 0; }

/* ── Paginator ────────────────────────────────────────────── */
.paginator {
  max-width: 900px;
  margin: 24px auto 40px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
}
.paginator a, .paginator span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 10px;
  border: 1px solid var(--border);
  font-size: 14px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  transition: border-color .12s, background .12s;
}
.paginator a:hover { border-color: var(--accent); background: var(--surface-2); }
.paginator .current {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff; font-weight: 700; pointer-events: none;
}
.paginator .disabled { opacity: .35; pointer-events: none; }
.paginator .ellipsis { border-color: transparent; background: transparent; pointer-events: none; color: var(--text-muted); }


/* ── detail.html ─────────────────────────────────────────── */
.detail-page { max-width: 100%; padding: 32px 24px 60px; }
.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--accent); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.detail-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
  margin-bottom: 40px;
}
@media (max-width: 640px) {
  .detail-hero { grid-template-columns: 1fr; }
}
.detail-img {
  width: 100%; display: block;
  border: 1px solid var(--border);
  cursor: zoom-in;
}
.detail-info h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(20px, 3.5vw, 32px);
  color: var(--text);
  margin: 0 0 14px;
  line-height: 1.2;
}
.detail-location { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.detail-location span { color: var(--accent); }

.plaque-text-box {
  background: var(--surface-2);
  /* border-left: 3px solid var(--accent); */
  padding: 16px 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 20px;
  white-space: pre-wrap;
}
.detail-meta { font-size: 12px; color: var(--text-muted); }
.detail-meta span { margin-right: 16px; }
.mini-map { height: 200px; overflow: hidden; border: 1px solid var(--border); margin-bottom: 32px; }
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); text-decoration: none; font-size: 13px; font-weight: 600;
}
.back-link:hover { text-decoration: underline; }

/* Lightbox */
#lightbox {
  display: none;
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.92);
  align-items: center; justify-content: center;
  cursor: zoom-out;
  animation: lb-in .15s ease;
}
#lightbox.open { display: flex; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
#lightbox img {
  max-width: 94vw; max-height: 94vh; object-fit: contain;
  animation: lb-scale .15s ease; cursor: default;
}
@keyframes lb-scale { from { transform: scale(.97); } to { transform: scale(1); } }
#lightbox-close {
  position: fixed; top: 16px; right: 20px;
  color: #fff; font-size: 28px; line-height: 1;
  cursor: pointer; opacity: .7; transition: opacity .12s;
  background: none; border: none; padding: 4px; z-index: 10000;
}
#lightbox-close:hover { opacity: 1; }


/* ── submit.html ─────────────────────────────────────────── */
.submit-page { max-width: 760px; margin: 0 auto; padding: 32px 20px 60px; }
.submit-page h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px; margin: 0 0 24px;
}
.submit-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 640px) { .submit-columns { grid-template-columns: 1fr; } }
.submit-col {}
#locationPicker { height: 280px; overflow: hidden; border: 1px solid var(--border); margin-bottom: 12px; }
.coord-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
#gpsBadge {
  display: none; margin-top: 10px; padding: 8px 12px;
  background: #e8f5e9; color: #2e7d32;
  border: 1px solid #a5d6a7; font-size: 13px;
}
.submit-btn {
  width: 100%; padding: 13px;
  background: var(--accent); color: #fff; border: none;
  font-family: inherit; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: background .15s; margin-top: 8px;
}
.submit-btn:hover { background: var(--accent-dark); }
.submit-btn:disabled { opacity: .6; cursor: not-allowed; }
#submitStatus { margin-top: 12px; font-size: 14px; }
.status-ok  { color: #2e7d32; }
.status-err { color: #c0392b; }

.dz-icon { font-size: 32px; margin-bottom: 6px; }
.drop-zone {
  border: 2px dashed var(--border);
  padding: 24px 16px; text-align: center; cursor: pointer;
  position: relative; transition: border-color .15s; background: var(--surface);
}
.drop-zone.drag-over { border-color: var(--accent); background: rgba(192,57,43,.04); }
.drop-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.dz-text { font-size: 13px; color: var(--text-muted); }
.dz-text strong { color: var(--accent); }


/* ── map.html ────────────────────────────────────────────── */
body.page-map { overflow: hidden; }
body.page-map main { height: calc(100vh - var(--header-h)); position: relative; }
#map  { width: 100%; height: 100%; }

/* Map popup */
.leaflet-popup-content-wrapper { border-radius: 0 !important; padding: 0 !important; overflow: hidden; }
.leaflet-popup-content { margin: 0 !important; width: auto !important; }
.popup-img   { width: 240px; height: 140px; object-fit: cover; display: block; }
.popup-body  { padding: 10px 14px; }
.popup-title { font-size: 14px; font-weight: 700; color: var(--text); margin: 0 0 4px; }
.popup-loc   { font-size: 11px; color: var(--text-muted); margin: 0 0 8px; }
.popup-link  { font-size: 12px; color: var(--accent); text-decoration: none; font-weight: 600; }
.popup-link:hover { text-decoration: underline; }
.map-popup-img-wrap { position: relative; }

/* Map search bar */
.map-search-bar {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 0; z-index: 800; width: min(440px, 90vw);
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.map-search-bar input {
  flex: 1; border: 1px solid var(--border); border-right: none;
  padding: 10px 14px; font-size: 14px; font-family: inherit;
  background: var(--surface); color: var(--text); outline: none;
}
.map-search-bar button {
  padding: 10px 16px;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  font-size: 16px; transition: background .12s;
}
.map-search-bar button:hover { background: var(--accent-dark); }
.map-search-results {
  display: none; position: absolute; top: calc(100% + 2px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,.12); z-index: 800; max-height: 280px; overflow-y: auto;
}
.gsr-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; cursor: pointer;
  border-bottom: 1px solid var(--border); transition: background .12s;
}
.gsr-item:last-child { border-bottom: none; }
.gsr-item:hover { background: var(--surface-2); }
.gsr-item img { width: 44px; height: 33px; object-fit: cover; flex-shrink: 0; }
.gsr-info strong { display: block; font-size: 13px; font-weight: 600; }
.gsr-info span { font-size: 11px; color: var(--text-muted); }
.gsr-empty { padding: 12px; font-size: 13px; color: var(--text-muted); }


/* ── admin_queue.html ────────────────────────────────────── */
.queue-page { max-width: 1000px; margin: 0 auto; padding: 32px 20px 60px; }
.queue-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 24px; padding-bottom: 12px; border-bottom: 2px solid var(--accent);
  flex-wrap: wrap; gap: 10px;
}
.queue-header h1 { font-family: Georgia, "Times New Roman", serif; font-size: 26px; margin: 0; }
.logout-link { font-size: 13px; color: var(--accent); text-decoration: none; }
.logout-link:hover { text-decoration: underline; }
.queue-empty { color: var(--text-muted); font-size: 15px; padding: 32px 0; text-align: center; }
.queue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.queue-card {
  background: var(--surface); border: 1px solid var(--border);
  overflow: hidden;
}
.qc-img { width: 100%; height: 180px; object-fit: cover; display: block; }
.qc-body { padding: 14px 16px; }
.qc-title { font-family: Georgia, "Times New Roman", serif; font-size: 16px; font-weight: 700; margin: 0 0 6px; }
.qc-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.qc-desc {
  font-size: 13px; color: var(--text-muted); line-height: 1.6; margin-bottom: 10px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.qc-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0; border-top: 1px solid var(--border); }
.qc-btn {
  padding: 10px 4px; background: none; border: none; cursor: pointer;
  font-size: 13px; font-family: inherit; transition: background .12s;
}
.qc-btn-approve { background: #f0faf4; color: #1a7a43; border-right: 1px solid var(--border); }
.qc-btn-approve:hover { background: #c8f0d8; }
.qc-btn-edit { background: #f5f5f5; color: #555; border-right: 1px solid var(--border); text-decoration: none; display: flex; align-items: center; justify-content: center; }
.qc-btn-edit:hover { background: #e8e8e8; }
.qc-btn-reject  { background: #fdf0f0; color: #c0392b; }
.qc-btn-reject:hover  { background: #f9cccc; }


/* ── admin_plaques.html ──────────────────────────────────── */
.ap-page { max-width: 1100px; margin: 0 auto; padding: 32px 20px 60px; }
.ap-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 24px; padding-bottom: 12px; border-bottom: 2px solid var(--accent);
  flex-wrap: wrap; gap: 10px;
}
.ap-header h1 { font-family: Georgia, "Times New Roman", serif; font-size: 26px; margin: 0; }
.ap-header-links { display: flex; gap: 16px; font-size: 13px; }
.ap-header-links a { color: var(--accent); text-decoration: none; }
.ap-header-links a:hover { text-decoration: underline; }
.ap-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ap-table th {
  text-align: left; padding: 8px 12px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted);
  border-bottom: 1.5px solid var(--border); white-space: nowrap;
}
.ap-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ap-table tr:hover td { background: var(--surface-2); }
.ap-thumb { width: 52px; height: 40px; object-fit: cover; display: block; }
.ap-title { font-weight: 700; font-size: 14px; }
.ap-title a { text-decoration: none; color: var(--text); }
.ap-title a:hover { color: var(--accent); }
.ap-loc { font-size: 12px; color: var(--text-muted); }
.badge { display: inline-block; padding: 2px 8px; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.badge-approved { background: #e8f5e9; color: #2e7d32; }
.badge-pending  { background: #fff8e1; color: #f57f17; }
.btn-edit {
  display: inline-block; padding: 4px 12px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); font-size: 12px; text-decoration: none;
  transition: border-color .12s;
}
.btn-edit:hover { border-color: var(--accent); color: var(--accent); }


/* ── admin_edit.html ─────────────────────────────────────── */
.edit-page { max-width: 780px; margin: 32px auto; padding: 0 20px 60px; }
.edit-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px; padding-bottom: 14px; border-bottom: 2px solid var(--accent);
  flex-wrap: wrap; gap: 12px;
}
.edit-header h1 { font-family: Georgia, "Times New Roman", serif; font-size: 24px; margin: 0; }
.edit-header-links { display: flex; gap: 16px; font-size: 13px; }
.edit-header-links a { color: var(--accent); text-decoration: none; }
.edit-header-links a:hover { text-decoration: underline; }

.form-section { margin-bottom: 24px; }
.form-section h2 {
  font-family: Georgia, "Times New Roman", serif; font-size: 15px;
  margin: 0 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.form-group { margin-bottom: 16px; }
label {
  display: block; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); margin-bottom: 5px;
}
input[type=text], textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border);
  font-family: inherit; font-size: 14px;
  background: var(--surface); color: var(--text);
  transition: border-color .15s; box-sizing: border-box;
}
input[type=text]:focus, textarea:focus {
  outline: none; border-color: var(--accent);
}
textarea { resize: vertical; min-height: 90px; }
.coord-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.current-img-wrap { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 12px; }
.current-img { width: 120px; height: 90px; object-fit: cover; border: 1px solid var(--border); flex-shrink: 0; }
.current-img-info { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.drop-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
#newImgPreview { display: none; margin-top: 10px; max-height: 160px; border: 1px solid var(--border); }
#coordPicker { height: 240px; overflow: hidden; border: 1px solid var(--border); margin-bottom: 10px; }

.toggle-row { display: flex; align-items: center; gap: 10px; }
.toggle-row input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }
.toggle-row label { margin: 0; text-transform: none; font-size: 14px; font-weight: 400; color: var(--text); cursor: pointer; }
.errors { background: #fde8e8; color: #c0392b; border: 1px solid #f5c6c6; padding: 12px 16px; font-size: 14px; margin-bottom: 20px; }

.btn-row { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.btn-save {
  padding: 11px 28px; background: var(--accent); color: #fff; border: none;
  font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer; transition: background .15s;
}
.btn-save:hover { background: var(--accent-dark); }
.btn-cancel {
  padding: 11px 20px; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); font-size: 14px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; transition: border-color .15s;
}
.btn-cancel:hover { border-color: var(--accent); }


/* ── Tags ─────────────────────────────────────────────────── */
.tag-pill {
  display: inline-block; padding: 2px 9px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
  text-decoration: none; transition: border-color .12s, color .12s;
}
.tag-pill:hover { border-color: var(--accent); color: var(--accent); }
.tag-pill--large { font-size: 15px; padding: 4px 14px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }

/* ── Tag page ─────────────────────────────────────────────── */
.tag-page { max-width: 900px; margin: 32px auto; padding: 0 20px 48px; }
.tag-page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 12px;
}
.tag-eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin: 0 0 6px; }
.tag-page-title { margin: 0; }
.tag-page-count { font-size: 13px; color: var(--text-muted); }
.tag-empty { color: var(--text-muted); font-size: 15px; }

/* ── Rotate button ────────────────────────────────────────── */
.btn-rotate {
  padding: 4px 10px; font-size: 13px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); transition: border-color .12s;
}
.btn-rotate:hover { border-color: var(--accent); }
.btn-rotate:disabled { opacity: .5; cursor: not-allowed; }

/* ── Nearby plaques ───────────────────────────────────────── */
.nearby-section { margin: 32px 0 24px; border-top: 1px solid var(--border); padding-top: 20px; }
.nearby-title { font-family: Georgia, "Times New Roman", serif; font-size: 17px; margin: 0 0 14px; }
.nearby-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.nearby-card { display: block; text-decoration: none; color: var(--text); }
.nearby-card img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border: 1px solid var(--border); transition: opacity .15s; display: block;
}
.nearby-card:hover img { opacity: .85; }
.nearby-card-body { padding: 5px 0 0; }
.nearby-card-title { font-size: 12px; font-weight: 700; margin: 0 0 2px; line-height: 1.3; }
.nearby-card:hover .nearby-card-title { color: var(--accent); }
.nearby-card-dist { font-size: 11px; color: var(--text-muted); margin: 0; }
.nearby-loading, .nearby-empty { font-size: 14px; color: var(--text-muted); }

/* ── Detail image gallery ─────────────────────────────────── */
.gallery-thumbs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.gallery-thumb {
  width: 56px; height: 44px; object-fit: cover;
  border: 2px solid var(--border); cursor: pointer; transition: border-color .12s;
}
.gallery-thumb.active, .gallery-thumb:hover { border-color: var(--accent); }

/* ── Admin edit gallery ───────────────────────────────────── */
.edit-gallery { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 4px; }
.edit-gallery-item { position: relative; width: 116px; }
.edit-gallery-item img { width: 100%; height: 87px; object-fit: cover; border: 1px solid var(--border); display: block; }
.edit-gallery-primary { position: absolute; top: 3px; left: 3px; background: var(--accent); color: #fff; font-size: 10px; padding: 2px 5px; }
.edit-gallery-actions { display: flex; gap: 3px; margin-top: 4px; flex-wrap: wrap; }
.eg-btn { flex: 1; padding: 3px 0; font-size: 11px; cursor: pointer; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); transition: border-color .12s; min-width: 0; }
.eg-btn:hover { border-color: var(--accent); }
.eg-btn-del:hover { border-color: #c0392b; color: #c0392b; }
.eg-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── About page ───────────────────────────────────────────── */
.about-page { max-width: 680px; margin: 40px auto; padding: 0 20px 60px; }
.about-header { margin-bottom: 28px; padding-bottom: 14px; border-bottom: 2px solid var(--accent); }
.about-header h1 { font-family: Georgia, "Times New Roman", serif; font-size: 32px; margin: 0; }
.about-lead { font-size: 16px; line-height: 1.75; color: var(--text); margin-bottom: 28px; }
.about-body h2 { font-family: Georgia, "Times New Roman", serif; font-size: 18px; margin: 28px 0 10px; }
.about-body p { font-size: 14px; line-height: 1.75; color: var(--text-muted); margin: 0 0 14px; }
.about-body a { color: var(--accent); text-decoration: none; }
.about-body a:hover { text-decoration: underline; }
.about-body ul { padding-left: 20px; margin: 0 0 14px; }
.about-body li { font-size: 14px; line-height: 1.75; color: var(--text-muted); margin-bottom: 5px; }
.about-body li a { color: var(--accent); text-decoration: none; }
.about-body li a:hover { text-decoration: underline; }

/* ── Map popup image loading ──────────────────────────────── */
.map-popup-img-wrap { position: relative; }

/* ── Utility ─────────────────────────────────────────────────────────────────── */
.is-hidden { display: none !important; }
.field-hint { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.label-hint { font-size: 12px; color: var(--text-muted); }
.link-accent { color: var(--accent); }
.img-preview-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.form-group--tight { margin: 0; }
.coord-row--spaced { margin-top: 12px; }
.toggle-row--spaced { margin-top: 12px; }

/* ── Login page ──────────────────────────────────────────────────────────────── */
.login-page { max-width: 380px; margin: 72px auto; padding: 0 24px; }
.login-title { font-family: Georgia, "Times New Roman", serif; font-size: 28px; margin-bottom: 8px; }
.login-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.login-error {
  background: #fde8e8; color: #c0392b;
  border: 1px solid #f5c6c6; padding: 12px 16px;
  font-size: 14px; margin-bottom: 20px;
}

/* ── Map wrapper ─────────────────────────────────────────────────────────────── */
.map-wrapper { position: relative; height: 100%; }
.popup-body { min-width: 220px; }
.map-popup-img { width: 100%; height: 140px; object-fit: cover; display: block; }

/* ── Alert box (submit page) ─────────────────────────────────────────────────── */
.alert-box { display: none; }

/* .map-pin removed — MapLibre Marker used instead */

/* ── Admin plaques table cells ───────────────────────────────────────────────── */
.ap-total { font-size: 13px; color: var(--text-muted); margin: 4px 0 0; }
.ap-meta-cell { font-size: 13px; color: var(--text-muted); }
.ap-date-cell { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

/* ── Queue header links ──────────────────────────────────────────────────────── */
.queue-header-links { display: flex; gap: 16px; align-items: center; }
.btn-save--full { width: 100%; }

/* ── Admin plaques — filter bar & sort ───────────────────────────────────────── */
.ap-filters {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 16px;
}
.ap-filter-group { display: flex; }
.ap-search {
  padding: 8px 12px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  width: 220px; transition: border-color .15s;
}
.ap-search:focus { outline: none; border-color: var(--accent); }
.ap-select {
  padding: 8px 10px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer;
}
.ap-select:focus { outline: none; border-color: var(--accent); }
.ap-filter-btn {
  padding: 8px 16px; font-size: 14px; font-family: inherit; font-weight: 600;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  transition: background .15s;
}
.ap-filter-btn:hover { background: var(--accent-dark); }
.ap-filter-reset {
  font-size: 13px; color: var(--text-muted); text-decoration: none;
  padding: 4px 8px; border: 1px solid var(--border);
}
.ap-filter-reset:hover { color: var(--accent); border-color: var(--accent); }
.ap-sort-link {
  text-decoration: none; color: inherit; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
}
.ap-sort-link:hover { color: var(--accent); }
.ap-sort-neutral { opacity: .35; font-size: 10px; }
.ap-empty { text-align: center; padding: 32px; color: var(--text-muted); font-size: 14px; }

/* ── Submitter link ───────────────────────────────────────────────────────────── */
.submitter-link { color: var(--accent); text-decoration: none; }
.submitter-link:hover { text-decoration: underline; }

/* ── Honeypot (must be visually hidden but not display:none — bots ignore that) */
.honeypot-wrap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* MapLibre popup overrides */
.maplibregl-popup-content { padding: 0 !important; overflow: hidden; border-radius: 2px !important; }
.maplibregl-popup-close-button { color: var(--text-muted); font-size: 16px; padding: 4px 8px; z-index: 1; }
.popup-img   { width: 240px; height: 140px; object-fit: cover; display: block; }
.popup-body  { padding: 10px 14px; }
.popup-title { font-size: 14px; font-weight: 700; color: var(--text); margin: 0 0 4px; }
.popup-link  { font-size: 12px; color: var(--accent); text-decoration: none; font-weight: 600; }
.popup-link:hover { text-decoration: underline; }
.map-popup-img-wrap { position: relative; }


.address-results {
  display: none;
  position: relative;
  z-index: 10;
  margin-top: 4px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg, #fff);
  overflow: hidden;
}

.address-result {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.address-result:last-child {
  border-bottom: 0;
}

.address-result:hover,
.address-result:focus {
  background: var(--surface, #f5f5f5);
}

/* ── Reject button (admin plaques table) ─────────────────────────────────────── */
.btn-reject {
  padding: 4px 10px; font-size: 12px; font-family: inherit; cursor: pointer;
  background: #fdf0f0; color: var(--accent); border: 1px solid var(--accent);
  transition: background .12s, color .12s; white-space: nowrap;
}
.btn-reject:hover { background: var(--accent); color: #fff; }
.btn-reject:disabled { opacity: .5; cursor: not-allowed; }

.map-loading {
  position: absolute;
  inset: 0;
  z-index: 850;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease;
}

.map-loading.is-visible {
  opacity: 1;
  visibility: visible;
}

.map-spinner {
  width: 42px;
  height: 42px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: map-spinner-spin .75s linear infinite;
}

@keyframes map-spinner-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── Index hero: featured + map side by side ─────────────────────────────────── */
.index-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  height: calc(100vh - var(--header-h) - var(--banner-h, 0px));
  min-height: 360px;
  max-height: 600px;
  max-width: 100%;
  padding: 0 24px;
  box-sizing: border-box;
}

.index-featured {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  position: relative;
}
.index-featured--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 14px;
}
.index-featured-img {
  width: 100%;
  flex: 1;
  object-fit: cover;
  display: block;
  min-height: 0;
  transition: filter .2s;
}
.index-featured:hover .index-featured-img { filter: brightness(.9); }
.index-featured-body {
  padding: 16px 20px;
  background: var(--surface);
  border-top: 2px solid var(--accent);
  flex-shrink: 0;
}
.index-featured-body h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(15px, 1.8vw, 22px);
  margin: 4px 0 6px;
  line-height: 1.25;
}
.index-featured-body .featured-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.index-map-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
}
.index-map-header {
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  flex-shrink: 0;
}
.index-map-header a { color: var(--accent); text-decoration: none; }
.index-map-header a:hover { text-decoration: underline; }
.index-map-panel .plaque-map-widget {
  flex: 1;
  min-height: 0;
  height: auto !important; /* override inline height — flex handles it */
}

/* Full-width sections below hero */
.search-section,
.recent-section {
  max-width: 100%;
  padding-left: 24px;
  padding-right: 24px;
}

@media (max-width: 640px) {
  .index-hero {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }
  .index-featured-img { max-height: 260px; }
  .index-map-panel { height: 260px; border-left: none; border-top: 1px solid var(--border); }
  .index-map-panel .plaque-map-widget { height: 100% !important; }
}

/* ── Un-approve button (admin plaques table) ─────────────────────────────────── */
.btn-unapprove {
  padding: 4px 10px; font-size: 12px; font-family: inherit; cursor: pointer;
  background: #f5f5f5; color: #555; border: 1px solid #aaa;
  transition: background .12s; white-space: nowrap;
}
.btn-unapprove:hover { background: #555; color: #fff; border-color: #555; }
.btn-unapprove:disabled { opacity: .5; cursor: not-allowed; }

/* ── Search results page ──────────────────────────────────────────────────────── */
.search-results-hero-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 28px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.search-results-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(18px, 2.5vw, 32px);
  margin: 0 0 12px;
  line-height: 1.25;
}
.search-results-title em { color: var(--accent); font-style: normal; }
.search-results-sub { font-size: 13px; color: var(--text-muted); margin: 0 0 24px; }
.search-results-sub a { color: var(--accent); text-decoration: none; }
.search-results-sub a:hover { text-decoration: underline; }
.search-results-form .search-box { margin-top: 8px; }
.search-submit-btn {
  padding: 0 16px; background: var(--accent); color: #fff; border: none;
  font-size: 14px; font-family: inherit; cursor: pointer; transition: background .15s;
}
.search-submit-btn:hover { background: var(--accent-dark); }
.search-no-results {
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: 32px 28px; gap: 16px;
  color: var(--text-muted); font-size: 14px;
}
.search-no-results a { color: var(--accent); text-decoration: none; }
.search-no-results a:hover { text-decoration: underline; }
