/* ============================================================
   MAIN STYLES — all component styles
   ============================================================ */

/* ── TOPBAR ── */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  background: rgba(13, 13, 13, 0.95);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--gold-b);
  z-index: 800;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 1.2rem;
}

.brand-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand {
  font-family: 'Cinzel', serif;
  font-size: 1.15rem;
  color: var(--gold);
  letter-spacing: 0.07em;
  line-height: 1;
}

.brand-sub {
  font-size: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  font-weight: 600;
}

.topbar-sep {
  width: 1px;
  height: 22px;
  background: var(--gold-b);
  flex-shrink: 0;
}

.tnav {
  font-size: 0.57rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-secondary);
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.14s;
  text-decoration: none;
  display: block;
}

.tnav:hover {
  color: var(--gold);
}
.tnav.active {
  color: var(--white);
  border-bottom-color: var(--gold);
}

.topbar-spacer {
  flex: 1;
}

.tb-btn {
  padding: 0.36rem 0.85rem;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.57rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  border: 1px solid var(--gold-b);
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.18s;
  text-decoration: none;
  display: inline-block;
}

.tb-btn:hover {
  border-color: var(--gold);
  color: var(--white);
  background: var(--gold-g);
}

/* ── GOOGLE TRANSLATE TOPBAR ── */
#google_translate_element {
  display: none !important;
}
.goog-te-banner-frame {
  display: none !important;
}
body {
  top: 0 !important;
}
.skiptranslate {
  display: none !important;
}

.tb-translate-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tb-translate-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #141414;
  border: 1px solid var(--gold-b);
  min-width: 220px;
  max-height: 340px;
  overflow-y: auto;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
  display: none;
}

.tb-translate-dropdown.open {
  display: block;
}

.tb-translate-dropdown::-webkit-scrollbar {
  width: 4px;
}
.tb-translate-dropdown::-webkit-scrollbar-track {
  background: transparent;
}
.tb-translate-dropdown::-webkit-scrollbar-thumb {
  background: var(--gold-b);
  border-radius: 2px;
}

.tb-tx-header {
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid var(--gold-b);
  font-size: 0.44rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tb-tx-header svg {
  width: 11px;
  height: 11px;
  fill: var(--gold);
  flex-shrink: 0;
}

.tb-tx-search {
  padding: 0.4rem 0.7rem;
  border-bottom: 1px solid var(--gold-b);
}

.tb-tx-search input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--gold-b);
  outline: none;
  color: var(--white);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.6rem;
  padding: 0.3rem 0.5rem;
}

.tb-tx-search input::placeholder {
  color: var(--text-muted);
}

.tb-tx-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.8rem;
  cursor: pointer;
  transition: background 0.12s;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.62rem;
  color: var(--text-secondary);
}

.tb-tx-option:hover,
.tb-tx-option.active {
  background: var(--gold-g);
  color: var(--white);
}

.tb-tx-option.active {
  border-left: 2px solid var(--gold);
  color: var(--gold);
}

.tb-tx-flag {
  font-size: 0.8rem;
  flex-shrink: 0;
  width: 1.2rem;
  text-align: center;
}

.tb-translate-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.tb-translate-btn svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
  opacity: 0.75;
}

.tb-tx-badge {
  background: var(--gold);
  color: var(--bg);
  font-size: 0.38rem;
  font-weight: 700;
  padding: 0.08rem 0.3rem;
  border-radius: 1px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-left: 0.2rem;
  display: none;
}

.tb-tx-badge.show {
  display: inline-block;
}

.goog-te-ftab-float {
  display: none !important;
}
iframe.goog-te-menu-frame {
  box-shadow: none !important;
}

/* ── HERO ── */
.hero {
  background: linear-gradient(140deg, #050505 0%, #1a1026 55%, #080510 100%);
  color: var(--white);
  padding: 5rem 2rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--gold-b);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(201, 168, 76, 0.12), transparent 70%);
  pointer-events: none;
}

.hero-issue {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--gold-l);
  margin-bottom: 1rem;
  display: block;
}

.hero-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  letter-spacing: 0.06em;
  color: var(--white);
  margin-bottom: 0.5rem;
  line-height: 1.1;
}

.hero-sub {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
}

.h-stat-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 300;
  color: var(--gold);
  display: block;
  line-height: 1;
}

