/* style.css — classless reading theme with auto light/dark
 * Light: Sakura (oxalorg/sakura) · Dark: Sakura Dark
 * Adapted for long-form reading.
 */

:root {
  --color-bg:         #f9f9f9;
  --color-bg-alt:     #f1f1f1;
  --color-text:       #4a4a4a;
  --color-text-muted: #999;
  --color-accent:     #1d7484;
  --color-accent-alt: #982c61;
  --color-link-visited:#144f5a;
  --color-border:     #ddd;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg:         #222222;
    --color-bg-alt:     #4a4a4a;
    --color-text:       #c9c9c9;
    --color-text-muted: #999;
    --color-accent:     #ffffff;
    --color-accent-alt: #c9c9c9;
    --color-link-visited:#e6e6e6;
    --color-border:     #4a4a4a;
  }
}

/* Base */
html {
  font-size: 62.5%;
  font-family: Georgia, "Noto Serif SC", "Noto Serif", "Source Serif Pro",
               serif;
}

body {
  font-size: 1.8rem;
  line-height: 1.75;
  max-width: 36em;
  margin: 4rem auto;
  padding: 0 1.6rem;
  color: var(--color-text);
  background-color: var(--color-bg);
}

@media (max-width: 684px) {
  body { font-size: 1.6rem; margin: 2rem auto; }
}
@media (max-width: 382px) {
  body { font-size: 1.4rem; }
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  font-weight: 700;
  margin-top: 3rem;
  margin-bottom: 1rem;
  color: var(--color-text);
}

h1 { font-size: 2.2em; margin-top: 0; }
h2 { font-size: 1.6em; }
h3 { font-size: 1.3em; }

/* Paragraph & text */
p {
  margin-top: 0;
  margin-bottom: 1.5rem;
  text-align: justify;
  hyphens: auto;
}

small, sub, sup { font-size: 75%; }

/* Links */
a { color: var(--color-accent); text-decoration: none; }
a:visited { color: var(--color-link-visited); }
a:hover { color: var(--color-accent-alt); border-bottom: 1px solid; }

/* Horizontal rule */
hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 3rem 0;
}

/* Lists */
ul, ol {
  padding-left: 1.4em;
  margin-bottom: 1.5rem;
}
li { margin-bottom: 0.4em; }

/* Blockquote */
blockquote {
  margin: 0 0 1.5rem 0;
  padding: 0.8em 1em;
  border-left: 4px solid var(--color-accent);
  background-color: var(--color-bg-alt);
  font-style: italic;
}
blockquote p { margin-bottom: 0; }

/* Pre / Code */
pre {
  background-color: var(--color-bg-alt);
  padding: 1em;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-size: 0.9em;
}
code {
  font-size: 0.9em;
  padding: 0.1em 0.4em;
  background-color: var(--color-bg-alt);
}
pre > code { padding: 0; background: transparent; }

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}
td, th {
  padding: 0.5em;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}

/* Story metadata */
.meta {
  color: var(--color-text-muted);
  font-size: 0.85em;
  margin-bottom: 2rem;
  line-height: 1.6;
}

/* Navigation */
nav {
  margin-bottom: 2rem;
  font-size: 0.9em;
}
nav a {
  margin-right: 1em;
}

/* Index page story list */
.story-list {
  list-style: none;
  padding: 0;
}
.story-list li {
  margin-bottom: 1.2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--color-border);
}
.story-list li:last-child {
  border-bottom: none;
}
.story-list .title {
  font-size: 1.1em;
  font-weight: 600;
}
.story-list .info {
  color: var(--color-text-muted);
  font-size: 0.85em;
}

/* Collapsible sections (index page) */
details {
  margin-bottom: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  overflow: hidden;
}
details summary {
  cursor: pointer;
  padding: 0.8em 1em;
  font-size: 1.15em;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  background-color: var(--color-bg-alt);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.6em;
}
details summary::-webkit-details-marker { display: none; }
details summary::before {
  content: "▸";
  display: inline-block;
  transition: transform 0.15s ease;
}
details[open] summary::before {
  transform: rotate(90deg);
}
details summary .count {
  font-size: 0.75em;
  font-weight: 400;
  color: var(--color-text-muted);
}
details .story-list {
  margin: 0;
  padding: 0.6em 1em;
}
details .story-list li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
}

/* Footer */
footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.8em;
}
