/* 해킹 피해 기업 현황 — newsroom UI (UIUX v1.2 deck); fonts via /fonts/pretendard-dynamic.css */

:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --secondary: #4b5563;
  --muted: #6b7280;
  --primary: #1d4ed8;
  --danger: #b91c1c;
  --chip-bg: #f3f4f6;
  --chip-text: #374151;
  --chart-1: #1d4ed8;
  --chart-2: #3b82f6;
  --chart-3: #93c5fd;
  --chart-4: #dbeafe;
  --chart-other: #9ca3af;
  --ok: #047857;
  --warn: #b45309;
  --radius: 12px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-banner: 0 2px 8px rgba(0, 0, 0, 0.08);
  --font: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo',
    'Malgun Gothic', 'Noto Sans KR', sans-serif;
  --max: 720px;
  --ad-banner-h: 64px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

html.has-ad-banner body {
  padding-bottom: calc(var(--ad-banner-h) + env(safe-area-inset-bottom, 0px) + 16px);
}
html.ad-banner-dismissed body { padding-bottom: 0; }

a { color: var(--primary); text-underline-offset: 2px; }
a:hover, a:focus-visible { text-decoration-thickness: 2px; }
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
/* Programmatic focus (e.g. heading after button nav) must not draw a ring */
:focus:not(:focus-visible) {
  outline: none;
}
/* Card heading is a tabindex=-1 SR target, not a control — never paint a focus ring on it */
.card-company:focus,
.card-company:focus-visible,
.card-company a:focus,
.card-company a:focus-visible {
  outline: none;
}
/* #deck is tabindex=0 for keyboard entry; ring would paint a full-width blue box around the stack */
.deck:focus,
.deck:focus-visible {
  outline: none;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--primary); color: #fff; padding: 8px 16px; z-index: 20;
}
.skip:focus { left: 0; }

