/*
 * Themis — Problems of Modern Law (modernlaw.uz)
 * Warm-canvas editorial system: flat surfaces, serif display, mono metadata.
 * Juridical blue #0F2A4A · brass #B08A3E · canvas #E5E5E5.
 * Fonts: PT Serif (display) · Inter (body) · JetBrains Mono (meta) — Cyrillic-safe.
 */

:root {
  --th-canvas: #E8E6E1;        /* warm paper canvas — page background, never pure white */
  --th-card: #FFFFFF;          /* card surface */
  --th-mist: #F3F2EF;          /* secondary surface */
  --th-ink: #14161A;           /* primary text, near-black */
  --th-ink-2: #444444;         /* secondary text */
  --th-smoke: #6C6C6C;         /* meta text */
  --th-hairline: #C9C7C2;      /* borders */
  --th-blue-950: #0A1F38;      /* darkest blue — inverted deep */
  --th-blue-900: #0F2A4A;      /* juridical blue — inverted blocks, structural accent */
  --th-blue-700: #1B3A63;      /* hover/active blue */
  --th-brass: #B08A3E;         /* restrained gold — hairlines, motifs, small marks */
  --th-brass-light: #C9A227;
  --th-ink-inv: #F2F0EB;       /* text on blue */
  --th-ink-inv-dim: #BCC8D8;   /* dim text on blue */

  --th-radius-card: 10px;
  --th-radius-btn: 8px;
  --th-radius-tag: 4px;

  --th-font-display: 'PT Serif', 'Noto Serif', Georgia, serif;
  --th-font-body: 'Inter', 'Noto Sans', -apple-system, 'Segoe UI', sans-serif;
  --th-font-mono: 'JetBrains Mono', 'IBM Plex Mono', 'Menlo', monospace;

  --th-max: 75rem;             /* 1200px */
  --th-section-gap: 5rem;      /* 80px */
}

/* ============ Base ============ */
html { background: var(--th-canvas); }
body {
  background: var(--th-canvas);
  color: var(--th-ink);
  font-family: var(--th-font-body);
  font-size: 16px;
  line-height: 1.6;
}
.pkp_structure_page, .pkp_structure_main { background: transparent; }
.pkp_structure_main a { color: var(--th-blue-900); text-decoration-color: var(--th-hairline); }
.pkp_structure_main a:hover { color: var(--th-brass); }
h1, h2, h3, h4 { font-family: var(--th-font-display); color: var(--th-ink); }

/* Beat parent theme px rules; serif display, mixed case, restrained scale */
.themis-landing h1, .themis-landing h2, .themis-landing h3,
.themis-journal h1, .themis-journal h2, .themis-journal h3 {
  font-family: var(--th-font-display) !important;
  line-height: 1.12 !important;
}
h1.th-jhero-title { font-size: clamp(2rem, 4.4vw, 3.6rem) !important; line-height: 1.08 !important; font-weight: 700; letter-spacing: -0.01em; }
h2.th-h2 { font-size: clamp(1.6rem, 3.2vw, 2.4rem) !important; font-weight: 700; }

/* Mono metadata label — the signature bibliographic register */
.th-meta {
  font-family: var(--th-font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--th-smoke);
}

/* Landing pages: full-bleed, no column rules */
.pkp_page_index .pkp_structure_main,
.pkp_page_index .pkp_structure_content {
  border: none !important;
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}
.pkp_page_index .pkp_structure_sidebar { display: none; }
.pkp_page_index .pkp_structure_page { max-width: none; }
.pkp_structure_main::before, .pkp_structure_main::after { display: none !important; }

/* ============ Header — single row, light institutional bar ============
   Theme variables (the 7-var re-skin contract):
   --cf-head-bg, --cf-head-border, --cf-ink, --cf-ink-dim, --cf-accent,
   --cf-menu-bg, --cf-btn-bg                                            */