.h-stat-lbl {
  font-size: 0.52rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ── FILTER BAR ── */
.filter-bar {
  background: var(--panel-bg);
  border-bottom: 1px solid var(--gold-b);
  padding: 0.7rem 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  position: sticky;
  top: var(--topbar-h);
  z-index: 700;
}

.fp {
  font-size: 0.57rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--gold-b);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  background: var(--bg);
}

.fp.active,
.fp:hover {
  background: var(--gold);
  color: var(--bg);
  border-color: var(--gold);
  font-weight: 700;
}

.filter-sep {
  width: 1px;
  height: 18px;
  background: var(--gold-b);
  margin: 0 0.2rem;
}

.search-wrap {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--gold-b);
  background: var(--bg);
  padding: 0.3rem 0.75rem;
}

.search-wrap input {
  background: none;
  border: none;
  outline: none;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.65rem;
  color: var(--white);
  width: 160px;
}

.search-wrap input::placeholder {
  color: var(--text-muted);
}

/* ── ARTICLE CARDS ── */
.feat-card {
  background: var(--panel-bg);
  border: 1px solid var(--gold-b);
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow-l);
  display: flex;
  transition: box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
  overflow: hidden;
}

.feat-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--gold);
}

.feat-thumb {
  width: 160px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #1c1304, #3e2c0e);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  min-height: 130px;
  border-right: 1px solid var(--gold-b);
}

.feat-thumb-label {
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  color: var(--gold);
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
  line-height: 1.5;
}

.feat-body {
  padding: 1.2rem 1.4rem;
  flex: 1;
  min-width: 0;
}

.feat-category {
  font-size: 0.52rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold-l);
  margin-bottom: 0.4rem;
}

.feat-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.3;
  margin-bottom: 0.45rem;
}

.feat-excerpt {
  font-size: 0.68rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 0.7rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feat-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.feat-author {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.feat-date {
  font-size: 0.58rem;
  color: var(--text-muted);
}

.feat-tag {
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem;
  background: var(--gold-g);
  border: 1px solid var(--gold-b);
  color: var(--gold-l);
}

.feat-read {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin-left: auto;
  white-space: nowrap;
}

/* ── SIDEBAR PANELS ── */
.sb-panel {
  background: var(--panel-bg);
  border: 1px solid var(--gold-b);
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow-l);
}

.sb-head {
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid var(--gold-b);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
}

.sb-body {
  padding: 0.8rem 1.1rem;
}

.sb-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(201, 168, 76, 0.1);
  cursor: pointer;
  transition: opacity 0.15s;
  text-decoration: none;
}

.sb-item:last-child {
  border-bottom: none;
}
.sb-item:hover {
  opacity: 0.75;
}

.sb-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  color: var(--gold-b);
  font-weight: 300;
  line-height: 1;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.sb-text {
  flex: 1;
}

.sb-title {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.4;
  margin-bottom: 0.15rem;
}

.sb-cat {
  font-size: 0.56rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.issue-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.issue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--gold-b);
  background: var(--bg);
  cursor: pointer;
  transition: all 0.15s;
}

.issue-item:hover {
  background: var(--gold);
  color: var(--bg);
}

.issue-item:hover .issue-label,
.issue-item:hover .issue-count {
  color: var(--bg);
}

.issue-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--white);
}

.issue-count {
  font-size: 0.56rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* ── CATEGORY PILL ── */
.cat-pill {
  display: inline-block;
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.55rem;
  background: var(--bg);
  border: 1px solid var(--gold-b);
  color: var(--gold-l);
  margin: 0.15rem 0.1rem;
}

/* ── MODAL ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 990;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 1rem;
  overflow-y: auto;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  background: var(--panel-bg);
  color: var(--ink);
  max-width: 780px;
  width: 100%;
  border-top: 4px solid var(--gold);
  margin-bottom: 3rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  position: relative;
}

.modal-head {
  padding: 1.8rem 2.2rem 1rem;
  border-bottom: 1px solid var(--gold-b);
}

.modal-issue {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
  margin-bottom: 0.4rem;
}

.modal-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 0.5rem;
}

.modal-author {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink2);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  color: var(--ink3);
  padding: 0.3rem 0.5rem;
  transition: color 0.2s;
  z-index: 1010;
}

.modal-close:hover {
  color: var(--gold);
}

.modal-body {
  padding: 1.8rem 2.2rem;
}

.modal-abstract {
  font-size: 0.82rem;
  color: var(--ink2);
  line-height: 1.9;
  border-left: 3px solid var(--gold);
  padding-left: 1.2rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  font-style: italic;
  margin-bottom: 2rem;
}

.modal-content {
  font-size: 0.82rem;
  color: var(--ink);
  line-height: 1.9;
}

.modal-content p {
  margin-bottom: 1.4rem;
}

.modal-content h3 {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin: 2rem 0 0.8rem;
  border-bottom: 1px solid var(--gold-b);
  padding-bottom: 0.3rem;
}

.modal-foot {
  padding: 1.2rem 2.2rem;
  border-top: 1px solid var(--gold-b);
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--bg3);
}

.modal-meta {
  font-size: 0.62rem;
  color: var(--ink3);
  margin-right: auto;
}

/* ── RICH CONTENT ── */
.rich-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.8rem 0;
  font-size: 0.72rem;
  font-family: 'Montserrat', sans-serif;
  color: var(--ink);
}

