/* ============================================================
   writing.css  ✦  the little book
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IM+Fell+English:ital@0;1&family=Crimson+Text:ital,wght@0,400;0,600;1,400&display=swap');

:root {
  --ink:         #343c64;
  --ink-light:   #5a6490;
  --ink-faint:   #8a93b8;
  --gold:        #FCB033;
  --gold-pale:   #FFD89B;
  --cream:       #fffdf7;
  --white-glass: rgba(255, 255, 255, 0.45);
  --white-hover: rgba(255, 255, 255, 0.65);
  --border:      2px double white;
  --shadow:      2px 4px 24px rgba(52, 60, 100, 0.13);
  --page-shadow: 6px 6px 32px rgba(52, 60, 100, 0.18),
                -2px 2px 12px rgba(52, 60, 100, 0.07);
}

body {
background-image: linear-gradient(
#FCB033, 
#FFD89B, 
#FFFFFF), url("https://bellelaviemedspa.com/wp-content/uploads/2016/12/132341-Gif-Stars-Purple-Sparkles-Yes-Sparkle-Png-Transparent-Transparency-....gif");
background-size: cover;
background-position: center;
background-attachment: fixed;
margin: 0;
height: 100vh;
color: 
#343c64;
column-rule: 2px double white;
font-family: monospace;
font-size: 20px;
}

/* ============================================================
   SHARED BASE  (both toc + entry pages inherit this)
   ============================================================ */

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

.writing-page {
  font-family: 'Crimson Text', Georgia, serif;
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--ink);
  min-height: 100vh;
}

/* grain layer */
.writing-page::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  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.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.3;
}

.writing-page > * { position: relative; z-index: 1; }

/* ============================================================
   TABLE OF CONTENTS PAGE
   ============================================================ */

/* the book cover / spine wrapper */
.toc-book {
  max-width: 720px;
  width: 92%;
  margin: 50px auto 40px;
  background: var(--white-glass);
  border: var(--border);
  box-shadow: var(--page-shadow);
  animation: pagein 0.5s ease both;
}

@keyframes pagein {
  from { opacity: 0; transform: translateY(16px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* cover strip at top */
.toc-cover {
  background: linear-gradient(135deg,
    rgba(252,176,51,0.35) 0%,
    rgba(255,216,155,0.18) 100%);
  border-bottom: var(--border);
  padding: 36px 48px 28px;
  text-align: center;
}

.toc-cover h1 {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 2.6rem;
  color: white;
  text-shadow: 1px 3px 14px rgba(52,60,100,0.22);
  margin: 0 0 0.15em;
  letter-spacing: 0.03em;
}

.toc-cover h1::after {
  content: "✦  ✦  ✦";
  display: block;
  font-style: normal;
  font-size: 0.65rem;
  color: var(--gold-pale);
  letter-spacing: 0.6em;
  margin-top: 0.45em;
}

.toc-cover .toc-subtitle {
  font-style: italic;
  color: rgba(255,255,255,0.85);
  font-size: 1rem;
  margin: 0;
  letter-spacing: 0.02em;
}

/* body of the TOC */
.toc-body {
  padding: 32px 48px 40px;
}

/* section heading inside TOC (e.g. "essays", "fiction") */
.toc-section-heading {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink-light);
  text-transform: lowercase;
  letter-spacing: 0.12em;
  margin: 2em 0 0.6em;
  display: flex;
  align-items: center;
  gap: 0.7em;
}

.toc-section-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--gold-pale), transparent);
}

/* the list itself */
.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* one entry row */
.toc-entry {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 0 0.75em;
  padding: 0.5em 0.6em;
  border-radius: 2px;
  text-decoration: none;
  color: inherit;
  transition: background 0.18s, transform 0.15s;
  position: relative;
  /* staggered fade-in */
  animation: fadein 0.4s ease both;
}

.toc-list li:nth-child(1)  .toc-entry { animation-delay: 0.08s; }
.toc-list li:nth-child(2)  .toc-entry { animation-delay: 0.14s; }
.toc-list li:nth-child(3)  .toc-entry { animation-delay: 0.20s; }
.toc-list li:nth-child(4)  .toc-entry { animation-delay: 0.26s; }
.toc-list li:nth-child(5)  .toc-entry { animation-delay: 0.32s; }
.toc-list li:nth-child(6)  .toc-entry { animation-delay: 0.38s; }
.toc-list li:nth-child(7)  .toc-entry { animation-delay: 0.44s; }
.toc-list li:nth-child(8)  .toc-entry { animation-delay: 0.50s; }

@keyframes fadein {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

.toc-entry:hover {
  background: var(--white-hover);
  transform: translateX(5px);
}

/* little gold tab on hover */
.toc-entry::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--gold);
  border-radius: 2px 0 0 2px;
  opacity: 0;
  transition: opacity 0.18s;
}
.toc-entry:hover::before { opacity: 1; }