.wrap {
  width: min(100% - 32px, var(--max));
  margin-inline: auto;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 24px 0 20px;
  margin-bottom: 32px;
}
.brand {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.brand a { color: inherit; text-decoration: none; }
.tagline {
  margin: 8px 0 0;
  color: var(--secondary);
  font-size: 15px;
}
.updated {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 768px) {
  .brand { font-size: 28px; }
  .tagline { font-size: 16px; }
  body { font-size: 16px; }
}

/* Summary */
.overview {
  margin-bottom: 32px;
}
.overview h2,
.section-title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
@media (min-width: 768px) {
  .overview h2,
  .section-title { font-size: 20px; }
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
  align-items: start;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.stat-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}
.stat-value {
  display: block;
  font-size: clamp(22px, 6.4vw, 32px);
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
}
.stat-unit {
  display: inline;
  font-size: 18px;
  font-weight: 600;
  margin-left: 0.15em;
  letter-spacing: 0;
}
.stat-note {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.chart-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.chart-block h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--secondary);
}
.month-chart {
  width: 100%;
  height: auto;
  display: block;
}
.month-chart .bar-current { fill: var(--chart-1); }
.month-chart .bar-past { fill: var(--chart-3); }
.month-chart .axis {
  fill: var(--muted);
  font-size: 10px;
  font-family: var(--font);
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.leak-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.leak-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}
.leak-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.leak-track {
  grid-column: 1 / -1;
  height: 8px;
  background: var(--chip-bg);
  border-radius: 3px;
  overflow: hidden;
}
.leak-fill {
  height: 100%;
  border-radius: 3px 0 0 3px;
  background: var(--chart-2);
}
.leak-fill.leak-other { background: var(--chart-other); }
.leak-count {
  text-align: right;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
.leak-row-inner {
  display: contents;
}

/* Deck (UIUX v1.2) — enabled under html.js; no-JS = vertical card list */
.deck-controls {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  max-width: 560px;
  margin-inline: auto;
  width: min(100%, 560px);
}
html.js .deck-controls { display: flex; }
.deck-btn {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.deck-btn[aria-disabled='true'],
.deck-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.deck-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.deck-indicator {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.deck-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.deck-hint[hidden] { display: none !important; }
.deck-progress {
  display: none;
  max-width: 560px;
  width: min(100%, 560px);
  margin: 0 auto 12px;
  height: 3px;
  background: #E5E7EB;
  border-radius: 2px;
  overflow: hidden;
}
html.js .deck-progress { display: block; }
.deck-progress-fill {
  height: 100%;
  width: 0%;
  background: #1D4ED8;
  border-radius: 2px;
  transition: width 0.25s ease;
}
@media (prefers-reduced-motion: reduce) {
  .deck-progress-fill { transition: none; }
}

.deck-section {
  margin-bottom: 32px;
  /* keep deck column inset with the rest of .wrap (16px sides on mobile) */
  padding-inline: 0;
}
.deck {
  position: relative;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  touch-action: pan-y;
  overflow: visible;
}
html.js .deck {
  transition: height 0.25s ease;
  /* room for +2 translateY(16px) stack edge under active card */
  margin-bottom: 4px;
}
@media (prefers-reduced-motion: reduce) {
  html.js .deck { transition: height 0.12s ease; }
  html.js .deck.is-crossfade .card.is-active { opacity: 0.85; }
}

/* No-JS: vertical list of cards */
.deck > .card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 12px;
}
html.js .deck > .card {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  margin-bottom: 0;
  width: 100%;
  transform-origin: center top;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
html.js .deck > .card.is-active {
  position: relative;
}
html.js .deck > .card.is-behind {
  /* top edge peeks under active via translateY from JS */
  pointer-events: none;
}
.deck-zone {
  display: none;
}
html.js .deck-zone {
  display: block;
  position: absolute;
  top: 0;
  bottom: 0;
  width: 18%;
  z-index: 1;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
html.js .deck-zone-prev { left: 0; }
html.js .deck-zone-next { right: 0; }
/* Zones sit under interactive card content (active card pointer-events + stacking) */
html.js .deck > .card.is-active {
  z-index: 5;
  pointer-events: none;
}
html.js .deck > .card.is-active a,
html.js .deck > .card.is-active button,
html.js .deck > .card.is-active .chips,
html.js .deck > .card.is-active .expand-panel,
html.js .deck > .card.is-active summary {
  pointer-events: auto;
  position: relative;
  z-index: 2;
}
html.js .deck-zone { z-index: 4; }


/* Card inner (restored — was dropped with .pager/.page removal) */
.card-row1 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.card-company {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
@media (min-width: 768px) {
  .card-company { font-size: 17px; }
}
.card-company a {
  color: inherit;
  text-decoration: none;
  font-weight: inherit;
}
.card-company a:hover { color: var(--primary); }
.card-date {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.card-row2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.card-affected {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.card-affected.severity-high { color: var(--danger); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
}
.chip {
  display: inline-block;
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: 12px;
  border-radius: 6px;
  padding: 2px 8px;
  line-height: 1.4;
  list-style: none;
}

.card-row3 {
  margin-top: 12px;
  margin-bottom: 12px;
  font-size: 13px;
}
.chips + .card-row3 { margin-top: 0; }
.card-sources {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.card-sources li { list-style: none; }
.card-sources a { text-decoration: none; }
.card-sources a:hover,
.card-sources a:focus-visible { text-decoration: underline; }

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--chip-bg);
  color: var(--muted);
  white-space: nowrap;
}
.status-sanction { color: var(--danger); border-color: #fecaca; background: #fef2f2; }
.status-open { color: var(--warn); border-color: #fde68a; background: #fffbeb; }
.status-notice { color: var(--ok); border-color: #a7f3d0; background: #ecfdf5; }

.stmts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.stmt { font-size: 14px; color: var(--text); }
.st-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 4px;
  vertical-align: 0.05em;
  border: 1px solid var(--border);
  background: transparent;
}
.st-confirmed { color: var(--ok); border-color: var(--ok); }
.st-unverified { color: var(--warn); border-color: var(--warn); }
.st-claim { color: var(--danger); border-color: var(--danger); }
.fn {
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  margin-left: 2px;
  white-space: nowrap;
}

.card-more {
  margin-top: 12px;
  font-size: 13px;
}
.card-details {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.card-details summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--secondary);
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* Detail pages */
.crumb { margin: 0 0 16px; font-size: 14px; }
.detail header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.detail h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
@media (min-width: 768px) {
  .detail h1 { font-size: 28px; }
}
.meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin: 0 0 24px;
  font-size: 14px;
}
.meta dt { margin: 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.meta dd { margin: 2px 0 0; }
.figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 0 0 16px;
}
.fig {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}
.fig-label { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.fig-value { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fig-value small { font-weight: 400; color: var(--muted); font-size: 13px; }
.detail h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 24px 0 12px;
}
.leak-list {
  margin: 0; padding: 0; list-style: none;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.leak-list li {
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: 12px;
  border-radius: 6px;
  padding: 2px 8px;
}
.timeline {
  margin: 0; padding: 0; list-style: none;
  border-left: 2px solid var(--border);
}
.timeline li { padding: 0 0 16px 16px; position: relative; }
.timeline li::before {
  content: '';
  position: absolute; left: -5px; top: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary);
}
.timeline time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.timeline p { margin: 4px 0; }
.tl-src { font-size: 13px; }
.sources { list-style: none; padding: 0; margin: 0; }
.sources li { margin-bottom: 12px; }
.src-num { font-weight: 700; font-variant-numeric: tabular-nums; margin-right: 4px; }
.src-type {
  display: inline-block;
  margin-left: 6px;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 6px;
}
.src-pub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.corrections { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.correction {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: var(--bg);
}
.correction del { color: var(--muted); }
.correction .reason { color: var(--muted); font-size: 13px; margin: 4px 0 0; }

/* Static prose pages */
.prose { max-width: var(--max); }
.prose h1 {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.prose h2 {
  margin: 32px 0 12px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.prose p, .prose li { color: var(--text); font-size: 15px; }
.prose ul { padding-left: 1.25rem; }
.prose .meta-line { color: var(--muted); font-size: 13px; }

/* Footer */
.site-footer {
  margin: 48px auto 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 12px;
}
.site-footer a { color: var(--primary); }

/* Floating Partners banner */
.ad-banner {
  position: fixed;
  left: 50%;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: min(calc(100% - 16px), var(--max));
  min-height: 56px;
  max-height: 72px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-banner);
}
.ad-banner[hidden] { display: none !important; }
.ad-banner__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ad-banner__link {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ad-banner__link:hover { color: var(--primary); text-decoration: underline; }
.ad-banner__disclosure {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ad-banner__close {
  flex: none;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
}
.ad-banner__close:hover { color: var(--text); background: var(--chip-bg); }

/* Card density / progressive disclosure */
.stmt-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-figure {
  margin: 0 0 12px;
  font-size: 15px;
}
.card-figure .fig-label { font-size: 12px; color: var(--muted); font-weight: 600; margin-right: 6px; }
.card-figure .fig-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.chip-more {
  background: transparent;
  color: var(--muted);
  border: 1px dashed var(--border);
}
.expand-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--secondary);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}
.expand-btn:hover { border-color: var(--primary); color: var(--primary); }
.expand-panel[hidden] { display: none !important; }
.expand-panel { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

.status-other {
  color: var(--muted);
  background: var(--chip-bg);
  border-color: var(--border);
}

/* WCAG 2.5.8: enlarge footnote hit area, keep visual size */
.fn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  padding: 4px;
  margin: -4px 0 -4px 2px;
  vertical-align: middle;
}

.card-head-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.month-chart .chart-baseline { stroke: #e5e7eb; stroke-width: 1; }
.month-chart .bar-val {
  fill: #4b5563;
  font-family: var(--font);
}
.month-chart { overflow: visible; }
.stat-sublabel {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 2px;
}
.ad-banner__title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin: 0;
}
.ad-banner__ad-label {
  flex: none;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 4px;
  line-height: 1.4;
}