.rich-table th {
  background: var(--gold);
  color: #0d0d0d;
  padding: 0.6rem 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  text-align: left;
}

.rich-table td {
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--gold-b);
  background: var(--panel-bg);
}

.rich-table tr:nth-child(even) td {
  background: #1e1e1e;
}

.rich-diagram {
  background: var(--bg3);
  color: var(--ink2);
  padding: 1.4rem;
  font-family: monospace;
  font-size: 0.65rem;
  line-height: 1.4;
  margin: 1.8rem 0;
  white-space: pre;
  border: 1px solid #dcdcdc;
  border-left: 3px solid var(--gold);
  overflow-x: auto;
}

.ref-list {
  font-size: 0.68rem;
  color: var(--ink2);
  line-height: 1.65;
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px dashed #cccccc;
  font-family: 'Montserrat', sans-serif;
}

/* ── BUREAU BYLINES ── */
.byline-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.3rem;
}

.byline-bureau {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold);
}

.byline-contributor {
  font-size: 0.55rem;
  color: var(--ink3);
  font-style: italic;
}

.feat-bureau {
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--gold-l);
  margin-bottom: 0.1rem;
  display: block;
}

/* ── ACCESSIBILITY STRIP ── */
.a11y-strip {
  background: linear-gradient(90deg, #0f0f0f, #151208, #0f0f0f);
  border-bottom: 1px solid var(--gold-b);
  padding: 0.5rem 2rem;
  display: flex;
  align-items: center;
  gap: 0;
  position: sticky;
  top: calc(var(--topbar-h) + 52px);
  z-index: 690;
}

.a11y-strip-label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex-shrink: 0;
  padding-right: 1rem;
  margin-right: 0.8rem;
  border-right: 1px solid var(--gold-b);
}

.a11y-strip-title {
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--gold);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.a11y-strip-sub {
  font-size: 0.4rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.a11y-active-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  display: none;
  flex-shrink: 0;
}

.a11y-active-dot.show {
  display: inline-block;
}

.a11y-tools {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-wrap: wrap;
}

.a11y-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  padding: 0.38rem 0.6rem;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.16s;
  white-space: nowrap;
  min-width: 54px;
  border-radius: 2px;
  position: relative;
}

.a11y-btn:hover {
  border-color: var(--gold-b);
  background: var(--gold-g);
  color: var(--white);
}

.a11y-btn.on {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.1);
  color: var(--gold);
}

.a11y-btn.on::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 15%;
  right: 15%;
  height: 2px;
  background: var(--gold);
}

.a11y-icon {
  width: 17px;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: opacity 0.16s;
}

.a11y-btn:hover .a11y-icon,
.a11y-btn.on .a11y-icon {
  opacity: 1;
}

.a11y-icon svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.a11y-lbl {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.42rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  line-height: 1;
  color: inherit;
}

.a11y-sep {
  width: 1px;
  height: 26px;
  background: var(--gold-b);
  margin: 0 0.4rem;
  flex-shrink: 0;
}

