/* 🌿 theme-overgrown.css: The Organic Decay Collection */

:root {
  --bg-color: #2b2e28; /* Damp stone grey/brown */
  --surface-color: #383c34;
  --text-primary: #d3d5c7; /* Muted bone white */
  --text-secondary: #9aa08a; /* Mossy grey */
  --accent-color: #7b9e59; /* Bright moss green */
  --accent-hover: #96ba74;
  --border-color: #4a5042;
  --code-bg: #22251f;

  --font-serif: Georgia, 'Times New Roman', serif;
  --font-heading: Georgia, 'Times New Roman', serif;
  --font-mono: 'Courier New', Courier, monospace;

  --max-width: 750px;
  --spacing-base: 1rem;
}

body {
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-serif);
  line-height: 1.7;
  margin: 0;
  padding: 0;
  background-image: linear-gradient(rgba(43, 46, 40, 0.9), rgba(43, 46, 40, 0.9)), url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.05" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100" height="100" filter="url(%23noise)" opacity="0.05"/></svg>');
}

.rk-shell {
  max-width: var(--max-width);
  margin: 3rem auto;
  padding: 3rem;
  background-color: var(--surface-color);
  border-radius: 4px 20px 4px 20px; /* Irregular, "chipped stone" rounding */
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3), 0 0 40px rgba(123, 158, 89, 0.05) inset;
  border-left: 5px solid var(--accent-color);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: #e5e7da;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  position: relative;
}

h1::after {
  content: " 🍃";
  font-size: 0.8em;
  opacity: 0.7;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  border-bottom: 1px solid rgba(123, 158, 89, 0.3);
  transition: all 0.3s ease;
}

a:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

.rk-header {
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
}

code {
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  background-color: var(--code-bg);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  color: #a4bfa4;
}

pre {
  background-color: var(--code-bg);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-color);
  overflow-x: auto;
}

blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-left: 3px solid var(--accent-color);
  background-color: rgba(123, 158, 89, 0.1);
  font-style: italic;
  color: var(--text-secondary);
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: rgba(0,0,0,0.1);
  font-family: var(--font-heading);
  font-size: 1.1em;
}

/* Accessibility: visible keyboard focus indicator for interactive elements. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* Narrow viewports: let wide tables scroll instead of blowing out layout. */
table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

/* Images never exceed the text column. */
img {
  max-width: 100%;
  height: auto;
}

/* Long inline code wraps instead of blowing out narrow viewports.
   Scoped away from pre > code so code fences keep horizontal scrolling. */
:not(pre) > code {
  overflow-wrap: anywhere;
}

/* Honor GFM column alignment from the renderer (align attributes);
   blanket cell text-align would otherwise flatten centered/right columns. */
th[align="center"],
td[align="center"] {
  text-align: center;
}

th[align="right"],
td[align="right"] {
  text-align: right;
}
