/*
 * 옥실이의 경제 블로그 — 매거진 디자인 스타일시트
 * 테마(OnePress)와 애드센스/광고 설정은 건드리지 않고 화면 스타일만 재정의합니다.
 * 되돌리기: 플러그인 "옥실이 디자인" 비활성화
 */

@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css");

:root {
  --ok-ink: #0f1b2d;
  --ok-body: #2c3543;
  --ok-muted: #6b7686;
  --ok-navy: #0b2b4d;
  --ok-navy-soft: #14406c;
  --ok-gold: #c9a227;
  --ok-line: #e7eaf0;
  --ok-bg: #f4f6f8;
  --ok-radius: 16px;
}

/* ============================================================
   1. 기본 타이포그래피
   ============================================================ */
body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    system-ui, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", sans-serif;
  background: var(--ok-bg);
  color: var(--ok-body);
  font-size: 16.5px;
  line-height: 1.75;
  letter-spacing: -0.012em;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ok-navy-soft); }
a:hover, a:focus { color: var(--ok-navy); }
img { max-width: 100%; height: auto; }
::selection { background: rgba(201, 162, 39, 0.28); }

.container { max-width: 1160px; }

/* ============================================================
   2. 헤더
   ============================================================ */
.site-header {
  line-height: 72px;
  background: #fff;
  border-top: 3px solid var(--ok-navy);
  box-shadow: 0 1px 0 rgba(15, 27, 45, 0.07);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-branding { float: none; }

.site-branding .site-title,
.site-branding .site-text-logo {
  font-family: inherit;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.045em;
  text-transform: none;
  color: var(--ok-ink);
  line-height: 1.15;
}

.site-branding .site-title a { color: inherit; }
.site-branding .site-title a:hover { color: var(--ok-navy-soft); text-decoration: none; }

.site-branding .site-title a::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 20px;
  margin-right: 10px;
  border-radius: 3px;
  vertical-align: -3px;
  background: linear-gradient(180deg, #c9a227, #e8c964);
}

.header-right-wrapper { display: flex; align-items: center; }

.onepress-menu { float: none; display: flex; align-items: center; }
.onepress-menu > li { float: none; }

.onepress-menu > li > a,
.onepress-menu a {
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.015em;
  text-transform: none;
  color: #3c4a5c;
  padding-left: 15px;
  padding-right: 15px;
}

.onepress-menu > li > a:hover,
.onepress-menu > li.current-menu-item > a,
.onepress-menu > li.onepress-current-item > a {
  color: var(--ok-navy);
}

.onepress-menu > li > a::after {
  content: "";
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 20px;
  height: 2px;
  background: var(--ok-gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.25s ease;
}

.onepress-menu > li > a:hover::after { transform: scaleX(1); }
.onepress-menu > li:first-child > a { padding-left: 0; }
.onepress-menu > li:first-child > a::after { left: 0; }

/* ============================================================
   3. 페이지 헤더 (카테고리 / 아카이브 / 검색)
   ============================================================ */
.page-header {
  background: linear-gradient(135deg, #0a2542 0%, #173f66 100%);
  border: 0;
  padding: 32px 0 34px;
  margin: 0;
}

.page-header::before { display: none; }

.page-header .entry-title,
.page-header .page-title {
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-align: left;
  border: 0;
  padding: 0;
  margin: 0;
  line-height: 1.4;
}

.page-header .page-title span { color: #fff; }

.home .page-header { display: none; }

/* ============================================================
   4. 레이아웃 (본문 + 사이드바)
   ============================================================ */
.site-content { border-top: 0; }

#content-inside {
  padding-top: 32px;
  padding-bottom: 56px;
}

@media (min-width: 960px) {
  #content-inside {
    display: flex;
    align-items: flex-start;
    gap: 36px;
  }
  #content-inside #primary {
    flex: 1 1 auto;
    min-width: 0;
    float: none;
    width: auto;
    padding-right: 0;
    border-right: 0;
  }
  #content-inside #secondary {
    flex: 0 0 280px;
    width: 280px;
    float: none;
    padding-left: 0;
    border-left: 0;
    margin-left: 0;
    position: sticky;
    position: -webkit-sticky;
    top: 92px;
    align-self: flex-start;
  }
  .admin-bar #content-inside #secondary { top: 124px; }
}

/* ============================================================
   5. 글 목록 — 매거진 그리드
   ============================================================ */
#main.site-main {
  display: block;
}

.home #main.site-main,
.blog #main.site-main,
.archive #main.site-main,
.search #main.site-main,
.author #main.site-main {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px 22px;
  align-items: stretch;
}

#main.site-main > .list-article {
  min-width: 0;
  border: 1px solid var(--ok-line);
  border-radius: var(--ok-radius);
  background: #fff;
  padding: 0;
  margin: 0;
  overflow: hidden;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

