/* Harry's Blog - Fusion of Console Theme & Academic Features */

/* Clean Minimal Palette */
:root {
  --bg-color: #faf9f6;
  --text-color: #1a1a1a;
  --accent-color: #666666;
  --card-bg: #faf9f6;
  --border-color: #eaeaea;
  --hover-bg: #f0ede6;
  --muted-text: #666666;
  --light-text: #999999;
  --code-bg: #f5f5f5;
  --link-underline: #eaeaea;
}

[data-theme='dark'] {
  --bg-color: #0a0a0a;
  --text-color: #e5e5e5;
  --accent-color: #888888;
  --card-bg: #0a0a0a;
  --border-color: #222222;
  --hover-bg: #111111;
  --muted-text: #888888;
  --light-text: #666666;
  --code-bg: #1a1a1a;
  --link-underline: #222222;
}

/* Base Styles */
html {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg-color);
  color: var(--text-color);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  line-height: 1.6;
  font-size: 14px;
  font-weight: normal;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1 {
  font-weight: normal;
  font-size: 14px;
  margin-bottom: 1rem;
  line-height: 1.6;
  letter-spacing: normal;
}

h2 {
  font-weight: normal;
  font-size: 14px;
  margin-top: 2rem;
  margin-bottom: 1rem;
  line-height: 1.6;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

h3 {
  font-weight: normal;
  font-size: 14px;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

h4, h5, h6 {
  font-weight: normal;
  font-size: 14px;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

p {
  line-height: 1.6;
  margin-bottom: 1rem;
  color: var(--text-color);
  font-size: 14px;
}

/* Links */
a {
  color: var(--text-color);
  text-decoration: underline;
  text-decoration-color: var(--link-underline);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.2s ease;
}

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

/* Container */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Header Navigation */
.site-header {
  background: var(--bg-color);
  margin-bottom: 1rem;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 1rem;
}

.nav-logo {
  font-weight: normal;
  text-decoration: none;
  color: var(--text-color);
  font-size: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo:hover {
  text-decoration: none;
}

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

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

.nav-links a {
  color: var(--muted-text);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
}

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

/* Theme Toggle Button */
.theme-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.2s ease;
  z-index: 1000;
}

.theme-toggle:hover {
  background: var(--hover-bg);
  transform: scale(1.1);
}

/* Hero Section */
.hero {
  margin-bottom: 5rem;
}

.hero h1 {
  font-size: 14px;
  margin-bottom: 1rem;
  color: var(--text-color);
  font-weight: normal;
  line-height: 1.6;
}

.hero .tagline {
  color: var(--muted-text);
  margin-bottom: 3rem;
  font-weight: normal;
  font-size: 14px;
  line-height: 1.6;
  font-style: italic;
}

.hero .intro {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-color);
  margin-bottom: 0;
}

/* Cards - Clean Minimal Design */
.card {
  padding-bottom: 2rem;
  margin-bottom: 2rem;
  background: var(--card-bg);
  transition: all 0.2s ease;
}

.card:last-child {
  margin-bottom: 0;
}

.card:hover {
  transform: translateY(-1px);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.25rem;
  color: var(--text-color);
  font-weight: bold;
  font-size: 18px;
}

.card h3 a {
  text-decoration: none;
  color: var(--text-color);
  transition: all 0.2s ease;
  font-weight: bold;
}

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

.card p {
  color: var(--text-color);
  line-height: 1.7;
  margin-top: 0;
  margin-bottom: 0;
}

/* Post Meta */
.post-meta {
  font-size: 14px;
  color: var(--muted-text);
  margin-bottom: 0.1rem;
  font-weight: normal;
  letter-spacing: normal;
}

/* Tag Filter Navigation */
.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}

.tag-filter .filter-tag {
  color: var(--muted-text);
  text-decoration: none;
  transition: color 0.2s ease;
  cursor: pointer;
}

.tag-filter .filter-tag:hover {
  color: var(--text-color);
}

.tag-filter .filter-tag.active {
  color: var(--text-color);
  font-weight: bold;
}

/* Sections */
section {
  margin-bottom: 4rem;
}

section h2 {
  margin-bottom: 1.5rem;
  color: var(--text-color);
  font-size: 14px;
}

/* Main Content Area */
.page-content {
  flex: 1 0 auto;
}

/* Footer */
.site-footer {
  text-align: left;
  padding: 2rem 1.5rem;
  margin-top: 4rem;
  color: var(--muted-text);
  flex-shrink: 0;
}

/* Social Links */
.social-links {
  margin-top: 1.5rem;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.social-links a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* Social Icons (horizontal icon-only layout) */
.social-icons {
  display: flex;
  gap: 1.5rem;
  margin-top: 2rem;
  justify-content: center;
}

.social-icons a {
  color: var(--muted-text);
  text-decoration: none;
  font-size: 1.25rem;
  transition: color 0.2s ease;
}

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

/* Code Blocks */
pre, code {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: 13px;
}

code {
  background: var(--code-bg);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  color: var(--text-color);
}

pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  border: 1px solid var(--border-color);
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

/* Math Display */
.MathJax,
.MathJax_Display {
  font-size: 1em !important;
  overflow-x: auto;
  overflow-y: hidden;
}

/* Bibliography/Citations */
.bibliography {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: none;
}

.bibliography h2 {
  font-size: 16px;
  font-weight: normal;
  color: var(--muted-text);
  margin-bottom: 1rem;
}

.bibliography ol {
  padding-left: 1.5rem;
  padding-top: 1rem;
}

.bibliography li {
  margin-bottom: 1rem;
  line-height: 1.7;
  font-size: 12px;
  color: var(--muted-text);
}

/* Blockquotes */
blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--border-color);
  color: var(--muted-text);
  font-style: italic;
}

