/* ── Design tokens — NTK brand ─────────────────────────────── */
:root {
  --bg:            #f5f5f5;
  --surface:       #ffffff;
  --surface-2:     #f2f2f2;
  --ink:           #1a1a1a;
  --ink-2:         #333333;
  --ink-3:         #707070;
  --red:           #e42929;
  --red-dark:      #c21818;
  --red-subtle:    #fdf0f0;
  --blue:          #337ab7;
  --blue-dark:     #285f8f;
  --blue-subtle:   #e8f1f9;
  --border:        #dbdbdb;
  --border-strong: #aaaaaa;
  --radius:        2px;
  --font-body:     'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --shadow-sm:     0 1px 2px rgb(0 0 0 / .07);
  --shadow-md:     0 4px 14px rgb(0 0 0 / .10), 0 1px 4px rgb(0 0 0 / .06);
}

/* ── Reset & base ──────────────────────────────────────────── */
html { overflow-x: clip; }
*, *::before, *::after { box-sizing: border-box; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background-color: var(--bg);
  background-image: url('img/bg.png');
  background-position: center -230px;
  background-repeat: repeat;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  margin: 0;
}

a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid #707070;
  transition: color .1s ease, border-color .1s ease;
}
a:hover, a:focus {
  color: var(--blue);
  border-bottom-color: var(--blue);
  text-decoration: none;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-body);
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 .6rem;
}

h1 { font-size: clamp(1.5rem, 3vw, 1.75rem); }
h2 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h3 { font-size: clamp(1rem, 1.8vw, 1.25rem); color: var(--red); }

h4 {
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 .45rem;
}

/* ── Navbar ─────────────────────────────────────────────────── */
.psh-navbar {
  background: linear-gradient(70deg, #e42929, #cf1a38);
  border-bottom: none;
  position: sticky;
  top: 0;
  z-index: 100;
  padding: .7rem 1.5rem;
  box-shadow: 0 2px 6px rgb(0 0 0 / .25);
}

.psh-navbar-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  max-width: 1280px;
  margin: 0 auto;
}

/* Brand */
.psh-brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  text-decoration: none;
  border-bottom: none;
  flex-shrink: 0;
}
.psh-brand:hover { text-decoration: none; border-bottom: none; }

.psh-brand-logo {
  height: 36px;
  width: auto;
}

.psh-brand-wordmark {
  font-family: var(--font-body);
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: .01em;
  line-height: 1;
}

/* Search */
.psh-search-form {
  flex: 1;
  max-width: 500px;
  position: relative;
}

.psh-search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.psh-search-icon {
  position: absolute;
  left: .85rem;
  color: var(--ink-3);
  pointer-events: none;
  flex-shrink: 0;
  z-index: 1;
}

.psh-search-input {
  width: 100%;
  background: #fff;
  border: 1.5px solid rgba(0,0,0,.12);
  border-radius: 2px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: .9375rem;
  font-weight: 300;
  padding: .48rem 5.5rem .48rem 2.5rem;
  outline: none;
  transition: background .2s, border-color .2s, box-shadow .2s;
}
.psh-search-input::placeholder { color: var(--ink-3); }
.psh-search-input:focus {
  background: #fff;
  border-color: var(--red-dark);
  box-shadow: 0 0 0 2px rgba(255,255,255,.35);
}

