/* Recovery Guide — Premium Design System */
:root {
  --rg-primary: #1a6b5a;
  --rg-primary-dark: #134d40;
  --rg-primary-light: #e8f5f1;
  --rg-accent: #c96b3c;
  --rg-accent-light: #fef3ed;
  --rg-neutral-900: #1a1a2e;
  --rg-neutral-700: #374151;
  --rg-neutral-500: #6b7280;
  --rg-neutral-300: #d1d5db;
  --rg-neutral-100: #f3f4f6;
  --rg-neutral-50: #f9fafb;
  --rg-white: #ffffff;
  --rg-bg: #fafbfc;
  --rg-font-body: 'Pretendard Variable', 'Pretendard', -apple-system, 'Noto Sans KR', sans-serif;
  --rg-font-heading: 'Noto Serif KR', 'Pretendard Variable', serif;
  --rg-radius-sm: 8px;
  --rg-radius-md: 12px;
  --rg-radius-lg: 20px;
  --rg-shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --rg-shadow-md: 0 4px 16px rgba(0,0,0,.08);
  --rg-shadow-lg: 0 12px 40px rgba(0,0,0,.1);
  --rg-max-width: 1200px;
  --rg-content-width: 780px;
  --rg-space-xs: 8px;
  --rg-space-sm: 16px;
  --rg-space-md: 24px;
  --rg-space-lg: 40px;
  --rg-space-xl: 64px;
  --rg-space-2xl: 96px;
  --rg-space-3xl: 128px;
}

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

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body, .wp-site-blocks {
  font-family: var(--rg-font-body) !important;
  font-size: 16px;
  line-height: 1.75;
  color: var(--rg-neutral-700);
  background: var(--rg-bg) !important;
  overflow-x: hidden;
}

/* === HEADER / NAV === */
.rg-header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(0,0,0,.06);
  transition: box-shadow .2s;
}
.rg-header.scrolled { box-shadow: var(--rg-shadow-sm); }
.rg-header-inner {
  max-width: var(--rg-max-width);
  margin: 0 auto;
  padding: 0 var(--rg-space-md);
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.rg-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--rg-neutral-900);
  font-weight: 700; font-size: 1.05rem;
  letter-spacing: -.02em;
}
.rg-logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--rg-primary), var(--rg-primary-dark));
  color: #fff; font-size: 1.1rem; font-weight: 800;
}
.rg-nav { display: flex; align-items: center; gap: 4px; }
.rg-nav a {
  padding: 8px 14px; border-radius: var(--rg-radius-sm);
  text-decoration: none; color: var(--rg-neutral-500);
  font-size: .88rem; font-weight: 500;
  transition: all .15s;
}
.rg-nav a:hover, .rg-nav a.active {
  color: var(--rg-primary); background: var(--rg-primary-light);
}
.rg-mobile-toggle {
  display: none; background: none; border: none;
  font-size: 1.4rem; color: var(--rg-neutral-700); cursor: pointer;
}

/* === HERO === */
.rg-hero {
  position: relative; overflow: hidden;
  min-height: 520px;
  display: flex; align-items: center;
  background: linear-gradient(135deg, var(--rg-neutral-900), #1e3a4f);
}
.rg-hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: .35;
}
.rg-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(26,26,46,.5) 0%, rgba(26,26,46,.85) 100%);
}
.rg-hero-content {
  position: relative; z-index: 2;
  max-width: var(--rg-max-width);
  margin: 0 auto; padding: var(--rg-space-3xl) var(--rg-space-md);
  width: 100%;
}
.rg-hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 16px; border-radius: 100px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.8); font-size: .78rem; font-weight: 500;
  margin-bottom: var(--rg-space-md);
  backdrop-filter: blur(8px);
}
.rg-hero h1 {
  font-family: var(--rg-font-heading);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 700; line-height: 1.2;
  color: var(--rg-white);
  letter-spacing: -.03em;
  margin-bottom: var(--rg-space-sm);
}
.rg-hero-desc {
  font-size: 1.1rem; line-height: 1.7;
  color: rgba(255,255,255,.7);
  max-width: 600px;
  margin-bottom: var(--rg-space-lg);
}
.rg-hero-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px; border-radius: var(--rg-radius-md);
  background: var(--rg-primary); color: var(--rg-white);
  text-decoration: none; font-weight: 600; font-size: .95rem;
  transition: all .2s; border: none; cursor: pointer;
}
.rg-hero-cta:hover {
  background: var(--rg-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26,107,90,.3);
}