#main.site-main > .list-article:last-of-type { border-bottom: 1px solid var(--ok-line); }

#main.site-main > .list-article:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(15, 27, 45, 0.10);
  border-color: #d8dee8;
}

#main.site-main > .list-article .list-article-thumb {
  float: none;
  margin: 0;
  width: 100%;
  display: block;
  overflow: hidden;
}

#main.site-main > .list-article .list-article-thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  transition: transform 0.5s ease;
}

#main.site-main > .list-article:hover .list-article-thumb img { transform: scale(1.04); }

#main.site-main > .list-article .list-article-content {
  float: none;
  overflow: visible;
  padding: 16px 17px 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

#main.site-main > .list-article .list-article-meta {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1;
}

#main.site-main > .list-article .list-article-meta a {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ok-navy);
  letter-spacing: -0.01em;
  box-shadow: 0 2px 8px rgba(15, 27, 45, 0.16);
}

#main.site-main > .list-article .list-article-meta a:hover {
  background: var(--ok-navy);
  color: #fff;
  text-decoration: none;
}

#main.site-main > .list-article .entry-title {
  font-size: 16.5px;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ok-ink);
  margin: 0 0 8px;
}

#main.site-main > .list-article .entry-title a { color: inherit; display: block; overflow-wrap: anywhere; }
#main.site-main > .list-article .entry-title a:hover { color: var(--ok-navy-soft); text-decoration: none; }

#main.site-main > .list-article .entry-excerpt p {
  font-size: 13.5px;
  line-height: 1.62;
  color: var(--ok-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 광고가 그리드 한 칸을 차지하지 않도록 전체 폭으로 */
#main.site-main > div.google-auto-placed,
#main.site-main > .code-block,
#main.site-main > .ai-viewport,
#main.site-main > ins.adsbygoogle {
  grid-column: 1 / -1;
  margin: 6px 0;
  text-align: center;
}

/* 비어 있는(광고 미송출) 자동 광고 자리는 그리드를 깨지 않도록 정리 */
#main.site-main > div.google-auto-placed:has(ins.adsbygoogle[data-ad-status="unfilled"]) {
  display: none;
}

/* ============================================================
   6. 맨 위 대표 글 (홈 전용)
   ============================================================ */
.home #main.site-main > .list-article:first-of-type {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 30px;
  align-items: center;
  padding: 26px 30px;
  border: 0;
  border-radius: 20px;
  color: #fff;
  background:
    radial-gradient(120% 150% at 88% 0%, rgba(201, 162, 39, 0.24) 0%, rgba(201, 162, 39, 0) 58%),
    linear-gradient(135deg, #0a2542 0%, #123a60 55%, #1b4f7d 100%);
  box-shadow: 0 16px 38px rgba(11, 43, 77, 0.18);
}

.home #main.site-main > .list-article:first-of-type:hover {
  transform: none;
  box-shadow: 0 16px 38px rgba(11, 43, 77, 0.22);
}

.home #main.site-main > .list-article:first-of-type .list-article-content {
  order: 1;
  grid-column: 1;
  grid-row: 1;
  float: none;
  overflow: visible;
  padding: 0;
}

.home #main.site-main > .list-article:first-of-type .list-article-content::before {
  content: "오늘의 헤드라인";
  display: inline-block;
  padding: 5px 13px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: var(--ok-gold);
  color: #241b02;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.4;
  align-self: flex-start;
}

.home #main.site-main > .list-article:first-of-type .list-article-meta {
  position: static;
  display: block;
  margin: 0 0 8px;
  font-size: 12.5px;
}

.home #main.site-main > .list-article:first-of-type .list-article-meta a {
  background: none;
  box-shadow: none;
  padding: 0;
  color: #e5cd7d;
  font-weight: 700;
}

.home #main.site-main > .list-article:first-of-type .list-article-meta a:hover {
  color: #fff;
  background: none;
}

.home #main.site-main > .list-article:first-of-type .entry-title {
  font-size: 25px;
  line-height: 1.42;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: #fff;
  margin: 0 0 12px;
}

.home #main.site-main > .list-article:first-of-type .entry-title a { color: #fff; }
.home #main.site-main > .list-article:first-of-type .entry-title a:hover { color: #e5cd7d; }

.home #main.site-main > .list-article:first-of-type .entry-excerpt p {
  color: rgba(255, 255, 255, 0.74);
  font-size: 14.5px;
  line-height: 1.7;
  -webkit-line-clamp: 3;
}

.home #main.site-main > .list-article:first-of-type .list-article-thumb {
  order: 2;
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  border-radius: 14px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3);
}

.home #main.site-main > .list-article:first-of-type:hover .list-article-thumb img { transform: none; }

/* ============================================================
   7. 페이지 네비게이션
   ============================================================ */