.a11y-reset {
  margin-left: auto;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.44rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.a11y-reset:hover {
  border-color: var(--gold-b);
  color: var(--white);
}

/* ── MODAL READING TOOLS ── */
.modal-a11y {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.6rem 2.2rem;
  background: rgba(201, 168, 76, 0.04);
  border-bottom: 1px solid var(--gold-b);
  flex-wrap: wrap;
}

.modal-a11y-label {
  font-size: 0.44rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--gold);
  white-space: nowrap;
  margin-right: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.modal-a11y-label svg {
  width: 11px;
  height: 11px;
  fill: var(--gold);
}

.m-a11y-btn {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.55rem;
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.14s;
  white-space: nowrap;
  font-family: 'Montserrat', sans-serif;
  border-radius: 2px;
}

.m-a11y-btn:hover {
  border-color: var(--gold-b);
  background: var(--gold-g);
  color: var(--white);
}

.m-a11y-btn.on {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.12);
  color: var(--gold-l);
}

.m-a11y-btn svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.14s;
}

.m-a11y-btn:hover svg,
.m-a11y-btn.on svg {
  opacity: 1;
}

.m-a11y-btn-lbl {
  font-size: 0.44rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1;
}

.m-a11y-sep {
  width: 1px;
  height: 16px;
  background: var(--gold-b);
  margin: 0 0.2rem;
  flex-shrink: 0;
}

/* ── READING MODES ── */
body.a11y-dyslexia .modal-body,
body.a11y-dyslexia .modal-content p,
body.a11y-dyslexia .modal-abstract {
  font-family: 'Atkinson Hyperlegible', sans-serif !important;
}
body.a11y-dyslexia .modal-title {
  font-family: 'Atkinson Hyperlegible', sans-serif !important;
  letter-spacing: 0.04em;
}

body.a11y-large-text .modal-content {
  font-size: 1rem !important;
  line-height: 2.1 !important;
}
body.a11y-large-text .modal-content p {
  font-size: 1rem !important;
  line-height: 2.1 !important;
}
body.a11y-large-text .modal-abstract {
  font-size: 1.1rem !important;
  line-height: 2 !important;
}
body.a11y-large-text .modal-title {
  font-size: 2.2rem !important;
}

body.a11y-wide-spacing .modal-content p {
  letter-spacing: 0.06em !important;
  word-spacing: 0.22em !important;
  line-height: 2.3 !important;
}
body.a11y-wide-spacing .modal-abstract {
  letter-spacing: 0.04em !important;
  word-spacing: 0.16em !important;
  line-height: 2.2 !important;
}

body.a11y-high-contrast .modal-backdrop.open {
  background: rgba(0, 0, 0, 0.98) !important;
}
body.a11y-high-contrast .modal {
  background: #ffffff !important;
  border-top-color: #000 !important;
  box-shadow: 0 0 0 2px #000 !important;
}
body.a11y-high-contrast .modal-head {
  background: #ffffff !important;
  border-bottom: 2px solid #000000 !important;
}
body.a11y-high-contrast .modal-issue {
  color: #0055cc !important;
}
body.a11y-high-contrast .modal-title {
  color: #000000 !important;
  font-family: 'Georgia', serif !important;
}
body.a11y-high-contrast .byline-bureau {
  color: #0055cc !important;
}
body.a11y-high-contrast .byline-contributor {
  color: #333333 !important;
}
body.a11y-high-contrast .modal-a11y {
  background: #f0f0f0 !important;
  border-bottom: 2px solid #000 !important;
}
body.a11y-high-contrast .modal-a11y-label {
  color: #000000 !important;
}
body.a11y-high-contrast .m-a11y-btn {
  color: #000000 !important;
  border-color: #999 !important;
}
body.a11y-high-contrast .m-a11y-btn:hover,
body.a11y-high-contrast .m-a11y-btn.on {
  background: #000 !important;
  color: #fff !important;
  border-color: #000 !important;
}
body.a11y-high-contrast .m-a11y-btn svg {
  fill: #000000 !important;
}
body.a11y-high-contrast .modal-body {
  background: #ffffff !important;
}
body.a11y-high-contrast .modal-abstract {
  color: #111111 !important;
  border-left-color: #000000 !important;
  font-style: italic;
}
body.a11y-high-contrast .modal-content {
  color: #000000 !important;
  background: #ffffff !important;
}
body.a11y-high-contrast .modal-content p {
  color: #000000 !important;
}
body.a11y-high-contrast .modal-content h3 {
  color: #0055cc !important;
  border-bottom-color: #000 !important;
}
body.a11y-high-contrast .modal-foot {
  background: #e8e8e8 !important;
  border-top: 2px solid #000 !important;
}
body.a11y-high-contrast .modal-meta {
  color: #333 !important;
}
body.a11y-high-contrast .modal-close {
  color: #000 !important;
}
body.a11y-high-contrast .rich-table td {
  background: #fff !important;
  color: #000 !important;
  border-color: #000 !important;
}
body.a11y-high-contrast .rich-table th {
  background: #000 !important;
  color: #fff !important;
}
body.a11y-high-contrast .ref-list {
  color: #222 !important;
}
body.a11y-high-contrast .reading-progress-fill {
  background: #0055cc !important;
}

