/* ===== LAYOUT VARIABLES ===== */
:root {
  --sidebar-width: 250px;
  --decoration-size: 100px;
  --footer-decoration-size: 100px;
  --footer-deco: url(/assets/border.png);
  --sidebar-deco: url(/assets/border-v.png);
}

/* ===== NAVIGATION: NAVBAR ===== */
.navbar {
  padding: 2%;
  z-index: 100;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: var(--sp-md);
}

.nav-links a {
  color: var(--accent-primary);
  font-weight: 600;
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--accent-secondary);
}

/* ===== NAVIGATION: SIDEBAR ===== */
.sidebar-nav {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  z-index: 100;
  background-color: var(--bg-tertiary);
  align-content: center;
}

.sidebar-nav::after {
  content: '';
  position: absolute;
  right: calc(var(--decoration-size) * -1);
  top: 0;
  width: var(--decoration-size);
  height: 100%;
  background-repeat: repeat-y;
  mask-image: var(--sidebar-deco);
  mask-repeat: repeat-y;
  mask-size: var(--footer-decoration-size);
  background-color: var(--bg-tertiary);
}

@media (max-width: 768px) {
  .sidebar-nav::after {
    display: none;
  }
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: var(--sp-md);
  align-items: center;
}

.sidebar-links a {
  color: var(--accent-primary);
  font-weight: 600;
}

.sidebar-links a:hover {
  color: var(--accent-secondary);
}

/* ===== MAIN LAYOUT ===== */
.sidebar-content-wrapper {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.sidebar-content-wrapper .main-content {
  flex: 1;
}

.main-content {
  min-height: calc(100vh - 200px);
  padding: var(--sp-2xl);
}

/* ===== FOOTER ===== */
.footer {
  background: var(--bg-tertiary);
  padding: var(--sp-2xl) 0;
  margin-top: var(--sp-2xl);
  text-align: center;
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: calc(var(--footer-decoration-size) * -1);
  left: 0;
  width: 100%;
  height: var(--footer-decoration-size);
  mask-image: var(--footer-deco);
  mask-repeat: repeat-x;
  mask-size: var(--footer-decoration-size);
  background-color: var(--bg-tertiary);
}

@media (max-width: 768px) {
  .footer::before {
    display: none;
  }
}

.footer p {
  margin-bottom: var(--sp-md);
  color: var(--text-secondary);
}

.footer-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ===== POST LAYOUTS ===== */
.post {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--sp-lg);
  background-color: var(--bg-secondary);
}

.post-date {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: var(--sp-lg);
}

.post-content h2 {
  margin-top: var(--sp-2xl);
  color: var(--text-primary);
  padding-bottom: var(--sp-md);
}

.post-content h3,
.post-content h4 {
  color: var(--accent-tertiary);
}

/* ===== MICROBLOG POSTS ===== */
.micro-post {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--sp-lg);
  margin-bottom: var(--sp-lg);
  position: relative;
  overflow: visible;
  animation: float 2s ease-in-out infinite;
  transform-origin: center;
}

.micro-post:nth-child(1) { animation-delay: 0s; --rotation: -2deg; }
.micro-post:nth-child(2) { animation-delay: 0.3s; --rotation: 1.5deg; }
.micro-post:nth-child(3) { animation-delay: 0.6s; --rotation: -1deg; }
.micro-post:nth-child(4) { animation-delay: 0.2s; --rotation: 2.2deg; }
.micro-post:nth-child(5) { animation-delay: 0.4s; --rotation: -1.8deg; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(var(--rotation, 0deg)); }
  50% { transform: translateY(-8px) rotate(var(--rotation, 0deg)); }
}

.micro-post:hover {
  animation-play-state: paused;
  background-color: var(--bg-tertiary);
}

.micro-post-older {
  animation: none !important;
  margin-bottom: 0;
}

.micro-post-older:hover {
  animation-play-state: running !important;
  background-color: var(--bg-secondary);
}

.micro-content {
  color: var(--text-primary);
  margin-bottom: var(--sp-md);
  line-height: 1.8;
}

