/* Minimal theme inspired by clean personal sites */

:root {
  --text: #1a1a1a;
  --text-muted: #666;
  --accent: #1a3a5f;
  --bg: #fafafa;
  --border: #e0e0e0;
}

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

html {
  font-size: 18px;
}

body {
  font-family: 'EB Garamond', Georgia, serif;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

/* Navigation */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.nav-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

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

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

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

/* Content */
.content {
  min-height: 60vh;
}

/* Home page */
.home .profile-photo {
  display: block;
  max-width: 280px;
  width: 100%;
  border-radius: 6px;
  margin: 0 auto 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.home h1 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--accent);
  text-align: center;
}

.home h1 + p {
  text-align: center;
  margin-bottom: 2rem;
}

.home p {
  margin-bottom: 1.2rem;
}

.home a {
  color: var(--accent);
}

/* Highlights */
.home h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.highlights-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 0.5rem;
}

.highlight-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease;
}

.highlight-card:hover {
  border-color: var(--accent);
}

.highlight-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.highlight-card p {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin-bottom: 1rem;
  flex: 1;
}

.highlight-buttons {
  display: flex;
  gap: 0.6rem;
}

.highlight-buttons a {
  font-size: 0.8rem;
  padding: 0.35rem 0.85rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-read {
  background: var(--accent);
  color: #fff !important;
}

.btn-read:hover {
  background: #142d4a;
}

.btn-link {
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Articles */
.article-header {
  margin-bottom: 2rem;
}

.article-header h1 {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.article-header .subtitle {
  color: var(--text-muted);
  font-style: italic;
}

.article-header .date {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.featured-image {
  margin: 0 0 2rem;
  overflow: hidden;
  border-radius: 6px;
  aspect-ratio: 3 / 2;
  background: #0a0a0a;
  cursor: zoom-in;
}

.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

.featured-image.list-hero {
  margin-bottom: 2.5rem;
}

/* Hero pair — two figures side by side */
.hero-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0 0 2.5rem;
}

.hero-pair figure {
  position: relative;
  margin: 0;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 6px;
  background: #0a0a0a;
  cursor: zoom-in;
}

.hero-pair img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

.hero-pair figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.5rem 0.75rem;
  color: #fff;
  font-size: 0.8rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
  font-family: 'EB Garamond', Georgia, serif;
  font-style: italic;
}

.article-content {
  text-align: left;
}

.article-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.75rem auto;
  border-radius: 4px;
  cursor: zoom-in;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

.article-content img + em,
.article-content p > img {
  margin-bottom: 1.75rem;
}

.article-content p {
  margin-bottom: 1.2rem;
}

.article-content h2,
.article-content h3 {
  color: var(--accent);
  margin: 2rem 0 1rem;
  font-weight: 600;
}

.article-content h2 {
  font-size: 1.3rem;
}

.article-content h3 {
  font-size: 1.1rem;
}

.article-content a {
  color: var(--accent);
}

.article-content blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}

/* Tables */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.article-content thead th {
  text-align: left;
  font-weight: 600;
  color: var(--accent);
  padding: 0.6rem 0.75rem;
  border-bottom: 2px solid var(--border);
}

.article-content tbody td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.article-content tbody tr:last-child td {
  border-bottom: none;
}

.article-content table code {
  font-size: 0.85em;
}

/* Lists */
.list h1 {
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.list > p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.post-row {
  border-bottom: 1px solid var(--border);
}

.post-row:first-child {
  border-top: 1px solid var(--border);
}

.post-row-link {
  display: flex;
  flex-direction: row;
  gap: 1.25rem;
  padding: 1.1rem 0;
  text-decoration: none;
  color: inherit;
  align-items: flex-start;
}

.post-row-thumb {
  flex: 0 0 120px;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #f0f0f0;
  border-radius: 3px;
}

.post-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-row-body {
  flex: 1;
  min-width: 0;
}

.post-row-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.post-row-title {
  color: var(--text);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.3;
}

.post-row:hover .post-row-title {
  color: var(--accent);
}

.post-row time {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.post-row .description {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

/* Essay row — inline within body content */
.essay-row {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
  padding: 0.9rem 0;
  margin: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.essay-row:first-of-type {
  border-top: 1px solid var(--border);
}

h2 + .essay-row {
  border-top: 1px solid var(--border);
}

.essay-thumb {
  flex: 0 0 120px;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #0a0a0a;
  border-radius: 3px;
}

.essay-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

.essay-body {
  flex: 1;
  min-width: 0;
}

.essay-title {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 0.3rem;
}

.essay-row:hover .essay-title {
  color: var(--accent);
}

.essay-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.essay-desc p {
  margin: 0;
}

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

/* Archive — card layout */
.archive-list > p {
  margin-bottom: 3rem;
}

.archive-cards {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.archive-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  transition: border-color 0.2s ease, transform 0.2s ease;
  position: relative;
}

.archive-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.archive-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.archive-card-image {
  background: #f5f5f5;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.archive-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.archive-card-body {
  padding: 1.25rem 1.5rem 1.5rem;
}

.archive-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.archive-card-header h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.archive-card-header time {
  color: var(--text-muted);
  font-size: 0.8rem;
  white-space: nowrap;
}

.archive-card .description {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
}

.archive-card-external {
  display: inline-block;
  margin: 0 1.5rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-decoration: none;
  font-family: 'EB Garamond', Georgia, serif;
  font-style: italic;
}

.archive-card-external:hover {
  color: var(--accent);
}

/* Archive — single entry */
.archive-single-header {
  margin-bottom: 2rem;
}

.archive-breadcrumb {
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.archive-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.archive-breadcrumb a:hover {
  color: var(--accent);
}

.archive-single h1 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.archive-single-description {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 1rem;
}

.archive-single-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.archive-single-meta a {
  color: var(--text-muted);
  text-decoration: none;
}

.archive-single-meta a:hover {
  color: var(--accent);
}

.archive-single-image {
  margin: 2rem 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.archive-single-image img {
  width: 100%;
  display: block;
}

.archive-single-body {
  margin-top: 2rem;
}

.archive-single-body p {
  margin-bottom: 1.2rem;
}

.archive-single-body strong {
  color: var(--text);
}

.archive-single-body a {
  color: var(--accent);
  text-decoration: underline;
}

/* Wider container for archive */
.archive-list,
.archive-single {
  max-width: 760px;
  margin: 0 auto;
}

/* Footer */
.footer {
  margin-top: 4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer a {
  color: var(--text-muted);
  text-decoration: none;
}

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

.footer .resume-links {
  margin-top: 0.5rem;
}

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

  .container {
    padding: 1.5rem 1rem;
  }

  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 2rem;
  }

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

  .highlights-grid {
    grid-template-columns: 1fr;
  }

  .article-header h1 {
    font-size: 1.5rem;
    line-height: 1.25;
  }

  .article-content {
    text-align: left;
    hyphens: none;
  }

  .article-content h2 {
    font-size: 1.2rem;
  }

  .article-content h3 {
    font-size: 1.05rem;
  }

  .article-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.85rem;
  }

  .featured-image {
    margin: 0 0 1.5rem;
    border-radius: 4px;
  }

  .post-row-link {
    gap: 0.9rem;
    padding: 0.9rem 0;
  }

  .post-row-thumb {
    flex: 0 0 88px;
  }

  .post-row-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    margin-bottom: 0.3rem;
  }

  .post-row-title {
    font-size: 1rem;
  }

  .post-row .description {
    font-size: 0.85rem;
    line-height: 1.45;
  }

  .hero-pair {
    gap: 0.35rem;
    margin-bottom: 1.75rem;
  }

  .hero-pair figcaption {
    font-size: 0.72rem;
    padding: 0.4rem 0.55rem;
  }

  .essay-row {
    gap: 0.9rem;
    padding: 0.8rem 0;
  }

  .essay-thumb {
    flex: 0 0 88px;
  }

  .essay-title {
    font-size: 0.98rem;
  }

  .essay-desc {
    font-size: 0.85rem;
    line-height: 1.45;
  }

  .list h1 {
    font-size: 1.35rem;
  }

  .archive-card-body {
    padding: 1rem 1.25rem 1.25rem;
  }

  .archive-card-external {
    margin: 0 1.25rem 1rem;
  }
}

/* Lightbox overlay */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 5, 5, 0.94);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.lightbox-overlay.open {
  display: flex;
  opacity: 1;
}

.lightbox-stage {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-stage > img {
  max-width: 100%;
  max-height: 92vh;
  object-fit: contain;
  display: block;
  border-radius: 2px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.lightbox-stage.pair {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-height: 92vh;
}

.lightbox-stage.pair figure {
  position: relative;
  margin: 0;
  max-height: 92vh;
  flex: 0 1 auto;
}

.lightbox-stage.pair figure img {
  max-height: 92vh;
  max-width: 100%;
  object-fit: contain;
  display: block;
  border-radius: 2px;
}

.lightbox-stage.pair figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.5rem 0.75rem;
  color: #fff;
  font-size: 0.85rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  font-family: 'EB Garamond', Georgia, serif;
  font-style: italic;
}

@media (max-width: 600px) {
  .lightbox-stage.pair {
    gap: 0.35rem;
  }
  .lightbox-stage.pair figcaption {
    font-size: 0.7rem;
    padding: 0.35rem 0.5rem;
  }
}

.lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: transparent;
  color: #fff;
  border: none;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.6rem;
  font-family: inherit;
  opacity: 0.8;
  transition: opacity 0.15s ease;
}

.lightbox-close:hover,
.lightbox-close:focus {
  opacity: 1;
}
