/*
Theme Name: SOWOON
Theme URI: https://leesowoon.com
Author: Lee Sowoon
Description: leesowoon.com 랜딩 페이지와 동일한 다크 디자인의 단일 컬럼 블로그 테마. 사이드바 없이 카드 그리드로 글을 보여줍니다.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sowoon
*/

:root {
  --bg: #070a13;
  --bg-soft: #0d1120;
  --card: rgba(255, 255, 255, 0.04);
  --card-solid: #111627;
  --card-border: rgba(255, 255, 255, 0.09);
  --card-hover: rgba(255, 255, 255, 0.07);
  --text: #e8ecf4;
  --text-dim: #97a0b5;
  --accent: #7c6cff;
  --accent-2: #2dd4bf;
  --radius: 16px;
}

/* ── 기본 ─────────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
    system-ui, 'Segoe UI', 'Malgun Gothic', sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: #fff;
}

::-webkit-scrollbar {
  width: 10px;
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: #2a3149;
  border-radius: 5px;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-2);
}

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

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.gradient-text {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── 헤더 ─────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 10, 19, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 16px;
  padding-bottom: 16px;
  flex-wrap: wrap;
}

.site-logo {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.site-logo .dot {
  color: var(--accent);
}

.site-nav ul {
  display: flex;
  gap: 22px;
  list-style: none;
  flex-wrap: wrap;
}

.site-nav a {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-dim);
}

.site-nav a:hover,
.site-nav .current-menu-item > a,
.site-nav .current-cat > a {
  color: var(--text);
}

.site-nav .sub-menu {
  display: none;
  position: absolute;
  background: var(--bg-soft);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 10px;
  margin-top: 10px;
  min-width: 160px;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.site-nav li {
  position: relative;
}

.site-nav li:hover > .sub-menu {
  display: flex;
}

.site-nav .sub-menu a {
  display: block;
  padding: 7px 12px;
  border-radius: 8px;
}

.site-nav .sub-menu a:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* 헤더 검색 */
.header-search form {
  display: flex;
  align-items: center;
}

.header-search input[type='search'] {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--text);
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.88rem;
  width: 150px;
  transition: width 0.3s ease, border-color 0.2s;
}

.header-search input[type='search']:focus {
  outline: none;
  width: 210px;
  border-color: var(--accent);
}

.header-search input[type='search']::placeholder {
  color: var(--text-dim);
}

/* ── 페이지 타이틀 영역 ───────────────────────────── */

.page-hero {
  padding: 72px 0 48px;
  background: radial-gradient(ellipse 70% 90% at 50% -20%, rgba(124, 108, 255, 0.13), transparent);
}

.page-hero h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -0.03em;
}

.page-hero .hero-sub {
  color: var(--text-dim);
  margin-top: 10px;
  font-size: 1.02rem;
}

/* ── 글 목록 카드 그리드 ──────────────────────────── */

.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  padding-bottom: 72px;
}

@media (max-width: 760px) {
  .posts-grid {
    grid-template-columns: 1fr;
  }
}

.post-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease,
    background 0.3s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  background: var(--card-hover);
  border-color: rgba(124, 108, 255, 0.45);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.post-card .card-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-soft);
}

.post-card .card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

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

.post-card .card-body {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.post-card .card-cats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.post-card .card-cats a {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-2);
  border: 1px solid rgba(45, 212, 191, 0.3);
  background: rgba(45, 212, 191, 0.08);
  padding: 2px 10px;
  border-radius: 100px;
}

