﻿@import url('https://fonts.googleapis.com/css2?family=Fraunces:wght@400;600;700&family=Work+Sans:wght@400;500;700&display=swap');

:root {
  --bg: #f5efe6;
  --bg-soft: #f0e4d5;
  --ink: #1e1b16;
  --muted: #6f665b;
  --primary: #2c6e6f;
  --secondary: #d77a61;
  --card: #fff9f0;
  --border: #e5d6c6;
  --shadow: 0 18px 35px rgba(31, 24, 16, 0.12);
}

[data-theme="dark"] {
  --bg: #14110d;
  --bg-soft: #1b1611;
  --ink: #f6efe6;
  --muted: #b0a59a;
  --primary: #70c0c1;
  --secondary: #e5a487;
  --card: #1d1812;
  --border: #352c23;
  --shadow: 0 18px 35px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Work Sans", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: -140px;
  right: -120px;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle at top, rgba(215, 122, 97, 0.35), transparent 70%);
  z-index: -1;
}

body::after {
  content: "";
  position: fixed;
  bottom: -160px;
  left: -120px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle at bottom, rgba(44, 110, 111, 0.35), transparent 70%);
  z-index: -1;
}

[data-theme="dark"] body::before {
  background: radial-gradient(circle at top, rgba(229, 164, 135, 0.2), transparent 70%);
}

[data-theme="dark"] body::after {
  background: radial-gradient(circle at bottom, rgba(112, 192, 193, 0.2), transparent 70%);
}

a {
  color: var(--primary);
  text-decoration: none;
}

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

.site-hero {
  padding: 64px 8vw 32px;
  background: linear-gradient(120deg, #2c6e6f, #d77a61);
  color: #fff;
  position: relative;
  overflow: hidden;
}

.site-hero::after {
  content: "";
  position: absolute;
  top: -20px;
  right: -40px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  filter: blur(0.5px);
}

.hero-inner {
  max-width: 980px;
  margin: 0 auto;
  animation: fadeIn 0.8s ease-out both;
}

.site-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  margin: 0 0 12px;
}

.site-title {
  font-family: "Fraunces", serif;
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  margin: 0 0 12px;
}

.site-tagline {
  font-size: 1.1rem;
  max-width: 560px;
  opacity: 0.9;
}

.site-nav {
  display: flex;
  gap: 24px;
  padding: 16px 8vw;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .site-nav {
  background: rgba(20, 17, 13, 0.8);
}

.site-nav a {
  font-weight: 600;
}

.nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.nav-actions:empty {
  display: none;
}

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

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

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 32px;
  padding: 32px 8vw 64px;
}