.psh-search-btn {
  position: absolute;
  right: .32rem;
  background: var(--red);
  border: 1px solid var(--red-dark);
  border-radius: 2px;
  color: #fff;
  font-family: var(--font-body);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .05em;
  padding: .3rem .9rem;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.psh-search-btn:hover { background: var(--red-dark); }

/* Custom autocomplete */
.psh-suggestions {
  position: absolute;
  top: calc(100% + .5rem);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-height: 340px;
  overflow-y: auto;
  z-index: 200;
  display: none;
}
.psh-suggestions.open { display: block; animation: dropIn .14s ease; }

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.psh-suggestion {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  padding: .5rem 1rem;
  cursor: pointer;
  font-size: .9375rem;
  font-weight: 300;
  color: var(--ink);
  background: none;
  border: none;
  border-bottom: 1px solid #f5f5f5;
  width: 100%;
  text-align: left;
  transition: background .1s;
}
.psh-suggestion:last-child { border-bottom: none; }
.psh-suggestion:hover,
.psh-suggestion.active { background: var(--red-subtle); color: var(--red-dark); }

.psh-suggestion-type {
  font-size: .625rem;
  font-weight: 500;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: .15rem .4rem;
  flex-shrink: 0;
  line-height: 1.4;
}
.psh-suggestion.active .psh-suggestion-type { background: rgba(228,41,41,.1); color: var(--red-dark); }

/* Nav right */
.psh-nav-right {
  display: flex;
  align-items: center;
  gap: .9rem;
  flex-shrink: 0;
  margin-left: auto;
}

.psh-lang {
  display: flex;
  align-items: center;
  gap: .05rem;
  flex-shrink: 0;
}
.psh-lang a {
  color: rgba(255,255,255,.6);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
  padding: .25rem .35rem;
  border-radius: var(--radius);
  border-bottom: none;
  transition: color .15s;
}
.psh-lang a.active,
.psh-lang a:hover { color: #fff; text-decoration: none; border-bottom: none; }
.psh-lang-sep { color: rgba(255,255,255,.3); font-size: .75rem; margin: 0 .05rem; }

.psh-ntk-link { border-bottom: none; }
.psh-ntk-link img {
  height: 28px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
  opacity: .65;
  transition: opacity .2s;
}
.psh-ntk-link:hover img { opacity: 1; }

/* ── Page wrapper ───────────────────────────────────────────── */
.psh-page {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  animation: fadeUp .3s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Two-column layout ─────────────────────────────────────── */
.psh-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 2rem;
  align-items: start;
}
.psh-layout > * { min-width: 0; }

/* ── Sidebar / panel ────────────────────────────────────────── */
.psh-sidebar {
  position: sticky;
  top: 76px;
  align-self: start;
}

.psh-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.psh-panel-head {
  padding: .85rem 1.2rem .7rem;
  border-bottom: 2px solid var(--red);
  background: var(--surface);
}
.psh-panel-head h3 { margin-bottom: .15rem; font-size: 1.125rem; }

.psh-uri {
  font-size: .72rem;
  color: var(--ink-3);
  word-break: break-all;
  margin-top: .15rem;
}
.psh-uri a { color: var(--ink-3); border-bottom-color: transparent; }
.psh-uri a:hover { color: var(--blue); border-bottom-color: var(--blue); }

.psh-panel-section {
  padding: .65rem 1.2rem;
  border-bottom: 1px solid var(--border);
}
.psh-panel-section:last-of-type { border-bottom: none; }

/* Term lists */
.psh-term-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .05rem;
}
.psh-term-list li { font-size: .9375rem; line-height: 1.5; font-weight: 300; }

.psh-term-list li a {
  display: block;
  padding: .18rem .3rem;
  border-radius: var(--radius);
  border-bottom: none;
  transition: background .1s, color .1s;
  color: var(--ink);
}
.psh-term-list li a:hover {
  background: var(--red-subtle);
  color: var(--red-dark);
  text-decoration: none;
  border-bottom: none;
}

.psh-term-list li span {
  display: block;
  padding: .18rem .3rem;
  color: var(--ink-3);
  font-weight: 300;
}

.psh-json-link {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .6rem 1.2rem;
  font-size: .8rem;
  color: var(--ink-3);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  transition: background .12s, color .12s;
  border-bottom: none;
  font-weight: 400;
}
.psh-json-link:hover {
  background: var(--red-subtle);
  color: var(--red-dark);
  text-decoration: none;
  border-bottom: none;
}


/* ── Breadcrumb ─────────────────────────────────────────────── */
.psh-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .2rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  font-size: .875rem;
  color: var(--ink-3);
}
.psh-breadcrumb li + li::before {
  content: '/';
  margin-right: .2rem;
  color: var(--border-strong);
}
.psh-breadcrumb a { color: var(--ink-3); border-bottom: none; }
.psh-breadcrumb a:hover { color: var(--blue); border-bottom: none; text-decoration: none; }
.psh-breadcrumb li:last-child a { color: var(--ink-2); font-weight: 500; }

/* ── Word cloud ─────────────────────────────────────────────── */
.wordcloud { margin-bottom: 2.5rem; }

.wordcloud-source {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .75rem;
  list-style: none;
  padding-left: 0;
}

.wordcloud-rendered .wordcloud-source {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.wordcloud-render { width: 100%; }

.wordcloud-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: .3rem .9rem;
  padding: 2rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--red);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  line-height: 1;
  animation: fadeUp .4s ease .1s both;
}