/* === SECTIONS === */
.rg-section {
  max-width: var(--rg-max-width);
  margin: 0 auto;
  padding: var(--rg-space-2xl) var(--rg-space-md);
}
.rg-section-title {
  font-family: var(--rg-font-heading);
  font-size: 1.8rem; font-weight: 700;
  color: var(--rg-neutral-900);
  letter-spacing: -.02em;
  margin-bottom: var(--rg-space-xs);
}
.rg-section-subtitle {
  font-size: .95rem; color: var(--rg-neutral-500);
  margin-bottom: var(--rg-space-lg);
}

/* === CARD GRID === */
.rg-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--rg-space-md);
}
.rg-card {
  background: var(--rg-white);
  border-radius: var(--rg-radius-lg);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,.06);
  transition: all .25s cubic-bezier(.4,0,.2,1);
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column;
}
.rg-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--rg-shadow-lg);
  border-color: rgba(26,107,90,.15);
}
.rg-card-img {
  aspect-ratio: 16/9; overflow: hidden;
  position: relative;
}
.rg-card-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s cubic-bezier(.4,0,.2,1);
}
.rg-card:hover .rg-card-img img { transform: scale(1.05); }
.rg-card-body {
  padding: var(--rg-space-md);
  display: flex; flex-direction: column; flex: 1;
}
.rg-card-cat {
  font-size: .75rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .06em; color: var(--rg-primary);
  margin-bottom: var(--rg-space-xs);
}
.rg-card-title {
  font-family: var(--rg-font-heading);
  font-size: 1.15rem; font-weight: 700;
  color: var(--rg-neutral-900);
  line-height: 1.4; margin-bottom: var(--rg-space-xs);
  letter-spacing: -.01em;
}
.rg-card-excerpt {
  font-size: .88rem; color: var(--rg-neutral-500);
  line-height: 1.65; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.rg-card-meta {
  display: flex; align-items: center; gap: 12px;
  margin-top: var(--rg-space-sm);
  padding-top: var(--rg-space-sm);
  border-top: 1px solid var(--rg-neutral-100);
  font-size: .78rem; color: var(--rg-neutral-500);
}

/* === CAROUSEL === */
.rg-carousel {
  background: var(--rg-neutral-50);
  padding: var(--rg-space-2xl) 0;
}
.rg-carousel-inner {
  max-width: var(--rg-max-width);
  margin: 0 auto; padding: 0 var(--rg-space-md);
}
.rg-carousel-track {
  display: flex; gap: var(--rg-space-md);
  overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; padding-bottom: var(--rg-space-sm);
}
.rg-carousel-track::-webkit-scrollbar { display: none; }
.rg-carousel-item {
  min-width: 300px; max-width: 380px; flex-shrink: 0;
  scroll-snap-align: start;
  background: var(--rg-white);
  border-radius: var(--rg-radius-lg);
  overflow: hidden; border: 1px solid rgba(0,0,0,.06);
  transition: all .2s;
}
.rg-carousel-item:hover { box-shadow: var(--rg-shadow-md); }
.rg-carousel-item img {
  width: 100%; aspect-ratio: 16/10; object-fit: cover;
}
.rg-carousel-item-body {
  padding: var(--rg-space-sm) var(--rg-space-md) var(--rg-space-md);
}
.rg-carousel-item-title {
  font-weight: 700; font-size: 1rem;
  color: var(--rg-neutral-900); margin-bottom: 4px;
}
.rg-carousel-item-desc {
  font-size: .85rem; color: var(--rg-neutral-500); line-height: 1.6;
}

/* === SINGLE POST === */
.rg-single { max-width: var(--rg-content-width); margin: 0 auto; padding: var(--rg-space-xl) var(--rg-space-md) var(--rg-space-3xl); }
.rg-single-header { margin-bottom: var(--rg-space-lg); }
.rg-single-cat {
  display: inline-block; padding: 4px 14px;
  border-radius: 100px; background: var(--rg-primary-light);
  color: var(--rg-primary); font-size: .78rem; font-weight: 600;
  margin-bottom: var(--rg-space-sm);
}
.rg-single h1 {
  font-family: var(--rg-font-heading);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700; line-height: 1.3;
  color: var(--rg-neutral-900);
  letter-spacing: -.02em;
}
.rg-single-meta {
  display: flex; align-items: center; gap: 16px;
  margin-top: var(--rg-space-sm);
  font-size: .85rem; color: var(--rg-neutral-500);
}
.rg-single-hero-img {
  width: 100%; border-radius: var(--rg-radius-lg);
  aspect-ratio: 16/9; object-fit: cover;
  margin-bottom: var(--rg-space-lg);
}

/* === ARTICLE BODY === */
.rg-article { font-size: 1.05rem; line-height: 1.8; color: var(--rg-neutral-700); }
.rg-article h2 {
  font-family: var(--rg-font-heading);
  font-size: 1.45rem; font-weight: 700;
  color: var(--rg-neutral-900);
  margin: var(--rg-space-xl) 0 var(--rg-space-sm);
  padding-bottom: var(--rg-space-xs);
  border-bottom: 2px solid var(--rg-primary-light);
  letter-spacing: -.01em;
}
.rg-article h3 {
  font-size: 1.15rem; font-weight: 700;
  color: var(--rg-neutral-900);
  margin: var(--rg-space-lg) 0 var(--rg-space-xs);
}
.rg-article p { margin-bottom: var(--rg-space-sm); }
.rg-article ul, .rg-article ol {
  margin: var(--rg-space-sm) 0; padding-left: 1.5em;
}
.rg-article li { margin-bottom: 6px; }
.rg-article img {
  max-width: 100%; height: auto;
  border-radius: var(--rg-radius-md);
  margin: var(--rg-space-md) 0;
}
.rg-article a { color: var(--rg-primary); text-decoration: underline; text-underline-offset: 2px; }
.rg-article a:hover { color: var(--rg-primary-dark); }

/* Tables */
.rg-article table {
  width: 100%; border-collapse: collapse;
  margin: var(--rg-space-md) 0;
  font-size: .92rem;
  border-radius: var(--rg-radius-md);
  overflow: hidden;
  border: 1px solid var(--rg-neutral-300);
}
.rg-article th {
  background: var(--rg-primary);
  color: var(--rg-white);
  padding: 12px 16px;
  font-weight: 600; text-align: left;
  font-size: .85rem;
}
.rg-article td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--rg-neutral-100);
}
.rg-article tr:nth-child(even) td { background: var(--rg-neutral-50); }
.rg-article tr:hover td { background: var(--rg-primary-light); }

