/* ===========================================================================
   Cold Rain Pond — a quarterly.
   Understated, typographic, print-minded. No boxes, no shadows: type, space,
   hairline rules, one quiet lake-blue accent. EB Garamond on warm paper.
   Inspired by The Paris Review's editorial gravity and Derek Sivers' restraint.
   ======================================================================== */

:root {
  --paper:      #d3d9d8;   /* the sheet — brighter */
  --paper-in:   #c8cfce;   /* recessed (top bar, form fields) */
  --surround:   #232c33;   /* the side bars — same hue, ~70% darker */
  --rule-hard:  rgba(20, 27, 33, 0.32);

  /* 2008 web-app chrome (Submission Grinder-style modules) */
  --panel-bg:     #e7ebea;   /* content box, lighter than the sheet */
  --panel-border: #8a99aa;   /* solid module border */
  --bar-top:      #4f74a6;   /* gradient bar — light stop */
  --bar-bot:      #345680;   /* gradient bar — dark stop */
  --th-bg:        #cfd6da;   /* shaded table header row */
  --row-alt:      rgba(20, 27, 33, 0.045);   /* zebra */
  --row-hover:    rgba(63, 103, 156, 0.12);  /* table row hover */

  --ink:        #141b21;   /* deep blue-charcoal, near-black */
  --ink-soft:   #4e5960;   /* muted labels, deks, bylines */
  --lake:       #3f679c;   /* the one accent — denim indigo */
  --lake-deep:  #2e4e79;   /* hover */

  --rule:       rgba(20,27,33,0.17);
  --rule-faint: rgba(20,27,33,0.09);

  /* every text role is Open Sans now */
  --serif: "Open Sans", -apple-system, system-ui, "Segoe UI", Helvetica, Arial,
           sans-serif;
  --sans:  "Open Sans", -apple-system, system-ui, "Segoe UI", Helvetica, Arial,
           sans-serif;

  --measure: 66rem;   /* contents / general column — a little wider */
  --read:    47rem;   /* prose reading column */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--surround);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.6;
  font-feature-settings: "onum" 1, "liga" 1;   /* oldstyle numerals + ligatures */
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* paper grain — a little heavier now, so the page reads as stock, not screen */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  opacity: 0.7; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
}

/* the sheet: a content column laid on the darker surround.
   A soft edge-darkening keeps it from looking laser-flat. */
.sheet {
  max-width: 74rem;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: inset 0 0 5rem rgba(20, 27, 33, 0.09);
}

a { color: var(--lake); text-decoration: none; }
a:hover { color: var(--lake-deep); text-decoration: underline; text-underline-offset: 0.14em;
          text-decoration-thickness: 0.5px; }

