/* ========================================
   Mimilog Blog - Flat + Deco Style
   (랜딩페이지와 일관성 유지)
   ======================================== */

/* Fonts - HTML <head>에서 preload로 로드 */

:root {
  /* 랜딩페이지 색상 시스템 */
  --bg-cream: #F8F5E6;
  --bg-white: #FFF;
  --card-bg: #FDFBF7;
  --border-dark: #333;
  --border-light: #ddd;

  --text-primary: #222;
  --text-secondary: #666;
  --text-muted: #888;

  /* Deco Colors */
  --tape-yellow: #fff3b0;
  --tape-pink: #ffd6e0;
  --tape-mint: #c8f7dc;
  --tape-blue: #d0e8ff;
  --sticker-coral: #ff8a80;
  --sticker-yellow: #ffe082;
  --highlight-yellow: #fff59d;
  --highlight-pink: #f8bbd9;

  /* Mimilog Brand */
  --brand-coral: #ff6b6b;
  --brand-warm: #ff8a65;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Nanum Myeongjo', 'Noto Serif', serif;
  background: linear-gradient(135deg, #F8F5E6 0%, #FFF 100%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ========================================
   Container - 크림색 배경 + 라인노트
   ======================================== */
.notebook {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  /* 라인노트 효과 - 전체 영역 */
  line-height: 2;
  background-image: repeating-linear-gradient(
    transparent,
    transparent calc(2em - 1px),
    #ddd calc(2em - 1px),
    #ddd 2em
  );
  background-size: 100% 2em;
  background-position: 0 0.5em;
  position: relative;
}

.notebook-content {
  padding: 40px 20px;
}

/* ========================================
   Header / Navigation
   ======================================== */
.blog-header {
  padding: var(--space-md) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1.5px solid var(--border-dark);
  margin-bottom: var(--space-lg);
  background: linear-gradient(135deg, #F8F5E6 0%, #FFF 100%);
}

.blog-logo {
  font-family: 'Playwrite ZA', cursive;
  font-size: 1.6rem;
  font-weight: 100;
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-logo:hover {
  color: var(--brand-coral);
}

.blog-nav {
  display: flex;
  gap: var(--space-md);
}

.blog-nav a {
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 4px 12px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.blog-nav a:hover {
  background: var(--tape-yellow);
  color: var(--text-primary);
}

/* Active state - 현재 페이지 표시 */
.blog-nav a.active {
  color: var(--text-primary);
  font-weight: 600;
  background: var(--tape-yellow);
}

/* Pressed state - 클릭 시 */
.blog-nav a:active {
  transform: scale(0.95);
  background: #e8e0a8;
}

/* ========================================
   Decorative Elements (Deco/다꾸)
   ======================================== */

/* Masking Tape */
.tape {
  position: absolute;
  height: 24px;
  opacity: 0.85;
}

.tape-yellow { background: var(--tape-yellow); }
.tape-pink { background: var(--tape-pink); }
.tape-mint { background: var(--tape-mint); }
.tape-blue { background: var(--tape-blue); }

.tape-top-left {
  top: -8px;
  left: 16px;
  width: 70px;
  transform: rotate(-12deg);
}

.tape-top-right {
  top: -8px;
  right: 16px;
  width: 50px;
  transform: rotate(10deg);
}

/* Sticky Notes / Post-it */
.sticky-note {
  background: var(--sticker-yellow);
  padding: var(--space-md);
  font-family: 'Gaegu', cursive;
  font-size: 1.1rem;
  border: 1px solid rgba(0,0,0,0.08);
  transform: rotate(1deg);
  position: relative;
}

.sticky-note.pink { background: var(--tape-pink); }
.sticky-note.mint { background: var(--tape-mint); }
.sticky-note.blue { background: var(--tape-blue); }

/* Sticker */
.sticker {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 50px;
  font-family: 'Gaegu', cursive;
  font-weight: 700;
  font-size: 0.85rem;
}

.sticker-coral {
  background: var(--sticker-coral);
  color: white;
}

.sticker-yellow {
  background: var(--sticker-yellow);
  color: var(--text-primary);
}

/* Highlight marker effect */
.highlight {
  background: linear-gradient(180deg, transparent 60%, var(--highlight-yellow) 60%);
  padding: 0 4px;
}

.highlight-pink {
  background: linear-gradient(180deg, transparent 60%, var(--highlight-pink) 60%);
}

/* Handwritten underline */
.underline-hand {
  position: relative;
}

.underline-hand::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 3px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 10'%3E%3Cpath d='M0,5 Q25,0 50,5 T100,5' stroke='%23ff6b6b' stroke-width='2' fill='none'/%3E%3C/svg%3E") repeat-x;
  background-size: 100px 10px;
}

/* Photo frame - flat style */
.photo-frame {
  background: white;
  padding: 10px 10px 30px 10px;
  border: 1.5px solid var(--border-dark);
  margin: var(--space-lg) 0;
}

.photo-frame img {
  width: 100%;
  display: block;
}

.photo-frame .caption {
  font-family: 'Gaegu', cursive;
  font-size: 1.3rem;
  text-align: center;
  margin-top: 10px;
  color: var(--text-secondary);
}

/* Sketch Wrapper - Transparent background */
.sketch-wrapper {
  text-align: center;
  margin: var(--space-lg) 0;
  padding: 10px;
}

.sketch-wrapper img {
  max-width: 100%;
  height: auto;
  display: inline-block;
  opacity: 0.9; /* 약간 자연스럽게 */
  mix-blend-mode: multiply; /* 배경과 자연스럽게 섞이게 */
}

.sketch-wrapper .caption {
  font-family: 'Gaegu', cursive;
  font-size: 1.3rem;
  text-align: center;
  margin-top: 0;
  color: var(--text-secondary);
}

/* ========================================
   Typography
   ======================================== */
.handwritten {
  font-family: 'Nanum Pen Script', cursive;
}

.handwritten-alt {
  font-family: 'Gaegu', cursive;
}

h1, h2, h3 {
  font-family: 'Nanum Myeongjo', serif;
  font-weight: 700;
  line-height: 1.4;
}

.post-title {
  font-size: 2rem;
  margin-bottom: var(--space-md);
  position: relative;
  display: inline-block;
}

.post-subtitle {
  font-family: 'Gaegu', cursive;
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

/* ========================================
   Quote Box - flat style
   ======================================== */
.quote-box {
  position: relative;
  margin: var(--space-xl) 0;
  padding: var(--space-lg);
  background: var(--card-bg);
  border: 1.5px solid var(--border-dark);
  border-left: 4px solid var(--brand-coral);
}

.quote-box::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 15px;
  font-size: 3rem;
  font-family: Georgia, serif;
  color: var(--brand-coral);
  opacity: 0.5;
  line-height: 1;
}

.quote-text {
  font-size: 1.15rem;
  font-style: italic;
  margin-bottom: var(--space-sm);
}

.quote-author {
  font-family: 'Gaegu', cursive;
  font-size: 1rem;
  color: var(--text-secondary);
  text-align: right;
}

/* ========================================
   Post Header
   ======================================== */
.post-header {
  margin-bottom: var(--space-xl);
  border-bottom: 1.5px solid var(--border-dark);
  padding-bottom: var(--space-lg);
}

.post-header h1 {
  font-size: 1.8rem;
  margin-bottom: 0;
  display: inline;
  background: linear-gradient(180deg, transparent 60%, #e0e0e0 60%);
}

.post-date {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

/* ========================================
   Content Sections
   ======================================== */
.content-section {
  margin: var(--space-xl) 0;
}

.content-section h2 {
  font-size: 1.3rem;
  margin-bottom: var(--space-md);
  display: inline-block;
  background: linear-gradient(180deg, transparent 60%, #e0e0e0 60%);
}

.content-section p {
  margin-bottom: var(--space-md);
  line-height: 2;
}

/* Quote */
.quote {
  font-style: italic;
  color: var(--text-secondary);
  background: linear-gradient(180deg, transparent 60%, #fff59d 60%);
  display: inline;
}

.quote-author {
  display: block;
  margin-top: 0.5em;
  font-style: normal;
  font-size: 1.2rem;
  color: var(--text-muted);
}

.author-bio {
  display: block;
  margin-top: 0.3em;
  font-style: normal;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: none;
}

/* App Download */
.app-download p {
  text-align: center;
}

.app-download a {
  color: var(--text-primary);
  text-decoration: none;
  padding: 8px 16px;
  border: 1.5px solid var(--border-dark);
  border-radius: 4px;
  transition: all 0.2s ease;
  display: inline-block;
  margin: 4px;
}

.app-download a:hover {
  background: var(--border-dark);
  color: white;
}

/* ========================================
   Post Footer
   ======================================== */
.post-footer {
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-light);
}

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

.post-footer a:hover {
  color: var(--text-primary);
}

/* Deco divider */
.deco-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin: var(--space-xl) 0;
  color: var(--text-muted);
}

.deco-divider::before,
.deco-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeInUp 0.6s ease-out forwards;
}

/* Scroll-triggered animations */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease-out;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   Blog List Page
   ======================================== */
.blog-list {
  display: grid;
  gap: var(--space-lg);
}

.blog-card {
  background: var(--card-bg);
  padding: var(--space-lg);
  border: 1.5px solid var(--border-dark);
  border-radius: 8px;
  position: relative;
  transition: transform 0.2s ease, background 0.2s ease;
  cursor: pointer;
}

.blog-card:hover {
  transform: translateY(-3px);
  background: white;
}

/* 카드 전체 클릭 가능 */
.blog-card-title a::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.blog-card-title {
  font-size: 1.3rem;
  margin-bottom: var(--space-sm);
}

.blog-card-title a {
  color: var(--text-primary);
  text-decoration: none;
}

.blog-card-title a:hover {
  color: #1a365d;
}

.blog-card-date {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

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

/* ========================================
   Footer (홈페이지와 동일)
   ======================================== */
.blog-footer {
  margin-top: var(--space-xl);
  padding: var(--space-lg) 0;
  border-top: 1.5px solid var(--border-dark);
  text-align: center;
  background: linear-gradient(135deg, #F8F5E6 0%, #FFF 100%);
}

.blog-footer .footer-nav {
  margin-bottom: 16px;
}

.blog-footer .footer-nav a {
  color: #666;
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.blog-footer .footer-nav a:hover {
  background: #f5f5f5;
  border-color: #ccc;
  color: #333;
}

.blog-footer p {
  font-size: 16px;
  color: var(--text-muted);
}

.blog-footer .contact {
  margin-top: 4px;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
  .notebook {
    border-left: none;
    border-right: none;
  }

  .notebook-content {
    padding: var(--space-lg) var(--space-md);
  }

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

  .blog-header {
    flex-direction: column;
    gap: var(--space-sm);
  }
}

/* ========================================
   Utilities
   ======================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.relative { position: relative; }
.inline-block { display: inline-block; }

/* ========================================
   Language Dropdown (홈페이지와 동일)
   ======================================== */
.lang-dropdown {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  color: #333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.2s;
}

.lang-btn:hover {
  border-color: #bbb;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.lang-icon {
  width: 16px;
  height: 16px;
  stroke: #666;
  stroke-width: 2;
}

.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  min-width: 160px;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.lang-dropdown:hover .lang-menu,
.lang-dropdown:focus-within .lang-menu {
  display: block;
}

.lang-menu a {
  display: block;
  padding: 10px 16px;
  text-decoration: none;
  color: #333;
  font-size: 14px;
  transition: background 0.15s;
}

.lang-menu a:first-child {
  border-radius: 7px 7px 0 0;
}

.lang-menu a:last-child {
  border-radius: 0 0 7px 7px;
}

.lang-menu a:hover {
  background: #f5f5f5;
}

.lang-menu a.active {
  background: #F8F5E6;
  font-weight: 600;
}

/* ========================================
   Category Badge
   ======================================== */
.blog-card-meta {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-xs);
}

.category-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 4px;
  margin-right: 8px;
}

.category-essay {
  background: #ffd6e0;
  color: #9c4d61;
}

.category-qna {
  background: #c8f7dc;
  color: #3d7a57;
}

.category-language-tips {
  background: #ffe082;
  color: #8a6d1b;
}

/* ========================================
   Category Filter Chips
   ======================================== */
.category-filter {
  display: flex;
  gap: 8px;
  margin-bottom: var(--space-lg);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: none;  /* Firefox */
}

.category-filter::-webkit-scrollbar {
  display: none;  /* Chrome, Safari */
}

.filter-chip {
  padding: 6px 14px;
  font-size: 0.9rem;
  border: 1.5px solid var(--border-dark);
  border-radius: 20px;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  font-family: inherit;
}

.filter-chip:hover {
  background: var(--card-bg);
}

.filter-chip.active {
  background: var(--border-dark);
  color: white;
}

.filter-chip[data-filter="essay"].active {
  background: #ffd6e0;
  color: #9c4d61;
  border-color: #ffd6e0;
}

.filter-chip[data-filter="qna"].active {
  background: #c8f7dc;
  color: #3d7a57;
  border-color: #c8f7dc;
}

.filter-chip[data-filter="language-tips"].active {
  background: #ffe082;
  color: #8a6d1b;
  border-color: #ffe082;
}

.blog-card.hidden {
  display: none;
}

/* ========================================
   Responsive - Language Dropdown
   ======================================== */
@media (max-width: 480px) {
  .lang-dropdown {
    top: 12px;
    right: 12px;
  }

  .lang-btn {
    padding: 6px 10px;
    font-size: 13px;
  }

  .lang-menu {
    max-height: 280px;
  }
}
