/*


 */

/* CSS Variables - matching existing site */
:root {
  --soft-gray: #e8e8e8;
  --warm-gray: #d4d4d4;
  --sage-green: #5D4954;
  --hunter-green: #1E4D3B;
  --mauve: #8B8499;
  --dusty-blue: #A5A9D0;
  --warm-taupe: #a39080;
  --charcoal: #2c2c2c;
  --off-white: #fafafa;

  --font-serif: 'Georgia', 'Times New Roman', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;

  --max-width: 700px;
  --spacing: 2rem;
}

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

/* Base */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--charcoal);
  background: #fefefe;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.3;
  color: var(--hunter-green);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; margin-top: 2rem; margin-bottom: 1rem; }
h3 { font-size: 1.25rem; margin-top: 1.5rem; margin-bottom: 0.75rem; }

a {
  color: var(--dusty-blue);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--sage-green);
}

p {
  margin: 0 0 1.5rem;
  line-height: 1.7;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: rgba(93, 73, 84, 0.1);
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
}

pre {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background: #282c34;
  color: #abb2bf;
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1.5rem 0;
}

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

blockquote {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
  border-left: 2px solid var(--warm-taupe);
  color: var(--warm-taupe);
  font-style: italic;
}

/* Header */
.site-header {
  padding: var(--spacing) 0;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--hunter-green);
  text-decoration: none;
}

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

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

.nav-links a {
  color: var(--dusty-blue);
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--sage-green);
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--charcoal);
  position: relative;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 2px;
  background: var(--charcoal);
  left: 0;
}

.hamburger::before { top: -6px; }
.hamburger::after { top: 6px; }

/* Main Content */
.main-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem var(--spacing) 4rem;
  min-height: calc(100vh - 200px);
}

/* Footer */
.site-footer {
  padding: var(--spacing) 0;
  text-align: center;
}

.site-footer p {
  font-size: 0.75rem;
  color: var(--mauve);
  font-style: italic;
  opacity: 0.6;
  margin: 0;
}

/* Home Page */
.home-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 70vh;
}

.hero {
  margin-bottom: 3rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 1s ease forwards;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 400;
  color: var(--hunter-green);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.tagline {
  font-size: 1.2rem;
  color: var(--dusty-blue);
  font-weight: 300;
  letter-spacing: 0.05em;
  margin: 0 0 2rem;
}

.divider {
  width: 80px;
  height: 1px;
  background-color: var(--warm-taupe);
  margin: 0 auto 2rem;
  opacity: 0;
  animation: fadeIn 1s ease 0.5s forwards;
}

.plum-divider {
  width: 200px;
  height: 1px;
  background-color: var(--sage-green);
  margin: 2rem auto;
}

.home-container .plum-divider {
  opacity: 0;
  animation: fadeIn 1s ease 1s forwards;
}

.headshot {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 2rem;
  opacity: 0;
  animation: fadeIn 1s ease 0.5s forwards;
}

.about {
  max-width: 550px;
  margin-bottom: 3rem;
  opacity: 0;
  animation: fadeIn 1s ease 1s forwards;
}

.about p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--charcoal);
  margin-bottom: 1.5rem;
}

.contact-section {
  opacity: 0;
  animation: fadeIn 1s ease 1.5s forwards;
  margin-bottom: 2rem;
}

.contact-button {
  display: inline-block;
  padding: 1rem 2rem;
  background-color: var(--dusty-blue);
  color: var(--off-white);
  text-decoration: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  transition: all 0.3s ease;
  border: 1px solid var(--dusty-blue);
}

.contact-button:hover {
  background-color: transparent;
  color: var(--dusty-blue);
}

.recent-posts-section {
  opacity: 0;
  animation: fadeIn 1s ease 2s forwards;
  text-align: left;
  width: 100%;
  max-width: 550px;
}

.recent-posts-section h2 {
  font-size: 1.2rem;
  color: var(--hunter-green);
  margin-bottom: 1rem;
  text-align: center;
}

.home-footer {
  margin-top: 3rem;
  opacity: 0;
  animation: fadeIn 1s ease 2.5s forwards;
}

.footer-text {
  font-size: 0.75rem;
  color: var(--mauve);
  font-style: italic;
  opacity: 0.6;
  margin: 0;
  line-height: 1.8;
}

/* Post List (Home) */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(163, 144, 128, 0.3);
}

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

.post-list time {
  font-size: 0.875rem;
  color: var(--warm-taupe);
  white-space: nowrap;
  margin-left: 1rem;
}

.view-all-link {
  display: block;
  text-align: center;
  margin-top: 1rem;
  font-size: 0.9rem;
}

/* Blog Index */
.blog-header {
  text-align: center;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
}

.blog-header h1 {
  margin-bottom: 0.5rem;
}

.blog-header p {
  color: var(--mauve);
  margin: 0;
}

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

.series-title {
  font-size: 1rem;
  color: var(--warm-taupe);
  border-bottom: 1px solid rgba(163, 144, 128, 0.3);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
}

