/* hanatsumi · shared stylesheet
   typography: EB Garamond — Italian Renaissance lineage, fits the rosso/giallo aesthetic.
   palette: warm cream, dark warm text, single rosso accent. inverts gracefully in dark mode.
*/

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

:root {
  color-scheme: light dark;
  --bg: #faf6ee;
  --text: #1c1814;
  --muted: #6b6259;
  --accent: #9a2a2a;
  --rule: #e8dfcd;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1814;
    --text: #f0e9da;
    --muted: #9b9285;
    --accent: #d97a7a;
    --rule: #2e2820;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: 'EB Garamond', ui-serif, Georgia, "Times New Roman", serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 19px;
  font-feature-settings: "kern", "liga", "onum";
  max-width: 38rem;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 4rem;
}

/* ---- Links ---- */
a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule);
  text-underline-offset: 4px;
  transition: color 0.15s, text-decoration-color 0.15s;
}

a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* ---- Back link (top of subpages) ---- */
.back {
  display: inline-block;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 2rem;
}

.back:hover {
  color: var(--accent);
}

/* ---- Site header ---- */
header.site {
  margin-bottom: 2.5rem;
}

header.site h1 {
  font-weight: 500;
  font-size: 2.6rem;
  margin: 0 0 0.3rem;
  letter-spacing: -0.005em;
  line-height: 1.1;
}

header.site .tagline {
  font-style: italic;
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0;
}

.intro {
  font-style: italic;
  color: var(--muted);
  margin: 0 0 2.5rem;
}

/* ---- Collection nav (homepage) ---- */
nav.collections {
  margin: 2.5rem 0 1rem;
}

nav.collections ul {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--rule);
}

nav.collections li {
  border-bottom: 1px solid var(--rule);
}

nav.collections a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.9rem 0;
  text-decoration: none;
  color: var(--text);
  gap: 1rem;
}

nav.collections a:hover { color: var(--accent); }

nav.collections .name {
  font-size: 1.15rem;
  font-weight: 500;
}

nav.collections .desc {
  color: var(--muted);
  font-style: italic;
  font-size: 0.95rem;
  text-align: right;
}

/* ---- Collection list (entries inside a section) ---- */
ul.collection-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--rule);
}

ul.collection-list li {
  border-bottom: 1px solid var(--rule);
}

ul.collection-list a {
  display: block;
  padding: 1.1rem 0;
  text-decoration: none;
  color: var(--text);
}

ul.collection-list a:hover { color: var(--accent); }

ul.collection-list .title {
  font-size: 1.1rem;
  margin-bottom: 0.2rem;
}

ul.collection-list .meta {
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
}

ul.collection-list a:hover .meta { color: var(--accent); }

/* ---- Article (entry pages) ---- */
article header {
  margin-bottom: 2rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--rule);
}

article header h1 {
  font-weight: 500;
  font-size: 2rem;
  margin: 0 0 0.4rem;
  line-height: 1.2;
}

article header .meta {
  color: var(--muted);
  font-style: italic;
  font-size: 1rem;
  margin: 0;
}

article .body p {
  margin: 0 0 1.1rem;
}

article .body blockquote {
  border-left: 2px solid var(--accent);
  padding: 0.3rem 0 0.3rem 1.4rem;
  margin: 1.6rem 0;
  font-style: italic;
  color: var(--text);
  font-size: 1.05rem;
}

article .body blockquote p { margin: 0 0 0.5rem; }
article .body blockquote p:last-child { margin: 0; }

article .body blockquote cite {
  display: block;
  text-align: right;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--muted);
  margin-top: 0.6rem;
}

article .body em { font-style: italic; }
article .body strong { font-weight: 600; }

/* ---- Demo notice (on example entries) ---- */
.demo-notice {
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
  margin: 0 0 1.8rem;
  padding: 0.6rem 0.9rem;
  border-left: 2px solid var(--rule);
  background: rgba(0,0,0,0.02);
}

@media (prefers-color-scheme: dark) {
  .demo-notice { background: rgba(255,255,255,0.02); }
}

.demo-notice code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.85em;
  padding: 0.05rem 0.3rem;
  background: var(--rule);
  border-radius: 3px;
}

/* ---- Footer ---- */
footer.site {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
}

footer.site p { margin: 0; }

footer.site a { color: var(--muted); }
footer.site a:hover { color: var(--accent); }

/* ---- Mobile ---- */
@media (max-width: 480px) {
  body {
    font-size: 18px;
    padding: 2rem 1.2rem 3rem;
  }
  header.site h1 { font-size: 2.1rem; }
  article header h1 { font-size: 1.7rem; }
  nav.collections a { flex-direction: column; gap: 0.1rem; }
  nav.collections .desc { text-align: left; }
}