body.a11y-focus-mode .modal-backdrop.open {
  background: rgba(0, 0, 0, 0.97) !important;
}
body.a11y-focus-mode .modal::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 72% 80% at 50% 45%, transparent 60%, rgba(0, 0, 0, 0.92) 100%);
  pointer-events: none;
  z-index: -1;
}
body.a11y-focus-mode .topbar {
  opacity: 0.15;
  transition: opacity 0.3s;
}
body.a11y-focus-mode .topbar:hover {
  opacity: 1;
}
body.a11y-focus-mode .modal-head {
  border-bottom-color: rgba(201, 168, 76, 0.15) !important;
}
body.a11y-focus-mode .modal-foot {
  opacity: 0.4;
}

.reading-progress {
  position: sticky;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--gold-b);
  z-index: 5;
  margin: -1.8rem -2.2rem 1.2rem;
  width: calc(100% + 4.4rem);
}

.reading-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-d), var(--gold-l));
  width: 0%;
  transition: width 0.1s linear;
}

.tts-speaking {
  background: rgba(201, 168, 76, 0.13);
  border-left: 2px solid var(--gold);
  padding-left: 0.6rem;
  margin-left: -0.8rem;
  transition: all 0.25s;
}

body.a11y-ruler .modal-body {
  cursor: crosshair;
}
.reading-ruler {
  position: fixed;
  left: 0;
  right: 0;
  height: 2.2rem;
  background: rgba(201, 168, 76, 0.07);
  border-top: 1px solid rgba(201, 168, 76, 0.3);
  border-bottom: 1px solid rgba(201, 168, 76, 0.3);
  pointer-events: none;
  z-index: 9999;
  display: none;
  box-shadow: 0 -40px 40px rgba(0, 0, 0, 0.35), 0 40px 40px rgba(0, 0, 0, 0.35);
}
body.a11y-ruler .reading-ruler {
  display: block;
}

body.a11y-sentence-hl .modal-content p:hover {
  background: rgba(201, 168, 76, 0.07) !important;
  border-left: 2px solid var(--gold-b) !important;
  padding-left: 0.6rem !important;
  cursor: default;
}

body.a11y-adhd .modal-content p {
  max-width: 62ch !important;
  margin-bottom: 1.8rem !important;
  line-height: 2.1 !important;
}
body.a11y-adhd .modal-content p::first-line {
  font-weight: 700;
}

body.a11y-reduce-motion * {
  animation: none !important;
  transition: none !important;
}

body.a11y-sepia .modal {
  background: #1a1500 !important;
}
body.a11y-sepia .modal-body {
  background: #1a1500 !important;
}
body.a11y-sepia .modal-content {
  color: #e8d9a0 !important;
}
body.a11y-sepia .modal-content p {
  color: #e8d9a0 !important;
}
body.a11y-sepia .modal-abstract {
  color: #c9ba80 !important;
}

/* ── MAG-TTS BAR ── */
#mag-tts-bar {
  background: linear-gradient(160deg, #090600, #0e0b01, #090600);
  border-bottom: 1px solid var(--gold-b);
  padding: 0.85rem 2.2rem 0.9rem;
  display: none;
  flex-direction: column;
  gap: 0.55rem;
  position: relative;
}

#mag-tts-bar.active {
  display: flex;
}

@keyframes mtts-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

@keyframes mtts-wave {
  0% {
    transform: scaleY(0.3);
  }
  50% {
    transform: scaleY(1);
  }
  100% {
    transform: scaleY(0.3);
  }
}

.mtts-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.mtts-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-d), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(201, 168, 76, 0.35);
}

.mtts-icon svg {
  width: 16px;
  height: 16px;
  fill: #0d0d0d;
}

.mtts-meta {
  flex: 1;
  min-width: 0;
}