/* Blockquote / Callout */
.rg-article blockquote, .rg-callout {
  background: var(--rg-primary-light);
  border-left: 4px solid var(--rg-primary);
  border-radius: 0 var(--rg-radius-md) var(--rg-radius-md) 0;
  padding: var(--rg-space-sm) var(--rg-space-md);
  margin: var(--rg-space-md) 0;
  font-size: .95rem;
  color: var(--rg-primary-dark);
}
.rg-warning {
  background: #fef3cd;
  border-left: 4px solid #f59e0b;
  border-radius: 0 var(--rg-radius-md) var(--rg-radius-md) 0;
  padding: var(--rg-space-sm) var(--rg-space-md);
  margin: var(--rg-space-md) 0;
  font-size: .92rem;
  color: #92400e;
}

/* Checklist */
.rg-checklist {
  list-style: none; padding: 0;
  margin: var(--rg-space-md) 0;
}
.rg-checklist li {
  padding: 10px 16px 10px 44px;
  position: relative;
  background: var(--rg-white);
  border: 1px solid var(--rg-neutral-100);
  border-radius: var(--rg-radius-sm);
  margin-bottom: 8px;
  font-size: .92rem;
}
.rg-checklist li::before {
  content: ''; position: absolute; left: 16px; top: 14px;
  width: 18px; height: 18px; border-radius: 4px;
  border: 2px solid var(--rg-primary);
}

