/*
Theme Name: 3rdWriter Blog
Theme URI: https://blog.3rdwriter.io
Author: 3rdWriter
Description: 3rdWriter 공식 로고와 매체형 워드프레스 목록 구조를 적용한 블로그 테마.
Version: 2.2.0
License: GPL-2.0-or-later
Text Domain: rdwriter-blog
*/

:root {
  --ink: #0F1018;
  --ink-soft: #475064;
  --muted: #7A8190;
  --line: #ECEEF4;
  --paper: #FFFFFF;
  --surface: #F7F7FA;
  --mist: #EAF9F7;
  --mint: #6EE7D8;
  --violet: #7C3AED;
  --violet-deep: #5B21B6;
  --violet-soft: #F0E9FF;
  --space: #09090D;
  --grad-btn: linear-gradient(135deg, #7C3AED, #5B21B6);
  --sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, sans-serif;
  --serif: 'Noto Serif KR', Georgia, serif;
}

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

html { background: var(--paper); overflow-x: hidden; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
img { max-width: 100%; height: auto; border-radius: 0; }
h1, h2, h3, p, a { overflow-wrap: anywhere; letter-spacing: 0; }

.read-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, #7C3AED, #6EE7D8); z-index: 100;
  transition: width .1s linear;
}

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  max-width: 1240px;
  height: 72px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.site-logo img {
  width: 156px;
  height: auto;
  display: block;
}

.site-logo .sub {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding-left: 14px;
  border-left: 1px solid #D7DAE3;
  color: var(--ink);
  font-size: 16px;
  font-weight: 850;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  color: #1C2231;
  font-size: 15px;
  font-weight: 750;
  white-space: nowrap;
}

.site-nav a:not(.cta):hover { color: var(--violet-deep); }

.site-nav .search-link {
  position: relative;
  width: 24px;
  height: 24px;
  display: inline-flex;
  flex: 0 0 auto;
}

.site-nav .search-link::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 12px;
  height: 12px;
  border: 2px solid #111827;
  border-radius: 999px;
}

.site-nav .search-link::after {
  content: '';
  position: absolute;
  left: 16px;
  top: 16px;
  width: 8px;
  height: 2px;
  background: #111827;
  border-radius: 99px;
  transform: rotate(45deg);
  transform-origin: left center;
}

.site-nav .cta {
  color: #fff;
  background: var(--grad-btn);
  padding: 10px 20px;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.22);
}

.site-nav .cta:hover { filter: brightness(1.06); }

.blog-hero {
  background:
    radial-gradient(circle at 20% 10%, rgba(124, 58, 237, 0.10), transparent 28%),
    radial-gradient(circle at 80% 0%, rgba(110, 231, 216, 0.26), transparent 30%),
    linear-gradient(135deg, #ECFAF7 0%, #F3FBFA 48%, #FFFFFF 100%);
  border-bottom: 1px solid #EDF5F4;
}

.blog-hero-inner {
  max-width: 1240px;
  min-height: 300px;
  margin: 0 auto;
  padding: 78px 40px 82px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.blog-hero h1 {
  font-size: clamp(40px, 5vw, 62px);
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: 0;
}

.blog-hero p {
  max-width: 760px;
  margin-top: 24px;
  color: #20283A;
  font-size: 18px;
  line-height: 1.75;
  font-weight: 520;
}

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 40px;
}

.listing-wrap { padding-top: 44px; }

.category-tabs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 24px;
  margin-bottom: 38px;
}

.category-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: #354052;
  font-size: 16px;
  font-weight: 650;
  padding: 6px 12px;
  border-radius: 8px;
}

.category-tabs a:hover { color: var(--violet-deep); }
.category-tabs a.active {
  background: #F2F3F7;
  color: var(--ink);
  font-weight: 850;
}

.post-list.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 42px 36px;
  padding-bottom: 64px;
}

.post-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.post-card .thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1.72 / 1;
  overflow: hidden;
  background: #EAF9F7;
  border: 1px solid #E1F0EE;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(15, 16, 24, 0.08);
}

.post-card .thumb > img,
.post-card .thumb .post-thumb-fallback {
  width: 100%;
  height: 100%;
}

.post-card .thumb > img {
  object-fit: cover;
  transition: transform .22s ease;
}

.post-card:hover .thumb > img { transform: scale(1.025); }

