/* Jeff's poetry site: a koi pond with frosted panels floating on it. */

:root {
  --ink: #12303b;
  --ink-soft: #4b6a73;
  --paper: rgba(247, 251, 249, 0.88);
  --paper-solid: #f7fbf9;
  --edge: rgba(255, 255, 255, 0.6);
  --koi: #e4692c;
  --koi-deep: #c4561f;
  --lily: #2f7d5b;
  --danger: #b33a2b;
  --radius: 18px;
  --shadow: 0 10px 40px rgba(3, 30, 40, 0.28), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
  --serif: "EB Garamond", Georgia, serif;
  --display: "Cormorant Garamond", Georgia, serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { background: #0c3d55; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  background: linear-gradient(160deg, #2a8c96, #17677a 45%, #0c3d55);
  display: flex;
  flex-direction: column;
}

#pool {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

a { color: var(--koi-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--koi); }

/* ---------- Top bar ---------- */
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1040px;
  width: 100%;
  margin: 18px auto 0;
  padding: 10px 16px 10px 22px;
  background: rgba(247, 251, 249, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--edge);
  border-radius: 999px;
  box-shadow: 0 6px 24px rgba(3, 30, 40, 0.2);
}
.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.55rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}
.nav a:hover, .nav a.is-here { background: rgba(18, 48, 59, 0.08); }
.nav a.nav-cta { background: var(--koi); color: #fff; }
.nav a.nav-cta:hover { background: var(--koi-deep); }

/* ---------- Layout ---------- */
.page {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 16px 40px;
}
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  color: rgba(235, 250, 245, 0.85);
  font-size: 0.9rem;
  padding: 0 16px 28px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.footer a { color: inherit; }
.footer a.quiet { opacity: 0.6; }

.panel {
  background: var(--paper);
  backdrop-filter: blur(8px) saturate(1.1);
  -webkit-backdrop-filter: blur(8px) saturate(1.1);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px;
  margin-bottom: 22px;
}
.panel--center { text-align: center; }
.narrow { max-width: 440px; margin-left: auto; margin-right: auto; }

/* ---------- Homepage ---------- */
.hero { text-align: center; padding: 34px 0 26px; color: #f4fbf7; text-shadow: 0 2px 14px rgba(0, 30, 40, 0.45); }
.hero-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 1.05;
  margin: 0;
}
.hero-sub { font-family: var(--display); font-style: italic; font-size: 1.35rem; margin: 6px 0 0; opacity: 0.92; }

.feed { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; align-items: start; }
.feed .panel { margin: 0; }
.card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.card-cover { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #cfe3df; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s ease; }
.card:hover .card-cover img { transform: scale(1.04); }
.card-text { padding: 22px 26px 24px; display: flex; flex-direction: column; flex: 1; }
.card-title { font-family: var(--display); font-weight: 600; font-size: 1.75rem; line-height: 1.15; margin: 0 0 4px; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--koi-deep); }
.read-more { margin-top: auto; padding-top: 12px; font-weight: 500; text-decoration: none; }

.meta { color: var(--ink-soft); font-size: 0.9rem; margin: 0; }
.muted { color: var(--ink-soft); }
.small { font-size: 0.86rem; }
.lead { font-size: 1.15rem; }

/* ---------- Poems ---------- */
.poem {
  font-family: var(--serif);
  font-size: 1.22rem;
  line-height: 1.75;
  white-space: pre-wrap;        /* keeps every line break and indent */
  overflow-wrap: anywhere;
  margin: 18px 0;
}
.poem--excerpt { font-size: 1.08rem; line-height: 1.65; margin: 12px 0 0; color: #23434d; }

.post { max-width: 760px; margin-left: auto; margin-right: auto; padding: 40px 52px; }
.post-head { margin-bottom: 8px; }
.post-title { font-family: var(--display); font-weight: 600; font-size: clamp(2rem, 5vw, 2.9rem); line-height: 1.1; margin: 0 0 6px; }
.badge {
  display: inline-block;
  background: rgba(228, 105, 44, 0.14);
  color: var(--koi-deep);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0 0 10px;
}
.gallery { display: grid; gap: 10px; margin: 22px 0; }
.gallery--2 { grid-template-columns: 1fr 1fr; }
.gallery--3 { grid-template-columns: repeat(3, 1fr); }
.gallery-item { display: block; border-radius: 12px; overflow: hidden; background: #d6e8e3; }
.gallery-item img { width: 100%; height: 100%; display: block; object-fit: cover; }
.gallery--1 .gallery-item img { height: auto; max-height: 80vh; object-fit: contain; }

.neighbours {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  max-width: 760px;
  margin: 0 auto 22px;
}
.neighbour { display: flex; flex-direction: column; gap: 2px; padding: 16px 22px; margin: 0; text-decoration: none; color: var(--ink); font-family: var(--display); font-size: 1.3rem; font-weight: 600; }
.neighbour .muted { font-family: var(--sans); font-size: 0.85rem; font-weight: 500; }
.neighbour--next { text-align: right; grid-column: 2; }

/* ---------- Comments ---------- */
.comments { max-width: 760px; margin-left: auto; margin-right: auto; }
.section-title { font-family: var(--display); font-weight: 600; font-size: 1.7rem; margin: 0 0 12px; }
.sub-title { font-family: var(--display); font-size: 1.3rem; margin: 20px 0 6px; }
.comment-list { list-style: none; padding: 0; margin: 0 0 10px; }
.comment { padding: 16px 0; border-top: 1px solid rgba(18, 48, 59, 0.1); }
.comment:first-child { border-top: 0; }
.comment-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.comment-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f4a259, var(--koi));
  color: #fff; font-weight: 600;
}
.comment-name { font-weight: 600; color: var(--ink); margin-right: 8px; }
.comment-body { white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--serif); font-size: 1.08rem; }