.mtts-label {
  font-family: 'Cinzel', serif;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  color: var(--gold);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.mtts-voice-name {
  font-size: 0.43rem;
  color: var(--text-muted);
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  letter-spacing: 0.05em;
  font-style: italic;
}

.mtts-status {
  font-size: 0.43rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.16rem 0.45rem;
  border-radius: 2px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.22s;
  white-space: nowrap;
  flex-shrink: 0;
}

.mtts-status.playing {
  color: var(--green);
  background: var(--green-g);
  border-color: var(--green-b);
}

.mtts-status.paused {
  color: var(--amber);
  background: var(--amber-g);
  border-color: var(--amber-b);
}

.mtts-status.loading {
  color: var(--purple);
  background: var(--purple-g);
  border-color: var(--purple-b);
  animation: mtts-pulse 0.9s infinite;
}

.mtts-wave-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.mtts-wave-bars {
  flex: 1;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(201, 168, 76, 0.12);
  border-radius: 3px;
}

.mtts-wave-bar {
  width: 3px;
  background: var(--gold-d);
  border-radius: 2px;
  height: 8px;
  animation: mtts-wave 1.4s ease-in-out infinite;
  opacity: 0.6;
}

.mtts-wave-bar:nth-child(2) {
  animation-delay: 0.1s;
  height: 14px;
}
.mtts-wave-bar:nth-child(3) {
  animation-delay: 0.2s;
  height: 22px;
}
.mtts-wave-bar:nth-child(4) {
  animation-delay: 0.3s;
  height: 30px;
}
.mtts-wave-bar:nth-child(5) {
  animation-delay: 0.4s;
  height: 22px;
}
.mtts-wave-bar:nth-child(6) {
  animation-delay: 0.5s;
  height: 14px;
}
.mtts-wave-bar:nth-child(7) {
  animation-delay: 0.6s;
  height: 8px;
}

.mtts-wave-bars.idle .mtts-wave-bar {
  animation: none;
  height: 4px;
  opacity: 0.2;
}

.mtts-wave-bars.paused .mtts-wave-bar {
  animation-play-state: paused;
  opacity: 0.35;
}

.mtts-progress-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.mtts-track {
  flex: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.mtts-track:hover {
  height: 7px;
  transition: height 0.15s;
}

.mtts-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-d), var(--gold), var(--gold-l));
  border-radius: 3px;
  width: 0%;
  transition: width 0.25s linear;
}

.mtts-pct {
  font-size: 0.45rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  min-width: 30px;
  font-weight: 700;
}

.mtts-time {
  font-size: 0.44rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.mtts-preview {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.88rem;
  font-style: italic;
  color: rgba(201, 168, 76, 0.7);
  line-height: 1.65;
  padding: 0.3rem 0.7rem;
  border-left: 2px solid var(--gold-b);
  min-height: 1.6rem;
  border-radius: 0 2px 2px 0;
  background: rgba(201, 168, 76, 0.03);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mtts-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.mtts-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  border: 1px solid var(--gold-b);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.14s;
  border-radius: 2px;
  font-family: 'Montserrat', sans-serif;
  font-size: 0.47rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.3rem 0.6rem;
  white-space: nowrap;
}

.mtts-btn:hover {
  border-color: var(--gold);
  color: var(--gold-l);
  background: var(--gold-g);
}

.mtts-btn svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
  flex-shrink: 0;
}

.mtts-play {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gold);
  border-color: var(--gold);
  color: #0d0d0d;
  padding: 0;
  flex-shrink: 0;
  box-shadow: 0 2px 12px rgba(201, 168, 76, 0.4);
}

.mtts-play:hover {
  background: var(--gold-l);
  transform: scale(1.07);
}

.mtts-play svg {
  width: 18px;
  height: 18px;
  fill: #0d0d0d;
}

.mtts-sep {
  width: 1px;
  height: 22px;
  background: var(--gold-b);
  flex-shrink: 0;
  margin: 0 0.15rem;
}

.mtts-ctrl-group {
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
}

