:is(.dohwa-feature, .cn-feature-article) {
  --dohwa-feature-ink: #3b2a3c;
  --dohwa-feature-copy: #4f4652;
  --dohwa-feature-muted: #715f73;
  --dohwa-feature-accent: #744760;
  --dohwa-feature-line: #e8dfe6;
  --dohwa-feature-nav-bg: #f9f2f4;
  --dohwa-feature-close-bg: #f6ecf3;
  --dohwa-feature-serif: "Noto Serif KR", "Nanum Myeongjo", AppleMyungjo, Batang, "바탕", serif;
}

.dohwa-feature {
  --dohwa-tone-ink: var(--dohwa-feature-accent);
  --dohwa-tone-fill: var(--dohwa-feature-nav-bg);
  --dohwa-tone-line: var(--dohwa-feature-line);
  container: dohwa-archive-feature / inline-size;
  color: var(--dohwa-feature-copy);
  font-size: clamp(.975rem, .94rem + .2vw, 1.075rem);
  line-height: 1.72;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.dohwa-feature .dohwa-tone-wood {
  --dohwa-tone-ink: #36574a;
  --dohwa-tone-fill: #eaf2e8;
  --dohwa-tone-line: #d3e3cf;
}

.dohwa-feature .dohwa-tone-fire {
  --dohwa-tone-ink: #843e48;
  --dohwa-tone-fill: #faeeeb;
  --dohwa-tone-line: #eed4ce;
}

.dohwa-feature .dohwa-tone-earth {
  --dohwa-tone-ink: #6f502c;
  --dohwa-tone-fill: #f6efe2;
  --dohwa-tone-line: #ead9bd;
}

.dohwa-feature .dohwa-tone-metal {
  --dohwa-tone-ink: #5a4775;
  --dohwa-tone-fill: #f1edf7;
  --dohwa-tone-line: #e2d9ef;
}

.dohwa-feature .dohwa-tone-water {
  --dohwa-tone-ink: #305670;
  --dohwa-tone-fill: #e8f2f7;
  --dohwa-tone-line: #d0e3ee;
}

.dohwa-feature > p { margin: 0 0 .7em; }
.dohwa-feature > p > strong { color: var(--dohwa-feature-accent); }

.dohwa-feature :is(.dohwa-feature-eyebrow, .dohwa-feature-nav-heading strong, .dohwa-feature-closing strong) {
  color: var(--dohwa-feature-accent);
  font-weight: 700;
}

.dohwa-feature .dohwa-feature-nav {
  margin: 1.25rem 0 .25rem;
  padding: clamp(.65rem, 3cqi, .95rem);
  background: var(--dohwa-feature-nav-bg);
  border: 1px solid var(--dohwa-feature-line);
  border-radius: 14px;
}

.dohwa-feature .dohwa-feature-nav-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .15rem .65rem;
  margin-bottom: .65rem;
}

.dohwa-feature .dohwa-feature-nav-heading span {
  color: var(--dohwa-feature-muted);
  font-size: .78em;
}

.dohwa-feature .dohwa-feature-nav-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .35rem;
}

.dohwa-feature .dohwa-feature-matrix {
  display: table;
  width: 100%;
  margin: 0;
  border-collapse: separate;
  border-spacing: .35rem;
  table-layout: fixed;
  font-size: .9em;
  line-height: 1.35;
}

.dohwa-feature .dohwa-feature-matrix :is(th, td) {
  padding: 0;
  border: 0;
  background: none;
  text-align: center;
}

.dohwa-feature .dohwa-feature-matrix thead th {
  padding-bottom: .15rem;
  color: var(--dohwa-feature-muted);
  font-size: .87em;
  font-weight: 700;
}

.dohwa-feature .dohwa-feature-matrix thead th:first-child { width: 15%; }
.dohwa-feature .dohwa-feature-matrix thead th:not(:first-child) { color: var(--dohwa-tone-ink); }