.posts-navigation {
  grid-column: 1 / -1;
  margin: 8px 0 0;
}

.posts-navigation .nav-links { display: flex; justify-content: center; gap: 10px; }

.posts-navigation a {
  display: inline-block;
  padding: 10px 24px;
  border: 1px solid var(--ok-line);
  border-radius: 999px;
  background: #fff;
  color: var(--ok-body);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.posts-navigation a:hover {
  border-color: var(--ok-navy);
  color: var(--ok-navy);
  box-shadow: 0 6px 16px rgba(11, 43, 77, 0.08);
}

/* ============================================================
   8. 사이드바
   ============================================================ */
#secondary .widget {
  background: #fff;
  border: 1px solid var(--ok-line);
  border-radius: var(--ok-radius);
  padding: 18px 18px 14px;
  margin: 0 0 18px;
}

#secondary .widget:last-child { margin-bottom: 0; }

#secondary .widget:empty,
#secondary .widget_block:empty { display: none; }

#secondary .widget:has(> ins.adsbygoogle) {
  background: transparent;
  border: 0;
  padding: 0;
  text-align: center;
}

#secondary .widget .widget-title,
#secondary .widget h2 {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ok-ink);
  border: 0;
  border-bottom: 1px solid var(--ok-line);
  padding: 0 0 10px;
  margin: 0 0 12px;
  line-height: 1.4;
}

#secondary .widget ul { margin: 0; padding: 0; list-style: none; }
#secondary .widget ul li {
  border-bottom: 1px dashed #eef1f5;
  padding: 9px 0;
  font-size: 14px;
  line-height: 1.4;
}
#secondary .widget ul li:last-child { border-bottom: 0; padding-bottom: 0; }

#secondary .widget ul li a {
  display: inline-flex;
  align-items: center;
  color: var(--ok-body);
  font-size: 14px;
  text-decoration: none;
}

#secondary .widget ul li a::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--ok-gold);
}

#secondary .widget ul li a:hover { color: var(--ok-navy); }

#secondary .widget_search form,
#secondary .wp-block-search__inside-wrapper {
  display: flex;
  gap: 6px;
  align-items: stretch;
}

#secondary .wp-block-search__label { display: none; }

#secondary .widget_search input[type="search"],
#secondary .wp-block-search__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--ok-line);
  border-radius: 10px;
  background: #fafbfc;
  font-size: 14px;
  color: var(--ok-body);
}

#secondary .widget_search button,
#secondary .wp-block-search__button {
  height: 42px;
  margin: 0;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: var(--ok-navy);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

#secondary .widget_search button:hover,
#secondary .wp-block-search__button:hover { background: var(--ok-navy-soft); }

/* ============================================================
   9. 글 상세
   ============================================================ */
@media (min-width: 960px) {
  .single-post #content-inside #primary {
    background: #fff;
    border: 1px solid var(--ok-line);
    border-radius: 20px;
    padding: 34px 38px 40px;
  }
}

.single-post .entry-header .entry-title {
  font-size: 30px;
  line-height: 1.4;
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--ok-ink);
  text-align: left;
  border: 0;
  padding: 0;
  margin: 0 0 14px;
}

.single-post .entry-meta {
  font-size: 13px;
  color: var(--ok-muted);
  margin: 0 0 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ok-line);
}

.single-post .entry-meta a { color: var(--ok-muted); text-decoration: none; }
.single-post .entry-meta .byline { margin-left: 8px; }

.single-post .entry-content {
  font-size: 17px;
  line-height: 1.85;
  color: var(--ok-body);
  letter-spacing: -0.005em;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.single-post .entry-content p { margin: 0 0 1.15em; font-size: inherit; }
.single-post .entry-content p:empty { display: none; }

.single-post .entry-content h2 {
  font-size: 22px;
  line-height: 1.5;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ok-navy);
  border: 0;
  padding: 0;
  margin: 2em 0 0.7em;
}

.single-post .entry-content h3 {
  font-size: 19px;
  line-height: 1.55;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ok-ink);
  margin: 1.7em 0 0.6em;
}

.single-post .entry-content h4 { font-size: 17px; font-weight: 800; margin: 1.4em 0 0.5em; }

.single-post .entry-content ul,
.single-post .entry-content ol {
  margin: 0 0 1.2em;
  padding-left: 1.25em;
  font-size: 16.5px;
}

.single-post .entry-content li { margin-bottom: 0.35em; line-height: 1.75; }

.single-post .entry-content img { border-radius: 10px; }
.single-post .entry-content figure,
.single-post .entry-content .wp-caption { max-width: 100% !important; }
.single-post .entry-content figure.wp-caption { width: auto !important; }