:root {
  --cf-head-bg: rgba(250, 249, 247, 0.94);
  --cf-head-border: var(--th-hairline);
  --cf-ink: var(--th-ink);
  --cf-ink-dim: var(--th-ink-2);
  --cf-accent: var(--th-brass);
  --cf-menu-bg: #FFFFFF;
  --cf-btn-bg: rgba(15, 42, 74, 0.06);
}

.pkp_site_nav_menu, .pkp_navigation_primary_row, .pkp_navigation_primary,
.pkp_navigation_user, .pkp_head_wrapper { background: transparent !important; }

.cf-head {
  position: sticky; top: 0; z-index: 100;
  background: var(--cf-head-bg);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--cf-head-border);
}
.cf-head-inner {
  display: flex; align-items: center; gap: 1.6rem;
  max-width: var(--th-max); margin: 0 auto; padding: 0.7rem 1.5rem;
}

.cf-brand { flex: 0 0 auto; }
.pkp_site_name .is_img img { display: none; }

.cf-nav { display: flex; align-items: center; }
ul.pkp_navigation_primary.cf-menu {
  display: flex; align-items: center; gap: 0.2rem;
  list-style: none; margin: 0; padding: 0;
}
.cf-menu > li { position: relative; }
.cf-menu > li > a {
  display: block; padding: 0.5rem 0.8rem; border-radius: var(--th-radius-btn);
  color: var(--cf-ink-dim) !important; font-weight: 500; font-size: 0.93rem;
  text-decoration: none; transition: color .2s, background .2s; white-space: nowrap;
}
.cf-menu > li > a:hover { color: var(--th-blue-900) !important; background: var(--cf-btn-bg); }
.cf-menu li ul {
  position: absolute; top: 100%; left: 0; min-width: 240px;
  background: var(--cf-menu-bg);
  border: 1px solid var(--cf-head-border); border-radius: var(--th-radius-card);
  padding: 0.4rem; margin-top: 0.4rem; list-style: none;
}
.cf-menu li ul a {
  display: block; padding: 0.5rem 0.8rem; border-radius: var(--th-radius-btn);
  color: var(--cf-ink) !important; font-size: 0.9rem; text-decoration: none;
}
.cf-menu li ul a:hover { background: var(--cf-btn-bg); color: var(--th-blue-900) !important; }

.cf-actions { margin-left: auto; display: flex; align-items: center; gap: 0.6rem; }

/* Visible search input (indexers and readers expect it) */
.th-search-form { display: flex; align-items: center; }
.th-search-input {
  width: 150px; padding: 0.45rem 0.7rem;
  border: 1px solid var(--cf-head-border); border-radius: var(--th-radius-btn);
  background: var(--th-card); color: var(--th-ink);
  font: inherit; font-size: 0.88rem;
  transition: width .25s ease, border-color .2s;
}
.th-search-input:focus { width: 200px; border-color: var(--th-blue-900); outline: none; }
.th-search-input::placeholder { color: var(--th-smoke); }

.cf-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--th-radius-btn);
  color: var(--cf-ink-dim) !important; border: 1px solid transparent;
}
.cf-icon-btn:hover { color: var(--th-blue-900) !important; background: var(--cf-btn-bg); }

