/* ===== CSS Variables ===== */
:root {
  --primary: #664bf4;
  --primary-rgb: 102, 75, 244;
  --gray04: #8d96a1;
  --gray06: #556372;
  --gray08: #3c4651;
  --gray10: #242a30;
  --gray10-rgb: 36, 42, 48;
  --white: #ffffff;
  --white-rgb: 255, 255, 255;
  --black: #000000;
  --surface-hover: #f9f9fb;
  --surface-thumbnail: #f5f5f7;
}

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

html {
  font-family:
    'Pretendard',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    sans-serif;
  color: var(--gray10);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  line-height: 1.7;
}

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

img {
  display: block;
}

/* ===== GNB (Global Navigation Bar) ===== */
.gnb {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(var(--white-rgb), 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.gnb--scrolled {
  border-bottom-color: rgba(var(--gray10-rgb), 0.06);
}

.gnb__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1212px;
  margin: 0 auto;
  padding: 16px 25px;
}

.gnb__title {
  display: flex;
  align-items: center;
  transition: opacity 0.2s ease;
}

.gnb__title:hover {
  opacity: 0.7;
}

.gnb__logo {
  height: 22px;
  width: auto;
  display: block;
}

.gnb__title:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  border-radius: 4px;
}

.gnb__home-button {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  background-color: rgba(var(--primary-rgb), 0.08);
  border-radius: 100px;
  letter-spacing: -0.01em;
  transition: background-color 0.2s ease;
}

.gnb__home-button:hover {
  background-color: rgba(var(--primary-rgb), 0.15);
}

.gnb__home-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ===== Post Detail ===== */
.post {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

.post__header {
  padding-top: 80px;
  padding-bottom: 16px;
  text-align: center;
}

.post__title {
  font-size: 48px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.03em;
  color: var(--gray10);
}

.post__meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.post__date {
  font-size: 17px;
  color: var(--gray06);
}

.post__author {
  font-size: 17px;
  color: var(--gray06);
}

.post__author::before {
  content: '·';
  margin-right: 6px;
}

.post__thumbnail {
  margin-top: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-thumbnail);
}

.post__thumbnail img {
  width: 100%;
  max-width: 720px;
  border-radius: 8px;
}

/* ===== Post Body ===== */
.post__body {
  margin-top: 32px;
  font-size: 17px;
  line-height: 1.8;
  color: var(--gray10);
  word-break: keep-all;
}

.post__body h2 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 48px;
  margin-bottom: 16px;
}

.post__body h3 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 32px;
  margin-bottom: 12px;
}

.post__body p {
  margin-bottom: 24px;
}

.post__body a {
  color: var(--primary);
  text-decoration: underline;
}

.post__body a:hover {
  color: #5538d4;
}

.post__body ul,
.post__body ol {
  padding-left: 24px;
  margin-bottom: 24px;
}

.post__body li {
  margin-bottom: 8px;
}

.post__body blockquote {
  border-left: 3px solid var(--primary);
  padding-left: 16px;
  color: var(--gray06);
  margin-bottom: 24px;
}

.post__body img {
  max-width: 100%;
  border-radius: 8px;
  margin: 24px 0;
}

.post__body strong {
  font-weight: 600;
}

.post__body code {
  background: rgba(var(--gray10-rgb), 0.04);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
}

/* ===== Table ===== */
.post__body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 14px;
  line-height: 1.6;
}

.post__body th,
.post__body td {
  border: 1px solid rgba(var(--gray10-rgb), 0.1);
  padding: 12px 16px;
  text-align: left;
}

.post__body th {
  background: rgba(var(--gray10-rgb), 0.03);
  font-weight: 600;
}

.post__body tr:hover {
  background: rgba(var(--gray10-rgb), 0.02);
}

/* ===== hr ===== */
.post__body hr {
  border: none;
  border-top: 1px solid rgba(var(--gray10-rgb), 0.1);
  margin: 48px 0;
}

/* ===== Copy Button ===== */
.post__copy-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  background-color: rgba(var(--primary-rgb), 0.08);
  border: none;
  border-radius: 100px;
  cursor: pointer;
  letter-spacing: -0.01em;
  font-family: inherit;
  transition: background-color 0.2s ease;
}

.post__copy-btn:hover {
  background-color: rgba(var(--primary-rgb), 0.15);
}

.post__copy-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.post__copy-btn--copied {
  color: #16a34a;
  background-color: rgba(22, 163, 74, 0.08);
}

.post__copy-btn--copied:hover {
  background-color: rgba(22, 163, 74, 0.15);
}

.post__header .post__copy-btn {
  margin-top: 16px;
}

/* ===== Floating Share ===== */
.post__share {
  display: block;
  position: fixed;
  bottom: 16px;
  right: 16px;
}

@media (min-width: 1000px) {
  .post__share {
    bottom: auto;
    left: auto;
    right: calc(50% - 428px);
  }
}

.post__share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: var(--white);
  border: 1px solid rgba(var(--gray10-rgb), 0.1);
  border-radius: 14px;
  cursor: pointer;
  color: var(--gray06);
  font-family: inherit;
  transition:
    background-color 0.2s,
    color 0.2s,
    border-color 0.2s;
}

