/* Training page — minimal design, News Cycle (app font) */
:root {
  --bg: #f8fafc;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --dark: #1f2937;
  --hover: #f1f5f9;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'News Cycle', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  font-weight: 400;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(248, 250, 252, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line);
}
.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto;
}
h1 {
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0.01em;
  margin: 0;
}
.lang-switch { display: flex; gap: 6px; }
.lang-switch button {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 6px 14px;
  min-height: 34px;
  font-family: inherit;
  font-size: 15px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.lang-switch button.active { background: var(--dark); border-color: var(--dark); color: #fff; }

#searchBox {
  display: block;
  width: 100%;
  max-width: 760px;
  margin: 12px auto 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 11px 18px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
#searchBox:focus { border-color: var(--dark); }
#searchBox::placeholder { color: #9ca3af; }

/* Role chips */
.roles {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 20px 4px;
  scrollbar-width: none;
}
.roles::-webkit-scrollbar { display: none; }
.role-chip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 9px 16px;
  min-height: 40px;
  font-family: inherit;
  font-size: 15px;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.role-chip:hover { border-color: var(--muted); }
.role-chip.active { background: var(--dark); border-color: var(--dark); color: #fff; }

/* Content */
main { max-width: 760px; margin: 0 auto; padding: 4px 20px 40px; }

.direction {
  margin: 32px 0 2px;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

ion-icon { vertical-align: middle; }
.chip-icon { font-size: 17px; line-height: 1; flex: 0 0 auto; }
.dir-icon { font-size: 14px; }
.meta-icon { font-size: 13px; margin-right: 4px; }

details.section { border-bottom: 1px solid var(--line); }
details.section:first-of-type { border-top: 1px solid var(--line); }
details.section summary {
  cursor: pointer;
  padding: 16px 2px;
  font-size: 19px;
  line-height: 1.35;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  transition: color 0.15s;
}
details.section summary:hover { color: #111827; }
details.section summary::-webkit-details-marker { display: none; }
details.section summary::after {
  content: '+';
  flex: 0 0 auto;
  color: #9ca3af;
  font-size: 22px;
  line-height: 1;
  transition: transform 0.2s;
}
details.section[open] summary::after { content: '−'; }
details.section .body { padding: 0 2px 22px; line-height: 1.6; }
.body p { margin: 10px 0; }
.body ul, .body ol { padding-left: 20px; margin: 10px 0; }
.body li { margin: 4px 0; }

mark { background: #fde68a; border-radius: 3px; padding: 0 2px; }

/* Search results */
.search-result {
  padding: 15px 2px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.search-result:first-child { border-top: 1px solid var(--line); }
.search-result:hover { background: var(--hover); }
.search-result > div:first-child { font-size: 18px; line-height: 1.35; }
.result-meta { font-size: 14px; color: var(--muted); margin-top: 3px; }

.empty { text-align: center; color: var(--muted); padding: 72px 16px; }
.empty .big { font-size: 21px; margin-bottom: 8px; color: var(--text); }

.foot {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

button:focus-visible, #searchBox:focus-visible, summary:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .top { padding: 14px 14px 10px; }
  h1 { font-size: 24px; }
  .roles { padding: 12px 14px 4px; }
  main { padding: 4px 14px 32px; }
  details.section summary { font-size: 18px; }
  .foot { padding: 16px 14px; }
}