/* Step Cards */
.rg-steps {
  display: flex; flex-direction: column; gap: 16px;
  margin: var(--rg-space-md) 0;
}
.rg-step {
  display: flex; gap: 16px; align-items: flex-start;
  padding: var(--rg-space-sm) var(--rg-space-md);
  background: var(--rg-white);
  border: 1px solid var(--rg-neutral-100);
  border-radius: var(--rg-radius-md);
}
.rg-step-num {
  flex-shrink: 0;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--rg-primary); color: var(--rg-white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .9rem;
}
.rg-step-content { flex: 1; }
.rg-step-title { font-weight: 700; color: var(--rg-neutral-900); margin-bottom: 4px; }
.rg-step-desc { font-size: .88rem; color: var(--rg-neutral-500); }

/* === FOOTER === */
.rg-footer {
  background: var(--rg-neutral-900);
  color: rgba(255,255,255,.6);
  padding: var(--rg-space-xl) var(--rg-space-md) var(--rg-space-lg);
}
.rg-footer-inner {
  max-width: var(--rg-max-width);
  margin: 0 auto;
}
.rg-footer-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  flex-wrap: wrap; gap: var(--rg-space-lg);
  padding-bottom: var(--rg-space-lg);
  border-bottom: 1px solid rgba(255,255,255,.1);
}
.rg-footer-brand {
  font-size: 1.1rem; font-weight: 700;
  color: var(--rg-white); margin-bottom: 8px;
}
.rg-footer-desc { font-size: .85rem; max-width: 360px; line-height: 1.6; }
.rg-footer-links { display: flex; gap: var(--rg-space-xl); flex-wrap: wrap; }
.rg-footer-col h4 {
  color: var(--rg-white); font-size: .82rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: var(--rg-space-sm);
}
.rg-footer-col a {
  display: block; color: rgba(255,255,255,.55);
  text-decoration: none; font-size: .85rem;
  padding: 3px 0; transition: color .15s;
}
.rg-footer-col a:hover { color: var(--rg-white); }
.rg-footer-bottom {
  margin-top: var(--rg-space-lg);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
  font-size: .78rem;
}
.rg-footer-legal {
  font-size: .78rem; color: rgba(255,255,255,.4);
  margin-top: var(--rg-space-md);
  line-height: 1.7;
  padding: var(--rg-space-sm);
  background: rgba(255,255,255,.03);
  border-radius: var(--rg-radius-sm);
}

/* === PAGE TEMPLATE === */
.rg-page { max-width: var(--rg-content-width); margin: 0 auto; padding: var(--rg-space-xl) var(--rg-space-md) var(--rg-space-3xl); }
.rg-page h1 {
  font-family: var(--rg-font-heading);
  font-size: 1.8rem; font-weight: 700;
  color: var(--rg-neutral-900);
  margin-bottom: var(--rg-space-lg);
  padding-bottom: var(--rg-space-sm);
  border-bottom: 2px solid var(--rg-primary-light);
}
.rg-page-content { font-size: .95rem; line-height: 1.8; color: var(--rg-neutral-700); }
.rg-page-content h2 {
  font-size: 1.25rem; font-weight: 700;
  color: var(--rg-neutral-900);
  margin: var(--rg-space-lg) 0 var(--rg-space-sm);
}
.rg-page-content p { margin-bottom: var(--rg-space-sm); }
.rg-page-content ul, .rg-page-content ol { margin: var(--rg-space-sm) 0; padding-left: 1.5em; }
.rg-page-content li { margin-bottom: 6px; }

