/* Bio2040 — Global Stylesheet */

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

html, body {
  overflow-x: hidden;
}

:root {
  --color-bg: #ffffff;
  --color-text: #1a1a2e;
  --color-text-secondary: #555;
  --color-accent: #00a86b;
  --color-accent-hover: #008855;
  --color-accent-light: rgba(0, 168, 107, 0.08);
  --color-accent-glow: rgba(0, 168, 107, 0.15);
  --color-purple: #7a00df;
  --color-border: #e0e0e0;
  --color-bg-light: #f5faf7;
  --color-bg-card: #ffffff;
  --color-nav-bg: #1a1a2e;
  --color-nav-text: #ffffff;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-heading: var(--font-body);
  --max-width: 720px;
  --max-width-wide: 960px;
  --nav-height: 64px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text);
}

h1 { font-size: 2rem; margin-bottom: 0.5em; }
h2 { font-size: 1.5rem; margin-top: 1.8em; margin-bottom: 0.5em; }
h3 { font-size: 1.25rem; margin-top: 1.5em; margin-bottom: 0.4em; }

/* ── Navigation ── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-nav-bg);
  height: var(--nav-height);
}

.nav-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 4px;
}

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

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

.nav-links a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: #fff;
  text-decoration: none;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  margin: 5px 0;
  transition: transform 0.3s, opacity 0.3s;
}

/* ── Main Content ── */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.container-wide {
  max-width: var(--max-width-wide);
}

/* ── Homepage: Post List ── */
.hero {
  text-align: center;
  padding: 2.5rem 1.5rem 2rem;
  background: linear-gradient(135deg, #f5faf7 0%, #eef7f2 50%, #f0f4f8 100%);
  border-bottom: 1px solid var(--color-border);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.archive-banner {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--color-accent);
  border-radius: 20px;
  padding: 0.4rem 1rem;
  margin-bottom: 2rem;
  display: inline-block;
}

.archive-banner a {
  font-weight: 600;
}

.hero h1 {
  font-size: 2.2rem;
  margin-bottom: 0.2em;
  color: var(--color-text);
}

.hero p {
  color: var(--color-text-secondary);
  font-size: 1.05rem;
  max-width: 540px;
  margin: 0 auto;
}

.hero p.archive-banner {
  margin-bottom: 2rem;
}

.post-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}

.post-card {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: box-shadow 0.2s, border-color 0.2s;
  background: var(--color-bg-card);
}

.post-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.post-card h2 {
  font-size: 1.2rem;
  margin: 0 0 0.3em;
}

.post-card h2 a {
  color: var(--color-text);
}

.post-card h2 a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

.post-meta {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  margin-bottom: 0.5em;
}

.post-card .excerpt {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ── Article / Post Page ── */
.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.article-header h1 {
  font-size: 2rem;
  margin-bottom: 0.4em;
}

.article-header .post-meta {
  font-size: 0.9rem;
}

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

.article-content ul,
.article-content ol {
  margin-bottom: 1.2em;
  padding-left: 1.5em;
}

.article-content li {
  margin-bottom: 0.4em;
}

.article-content blockquote {
  border-left: 3px solid var(--color-accent);
  padding: 0.5em 1em;
  margin: 1.5em 0;
  color: var(--color-text-secondary);
  background: var(--color-bg-light);
  border-radius: 0 4px 4px 0;
}

.article-content img {
  border-radius: 6px;
  margin: 1.5em 0;
}

.article-content a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Spotify player */
.audio-player {
  margin: 1.5em 0;
  border-radius: 12px;
}

/* Iframe embeds (Slides, Descript) */
.embed-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 1.5em 0;
  border-radius: 6px;
}

.embed-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── About Page ── */
.about-profile {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.about-profile img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.about-profile .bio {
  flex: 1;
}

/* ── Contact Page ── */
.contact-form {
  max-width: 500px;
}

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

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

.btn {
  display: inline-block;
  padding: 0.7rem 1.8rem;
  background: var(--color-accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn:hover {
  background: var(--color-accent-hover);
  color: #fff;
  text-decoration: none;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--color-text-secondary);
}

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

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.8rem;
  list-style: none;
}

/* ── Share Buttons ── */
.share-buttons {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
}

.share-label {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.share-buttons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.share-buttons a:hover {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
  text-decoration: none;
}

/* ── Post Navigation ── */
.post-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.post-nav a {
  max-width: 45%;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  h1 { font-size: 1.6rem; }
  .hero h1 { font-size: 1.8rem; }

  .archive-banner {
    font-size: 0.8rem;
    padding: 0.35rem 0.8rem;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-nav-bg);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: 1rem 1.5rem;
    gap: 0.8rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  }

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

  .nav-toggle {
    display: block;
  }

  .nav-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav-toggle.open span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .about-profile {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .post-nav {
    flex-direction: column;
    gap: 1rem;
  }

  .post-nav a {
    max-width: 100%;
  }
}
