/*
Theme Name: Economy Ible
Theme URI: https://economy.ible.blog/
Author: Ible Blog
Description: Fast custom WordPress theme for asset market guides and economy explainers.
Version: 1.0.0
Text Domain: ibleblog
*/

/* 1. Design tokens */
:root {
  --color-bg: #f7f8fa;
  --color-surface: #ffffff;
  --color-text: #1f2933;
  --color-heading: #0f172a;
  --color-muted: #64748b;
  --color-border: #e2e8f0;
  --color-accent: #0f766e;
  --color-accent-soft: #ecfdf5;
  --color-warning-soft: #fff7ed;
  --color-warning-border: #fed7aa;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --container: 1180px;
  --article-width: 760px;
}

/* 2. Reset and base */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family:
    Pretendard,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Noto Sans KR",
    sans-serif;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

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

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

/* 3. Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 249, 0.9);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.035);
}

.header-inner {
  max-width: var(--container);
  min-height: 70px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 8px 0;
  color: var(--color-heading);
  font-size: 1.38rem;
  font-weight: 850;
  letter-spacing: -0.04em;
}

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

.site-logo__suffix {
  display: inline-flex;
  align-items: baseline;
}

.site-logo__dot {
  font-size: 0.68em;
  line-height: 1;
  transform: translateY(-0.03em);
}

.site-logo--image::before {
  content: none;
}

.site-logo__image {
  display: block;
  width: auto;
  max-width: 220px;
  height: 34px;
}

.site-nav {
  padding: 5px;
  border: 1px solid rgba(226, 232, 240, 0.75);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.025);
}

.primary-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #374151;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.primary-menu a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  color: #374151;
  transition:
    background 0.18s ease,
    color 0.18s ease;
}

.primary-menu a:hover {
  background: rgba(239, 246, 255, 0.9);
  color: var(--color-accent);
}

/* 4. Mobile menu */
.mobile-menu-toggle {
  display: none;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(191, 219, 254, 0.9);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
  cursor: pointer;
  padding: 11px;
  flex: 0 0 auto;
}

.mobile-menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: #1f2937;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.mobile-menu-toggle span + span {
  margin-top: 6px;
}

.mobile-menu-panel {
  display: none;
  border-top: 1px solid rgba(229, 231, 235, 0.9);
  background:
    radial-gradient(
      circle at top left,
      rgba(37, 99, 235, 0.08),
      transparent 34%
    ),
    rgba(250, 250, 249, 0.98);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.mobile-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: min(100% - 32px, var(--container));
  margin: 0 auto;
  padding: 18px 0 14px;
}

.mobile-search-form input {
  width: 100%;
  min-width: 0;
  flex: 1 1 100%;
  min-height: 48px;
  border: 1px solid rgba(191, 219, 254, 0.9);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.mobile-search-form .search-category {
  flex: 1 1 0;
  min-height: 48px;
  cursor: pointer;
  border: 1px solid rgba(191, 219, 254, 0.9);
  border-radius: 14px;
  padding: 0 14px;
  font: inherit;
  color: #374151;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.mobile-search-form button {
  min-height: 48px;
  cursor: pointer;
  border: 1px solid var(--color-accent);
  border-radius: 14px;
  background: var(--color-accent);
  color: #ffffff;
  padding: 0 18px;
  font: inherit;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.16);
}

.mobile-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  width: min(100% - 32px, var(--container));
  margin: 0 auto;
  padding: 0 0 22px;
}

.mobile-nav a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 13px 14px 13px 38px;
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-heading);
  font-size: 0.94rem;
  font-weight: 750;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.mobile-nav a::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--color-accent);
  transform: translateY(-50%);
  box-shadow: 0 0 0 5px var(--color-accent-soft);
}

.mobile-nav a:hover {
  transform: translateY(-1px);
  border-color: #bfdbfe;
  background: #ffffff;
}

.site-header.is-mobile-menu-open .mobile-menu-panel {
  display: block;
}

.site-header.is-mobile-menu-open .mobile-menu-toggle span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.site-header.is-mobile-menu-open .mobile-menu-toggle span:nth-child(2) {
  opacity: 0;
}

.site-header.is-mobile-menu-open .mobile-menu-toggle span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* 5. Layout */
.page-wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 38px 24px 80px;
}