.content {
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 96px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.panel h3 {
  font-family: "Fraunces", serif;
  margin-top: 0;
}

.sidebar-tabs {
  padding: 16px;
}

.sidebar-tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.sidebar-tab {
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.sidebar-tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.sidebar-tabcontent {
  max-height: min(50vh, 420px);
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-tabcontent::-webkit-scrollbar {
  display: none;
}

.sidebar-tabs.is-js .sidebar-tabpanel {
  display: none;
}

.sidebar-tabs.is-js .sidebar-tabpanel.is-active {
  display: block;
}

.sidebar-tabpanel > :first-child {
  margin-top: 0;
}

.sidebar-empty {
  margin: 0;
  color: var(--muted);
}

.sidebar-archive-group {
  margin-bottom: 16px;
}

.sidebar-archive-group h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.sidebar-archive-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.sidebar-archive-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.sidebar-archive-list a {
  color: var(--ink);
  font-weight: 600;
}

.sidebar-archive-list .archive-date {
  min-width: auto;
  font-size: 0.75rem;
}

.section-head {
  margin-bottom: 22px;
}

.section-head h2 {
  font-family: "Fraunces", serif;
  font-size: 1.8rem;
  margin: 0 0 8px;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.post-grid {
  display: grid;
  gap: 18px;
}

.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 22px;
  border-radius: 18px;
  box-shadow: var(--shadow);
  animation: rise 0.6s ease-out both;
}

.post-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.post-meta-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.post-words {
  padding: 2px 8px;
  border-radius: 999px;
  background: #efe2d3;
  font-size: 0.75rem;
  color: var(--ink);
}

[data-theme="dark"] .post-words {
  background: #2a2218;
}

.post-updated {
  font-size: 0.8rem;
  color: var(--muted);
}

.stale-warning {
  margin: 12px 0 18px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(210, 116, 54, 0.35);
  background: rgba(210, 116, 54, 0.12);
  color: #8a4f2a;
  font-weight: 600;
}

[data-theme="dark"] .stale-warning {
  border-color: rgba(229, 164, 135, 0.35);
  background: rgba(229, 164, 135, 0.15);
  color: #f1c8ac;
}

.post-title {
  font-family: "Fraunces", serif;
  margin: 0 0 8px;
}

.post-title a {
  color: inherit;
}

.post-summary {
  margin: 0 0 14px;
  color: var(--muted);
}

.post-more {
  font-weight: 600;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: rgba(44, 110, 111, 0.12);
  border-radius: 999px;
  font-size: 0.75rem;
  color: var(--primary);
  margin-right: 6px;
}

.post {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 28px;
  border-radius: 22px;
  box-shadow: var(--shadow);
  animation: rise 0.6s ease-out both;
}

.post-body {
  line-height: 1.75;
}

.post-body h2,
.post-body h3 {
  font-family: "Fraunces", serif;
}

.post-body img {
  max-width: 100%;
  border-radius: 16px;
  margin: 16px 0;
  box-shadow: var(--shadow);
}

.post-body pre {
  background: #1f2320;
  color: #f3f0e8;
  padding: 16px;
  border-radius: 12px;
  overflow-x: auto;
}

.post-body code {
  font-family: "Courier New", monospace;
}

.post-body :not(pre) > code {
  background: #efe2d3;
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.95em;
}

[data-theme="dark"] .post-body :not(pre) > code {
  background: #2a2218;
  border-color: #3b3025;
}

.post-body blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  border-left: 4px solid var(--secondary);
  background: #f8efe3;
  color: var(--ink);
}

[data-theme="dark"] .post-body blockquote {
  background: #2a2218;
}

.post-body blockquote p {
  margin: 0;
}

.post-footer {
  margin-top: 24px;
}

.category-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.category-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.category-list a {
  font-weight: 600;
  color: var(--ink);
}

.category-list .count {
  background: #efe2d3;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
}

[data-theme="dark"] .category-list .count {
  background: #2a2218;
  color: var(--ink);
}

.archive-group {
  margin-bottom: 24px;
}

.archive-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
  color: var(--muted);
}

.archive-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.archive-toggle {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.archive-toggle.is-active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

.archive-views.is-js .archive-view {
  display: none;
}

.archive-views.is-js .archive-view.is-active {
  display: block;
}

.archive-empty {
  color: var(--muted);
  margin: 0 0 12px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.page-link {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
}

.page-link.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-numbers {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  flex: 1;
}

.page-number {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
}

.page-number.is-active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

.archive-total {
  font-weight: 600;
  color: var(--ink);
}

.archive-year-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.archive-year {
  font-weight: 600;
  color: var(--ink);
}

.archive-count {
  background: #efe2d3;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  margin-left: 6px;
}

.archive-group h3 {
  font-family: "Fraunces", serif;
  margin: 0 0 10px;
}

.archive-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.archive-list li {
  display: flex;
  gap: 12px;
  align-items: baseline;
  color: var(--muted);
}

.archive-date {
  font-size: 0.85rem;
  min-width: 110px;
  color: var(--muted);
}

.archive-list a {
  color: var(--ink);
  font-weight: 600;
}

.archive-list a:hover {
  color: var(--secondary);
}

.toc {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.toc li {
  line-height: 1.4;
}

.toc a {
  color: var(--ink);
  font-weight: 600;
}

.toc a:hover {
  color: var(--primary);
}

.toc ul ul {
  padding-left: 12px;
  border-left: 1px solid var(--border);
  margin-left: 6px;
}

.search-bar {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
}

.search-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 1rem;
}

.search-input:focus {
  outline: 2px solid rgba(44, 110, 111, 0.4);
  border-color: var(--primary);
}

.search-status {
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 24px;
  color: var(--muted);
}

.dot {
  opacity: 0.6;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 720px) {
  .site-hero {
    padding: 48px 6vw 28px;
  }

  .site-nav {
    padding: 12px 6vw;
    flex-wrap: wrap;
  }

  .layout {
    padding: 24px 6vw 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
