/* ============================================
   THE ARCHIVE — Red Room index
   /ourotheia/archive.css
   ============================================ */

/* ----------------------------------------
   BASE
   ---------------------------------------- */
.o-archive {
  background: #0a0606;
  color: #d8d0c8;
  font-family: var(--o-font-body);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Kill cursor trail */
.o-archive .cursor-trail,
.o-archive #cursorCanvas,
body:has(.o-archive) > canvas {
  display: none !important;
}

/* Scrollbar */
.o-archive,
html:has(.o-archive) {
  scrollbar-width: thin;
  scrollbar-color: rgba(140,20,20,0.2) #0a0606;
}

.o-archive::-webkit-scrollbar,
html:has(.o-archive)::-webkit-scrollbar {
  width: 5px;
}

.o-archive::-webkit-scrollbar-track,
html:has(.o-archive)::-webkit-scrollbar-track {
  background: #0a0606;
}

.o-archive::-webkit-scrollbar-thumb,
html:has(.o-archive)::-webkit-scrollbar-thumb {
  background: rgba(140,20,20,0.25);
  border-radius: 3px;
}

.o-archive::-webkit-scrollbar-thumb:hover,
html:has(.o-archive)::-webkit-scrollbar-thumb:hover {
  background: rgba(160,30,30,0.4);
}

.o-archive .o-vignette {
  z-index: 100;
}


/* ----------------------------------------
   CURTAINS
   ---------------------------------------- */
.curtain {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 120px;
  z-index: 2;
  pointer-events: none;
}

.curtain--left {
  left: 0;
  background: linear-gradient(
    90deg,
    rgba(90,8,8,0.4) 0%,
    rgba(70,6,6,0.25) 30%,
    rgba(50,4,4,0.1) 60%,
    transparent 100%
  );
  box-shadow: inset -8px 0 20px rgba(0,0,0,0.3);
  animation: curtain-sway-left 12s ease-in-out infinite alternate;
}

.curtain--right {
  right: 0;
  background: linear-gradient(
    -90deg,
    rgba(90,8,8,0.4) 0%,
    rgba(70,6,6,0.25) 30%,
    rgba(50,4,4,0.1) 60%,
    transparent 100%
  );
  box-shadow: inset 8px 0 20px rgba(0,0,0,0.3);
  animation: curtain-sway-right 12s ease-in-out infinite alternate;
}

@keyframes curtain-sway-left {
  0%   { width: 120px; opacity: 0.9; }
  50%  { width: 126px; opacity: 1; }
  100% { width: 118px; opacity: 0.88; }
}

@keyframes curtain-sway-right {
  0%   { width: 118px; opacity: 0.88; }
  50%  { width: 124px; opacity: 1; }
  100% { width: 120px; opacity: 0.9; }
}

/* Fabric fold lines */
.curtain--left::before,
.curtain--right::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  pointer-events: none;
  background: repeating-linear-gradient(
    90deg,
    transparent 0px,
    rgba(0,0,0,0.06) 2px,
    transparent 4px,
    transparent 18px
  );
}

.curtain--left::after,
.curtain--right::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  pointer-events: none;
  background: repeating-linear-gradient(
    90deg,
    transparent 0px,
    rgba(120,15,15,0.04) 1px,
    transparent 2px,
    transparent 24px
  );
}


/* ----------------------------------------
   CHEVRON FLOOR
   ---------------------------------------- */
