/* ==========================================================================
   ARCHIVE DOSSIER READING TERMINAL - DEEPDROP ARCHIVES
   Apple Symmetry + Post-Apocalyptic / Resident Evil Tactical HUD
   ========================================================================== */

/* Outer Article Container */
body.ah-archive-theme .ah-main .ah-article-detail {
  width: min(1200px, calc(100% - 40px));
  max-width: none;
  margin: 24px auto 96px;
  color: var(--ah-paper, #e5e3da);
}

/* Nav Strip */
.ah-article-nav-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ah-dossier-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--ah-paper, #e5e3da) 22%, var(--ah-line, #444));
  border-radius: 999px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--ah-panel, #161719) 94%, var(--ah-paper, #e5e3da) 6%), var(--ah-panel, #161719));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 3px 10px rgba(0,0,0,.24);
  color: var(--ah-paper, #e5e3da);
  font-size: 13px;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.ah-dossier-back:hover,
.ah-dossier-back:focus-visible {
  border-color: color-mix(in srgb, var(--ah-warning, #b87a55) 62%, var(--ah-line, #444));
  background-color: color-mix(in srgb, var(--ah-panel, #161719) 88%, var(--ah-warning, #b87a55) 12%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 5px 14px rgba(0,0,0,.32);
  color: var(--ah-paper, #e5e3da);
}

.ah-dossier-code {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--ah-archive-signal, #c9756b);
  opacity: 0.85;
}

/* ==========================================================================
   Dual-Column Bento Grid Shell
   ========================================================================== */
.ah-article-bento-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 340px);
  gap: 28px;
  align-items: start;
}

/* ==========================================================================
   Left Column: Main Reading Terminal Slab
   ========================================================================== */
.ah-article-dossier-slab {
  position: relative;
  background: #111319;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: clamp(24px, 4vw, 44px) clamp(20px, 4.5vw, 48px);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

/* Resident Evil Corner Brackets */
.ah-article-dossier-slab > .re-bracket,
.ah-sidebar-bento-card > .re-bracket,
.ah-article-cover-frame > .re-bracket {
  position: absolute;
  width: 8px;
  height: 8px;
  pointer-events: none;
  z-index: 2;
  border-color: rgba(255, 255, 255, 0.35);
  border-style: solid;
}

.re-bracket--tl {
  top: 5px;
  left: 5px;
  border-width: 1.5px 0 0 1.5px;
}

.re-bracket--br {
  bottom: 5px;
  right: 5px;
  border-width: 0 1.5px 1.5px 0;
}

/* Hairline Reading Progress Bar */
.ah-reading-progress-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.04);
  z-index: 10;
}

.ah-reading-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--ah-archive-signal, #c9756b);
  box-shadow: 0 0 8px rgba(201, 117, 107, 0.45);
  transition: width 0.06s linear;
}

/* Dossier Header */
.ah-article-header-block {
  margin-bottom: 30px;
}

.ah-dossier-stamp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.ah-dossier-stamp {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--ah-archive-signal, #c9756b) 45%, transparent);
  background: rgba(201, 117, 107, 0.06);
  color: var(--ah-archive-signal, #c9756b);
  font: 11px/1.3 var(--ah-mono, monospace);
  letter-spacing: 0.08em;
  border-radius: 4px;
}

.ah-dossier-stamp code {
  color: #ffffff;
  font: inherit;
  font-weight: 600;
}

.ah-dossier-date {
  color: var(--ah-soft, #8e8d88);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.ah-article-headline {
  margin: 0 0 16px;
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: #ffffff;
  overflow-wrap: anywhere;
}

.ah-article-byline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--ah-soft, #8e8d88);
}

.ah-article-byline {
  margin: 0;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.ah-byline-label {
  color: var(--ah-soft, #8e8d88);
}

.ah-article-byline strong {
  color: #e5e3da;
  font-weight: 600;
}

.ah-reading-estimate {
  font-size: 11px;
  color: var(--ah-soft, #8e8d88);
  letter-spacing: 0.03em;
}

.ah-article-lede-box {
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.025);
  border-left: 3px solid var(--ah-archive-signal, #c9756b);
  border-radius: 0 8px 8px 0;
  margin-bottom: 28px;
}

.ah-article-lede {
  margin: 0;
  font-size: clamp(16px, 1.6vw, 18px);
  line-height: 1.75;
  color: #dedcd4;
  overflow-wrap: anywhere;
}

/* Featured Cover Frame */
.ah-article-cover-frame {
  position: relative;
  margin: 0 0 32px;
  padding: 8px;
  background: #0d0e12;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.4);
}

.ah-article-cover-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: cover;
  border-radius: 6px;
  background: #141518;
}

.ah-article-cover-caption {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 4px 4px;
  color: var(--ah-soft, #8e8d88);
  font-size: 12px;
  line-height: 1.5;
  font-family: var(--ah-mono, monospace);
}

.ah-caption-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ah-archive-signal, #c9756b);
  flex-shrink: 0;
}

/* ==========================================================================
   Elevated High-Contrast Article Body Reading Chamber
   ========================================================================== */
.ah-article-reading-chamber {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: clamp(22px, 3.5vw, 36px);
  margin-bottom: 34px;
}

.ah-article-body {
  width: 100%;
  max-width: none;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Anuphan", sans-serif;
  color: #f2f0e8;
  -webkit-font-smoothing: antialiased;
}

.ah-article-body p {
  margin: 0 0 1.75em;
  color: #f2f0e8;
  font-size: clamp(17px, 1.7vw, 19px);
  line-height: 1.88;
  letter-spacing: -0.005em;
  overflow-wrap: anywhere;
}

.ah-article-body p:last-child {
  margin-bottom: 0;
}

.ah-article-body strong,
.ah-article-body b {
  color: #ffffff;
  font-weight: 600;
}

.ah-article-body a {
  color: var(--ah-archive-signal, #c9756b);
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 0.15s ease;
}

.ah-article-body a:hover,
.ah-article-body a:focus-visible {
  color: #ffffff;
}

/* Archival Photo Gallery */
.ah-article-gallery-chamber {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ah-chamber-header {
  margin-bottom: 16px;
}

.ah-chamber-tag {
  display: block;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ah-archive-signal, #c9756b);
  margin-bottom: 4px;
}

.ah-chamber-header h2 {
  margin: 0;
  font-size: clamp(19px, 2.2vw, 24px);
  color: #ffffff;
  font-weight: 600;
}

.ah-article-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr));
  gap: 14px;
}

.ah-gallery-card {
  margin: 0;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
}

.ah-gallery-img-wrap img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 4px;
  background: #141518;
}

.ah-gallery-card figcaption {
  margin-top: 8px;
  padding-inline: 4px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ah-soft, #8e8d88);
}

/* ==========================================================================
   Right Column: Sticky Tactical Sidebar (32%)
   ========================================================================== */
.ah-article-sticky-sidebar {
  position: sticky;
  top: 92px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ah-sidebar-bento-card {
  position: relative;
  background: #111319;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}

.ah-sidebar-card-tag {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ah-archive-signal, #c9756b);
  font-weight: 600;
  margin-bottom: 12px;
}

/* Related Event Card */
.ah-sidebar-event-title {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  color: #ffffff;
}

.ah-sidebar-event-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.025);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.ah-meta-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}

.ah-meta-label {
  color: var(--ah-soft, #8e8d88);
}

.ah-meta-val {
  color: #e5e3da;
  font-weight: 600;
  text-align: right;
}

.ah-sidebar-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  background: #ffffff;
  color: #000000;
  transition: transform 0.15s ease, background 0.15s ease;
}

.ah-sidebar-cta:hover,
.ah-sidebar-cta:focus-visible {
  background: #f0f0f0;
  transform: translateY(-1px);
}

/* Cross-Index References Card */
.ah-sidebar-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.ah-sidebar-card-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
}

.ah-ref-count-chip {
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 11px;
  color: var(--ah-archive-signal, #c9756b);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ah-sidebar-ref-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ah-sidebar-ref-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  transition: border-color 0.15s, background 0.15s;
}

.ah-sidebar-ref-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.ah-ref-kind-pill {
  font-size: 10px;
  font-family: var(--ah-mono, monospace);
  padding: 2px 6px;
  background: rgba(201, 117, 107, 0.12);
  color: var(--ah-archive-signal, #c9756b);
  border-radius: 4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.ah-ref-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 1;
  min-width: 0;
  color: #e5e3da;
  text-decoration: none;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.ah-ref-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ah-ref-arrow {
  color: var(--ah-soft, #8e8d88);
  font-size: 12px;
  flex-shrink: 0;
}

.ah-sidebar-ref-item:hover .ah-ref-link {
  color: #ffffff;
}

.ah-sidebar-ref-item:hover .ah-ref-arrow {
  color: var(--ah-archive-signal, #c9756b);
}

.ah-reference-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
  font-size: 11px;
  color: var(--ah-soft, #8e8d88);
}

.ah-reference-pagination a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
}

.ah-reference-pagination a:hover {
  color: var(--ah-archive-signal, #c9756b);
}

/* Quick Actions Card */
.ah-sidebar-actions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ah-sidebar-action-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  color: #e5e3da;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.ah-sidebar-action-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.ah-sidebar-action-btn--primary {
  border-color: color-mix(in srgb, var(--ah-archive-signal, #c9756b) 45%, transparent);
  background: rgba(201, 117, 107, 0.08);
  color: #ffffff;
}

.ah-sidebar-action-btn--primary:hover {
  background: rgba(201, 117, 107, 0.16);
  border-color: var(--ah-archive-signal, #c9756b);
}

/* ==========================================================================
   Footer Navigation Strip
   ========================================================================== */
body.ah-archive-theme .ah-main .ah-article-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Focus States */
body.ah-archive-theme .ah-main .ah-article-detail :is(a, button):focus-visible {
  outline: 2px solid var(--ah-archive-signal, #c9756b);
  outline-offset: 3px;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 960px) {
  .ah-article-bento-shell {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .ah-article-sticky-sidebar {
    position: static;
  }
}

@media (max-width: 760px) {
  body.ah-archive-theme .ah-main .ah-article-detail {
    width: calc(100% - 24px);
    margin-block: 16px 64px;
  }

  .ah-article-dossier-slab {
    padding: 22px 18px;
    border-radius: 10px;
  }

  .ah-article-reading-chamber {
    padding: 18px 14px;
  }

  .ah-article-body p {
    font-size: 16.5px;
    line-height: 1.82;
  }

  .ah-dossier-stamp-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .ah-sidebar-bento-card {
    padding: 16px;
  }
}

@media (forced-colors: active) {
  .ah-article-dossier-slab,
  .ah-sidebar-bento-card,
  .ah-article-cover-frame,
  .ah-article-reading-chamber {
    border: 1px solid CanvasText;
  }
}

/* Reading comfort and accessible interaction states. */
.ah-article-detail :is(.ah-dossier-date, .ah-byline-label, .ah-meta-label, .ah-reference-pagination, .ah-ref-arrow, .ah-article-cover-caption, .ah-gallery-card figcaption) { color: #c5c5ca; }
.ah-article-detail :is(.ah-sidebar-card-tag, .ah-ref-kind-pill, .ah-ref-count-chip, .ah-dossier-code) { color: #d2d2d7; opacity: 1; }
.ah-article-detail .ah-sidebar-card-tag { font-size: 12px; line-height: 1.5; }
.ah-article-detail .ah-ref-name { white-space: normal; overflow-wrap: anywhere; }
.ah-article-detail .ah-ref-link,
.ah-article-detail .ah-reference-pagination a,
.ah-article-detail .ah-sidebar-action-btn,
.ah-article-detail .ah-article-footer a,
.ah-article-detail .tp-cross-sell-bento-cta { min-height: 44px; box-sizing: border-box; }
.ah-article-detail .ah-reference-pagination a,
.ah-article-detail .ah-article-footer a { display: inline-flex; align-items: center; }
body.ah-archive-theme .ah-main .ah-article-detail :is(a, button):focus-visible { outline-color: #f5f5f7; }
.ah-article-detail .ah-article-nav-strip { flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) {
  .ah-article-detail :is(.ah-reading-progress-bar, .ah-dossier-back, .ah-sidebar-cta, .ah-sidebar-action-btn, .ah-sidebar-ref-item) { transition: none !important; }
  .ah-article-detail .ah-sidebar-cta:is(:hover, :focus-visible) { transform: none; }
}