.cf-lang { position: relative; }
.cf-lang-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.7rem; border-radius: var(--th-radius-btn);
  background: transparent; border: 1px solid var(--cf-head-border);
  color: var(--cf-ink) !important; font: inherit; font-size: 0.88rem; font-weight: 600;
  cursor: pointer;
}
.cf-lang-btn:hover { border-color: var(--th-blue-900); }
.cf-caret { font-size: 0.7rem; opacity: 0.8; }
.cf-lang-menu {
  position: absolute; top: 100%; right: 0; min-width: 170px;
  background: var(--cf-menu-bg);
  border: 1px solid var(--cf-head-border); border-radius: var(--th-radius-card);
  padding: 0.4rem; margin-top: 0.4rem; list-style: none;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.cf-lang:hover .cf-lang-menu, .cf-lang:focus-within .cf-lang-menu,
.cf-lang-menu.is-open { opacity: 1; visibility: visible; transform: none; }
.cf-lang-menu a {
  display: block; padding: 0.5rem 0.8rem; border-radius: var(--th-radius-btn);
  color: var(--cf-ink) !important; font-size: 0.9rem; text-decoration: none;
}
.cf-lang-menu a:hover { background: var(--cf-btn-bg); }
.cf-lang-menu .is-current a { color: var(--th-brass) !important; font-weight: 600; }

ul.pkp_navigation_user.cf-user-menu {
  display: flex; align-items: center; gap: 0.3rem; list-style: none; margin: 0; padding: 0;
}
.cf-user-menu > li > a {
  display: block; padding: 0.5rem 0.85rem; border-radius: var(--th-radius-btn);
  color: var(--cf-ink-dim) !important; font-weight: 500; font-size: 0.9rem; text-decoration: none;
  white-space: nowrap;
}
.cf-user-menu > li > a:hover { color: var(--th-blue-900) !important; background: var(--cf-btn-bg); }
/* Login → filled dark button */
.cf-user-menu > li:last-child > a {
  background: var(--th-blue-900);
  color: var(--th-ink-inv) !important; font-weight: 600;
}
.cf-user-menu > li:last-child > a:hover { background: var(--th-blue-700); color: #fff !important; }

.cf-burger { display: none; position: static; float: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.cf-burger span { display: block; width: 24px; height: 2px; background: var(--cf-ink); margin: 5px 0; border-radius: 2px; transition: transform .25s, opacity .2s; }
.cf-head.cf-open .cf-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.cf-head.cf-open .cf-burger span:nth-child(2) { opacity: 0; }
.cf-head.cf-open .cf-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 980px) {
  .cf-head-inner { flex-wrap: wrap; column-gap: 0.6rem; row-gap: 0; padding: 0.6rem 1.1rem; }
  .cf-brand { margin-right: auto; }
  .cf-burger { display: block; order: 2; }
  .cf-nav, .cf-actions {
    order: 3; flex-basis: 100%; width: 100%;
    position: static; max-height: 0; overflow: hidden;
    transition: max-height .3s ease;
  }
  .cf-head.cf-open .cf-nav { max-height: 74vh; overflow: auto; padding: 0.9rem 0 0.4rem; border-top: 1px solid var(--cf-head-border); margin-top: 0.4rem; }
  .cf-head.cf-open .cf-actions { max-height: 44vh; overflow: visible; padding: 0.2rem 0 0.9rem; }
  ul.pkp_navigation_primary.cf-menu { flex-direction: column; align-items: stretch; gap: 0.1rem; width: 100%; }
  .cf-menu > li { width: 100%; }
  .cf-menu > li > a { padding: 0.7rem 0.5rem; font-size: 1rem; }
  .cf-menu li ul {
    position: static; border: none; background: transparent;
    margin: 0.1rem 0 0.4rem 1rem; padding: 0; min-width: 0;
  }
  .cf-actions { margin-left: 0; flex-wrap: wrap; gap: 0.6rem; justify-content: flex-start; }
  .th-search-input, .th-search-input:focus { width: 100%; }
  .th-search-form { width: 100%; }
  .cf-lang { width: 100%; }
  .cf-lang-menu {
    position: static; opacity: 1; visibility: visible; transform: none;
    border: none; background: transparent; padding: 0.2rem 0 0 0.8rem; margin: 0.3rem 0 0;
  }
  .cf-user-menu { flex-wrap: wrap; gap: 0.5rem; }
}

/* ============ Brand mark ============ */
.th-brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.th-brand-mark { flex: 0 0 auto; }
.th-brand-text { display: flex; flex-direction: column; line-height: 1.18; }
.th-brand-name {
  font-family: var(--th-font-display);
  font-weight: 700;
  font-size: 1.12rem;
  letter-spacing: 0.02em;
  color: var(--th-ink);
}
.th-brand-sub {
  font-family: var(--th-font-mono);
  font-size: 0.62rem; letter-spacing: 0.1em;
  color: var(--th-smoke); text-transform: uppercase;
}

/* ============ Reveal animation ============ */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-reveal].is-visible { opacity: 1; transform: none; }
[data-reveal-delay="1"] { transition-delay: 0.12s; }
[data-reveal-delay="2"] { transition-delay: 0.24s; }
[data-reveal-delay="3"] { transition-delay: 0.36s; }

/* ============ Buttons — flat, small radius ============ */
.th-btn {
  display: inline-block;
  padding: 0.8rem 1.7rem;
  border-radius: var(--th-radius-btn);
  font-family: var(--th-font-body);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  margin: 0 0.4rem 0.6rem 0;
}
.th-btn-dark {
  background: var(--th-blue-900);
  color: var(--th-ink-inv) !important;
}
.th-btn-dark:hover { background: var(--th-blue-700); color: #fff !important; }
.th-btn-ghost {
  background: transparent;
  border: 1.5px solid var(--th-ink-2);
  color: var(--th-ink-2) !important;
}
.th-btn-ghost:hover { border-color: var(--th-blue-900); color: var(--th-blue-900) !important; }

/* ============ Sections ============ */
.th-section { max-width: var(--th-max); margin: 0 auto; padding: var(--th-section-gap) 1.5rem; position: relative; }
.th-section + .th-section { padding-top: 0; }
.th-kicker {
  font-family: var(--th-font-mono);
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--th-brass);
  margin-bottom: 0.8rem;
}

/* ============ Journal hero — split: text left, Themis art right ============ */
.th-jhero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--th-hairline);
  background: var(--th-canvas);
}
.th-jhero-inner {
  max-width: var(--th-max); margin: 0 auto;
  padding: 4.5rem 1.5rem 4rem;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3rem;
  align-items: center;
}
.th-jhero-copy { min-width: 0; }
.th-jhero-badge {
  display: inline-block;
  font-family: var(--th-font-mono);
  font-weight: 500; font-size: 12px; letter-spacing: 0.14em;
  color: var(--th-blue-900);
  border: 1px solid var(--th-blue-900);
  padding: 0.3rem 0.75rem;
  border-radius: var(--th-radius-tag);
  margin-bottom: 1.2rem;
  text-transform: uppercase;
}
.th-jhero-title { margin: 0 0 1rem; }
.th-jhero-founder {
  color: var(--th-ink-2);
  font-size: 1.02rem; line-height: 1.6;
  margin: 0 0 1.6rem; max-width: 34rem;
}
.th-jhero-founder strong { color: var(--th-ink); font-weight: 600; }
.th-chips { list-style: none; padding: 0; margin: 0 0 2rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.th-chips li {
  font-family: var(--th-font-mono);
  font-size: 11.5px; font-weight: 500;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--th-ink-2);
  border: 1px solid var(--th-hairline);
  background: var(--th-card);
  padding: 0.38rem 0.8rem;
  border-radius: var(--th-radius-tag);
}
.th-hero-cta { display: flex; flex-wrap: wrap; align-items: center; }

