/* ========================================
   EDITH MINA LYRE
   A clean house for words
   ======================================== */

:root {
  /* Light mode (default) */
  --bg: #fefefe;
  --bg-alt: #f5f3f0;
  --text: #2d2d2d;
  --text-muted: #6b6b6b;
  --text-faint: #999;
  --border: #e8e4df;
  --accent: #8b4049;
  
  --serif: 'EB Garamond', Georgia, serif;
  --sans: 'Source Sans 3', -apple-system, sans-serif;
}

/* Dark mode */
[data-theme="dark"] {
  --bg: #121214;
  --bg-alt: #1a1a1e;
  --text: #e0ddd8;
  --text-muted: #9a9590;
  --text-faint: #5a5550;
  --border: #2a2a2e;
  --accent: #c97078;
}

/* System preference (if no manual choice) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121214;
    --bg-alt: #1a1a1e;
    --text: #e0ddd8;
    --text-muted: #9a9590;
    --text-faint: #5a5550;
    --border: #2a2a2e;
    --accent: #c97078;
  }
}

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

html {
  font-size: 18px;
}

body {
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ----------------------------------------
   TYPOGRAPHY
   ---------------------------------------- */

h1, h2, h3 {
  font-weight: 500;
  line-height: 1.3;
}

h2 {
  font-size: 0.85rem;
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

h3 {
  font-size: 1.15rem;
  font-weight: 400;
}

a {
  color: inherit;
  text-decoration: none;
}

p a, .work-item h3 a {
  border-bottom: 1px solid var(--text-faint);
  transition: border-color 0.2s ease, color 0.2s ease;
}

p a:hover, .work-item h3 a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ----------------------------------------
   LAYOUT
   ---------------------------------------- */

header {
  padding: 2rem 2rem 0;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.site-title {
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

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

nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

nav ul a {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

nav ul a:hover {
  color: var(--text);
}

main {
  flex: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem 2rem;
  width: 100%;
}

/* ----------------------------------------
   HOME - INTRO
   ---------------------------------------- */

.intro {
  margin-bottom: 4rem;
}

.intro p {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ----------------------------------------
   WORK LISTINGS
   ---------------------------------------- */

.featured {
  margin-bottom: 3rem;
}

.work-item {
  display: grid;
  grid-template-columns: 4rem 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.work-item:last-child {
  border-bottom: none;
}

.work-item .year {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--text-faint);
}

.work-item h3 {
  margin: 0;
}

.work-item .category {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ----------------------------------------
   CONTENT PAGES
   ---------------------------------------- */

.page-header {
  margin-bottom: 3rem;
}

.page-header h1 {
  font-size: 1.8rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.page-header .meta {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--text-faint);
}

.content {
  max-width: 600px;
}

.content p {
  margin-bottom: 1.5rem;
  text-align: left;
}

.content p:last-child {
  margin-bottom: 0;
}

/* Poetry formatting */
.content.poetry {
  text-align: left;
}

.content.poetry p {
  text-align: left;
  hyphens: none;
  white-space: pre-wrap;
  margin-bottom: 2rem;
}

.stanza {
  margin-bottom: 1.5rem;
}

/* Section divider */
.section-break {
  text-align: center;
  margin: 2rem 0;
  color: var(--text-faint);
}

/* ----------------------------------------
   WORK INDEX PAGES (stories, poems, essays)
   ---------------------------------------- */

.work-section {
  margin-bottom: 3rem;
}

.work-section h2 {
  margin-bottom: 1rem;
}

.work-list {
  list-style: none;
}

.work-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.work-list li:last-child {
  border-bottom: none;
}

.work-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.work-list .title {
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.work-list a:hover .title {
  border-color: var(--accent);
  color: var(--accent);
}

.work-list .year {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--text-faint);
  flex-shrink: 0;
}

/* ----------------------------------------
   BIO PAGE
   ---------------------------------------- */

.bio-content {
  max-width: 600px;
}

.bio-content p {
  margin-bottom: 1.5rem;
}

/* ----------------------------------------
   CONTACT PAGE
   ---------------------------------------- */

.contact-content a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
}

.contact-content a:hover {
  color: var(--text);
  border-color: var(--text);
}

/* ----------------------------------------
   FOOTER
   ---------------------------------------- */

footer {
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.social {
  display: flex;
  gap: 1.5rem;
}

.social a {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

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

.updated {
  font-family: var(--sans);
  font-size: 0.75rem;
  color: var(--text-faint);
}

/* ----------------------------------------
   THEME TOGGLE
   ---------------------------------------- */

.theme-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s ease;
  z-index: 100;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Sun icon for dark mode, moon for light */
.theme-toggle::before {
  content: '☽';
}

[data-theme="dark"] .theme-toggle::before {
  content: '☼';
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle::before {
    content: '☼';
  }
}

/* ----------------------------------------
   RESPONSIVE
   ---------------------------------------- */

@media (max-width: 600px) {
  html {
    font-size: 16px;
  }
  
  header, main, footer {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
  
  nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  nav ul {
    gap: 1rem;
    flex-wrap: wrap;
  }
  
  .work-item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  
  .work-item .year {
    order: 2;
  }
  
  .work-item h3 {
    order: 1;
  }
  
  .work-item .category {
    order: 3;
  }
  
  footer {
    flex-direction: column;
    align-items: flex-start;
  }
}
