/* ===== CUTPLE BLOG THEME - CARAT.IM CLONE ===== */

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

:root {
  --font-main: 'Pretendard Variable', Pretendard, -apple-system, system-ui, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --color-text: #09090b;
  --color-text-2: rgba(55, 53, 47, 0.65);
  --color-text-3: rgba(55, 53, 47, 0.4);
  --color-bg: #ffffff;
  --color-border: #e5e5e5;
  --color-surface: #f4f4f5;
  --max-width: 1200px;
  --content-width: 720px;
}

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

body {
  font-family: var(--font-main);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
  height: 56px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-logo {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.header-divider {
  color: var(--color-text-3);
  font-weight: 300;
}

.header-blog-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-2);
}

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

.header-nav ul {
  display: flex;
  list-style: none;
  gap: 24px;
}

.header-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-2);
  transition: color 0.15s;
}

.header-nav a:hover {
  color: var(--color-text);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-2);
  padding: 4px;
  transition: color 0.15s;
}

.search-btn:hover {
  color: var(--color-text);
}

/* ===== HERO SECTION ===== */
.hero-section {
  text-align: center;
  padding: 64px 40px 32px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.hero-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.03em;
  line-height: 1.3;
  margin-bottom: 12px;
}

.hero-description {
  font-size: 16px;
  color: var(--color-text-2);
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto;
}

/* ===== TAG FILTER PILLS ===== */
.tag-filters {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: var(--max-width);
  margin: 0 auto 40px;
  padding: 0 40px;
}

.tag-pill {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  color: var(--color-text-2);
  background: transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.tag-pill:hover,
.tag-pill.active {
  background: var(--color-text);
  color: #fff;
  border-color: var(--color-text);
}

/* ===== POST FEED GRID ===== */
.post-feed {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px 60px;
}

@media (max-width: 1024px) {
  .post-feed {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (max-width: 640px) {
  .post-feed {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 0 20px 40px;
  }
  .hero-section { padding: 40px 20px 24px; }
  .tag-filters { padding: 0 20px; margin-bottom: 24px; }
  .header-inner { padding: 0 20px; }
}

/* ===== FEATURED FIRST CARD (large) ===== */
.post-card.first-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 32px;
}

.post-card.first-card .post-card-image {
  aspect-ratio: 16/10;
  margin-bottom: 0;
}

.post-card.first-card .post-card-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.post-card.first-card .post-card-title {
  font-size: 28px;
  -webkit-line-clamp: 3;
}

.post-card.first-card .post-card-excerpt {
  font-size: 15px;
  -webkit-line-clamp: 3;
}

@media (max-width: 768px) {
  .post-card.first-card {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .post-card.first-card .post-card-title {
    font-size: 22px;
  }
}

/* ===== POST CARD ===== */
.post-card {
  transition: transform 0.2s;
}

.post-card:hover {
  transform: translateY(-3px);
}

.post-card-link {
  display: block;
}

.post-card-image {
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/10;
  margin-bottom: 16px;
  background: var(--color-surface);
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.post-card:hover .post-card-image img {
  transform: scale(1.03);
}

.post-card-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.45;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-excerpt {
  font-size: 14px;
  color: var(--color-text-2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--color-text-3);
}

.post-card-tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-2);
  background: var(--color-surface);
  padding: 2px 8px;
  border-radius: 4px;
}

/* ===== LOAD MORE ===== */
.load-more {
  text-align: center;
  padding: 0 40px 60px;
}

.load-more-btn {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 12px 36px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text);
  transition: all 0.2s;
}

.load-more-btn:hover {
  background: var(--color-text);
  color: #fff;
  border-color: var(--color-text);
}

/* ===== ARTICLE (POST PAGE) ===== */
.article {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 20px;
}

.article-header {
  padding: 48px 0 24px;
}

.article-tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-surface);
  padding: 4px 12px;
  border-radius: 4px;
  margin-bottom: 16px;
}

.article-title {
  font-size: 42px;
  font-weight: 700;
  color: #292929;
  line-height: 1.3;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

@media (max-width: 640px) {
  .article-title { font-size: 28px; }
}

.article-excerpt {
  font-size: 18px;
  color: var(--color-text-2);
  line-height: 1.6;
  margin-bottom: 24px;
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--color-text-3);
  padding-bottom: 24px;
}

.article-share {
  display: flex;
  gap: 12px;
  align-items: center;
}

