﻿/* =========================================================
   DOCUMENT STYLE - MANIFESTO PAGE
   ========================================================= */

/* ===== DOCUMENT TITLE ===== */

.document-title {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--green);
}

.document-title h1 {
  margin: 0;
  padding: 0;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.document-title h1 .ja {
  display: block;
  font-family: var(--font-ja-serif);
  color: var(--text);
  margin-bottom: 8px;
}

.document-title h1 .en {
  display: block;
  font-family: var(--font-en);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 700;
  line-height: 0.5;
  padding: 0 0 0 0.3em;
}

/* ===== MESSAGE HEADER ===== */

.msg-header {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 0;
  padding: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, 0.2);
  font-family: ui-monospace, monospace;
  font-size: 0.7rem;
  line-height: 1.5;
  margin-bottom: 12px;
}

.msg-field {
  display: contents;
}

.msg-field-ja {
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  padding-right: 8px;
  padding-left: 0;
  text-align: right;
  border-right: none;
  word-break: break-word;
  white-space: nowrap;
}

.msg-field-en {
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  padding-right: 8px;
  padding-left: 8px;
  text-align: left;
  border-right: 1px solid var(--line);
  word-break: break-word;
  white-space: nowrap;
}

.msg-field-value {
  padding-left: 8px;
  padding-right: 4px;
  color: var(--text);
  word-break: break-word;
  white-space: pre-wrap;
}

/* ===== RULE LINES ===== */

.rule-line {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  margin: 16px 0;
  color: var(--line-strong);
  font-family: ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  user-select: none;
  opacity: 0.7;
}

.rule-line::before,
.rule-line::after {
  content: "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━";
  flex: 1;
}

.rule-line-text {
  padding: 0 12px;
  font-weight: 900;
  color: var(--text-muted);
  user-select: text;
  white-space: nowrap;
}

/* ===== ARTICLE SECTIONS ===== */

.article {
  position: relative;
  margin: 20px 0;
  padding: 12px;
  border-left: 3px solid var(--green);
  background: rgba(42, 167, 101, 0.08);
  transition: all 0.3s ease;
  overflow: hidden;
}

.article::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  background-image: url("../images/mtp_logo.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.08;
  z-index: 0;
  pointer-events: none;
}

.article > * {
  position: relative;
  z-index: 1;
}

.article:hover {
  border-left-color: var(--green-bright);
  background: rgba(42, 167, 101, 0.12);
}

.article.current {
  border-left: 3px solid var(--green-bright);
  background: rgba(42, 167, 101, 0.15);
  box-shadow: 0 0 10px rgba(114, 255, 178, 0.3);
}

.article-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--green-dim);
}

.article-num {
  font-family: ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 900;
}

.article-title .ja {
  font-family: var(--font-ja-serif);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  color: var(--green-bright);
  text-shadow: var(--glow-green);
}

.article-title .en {
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: ui-monospace, monospace;
  color: var(--text-muted);
  margin-top: 2px;
}

.article-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.article-body p {
  position: relative;
  padding-left: 40px;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text);
  margin: 0;
  transition: all 0.2s ease;
}

.article-body p:hover {
  color: var(--green-bright);
  text-shadow: 0 0 8px rgba(114, 255, 178, 0.4);
}

.article-body p::before {
  content: attr(data-line);
  position: absolute;
  left: 0;
  width: 32px;
  text-align: right;
  font-family: ui-monospace, monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  user-select: none;
  opacity: 0.6;
  transition: all 0.2s ease;
}

.article-body p:hover::before {
  color: var(--green-bright);
  opacity: 1;
  text-shadow: 0 0 4px rgba(114, 255, 178, 0.5);
}

/* ===== PREAMBLE ===== */

.preamble {
  position: relative;
  margin-bottom: 24px;
  padding: 12px;
  border: 1px solid var(--green-dim);
  background: rgba(42, 167, 101, 0.08);
  transition: all 0.3s ease;
  overflow: hidden;
}

.preamble::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 300px;
  height: 300px;
  background-image: url("../images/mtp_logo.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.08;
  z-index: 0;
  pointer-events: none;
}

.preamble > * {
  position: relative;
  z-index: 1;
}

.preamble:hover {
  border-color: var(--green-bright);
  background: rgba(42, 167, 101, 0.12);
}

