/* ==========================================
   MINIMALIST PERSONAL BLOG DESIGN SYSTEM
   ========================================== */

:root {
  /* Light Theme Palette */
  --bg-primary: #ffffff;
  --bg-secondary: #fafafa;
  --bg-subtle: #f3f4f6;
  --bg-glass: rgba(255, 255, 255, 0.85);

  --text-main: #111827;
  --text-muted: #6b7280;
  --text-light: #9ca3af;

  --accent-color: #111827;
  --accent-hover: #374151;
  --accent-tag-bg: #f3f4f6;

  --color-border: #e5e7eb;
  --color-border-light: #f3f4f6;
  --card-bg: #ffffff;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Pretendard Variable", Pretendard, "Noto Sans KR", sans-serif;
  --font-serif: Georgia, Cambria, "Times New Roman", Times, serif;

  /* Spacing */
  --nav-height: 72px;
  --container-max-width: 860px;
  --post-reading-width: 720px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* ==========================================
   DARK SKIN THEME OVERRIDES
   ========================================== */

html[data-theme="dark"] {
  --bg-primary: #09090b;
  --bg-secondary: #121215;
  --bg-subtle: #1f1f23;
  --bg-glass: rgba(9, 9, 11, 0.85);

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-light: #6b7280;

  --accent-color: #f3f4f6;
  --accent-hover: #e5e7eb;
  --accent-tag-bg: #1f1f23;

  --color-border: #27272a;
  --color-border-light: #1f1f23;
  --card-bg: #121215;
}

/* Dark mode specific form and element tweaks */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background-color: #121215 !important;
  color: #f3f4f6 !important;
  border-color: #27272a !important;
}

html[data-theme="dark"] .search-modal-card {
  background-color: #121215;
  border-color: #27272a;
}

html[data-theme="dark"] .search-input {
  color: #f3f4f6;
}

html[data-theme="dark"] .kbd-shortcut {
  background-color: #1f1f23;
  color: #9ca3af;
  border-color: #27272a;
}

html[data-theme="dark"] .editor-toolbar {
  background-color: #18181b;
  border-color: #27272a;
}

html[data-theme="dark"] .editor-btn {
  background-color: #27272a;
  color: #f3f4f6;
  border-color: #3f3f46;
}

html[data-theme="dark"] .post-detail-body blockquote {
  background-color: #18181b;
  color: #d1d5db;
  border-left-color: #f3f4f6;
}

html[data-theme="dark"] .post-detail-body code {
  background-color: #27272a;
  color: #f3f4f6;
}

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--text-main);
  background-color: var(--bg-primary);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.7;
  background-color: var(--bg-primary);
  color: var(--text-main);
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

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

/* App Wrapper */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Container Utility */
.site-container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.reading-container {
  width: 100%;
  max-width: var(--post-reading-width);
  margin: 0 auto;
}

/* ==========================================
   HEADER & NAVIGATION
   ========================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background-color: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border-light);
  transition: border-color var(--transition-normal), background-color var(--transition-normal);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-main);
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-logo span.logo-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background-color: var(--text-main);
  border-radius: 50%;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  font-size: 0.925rem;
  font-weight: 400;
  color: var(--text-muted);
  position: relative;
  padding: 4px 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-main);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--text-main);
  border-radius: 1px;
}

.theme-toggle-btn {
  font-size: 1.1rem;
  padding: 6px 10px;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background-color: var(--bg-secondary);
  color: var(--text-main);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle-btn:hover {
  border-color: var(--text-main);
  transform: scale(1.05);
}

.nav-search-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.875rem;
  color: var(--text-muted);
  background-color: var(--bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  transition: all var(--transition-fast);
}

.nav-search-btn:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
}

.kbd-shortcut {
  font-size: 0.725rem;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 4px;
  background-color: var(--bg-primary);
  border: 1px solid var(--color-border);
  color: var(--text-muted);
}

/* Mobile Hamburger Button */
.mobile-toggle {
  display: none;
  font-size: 1.25rem;
  color: var(--text-main);
  padding: 8px;
}

/* ==========================================
   MAIN CONTENT AREA
   ========================================== */

.main-content {
  flex: 1;
  padding-top: 48px;
  padding-bottom: 80px;
  animation: fadeIn 0.3s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
   HOME VIEW
   ========================================== */

.hero-intro {
  padding: 36px 0 60px 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 48px;
}

.hero-eyebrow {
  font-size: 0.825rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--text-main);
  margin-bottom: 16px;
}

.hero-description {
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--text-muted);
  max-width: 540px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* ==========================================
   POST ITEM LIST (Minimal Divider Lines)
   ========================================== */

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

.post-item {
  padding: 32px 0;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background-color var(--transition-fast);
}

.post-item:first-child {
  padding-top: 8px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.post-category-tag {
  font-size: 0.775rem;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 12px;
  background-color: var(--accent-tag-bg);
  color: var(--text-main);
  border: 1px solid var(--color-border);
  transition: background-color var(--transition-fast);
}

.post-category-tag:hover {
  background-color: var(--color-border);
}

.post-title {
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
  color: var(--text-main);
}

.post-title a {
  background-image: linear-gradient(var(--text-main), var(--text-main));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  transition: background-size 0.3s ease;
}

.post-title a:hover {
  background-size: 100% 1px;
}

.post-excerpt {
  font-size: 0.975rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-read-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
  margin-top: 8px;
}

.post-read-more:hover {
  gap: 8px;
}

/* ==========================================
   POST DETAIL VIEW & RICH MEDIA STYLES
   ========================================== */

.post-detail-header {
  padding-bottom: 32px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 40px;
}

.post-detail-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.post-detail-title {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.3;
  color: var(--text-main);
}

.post-detail-body {
  font-size: 1.075rem;
  line-height: 1.85;
  color: var(--text-main);
}

.post-detail-body p {
  margin-bottom: 24px;
}

/* Post Images & Media */
.post-detail-body img {
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 28px 0;
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.post-detail-body figure {
  margin: 32px 0;
  text-align: center;
}

.post-detail-body figcaption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Responsive Videos */
.post-detail-body video {
  width: 100%;
  max-width: 100%;
  border-radius: 8px;
  margin: 28px 0;
  border: 1px solid var(--color-border);
}

.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  max-width: 100%;
  margin: 32px 0;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

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

.post-detail-body h2 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 44px;
  margin-bottom: 18px;
  color: var(--text-main);
}

.post-detail-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 14px;
  color: var(--text-main);
}