.post-card .thumb .post-thumb-fallback {
  position: relative;
  overflow: hidden;
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    radial-gradient(circle at 78% 35%, rgba(124, 58, 237, 0.16), transparent 30%),
    linear-gradient(135deg, #E4FBF7 0%, #F7FFFD 100%);
}

.post-thumb-fallback::after {
  content: '';
  position: absolute;
  right: -60px;
  bottom: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 42px solid rgba(124, 58, 237, 0.11);
}

.post-thumb-fallback img {
  position: relative;
  z-index: 1;
  width: 168px;
  height: auto;
}

.post-thumb-fallback span {
  position: relative;
  z-index: 1;
  width: fit-content;
  color: #0F1018;
  border: 1px solid rgba(15, 16, 24, 0.55);
  border-radius: 999px;
  padding: 5px 15px;
  font-size: 13px;
  font-weight: 800;
}

.post-thumb-fallback strong {
  position: relative;
  z-index: 1;
  max-width: min(580px, 78%);
  color: #0B1020;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.18;
  font-weight: 900;
}

.post-copy { padding-top: 26px; }

.post-card h2 {
  color: var(--ink);
  font-size: 31px;
  line-height: 1.25;
  font-weight: 900;
  letter-spacing: 0;
}

.post-card h2 a:hover { color: var(--violet-deep); }

.post-card .excerpt {
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.72;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card .meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  color: #666D7A;
  font-size: 14px;
  line-height: 1.4;
}

.brand-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 48% 48%, #FFFFFF 0 2px, transparent 3px),
    linear-gradient(135deg, #0F1018 0%, #2A2142 100%);
}

.post-card .cat {
  color: #4F586B;
  background: #F1F3F7;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 13px;
  font-weight: 750;
}

.post-card .cat:hover {
  color: var(--violet-deep);
  background: var(--violet-soft);
}

.post-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(360px, 0.95fr);
  gap: 42px;
  align-items: center;
}

.post-card.featured .thumb { aspect-ratio: 1.58 / 0.83; }
.post-card.featured .post-copy { padding-top: 0; }
.post-card.featured h2 {
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.18;
}

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

.post-card.empty {
  grid-column: 1 / -1;
  padding: 60px 0;
  text-align: center;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0 0 72px;
  font-size: 15px;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

.pagination .page-numbers.current {
  color: #fff;
  background: var(--grad-btn);
  border-color: transparent;
}

.article-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(ellipse 55% 60% at 25% 20%, rgba(124, 58, 237, 0.22), transparent 60%),
    radial-gradient(ellipse 45% 50% at 80% 80%, rgba(110, 231, 216, 0.11), transparent 55%),
    linear-gradient(135deg, #09090D 0%, #171225 58%, #23183B 100%);
}

.article-hero-inner {
  max-width: 840px;
  margin: 0 auto;
  padding: 76px 32px 118px;
  text-align: center;
}

.article-hero .cat-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 22px;
}

.article-hero .cat {
  border: 1px solid rgba(167, 139, 250, 0.45);
  color: #DDD6FE;
  background: rgba(124, 58, 237, 0.12);
  font-weight: 700;
  font-size: 13px;
  padding: 5px 14px;
  border-radius: 999px;
}

.article-hero h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 700;
  line-height: 1.44;
}