.preamble.current {
  border: 1px solid var(--green-bright);
  background: rgba(42, 167, 101, 0.15);
  box-shadow: 0 0 10px rgba(114, 255, 178, 0.3);
}

.preamble-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--green-dim);
}

.preamble-title .ja {
  font-family: var(--font-ja-serif);
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: -0.048em;
  color: var(--green-bright);
}

.preamble-title .en {
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: ui-monospace, monospace;
  color: var(--text-muted);
  padding: 0 0 0 0.1em;
}

.preamble-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preamble-body p {
  position: relative;
  padding-left: 40px;
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text);
  margin: 0;
  transition: all 0.2s ease;
}

.preamble-body p:hover {
  color: var(--green-bright);
  text-shadow: 0 0 8px rgba(114, 255, 178, 0.4);
}

.preamble-body p::before {
  content: attr(data-line);
  position: absolute;
  left: 0;
  width: 32px;
  text-align: right;
  font-family: ui-monospace, monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  user-select: none;
  opacity: 0.6;
  transition: all 0.2s ease;
}

.preamble-body p:hover::before {
  color: var(--green-bright);
  opacity: 1;
  text-shadow: 0 0 4px rgba(114, 255, 178, 0.5);
}

/* Override text-transform for English text in preamble and article bodies */
.preamble-body .en,
.article-body .en {
  text-transform: none;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  line-height: 1;
}

/* ===== MESSAGE CLOSURE ===== */

.nothing-follows {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  margin: 20px 0;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-bright);
  text-shadow: var(--glow-green);
  font-weight: 900;
  border: 1px dashed var(--line);
  background: rgba(0, 0, 0, 0.1);
}

.eot-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  margin: 16px 0;
  font-family: ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  user-select: none;
}

.cursor {
  display: inline-block;
  width: 6px;
  height: 1em;
  margin-left: 2px;
  background: var(--green);
  animation: cursor-blink 1s infinite;
}

@keyframes cursor-blink {
  0%,
  49% {
    opacity: 1;
  }
  50%,
  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cursor {
    animation: none;
    opacity: 1;
  }
}

/* ===== WORD RAINBOW EASTER EGG ===== */

/* Word rainbow hover animation defined in word-rainbow.css */

/* ===== FOOTER ===== */

.doc-footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  margin-top: 16px;
  font-family: ui-monospace, monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.05em;
}

/* ===== TABLE OF CONTENTS (TOC) ===== */

.toc {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  margin: 0;
  list-style: none;
}

.toc-item {
  position: relative;
  padding: 6px 9px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  gap: 2px;
}

.toc-item:hover {
  background: rgba(12, 38, 23, 0.5);
  border-color: var(--green-bright);
  color: var(--green-bright);
  text-shadow: 0 0 4px rgba(114, 255, 178, 0.3);
}

.toc-item.current {
  border-color: var(--orange);
  background: rgba(125, 50, 22, 0.6);
  color: var(--orange-bright);
  text-shadow: var(--glow-orange);
  font-weight: 900;
}

.toc-num {
  font-family: ui-monospace, monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-right: 6px;
  user-select: none;
}

.toc-title {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

.toc-title .ja {
  font-weight: 900;
  line-height: 1.2;
}

.toc-title .en {
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-family: ui-monospace, monospace;
}

.toc-item:hover .toc-title .en {
  color: var(--green-bright);
}

.toc-item.current .toc-title .en {
  color: var(--orange-bright);
}

/* ===== DOCUMENT CONTROL PANEL (Right Column) ===== */

.doc-control {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.control-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.1);
  font-size: 0.75rem;
}

.control-section-title {
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--green-bright);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 4px;
  margin-bottom: 4px;
}

.control-item {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-family: ui-monospace, monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.control-label {
  font-weight: 700;
  color: var(--text-muted);
}

.control-value {
  font-weight: 900;
  color: var(--green);
  text-align: right;
  flex: 0 0 auto;
}

.progress-meter {
  width: 100%;
  height: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
  border-radius: 1px;
  overflow: hidden;
  margin-top: 4px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--green-bright));
  box-shadow: 0 0 4px rgba(114, 255, 178, 0.5);
  transition: width 0.3s ease;
}