.post-detail-body blockquote {
  padding: 16px 24px;
  margin: 28px 0;
  border-left: 3px solid var(--text-main);
  background-color: var(--bg-secondary);
  font-style: italic;
  color: var(--text-main);
}

.post-detail-body code {
  font-family: monospace;
  font-size: 0.9em;
  background-color: var(--bg-subtle);
  padding: 2px 6px;
  border-radius: 4px;
}

.post-detail-footer {
  margin-top: 60px;
  padding-top: 32px;
  border-top: 1px solid var(--color-border);
}

.back-to-list-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 32px;
  padding: 8px 16px;
  border-radius: 20px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--color-border);
  transition: all var(--transition-fast);
}

.back-to-list-btn:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
}

.post-pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.post-nav-card {
  padding: 20px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.post-nav-card:hover {
  border-color: var(--text-main);
  background-color: var(--bg-secondary);
}

.post-nav-label {
  font-size: 0.775rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.post-nav-title {
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================
   EDITOR MEDIA TOOLBAR STYLES
   ========================================== */

.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--color-border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
}

.editor-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  background-color: var(--bg-primary);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  transition: all var(--transition-fast);
}

.editor-btn:hover {
  background-color: var(--bg-subtle);
  border-color: var(--text-muted);
}

/* ==========================================
   ABOUT VIEW
   ========================================== */

.about-wrapper {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.about-header {
  display: flex;
  align-items: center;
  gap: 32px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--color-border);
}

.about-avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--color-border);
  background-color: var(--bg-subtle);
  flex-shrink: 0;
}

.about-name {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.about-tagline {
  font-size: 1.05rem;
  color: var(--text-muted);
}

.about-section-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-main);
}

.about-text {
  font-size: 1.025rem;
  line-height: 1.8;
  color: var(--text-main);
}

.about-text p {
  margin-bottom: 16px;
}

.about-links {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}

.about-social-link {
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background-color: var(--bg-secondary);
  transition: all var(--transition-fast);
}

.about-social-link:hover {
  border-color: var(--text-main);
  background-color: var(--text-main);
  color: var(--bg-primary);
}

/* ==========================================
   CATEGORIES VIEW
   ========================================== */

.category-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

.category-chip {
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 24px;
  border: 1px solid var(--color-border);
  background-color: var(--bg-secondary);
  color: var(--text-muted);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.category-chip:hover,
.category-chip.active {
  color: var(--bg-primary);
  background-color: var(--text-main);
  border-color: var(--text-main);
}

.category-count {
  font-size: 0.775rem;
  opacity: 0.7;
}

/* ==========================================
   ARCHIVE VIEW
   ========================================== */

.archive-year-group {
  margin-bottom: 48px;
}

.archive-year-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--text-main);
  margin-bottom: 24px;
}

.archive-month-group {
  margin-bottom: 28px;
  padding-left: 8px;
}

.archive-month-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.archive-item {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--color-border);
}

.archive-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  width: 60px;
  flex-shrink: 0;
}

.archive-title {
  font-size: 1rem;
  font-weight: 500;
}

.archive-title:hover {
  text-decoration: underline;
}

/* ==========================================
   SEARCH MODAL
   ========================================== */

.search-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
  animation: fadeIn 0.2s ease-out;
}

.search-modal-card {
  width: 100%;
  max-width: 640px;
  background-color: var(--bg-primary);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.search-input-header {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  gap: 12px;
}

.search-icon {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1.1rem;
  font-family: inherit;
  color: var(--text-main);
  background: transparent;
}

.search-close-btn {
  font-size: 1rem;
  color: var(--text-muted);
  padding: 4px;
}

.search-results-list {
  max-height: 400px;
  overflow-y: auto;
  padding: 12px;
}

.search-result-item {
  padding: 12px 16px;
  border-radius: 8px;
  transition: background-color var(--transition-fast);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-result-item:hover {
  background-color: var(--bg-secondary);
}

.search-result-title {
  font-size: 1rem;
  font-weight: 600;
}

.search-result-excerpt {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ==========================================
   FOOTER
   ========================================== */

.site-footer {
  border-top: 1px solid var(--color-border-light);
  padding: 40px 0;
  margin-top: auto;
  background-color: var(--bg-secondary);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ==========================================
   RESPONSIVE DESIGN BREAKPOINTS
   ========================================== */

@media (max-width: 640px) {
  :root {
    --nav-height: 64px;
  }

  .site-container {
    padding: 0 18px;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    background: var(--bg-primary);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 24px;
    gap: 16px;
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
  }

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

  .mobile-toggle {
    display: block;
  }

  .hero-title {
    font-size: 1.85rem;
  }

  .post-title {
    font-size: 1.25rem;
  }

  .post-detail-title {
    font-size: 1.65rem;
  }

  .post-pagination {
    grid-template-columns: 1fr;
  }

  .about-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .search-modal-backdrop {
    padding-top: 20px;
    padding-left: 12px;
    padding-right: 12px;
  }
}