.dohwa-feature .dohwa-feature-matrix tbody th {
  padding: .25rem .3rem;
  border: 1px solid var(--dohwa-tone-line);
  border-radius: 9px;
  background: var(--dohwa-tone-fill);
  color: var(--dohwa-tone-ink);
  font-weight: 700;
}

.dohwa-feature :is(.dohwa-feature-nav-grid > a, .dohwa-feature-matrix td > a) {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 44px;
  padding: .35rem .25rem;
  border: 1px solid var(--dohwa-tone-line);
  border-radius: 9px;
  background: var(--dohwa-tone-fill);
  color: var(--dohwa-tone-ink);
  font-size: .88em;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
}

.dohwa-feature .dohwa-feature-matrix td > a {
  box-sizing: border-box;
  padding-inline: .12rem;
  font-size: 1em;
}

.dohwa-feature :is(.dohwa-feature-nav-grid > a, .dohwa-feature-matrix td > a):hover { text-decoration: underline; }

.dohwa-feature :is(.dohwa-feature-nav-grid > a, .dohwa-feature-matrix td > a):focus-visible {
  outline: 2px solid var(--dohwa-tone-ink);
  outline-offset: 2px;
}

@container dohwa-archive-feature (max-width: 325px) {
  .dohwa-feature .dohwa-feature-nav-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dohwa-feature .dohwa-feature-matrix { border-spacing: .25rem; }
  .dohwa-feature .dohwa-feature-matrix thead th span {
    display: block;
    font-size: .9em;
  }
  .dohwa-feature .dohwa-feature-matrix tbody th { padding-inline: .1rem; }
}

@container dohwa-archive-feature (max-width: 220px) {
  .dohwa-feature .dohwa-feature-nav-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dohwa-feature .dohwa-feature-matrix {
    border-spacing: .12rem .25rem;
    font-size: .8em;
  }
  .dohwa-feature .dohwa-feature-matrix td > a { padding-inline: 0; }
}

.dohwa-feature .dohwa-feature-section {
  padding-block: clamp(1rem, 4cqi, 1.25rem);
  border-bottom: 1px solid var(--dohwa-feature-line);
  scroll-margin-top: 5rem;
}

.dohwa-feature .dohwa-feature-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(.45rem, 3cqi, .85rem);
  margin-bottom: .65rem;
}

.dohwa-feature .dohwa-feature-symbol {
  display: grid;
  place-items: center;
  inline-size: clamp(2.15rem, 12cqi, 3rem);
  aspect-ratio: 1;
  border: 1px solid var(--dohwa-tone-line);
  border-radius: 11px;
  background: var(--dohwa-tone-fill);
  color: var(--dohwa-tone-ink);
  font-family: var(--dohwa-feature-serif);
  font-size: clamp(1.3rem, 7cqi, 1.65rem);
  font-weight: 700;
  line-height: 1;
}