/* ===== CONTRIBUTORS LIST ===== */

.contributors {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px;
  border: 1px solid var(--green-dim);
  background: rgba(42, 167, 101, 0.06);
  font-size: 0.7rem;
}

.contributors-title {
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--green);
  margin-bottom: 4px;
}

.contributor {
  position: relative;
  padding-left: 14px;
  color: var(--text-muted);
  line-height: 1.4;
}

.contributor::before {
  content: "•";
  position: absolute;
  left: 0;
  user-select: none;
}

/* ===== SHARE BUTTONS PANEL ===== */

.share-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.1);
  font-size: 0.75rem;
}

.share-panel-title {
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--green-bright);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 4px;
  margin-bottom: 4px;
}

.share-buttons-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 4px;
}

.share-btn {
  padding: 6px 8px;
  border: 1px solid var(--line);
  background: rgba(42, 167, 101, 0.15);
  color: var(--text-muted);
  font-family: var(--font-en);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s ease;
  text-align: center;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-btn:hover {
  border-color: var(--green);
  background: rgba(42, 167, 101, 0.25);
  color: var(--green);
  box-shadow: 0 0 8px rgba(114, 255, 178, 0.3);
}

.share-btn:active {
  transform: scale(0.98);
}

.share-btn.copied {
  border-color: var(--green);
  background: rgba(42, 167, 101, 0.4);
  color: var(--green);
}

.share-separator {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

.copy-text-btn {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--green-dim);
  background: rgba(42, 167, 101, 0.08);
  color: var(--text-muted);
  font-family: var(--font-ja-serif);
  font-size: 0.75rem;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  user-select: none;
}

.copy-text-btn:hover {
  border-color: var(--green);
  background: rgba(42, 167, 101, 0.2);
  color: var(--green);
  box-shadow: 0 0 8px rgba(114, 255, 178, 0.3);
}

.copy-text-btn:active {
  transform: scale(0.98);
}

.copy-text-btn.copied {
  border-color: var(--green-bright);
  background: rgba(42, 167, 101, 0.35);
  color: var(--green-bright);
  box-shadow: 0 0 12px rgba(114, 255, 178, 0.5);
}

.copy-buttons-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.copy-buttons-container .copy-text-btn {
  width: 100%;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 1100px) {
  .msg-header {
    font-size: 0.65rem;
    padding: 8px;
  }

  .msg-field-ja {
    padding-right: 6px;
  }

  .msg-field-en {
    padding-right: 6px;
    padding-left: 6px;
  }

  .msg-field-value {
    padding-left: 6px;
    padding-right: 3px;
  }

  .article-body p,
  .preamble-body p {
    font-size: 0.85rem;
    padding-left: 36px;
  }

  .article-body p::before,
  .preamble-body p::before {
    font-size: 0.6rem;
    width: 28px;
  }
}

@media (max-width: 860px) {
  .msg-header {
    grid-template-columns: auto auto 1fr;
    font-size: 0.6rem;
    padding: 6px;
  }

  .msg-field-ja {
    padding-right: 5px;
  }

  .msg-field-en {
    padding-right: 5px;
    padding-left: 5px;
  }

  .msg-field-value {
    padding-left: 5px;
    padding-right: 2px;
  }

  .article-body p,
  .preamble-body p {
    font-size: 0.8rem;
    padding-left: 32px;
  }

  .article-body p::before,
  .preamble-body p::before {
    font-size: 0.55rem;
    width: 24px;
  }
}

@media print {
  .article,
  .preamble {
    background: white !important;
    border-color: black;
    page-break-inside: avoid;
  }

  .article-body p,
  .preamble-body p {
    text-shadow: none;
  }

  .cursor {
    display: none;
  }

  .doc-control {
    display: none;
  }
}

/* ===== BUREAU LINKS ===== */

.bureau-link {
   color: var(--green);
   text-decoration: underline;
   text-decoration-thickness: 1px;
   text-underline-offset: 2px;
   transition: all 0.2s ease;
   cursor: pointer;
}

.bureau-link:hover {
   color: var(--green-bright);
   text-decoration-thickness: 2px;
   text-underline-offset: 1px;
   box-shadow: 0 0 8px rgba(114, 255, 178, 0.3);
}

.bureau-link:active {
   transform: scale(0.98);
}