.single-post .entry-content figure.aligncenter,
.single-post .entry-content .wp-caption.aligncenter,
.single-post .entry-content img.aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.single-post .entry-content .wp-caption-text,
.single-post .entry-content figcaption {
  font-size: 13px;
  color: var(--ok-muted);
  margin-top: 6px;
  text-align: center;
}

.single-post .entry-content table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 1.4em 0;
  font-size: 14.5px;
  line-height: 1.6;
}

.single-post .entry-content th,
.single-post .entry-content td {
  padding: 10px 12px;
  border: 1px solid var(--ok-line);
  font-size: 14.5px;
  vertical-align: middle;
}

.single-post .entry-content blockquote {
  margin: 1.4em 0;
  padding: 16px 20px;
  border-left: 4px solid var(--ok-gold);
  background: #fbfaf5;
  border-radius: 0 10px 10px 0;
  color: #4a5568;
  font-size: 16px;
}

.single-post .entry-content a {
  color: #0f5c9c;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.single-post .entry-content strong { font-weight: 700; color: #1b2736; }
.single-post .entry-content .code-block { margin: 26px 0; text-align: center; }
.single-post .entry-content hr { border: 0; border-top: 1px solid var(--ok-line); margin: 2.2em 0; }

.single-post .entry-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--ok-line);
  font-size: 13px;
  color: var(--ok-muted);
}

.single-post .entry-footer a {
  color: var(--ok-navy-soft);
  text-decoration: none;
  margin-right: 6px;
}

/* ============================================================
   10. 광고 영역 여백 정리 (광고 코드/설정은 그대로)
   ============================================================ */
.code-block {
  margin: 22px auto;
  max-width: 100%;
  text-align: center;
  clear: both;
}

div.google-auto-placed { margin: 18px 0; }

/* 본문 안에서 광고가 채워지지 않은 자리는 빈 공백으로 남기지 않음 */
.single-post .entry-content > div.google-auto-placed:has(ins.adsbygoogle[data-ad-status="unfilled"]) {
  display: none;
}

/* Ad Inserter 수동 광고 블록 중 실제로 광고가 채워지지 않은 자리도 공백을 남기지 않음 */
.single-post .entry-content .code-block:has(ins.adsbygoogle[data-ad-status="unfilled"]):not(:has(ins.adsbygoogle[data-ad-status="filled"])) {
  display: none;
}

/* 애드센스가 표 안에 삽입되는 경우 레이아웃이 깨지지 않도록 */
.entry-content td ins.adsbygoogle,
.entry-content th ins.adsbygoogle { margin: 0; }

/* ============================================================
   11. 푸터
   ============================================================ */
.site-footer {
  background: #0a1f38;
  border: 0;
  padding: 0;
}

.site-footer .site-info {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  padding: 22px 0;
  text-align: center;
  line-height: 1.7;
}

.site-footer a { color: rgba(255, 255, 255, 0.78); text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer .site-info .container { max-width: 1160px; }
.site-footer .btt { display: none; }

/* ============================================================
   12. 반응형
   ============================================================ */
@media (max-width: 1140px) {
  .site-header { line-height: 64px; }
  .site-header .container { gap: 12px; }
  .site-branding .site-title,
  .site-branding .site-text-logo { font-size: 19px; }
}

@media (max-width: 1024px) {
  .home #main.site-main,
  .blog #main.site-main,
  .archive #main.site-main,
  .search #main.site-main,
  .author #main.site-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home #main.site-main > .list-article:first-of-type {
    grid-template-columns: minmax(0, 1fr);
    padding: 22px;
    gap: 18px;
  }
  .home #main.site-main > .list-article:first-of-type .list-article-thumb {
    order: 0;
    grid-column: 1;
    grid-row: 2;
    max-width: 380px;
  }
  .home #main.site-main > .list-article:first-of-type .entry-title { font-size: 23px; }
}

@media (max-width: 940px) {
  #main.site-main > .list-article .list-article-thumb {
    display: block;
    width: 100%;
    float: none;
    margin: 0;
  }
  .single-post .entry-header .entry-title { font-size: 25px; }
  .single-post .entry-content { font-size: 16.5px; }
}

@media (max-width: 640px) {
  .home #main.site-main,
  .blog #main.site-main,
  .archive #main.site-main,
  .search #main.site-main,
  .author #main.site-main { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  #content-inside { padding-top: 20px; padding-bottom: 40px; }
  .home #main.site-main > .list-article:first-of-type { padding: 18px; border-radius: 16px; }
  .home #main.site-main > .list-article:first-of-type .entry-title { font-size: 21px; }
  .home #main.site-main > .list-article:first-of-type .entry-excerpt p { -webkit-line-clamp: 4; }
  .page-header { padding: 24px 0; }
  .page-header .entry-title { font-size: 21px; }
  .single-post .entry-header .entry-title { font-size: 22px; }
  #secondary { margin-top: 26px; }
}
