/* eleanor thorn's stylesheet
   colors + fonts */

:root {
  --bg: #0c110e;
  --text: #e6d8cb;
  --muted: #9c978c;       /* dates, little notes */
  --link: #d9774a;
  --link-visited: #6cc9bd;
  --rule: #2c3631;        /* lines/borders */
  --note-bg: #151d19;     /* content notes box */

  --font-body: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --font-heading: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", sans-serif;

  --font-size: 1.15rem;
  --line-height: 1.7;
  --measure: 36rem;
  --measure-story: 46rem; /* stories are wider */
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  padding: 2rem 1.25rem 4rem;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--font-size);
  line-height: var(--line-height);
}

.page { max-width: var(--measure); margin: 0 auto; }
.page:has(.story-text) { max-width: var(--measure-story); }

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: normal;
  line-height: 1.25;
}
h1 { font-size: 2rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.4rem; margin: 2.5rem 0 0.75rem; }

a { color: var(--link); }
a:visited { color: var(--link-visited); }

hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}


/* --- header / nav --- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  padding-bottom: 1rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-ui);
  font-size: 0.95rem;
}
.site-title { font-size: 1.1rem; font-weight: 600; text-decoration: none; }
.site-title, .site-title:visited { color: var(--text); }
.site-header nav a { margin-left: 1rem; }
.site-header nav a:first-child { margin-left: 0; }

/*about page */
.portrait {
  display: block;
  width: 14rem;
  max-width: 100%;
  height: auto;
  margin: 1rem 0 1.5rem;
  border-radius: 4px;
}


/* --- lists (home, writing, serial contents) --- */

.work-list { list-style: none; padding: 0; margin: 0; }
.work-list li { margin-bottom: 1.5rem; }
.work-list .work-title { font-size: 1.15em; }
.work-list .work-info {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--muted);
}

.chapter-list { padding-left: 1.5rem; }
.chapter-list li { margin-bottom: 0.35rem; }


/* --- story pages --- */

.story-header { margin-bottom: 2rem; }
.series {
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 0.25rem;
}

/* genre / words / CWs */
.story-meta {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  background: var(--note-bg);
  border-left: 3px solid var(--rule);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  line-height: 1.5;
}
.story-meta div { margin: 0.15rem 0; }
.story-meta dt { display: inline; font-weight: 600; }
.story-meta dt::after { content: ":"; }
.story-meta dd { display: inline; margin: 0; }

.story-note {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.75rem 0 0;
}

/* gap between paragraphs, no indents.
   (:where so .verse etc can override it) */
:where(.story-text) p { margin: 0 0 1em; }

/* <p class="scene-break">***</p> */
.scene-break {
  text-align: center;
  text-indent: 0;
  margin: 1.5rem 0;
  letter-spacing: 1em;
  color: var(--muted);
}

/* poems/songs: <p class="verse">line<br>line</p>
   signs etc:   <p class="sign">KEEP OUT</p>
   add "upright" to a verse if it shouldn't be italic */
.verse,
.sign {
  text-align: center;
  text-indent: 0;
  margin: 1.5rem 0;
}
.verse { font-style: italic; }
.verse.upright { font-style: normal; }

/* prev / contents / next */
.chapter-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
}
.chapter-nav .placeholder { visibility: hidden; }


/* --- 18+ popup (age-gate.js) --- */

.age-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: var(--bg);
  overflow-y: auto;
}
.age-check body > .page { visibility: hidden; }
.age-gate-box { max-width: 30rem; }
.age-gate-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-top: 1.5rem;
  font-family: var(--font-ui);
}
.age-gate-buttons button {
  padding: 0.6rem 1.1rem;
  border: none;
  border-radius: 3px;
  background: var(--link);
  color: var(--bg);
  font: inherit;
  cursor: pointer;
}


/* --- footer / hit counter (hit-counter.js) --- */

.site-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--muted);
}


/* --- comments (guestbook.js) --- */

.guestbook {
  margin-top: 4rem;
  font-family: var(--font-ui);
  font-size: 0.95rem;
}
/* little ornament above the heading, like a scene break */
.guestbook::before {
  content: "***";
  display: block;
  text-align: center;
  margin-bottom: 1.5rem;
  letter-spacing: 1em;
  padding-left: 1em; /* balances the spacing after the last * */
  color: var(--muted);
  font-family: var(--font-body);
}
.guestbook h2 { margin: 0 0 1.25rem; }

.gb-entry {
  padding: 0.85rem 1rem;
  margin-bottom: 0.75rem;
  background: var(--note-bg);
  border-left: 3px solid var(--rule);
}
.gb-entry-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0 1rem;
}
.gb-entry-head strong { font-weight: 600; }
.gb-entry-head small { color: var(--muted); font-size: 0.8rem; }
.gb-entry p {
  margin: 0.35rem 0 0;
  font-family: var(--font-body);
  font-size: 1rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.gb-empty { color: var(--muted); font-style: italic; }

#gb-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.75rem;
}
#gb-form input,
#gb-form textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--note-bg);
  color: var(--text);
  font: inherit;
}
#gb-form input { max-width: 18rem; }
#gb-form textarea { min-height: 6rem; resize: vertical; }
#gb-form input::placeholder,
#gb-form textarea::placeholder { color: var(--muted); }
#gb-form input:focus,
#gb-form textarea:focus {
  outline: none;
  border-color: var(--link);
}
.gb-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}
.gb-actions button {
  padding: 0.5rem 1.2rem;
  border: none;
  border-radius: 3px;
  background: var(--link);
  color: var(--bg);
  font: inherit;
  cursor: pointer;
}
.gb-actions button:hover { filter: brightness(1.1); }
#gb-status { color: var(--muted); font-size: 0.85rem; }

.gb-credit {
  margin: 2rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.gb-credit a, .gb-credit a:visited { color: var(--muted); }