.chevron-floor {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.12;
  background:
    linear-gradient(135deg, #d8d0c8 25%, transparent 25%) -20px 0,
    linear-gradient(225deg, #d8d0c8 25%, transparent 25%) -20px 0,
    linear-gradient(315deg, #d8d0c8 25%, transparent 25%),
    linear-gradient(45deg, #d8d0c8 25%, transparent 25%);
  background-size: 40px 40px;
  background-color: #1a0808;
  -webkit-mask-image: linear-gradient(transparent 0%, black 40%);
  mask-image: linear-gradient(transparent 0%, black 40%);
}


/* ----------------------------------------
   HEADER
   ---------------------------------------- */
.archive-header {
  text-align: center;
  padding: 2.5rem 2rem 1.5rem;
  position: relative;
  z-index: 3;
}

.archive-title {
  font-family: "Euphorigenic", var(--o-font-display);
  font-size: 2.6rem;
  color: #d8d0c8;
  letter-spacing: 0.14em;
  text-shadow:
    0 0 6px rgba(140,20,20,0.15),
    0 2px 4px rgba(0,0,0,0.8);
}


/* ----------------------------------------
   LAYOUT — sidebar + main
   ---------------------------------------- */
.archive-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
  position: relative;
  z-index: 3;
  align-items: start;
}


/* ----------------------------------------
   SIDEBAR
   ---------------------------------------- */
.archive-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 2rem;
}

.sidebar-panel {
  border: 1px solid rgba(140,20,20,0.18);
  padding: 1.2rem 1rem;
}


/* ----------------------------------------
   MAIN CONTENT
   ---------------------------------------- */
.main-panel {
  border: 1px solid rgba(140,20,20,0.18);
  padding: 1.5rem 2rem 2rem;
}


/* ----------------------------------------
   RULES
   ---------------------------------------- */
.archive-rule {
  width: 100%;
  height: 1px;
  margin: 1.5rem 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(140,20,20,0.25) 20%,
    rgba(140,20,20,0.3) 50%,
    rgba(140,20,20,0.25) 80%,
    transparent 100%
  );
}


/* ----------------------------------------
   SECTION HEADINGS
   ---------------------------------------- */
.section-heading {
  font-family: var(--o-font-mono, monospace);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: #8c1414;
  margin-bottom: 1rem;
}


/* ----------------------------------------
   RECENT ADDITIONS
   ---------------------------------------- */
.recent-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.recent-empty {
  font-size: 0.82rem;
  color: #4a4040;
  font-style: italic;
}

.recent-item {
  padding: 0.3em 0;
}

.recent-item-title {
  font-size: 0.82rem;
  color: #d8d0c8;
  text-decoration: none;
  display: block;
  transition: color 200ms ease;
}

.recent-item-title:hover {
  color: #e8c8c8;
}

.recent-item-date {
  font-family: var(--o-font-mono, monospace);
  font-size: 0.6rem;
  color: #5a4040;
  display: block;
  margin-top: 0.1em;
}


/* ----------------------------------------
   TAGS
   ---------------------------------------- */
.archive-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3em;
}

.archive-tag {
  font-family: 'AMORIA';
  font-size: 0.85rem;
  color: #8a6868;
  padding: 0.12em 0.5em;
  border: 1px solid rgba(140,20,20,0.12);
  background: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: color 200ms ease, border-color 200ms ease, background 200ms ease;
  letter-spacing: 0.03em;
}

.archive-tag:hover {
  color: #d8d0c8;
  border-color: rgba(140,20,20,0.3);
  background: rgba(140,20,20,0.06);
}


/* ----------------------------------------
   SITE MAP
   ---------------------------------------- */
.map-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 2.5rem;
  align-items: start;
}

.map-group {
  margin-bottom: 0.5rem;
}

.map-group-label {
  font-family: var(--o-font-mono, monospace);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #6a4040;
  margin-bottom: 0.5rem;
  padding-left: 0.2em;
}

.map-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.map-list li {
  padding: 0.25em 0;
  padding-left: 1em;
  position: relative;
}

.map-list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: #3a2020;
}

.map-list a {
  font-size: 0.82rem;
  color: #c8c0b8;
  text-decoration: none;
  transition: color 200ms ease;
}

.map-list a:hover {
  color: #e8c8c8;
}

.map-note {
  font-size: 0.68rem;
  color: #4a3030;
  font-style: italic;
}


/* ----------------------------------------
   ECHOES
   ---------------------------------------- */
.echoes-section {
  margin-top: 0.5rem;
}

.echoes-intro {
  font-size: 0.78rem;
  font-style: italic;
  color: #5a4848;
  margin-bottom: 1.2rem;
}

.echo {
  margin: 0 0 1.5rem;
  padding: 0;
  border: none;
  border-left: 1px solid rgba(140,20,20,0.2);
  padding-left: 1.2em;
}

.echo-text {
  font-size: 0.85rem;
  line-height: 1.7;
  color: #b8b0a8;
  font-style: italic;
  margin: 0 0 0.3em;
}

.echo-source {
  display: block;
  font-family: var(--o-font-mono, monospace);
  font-size: 0.62rem;
  color: #5a4040;
  font-style: normal;
  letter-spacing: 0.04em;
}


/* ----------------------------------------
   BACK LINK
   ---------------------------------------- */
.archive-back {
  position: fixed;
  bottom: 1.2rem;
  left: 1.5rem;
  font-family: var(--o-font-mono, monospace);
  font-size: 0.72rem;
  color: #4a3838;
  text-decoration: none;
  z-index: 10;
  transition: color 200ms ease;
}

.archive-back:hover {
  color: #8c1414;
}


/* ----------------------------------------
   RESPONSIVE
   ---------------------------------------- */
@media (max-width: 760px) {
  .archive-layout {
    grid-template-columns: 1fr;
    padding: 0 1.5rem 4rem;
  }

  .archive-sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .sidebar-panel {
    flex: 1;
    min-width: 200px;
  }

  .curtain {
    width: 60px;
  }

  .archive-title {
    font-size: 2rem;
  }
}

@media (max-width: 520px) {
  .archive-sidebar {
    flex-direction: column;
  }

  .sidebar-panel {
    min-width: auto;
  }

  .map-columns {
    grid-template-columns: 1fr;
    gap: 1.5rem 0;
  }

  .curtain {
    width: 30px;
  }

  .archive-header {
    padding: 2rem 1rem 1rem;
  }
}