.post__share-btn:hover {
  background-color: var(--surface-hover);
  color: var(--gray10);
}

.post__share-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.post__share-btn.post__copy-btn--copied {
  color: #16a34a;
  border-color: rgba(22, 163, 74, 0.3);
  background-color: rgba(22, 163, 74, 0.06);
}

/* ===== CTA Block ===== */
.post__cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  margin-top: 48px;
  margin-bottom: 96px;
  padding: 40px 32px;
  background: linear-gradient(
    135deg,
    rgba(var(--primary-rgb), 0.04),
    rgba(var(--primary-rgb), 0.08)
  );
  border: 1px solid rgba(var(--primary-rgb), 0.12);
  border-radius: 12px;
}

.post__cta-message {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--gray10);
}

.post__cta-button {
  display: inline-flex;
  align-items: center;
  padding: 12px 28px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--white);
  background-color: var(--primary);
  border-radius: 100px;
  letter-spacing: -0.01em;
  transition: background-color 0.2s ease;
}

.post__cta-button:hover {
  background-color: #5538d4;
}

.post__cta-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  padding: 12px 24px;
  background-color: var(--gray10);
  color: var(--white);
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    visibility 0.3s;
  z-index: 200;
}

.toast--visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ===== Footer ===== */
.footer {
  padding: 48px 0 40px;
  background: rgba(var(--gray10-rgb), 0.02);
}

.footer__inner {
  max-width: 1212px;
  margin: 0 auto;
  padding: 0 25px;
}

.footer__divider {
  display: none;
}

.footer__company {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  color: rgba(var(--gray10-rgb), 0.48);
  margin-bottom: 4px;
}

.footer__copyright {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  color: rgba(var(--gray10-rgb), 0.36);
}

/* ===== Blog Header (List Page) ===== */
.blog-header {
  max-width: 1212px;
  margin: 0 auto;
  padding: 48px 25px 32px;
}

.blog-header__title {
  font-size: 32px;
  font-weight: 700;
  color: var(--gray10);
}

.blog-header__description {
  font-size: 16px;
  color: rgba(var(--gray10-rgb), 0.76);
  margin-top: 8px;
}

/* ===== Post List (List Page) ===== */
.post-list {
  max-width: 1212px;
  margin: 0 auto;
  padding: 0 25px 120px;
}

.post-list__item {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px 16px;
  margin: 0 -16px;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s;
}

.post-list__item:hover {
  background-color: var(--surface-hover);
}

.post-list__item:hover .post-list__item-title {
  color: var(--primary);
}

.post-list__content {
  flex: 1;
  min-width: 0;
  margin-right: 100px;
}

.post-list__item-title {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.02em;
  color: var(--gray10);
  word-break: keep-all;
  transition: color 0.2s;
}

.post-list__item-description {
  font-size: 17px;
  color: rgba(var(--gray10-rgb), 0.56);
  margin-top: 8px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-list__item-date {
  font-size: 15px;
  color: var(--gray04);
  margin-top: 12px;
  display: block;
}

/* ===== Post List Thumbnail ===== */
.post-list__thumbnail {
  width: 220px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid rgba(var(--gray10-rgb), 0.1);
  background-color: var(--surface-thumbnail);
}

.post-list__thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== Responsive ===== */

/* 태블릿 */
@media (max-width: 768px) {
  .gnb__inner {
    padding: 12px 16px;
  }

  .post__title {
    font-size: 32px;
  }

  .gnb__title {
    font-size: 0.9375rem;
  }

  .gnb__home-button {
    padding: 6px 14px;
    font-size: 0.8125rem;
  }

  .post {
    padding: 0 20px;
  }

  .post__cta {
    padding: 32px 24px;
  }

  .post__cta-message {
    font-size: 15px;
  }

  .blog-header {
    padding: 36px 16px 24px;
  }

  .post-list {
    padding: 0 16px 80px;
  }

  .post-list__item {
    flex-direction: column;
    gap: 16px;
  }

  .post-list__content {
    margin-right: 0;
    order: 2;
  }

  .post-list__thumbnail {
    width: 100%;
    order: 1;
  }

  .footer__inner {
    padding: 0 20px;
  }
}

/* 모바일 */
@media (max-width: 375px) {
  .post {
    padding: 0 16px;
  }

  .post__title {
    font-size: 32px;
  }

  .post__header {
    padding-top: 32px;
  }

  .post__meta {
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  .post__author::before {
    content: none;
    margin-right: 0;
  }

  .post__cta {
    padding: 28px 20px;
  }

  .post__cta-message {
    font-size: 14px;
  }

  .toast {
    left: 16px;
    right: 16px;
    transform: translateX(0) translateY(16px);
  }

  .toast--visible {
    transform: translateX(0) translateY(0);
  }

  .post__body h2 {
    font-size: 20px;
  }

  .post__body h3 {
    font-size: 18px;
  }

  .blog-header {
    padding: 32px 16px 20px;
  }

  .blog-header__title {
    font-size: 24px;
  }

  .post-list {
    padding: 0 16px 60px;
  }

  .post-list__item-title {
    font-size: 20px;
  }

  .footer {
    padding: 32px 0 24px;
  }

  .footer__inner {
    padding: 0 16px;
  }
}
