/* ============================================================
   Emberwood — Dark Fantasy Static Site Stylesheet
   ============================================================ */

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

/* ── Custom Properties ── */
:root {
  --bg:         #141410;
  --bg-card:    #1c1c16;
  --bg-nav:     #0e0e0a;
  --text:       #ddd8c4;
  --text-muted: #8a8472;
  --accent:     #c47a3a;
  --heading:    #d4b87a;
  --border:     #2a2920;
  --link:       #b89a5a;
  --link-hover: #d4b87a;
}

/* ── Reset & Base ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 1rem;
  line-height: 1.75;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Cinzel', serif;
  color: var(--heading);
  line-height: 1.3;
  margin-top: 1.6em;
  margin-bottom: 0.5em;
}

h1 { font-size: 2rem;   font-weight: 600; }
h2 { font-size: 1.5rem; font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 400; }
h4 { font-size: 1.05rem; font-weight: 400; }

p {
  margin-bottom: 1em;
}

strong {
  font-weight: 600;
  color: var(--text);
}

em {
  font-style: italic;
  color: var(--text-muted);
}

/* ── Links ── */
a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover,
a:focus {
  color: var(--link-hover);
  text-decoration: underline;
}

/* ── Navigation ── */
.site-nav {
  background-color: var(--bg-nav);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--heading);
  text-decoration: none;
  letter-spacing: 0.04em;
}

.nav-brand:hover {
  color: var(--accent);
  text-decoration: none;
}

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

.nav-links a {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a:focus {
  color: var(--heading);
  text-decoration: none;
}

/* ── Main Content ── */
.site-main {
  flex: 1;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}

/* ── Article / Page Containers ── */
article {
  width: 100%;
}

/* ── Horizontal Rules ── */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2em 0;
}

/* ── Lists ── */
ul, ol {
  padding-left: 1.5em;
  margin-bottom: 1em;
}

li {
  margin-bottom: 0.3em;
}

/* ── Images ── */
img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
  margin: 1em auto;
}

/* ── Tables ── */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5em;
  font-size: 0.95rem;
}

th {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--heading);
  text-align: left;
  padding: 0.5em 0.75em;
  border-bottom: 1px solid var(--accent);
  letter-spacing: 0.04em;
}

td {
  padding: 0.45em 0.75em;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tr:last-child td {
  border-bottom: none;
}

/* ── Blockquotes ── */
blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.5em 1em;
  margin: 1.5em 0;
  color: var(--text-muted);
  font-style: italic;
}

blockquote p {
  margin-bottom: 0;
}

/* ── Code ── */
code {
  font-family: 'Courier New', monospace;
  font-size: 0.875em;
  background-color: var(--bg-card);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  color: var(--accent);
}

pre {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1em;
  overflow-x: auto;
  margin-bottom: 1.5em;
}

pre code {
  background: none;
  padding: 0;
}

/* ── Resident Card ── */
.page-resident {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2rem 2.25rem;
}

/* ── Species Badge ── */
.species-badge {
  display: inline-block;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background-color: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 0.2em 0.65em;
  margin-bottom: 0.5em;
}

/* ── Council Link (on resident pages) ── */
.council-link {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.25em;
}

.council-link a {
  color: var(--link);
}

.council-link a:hover {
  color: var(--link-hover);
}

/* ── Oaths & Portents — accent h3 treatment ──
   Targets h3 elements inside articles.
   Since goldmark renders "### Oaths & Portents" as a plain h3,
   we style all article h3 with the accent border treatment.
   This is the expected pattern for all resident pages.
   ────────────────────────────────────────────── */
article h3 {
  border-left: 3px solid var(--accent);
  padding-left: 0.75em;
  margin-left: -0.75em;
  color: var(--heading);
}

/* Paragraphs immediately following h3 get slight indent */
article h3 + p,
article h3 + ul {
  padding-left: 0.25em;
}

/* ── Index Pages ── */
.page-index h1 {
  margin-top: 0;
  margin-bottom: 0.3em;
}

.index-intro {
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 2em;
  font-size: 1.05rem;
}

/* ── Species Groups (residents index) ── */
.species-group {
  margin-bottom: 2.5em;
}

.species-group h2 {
  margin-top: 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.3em;
  margin-bottom: 0.75em;
}

.resident-list {
  list-style: none;
  padding-left: 0;
}

.resident-entry {
  padding: 0.25em 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 0.5em;
  flex-wrap: wrap;
}

.resident-entry:last-child {
  border-bottom: none;
}

.resident-entry a {
  font-weight: 600;
}

.resident-council {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Council List (councils index) ── */
.council-list {
  list-style: none;
  padding-left: 0;
  margin-top: 1.5em;
}

.council-entry {
  padding: 0.5em 0;
  border-bottom: 1px solid var(--border);
  font-size: 1.05rem;
}

.council-entry:last-child {
  border-bottom: none;
}

.council-entry a {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
}

/* ── Chronicle List (chronicles index) ── */
.chronicle-list {
  list-style: none;
  padding-left: 0;
  margin-top: 1.5em;
}

.chronicle-entry {
  padding: 0.5em 0;
  border-bottom: 1px solid var(--border);
  font-size: 1.05rem;
}

.chronicle-entry:last-child {
  border-bottom: none;
}

/* ── Footer ── */
.site-footer {
  background-color: var(--bg-nav);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1.25rem 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  font-family: 'Crimson Pro', serif;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  html {
    font-size: 16px;
  }

  .site-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
  }

  .site-main {
    padding: 1.5rem 1rem 2.5rem;
  }

  .page-resident {
    padding: 1.25rem 1rem;
  }

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.3rem; }
}