.post-card {
  padding: 1.5rem 0;
  border-bottom: 1px solid rgba(163, 144, 128, 0.3);
}

.post-card:last-child {
  border-bottom: none;
}

.post-card h3 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  color: var(--hunter-green);
}

.post-card h3 a {
  color: inherit;
}

.post-card h3 a:hover {
  color: var(--dusty-blue);
}

.post-card time {
  font-size: 0.875rem;
  color: var(--warm-taupe);
}

.post-card .excerpt {
  margin: 0.75rem 0 0;
  color: var(--charcoal);
  opacity: 0.8;
}

.no-posts {
  color: var(--warm-taupe);
  font-style: italic;
  text-align: center;
}

.under-construction {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--mauve);
  font-style: italic;
}

.under-construction p {
  margin: 0.5rem 0;
}

/* Contact Page */
.contact-page {
  max-width: 500px;
  margin: 0 auto;
  padding: 2rem 0;
}

.contact-page h1 {
  text-align: center;
  margin-bottom: 2rem;
}

.contact-links p {
  margin-bottom: 1.5rem;
}

.contact-links strong {
  color: var(--sage-green);
  font-weight: normal;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}

.contact-value {
  color: var(--charcoal);
}

/* Post Show */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--sage-green);
  width: 0;
  z-index: 100;
  transition: width 0.1s;
}

.post-header {
  text-align: left;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(163, 144, 128, 0.3);
}

.post-header h1 {
  margin: 0 0 0.75rem;
}

.post-header time {
  color: var(--warm-taupe);
  font-size: 0.9rem;
}

.series-badge {
  display: inline-block;
  background: rgba(93, 73, 84, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--sage-green);
  margin-left: 1rem;
}

.post-content {
  margin-bottom: 3rem;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.post-content h2 {
  color: var(--hunter-green);
  margin-top: 2.5rem;
}

.post-content h3 {
  color: var(--hunter-green);
}

.post-content a {
  color: var(--hunter-green);
}

.post-content a:hover {
  color: var(--sage-green);
}

/* Footnotes */
.post-content .footnotes {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(163, 144, 128, 0.3);
  font-size: 0.9rem;
}

.post-content .footnotes ol {
  padding-left: 1.5rem;
  color: var(--charcoal);
}

.post-content .footnotes li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.post-content .footnotes li p {
  margin: 0;
  display: inline;
}

.post-content sup {
  font-size: 0.75em;
}

.post-content sup a.footnote {
  color: var(--hunter-green);
  text-decoration: none;
  padding: 0 0.2em;
}

.post-content sup a.footnote:hover {
  text-decoration: underline;
}

.post-content .reversefootnote {
  color: var(--dusty-blue);
  text-decoration: none;
  margin-left: 0.25rem;
}

.post-content .footnote-note {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--mauve);
  margin: 0.25rem 0;
}

.series-nav {
  background: rgba(93, 73, 84, 0.08);
  padding: 1.5rem;
  border-radius: 4px;
  margin: 2rem 0;
}

.series-nav h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
  color: var(--hunter-green);
}

.series-nav ol {
  margin: 0;
  padding-left: 1.5rem;
}

.series-nav li {
  padding: 0.25rem 0;
  color: var(--charcoal);
}

.series-nav li.current {
  font-weight: 600;
  color: var(--sage-green);
}

.post-nav {
  padding-top: 2rem;
  border-top: 1px solid rgba(163, 144, 128, 0.3);
}

/* Admin Styles */
body.admin {
  background: var(--soft-gray);
}

.admin-header {
  background: var(--charcoal);
  padding: 1rem 0;
}

.admin-header .nav-container {
  max-width: 1000px;
}

.admin-header .site-title {
  color: var(--off-white);
}

.admin-header .nav-links a {
  color: var(--dusty-blue);
}

.admin-header .nav-links a:hover {
  color: var(--off-white);
}

.admin-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem var(--spacing);
}

.admin-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.admin-header-actions h1 {
  margin: 0;
  color: var(--charcoal);
}

.admin-table {
  width: 100%;
  background: var(--off-white);
  border-radius: 4px;
  border-collapse: collapse;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.admin-table th,
.admin-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--warm-gray);
}

.admin-table th {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--warm-taupe);
  background: var(--soft-gray);
}

.admin-table th:first-child {
  border-radius: 4px 0 0 0;
}

.admin-table th:last-child {
  border-radius: 0 4px 0 0;
}

.admin-table .actions {
  display: flex;
  gap: 1rem;
}

.admin-table .actions a {
  font-size: 0.875rem;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: var(--font-sans);
  font-weight: 500;
}

.badge-success {
  background: rgba(93, 73, 84, 0.15);
  color: var(--sage-green);
}

.badge-draft {
  background: rgba(163, 144, 128, 0.2);
  color: var(--warm-taupe);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--warm-gray);
  border-radius: 4px;
  background: var(--off-white);
  color: var(--charcoal);
  font-family: var(--font-serif);
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn:hover {
  background: var(--soft-gray);
  color: var(--charcoal);
}