.comment-form { border-top: 1px solid rgba(18, 48, 59, 0.12); padding-top: 18px; margin-top: 8px; }
.form-title { font-family: var(--display); font-size: 1.45rem; margin: 0 0 12px; }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 14px; border: 0; padding: 0; }
.field > span, .field > legend { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(18, 48, 59, 0.2);
  border-radius: 10px;
  padding: 10px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus { outline: none; border-color: var(--koi); box-shadow: 0 0 0 3px rgba(228, 105, 44, 0.18); }
textarea { resize: vertical; }
.input-title { font-family: var(--display); font-size: 1.6rem !important; font-weight: 600; }
.poem-input { font-family: var(--serif); font-size: 1.15rem !important; line-height: 1.7; tab-size: 4; }
.honey { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.check { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--koi); }
.check--small { font-size: 0.86rem; }
.radio-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 0.92rem; }
.radio-row > span { font-weight: 600; }
.checks { padding-top: 22px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
code { background: rgba(18, 48, 59, 0.08); padding: 1px 5px; border-radius: 5px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 600;
  color: #fff;
  background: var(--koi);
  border: 0;
  border-radius: 999px;
  padding: 10px 22px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.btn:hover { background: var(--koi-deep); color: #fff; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px rgba(18, 48, 59, 0.25); }
.btn--ghost:hover { background: rgba(18, 48, 59, 0.06); color: var(--ink); }
.btn--danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px rgba(179, 58, 43, 0.4); }
.btn--danger:hover { background: var(--danger); color: #fff; }
.btn--small { padding: 5px 14px; font-size: 0.88rem; }
.btn--wide { width: 100%; }
.linklike { background: none; border: 0; padding: 6px 12px; font: inherit; color: var(--ink-soft); cursor: pointer; }
.linklike:hover { color: var(--koi-deep); }

.flash {
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.92);
  border-left: 4px solid var(--lily);
  box-shadow: 0 6px 20px rgba(3, 30, 40, 0.18);
  transition: opacity 0.6s, transform 0.6s;
}
.flash--warning { border-left-color: var(--koi); }
.flash--info { border-left-color: #3f8fb0; }
.flash--fade { opacity: 0; transform: translateY(-6px); pointer-events: none; }
.page > .flash { max-width: 760px; margin-left: auto; margin-right: auto; }

.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 26px; color: #eef8f4; }
.pager .muted { color: #e2f2ec; }
.pager .btn--ghost { color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6); }
.pager .btn--ghost:hover { background: rgba(255, 255, 255, 0.15); }

.year { font-family: var(--display); font-size: 1.6rem; margin: 26px 0 6px; color: var(--koi-deep); }
.archive-list { list-style: none; padding: 0; margin: 0; }
.archive-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed rgba(18, 48, 59, 0.12); }
.archive-list a { font-family: var(--serif); font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.archive-list a:hover { color: var(--koi-deep); }

.hero--small { padding: 22px 0 22px; }
.hero--small .hero-title { font-size: clamp(2.2rem, 6vw, 3.6rem); }
.hero-kicker { margin: 0; font-size: 0.85rem; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.85; }
.hero a { color: inherit; }
.meta a.cat { color: var(--koi-deep); text-decoration: none; }
.meta a.cat:hover { text-decoration: underline; }
.poem a { color: var(--koi-deep); }
.cat-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 6px; }
.cat-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(228, 105, 44, 0.1); color: var(--ink); text-decoration: none; font-weight: 500;
}
.cat-chip span { color: var(--ink-soft); font-size: 0.82rem; }
.cat-chip:hover { background: rgba(228, 105, 44, 0.2); color: var(--ink); }
.cat-picks { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 8px; }

.prose { max-width: 760px; margin-left: auto; margin-right: auto; }
.prose h2 { font-family: var(--display); font-size: 1.45rem; margin: 22px 0 4px; }

/* ---------- Admin ---------- */
.admin-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; padding: 8px 12px; border-radius: 999px; }
.admin-nav a { padding: 6px 14px; border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 500; }
.admin-nav a.is-here, .admin-nav a:hover { background: rgba(18, 48, 59, 0.08); }
.admin-nav-logout { margin-left: auto; }