.article-layout {
  display: flex;
  gap: 36px;
  align-items: flex-start;
  min-width: 0;
}

.article-layout > .article-card {
  flex: 1 1 auto;
  min-width: 0;
  align-self: flex-start;
}

.article-layout > .sidebar {
  flex: 0 0 310px;
  align-self: flex-start;
  min-width: 0;
  position: -webkit-sticky;
  position: sticky;
  top: 96px;
  height: fit-content;
}

/* 6. Home page */
.home-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.75fr);
  gap: 28px;
  align-items: stretch;
  margin-bottom: 42px;
  padding: 42px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 30px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.06);
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.06) 0%, transparent 34%),
    radial-gradient(
      circle at 88% 14%,
      rgba(14, 165, 233, 0.05),
      transparent 20%
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0));
}

.home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.18;
  mask-image: linear-gradient(135deg, rgba(0, 0, 0, 0.55), transparent 70%);
  -webkit-mask-image: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.55),
    transparent 70%
  );
}

.home-hero > * {
  position: relative;
  z-index: 1;
}

.home-hero__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.home-title {
  max-width: 760px;
  margin: 0 0 16px;
  color: var(--color-heading);
  font-size: clamp(2.5rem, 5vw, 4.45rem);
  line-height: 1.08;
  letter-spacing: -0.075em;
}

.home-hero__content p {
  max-width: 680px;
  margin: 0;
  color: #4b5563;
  font-size: 1.08rem;
  line-height: 1.75;
}

.home-search {
  max-width: 620px;
  margin-top: 28px;
}

.home-search .search-form,
.home-search .search-box {
  min-height: 58px;
  border-color: rgba(191, 219, 254, 0.95);
  border-radius: 18px;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.08);
}

.home-search .search-field,
.home-search input[type="search"] {
  padding: 15px 16px;
  font-size: 1rem;
}

.home-search .search-category {
  min-width: 168px;
}

.home-search .search-submit,
.home-search button {
  padding: 0 22px;
}

.home-hero__panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 24px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.045);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.home-hero__panel strong {
  display: block;
  margin-bottom: 16px;
  color: var(--color-heading);
  font-size: 1.05rem;
  letter-spacing: -0.025em;
}

.home-popular-links {
  display: grid;
  gap: 10px;
}

.home-popular-links a {
  position: relative;
  display: block;
  padding: 12px 14px 12px 18px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: #ffffff;
  color: #1f2937;
  font-size: 0.94rem;
  font-weight: 800;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.home-popular-links a::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: var(--color-accent);
}

.home-popular-links a:hover {
  transform: translateY(-1px);
  border-color: #bfdbfe;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

/* 7. Archive and category pages */
.category-hero {
  margin-bottom: 28px;
  padding: 34px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.04);
}

.archive-title {
  margin: 0 0 12px;
  color: var(--color-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.055em;
}

.archive-description {
  max-width: 720px;
  margin: 0;
  color: var(--color-muted);
  font-size: 1.02rem;
  line-height: 1.75;
}

.archive-description p {
  margin: 0;
}

.archive-section + .archive-section {
  margin-top: 34px;
}

.archive-section__header {
  margin-bottom: 18px;
}

.archive-section__header h2 {
  margin: 0;
  color: var(--color-heading);
  font-size: 1.6rem;
  line-height: 1.35;
  letter-spacing: -0.04em;
}

.archive-section__header--with-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.home-section {
  margin-top: 46px;
}

.text-link {
  color: var(--color-accent);
  font-size: 0.94rem;
  font-weight: 900;
}

.archive-search {
  max-width: 620px;
  margin-top: 24px;
}

.archive-search .search-form,
.archive-search .search-box {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
}

.archive-search .search-field,
.archive-search input[type="search"] {
  min-width: 0;
  flex: 1;
  border: 0;
  padding: 12px 14px;
  font: inherit;
  background: transparent;
}

.archive-search .search-submit,
.archive-search button {
  cursor: pointer;
  border: 0;
  background: var(--color-accent);
  color: #ffffff;
  padding: 0 16px;
  font: inherit;
  font-weight: 800;
}

.search-category {
  min-width: 156px;
  cursor: pointer;
  border: 0 !important;
  border-left: 1px solid var(--color-border);
  padding: 0 14px;
  font: inherit;
  color: var(--color-heading);
  font-weight: 700;
  background: #ffffff;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none !important;
  outline: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #94a3b8 50%),
    linear-gradient(135deg, #94a3b8 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 12px) calc(50% - 2px);
  background-size:
    6px 6px,
    6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.search-category.is-placeholder {
  color: var(--color-muted);
  font-weight: 600;
}

.search-category:focus,
.search-field:focus,
.search-box input:focus {
  outline: none;
}

.empty-state {
  padding: 34px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.04);
}

.empty-state h2 {
  margin: 0 0 10px;
  color: var(--color-heading);
  font-size: 1.4rem;
  line-height: 1.3;
  letter-spacing: -0.03em;
}

.empty-state p {
  margin: 0;
  color: var(--color-muted);
  font-size: 1rem;
  line-height: 1.75;
}

.pagination-wrap {
  margin-top: 34px;
}

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

.pagination-wrap .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--color-heading);
  font-weight: 750;
}