.article-share a,
.article-share button {
  color: var(--color-text-3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  transition: color 0.15s;
  display: flex;
  align-items: center;
}

.article-share a:hover,
.article-share button:hover {
  color: var(--color-text);
}

/* Article Image */
.article-image {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 48px;
}

.article-image img {
  width: 100%;
  border-radius: 12px;
}

/* ===== ARTICLE CONTENT ===== */
.article-content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--color-text);
}

.article-content h2 {
  font-size: 28px;
  font-weight: 600;
  color: var(--color-text);
  margin-top: 56px;
  margin-bottom: 16px;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.article-content h3 {
  font-size: 22px;
  font-weight: 600;
  margin-top: 40px;
  margin-bottom: 12px;
  line-height: 1.4;
}

.article-content p {
  margin-bottom: 24px;
}

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

.article-content li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.article-content a {
  color: #0066cc;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-content a:hover {
  color: #004499;
}

.article-content blockquote {
  border-left: 3px solid var(--color-text);
  padding-left: 20px;
  margin: 32px 0;
  color: var(--color-text-2);
  font-style: normal;
}

.article-content img {
  border-radius: 8px;
  margin: 32px 0;
}

.article-content figure {
  margin: 32px 0;
}

.article-content figcaption {
  text-align: center;
  font-size: 13px;
  color: var(--color-text-3);
  margin-top: 8px;
}

.article-content pre {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: 8px;
  padding: 20px;
  overflow-x: auto;
  margin: 24px 0;
  font-size: 14px;
  line-height: 1.6;
}

.article-content code {
  background: var(--color-surface);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

.article-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

.article-content hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 48px 0;
}

/* Ghost specific content cards */
.kg-card {
  margin: 32px 0;
}

.kg-image-card img,
.kg-gallery-image img {
  border-radius: 8px;
}

.kg-bookmark-card {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}

.kg-bookmark-container {
  display: flex;
  text-decoration: none;
  color: inherit;
}

.kg-bookmark-content {
  flex: 1;
  padding: 20px;
}

.kg-bookmark-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.kg-bookmark-description {
  font-size: 13px;
  color: var(--color-text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.kg-bookmark-thumbnail {
  width: 180px;
}

.kg-bookmark-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

/* ===== SUBSCRIBE BOX ===== */
.article-subscribe {
  background: var(--color-surface);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  margin: 48px 0;
}

.article-subscribe h3 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 20px;
}

.article-subscribe form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 360px;
  margin: 0 auto;
}

.article-subscribe label {
  font-size: 13px;
  color: var(--color-text-2);
  align-self: flex-start;
}

.article-subscribe input[type="email"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 14px;
  font-family: var(--font-main);
  outline: none;
  transition: border-color 0.15s;
}

.article-subscribe input[type="email"]:focus {
  border-color: var(--color-text);
}

.article-subscribe button[type="submit"] {
  width: 100%;
  padding: 10px 24px;
  background: var(--color-text);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-main);
  cursor: pointer;
  transition: opacity 0.15s;
}

.article-subscribe button[type="submit"]:hover {
  opacity: 0.85;
}

/* ===== READ NEXT / RELATED POSTS ===== */
.read-next {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 40px 60px;
  border-top: 1px solid var(--color-border);
}

.read-next-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 24px;
}

.read-next-header a {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-2);
  transition: color 0.15s;
}

.read-next-header a:hover {
  color: var(--color-text);
}

.read-next-feed {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.read-next-card {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
}

.read-next-card:last-child {
  border-bottom: none;
}

.read-next-card a {
  display: block;
}

.read-next-card h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
  line-height: 1.4;
}

.read-next-card p {
  font-size: 14px;
  color: var(--color-text-2);
  line-height: 1.5;
  margin-bottom: 8px;
}

.read-next-card time {
  font-size: 13px;
  color: var(--color-text-3);
}

/* ===== FOOTER ===== */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 32px 0;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 40px;
  font-size: 13px;
  color: var(--color-text-3);
}

.footer-text {
  font-weight: 500;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-links a {
  color: var(--color-text-3);
  transition: color 0.15s;
}

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

.footer-dot {
  font-size: 10px;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #d4d4d8;
  border-radius: 3px;
}

/* ===== GHOST PORTAL CLEANUP ===== */
.gh-portal-triggerbtn-container {
  display: none !important;
}

/* ===== SELECTION ===== */
::selection {
  background: rgba(9, 9, 11, 0.1);
}