/* Themis art: video/poster/SVG slot */
.th-hero-art {
  position: relative;
  margin: 0; align-self: stretch;
  display: flex; align-items: center; justify-content: center;
  min-height: 320px;
}
.th-hero-art img, .th-hero-art video {
  max-width: 100%; height: auto; display: block;
  border-radius: var(--th-radius-card);
}
.th-scales { width: min(100%, 380px); height: auto; display: block; }

/* Scales pendulum motion (SVG fallback / primary until render lands) */
.th-scales .th-beam-group {
  transform-origin: 210px 96px;
  animation: th-sway 9s ease-in-out infinite;
}
.th-scales .th-pan-left { transform-origin: 90px 96px; animation: th-counter 9s ease-in-out infinite; }
.th-scales .th-pan-right { transform-origin: 330px 96px; animation: th-counter 9s ease-in-out infinite; }
@keyframes th-sway {
  0%, 100% { transform: rotate(-1.6deg); }
  50% { transform: rotate(1.6deg); }
}
@keyframes th-counter {
  0%, 100% { transform: rotate(1.6deg); }
  50% { transform: rotate(-1.6deg); }
}

@media (max-width: 900px) {
  .th-jhero-inner { grid-template-columns: 1fr; padding: 3rem 1.2rem; gap: 2rem; }
  .th-hero-art { min-height: 0; order: -1; }
  .th-scales { width: min(60%, 260px); margin: 0 auto; }
}