.pagination-wrap .page-numbers.current {
  border-color: var(--color-accent);
  background: var(--color-accent);
  color: #ffffff;
}

/* 8. Single article */
.article-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-width: 0;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.06);
}

.article-header {
  padding: 42px 44px 28px;
  min-width: 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--color-muted);
  font-size: 0.88rem;
}

.breadcrumb a {
  color: var(--color-accent);
  font-weight: 700;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 12px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-size: 0.78rem;
  font-weight: 800;
}

.article-title {
  margin: 0 0 18px;
  color: var(--color-heading);
  font-size: clamp(2.1rem, 4vw, 3.45rem);
  line-height: 1.15;
  letter-spacing: -0.065em;
  overflow-wrap: anywhere;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--color-muted);
  font-size: 0.92rem;
}

.short-answer {
  margin-top: 26px;
  padding: 20px 22px;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  background: var(--color-accent-soft);
  min-width: 0;
}

.short-answer strong {
  display: block;
  margin-bottom: 8px;
  color: #1d4ed8;
  font-size: 0.95rem;
}

.short-answer p {
  margin: 0;
  color: #1e3a8a;
  font-size: 1rem;
  line-height: 1.75;
}

.featured-image {
  min-height: 340px;
  margin: 0;
  background:
    radial-gradient(
      circle at 18% 20%,
      rgba(37, 99, 235, 0.28),
      transparent 28%
    ),
    linear-gradient(135deg, #dbeafe, #f8fafc 60%, #e0f2fe);
  display: grid;
  place-items: center;
  color: #1e40af;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 850;
  letter-spacing: -0.04em;
  text-align: center;
  padding: 32px;
  overflow: hidden;
}

.featured-image--has-image {
  display: block;
  min-height: 0;
  padding: 0;
  background: #f8fafc;
}

.featured-image--has-image img {
  width: 100%;
  height: auto;
  min-height: 0;
  object-fit: contain;
}

.article-body-wrap {
  padding: 34px 44px 50px;
  min-width: 0;
}

.article-body-wrap--footer {
  padding-top: 0;
}

.summary-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 30px 0;
}

.summary-item {
  padding: 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #ffffff;
  min-width: 0;
}

.summary-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--color-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.summary-item strong {
  display: block;
  color: var(--color-heading);
  font-size: 1rem;
  line-height: 1.45;
}

