/* Color scheme variables */
:root {
  --color-background: #ffffff;
  --color-text: #000000;
  --color-text-secondary: #666666;
  --color-border: #dddddd;
  --color-footer-bg: #f5f5f5;
  --color-link: #0066cc;
  --color-link-hover: #0066cc;
  --color-hover-bg: #f5f5f5;
}

[data-theme="dark"] {
  --color-background: #1a1a1a;
  --color-text: #e0e0e0;
  --color-text-secondary: #a0a0a0;
  --color-border: #404040;
  --color-footer-bg: #242424;
  --color-link: #4da6ff;
  --color-link-hover: #66b3ff;
  --color-hover-bg: #2a2a2a;
}

/* Reset and base styles */
* {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--color-background);
  color: var(--color-text);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Container - Grid Layout */
.container {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr repeat(12, minmax(auto, 4.2rem)) 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 0;
}

/* Navigation */
.nav {
  grid-column: 2 / span 12;
  grid-row: 1 / 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 0;
}

.nav a {
  text-decoration: none;
  color: inherit;
}

.nav h1 {
  margin: 0;
  font-size: 1.5rem;
  text-align: center;
}

.logo {
  display: block;
  width: 60%;
  height: auto;
  margin: 0 auto;
}

/* Main content area */
.main {
  grid-column: 2 / span 12;
  grid-row: 2 / 3;
  padding-bottom: 2rem;
}

/* Footer */
.footer {
  grid-column: 1 / -1;
  grid-row: 3 / 4;
  background-color: var(--color-footer-bg);
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
  text-align: center;
}

.footer p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

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

.footer a:hover {
  text-decoration: underline;
}

/* Blog Grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 50px;
  margin-bottom: 2rem;
}

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

  .container {
    grid-template-columns: 1rem 1fr 1rem;
    gap: 0;
  }

  .nav {
    grid-column: 2 / 3;
  }

  .main {
    grid-column: 2 / 3;
  }

  .footer {
    grid-column: 1 / -1;
  }
}

/* Blog post card */
.blog-post-card {
  display: flex;
  flex-direction: column;
}

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

.blog-post-card h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.2rem;
}

.blog-post-card h3 a {
  text-decoration: none;
  color: inherit;
  box-shadow: none;
}

.blog-post-card h3 a:hover {
  text-decoration: underline;
}

.blog-post-card small {
  color: var(--color-text-secondary);
}

.blog-post-card section {
  margin-bottom: 0.5rem;
}

/* Tags section */
.tags-section {
  margin-top: 0.5rem;
}

.tags-section p {
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.tags-section a {
  text-decoration: none;
  color: var(--color-link);
}

.tags-section a:hover {
  text-decoration: underline;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: space-between;
  margin: 2rem 0;
  padding: 1rem 0;
}

.pagination a {
  text-decoration: none;
  color: var(--color-link);
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
}

.pagination a:hover {
  background-color: var(--color-hover-bg);
}

/* Bio */
.bio {
  display: flex;
  align-items: flex-start;
  margin-bottom: 2.5rem;
  gap: 1rem;
}

.bio-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  flex-shrink: 0;
}

.bio p {
  margin: 0;
}

.bio a {
  color: var(--color-link);
  text-decoration: none;
}

.bio a:hover {
  text-decoration: underline;
}

/* Blog post page */
.post-header {
  margin-bottom: 2rem;
}

.post-title {
  margin: 0 0 0.5rem 0;
}

.post-date {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

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

.post-content img {
  max-width: 100%;
  height: auto;
}

.post-content figure {
  margin: 2rem 0;
}

.post-content figcaption {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  margin-top: 0.5rem;
  font-style: italic;
}

/* Audio player */
.audio-player {
  margin: 2rem 0;
}

/* Navigation between posts */
.post-navigation {
  display: flex;
  justify-content: space-between;
  margin: 3rem 0;
  padding: 2rem 0;
  border-top: 1px solid var(--color-border);
}

.post-navigation a {
  text-decoration: none;
  color: var(--color-link);
}

.post-navigation a:hover {
  text-decoration: underline;
}

/* Theme toggle */
.theme-toggle {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 0.5rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  transition: background-color 0.3s ease, border-color 0.3s ease;
  width: 40px;
  height: 40px;
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
}

.theme-toggle:hover {
  background-color: var(--color-hover-bg);
}

.theme-toggle__icon {
  position: absolute;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-toggle__icon--sun {
  opacity: 1;
  transform: rotate(0deg);
}

.theme-toggle__icon--moon {
  opacity: 0;
  transform: rotate(180deg);
}

[data-theme="dark"] .theme-toggle__icon--sun {
  opacity: 0;
  transform: rotate(180deg);
}

[data-theme="dark"] .theme-toggle__icon--moon {
  opacity: 1;
  transform: rotate(0deg);
}