/* --- small utility labels (monospace, letterspaced caps) ---------------- */
.subtitle, .nav, .issue-line, .filters, .dept-name, .eyebrow,
.reading-date, .colophon, .field > span, .kicker, .release-season,
.feed-title, .see-all, .item-date, .work-date {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ===========================================================================
   Top bar — a skinny header strip (wordmark left, nav right)
   ======================================================================== */
.topbar {
  background: linear-gradient(to bottom, var(--bar-top) 0%, var(--bar-bot) 100%);
  border-bottom: 1px solid var(--bar-bot);
}
.topbar-inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0.5rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.28);
}
.brand:hover { color: #fff; text-decoration: none; }
.nav { font-size: 0.72rem; letter-spacing: 0.05em; white-space: nowrap; }
.nav a,
.nav a:hover,
.nav a:active,
.nav a:focus { text-decoration: none; }
.nav a { color: rgba(255, 255, 255, 0.82); }
.nav a + a::before {
  content: "|";
  margin: 0 0.5rem;
  color: rgba(255, 255, 255, 0.4);
}
.nav a:hover { color: #fff; }
.nav a.here { color: #fff; font-weight: 700; }
.subtitle {
  margin: 0.9rem 0 0;
  font-size: 0.68rem;
  color: var(--ink-soft);
}

/* ===========================================================================
   Page shell
   ======================================================================== */
.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.4rem 1.1rem 3rem;
}

.issue-line {
  text-align: center;
  font-size: 0.72rem;
  color: var(--ink-soft);
}
.issue-line .sep { margin: 0 0.5rem; opacity: 0.6; }

.epigraph {
  max-width: 30rem;
  margin: 1.6rem auto 0;
  text-align: center;
  font-style: italic;
  font-size: 1.28rem;
  color: var(--ink-soft);
}

.quiet-note {
  max-width: 32rem;
  margin: 3rem auto;
  text-align: center;
  font-style: italic;
  color: var(--ink-soft);
}

/* ===========================================================================
   Modules (panels) — a titled box with a gradient header bar, 2008-web-app style
   ======================================================================== */
.panel {
  margin: 0 0 1.3rem;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 3px;
  overflow: hidden;
}
.panel-head {
  padding: 0.42rem 0.85rem;
  background: linear-gradient(to bottom, var(--bar-top) 0%, var(--bar-bot) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.28);
  border-bottom: 1px solid var(--panel-border);
}
.panel-body { padding: 1.05rem 1.1rem; }

/* --- data table (the collection) --------------------------------------- */
.grid-table { width: 100%; border-collapse: collapse; font-size: 0.98rem; }
.grid-table th {
  text-align: left;
  padding: 0.4rem 0.85rem;
  background: var(--th-bg);
  color: var(--ink);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--panel-border);
}
.grid-table td {
  padding: 0.42rem 0.85rem;
  border-bottom: 1px solid rgba(20, 27, 33, 0.12);
}
.grid-table tbody tr:nth-child(even) { background: var(--row-alt); }
.grid-table tbody tr:hover { background: var(--row-hover); }
.grid-table tbody tr:last-child td { border-bottom: none; }
.grid-table a { color: var(--lake); text-decoration: underline; text-underline-offset: 0.12em; }
.grid-table a:hover { color: var(--lake-deep); }
.grid-table .num {
  text-align: right;
  white-space: nowrap;
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.grid-table th.num { color: var(--ink); }

/* content-page bits that live inside panels */
.byline { margin: 0 0 1.3rem; font-size: 0.92rem; color: var(--ink-soft); }
/* back link lives in the margin between the top bar and the article box */
.backlink {
  display: inline-block;
  margin: 0 0 0.7rem;
  font-size: 0.86rem;
  color: var(--lake);
  text-decoration: underline;
  text-underline-offset: 0.14em;
}
.backlink:hover { color: var(--lake-deep); }

/* ===========================================================================
   Plain text pages (About) — just a heading and paragraphs, nothing fancy
   ======================================================================== */
.text { max-width: 42rem; }
.text h1 {
  font-weight: 700;
  font-size: 1.4rem;
  margin: 0 0 1rem;
  color: var(--ink);
}
.text p { font-size: 1.1rem; line-height: 1.65; margin: 0 0 1.1rem; }
.text a {
  text-decoration: underline;
  text-underline-offset: 0.14em;
  text-decoration-thickness: 0.5px;
}

/* ===========================================================================
   Reading view (a single piece) + prose pages
   ======================================================================== */
.reading { max-width: var(--read); margin: 0 auto; }

.reading-head {
  text-align: center;
  padding-bottom: 1.8rem;
  margin-bottom: 2.2rem;
  border-bottom: 1px solid var(--rule);
}
.eyebrow {
  margin: 0 0 0.9rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--lake);
}
.reading-title {
  margin: 0;
  font-weight: 500;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.14;
  color: var(--ink);
}
.reading-byline {
  margin: 0.9rem 0 0;
  font-style: italic;
  font-size: 1.18rem;
  color: var(--ink-soft);
}
.reading-date {
  margin: 0.7rem 0 0;
  font-size: 0.66rem;
  color: var(--ink-soft);
}

.embed {
  margin: 2.2rem 0;
  aspect-ratio: 16 / 9;
  background: var(--paper-in);
  border: 1px solid var(--rule);
}
.embed iframe, .embed video { width: 100%; height: 100%; border: 0; display: block; }

/* flat reading: one size, Open Sans, no special formatting */
.prose { max-width: 42rem; font-size: 1.08rem; line-height: 1.65; color: var(--ink); }
.prose p { margin: 0 0 1.1rem; }
/* headings, quotes, rules all render as ordinary flat text */
.prose h1, .prose h2, .prose h3, .prose h4 {
  font-size: 1.08rem; font-weight: 700; margin: 1.1rem 0; color: var(--ink);
}
.prose blockquote {
  margin: 0 0 1.1rem; padding: 0; border: 0; font-style: normal; color: var(--ink);
}
.prose a { text-decoration: underline; text-underline-offset: 0.14em; text-decoration-thickness: 0.5px; }
.prose img { max-width: 100%; height: auto; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 1.3rem 0; }

/* verse: keep the poet's line breaks (rendered with <br>), still one flat size */
.prose.verse { line-height: 1.5; }

.reading-foot {
  margin-top: 3.2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule-faint);
  text-align: center;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.reading-foot a { color: var(--ink-soft); }
.reading-foot a:hover { color: var(--ink); text-decoration: none; }

/* ===========================================================================
   Submission form — clean underline fields, one quiet button
   ======================================================================== */
.submit-form { margin-top: 1.4rem; }

/* format selector (Paste text / File / Link) */
.formats {
  margin: 0 0 1.4rem;
  padding: 0.7rem 0.9rem 0.8rem;
  border: 1px solid var(--panel-border);
  border-radius: 2px;
  background: rgba(20, 27, 33, 0.02);
}
.formats legend {
  padding: 0 0.35rem;
  font-family: var(--sans);
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}
.radio {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.2rem 1.4rem 0.2rem 0;
  font-size: 1rem;
  cursor: pointer;
}
.radio input { margin: 0; }

/* "Jump to Submission" link above the guidelines */
.jumplink { margin: 0 0 0.9rem; }
.field-row { display: flex; gap: 1.6rem; }
.field-row .field { flex: 1; }
.field { display: block; margin-bottom: 1.5rem; }
.field > span {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.field > span em {
  text-transform: none; letter-spacing: 0; font-style: italic;
  font-weight: 400; color: var(--lake);
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.42rem 0.55rem;
  font-family: var(--sans);
  font-size: 0.98rem;
  color: var(--ink);
  background: #f1f4f3;
  border: 1px solid var(--panel-border);
  border-radius: 2px;
  box-shadow: inset 0 1px 2px rgba(20, 27, 33, 0.10);
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--lake);
  box-shadow: inset 0 1px 2px rgba(20, 27, 33, 0.10), 0 0 0 2px rgba(63, 103, 156, 0.18);
}

.button {
  margin-top: 0.6rem;
  padding: 0.5rem 1.6rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.28);
  background: linear-gradient(to bottom, var(--bar-top) 0%, var(--bar-bot) 100%);
  border: 1px solid var(--bar-bot);
  border-radius: 3px;
  cursor: pointer;
}
.button:hover { background: linear-gradient(to bottom, #5c81b2 0%, #3c6089 100%); }
.button:active { background: linear-gradient(to bottom, var(--bar-bot) 0%, var(--bar-top) 100%); }

.form-error {
  margin: 1.4rem 0;
  padding-left: 1rem;
  border-left: 2px solid #9a5b4f;
  font-style: italic;
  color: #7c4438;
}

/* ===========================================================================
   Admin / developer mode
   ======================================================================== */
.author-cell { color: var(--ink); }
.admin-link { font-weight: 700; }

.devlogin {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20, 27, 33, 0.5);
}
.devlogin[hidden] { display: none; }
.devlogin-box {
  width: 20rem; max-width: calc(100vw - 2rem);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 3px;
  padding: 1.1rem 1.2rem 1.2rem;
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.4);
}
.devlogin-title { font-weight: 700; margin-bottom: 0.4rem; color: var(--ink); }
.devlogin-hint { font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 0.7rem; }
.devlogin input {
  width: 100%; padding: 0.45rem 0.55rem;
  border: 1px solid var(--panel-border); border-radius: 2px;
  background: #f1f4f3; font-family: var(--sans); font-size: 0.98rem;
  box-shadow: inset 0 1px 2px rgba(20, 27, 33, 0.10);
}
.devlogin input:focus { outline: none; border-color: var(--lake); }
.devlogin-actions { display: flex; align-items: center; gap: 1.2rem; margin-top: 0.9rem; }
.devlogin .button { margin-top: 0; }