/* Legal notices in posts */
.legal-notice, .ai-notice {
  font-size: .85em !important;
}

/* TOC */
.rg-toc {
  background: var(--rg-neutral-50);
  border: 1px solid var(--rg-neutral-100);
  border-radius: var(--rg-radius-md);
  padding: var(--rg-space-md);
  margin-bottom: var(--rg-space-lg);
}
.rg-toc-title {
  font-weight: 700; font-size: .9rem; color: var(--rg-neutral-900);
  margin-bottom: var(--rg-space-xs);
}
.rg-toc ol { padding-left: 1.2em; margin: 0; }
.rg-toc li { margin-bottom: 6px; font-size: .88rem; }
.rg-toc a { color: var(--rg-neutral-500); text-decoration: none; }
.rg-toc a:hover { color: var(--rg-primary); }

/* Related posts */
.rg-related {
  margin-top: var(--rg-space-xl);
  padding-top: var(--rg-space-lg);
  border-top: 1px solid var(--rg-neutral-100);
}
.rg-related-title {
  font-family: var(--rg-font-heading);
  font-size: 1.3rem; font-weight: 700;
  color: var(--rg-neutral-900);
  margin-bottom: var(--rg-space-md);
}
.rg-related-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 16px;
}
.rg-related-card {
  display: flex; gap: 12px; align-items: center;
  padding: 12px; border-radius: var(--rg-radius-md);
  background: var(--rg-neutral-50);
  text-decoration: none; transition: all .2s;
}
.rg-related-card:hover {
  background: var(--rg-primary-light);
  transform: translateY(-2px);
}
.rg-related-card img {
  width: 72px; height: 54px; border-radius: var(--rg-radius-sm);
  object-fit: cover; flex-shrink: 0;
}
.rg-related-card span {
  font-size: .88rem; font-weight: 600;
  color: var(--rg-neutral-900); line-height: 1.4;
}

/* === ANIMATIONS === */
@media (prefers-reduced-motion: no-preference) {
  .rg-fade-in {
    opacity: 0; transform: translateY(20px);
    transition: opacity .5s, transform .5s;
  }
  .rg-fade-in.visible { opacity: 1; transform: translateY(0); }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .rg-header-inner { height: 56px; }
  .rg-nav { display: none; }
  .rg-mobile-toggle { display: block; }
  .rg-nav.open {
    display: flex; flex-direction: column;
    position: absolute; top: 56px; left: 0; right: 0;
    background: var(--rg-white);
    padding: var(--rg-space-sm);
    border-bottom: 1px solid var(--rg-neutral-100);
    box-shadow: var(--rg-shadow-md);
  }
  .rg-hero { min-height: 420px; }
  .rg-hero h1 { font-size: 1.8rem; }
  .rg-hero-desc { font-size: .95rem; }
  .rg-card-grid { grid-template-columns: 1fr; }
  .rg-section { padding: var(--rg-space-xl) var(--rg-space-sm); }
  .rg-single { padding: var(--rg-space-lg) var(--rg-space-sm) var(--rg-space-2xl); }
  .rg-footer-top { flex-direction: column; }
  .rg-footer-links { flex-direction: column; gap: var(--rg-space-md); }
  .rg-footer-bottom { flex-direction: column; text-align: center; }
  .rg-carousel-item { min-width: 280px; }
  .rg-article table { font-size: .82rem; display: block; overflow-x: auto; }
  .rg-related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .rg-hero { min-height: 360px; }
  .rg-hero h1 { font-size: 1.5rem; }
  .rg-card-body { padding: var(--rg-space-sm); }
  .rg-single h1 { font-size: 1.4rem; }
}

/* Override WP block editor styles */
.wp-site-blocks > * { max-width: none !important; }
.entry-content, .wp-block-post-content { max-width: none !important; padding: 0 !important; }
.has-global-padding { padding: 0 !important; }
