/* v35: clearer colour and structure for the English prefix / suffix maps.
   Loaded after each page's inline styles; affix-map.js adds data-accent hooks. */

:root {
  --text-dim: #c4ccdc;
  --text-faint: #96a1b6;
}

/* One accent per card, taken from its existing data-color. */
.suffix-card,
[data-accent] { --accent: #ffd166; --accent-rgb: 255,209,102; }
.suffix-card[data-color="blue"],   [data-accent="blue"]   { --accent: #6cb4ff; --accent-rgb: 108,180,255; }
.suffix-card[data-color="teal"],   [data-accent="teal"]   { --accent: #5fe0d6; --accent-rgb: 95,224,214; }
.suffix-card[data-color="pink"],   [data-accent="pink"]   { --accent: #ff7fab; --accent-rgb: 255,127,171; }
.suffix-card[data-color="purple"], [data-accent="purple"] { --accent: #c39bff; --accent-rgb: 195,155,255; }
.suffix-card[data-color="orange"], [data-accent="orange"] { --accent: #ffb26b; --accent-rgb: 255,178,107; }
.suffix-card[data-color="green"],  [data-accent="green"]  { --accent: #7fe08f; --accent-rgb: 127,224,143; }

/* ---------- Hero & section headers ---------- */
.hero p { color: #d3dae6; }
.hero-eyebrow { color: #ffd166; opacity: .85; }
.section-header { position: relative; padding-left: 18px; border-left: 4px solid var(--accent, #ffd166); }
.section-header .num {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  background: rgba(var(--accent-rgb, 255,209,102), .14);
  border: 1px solid rgba(var(--accent-rgb, 255,209,102), .35);
  color: var(--accent, #ffd166); font-weight: 800; letter-spacing: .08em;
}
.section-header h2 { color: #fff; }
.section-header p { color: #ccd4e2; }

/* Quick-jump chips listing every affix card in the section (built by affix-map.js). */
.affix-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 28px; }
.affix-jump a {
  display: inline-flex; align-items: baseline; gap: 7px;
  padding: 7px 12px; border-radius: 10px; text-decoration: none;
  background: rgba(var(--accent-rgb), .08); border: 1px solid rgba(var(--accent-rgb), .3);
  color: #f3f6fb; font-family: 'Georgia', 'Times New Roman', serif; font-size: 15px; line-height: 1.2;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.affix-jump a small { font-family: system-ui, -apple-system, 'Noto Sans KR', sans-serif; font-size: 11.5px; color: var(--accent); font-weight: 700; }
.affix-jump a:hover { background: rgba(var(--accent-rgb), .18); border-color: rgba(var(--accent-rgb), .6); transform: translateY(-1px); }

/* ---------- Affix cards ---------- */
.suffix-card {
  border: 1px solid rgba(var(--accent-rgb), .22);
  background:
    radial-gradient(120% 60% at 0% 0%, rgba(var(--accent-rgb), .10), transparent 60%),
    #141826;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}
.suffix-card:hover { border-color: rgba(var(--accent-rgb), .45); background:
    radial-gradient(120% 60% at 0% 0%, rgba(var(--accent-rgb), .14), transparent 60%),
    #171c2c; }
.suffix-card::before { width: 5px; background: var(--accent) !important; }
.suffix-top { align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.suffix-title { color: var(--accent); text-shadow: 0 0 28px rgba(var(--accent-rgb), .25); }
.suffix-function {
  background: rgba(var(--accent-rgb), .14) !important; border: 1px solid rgba(var(--accent-rgb), .4);
  color: var(--accent) !important; font-weight: 700; border-radius: 999px; padding: 4px 11px;
}
.suffix-tagline, .suffix-card[data-color] .suffix-tagline {
  color: #fff !important; font-size: 18px; font-weight: 750; letter-spacing: -.01em;
  padding: 2px 0 2px 12px; border-left: 3px solid var(--accent); margin-bottom: 22px;
}

/* Etymology: tinted note box with a pill label. */
.etymology {
  background: rgba(var(--accent-rgb), .07); border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0; padding: 16px 18px;
}
.etymology-label, .examples-label {
  display: inline-block; margin-bottom: 8px; padding: 2px 10px; border-radius: 999px;
  background: rgba(var(--accent-rgb), .16); color: var(--accent);
  font-size: 11.5px; font-weight: 800; letter-spacing: .12em;
}
.etymology p { color: #dde3ee; }
.etymology em { color: #fff; }
.etymology strong { color: var(--accent); font-weight: 700; }

/* Examples: a grid of word tiles instead of grey two-column rows. */
.examples-label { margin-top: 6px; }
.examples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.example {
  display: flex !important; flex-direction: column; gap: 8px;
  padding: 15px 16px !important; border: 1px solid rgba(255,255,255,.08) !important;
  border-radius: 12px; background: rgba(255,255,255,.035);
  transition: border-color .15s ease, background .15s ease;
}
.example:last-child { padding-bottom: 15px !important; }
.example:hover { border-color: rgba(var(--accent-rgb), .45) !important; background: rgba(var(--accent-rgb), .06); }
.example-word { display: flex !important; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; }
.example-word .en { color: #fff; font-size: 21px; }
.example-word .ko {
  margin-top: 0 !important; padding: 2px 9px; border-radius: 999px;
  background: rgba(var(--accent-rgb), .14); color: var(--accent); font-size: 12.5px; font-weight: 700;
}
.example-desc { color: #d0d7e4; font-size: 13.5px; line-height: 1.7; }
.example-desc em {
  font-style: normal; color: #fff; background: rgba(var(--accent-rgb), .16);
  border-radius: 5px; padding: 0 5px; font-family: 'Georgia', 'Times New Roman', serif;
}
.example-desc strong { color: #fff; font-weight: 700; box-shadow: inset 0 -0.45em 0 rgba(var(--accent-rgb), .22); }

/* "연결해서 더 탐구하기" box picks up the card colour too. */
.suffix-card .explorer-related { border-color: rgba(var(--accent-rgb), .25); background: rgba(var(--accent-rgb), .045); }
.suffix-card .explorer-related .er-heading { color: var(--accent); }
.suffix-card .explorer-related .er-note { color: #a3adc2; }

/* ---------- Intro two-layer cards ---------- */
.layer-card .sub { color: #b6c0d2; }
.layer-card .tone { color: #ccd4e2; }
.layer-card .tone strong { color: #fff; }

/* ---------- Summary table ---------- */
.summary-table { border-collapse: separate; border-spacing: 0; border-radius: 14px; overflow: hidden; border: 1px solid rgba(255,255,255,.09); }
.summary-table th { background: #1b2133; color: #ffd166; font-weight: 800; }
.summary-table td { color: #d3dae6; }
.summary-table tr:nth-child(even) td { background: rgba(255,255,255,.025); }
.summary-table tr:hover td { background: rgba(255,209,102,.06); }
.summary-table .sf { color: #ffd166; font-weight: 700; }
.summary-table .word { color: #fff; }
.summary-table .kw { color: #9fd0ff; }

/* ---------- Sidebar ---------- */
.sidebar-nav .nav-section {
  display: flex; align-items: center; gap: 7px;
  color: var(--accent, #aab4c8) !important; font-weight: 800; opacity: 1;
}
.sidebar-nav .nav-section::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent, #aab4c8); box-shadow: 0 0 10px rgba(var(--accent-rgb, 170,180,200), .6);
}
.sidebar-nav a { color: #cdd5e3; }
.sidebar-nav a[data-accent]:hover { color: var(--accent); }
.sidebar-nav a.active[data-accent] { color: #fff; border-left-color: var(--accent); background: rgba(var(--accent-rgb), .12); }

/* ---------- Closing ---------- */
.closing blockquote { color: #eef2f8; }

@media (max-width: 900px) {
  .examples { grid-template-columns: 1fr; }
  .suffix-tagline, .suffix-card[data-color] .suffix-tagline { font-size: 16.5px; }
  .affix-jump { margin-top: -4px; }
  .affix-jump a { font-size: 14px; padding: 6px 10px; }
}
