/* Laracon Talk Prep — Reading-Optimized Stylesheet */

:root {
  --text-light: #1a1a1a;
  --bg-light: #f8f8f6;
  --accent-light: #555;
  --border-light: #e0ddd8;
  
  --text-dark: #e8e8e6;
  --bg-dark: #1a1a1a;
  --accent-dark: #aaa;
  --border-dark: #333;
  
  /* Reading defaults */
  --font-serif: 'Charter', Georgia, 'Source Serif Pro', serif;
  --font-mono: 'Monaco', 'Courier New', monospace;
  --body-size: 18px;
  --line-height: 1.65;
  --max-width: 680px;
}

/* Dark mode media query */
@media (prefers-color-scheme: dark) {
  :root {
    --text: var(--text-dark);
    --bg: var(--bg-dark);
    --accent: var(--accent-dark);
    --border: var(--border-dark);
  }
}

@media (prefers-color-scheme: light) {
  :root {
    --text: var(--text-light);
    --bg: var(--bg-light);
    --accent: var(--accent-light);
    --border: var(--border-light);
  }
}

/* Fallback for older browsers */
:root {
  --text: var(--text-light);
  --bg: var(--bg-light);
  --accent: var(--accent-light);
  --border: var(--border-light);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-serif);
  font-size: var(--body-size);
  line-height: var(--line-height);
  color: var(--text);
  background-color: var(--bg);
  transition: background-color 0.3s, color 0.3s;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin-top: 2em;
  margin-bottom: 0.75em;
  line-height: 1.2;
  font-weight: 600;
}

h1 {
  font-size: 2.2em;
  margin-top: 0;
}

h2 {
  font-size: 1.6em;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5em;
}

h3 {
  font-size: 1.3em;
}

h4 {
  font-size: 1.1em;
}

p {
  margin-bottom: 1.2em;
}

/* Links */
a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

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

/* Lists */
ul, ol {
  margin-left: 2em;
  margin-bottom: 1.2em;
}

li {
  margin-bottom: 0.6em;
}

/* Blockquotes */
blockquote {
  margin: 1.5em 0;
  padding-left: 1.5em;
  border-left: 4px solid var(--border);
  color: var(--accent);
  font-style: italic;
  font-size: 0.95em;
  line-height: 1.7;
}

blockquote p {
  margin-bottom: 0.6em;
}

/* Code */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background-color: var(--border);
  padding: 0.2em 0.4em;
  border-radius: 2px;
}

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

pre code {
  background-color: transparent;
  padding: 0;
  font-size: 0.85em;
}

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

thead {
  border-bottom: 2px solid var(--border);
}

th {
  text-align: left;
  padding: 0.75em;
  font-weight: 600;
}

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

tbody tr:hover {
  background-color: var(--border);
}

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

/* Layout: Index Page */
.index-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3em 2em 2em;
}

.index-header h1 {
  margin: 0 0 0.5em;
  font-size: 2.5em;
}

.subtitle {
  font-size: 1.1em;
  color: var(--accent);
  font-style: italic;
}

.index-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2em 2em;
}

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

.doc-entry {
  margin-bottom: 3em;
  padding-bottom: 2em;
  border-bottom: 1px solid var(--border);
}

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

.doc-entry h2 {
  margin: 0 0 0.6em;
  font-size: 1.5em;
  border-bottom: none;
}

.doc-entry a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border);
}

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

.doc-excerpt {
  color: var(--accent);
  font-style: italic;
  margin-bottom: 0.6em;
  line-height: 1.6;
}

.doc-date {
  font-size: 0.85em;
  color: var(--accent);
  margin: 0;
}

.index-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2em;
  text-align: center;
  font-size: 0.85em;
  color: var(--accent);
  border-top: 1px solid var(--border);
}

/* Layout: Document Page */
.doc-header {
  background-color: var(--border);
  padding: 1em 0;
  border-bottom: 1px solid var(--border);
}

.nav-back {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2em;
}

.nav-back a {
  font-size: 0.95em;
}

.doc-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3em 2em;
}

.doc-content {
  /* Content rendered from markdown */
}

.doc-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2em;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.85em;
  color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
  :root {
    --body-size: 16px;
    --max-width: 100%;
  }
  
  h1 {
    font-size: 1.8em;
  }
  
  h2 {
    font-size: 1.4em;
  }
  
  h3 {
    font-size: 1.2em;
  }
  
  .index-header {
    padding: 2em 1.5em 1.5em;
  }
  
  .index-header h1 {
    font-size: 2em;
  }
  
  .index-main {
    padding: 0 1.5em 1.5em;
  }
  
  .doc-main {
    padding: 2em 1.5em;
  }
  
  table {
    font-size: 0.9em;
  }
  
  th, td {
    padding: 0.5em;
  }
}

@media (max-width: 480px) {
  :root {
    --body-size: 15px;
  }
  
  h1 {
    font-size: 1.6em;
  }
  
  h2 {
    font-size: 1.2em;
  }
  
  .index-header, .index-main, .doc-main, .doc-footer, .index-footer, .doc-header {
    padding-left: 1em;
    padding-right: 1em;
  }
  
  blockquote {
    margin: 1em 0;
    padding-left: 1em;
  }
  
  ul, ol {
    margin-left: 1.5em;
  }
}

/* Print-friendly */
@media print {
  :root {
    --text: black;
    --bg: white;
  }
  
  body {
    background-color: white;
    color: black;
  }
  
  a {
    text-decoration: underline;
    color: black;
  }
  
  .nav-back, .doc-footer, .index-footer {
    display: none;
  }
}