.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.admin-grid .panel { margin: 0 0 22px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.section-head .section-title, .section-head .post-title { margin: 0; }

.admin-strip { display: flex; gap: 10px; align-items: center; margin-top: 18px; padding-top: 14px; border-top: 1px dashed rgba(18, 48, 59, 0.15); }
.admin-strip form { margin: 0; }
.admin-strip--comment { margin-top: 8px; padding-top: 8px; justify-content: space-between; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-row .panel { margin: 0; }
.stat { display: flex; flex-direction: column; padding: 18px 22px; text-decoration: none; color: var(--ink); }
.stat-num { font-family: var(--display); font-weight: 700; font-size: 2.3rem; line-height: 1; }
.stat-label { color: var(--ink-soft); font-size: 0.9rem; margin-top: 4px; }
.stat-row--inline { margin: 16px 0 6px; }
.stat-row--inline .stat { padding: 0; }

.table { width: 100%; border-collapse: collapse; }
.table td, .table th { padding: 9px 6px; border-bottom: 1px solid rgba(18, 48, 59, 0.08); vertical-align: top; text-align: left; }
.table th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); font-weight: 600; }
.table--compact td, .table--compact th { padding: 6px 4px; font-size: 0.93rem; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions form { display: inline; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

.mini-comment { padding: 10px 0; border-bottom: 1px solid rgba(18, 48, 59, 0.08); }
.mini-comment p { margin: 4px 0 0; }
.admin-comment { padding: 16px 0; border-top: 1px solid rgba(18, 48, 59, 0.1); }
.admin-comment-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.admin-comment-head form { margin: 0; }

.editor { max-width: 860px; margin-left: auto; margin-right: auto; }
.image-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 12px; }
.image-item { display: flex; flex-direction: column; gap: 6px; }
.image-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: #d6e8e3; }
.image-item input { padding: 6px 8px !important; font-size: 0.86rem !important; }
.image-list--preview:empty { display: none; }

.range { display: flex; gap: 2px; background: rgba(18, 48, 59, 0.06); border-radius: 999px; padding: 3px; }
.range a { padding: 4px 12px; border-radius: 999px; color: var(--ink); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.range a.is-here { background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }

.chart { margin: 12px 0 0; }
.chart svg { width: 100%; height: auto; display: block; }
.chart-bar { fill: rgba(228, 105, 44, 0.75); }
.chart-bar:hover { fill: var(--koi-deep); }
.chart-line { fill: none; stroke: #17677a; stroke-width: 2; stroke-linejoin: round; }
.chart-axis { stroke: rgba(18, 48, 59, 0.25); }
.chart-label { font-size: 11px; fill: var(--ink-soft); font-family: var(--sans); }
.chart-key { font-size: 0.86rem; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
.key { display: inline-block; width: 14px; height: 10px; border-radius: 2px; }
.key--bar { background: rgba(228, 105, 44, 0.75); }
.key--line { height: 2px; background: #17677a; margin-left: 10px; }

.map { height: 380px; border-radius: 14px; overflow: hidden; position: relative; z-index: 0; background: #cfe3df; }
.map-empty {
  position: absolute; inset: auto 12px 12px auto; z-index: 500;
  background: rgba(255, 255, 255, 0.9); padding: 6px 12px; border-radius: 8px; font-size: 0.9rem;
}

.meter-row { display: grid; grid-template-columns: 140px 1fr auto; gap: 10px; align-items: center; padding: 4px 0; font-size: 0.93rem; }
.meter-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter { height: 8px; background: rgba(18, 48, 59, 0.08); border-radius: 999px; overflow: hidden; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, #f4a259, var(--koi)); border-radius: 999px; }
.meter-num { font-variant-numeric: tabular-nums; }

/* ---------- Small screens ---------- */
@media (max-width: 720px) {
  .topbar { margin: 10px 10px 0; width: auto; border-radius: 22px; flex-direction: column; gap: 6px; padding: 10px 14px; }
  .panel { padding: 22px 20px; }
  .post { padding: 28px 22px; }
  .poem { font-size: 1.12rem; }
  .field-row, .admin-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .gallery--3 { grid-template-columns: 1fr 1fr; }
  .neighbours { grid-template-columns: 1fr; }
  .neighbour--next { grid-column: auto; }
  .checks { padding-top: 0; }
  .admin-nav { border-radius: 18px; }
  .meter-row { grid-template-columns: 100px 1fr auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