.post-card h2 {
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.post-card h2 a:hover {
  color: var(--accent-2);
}

.post-card .card-excerpt {
  color: var(--text-dim);
  font-size: 0.9rem;
  flex: 1;
}

.post-card .card-meta {
  color: var(--text-dim);
  font-size: 0.8rem;
  display: flex;
  gap: 10px;
}

/* ── 페이지네이션 ─────────────────────────────────── */

.pagination {
  padding-bottom: 96px;
}

.pagination .nav-links {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── 글 본문 ──────────────────────────────────────── */

.single-article {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 24px 48px;
}

.single-article .entry-cats {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.single-article .entry-cats a {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-2);
  border: 1px solid rgba(45, 212, 191, 0.3);
  background: rgba(45, 212, 191, 0.08);
  padding: 3px 12px;
  border-radius: 100px;
}

.single-article .entry-title {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.single-article .entry-meta {
  color: var(--text-dim);
  font-size: 0.88rem;
  margin-top: 14px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.single-article .entry-thumb {
  margin: 32px 0;
}

.single-article .entry-thumb img {
  border-radius: var(--radius);
  width: 100%;
}

/* 본문 타이포그래피 */
.entry-content {
  font-size: 1.03rem;
  line-height: 1.85;
}

.entry-content > * + * {
  margin-top: 1.1em;
}

.entry-content h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-top: 2em;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--card-border);
}

.entry-content h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-top: 1.8em;
}

.entry-content h4 {
  font-size: 1.08rem;
  font-weight: 700;
  margin-top: 1.5em;
}

.entry-content a {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.entry-content ul,
.entry-content ol {
  padding-left: 1.4em;
}

.entry-content li + li {
  margin-top: 0.4em;
}

.entry-content blockquote {
  background: var(--bg-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  padding: 18px 22px;
  color: var(--text-dim);
}

.entry-content code {
  background: var(--bg-soft);
  color: var(--accent-2);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 0.9em;
}

.entry-content pre {
  background: #0a0e1c;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 20px;
  overflow-x: auto;
}

.entry-content pre code {
  background: transparent;
  color: var(--text);
  padding: 0;
}

.entry-content img {
  border-radius: 12px;
  margin-left: auto;
  margin-right: auto;
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.entry-content th,
.entry-content td {
  border: 1px solid var(--card-border);
  padding: 10px 14px;
  text-align: left;
}

.entry-content th {
  background: var(--bg-soft);
}

.entry-content hr {
  border: none;
  border-top: 1px solid var(--card-border);
  margin: 2.5em 0;
}

.entry-content .wp-caption-text,
.entry-content figcaption {
  color: var(--text-dim);
  font-size: 0.84rem;
  text-align: center;
  margin-top: 8px;
}

/* 태그 */
.entry-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 40px;
}

.entry-tags a {
  font-size: 0.78rem;
  color: var(--text-dim);
  border: 1px solid var(--card-border);
  border-radius: 100px;
  padding: 4px 13px;
  transition: all 0.2s ease;
}

.entry-tags a:hover {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* 이전/다음 글 */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 48px;
}

@media (max-width: 600px) {
  .post-nav {
    grid-template-columns: 1fr;
  }
}

.post-nav a {
  display: block;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 18px 20px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.post-nav a:hover {
  border-color: rgba(124, 108, 255, 0.45);
  background: var(--card-hover);
  color: var(--text);
}

.post-nav .nav-label {
  display: block;
  font-size: 0.76rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.post-nav .nav-title {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.4;
}

.post-nav .nav-next {
  text-align: right;
}

/* ── 댓글 ─────────────────────────────────────────── */

.comments-area {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px 96px;
}

.comments-title,
.comment-reply-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 24px;
}

.comment-list {
  list-style: none;
}

.comment-list .comment-body {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
}

.comment-list .children {
  list-style: none;
  padding-left: 28px;
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.comment-author img {
  border-radius: 50%;
}

.comment-metadata {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin: 4px 0 10px;
}

.comment-content {
  font-size: 0.95rem;
  color: var(--text);
}

.comment-reply-link {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
}

/* 댓글 폼 */
.comment-form label {
  display: block;
  font-size: 0.86rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.comment-form input[type='text'],
.comment-form input[type='email'],
.comment-form input[type='url'],
.comment-form textarea {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--text);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.94rem;
  margin-bottom: 16px;
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.comment-form .submit,
.wp-block-button__link,
button[type='submit'] {
  background: linear-gradient(120deg, var(--accent), #5b8cff);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 26px;
  font-weight: 700;
  font-size: 0.94rem;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.comment-form .submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124, 108, 255, 0.4);
}

/* ── 검색 결과 · 404 ──────────────────────────────── */

.no-results {
  text-align: center;
  padding: 80px 24px 120px;
}

.no-results h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.no-results p {
  color: var(--text-dim);
  margin-bottom: 28px;
}

.no-results .header-search input[type='search'] {
  width: 260px;
}

.error-404 .error-code {
  font-size: clamp(4rem, 14vw, 8rem);
  font-weight: 900;
  line-height: 1;
}

/* ── 푸터 ─────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--card-border);
  background: var(--bg-soft);
  padding: 48px 0 32px;
}

.site-footer .footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.site-footer .tagline {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-top: 6px;
}

.site-footer .footer-links {
  display: flex;
  gap: 24px;
  font-size: 0.92rem;
  color: var(--text-dim);
}

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

.site-footer .copy {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-top: 40px;
}

/* ── 정렬 유틸 (워드프레스 기본 클래스) ───────────── */

.alignleft {
  float: left;
  margin: 0 20px 12px 0;
}

.alignright {
  float: right;
  margin: 0 0 12px 20px;
}

.aligncenter {
  margin-left: auto;
  margin-right: auto;
}

.sticky {
  border-color: rgba(124, 108, 255, 0.5);
}