.btn-primary {
  background: var(--dusty-blue);
  border-color: var(--dusty-blue);
  color: var(--off-white);
}

.btn-primary:hover {
  background: transparent;
  color: var(--dusty-blue);
}

/* Forms */
.admin-form {
  background: var(--off-white);
  padding: 2rem;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-family: var(--font-sans);
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--charcoal);
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--warm-gray);
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  background: var(--off-white);
}

.form-control:focus {
  outline: none;
  border-color: var(--dusty-blue);
  box-shadow: 0 0 0 3px rgba(149, 165, 179, 0.2);
}

textarea.form-control {
  resize: vertical;
}

.content-editor {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.5;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-hint {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--warm-taupe);
}

.form-errors {
  background: rgba(220, 100, 100, 0.1);
  border: 1px solid rgba(220, 100, 100, 0.3);
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.form-errors h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: #991b1b;
}

.form-errors ul {
  margin: 0;
  padding-left: 1.5rem;
  color: #991b1b;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

/* Detail List */
.detail-list {
  margin: 0;
}

.detail-list dt {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--warm-taupe);
  margin-top: 1.5rem;
}

.detail-list dd {
  margin: 0.25rem 0 0;
}

.content-preview {
  background: var(--soft-gray);
  padding: 1.5rem;
  border-radius: 4px;
  margin-top: 0.5rem;
}

/* Flash Messages */
.notice, .alert {
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.notice {
  background: rgba(93, 73, 84, 0.15);
  color: var(--sage-green);
}

.alert {
  background: rgba(220, 100, 100, 0.1);
  color: #991b1b;
}

/* Syntax Highlighting (Rouge - One Dark theme) */
.highlight .hll { background-color: #3a3f4b }
.highlight .c { color: #5c6370; font-style: italic }
.highlight .k { color: #c678dd }
.highlight .n { color: #abb2bf }
.highlight .o { color: #abb2bf }
.highlight .p { color: #abb2bf }
.highlight .cm { color: #5c6370; font-style: italic }
.highlight .cp { color: #5c6370; font-style: italic }
.highlight .c1 { color: #5c6370; font-style: italic }
.highlight .cs { color: #5c6370; font-style: italic }
.highlight .gd { color: #e06c75 }
.highlight .gi { color: #98c379 }
.highlight .kc { color: #c678dd }
.highlight .kd { color: #c678dd }
.highlight .kn { color: #c678dd }
.highlight .kp { color: #c678dd }
.highlight .kr { color: #c678dd }
.highlight .kt { color: #e5c07b }
.highlight .m { color: #d19a66 }
.highlight .s { color: #98c379 }
.highlight .na { color: #d19a66 }
.highlight .nb { color: #e5c07b }
.highlight .nc { color: #e5c07b }
.highlight .no { color: #d19a66 }
.highlight .nd { color: #61afef }
.highlight .ni { color: #abb2bf }
.highlight .ne { color: #e06c75 }
.highlight .nf { color: #61afef }
.highlight .nl { color: #e06c75 }
.highlight .nn { color: #abb2bf }
.highlight .nt { color: #e06c75 }
.highlight .nv { color: #e06c75 }
.highlight .ow { color: #c678dd }
.highlight .w { color: #abb2bf }
.highlight .mf { color: #d19a66 }
.highlight .mh { color: #d19a66 }
.highlight .mi { color: #d19a66 }
.highlight .mo { color: #d19a66 }
.highlight .sb { color: #98c379 }
.highlight .sc { color: #98c379 }
.highlight .sd { color: #98c379 }
.highlight .s2 { color: #98c379 }
.highlight .se { color: #98c379 }
.highlight .sh { color: #98c379 }
.highlight .si { color: #98c379 }
.highlight .sx { color: #98c379 }
.highlight .sr { color: #56b6c2 }
.highlight .s1 { color: #98c379 }
.highlight .ss { color: #56b6c2 }
.highlight .bp { color: #e5c07b }
.highlight .vc { color: #e06c75 }
.highlight .vg { color: #e06c75 }
.highlight .vi { color: #e06c75 }
.highlight .il { color: #d19a66 }

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Mobile Styles */
@media (max-width: 768px) {
  body {
    font-size: 1.125rem;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--off-white);
    flex-direction: column;
    padding: 1rem var(--spacing);
    gap: 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    padding: 0.5rem 0;
  }

  .site-header {
    position: relative;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .tagline {
    font-size: 1.2rem;
  }

  .about p {
    font-size: 1.1rem;
  }

  .post-content {
    font-size: 1.125rem;
    line-height: 1.8;
  }

  .post-content p {
    margin-bottom: 1.75rem;
  }

  .contact-button {
    padding: 0.9rem 1.8rem;
    font-size: 1.05rem;
  }

  .post-list li {
    flex-direction: column;
    gap: 0.25rem;
  }

  .post-list time {
    margin-left: 0;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}