.wordcloud-tag {
  display: inline-block;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  text-decoration: none;
  border-bottom: none;
  white-space: nowrap;
  position: relative;
  transition: color .15s ease, transform .15s ease;
}
.wordcloud-tag:hover,
.wordcloud-tag:focus {
  color: var(--red);
  text-decoration: none;
  border-bottom: none;
  transform: scale(1.07);
  z-index: 1;
}

/* ── Search results ─────────────────────────────────────────── */
.psh-search-page { max-width: 900px; }
.psh-search-page h2 { margin-bottom: .25rem; color: var(--ink); }

.psh-results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1.75rem;
}

.psh-results-heading {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 2px solid var(--red);
  padding-bottom: .4rem;
  margin-bottom: .75rem;
}

.psh-result-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.psh-result-list li { font-size: .9375rem; font-weight: 300; line-height: 1.4; }
.psh-result-list a { color: var(--ink); border-bottom-color: transparent; }
.psh-result-list a:hover { color: var(--blue); border-bottom-color: var(--blue); }
.psh-alt-arrow { color: var(--ink-3); font-size: .8rem; margin-right: .15rem; }

/* ── Flash messages ─────────────────────────────────────────── */
.psh-flash {
  background: #FEFBF1;
  border: none;
  border-left: 5px solid #fec223;
  color: #6B5329;
  font-size: .9375rem;
  list-style: none;
  margin-bottom: 1.5rem;
  padding: .75rem 1rem;
  border-radius: 0;
}

/* ── Catalogue ──────────────────────────────────────────────── */
.psh-catalogue { margin-top: 2.25rem; }

.psh-tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.psh-tab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  color: var(--ink-3);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .03em;
  padding: .55rem 1.1rem;
  transition: color .15s, border-color .15s;
}
.psh-tab-btn:hover { color: var(--red); }
.psh-tab-btn.active { color: var(--red); border-bottom-color: var(--red); }

.psh-tab-badge {
  display: inline-block;
  background: var(--red-subtle);
  color: var(--red-dark);
  font-size: .68rem;
  font-weight: 700;
  padding: .1rem .45rem;
  border-radius: 1rem;
  margin-left: .35rem;
  vertical-align: middle;
}
.psh-tab-badge:empty { display: none; }

.psh-tab-panel { display: none; }
.psh-tab-panel.active {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  padding: 1rem 1.25rem;
  animation: fadeUp .2s ease;
}

.psh-catalogue-link {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--red);
  margin-bottom: .8rem;
  border-bottom: none;
}
.psh-catalogue-link:hover { color: var(--red-dark); text-decoration: underline; border-bottom: none; }
.psh-catalogue-link::after { content: ' >>'; }

.psh-catalogue-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.psh-catalogue-list li { font-size: .9rem; line-height: 1.45; font-weight: 300; }
.psh-catalogue-list a { color: var(--ink); border-bottom-color: transparent; }
.psh-catalogue-list a:hover { color: var(--blue); }
.psh-catalogue-list .author-name { color: var(--ink-3); font-style: italic; font-size: .875rem; }

/* ── Footer ─────────────────────────────────────────────────── */
.psh-footer {
  position: relative;
  background-color: #e8e8e8;
  background-image: url('img/grunge_wall.png');
  background-repeat: repeat;
  padding: 14px 0;
}

.psh-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background-image: linear-gradient(to bottom, rgba(0,0,0,.06) 0, rgba(0,0,0,0) 100%);
  border-top: 1px solid #dadada;
}

.psh-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 2rem;
  align-items: baseline;
  color: var(--ink-3);
  font-size: .8rem;
  font-weight: 300;
  line-height: 1.7;
}

.psh-footer a { color: var(--ink-3); border-bottom: none; }
.psh-footer a:hover { color: var(--blue); border-bottom: none; text-decoration: underline; }
.psh-footer-cc img { height: 15px; vertical-align: middle; margin-right: .35rem; opacity: .7; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .psh-layout { grid-template-columns: 1fr; }
  .psh-sidebar { position: static; max-height: none; }
  .psh-results-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (max-width: 640px) {
  .psh-navbar-inner { flex-wrap: wrap; gap: .65rem; }
  .psh-search-form { order: 3; width: 100%; max-width: 100%; }
  .psh-brand-wordmark { display: none; }
  .psh-nav-right { margin-left: auto; }
  .psh-page { padding: 1.25rem 1rem 3rem; }
  .psh-layout { gap: 1.25rem; }
}

@media print {
  .psh-navbar, .wordcloud, .psh-breadcrumb { display: none; }
  .psh-layout { grid-template-columns: 1fr; }
  .psh-tab-panel { display: block !important; }
}