/* ============ About block ============ */
.th-jabout-body { color: var(--th-ink-2); line-height: 1.75; max-width: 52rem; font-size: 1.02rem; }

/* ============ Editor-in-Chief card ============ */
.th-eic-card {
  display: flex; gap: 1.6rem; align-items: center;
  background: var(--th-card);
  border-radius: var(--th-radius-card);
  padding: 1.8rem 2rem;
  max-width: 44rem;
}
.th-eic-avatar {
  flex: 0 0 72px; width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--th-blue-900);
  color: var(--th-brass-light);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--th-font-display); font-size: 1.6rem; font-weight: 700;
}
.th-eic-name { font-family: var(--th-font-display); font-size: 1.25rem; font-weight: 700; margin: 0 0 0.2rem; }
.th-eic-title { color: var(--th-ink-2); font-size: 0.95rem; margin: 0; }

/* ============ Current issue ============ */
.current_issue { border-top: 1px solid var(--th-hairline); }
.current_issue_title {
  font-family: var(--th-font-mono);
  color: var(--th-smoke); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  margin: 0.6rem 0 1.4rem;
}
.obj_issue_toc .title { color: var(--th-ink); }
.obj_article_summary {
  background: var(--th-card);
  border: none;
  border-radius: var(--th-radius-card);
  padding: 1.2rem 1.4rem; margin-bottom: 0.9rem;
}
.obj_article_summary .title a { color: var(--th-ink); font-family: var(--th-font-display); }
.obj_article_summary .title a:hover { color: var(--th-blue-900); }
.obj_article_summary .meta, .obj_article_summary .authors { color: var(--th-ink-2); }
.obj_article_summary .pages, .obj_issue_toc .pages {
  font-family: var(--th-font-mono);
  color: var(--th-smoke) !important; font-size: 12px;
}
.obj_issue_toc .sections .section > h2,
.obj_issue_toc .sections .section > h3,
.obj_issue_toc .section > h2,
.obj_issue_toc .section > h3 {
  background: transparent !important;
  color: var(--th-blue-900) !important;
  font-family: var(--th-font-display);
}
.obj_issue_toc .section { border-top: none; }
.obj_issue_toc .published, .obj_issue_toc .description { color: var(--th-ink-2); }
.read_more { color: var(--th-blue-900); font-weight: 600; }

/* ============ Indexing band — inverted blue block ============ */
.th-index-band {
  background: var(--th-blue-900);
  color: var(--th-ink-inv);
  padding: var(--th-section-gap) 0;
  margin-top: var(--th-section-gap);
}
.th-index-inner { max-width: var(--th-max); margin: 0 auto; padding: 0 1.5rem; }
.th-index-band .th-h2 { color: var(--th-ink-inv) !important; margin: 0.3rem 0 0.8rem; }
.th-index-band .th-kicker { color: var(--th-brass-light); }
.th-index-lede,
.pkp_structure_main .th-index-band p,
.pkp_structure_main .th-index-band li { color: var(--th-ink-inv-dim); }
.th-index-lede { max-width: 46rem; margin: 0 0 2.4rem; }
.th-badges {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.8rem;
}
.th-badges li { margin: 0; }
.th-badge {
  display: flex; flex-direction: column; gap: 0.3rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(242, 240, 235, 0.16);
  border-radius: var(--th-radius-card);
  text-decoration: none;
  color: var(--th-ink-inv) !important;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
  min-height: 74px; justify-content: center;
}
.th-badge-name { font-family: var(--th-font-display); font-weight: 700; font-size: 1.02rem; letter-spacing: 0.01em; }
.th-badge-desc { font-family: var(--th-font-mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--th-ink-inv-dim); }
.th-badge:hover {
  border-color: var(--th-brass-light);
  background: rgba(201, 162, 39, 0.08);
  transform: translateY(-3px);
}
.th-badge:hover .th-badge-desc { color: var(--th-brass-light); }
.th-badge.is-pending { opacity: 0.55; }
.th-badge.is-pending:hover { opacity: 0.85; }