.mtts-ctrl-lbl {
  font-size: 0.37rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.mtts-sel {
  background: #080600;
  color: var(--text-secondary);
  border: 1px solid var(--gold-b);
  font-family: 'Montserrat', sans-serif;
  font-size: 0.49rem;
  padding: 0.22rem 0.38rem;
  cursor: pointer;
  border-radius: 2px;
  min-width: 80px;
}

.mtts-sel:hover {
  border-color: var(--gold);
}

.mtts-hint {
  font-size: 0.38rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  font-family: 'Montserrat', sans-serif;
  opacity: 0.5;
}

/* ── TRANSLATION STATUS BAR ── */
#tx-status-bar {
  display: none;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.48rem;
  color: var(--purple);
  background: var(--purple-g);
  border: 1px solid var(--purple-b);
  padding: 0.3rem 0.7rem;
  border-radius: 2px;
  margin-bottom: 0.1rem;
}

#tx-status-bar.active {
  display: flex;
}

#tx-status-bar svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
  flex-shrink: 0;
}

#tx-status-fill {
  height: 3px;
  background: var(--purple);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s;
}

/* ── AI EDITORIAL AGENT (minimal) ── */
#editorial-fab {
  position: fixed;
  bottom: 1.6rem;
  right: 1.6rem;
  z-index: 1200;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-d), var(--gold));
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(201, 168, 76, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s, box-shadow 0.18s;
  flex-direction: column;
  gap: 2px;
}

#editorial-fab:hover {
  transform: scale(1.09);
  box-shadow: 0 6px 24px rgba(201, 168, 76, 0.6);
}

#editorial-fab svg {
  width: 22px;
  height: 22px;
  fill: #0d0d0d;
}

#editorial-fab-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  padding: 0 4px;
  background: var(--red);
  color: #fff;
  font-size: 0.42rem;
  font-weight: 800;
  font-family: 'Montserrat', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
  white-space: nowrap;
}

#ep-toast {
  position: fixed;
  bottom: 5rem;
  right: 1.6rem;
  z-index: 1300;
  background: #0e0b02;
  border: 1px solid var(--green-b);
  border-left: 3px solid var(--green);
  color: var(--green);
  padding: 0.55rem 1rem;
  font-size: 0.54rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  letter-spacing: 0.06em;
  max-width: 280px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  gap: 0.5rem;
  animation: ep-toast-in 0.25s ease;
}

#ep-toast.show {
  display: flex;
}

@keyframes ep-toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

#ep-toast svg {
  width: 14px;
  height: 14px;
  fill: var(--green);
  flex-shrink: 0;
}

#editorial-panel {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
}

#editorial-panel.open {
  display: flex;
}

.ep-modal {
  background: #0e0b02;
  border: 1px solid var(--gold-b);
  border-top: 4px solid var(--gold);
  width: 100%;
  max-width: 1060px;
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.7);
  margin-bottom: 3rem;
}

/* (Editorial panel sub-styles are kept minimal; full version can be expanded) */
.ep-head {
  padding: 1rem 1.8rem;
  background: linear-gradient(90deg, #0f0c00, #1a1400, #0f0c00);
  border-bottom: 1px solid var(--gold-b);
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.ep-head-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ep-head-icon svg {
  width: 17px;
  height: 17px;
  fill: #0d0d0d;
}
.ep-head-text {
  flex: 1;
}
.ep-head-title {
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  color: var(--gold);
  letter-spacing: 0.08em;
  font-weight: 600;
}
.ep-head-sub {
  font-size: 0.46rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 0.12rem;
}
.ep-head-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.ep-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.4rem;
  transition: color 0.14s;
  margin-left: 0.3rem;
}
.ep-close:hover {
  color: var(--white);
}
.ep-queue-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.65rem 1.8rem;
  border-bottom: 1px solid var(--gold-b);
  background: rgba(0, 0, 0, 0.2);
}
.ep-queue-lbl {
  font-size: 0.46rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.ep-queue-tab {
  padding: 0.22rem 0.6rem;
  font-size: 0.48rem;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  border: 1px solid var(--gold-b);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.14s;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.ep-queue-tab .ep-qt-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.ep-queue-tab.active {
  background: var(--gold);
  color: #0d0d0d;
  border-color: var(--gold);
}
.ep-queue-spacer {
  flex: 1;
}
.ep-queue-submit-btn {
  padding: 0.28rem 0.75rem;
  font-size: 0.46rem;
  font-weight: 700;
  font-family: 'Montserrat', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--gold-b);
  color: var(--gold);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.ep-queue-submit-btn:hover {
  background: var(--gold-g);
  border-color: var(--gold);
}
.ep-queue-submit-btn svg {
  width: 11px;
  height: 11px;
  fill: currentColor;
}