.last-updated {
  margin: 0 0 18px;
  color: var(--color-muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.article-intro {
  margin: 0 0 24px;
  color: #334155;
  font-size: 1.08rem;
  line-height: 1.8;
}

.quick-answer-box,
.official-box,
.related-guide-box {
  margin: 30px 0;
  padding: 22px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #ffffff;
}

.quick-answer-box {
  border-color: #bfdbfe;
  background: var(--color-accent-soft);
}

.quick-answer-box h2,
.official-box h2,
.related-guide-box h2 {
  margin: 0 0 12px;
  color: var(--color-heading);
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.quick-answer-box h2 {
  color: #1d4ed8;
}

.quick-answer-box p,
.official-box p,
.related-guide-box p {
  margin: 0;
}

.quick-answer-box p {
  color: #1e3a8a;
}

.official-box {
  background: #f9fafb;
}

.related-guide-box ul {
  margin: 0;
  padding-left: 1.1em;
}

.related-guide-box li {
  margin-bottom: 0.7em;
}

.official-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  margin: 4px 0 30px;
  padding: 14px 18px;
  border-radius: 14px;
  background: var(--color-accent);
  color: #ffffff;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  box-shadow: 0 12px 22px rgba(37, 99, 235, 0.18);
}

.article-content .official-link {
  color: #ffffff;
  text-decoration: none;
}

.toc-box {
  margin: 8px 0 38px;
  padding: 22px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #f9fafb;
}

.toc-box h2 {
  margin: 0 0 14px;
  color: var(--color-heading);
  font-size: 1.1rem;
  letter-spacing: -0.03em;
}

.toc-box ol {
  margin: 0;
  padding-left: 20px;
}

.toc-box li + li {
  margin-top: 8px;
}

.toc-box a {
  color: #374151;
  font-weight: 700;
}

.notice-box {
  margin: 34px 0;
  padding: 22px;
  border: 1px solid var(--color-warning-border);
  border-radius: var(--radius-md);
  background: var(--color-warning-soft);
}

.notice-box h2 {
  margin: 0 0 10px;
  color: #9a3412;
  font-size: 1.18rem;
}

.notice-box p {
  margin: 0;
  color: #7c2d12;
  font-size: 0.98rem;
}

.faq-section {
  max-width: var(--article-width);
  margin-top: 40px;
}

.faq-section h2 {
  margin: 0 0 16px;
  color: var(--color-heading);
  font-size: 1.45rem;
  letter-spacing: -0.04em;
}

details {
  padding: 16px 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #ffffff;
}

details + details {
  margin-top: 12px;
}

summary {
  cursor: pointer;
  color: var(--color-heading);
  font-weight: 800;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  float: right;
  color: var(--color-accent);
  font-weight: 900;
}

details[open] summary::after {
  content: "-";
}

details p {
  margin: 12px 0 0;
  color: var(--color-muted);
}

/* 9. Article content */
.article-content {
  max-width: var(--article-width);
  min-width: 0;
  overflow-wrap: anywhere;
}

.article-content h2 {
  margin: 2.4em 0 0.75em;
  color: var(--color-heading);
  font-size: 1.68rem;
  line-height: 1.35;
  letter-spacing: -0.045em;
}

.article-content h3 {
  margin: 1.8em 0 0.6em;
  color: var(--color-heading);
  font-size: 1.28rem;
  line-height: 1.4;
  letter-spacing: -0.035em;
}

.article-content p {
  margin: 0 0 1.35em;
  color: #25313f;
  font-size: 1rem;
}

.article-content ul,
.article-content ol {
  margin: 0 0 1.6em;
  padding-left: 1.35em;
}

.article-content li {
  margin-bottom: 0.65em;
  font-size: 1.04rem;
}

.article-content a {
  color: var(--color-accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-size: 0.95rem;
}

.article-content th,
.article-content td {
  border: 1px solid var(--color-border);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.article-content th {
  background: #f3f4f6;
  color: var(--color-heading);
}

/* 10. Ad slots */
.ad-slot {
  margin: 30px 0;
  min-height: 0;
  color: #94a3b8;
  display: block;
  text-align: center;
  font-size: 0.9rem;
  overflow: visible;
}

.ad-slot--live {
  width: 100%;
  min-height: 90px;
  color: inherit;
}

.ad-slot span {
  display: inline-flex;
  margin-top: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f8fafc;
}

.ad-slot .adsbygoogle {
  display: block !important;
  width: 100% !important;
  max-width: 100%;
  min-width: 250px;
}

.ad-slot--home-after-featured .adsbygoogle,
.ad-slot--before-related .adsbygoogle {
  width: 100% !important;
  min-height: 90px;
}

.ad-slot--before-related {
  margin: 28px 0 38px;
}

.ad-slot--sidebar {
  margin: 0;
}

.ad-slot--sidebar .adsbygoogle {
  display: inline-block !important;
  width: 310px !important;
  min-width: 310px !important;
  max-width: 310px !important;
  height: 250px !important;
  min-height: 250px !important;
}

/* 11. Sidebar */
.sidebar {
  min-width: 0;
}

.sidebar-inner {
  display: block;
  position: static;
  top: auto;
  height: fit-content;
  min-width: 0;
}

.sidebar > .sidebar-inner {
  margin-top: 18px;
}

.sidebar-inner > * + * {
  margin-top: 18px;
}

.widget {
  padding: 22px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.widget--ad {
  padding: 0;
  overflow: hidden;
}

.widget--toc {
  padding: 20px 22px;
}

.widget h2,
.widget h3 {
  margin: 0 0 14px;
  color: var(--color-heading);
  font-size: 1rem;
  letter-spacing: -0.03em;
}

.search-box {
  display: flex;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
}

.search-box input {
  min-width: 0;
  flex: 1 1 52%;
  border: 0;
  padding: 12px;
  font: inherit;
  font-size: 0.94rem;
  color: var(--color-heading);
  background: #ffffff;
}

.search-box input::placeholder {
  color: #9ca3af;
}

.search-box .search-category {
  min-width: 126px;
  font-size: 0.8rem;
  border-left: 1px solid #d1d5db !important;
  background-color: #ffffff;
}

.search-box button {
  cursor: pointer;
  border: 0;
  background: var(--color-accent);
  color: #ffffff;
  padding: 0 14px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 800;
}

.sidebar .search-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.sidebar .search-box input {
  grid-column: 1 / -1;
  min-height: 46px;
  padding-left: 14px;
  border: 1px solid #d8dee9;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

.sidebar .search-box .search-category {
  min-width: 0;
  min-height: 46px;
  padding-left: 12px;
  padding-right: 30px;
  border: 1px solid #d8dee9 !important;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
  font-size: 0.88rem;
}

.sidebar .search-box button {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  font-size: 0.9rem;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.16);
}

.sidebar-toc {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: sidebar-toc;
}

.sidebar-toc__item + .sidebar-toc__item {
  margin-top: 8px;
}

.sidebar-toc__item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 14px;
  background: #ffffff;
  color: #374151;
  font-size: 0.84rem;
  font-weight: 650;
  line-height: 1.45;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.sidebar-toc__item a::before {
  counter-increment: sidebar-toc;
  content: counter(sidebar-toc, decimal-leading-zero);
  flex: 0 0 auto;
  color: var(--color-accent);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.sidebar-toc__item a:hover {
  border-color: #bfdbfe;
  background: #f8fbff;
  color: var(--color-accent);
  transform: translateX(1px);
}

.sidebar-toc__item--level-3 {
  margin-left: 12px;
}

.sidebar-toc__item--level-3 a {
  padding: 9px 11px;
  font-size: 0.8rem;
  color: var(--color-muted);
  font-weight: 600;
  background: #fbfcfe;
}

.sidebar-toc__item--level-3 a:hover {
  color: var(--color-accent);
}

.popular-list {
  display: grid;
  gap: 14px;
}

.popular-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.popular-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 850;
}

.popular-item a {
  display: block;
  color: var(--color-heading);
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.4;
}

.popular-item span:not(.popular-number) {
  display: block;
  margin-top: 3px;
  color: var(--color-muted);
  font-size: 0.8rem;
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.category-list a {
  padding: 8px 11px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-size: 0.82rem;
  font-weight: 750;
}

.category-list--large a {
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.category-directory {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.directory-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 158px;
  padding: 20px;
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.035);
  transition:
    border-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.directory-card::before {
  content: none;
}

.directory-card::after {
  content: "->";
  position: absolute;
  right: 18px;
  top: 18px;
  color: var(--color-accent);
  font-weight: 900;
  opacity: 0;
  transform: translateX(-4px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.directory-card:hover {
  transform: translateY(-3px);
  border-color: #bfdbfe;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.07);
}

.directory-card:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.directory-card__icon {
  width: 38px;
  height: 38px;
  margin-bottom: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.directory-card__icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.directory-card__title {
  margin-bottom: 8px;
  color: var(--color-heading);
  font-size: 1.02rem;
  font-weight: 900;
  letter-spacing: -0.025em;
}

.directory-card p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.home-category-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-featured-section {
  padding: 30px;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 30px;
  background:
    radial-gradient(
      circle at 10% 10%,
      rgba(37, 99, 235, 0.08),
      transparent 32%
    ),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.045);
}

.home-featured-section .archive-section__header {
  margin-bottom: 22px;
}

.home-featured-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.75fr);
  gap: 18px;
}

.home-featured-main {
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.055);
}

.home-featured-main a {
  display: grid;
  height: 100%;
}

.home-featured-main img,
.home-featured-main .post-card__thumb {
  width: 100%;
  aspect-ratio: 16 / 8;
  object-fit: cover;
}

.home-featured-main__body {
  padding: 24px;
}

.home-featured-main__body h3 {
  margin: 0 0 10px;
  color: var(--color-heading);
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.05em;
}

.home-featured-main__body p {
  margin: 0;
  color: var(--color-muted);
  font-size: 1rem;
}

.home-featured-side {
  display: grid;
  gap: 14px;
}

.home-featured-mini {
  border: 1px solid var(--color-border);
  border-radius: 18px;
  background: #ffffff;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.home-featured-mini:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.055);
}

.home-featured-mini a {
  display: block;
  padding: 20px;
}

.mini-category {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-size: 0.74rem;
  font-weight: 800;
}

.home-featured-mini h3 {
  margin: 0 0 10px;
  color: var(--color-heading);
  font-size: 1.05rem;
  line-height: 1.4;
  letter-spacing: -0.03em;
}

.home-featured-mini p {
  margin: 0 0 12px;
  color: var(--color-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.mini-date {
  color: var(--color-muted);
  font-size: 0.86rem;
}

.home-update-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.home-ad-section {
  margin-top: 34px;
}

.home-ad-section .ad-slot {
  margin: 0;
}

.home-ad-section .ad-slot--live {
  background: transparent;
}

.home-update-card {
  border: 1px solid var(--color-border);
  border-radius: 18px;
  background: #ffffff;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.home-update-card:hover {
  transform: translateY(-2px);
  border-color: #bfdbfe;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.055);
}

.home-update-card a {
  display: block;
  padding: 18px;
}

.home-update-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.home-update-card__category {
  display: inline-flex;
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-size: 0.72rem;
  font-weight: 850;
}

.home-update-card__date {
  color: var(--color-muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.home-update-card h3 {
  margin: 0 0 8px;
  color: var(--color-heading);
  font-size: 1.06rem;
  line-height: 1.42;
  letter-spacing: -0.03em;
}

.home-update-card p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* 12. Cards and related posts */
.related-posts {
  margin-top: 38px;
}

.related-posts h2 {
  margin: 0 0 18px;
  color: var(--color-heading);
  font-size: 1.45rem;
  letter-spacing: -0.04em;
}

.related-grid,
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.related-card,
.post-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #ffffff;
}

.related-card a,
.post-card a {
  display: grid;
  height: 100%;
}

.related-thumb,
.post-card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(
      circle at 22% 24%,
      rgba(37, 99, 235, 0.22),
      transparent 24%
    ),
    linear-gradient(135deg, #dbeafe 0%, #eef6ff 52%, #f8fafc 100%);
}

.post-card__thumb::after,
.related-thumb::after {
  content: "";
  position: absolute;
  right: 18%;
  top: 34%;
  width: 32%;
  height: 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.75);
  box-shadow:
    0 18px 0 rgba(37, 99, 235, 0.55),
    0 36px 0 rgba(37, 99, 235, 0.38);
}

.related-card img,
.post-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.related-card h3,
.post-card h3 {
  margin: 0;
  padding: 15px;
  color: var(--color-heading);
  font-size: 0.98rem;
  line-height: 1.45;
  letter-spacing: -0.025em;
}

.post-card__body {
  padding: 15px;
}

.post-card__category {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 8px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--color-accent-soft);
  color: var(--color-accent);
  font-size: 0.74rem;
  font-weight: 800;
}

.post-card__body h3 {
  padding: 0;
  margin-bottom: 8px;
}

.post-card__meta {
  color: var(--color-muted);
  font-size: 0.85rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.tag-list a {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-size: 0.86rem;
  font-weight: 750;
}

.tag-list a:hover {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

/* 13. Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: #ffffff;
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 32px 24px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--color-muted);
  font-size: 0.92rem;
}

.footer-copy {
  flex: 0 0 auto;
}

.footer-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}

.footer-tagline {
  color: var(--color-muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.footer-link {
  color: var(--color-muted);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.18s ease;
}

.footer-link:hover {
  color: var(--color-heading);
}

/* 14. Responsive */
@media (max-width: 1100px) {
  .site-nav {
    display: none;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .header-inner {
    min-height: 66px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-meta {
    align-items: flex-start;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 1024px) {
  .article-layout {
    display: block;
  }

  .sidebar {
    width: 100%;
    margin-top: 28px;
  }

  .article-layout > .sidebar {
    position: static;
    top: auto;
    height: auto;
  }

  .sidebar-inner {
    position: static;
  }
}

@media (max-width: 1500px) and (min-width: 1201px) {
  .article-layout {
    gap: 18px;
  }

  .article-layout > .sidebar {
    flex-basis: 210px;
  }

  .widget {
    padding: 16px;
  }

  .search-box .search-category {
    min-width: 104px;
  }
}

@media (max-width: 960px) {
  .home-hero {
    grid-template-columns: 1fr;
  }

  .home-featured-layout {
    grid-template-columns: 1fr;
  }

  .category-directory {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media (max-width: 760px) {
  .header-inner {
    padding: 14px 18px;
  }

  .page-wrap {
    width: 100%;
    max-width: 100%;
    padding: 24px 16px 60px;
  }

  .article-layout {
    display: block;
    width: 100%;
    max-width: 100%;
  }

  .article-card {
    width: 100%;
    max-width: 100%;
    border-radius: 20px;
  }

  .category-hero {
    padding: 24px 20px;
  }

  .archive-title {
    font-size: 2rem;
    letter-spacing: -0.04em;
  }

  .home-hero {
    padding: 28px 22px;
    border-radius: 24px;
  }

  .home-title {
    font-size: 2.25rem;
    letter-spacing: -0.055em;
  }

  .home-hero__content p {
    font-size: 1rem;
  }

  .home-search,
  .archive-search {
    max-width: 100%;
  }

  .home-search .search-form,
  .home-search .search-box,
  .archive-search .search-form,
  .archive-search .search-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  .home-search .search-field,
  .home-search input[type="search"],
  .archive-search .search-field,
  .archive-search input[type="search"] {
    grid-column: 1 / -1;
    min-height: 52px;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
  }

  .home-search .search-category,
  .archive-search .search-category {
    min-width: 0;
    min-height: 52px;
    border: 1px solid var(--color-border) !important;
    border-radius: 16px;
    background-color: #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
  }

  .home-search .search-submit,
  .home-search button,
  .archive-search .search-submit,
  .archive-search button {
    min-height: 52px;
    border-radius: 16px;
    padding: 0 18px;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.16);
  }

  .home-hero__panel {
    padding: 20px;
    border-radius: 20px;
  }

  .archive-section__header--with-link {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-update-list,
  .home-category-grid {
    grid-template-columns: 1fr;
  }

  .home-update-card__top {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .article-header,
  .article-body-wrap {
    width: 100%;
    max-width: 100%;
    padding-left: 22px;
    padding-right: 22px;
  }

  .article-header {
    padding-top: 30px;
  }

  .article-title {
    font-size: 1.82rem;
    line-height: 1.22;
    letter-spacing: -0.04em;
    word-break: break-word;
  }

  .short-answer,
  .summary-box,
  .summary-item,
  .official-link,
  .toc-box,
  .notice-box,
  .faq-section,
  .ad-slot,
  .related-posts {
    width: 100%;
    max-width: 100%;
  }

  .article-content,
  .article-content > * {
    max-width: 100%;
  }

  .featured-image {
    min-height: 240px;
    font-size: 1.8rem;
  }

  .featured-image--has-image img {
    min-height: 0;
  }

  .sidebar {
    display: none;
  }

  .summary-box,
  .related-grid,
  .post-grid {
    grid-template-columns: 1fr;
  }

  .article-content {
    font-size: 16.5px;
    line-height: 1.8;
  }

  .footer-inner {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .site-logo {
    font-size: 1.25rem;
  }

  .mobile-menu-toggle {
    width: 44px;
    height: 44px;
  }

  .mobile-nav {
    grid-template-columns: 1fr;
  }

  .category-directory {
    grid-template-columns: 1fr;
  }
}