/* ============ Policies quick grid ============ */
.th-policy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.th-policy-card {
  display: block;
  background: var(--th-card);
  border-radius: var(--th-radius-card);
  padding: 1.4rem 1.5rem;
  text-decoration: none;
  color: var(--th-ink) !important;
  transition: transform .2s ease, background .2s ease;
  border-top: 3px solid var(--th-blue-900);
}
.th-policy-card:hover { transform: translateY(-4px); }
.th-policy-card h3 {
  font-family: var(--th-font-display) !important;
  font-size: 1.05rem !important; font-weight: 700; margin: 0 0 0.4rem;
}
.th-policy-card p { color: var(--th-smoke); font-size: 0.88rem; line-height: 1.5; margin: 0; }

/* ============ Footer ============ */
.pkp_structure_footer_wrapper {
  background: var(--th-blue-950);
  border-top: none;
  color: var(--th-ink-inv-dim);
}
.pkp_structure_footer_wrapper a { color: var(--th-ink-inv); }
.pkp_structure_footer_wrapper a:hover { color: var(--th-brass-light); }
.th-footer { max-width: var(--th-max); margin: 0 auto; padding: 3rem 1.5rem 1.5rem; }
.th-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1.1fr 1fr 0.8fr;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(242, 240, 235, 0.12);
}
.th-footer-brand { font-family: var(--th-font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: 0.02em; color: var(--th-ink-inv); }
.th-footer-tag { font-size: 0.88rem; line-height: 1.6; margin-top: 0.6rem; }
.th-footer-h {
  font-family: var(--th-font-mono);
  font-size: 11px !important;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--th-brass-light);
  margin: 0 0 0.7rem;
}
.th-footer-col p { margin: 0 0 0.45rem; font-size: 0.9rem; }
.th-footer-issn { font-family: var(--th-font-mono); font-size: 0.82rem; }
.th-footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding-top: 1.4rem;
  font-size: 0.82rem;
}
.th-footer-ojs { color: var(--th-ink-inv-dim) !important; }
.pkp_brand_footer { display: none; }
@media (max-width: 860px) { .th-footer-grid { grid-template-columns: 1fr 1fr; } }

/* ============ Inner pages (about, static, article) ============ */
.pkp_structure_main h1, .pkp_structure_main h2, .pkp_structure_main h3 { color: var(--th-ink); }
.pkp_structure_main, .pkp_structure_main p, .pkp_structure_main li { color: var(--th-ink-2); }
.pkp_structure_sidebar .pkp_block {
  background: var(--th-card);
  border: none;
  border-radius: var(--th-radius-card);
  padding: 1.2rem;
}
.pkp_structure_sidebar .title { color: var(--th-ink); font-family: var(--th-font-display); }
.cmp_button, .pkp_button, button.submit {
  background: var(--th-blue-900);
  color: var(--th-ink-inv);
  border: none;
  border-radius: var(--th-radius-btn);
  font-weight: 600;
}
.cmp_button:hover, .pkp_button:hover, button.submit:hover { background: var(--th-blue-700); }

/* Sidebar indexing block (inner pages) */
.th-side-badges { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.th-side-badges a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--th-hairline); border-radius: var(--th-radius-btn);
  text-decoration: none; color: var(--th-ink) !important;
  font-family: var(--th-font-display); font-weight: 700; font-size: 0.92rem;
  transition: border-color .2s, background .2s;
}
.th-side-badges a:hover { border-color: var(--th-brass); background: var(--th-mist); }
.th-side-badges .th-meta { font-size: 10px; }