/* Lists */
ul, ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

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

th {
  background: var(--code-bg);
  font-weight: normal;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem 0;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--card-bg);
  color: var(--text-color);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
}

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

/* Language Switcher in Nav */
.nav-links .lang-switch {
  color: var(--muted-text);
  cursor: pointer;
}

.nav-links .lang-switch:hover {
  color: var(--text-color);
}

/* Post Front Matter */
.post {
  position: relative;
}

.front-matter {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
  margin-bottom: 3rem;
}

.front-matter .post-title {
  font-size: 32px;
  font-weight: bold;
  line-height: 1.3;
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.front-matter .post-subtitle {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-color);
  margin-top: 0.75rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.front-matter .bylines {
  margin-top: 1.5rem;
}

.front-matter .bylines .byline {
  margin-right: 2rem;
  float: left;
}

.front-matter .bylines .byline h3,
.front-matter .bylines .byline p {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

.front-matter .bylines .byline h3 {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--muted-text);
  letter-spacing: 0.8px;
  font-weight: bold;
}

.front-matter .bylines .byline p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted-text);
  margin-top: 0.25rem;
}

.clear {
  clear: both;
}

/* Post Content Spacing */
.post-content {
  margin-top: 3rem;
  font-size: 15px;
  line-height: 1.6;
}

.post-content h2:first-child {
  margin-top: 0;
}

.post-content h2 {
  font-size: 24px;
  font-weight: 500;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.75rem;
  padding-top: 1rem;
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
}

.post-content h3 {
  font-size: 20px;
  font-weight: 500;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.post-content h4 {
  font-size: 17px;
  font-weight: 500;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.post-content h5 {
  font-size: 15px;
  font-weight: 600;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

/* References section - subtle style */
.post-content h2:last-of-type {
  font-size: 16px;
  font-weight: normal;
  color: var(--muted-text);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-top: 3rem;
  margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 1.5rem 1rem;
  }

  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .theme-toggle {
    bottom: 1rem;
    right: 1rem;
  }

  .front-matter .bylines .byline {
    margin-right: 1rem;
  }
}

@media (max-width: 600px) {
  html, body {
    font-size: 13px;
  }

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