/* title */
.toc-entry-title {
  font-family: 'Crimson Text', serif;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--ink);
}

/* dot leader */
.toc-entry-title::after {
  content: ' ················';
  font-weight: 400;
  color: var(--gold-pale);
  letter-spacing: 0.08em;
  font-size: 0.85em;
}

/* date / page number */
.toc-entry-date {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 0.88rem;
  color: var(--ink-faint);
  white-space: nowrap;
  justify-self: end;
}

/* optional blurb under the title */
.toc-entry-blurb {
  grid-column: 1 / -1;
  font-style: italic;
  font-size: 0.88rem;
  color: var(--ink-light);
  margin-top: -0.15em;
  padding-left: 0.1em;
}

/* ============================================================
   ENTRY / "PAGE" LAYOUT
   ============================================================ */

.entry-page {
  max-width: 680px;
  width: 92%;
  margin: 50px auto 40px;
  background: var(--cream);
  border: var(--border);
  box-shadow: var(--page-shadow);
  padding: 52px 60px 60px;
  animation: pagein 0.45s ease both;
  /* faint ruled lines — pure CSS, no image needed */
  background-image:
    repeating-linear-gradient(
      to bottom,
      transparent,
      transparent calc(1.8rem - 1px),
      rgba(252,176,51,0.08) calc(1.8rem - 1px),
      rgba(252,176,51,0.08) 1.8rem
    );
  background-attachment: local;
}

/* running header */
.entry-header {
  text-align: center;
  margin-bottom: 2.5em;
  padding-bottom: 1.2em;
  border-bottom: var(--border);
}

.entry-header h1 {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 2rem;
  color: var(--ink);
  text-shadow: none;
  margin: 0 0 0.2em;
  letter-spacing: 0.02em;
}

/* remove the ✦ flourish on entry pages — h1::after from style.css
   might bleed in; this resets it cleanly */
.entry-header h1::after {
  content: none;
}

.entry-meta {
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ink-faint);
  letter-spacing: 0.04em;
}

.entry-meta .entry-category {
  color: var(--gold);
  margin-left: 0.5em;
}
.entry-meta .entry-category::before { content: "✦ "; }

/* body prose */
.entry-body {
  font-size: 1.12rem;
  line-height: 1.85;
  hyphens: auto;
}

.entry-body p { margin: 0 0 1.1em; }

.entry-body p:first-of-type::first-letter {
  font-family: 'IM Fell English', serif;
  font-size: 3.4em;
  float: left;
  line-height: 0.78;
  margin: 0.07em 0.1em 0 0;
  color: var(--gold);
  font-style: italic;
}

/* section break within an entry */
.entry-body .scene-break {
  text-align: center;
  color: var(--gold-pale);
  letter-spacing: 0.5em;
  margin: 1.8em 0;
  user-select: none;
}
.entry-body .scene-break::before { content: "❧  ✦  ❧"; }

/* pull quote */
.entry-body blockquote {
  border-left: 3px double var(--gold);
  margin: 1.5em 0 1.5em 1em;
  padding: 0.4em 1.2em;
  font-style: italic;
  color: var(--ink-light);
  background: rgba(252,176,51,0.06);
}

/* footer nav */
.entry-footer {
  margin-top: 3em;
  padding-top: 1.2em;
  border-top: var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1em;
  flex-wrap: wrap;
  font-family: 'IM Fell English', serif;
  font-style: italic;
  font-size: 0.95rem;
}

.entry-footer a {
  color: var(--ink-light);
  text-decoration: none;
  transition: color 0.15s;
}
.entry-footer a:hover { color: var(--gold); }

.entry-footer .prev::before { content: "← "; }
.entry-footer .next::after  { content: " →"; }
.entry-footer .back-toc     { color: var(--ink-faint); font-size: 0.85rem; }

/* page number stamp */
.entry-footer .page-num {
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--gold-pale);
  letter-spacing: 0.08em;
}

/* ============================================================
   RETURN LINK  (shared)
   ============================================================ */

.return-writing {
  width: min(90%, 360px);
  margin: 20px auto 50px;
  padding: 10px 20px;
  border: var(--border);
  background: var(--white-glass);
  text-align: center;
  font-family: 'IM Fell English', serif;
  font-style: italic;
  box-shadow: var(--shadow);
  transition: background 0.2s;
}
.return-writing:hover { background: var(--white-hover); }
.return-writing a {
  color: var(--ink);
  text-decoration: none;
}
.return-writing a:hover { color: var(--gold); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 600px) {
  .toc-cover        { padding: 24px 24px 20px; }
  .toc-cover h1     { font-size: 1.9rem; }
  .toc-body         { padding: 20px 20px 28px; }
  .entry-page       { padding: 30px 22px 36px; }
  .entry-header h1  { font-size: 1.5rem; }
  .entry-body p:first-of-type::first-letter { font-size: 2.6em; }
  .entry-footer     { flex-direction: column; align-items: center; }
}