/* Breadcrumbs */
.cmp_breadcrumbs, .cmp_breadcrumbs .current, .cmp_breadcrumbs .separator { color: var(--th-smoke) !important; }
.cmp_breadcrumbs a { color: var(--th-ink-2) !important; }
.cmp_breadcrumbs a:hover { color: var(--th-brass) !important; }

/* Article page */
.obj_article_details .item .label { color: var(--th-ink); font-family: var(--th-font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.obj_article_details .item .value, .obj_article_details .item { color: var(--th-ink-2); }
.obj_article_details .item .value a, .obj_article_details .authors a { color: var(--th-blue-900); }
.obj_article_details .item .value a:hover { color: var(--th-brass); }
.obj_article_details .row, .obj_article_details .main_entry, .obj_article_details .entry_details { border-color: var(--th-hairline); }
.obj_article_details .entry_details .item { border-bottom-color: var(--th-hairline); }

/* Keywords as flat tags */
.item.keywords .value {
  display: inline-flex; flex-wrap: wrap; gap: 0.4em 0.5em; align-items: center;
  border: 1px solid var(--th-hairline);
  background: var(--th-mist);
  border-radius: var(--th-radius-tag);
  padding: 0.2em 0.8em;
  color: var(--th-ink-2);
  font-weight: 500;
}

/* Citation block */
.item.citation_display .value, #citationOutput, .csl-entry { color: var(--th-ink-2); background: transparent; }
.item.citation_display .label, .citation_formats_button { color: var(--th-ink) !important; }
.citation_formats { background: var(--th-card); border: 1px solid var(--th-hairline) !important; border-radius: var(--th-radius-card); }
.citation_formats_styles a { color: var(--th-ink-2); border-bottom-color: var(--th-hairline) !important; }
.citation_formats_styles a:hover { color: var(--th-blue-900); background: var(--th-mist); }

/* PDF galley button */
.galleys_links { list-style: none; padding: 0; margin: 0.5rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.galleys_links li { margin: 0; }
.obj_galley_link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.95rem; border-radius: var(--th-radius-btn);
  font-family: var(--th-font-body);
  font-weight: 600; font-size: 0.85rem;
  color: var(--th-ink-inv) !important; text-decoration: none;
  background: var(--th-blue-900);
  border: 1px solid var(--th-blue-900);
  transition: background 0.15s ease, color 0.15s ease;
}
.obj_galley_link::before {
  content: ""; width: 15px; height: 18px; flex: none;
  background: currentColor;
  -webkit-mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 2h9l5 5v13a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2Z' fill='none' stroke='%23000' stroke-width='2'/%3E%3Cpath d='M14 2v6h6' fill='none' stroke='%23000' stroke-width='2'/%3E%3Ctext x='12' y='18' font-size='7' font-weight='700' text-anchor='middle' fill='%23000'%3EPDF%3C/text%3E%3C/svg%3E");
          mask: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 2h9l5 5v13a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2Z' fill='none' stroke='%23000' stroke-width='2'/%3E%3Cpath d='M14 2v6h6' fill='none' stroke='%23000' stroke-width='2'/%3E%3Ctext x='12' y='18' font-size='7' font-weight='700' text-anchor='middle' fill='%23000'%3EPDF%3C/text%3E%3C/svg%3E");
}
.obj_galley_link:hover { background: var(--th-brass); border-color: var(--th-brass); color: #fff !important; }
.obj_galley_link.restricted { opacity: 0.6; }

/* Center overrides inherited from parent */
.pkp_structure_main .th-chips,
.pkp_structure_main .th-hero-cta { margin-left: 0 !important; }

/* ============ Accessibility: reduced motion ============ */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .th-scales .th-beam-group,
  .th-scales .th-pan-left,
  .th-scales .th-pan-right { animation: none !important; }
  .th-hero-art video { display: none; }
  .th-hero-art .th-poster-fallback { display: block; }
}