.admin-note {
  display: flex; align-items: center; gap: 0.9rem;
  margin: 0 0 1.1rem; color: var(--ink-soft);
}
.admin-note > span {
  font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; font-size: 0.68rem;
}
.inline-form { display: inline; }
.linkbtn {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--sans); font-size: 0.85rem;
  color: var(--lake); text-decoration: underline;
}
.linkbtn:hover { color: var(--lake-deep); }
.linkbtn.danger { color: #a2453a; }
.admin-actions { display: flex; align-items: center; gap: 1.1rem; margin-top: 0.2rem; flex-wrap: wrap; }
.admin-actions .slug {
  font-family: var(--sans); font-size: 0.78rem; color: var(--ink-soft);
}
.view-link { font-family: var(--sans); font-size: 0.8rem; }

/* sleek filterable works index (accordion rows) */
.work-filter {
  width: 100%; margin-bottom: 0.7rem;
  padding: 0.42rem 0.55rem;
  border: 1px solid var(--panel-border); border-radius: 2px;
  background: #f1f4f3; font-family: var(--sans); font-size: 0.9rem;
  box-shadow: inset 0 1px 2px rgba(20, 27, 33, 0.10);
}
.work-filter:focus { outline: none; border-color: var(--lake); }
.wr-head, .work-row > summary {
  display: grid;
  grid-template-columns: 1fr 1fr 6rem;
  gap: 1rem;
  align-items: baseline;
}
.wr-head {
  padding: 0.35rem 0.6rem;
  font-family: var(--sans); font-size: 0.6rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-soft);
  border-bottom: 1px solid var(--panel-border);
}
.work-row { border-bottom: 1px solid rgba(20, 27, 33, 0.12); }
.work-row.hide { display: none; }
.work-row > summary {
  padding: 0.42rem 0.6rem;
  cursor: pointer;
  list-style: none;
  font-size: 0.95rem;
}
.work-row > summary::-webkit-details-marker { display: none; }
.work-row > summary:hover { background: var(--row-hover); }
.work-row[open] > summary { background: var(--row-alt); }
.wr-title { color: var(--lake); }
.work-row[open] .wr-title { font-weight: 700; color: var(--ink); }
.wr-author { color: var(--ink-soft); }
.wr-date {
  color: var(--ink-soft); font-family: var(--sans);
  font-size: 0.8rem; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.work-edit {
  padding: 1rem 0.6rem 1.3rem;
  border-top: 1px dashed var(--panel-border);
  background: rgba(20, 27, 33, 0.015);
}
.delete-form { margin-top: 0.9rem; }

/* rich-text editor (B / I / U) */
.rte {
  border: 1px solid var(--panel-border);
  border-radius: 2px;
  background: #fff;
}
.rte-toolbar {
  display: flex;
  gap: 0.25rem;
  padding: 0.3rem 0.4rem;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(20, 27, 33, 0.05);
}
.rte-toolbar button {
  min-width: 1.9rem; height: 1.7rem;
  padding: 0 0.45rem;
  border: 1px solid var(--panel-border); border-radius: 2px;
  background: #fff; color: var(--ink);
  cursor: pointer; font-size: 0.85rem; line-height: 1;
}
.rte-toolbar button.rte-text { font-family: var(--sans); font-size: 0.72rem; }
.rte-toolbar button:hover { background: var(--row-hover); }
.rte-sep { width: 1px; align-self: stretch; margin: 0.1rem 0.2rem; background: var(--panel-border); }
.rte-area a { color: var(--lake); text-decoration: underline; }
.rte-area {
  min-height: 8rem;
  padding: 0.6rem 0.7rem;
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  outline: none;
}
.rte-area:focus { box-shadow: inset 0 0 0 2px rgba(63, 103, 156, 0.18); }
.rte-area p { margin: 0 0 0.8rem; }

/* submissions inbox */
.sub-head { grid-template-columns: 1fr 7rem 5rem; }
.sub-row > summary { grid-template-columns: 1fr 7rem 5rem; }
.sub-from { color: var(--ink-soft); font-weight: 400; }
.sub-meta { font-size: 0.85rem; color: var(--ink-soft); margin: 0 0 0.6rem; }
.sub-meta strong { color: var(--ink); }
.sub-message { font-size: 0.95rem; margin: 0 0 1rem; }
.sub-status {
  font-family: var(--sans); font-size: 0.62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  align-self: center; text-align: right;
}
.status-new { color: var(--lake-deep); }
.status-approved { color: #3f7a4a; }
.btn-approve { background: linear-gradient(to bottom, #4f8a5e 0%, #356043 100%); border-color: #356043; }
.btn-approve:hover { background: linear-gradient(to bottom, #59986a 0%, #2f5a3c 100%); }

/* types management */
.types-hint { font-size: 0.88rem; color: var(--ink-soft); margin: 0 0 0.9rem; }
.type-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.type-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.25rem 0.3rem 0.25rem 0.7rem;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border); border-radius: 999px;
  font-size: 0.9rem; color: var(--ink);
}
.type-x {
  border: 0; background: none; cursor: pointer;
  color: var(--ink-soft); font-size: 1.05rem; line-height: 1;
  padding: 0 0.15rem;
}
.type-x:hover { color: #a2453a; }
.type-add { display: flex; gap: 0.6rem; align-items: center; }
.type-add input {
  flex: 0 0 auto; width: 16rem; max-width: 60%;
  padding: 0.42rem 0.55rem;
  border: 1px solid var(--panel-border); border-radius: 2px;
  background: #f1f4f3; font-family: var(--sans); font-size: 0.95rem;
  box-shadow: inset 0 1px 2px rgba(20, 27, 33, 0.10);
}
.type-add input:focus { outline: none; border-color: var(--lake); }
.type-add .button { margin-top: 0; }
.check { display: block; margin: 0.5rem 0 0.2rem; font-size: 0.9rem; color: var(--ink-soft); }
.check input { margin-right: 0.4rem; }
.panel-body textarea { font-family: var(--sans); line-height: 1.5; }

/* ===========================================================================
   Colophon
   ======================================================================== */
.colophon {
  max-width: var(--measure);
  margin: 3rem auto 0;
  padding: 1.5rem 1.5rem 3rem;
  border-top: 1px solid var(--rule-faint);
  text-align: center;
  font-size: 0.64rem;
  color: var(--ink-soft);
}
.colophon a { color: var(--ink-soft); }
.colophon a:hover { color: var(--ink); }
.colophon .sep { margin: 0 0.6rem; opacity: 0.55; }

/* ===========================================================================
   Small screens
   ======================================================================== */
@media (max-width: 34rem) {
  body { font-size: 1.14rem; }
  .topbar-inner { flex-wrap: wrap; gap: 0.35rem 0; }
  .nav { white-space: normal; }
  .nav a { margin: 0 0.9rem 0 0; }
  .work { flex-direction: column; gap: 0.3rem; }
  .work-date { padding-top: 0; }
  .field-row { flex-direction: column; gap: 0; }
}