.micro-date {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===== HOMEPAGE ===== */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: var(--sp-2xl) var(--sp-lg);
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: var(--sp-lg);
  line-height: 1.1;
}

.accent-gradient {
  display: block;
  margin-bottom: var(--sp-lg);
}

.hero-subtitle {
  font-size: 1.3rem;
  color: var(--text-secondary);
  margin-bottom: var(--sp-2xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== COLLECTION ITEMS ===== */
.collection-list-item h2 {
  margin-top: 0;
  margin-bottom: var(--sp-md);
}

.collection-list-item h3 {
  margin-top: 0;
  color: var(--accent-primary);
}

.item-meta {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: var(--sp-md);
}

.intro-text {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* ===== HOMEPAGE TWO-COLUMN LAYOUT ===== */
.two-column-section {
  margin-top: var(--sp-2xl);
}

.two-column-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-2xl);
}

.two-column-grid h2 {
  margin-top: 0;
}

/* ===== ABOUT PAGE ===== */
.about-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--sp-lg);
}

.about-section h2 {
  margin-top: var(--sp-2xl);
}

/* ===== MICROBLOG PAGE ===== */
.recent-microblog {
  margin-top: var(--sp-2xl);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.older-posts-section {
  margin-top: var(--sp-3xl);
}

.older-posts-section > div {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-lg);
  margin-top: var(--sp-lg);
}

/* ===== CHAPTER & WRITING ===== */
.chapters-list {
  list-style: decimal;
  margin-left: 2rem;
  margin-top: var(--sp-lg);
  margin-bottom: var(--sp-2xl);
}

.chapters-list li {
  margin-bottom: var(--sp-md);
  line-height: 1.6;
}

.chapters-list a {
  color: var(--accent-primary);
  text-decoration: none;
}

.chapters-list a:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}

.chapter-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: var(--sp-2xl) 0 var(--sp-lg);
  padding: var(--sp-lg);
}

.chapter-nav a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
}

.chapter-nav a:hover {
  color: var(--accent-secondary);
}

.chapter-nav-return {
  text-align: center;
  margin-top: var(--sp-2xl);
}

.chapter-nav-return a {
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 0.95rem;
}

.chapter-nav-return a:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}

.collection-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ===== HIGHLIGHTS ===== */
.highlight {
  background-color: var(--accent-tertiary);
  color: var(--bg-primary);
  border-radius: 3px;
  cursor: pointer;
}

.highlight:hover {
  background-color: var(--accent-secondary);
}

.highlight-note {
  display: block;
  border-left: 3px solid var(--bg-primary);
  background: var(--accent-tertiary);
  color: var(--bg-primary);
  margin-top: 0.5rem;
  padding: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.highlight-note[hidden] {
  display: none;
}

/* ===== YOUTUBE PLAYER ===== */
.youtube-player-wrapper {
  margin: var(--sp-lg) 0;
}

.youtube-player {
  position: relative;
  width: 250px;
  height: 50px;
  margin: 0 auto var(--sp-md);
  overflow: hidden;
  border-radius: 8px;
}

.player-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  z-index: 10;
  pointer-events: none;
}

.youtube-player iframe {
  display: block;
  width: 250px;
  height: 200px;
  position: absolute;
  bottom: 0;
}

.youtube-caption {
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-align: center;
  margin: 0;
  padding: 0 var(--sp-sm);
  font-style: italic;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  :root {
    --sidebar-width: 100%;
  }

  .nav-links {
    flex-wrap: wrap;
  }

  .main-content {
    padding: 2%;
  }

  .sidebar-nav {
    width: 100%;
    height: auto;
    position: relative;
    padding: var(--sp-md);
  }

  .sidebar-links {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--sp-md);
  }

  .sidebar-content-wrapper {
    margin-left: 0;
    width: 100%;
  }

  h1 {
    font-size: 2.5rem;
  }

  .two-column-grid {
    grid-template-columns: 1fr;
    gap: var(--sp-md);
  }
}

