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

:root {
  --ink:      #1a1410;
  --ink-soft: #5a4f46;
  --paper:    #faf8f4;
  --cream:    #f2ede4;
  --accent:   #b8632a;
  --accent-h: #9a4f1f;
  --border:   #e0d8cc;
  --radius:   6px;
  --serif:    Georgia, 'Times New Roman', serif;
  --body:     'Palatino Linotype', Palatino, Georgia, serif;
  --max-w:    900px;
  --gap:      clamp(1rem, 4vw, 2rem);
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper); color: var(--ink);
  font-family: var(--body); line-height: 1.75;
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--accent-h); }
img { max-width: 100%; display: block; height: auto; }

/* ── Header / nav ────────────────────────────────────── */
.site-header {
  background: var(--ink); color: #fff;
  position: sticky; top: 0; z-index: 200;
  /* isolation:isolate creates a new stacking context so that the
     mobile dropdown (position:absolute inside .site-header) stays
     visually inside the header's layer and always above page content. */
  isolation: isolate;
  box-shadow: 0 2px 12px rgba(0,0,0,.35);
}
.nav-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1rem; min-height: 52px; gap: .75rem;
}
.site-title {
  font-family: var(--serif); font-size: 1.1rem; font-style: italic;
  color: #fff; white-space: nowrap; flex-shrink: 0;
}
.site-title:hover { text-decoration: none; color: #e8d5b7; }

.nav-links {
  display: flex; align-items: center; gap: 1.25rem;
  font-size: .88rem;
}
.nav-links a { color: #ccc; }
.nav-links a:hover { color: #fff; text-decoration: none; }
.nav-admin { color: #e8d5b7 !important; }

/* Hamburger — hidden on desktop */
.nav-toggle {
  display: none; background: none; border: none;
  color: #fff; font-size: 1.4rem; cursor: pointer;
  padding: .25rem .4rem; line-height: 1;
}

/* ── Main ────────────────────────────────────────────── */
.main-content {
  flex: 1; max-width: var(--max-w); width: 100%;
  margin: 0 auto; padding: var(--gap) 1rem;
}

/* ── Flash messages ─────────────────────────────────── */
.flash {
  padding: .65rem 1rem; border-radius: var(--radius);
  margin-bottom: 1.25rem; font-size: .9rem;
}
.flash-success { background: #edf7ee; color: #2a6130; border: 1px solid #b2d9b5; }
.flash-error   { background: #fdf2f2; color: #8b1a1a; border: 1px solid #f0b8b8; }

/* ── Home: map section ───────────────────────────────── */
.home-map-section {
  margin-bottom: 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.home-map-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; padding: 1rem 1.25rem; flex-wrap: wrap;
}
.home-map-title { font-family: var(--serif); font-size: 1.05rem; font-weight: 400; }
.map-desc { color: var(--ink-soft); font-style: italic; }
.map-history-link { font-size: .82rem; color: var(--ink-soft); display: block; margin-top: .2rem; }
.map-history-link:hover { color: var(--accent); }

#home-map { width: 100%; height: clamp(220px, 40vw, 360px); cursor: default; }

.add-location-inline {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--cream);
}
.map-hint { font-size: .82rem; color: var(--ink-soft); font-style: italic; margin-bottom: .75rem; }

/* ── Posts section ───────────────────────────────────── */
.posts-section { }
.posts-heading { font-family: var(--serif); font-size: 1.4rem; font-style: italic; margin-bottom: 1.25rem; }

/* ── Post grid ───────────────────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 1.25rem;
  align-items: stretch;
}
.post-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow .2s, transform .2s;
}
.post-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,.1); transform: translateY(-2px); }
.card-img-link { display: block; overflow: hidden; aspect-ratio: 16/9; }
.card-img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card-img-link:hover .card-img { transform: scale(1.04); }
.card-img-empty {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 16/9; background: var(--cream); font-size: 2rem; opacity: .4;
}
.card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }
.card-date { font-size: .75rem; color: var(--ink-soft); letter-spacing: .05em; text-transform: uppercase; }
.card-title { font-family: var(--serif); font-size: 1.05rem; margin: .35rem 0 .5rem; line-height: 1.3; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent); text-decoration: none; }
.card-excerpt { color: var(--ink-soft); font-size: .88rem; line-height: 1.6; flex: 1; }
.card-read-more { font-size: .83rem; color: var(--accent); }

/* ── Post full ───────────────────────────────────────── */
.post-full { max-width: 700px; margin: 0 auto; }
.back-link { font-size: .83rem; color: var(--ink-soft); display: inline-block; margin-bottom: .5rem; }
.back-link:hover { color: var(--accent); text-decoration: none; }
.post-header { margin-bottom: 2rem; }
.post-date { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); margin: .5rem 0 .3rem; }
.post-title { font-family: var(--serif); font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 700; font-style: italic; line-height: 1.25; }
.post-cover { width: 100%; border-radius: var(--radius); aspect-ratio: 16/9; object-fit: cover; margin-top: 1.25rem; }

/* ── Prose ───────────────────────────────────────────── */
.prose { font-size: 1rem; line-height: 1.85; }
.prose h2, .prose h3 { font-family: var(--serif); margin: 1.75rem 0 .65rem; }
.prose h2 { font-size: 1.4rem; }
.prose h3 { font-size: 1.15rem; }
.prose p  { margin-bottom: 1.2rem; }
.prose ul, .prose ol { margin: 0 0 1.2rem 1.4rem; }
.prose li { margin-bottom: .25rem; }
.prose blockquote { border-left: 3px solid var(--accent); margin: 1.5rem 0; padding: .4rem 1.25rem; color: var(--ink-soft); font-style: italic; }
.prose img { border-radius: var(--radius); margin: 1.5rem 0; }
.prose code { background: var(--cream); padding: .1em .3em; border-radius: 3px; font-size: .88em; }
.prose pre { background: var(--ink); color: #f0e8d8; padding: .9rem 1.1rem; border-radius: var(--radius); overflow-x: auto; margin-bottom: 1.2rem; }
.prose pre code { background: none; padding: 0; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* ── Gallery ─────────────────────────────────────────── */
.gallery { display: grid; gap: .5rem; margin: 1.75rem 0; border-radius: var(--radius); overflow: hidden; }
.gallery-1 { grid-template-columns: 1fr; }
.gallery-2 { grid-template-columns: 1fr 1fr; }
.gallery-3 { grid-template-columns: 1fr 1fr; }
.gallery-3 .gallery-item:first-child { grid-column: 1 / -1; }
.gallery-4 { grid-template-columns: 1fr 1fr; }
.gallery-many { grid-template-columns: repeat(3, 1fr); }
.gallery-many .gallery-item:first-child { grid-column: 1 / -1; }
.gallery-item { overflow: hidden; aspect-ratio: 4/3; cursor: pointer; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gallery-item:hover img { transform: scale(1.04); }

/* ── Lightbox ────────────────────────────────────────── */
.lightbox { display: none; position: fixed; inset: 0; z-index: 999; background: rgba(0,0,0,.92); align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; border-radius: var(--radius); object-fit: contain; }
.lightbox-close { position: absolute; top: .75rem; right: 1rem; color: #fff; font-size: 2rem; cursor: pointer; background: none; border: none; line-height: 1; padding: .25rem; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); color: #fff; font-size: 2rem; cursor: pointer; background: rgba(255,255,255,.12); border: none; padding: .4rem .7rem; border-radius: var(--radius); }
.lightbox-nav.prev { left: .5rem; }
.lightbox-nav.next { right: .5rem; }

/* ── Videos ──────────────────────────────────────────── */
.video-section { margin: 2rem 0; }
.media-heading { font-family: var(--serif); font-size: 1.2rem; margin-bottom: 1rem; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%,320px),1fr)); gap: 1rem; }
.video-wrap { border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 16/9; }
.video-wrap video { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ── Comments ────────────────────────────────────────── */
.comments-section { max-width: 700px; margin: 3rem auto 0; padding-top: 2rem; border-top: 1px solid var(--border); }
.comments-title { font-family: var(--serif); font-size: 1.3rem; margin-bottom: 1.25rem; }
.comment-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; }
.comment { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1.1rem; }
.comment-meta { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .35rem; flex-wrap: wrap; }
.comment-author { font-weight: 600; font-size: .88rem; }
.comment-time { font-size: .78rem; color: var(--ink-soft); }
.comment-body { font-size: .93rem; color: var(--ink-soft); white-space: pre-wrap; }
.comment-form h3 { font-family: var(--serif); font-size: 1.05rem; margin-bottom: .9rem; }

/* ── Locations page ──────────────────────────────────── */
.locations-page { }
.locations-title { font-family: var(--serif); font-size: 1.8rem; font-style: italic; margin-bottom: .35rem; }
.locations-intro { color: var(--ink-soft); margin-bottom: 1.25rem; font-style: italic; }
#history-map { width: 100%; height: clamp(260px,45vw,440px); border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 1.5rem; }

.current-badge { display: inline-block; background: var(--accent); color: #fff; border-radius: 99px; font-size: .7rem; padding: .1rem .5rem; margin-left: .35rem; vertical-align: middle; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 1.5rem; }
.locations-table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 400px; }
.locations-table th { text-align: left; padding: .45rem .65rem; border-bottom: 2px solid var(--border); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); font-weight: 400; }
.locations-table td { padding: .55rem .65rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.location-actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }

.add-location-box { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.add-location-box h2 { font-family: var(--serif); font-size: 1.15rem; margin-bottom: .5rem; }
#pick-map { width: 100%; height: clamp(200px,35vw,300px); border-radius: var(--radius); border: 1px solid var(--border); cursor: crosshair; margin-bottom: .9rem; }

/* ── Gate ────────────────────────────────────────────── */
.gate-body { background: var(--ink); min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem; }
.gate-card { background: var(--paper); border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.55); width: 100%; max-width: 700px; overflow: hidden; }
.gate-top { padding: 1.75rem 1.5rem 1.1rem; text-align: center; }
.gate-title { font-family: var(--serif); font-size: clamp(1.4rem,4vw,1.9rem); font-style: italic; margin-bottom: .3rem; }
.gate-hint { color: var(--ink-soft); font-style: italic; font-size: .93rem; }
.gate-error { background: #fdf2f2; color: #8b1a1a; border: 1px solid #f0b8b8; border-radius: 6px; padding: .55rem .9rem; font-size: .88rem; margin: .65rem 1.5rem 0; text-align: center; }
#gate-map { height: clamp(260px,45vw,380px); width: 100%; cursor: crosshair; }
.gate-bottom { padding: 1rem 1.5rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.gate-coords { font-size: .82rem; color: var(--ink-soft); font-family: monospace; }
#submit-btn { background: var(--accent); color: #fff; border: none; border-radius: 6px; padding: .55rem 1.3rem; font-family: var(--body); font-size: .93rem; cursor: pointer; opacity: .4; pointer-events: none; transition: background .15s; white-space: nowrap; }
#submit-btn.ready { opacity: 1; pointer-events: auto; }
#submit-btn.ready:hover { background: var(--accent-h); }

/* ── Admin login ─────────────────────────────────────── */
.login-card {
  background: var(--paper); border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
  width: 100%; max-width: 360px;
  padding: 2rem 1.75rem;
}
.login-back { font-size: .82rem; color: var(--ink-soft); display: inline-block; margin-bottom: 1.25rem; }
.login-back:hover { color: var(--accent); text-decoration: none; }
.login-icon { font-size: 1.75rem; text-align: center; margin-bottom: .5rem; }
.login-title { font-family: var(--serif); font-size: 1.5rem; font-style: italic; text-align: center; margin-bottom: .25rem; }
.login-sub { color: var(--ink-soft); font-style: italic; font-size: .9rem; text-align: center; margin-bottom: 1.5rem; }

/* ── Forms ───────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .9rem; }
.field label { font-size: .82rem; color: var(--ink-soft); }
.field input[type=text],
.field input[type=email],
.field input[type=password],
.field textarea {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: .55rem .8rem; font: inherit; font-size: .93rem; background: #fff;
  transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184,99,42,.12);
}
.field textarea { resize: vertical; }
.field-row { display: flex; gap: .75rem; flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 140px; }
.field-coord { min-width: 110px !important; }

/* ── Buttons ─────────────────────────────────────────── */
.btn { display: inline-block; padding: .5rem 1.1rem; border-radius: var(--radius); font: inherit; font-size: .9rem; cursor: pointer; border: 1px solid transparent; transition: background .15s; text-align: center; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); text-decoration: none; color: #fff; }
.btn-outline { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: #fff; text-decoration: none; }
.btn-danger  { background: #c0392b; color: #fff; border-color: #c0392b; }
.btn-danger:hover { background: #a93226; }
.btn-sm { padding: .28rem .6rem; font-size: .78rem; }
.btn-full { width: 100%; display: block; }
.btn-link { background: none; border: none; color: var(--ink-soft); font: inherit; font-size: .83rem; cursor: pointer; text-decoration: underline; padding: 0; }
.btn-link:hover { color: var(--ink); }

/* ── Utility ─────────────────────────────────────────── */
.text-muted { color: var(--ink-soft); }
.nowrap { white-space: nowrap; }
.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--ink-soft); font-style: italic; }
.empty-state code { font-style: normal; background: var(--cream); padding: .1em .35em; border-radius: 3px; }

/* ── Footer ──────────────────────────────────────────── */
.site-footer { text-align: center; padding: 1.25rem; font-size: .78rem; color: var(--ink-soft); border-top: 1px solid var(--border); }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 640px) {
  /* Mobile nav */
  .nav-toggle { display: block; }
  .nav-links {
    display: none; flex-direction: column; align-items: flex-start;
    position: absolute; top: 52px; left: 0; right: 0;
    background: var(--ink); padding: .75rem 1rem 1rem;
    gap: .75rem; border-top: 1px solid rgba(255,255,255,.1);
    z-index: 1; /* relative to .site-header's stacking context, always on top */
  }
  .nav-links.open { display: flex; }

  .post-grid { grid-template-columns: 1fr; gap: 1rem; }
  .gallery-many { grid-template-columns: 1fr 1fr; }
  .gallery-3 { grid-template-columns: 1fr 1fr; }
  .gallery-4 { grid-template-columns: 1fr 1fr; }

  .field-row { flex-direction: column; gap: 0; }
  .home-map-header { flex-direction: column; gap: .5rem; }

  .gate-bottom { flex-direction: column; align-items: stretch; }
  .gate-coords { text-align: center; }
  #submit-btn { width: 100%; }

  .lightbox-nav.prev { left: .25rem; }
  .lightbox-nav.next { right: .25rem; }

  .hide-xs { display: none; }
  .locations-table { font-size: .82rem; }
}

@media (max-width: 400px) {
  :root { --gap: .75rem; }
  .gallery-many, .gallery-3, .gallery-4 { grid-template-columns: 1fr; }
  .gallery .gallery-item:first-child { grid-column: auto; }
}

/* ── Map z-index fix ─────────────────────────────────── */
/* All map wrappers live at z-index:0 relative to the page, so
   Leaflet's internal layers (z ~400-600 inside the map) never
   compete with the sticky header (z-index:200 in its own context). */
.home-map-section { position: relative; z-index: 0; }
#home-map, #history-map, #pick-map, #gate-map { z-index: 0; }

/* ── Admin comment styles ────────────────────────────── */
.comment-admin {
  border-left: 3px solid var(--accent);
  background: #fffaf6;
}
.comment-admin .comment-author { color: var(--accent); }
.btn-delete-comment {
  background: none; border: none; color: #ccc;
  cursor: pointer; font-size: .85rem; padding: 0 .2rem;
  line-height: 1; margin-left: auto;
}
.btn-delete-comment:hover { color: #c0392b; }
.admin-post-actions {
  max-width: 700px; margin: 1.5rem auto 0;
  padding-top: 1rem; border-top: 1px solid var(--border);
  display: flex; gap: .75rem; flex-wrap: wrap;
}

/* ── Notification signup ─────────────────────────────── */
.notify-section { margin-top: 2.5rem; display: flex; justify-content: center; }
.notify-box {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.5rem;
  width: 100%; max-width: 480px; text-align: center;
}
.notify-box-inner {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: center;
}
.notify-icon { font-size: 1.2rem; flex-shrink: 0; }
.notify-label { font-size: .88rem; color: var(--ink-soft); white-space: nowrap; }
.notify-form { display: flex; gap: .4rem; flex-wrap: wrap; flex: 1; }
.notify-form .field { margin-bottom: 0; flex: 1; min-width: 110px; }
.notify-form .field input { padding: .4rem .65rem; font-size: .85rem; }

/* ── Subscribe pill + dropdown (post page) ──────────── */
.subscribe-pill-wrap {
  max-width: 700px; margin: 2rem auto 0;
  position: relative; display: flex; justify-content: center;
}
.subscribe-pill {
  display: inline-flex; align-items: center; gap: .4rem;
  background: #fff; border: 1px solid var(--border);
  border-radius: 99px; padding: .4rem 1rem;
  font: inherit; font-size: .85rem; color: var(--ink-soft);
  cursor: pointer; transition: border-color .15s, color .15s, box-shadow .15s;
}
.subscribe-pill:hover,
.subscribe-pill.active {
  border-color: var(--accent); color: var(--accent);
  box-shadow: 0 2px 8px rgba(184,99,42,.12);
}
.subscribe-dropdown {
  position: absolute; top: calc(100% + .5rem); left: 50%; transform: translateX(-50%);
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.25rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  min-width: 300px; z-index: 50;
}
.subscribe-dropdown-sub {
  font-size: .85rem; color: var(--ink-soft); margin-bottom: .85rem;
}
.subscribe-dropdown-form {
  display: flex; flex-direction: column; gap: .5rem;
}
.subscribe-dropdown-form input {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: .5rem .75rem; font: inherit; font-size: .88rem; background: #fff;
  transition: border-color .15s;
  width: 100%;
}
.subscribe-dropdown-form input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184,99,42,.1);
}

@media (max-width: 640px) {
  .subscribe-pill-wrap { position: static; }
  .subscribe-dropdown {
    position: fixed;
    bottom: 1rem; left: 1rem; right: 1rem;
    top: auto; width: auto; min-width: 0; transform: none;
    z-index: 300; /* above everything including the sticky header */
    box-shadow: 0 -4px 24px rgba(0,0,0,.15);
  }
}

/* ── Gallery captions ────────────────────────────────── */
.gallery-item { position: relative; overflow: hidden; }
figure.gallery-item { margin: 0; }
.gallery-caption {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.65));
  color: #fff; font-size: .78rem; padding: 1.5rem .6rem .45rem;
  opacity: 0; transition: opacity .2s;
  pointer-events: none;
}
.gallery-item:hover .gallery-caption { opacity: 1; }

/* Lightbox caption */
.lightbox-inner { display: flex; flex-direction: column; align-items: center; }
.lightbox-caption {
  color: rgba(255,255,255,.85); font-size: .85rem; font-style: italic;
  margin-top: .6rem; text-align: center; max-width: 600px;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
}

/* ── Card footer (read-more + reactions row) ─────────── */
.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; margin-top: .75rem; flex-wrap: wrap;
}
.card-reactions {
  display: flex; gap: .3rem; flex-wrap: wrap;
}
.card-reaction-pill {
  font-size: .72rem; background: var(--cream); border: 1px solid var(--border);
  border-radius: 99px; padding: .05rem .45rem; white-space: nowrap;
  color: var(--ink-soft); cursor: default; user-select: none;
}

/* ── Reactions bar (post page) ───────────────────────── */
.reactions-bar {
  display: flex; gap: .5rem; flex-wrap: wrap;
  max-width: 700px; margin: 1.75rem auto 0;
  padding-top: 1.25rem; border-top: 1px solid var(--border);
}
.reaction-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  background: #fff; border: 1px solid var(--border);
  border-radius: 99px; padding: .35rem .85rem;
  font: inherit; font-size: .95rem; cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
  color: var(--ink-soft);
}
.reaction-btn:hover {
  border-color: var(--accent); background: #fff8f4;
  transform: scale(1.07);
}
.reaction-btn--active {
  border-color: var(--accent); background: #fff0e6;
  color: var(--accent); font-weight: 600;
}
.reaction-btn--active:hover { background: #ffe4d0; }
.reaction-emoji { line-height: 1; font-size: 1.1rem; }
.reaction-count {
  font-size: .8rem; font-variant-numeric: tabular-nums;
  min-width: .75ch; /* prevent layout shift when count appears */
}

/* ── Post meta row (date + weather) ─────────────────── */
.post-meta-row {
  display: flex; align-items: center; gap: .75rem;
  margin: .5rem 0 .3rem;
}
.post-meta-row .post-date { margin: 0; display: inline; }

.post-weather {
  display: inline-flex; align-items: center; gap: .25rem;
  font-size: .78rem; color: var(--ink-soft);
  background: var(--cream); border: 1px solid var(--border);
  border-radius: 99px; padding: .1rem .55rem;
  line-height: 1.6; white-space: nowrap;
  cursor: default; user-select: none;
}
.weather-emoji { font-size: .95rem; line-height: 1; }
.weather-temp  { font-variant-numeric: tabular-nums; }

/* ── Card meta row (date + weather + draft) ──────────── */
.card-meta-row {
  display: flex; align-items: center; gap: .45rem;
  flex-wrap: wrap; margin-bottom: .15rem;
}
.card-meta-row .card-date { margin: 0; }
.card-weather {
  font-size: .72rem; color: var(--ink-soft);
  background: var(--cream); border: 1px solid var(--border);
  border-radius: 99px; padding: .05rem .45rem;
  white-space: nowrap; cursor: default; user-select: none;
}

/* ── Draft styles ────────────────────────────────────── */
.card-draft-badge {
  font-size: .68rem; font-weight: 600; letter-spacing: .04em;
  background: #fff8e6; color: #8a6300; border: 1px solid #f0d87a;
  border-radius: 99px; padding: .05rem .5rem; white-space: nowrap;
}
.post-card--draft { border-style: dashed; opacity: .85; }
.post-card--draft:hover { opacity: 1; }

.draft-banner {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  background: #fff8e6; color: #7a5700;
  border: 1px solid #f0d87a; border-radius: var(--radius);
  padding: .5rem .9rem; font-size: .85rem; margin-bottom: .75rem;
}
.draft-icon { font-size: 1rem; }
.draft-hint {
  font-size: .8rem; color: var(--ink-soft); font-style: italic;
}
.draft-hint code {
  background: var(--cream); padding: .1em .3em;
  border-radius: 3px; font-style: normal;
}

/* ── Media manager ───────────────────────────────────── */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: .75rem; margin-top: 1rem;
}
.media-thumb {
  position: relative; aspect-ratio: 1; border-radius: var(--radius);
  overflow: hidden; border: 1px solid var(--border);
  background: var(--cream);
}
.media-thumb img, .media-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-thumb-name {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,.6); color: #fff; font-size: .62rem;
  padding: .2rem .4rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.media-thumb-actions {
  position: absolute; top: .3rem; right: .3rem;
  display: none; gap: .25rem;
}
.media-thumb:hover .media-thumb-actions { display: flex; }

/* ── Post editor ─────────────────────────────────────── */
.editor-layout {
  display: grid; grid-template-columns: 1fr 230px;
  gap: 1.25rem; align-items: start;
}
.editor-main { min-width: 0; }
.editor-sidebar {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: .9rem;
  position: sticky; top: 64px;
}
.editor-sidebar-title {
  font-size: .75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-soft); margin-bottom: .75rem;
}
.sidebar-photo-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .3rem;
  max-height: 360px; overflow-y: auto; margin-bottom: .6rem;
}
.sidebar-photo {
  aspect-ratio: 1; border-radius: 4px; overflow: hidden;
  border: 2px solid transparent; cursor: pointer; transition: border-color .15s;
}
.sidebar-photo:hover, .sidebar-photo.selected { border-color: var(--accent); }
.sidebar-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sidebar-upload-area {
  display: block; border: 2px dashed var(--border); border-radius: var(--radius);
  padding: .6rem; text-align: center; font-size: .78rem;
  color: var(--ink-soft); cursor: pointer; margin-bottom: .6rem;
  transition: border-color .15s, background .15s;
}
.sidebar-upload-area:hover,
.sidebar-upload-area.drag-over { border-color: var(--accent); background: #fffaf6; color: var(--accent); }

.drop-overlay {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(184,99,42,.12); border: 3px dashed var(--accent);
  align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 1.4rem; font-style: italic;
  color: var(--accent); pointer-events: none;
}
.drop-overlay.active { display: flex; }

@media (max-width: 700px) {
  .editor-layout { grid-template-columns: 1fr; }
  .editor-sidebar { position: static; }
  .sidebar-photo-grid { max-height: 200px; }
}

/* ── Fotos visual editor ─────────────────────────────── */
.fotos-editor {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: #fff; min-height: 58px;
  padding: .3rem;
}
.fotos-empty {
  display: flex; align-items: center; justify-content: center;
  min-height: 48px; color: var(--ink-soft); font-size: .82rem; font-style: italic;
}
.fotos-item {
  display: flex; align-items: center; gap: .45rem;
  padding: .3rem .3rem; border-radius: 4px;
  border: 1px solid transparent; background: transparent;
  transition: background .1s;
}
.fotos-item:hover { background: var(--cream); }
.fotos-item.dragging { opacity: .35; }
.fotos-item.drop-above { border-top: 2px solid var(--accent); }
.fotos-item.drop-below { border-bottom: 2px solid var(--accent); }
.fotos-handle {
  cursor: grab; color: #ccc; font-size: .9rem; flex-shrink: 0;
  user-select: none; line-height: 1; padding: 0 .1rem;
}
.fotos-handle:active { cursor: grabbing; }
.fotos-thumb {
  width: 44px; height: 44px; border-radius: 4px;
  object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--border); background: var(--cream); display: block;
}
.fotos-thumb-placeholder {
  width: 44px; height: 44px; border-radius: 4px; flex-shrink: 0;
  background: var(--cream); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.fotos-caption {
  flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: var(--radius);
  padding: .28rem .55rem; font: inherit; font-size: .83rem; background: #fff;
}
.fotos-caption:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(184,99,42,.1); }
.fotos-caption::placeholder { color: #bbb; font-style: italic; }
.fotos-remove {
  background: none; border: none; color: #ccc; cursor: pointer;
  font-size: 1rem; padding: .1rem .2rem; line-height: 1; flex-shrink: 0;
}
.fotos-remove:hover { color: #c0392b; }

/* ── Floating heart animation ────────────────────────── */
@keyframes float-heart {
  0%   { transform: translateY(0)   scale(1);   opacity: 1; }
  60%  { transform: translateY(-52px) scale(1.4); opacity: 1; }
  100% { transform: translateY(-80px) scale(0.8); opacity: 0; }
}
.float-heart {
  position: absolute;
  font-size: 1.4rem;
  line-height: 1;
  pointer-events: none;
  z-index: 9998;
  animation: float-heart 0.7s ease-out forwards;
  /* centre on the spawn point */
  transform-origin: center bottom;
  margin-left: -0.7rem;
  margin-top:  -0.7rem;
}
