/* ==========================================================================
   Weekendflash - Minimalistisches Digitales Archiv & Kanten-System
   Schriftart: M PLUS 1 Code (ausschließlich)
   Layout: 400px feste Breite, zentriert, responsive Skalierung
   ========================================================================== */

@font-face {
  font-family: 'M PLUS 1 Code';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./font/MPLUS1Code-Regular.ttf') format('truetype');
}

:root {
  --bg-color: #ffffff;
  --text-color: #000000;
  --meta-color: #000000;
  --border-color: #e5e5e5;
  --panel-bg: #f8f8f8;
  --link-color: #000000;
  --font-family: 'M PLUS 1 Code', monospace;
  --content-width: 400px;
  --radius-image: 6px;
  --spacing-object: 90px;
  --spacing-block: 18px;
  --font-size: 15px;
  --line-height: 1.65;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #000000;
    --text-color: #ffffff;
    --meta-color: #ffffff;
    --border-color: #262626;
    --panel-bg: #121212;
    --link-color: #ffffff;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-family);
  font-size: var(--font-size);
  font-weight: 400;
  line-height: var(--line-height);
  background-color: var(--bg-color);
  color: var(--text-color);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  padding: 60px 20px 140px 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

#archive-container {
  width: 100%;
  max-width: var(--content-width);
  display: flex;
  flex-direction: column;
}

/* Archiv-Objekt */
.archive-object {
  width: 100%;
  max-width: var(--content-width);
  margin-bottom: var(--spacing-object);
  scroll-margin-top: 40px;
}

.archive-object:last-child {
  margin-bottom: 40px;
}

/* Kopfzeile */
.object-header {
  font-family: var(--font-family);
  color: var(--meta-color);
  margin-bottom: var(--spacing-block);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.object-number {
  color: var(--text-color);
  text-decoration: none;
}

/* Blöcke */
.object-blocks {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-block);
}

.block-text {
  font-family: var(--font-family);
  line-height: var(--line-height);
  color: var(--text-color);
  white-space: pre-wrap;
  word-break: break-word;
}

.block-image {
  width: 100%;
  max-width: var(--content-width);
  aspect-ratio: 1 / 1;
  height: 400px;
  display: block;
}

.block-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius-image);
  display: block;
}

.block-link {
  font-family: var(--font-family);
  line-height: var(--line-height);
  word-break: break-all;
}

.block-link a {
  color: var(--link-color);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Interne Verweise auf Objekte & Kanten: ohne Unterstrich wie Fließtext */
a.archive-ref,
.edge-target-link,
.edge-rel-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

/* ==========================================================================
   Kantenzeilen am Ende des Objekts
   ========================================================================== */
.object-footer-links {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.5;
}

.edge-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--text-color);
}

.edge-text {
  color: var(--text-color);
}

/* ==========================================================================
   Kantenseite / Kantenansicht (Modal)
   ========================================================================== */
.edge-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  z-index: 999;
  backdrop-filter: blur(2px);
}

.edge-modal-card {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 100%;
  max-width: var(--content-width);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.edge-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.edge-modal-title {
  color: var(--text-color);
}

.btn-close-modal {
  background: none;
  border: none;
  color: var(--meta-color);
  font-family: inherit;
  cursor: pointer;
}

.edge-detail-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.edge-detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.edge-detail-label {
  color: var(--meta-color);
}

.edge-detail-val {
  color: var(--text-color);
}

/* Toast */
#toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--text-color);
  color: var(--bg-color);
  font-family: var(--font-family);
  padding: 8px 16px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease-in-out;
  z-index: 1000;
  white-space: nowrap;
}

#toast.show {
  opacity: 1;
}

.state-message {
  font-family: var(--font-family);
  font-size: var(--font-size);
  color: var(--meta-color);
  padding: 20px 0;
}

@media (max-width: 440px) {
  body {
    padding: 40px 16px 100px 16px;
  }
  .block-image {
    height: auto;
    width: 100%;
  }
  .block-image img {
    height: auto;
    aspect-ratio: 1 / 1;
  }
}