.dohwa-feature .dohwa-feature-heading .dohwa-feature-name {
  margin: 0;
  color: var(--dohwa-feature-ink);
  font-family: var(--dohwa-feature-serif);
  font-size: clamp(1.3rem, 5.6cqi, 1.65rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.025em;
}

.dohwa-feature .dohwa-feature-hanja {
  color: var(--dohwa-tone-ink);
  font-family: inherit;
  font-size: .66em;
  letter-spacing: 0;
  white-space: nowrap;
}

.dohwa-feature .dohwa-feature-heading .dohwa-feature-subtitle {
  margin: .12rem 0 0;
  color: var(--dohwa-feature-muted);
  font-size: .85em;
  line-height: 1.45;
}

.dohwa-feature .dohwa-feature-index {
  align-self: start;
  margin-top: .12rem;
  color: var(--dohwa-feature-muted);
  font-size: .78em;
  font-variant-numeric: tabular-nums;
}

.dohwa-feature .dohwa-feature-section > p { margin: 0 0 .7rem; }

.dohwa-feature .dohwa-feature-callout {
  padding: .65rem .8rem;
  border-inline-start: 3px solid var(--dohwa-tone-line);
  border-radius: 9px;
  background: var(--dohwa-tone-fill);
  font-size: .95em;
  line-height: 1.65;
}

.dohwa-feature .dohwa-feature-callout > strong {
  display: block;
  color: var(--dohwa-tone-ink);
  font-size: .93em;
}

.dohwa-feature .dohwa-feature-callout > p { margin: .1rem 0 0; }

.dohwa-feature .dohwa-feature-closing {
  margin: 1.05rem 0 .85rem;
  padding: .85rem .9rem 1rem;
  border: 1px solid var(--dohwa-feature-line);
  border-radius: 13px;
  background: var(--dohwa-feature-close-bg);
}

.dohwa-feature .dohwa-feature-closing > p {
  margin: .25rem 0 0;
  color: var(--dohwa-feature-ink);
  font-family: var(--dohwa-feature-serif);
  font-size: 1.13em;
  font-weight: 700;
  line-height: 1.55;
}

.dohwa-feature > .dohwa-feature-note {
  margin-bottom: .4rem;
  color: var(--dohwa-feature-muted);
  font-size: .81em;
  line-height: 1.65;
}

.cn-feature-article .dohwa-feature-title {
  margin-block: 1.1rem .85rem;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.cn-feature-article .dohwa-feature-title .dohwa-feature-eyebrow {
  margin: 0 0 .3rem;
  color: var(--dohwa-feature-accent);
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.5;
}

.cn-feature-article .dohwa-feature-title h1 {
  margin: 0;
  color: var(--dohwa-feature-ink);
  font-family: var(--dohwa-feature-serif);
  font-size: clamp(1.7rem, 6.7vw, 2.3rem);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -.035em;
}

.cn-feature-article .dohwa-feature-title time {
  display: block;
  margin-top: .55rem;
  color: var(--dohwa-feature-muted);
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
}

.cn-feature-article .cn-part-figure {
  overflow: hidden;
  border-radius: 13px;
}

.cn-feature-article .cn-prose.cn-rich-body:has(.dohwa-feature) { margin-top: 1rem; }

html[data-theme="dark"] :is(.dohwa-feature, .cn-feature-article) {
  --dohwa-feature-ink: #f0e5ef;
  --dohwa-feature-copy: #dad1dd;
  --dohwa-feature-muted: #c8b6cb;
  --dohwa-feature-accent: #ebbbd4;
  --dohwa-feature-line: #4e3d54;
  --dohwa-feature-nav-bg: #342735;
  --dohwa-feature-close-bg: #3c2b40;
}

html[data-theme="dark"] .dohwa-feature .dohwa-tone-wood {
  --dohwa-tone-ink: #bfdfc7;
  --dohwa-tone-fill: #273b33;
  --dohwa-tone-line: #3f594b;
}

html[data-theme="dark"] .dohwa-feature .dohwa-tone-fire {
  --dohwa-tone-ink: #f3bdc6;
  --dohwa-tone-fill: #492f39;
  --dohwa-tone-line: #66434e;
}

html[data-theme="dark"] .dohwa-feature .dohwa-tone-earth {
  --dohwa-tone-ink: #ecd2a7;
  --dohwa-tone-fill: #41362b;
  --dohwa-tone-line: #60503b;
}

html[data-theme="dark"] .dohwa-feature .dohwa-tone-metal {
  --dohwa-tone-ink: #dbc8f8;
  --dohwa-tone-fill: #382f47;
  --dohwa-tone-line: #514465;
}

html[data-theme="dark"] .dohwa-feature .dohwa-tone-water {
  --dohwa-tone-ink: #b9dcef;
  --dohwa-tone-fill: #283b49;
  --dohwa-tone-line: #3c586d;
}

html[data-theme="dark"] .dohwa-feature :is(.dohwa-feature-nav-grid > a, .dohwa-feature-matrix td > a) { color: var(--dohwa-tone-ink); }