.article-hero .byline {
  margin-top: 22px;
  color: #B9B3CC;
  font-size: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.article-sheet {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: -64px auto 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 56px 64px;
  box-shadow: 0 24px 60px rgba(9, 9, 13, 0.16);
}

.article-body { font-size: 17.5px; line-height: 1.95; }
.article-body > * + * { margin-top: 1.35em; }
.article-body > p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 54px;
  font-weight: 700;
  color: var(--violet-deep);
  float: left;
  line-height: 1;
  padding: 6px 10px 0 0;
}
.article-body h2 {
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.5;
  margin-top: 2.3em;
  padding-left: 16px;
  border-left: 3px solid var(--violet);
}
.article-body h3 { font-family: var(--serif); font-size: 20px; line-height: 1.5; margin-top: 1.8em; }
.article-body blockquote {
  border-left: 3px solid var(--violet);
  background: var(--violet-soft);
  padding: 18px 24px;
  border-radius: 0 14px 14px 0;
  color: #4A4370;
  font-size: 16.5px;
}
.article-body ul, .article-body ol { padding-left: 1.4em; }
.article-body li + li { margin-top: 0.5em; }
.article-body code { background: #F1F2F6; padding: 2px 7px; border-radius: 6px; font-size: 0.88em; }
.article-body pre { background: var(--space); color: #F7F7FA; padding: 20px 24px; border-radius: 14px; overflow-x: auto; font-size: 15px; line-height: 1.7; }
.article-body pre code { background: none; padding: 0; }
.article-body strong { color: #111827; }

.article-cta {
  max-width: 760px;
  margin: 28px auto 0;
  background:
    radial-gradient(ellipse 60% 80% at 80% 10%, rgba(124, 58, 237, 0.25), transparent 60%),
    linear-gradient(135deg, #09090D 0%, #171225 58%, #23183B 100%);
  border-radius: 18px;
  padding: 38px 42px;
  color: #fff;
}

.article-cta .badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  color: #DDD6FE;
  border: 1px solid rgba(167, 139, 250, 0.42);
  padding: 5px 13px;
  border-radius: 999px;
}

.article-cta .t { margin-top: 16px; font-family: var(--serif); font-size: 23px; font-weight: 700; line-height: 1.45; }
.article-cta .d { margin-top: 10px; color: #B9B3CC; font-size: 15px; line-height: 1.7; max-width: 560px; }
.article-cta .b {
  display: inline-block;
  margin-top: 22px;
  background: var(--grad-btn);
  color: #fff;
  font-weight: 750;
  font-size: 15px;
  padding: 13px 24px;
  border-radius: 10px;
}

.post-nav {
  max-width: 760px;
  margin: 26px auto 88px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.post-nav a {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 650;
}

.post-nav a:hover { border-color: #C9BCF0; box-shadow: 0 8px 22px rgba(30, 19, 51, 0.08); }
.post-nav .dir { display: block; color: var(--violet-deep); font-size: 12px; font-weight: 800; margin-bottom: 5px; }
.post-nav .next { text-align: right; }

.site-footer {
  background: var(--space);
  border-top: 1px solid rgba(124, 58, 237, 0.16);
  padding: 52px 0 60px;
  color: #8E87A8;
}

.site-footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 40px;
  font-size: 14px;
  line-height: 1.8;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 18px;
}

.footer-brand img { width: 164px; height: auto; display: block; }
.footer-brand span {
  color: #DDD6FE;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-left: 1px solid rgba(221, 214, 254, 0.32);
  padding-left: 12px;
}

.site-footer .links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 14px;
  font-weight: 650;
}

.site-footer .links a { color: #B9B3CC; }
.site-footer .links a:hover { color: #fff; }
.site-footer p + p { margin-top: 4px; }

@media (max-width: 980px) {
  .site-header-inner { padding: 0 24px; }
  .site-nav { gap: 18px; }
  .wrap, .blog-hero-inner, .site-footer-inner { padding-left: 24px; padding-right: 24px; }
  .post-card.featured {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .post-card.featured .post-copy { padding-top: 0; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .site-header-inner { height: 64px; gap: 12px; }
  .site-logo img { width: 132px; }
  .site-logo .sub { font-size: 14px; padding-left: 10px; }
  .site-nav { gap: 12px; }
  .site-nav .hide-m { display: none; }
  .site-nav .search-link { display: none; }
  .site-nav .cta {
    width: 56px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0;
  }
  .site-nav .cta::after { content: '시작'; font-size: 13px; }
  .blog-hero-inner {
    min-height: 240px;
    padding-top: 54px;
    padding-bottom: 58px;
  }
  .blog-hero h1 { font-size: 34px; line-height: 1.18; }
  .blog-hero p { margin-top: 16px; font-size: 15.5px; }
  .listing-wrap { padding-top: 28px; }
  .category-tabs {
    gap: 8px 10px;
    margin-bottom: 28px;
  }
  .category-tabs a {
    min-height: 32px;
    font-size: 14px;
    padding: 5px 10px;
  }
  .post-list.blog-grid {
    grid-template-columns: 1fr;
    gap: 38px;
  }
  .post-card h2 { font-size: 26px; }
  .post-card.featured h2 { font-size: 30px; }
  .post-copy { padding-top: 18px; }
  .post-thumb-fallback { padding: 22px; }
  .post-thumb-fallback img { width: 126px; }
  .post-thumb-fallback strong { font-size: 25px; }
  .post-card .excerpt { font-size: 15.5px; margin-top: 12px; }
  .post-card .meta { margin-top: 18px; }
  .article-hero-inner { padding: 52px 22px 100px; }
  .article-sheet {
    margin-left: 16px;
    margin-right: 16px;
    padding: 36px 26px;
  }
  .article-body { font-size: 16.5px; }
  .article-cta { margin-left: 16px; margin-right: 16px; padding: 30px 26px; }
  .post-nav { grid-template-columns: 1fr; margin-left: 16px; margin-right: 16px; }
  .footer-brand { align-items: flex-start; flex-direction: column; gap: 8px; }
  .footer-brand span { border-left: 0; padding-left: 0; }
}
