/* ================================
   Astracel – Codex SkyNotes (Reusable)
   ================================ */

/* Uses your existing tokens if present; has fallbacks */
:root{
  --skynote-bg: rgba(4, 6, 10, 0.78);
  --skynote-panel: rgba(255,255,255,0.06);
  --skynote-panel-2: rgba(0,0,0,0.25);
  --skynote-border: rgba(255,255,255,0.12);
  --skynote-muted: rgba(255,255,255,0.65);
}

/* =========================================================
   Codex-entry SkyNote button (right column)
   ========================================================= */
.codex-skynote-btn{
  width: 100%;
  cursor: pointer;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #f6f6f6;

  /* It is also an .info-box in your layout, so this is minimal */
  background: var(--panel, var(--skynote-panel));
  border: 1px solid var(--panel-border, var(--skynote-border));
  border-radius: var(--radius, 14px);
  box-shadow: var(--shadow, 0 8px 24px rgba(0,0,0,0.35));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease, color .18s ease;
}

.codex-skynote-btn:hover{
  background: var(--panel-hover, rgba(255,255,255,0.09));
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft, 0 6px 18px rgba(0,0,0,0.28));
}

.codex-skynote-icon{
  font-size: 18px;
  line-height: 1;
}

.codex-skynote-label{
  font-size: clamp(14px, 1.25vw, 20px);
  letter-spacing: .2px;
}

/* =========================================================
   Codex-entry SkyNote Modal
   ========================================================= */

/* Backdrop */
.codex-notes-backdrop{
  position: fixed;
  inset: 0;
  z-index: 3200;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 24px;

  background: var(--skynote-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  opacity: 0;
  pointer-events: none;
  transition: opacity .20s ease;
}

.codex-notes-backdrop.is-open{
  opacity: 1;
  pointer-events: auto;
}

/* Prevent background scroll when codex modal is open */
body.codex-notes-open{
  overflow: hidden;
}

/* Modal panel */
.codex-notes-modal{
  width: min(900px, 100%);
  max-height: 80vh;

  background: linear-gradient(
      135deg,
      rgba(255,255,255,0.10),
      rgba(255,255,255,0.03)
  );
  border-radius: 18px;
  border: 1px solid var(--panel-border, var(--skynote-border));
  box-shadow: 0 22px 60px rgba(0,0,0,0.60);

  padding: 18px 20px 20px;
  display:flex;
  flex-direction:column;
}

/* Modal header */
.codex-notes-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.codex-notes-header h2{
  margin: 0;
  font-size: clamp(18px, 2.1vw, 24px);
  letter-spacing: .4px;
}

.codex-notes-header p{
  margin: 6px 0 0;
  color: var(--muted, #a9b1ba);
  font-size: 13px;
}

/* Close button */
.codex-notes-close{
  background: transparent;
  border-radius: 999px;
  border: 1px solid transparent;
  width: 32px;
  height: 32px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor: pointer;
  color: var(--muted, #a9b1ba);
  font-size: 20px;
  line-height: 1;
  transition:
    color .18s ease,
    background .18s ease,
    border-color .18s ease,
    transform .14s ease;
}

.codex-notes-close:hover{
  color: var(--accent, #df3c1b);
  background: rgba(0,0,0,0.35);
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-1px);
}

/* Modal body (scrollable) */
.codex-notes-body{
  margin-top: 10px;
  padding-right: 6px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.codex-notes-body::-webkit-scrollbar{
  width: 6px;
}
.codex-notes-body::-webkit-scrollbar-thumb{
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent, #df3c1b) 70%, transparent);
}
.codex-notes-body::-webkit-scrollbar-track{
  background: transparent;
}

.codex-notes-empty{
  margin: 4px 0;
  color: var(--muted, #a9b1ba);
  font-size: 14px;
}

/* Note card */
.codex-notes-card{
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--skynote-panel-2);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  margin-bottom: 10px;
}

/* Unified list */
.codex-notes-list{
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.55;
  display: grid;
  gap: 6px;
}

/* Bullets */
.codex-notes-bullet{
  margin-bottom: 2px;
}

/* Plain lines should not force bullet markers */
.codex-notes-plain{
  list-style: none;
  padding-left: 0;
  margin-left: -18px;
  color: var(--text, #eef2f6);
  opacity: 0.95;
}

/* Image item */
.codex-notes-image-item{
  list-style: none;
  margin: 8px 0 4px;
  padding-left: 0;
  margin-left: -18px;
}

.codex-notes-image{
  display:block;
  max-width: 360px;
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 10px 26px rgba(0,0,0,0.45);
  object-fit: cover;
}

/* Links in codex modal */
.codex-notes-list a{
  color: var(--text, #eef2f6);
  text-decoration: underline;
  text-decoration-color: var(--accent, #df3c1b);
  text-underline-offset: 2px;
  transition: color .2s ease, text-decoration-color .2s ease;
}

.codex-notes-list a:hover{
  color: var(--accent, #df3c1b);
  text-decoration-color: #fff;
}

/* Container */
.container {
  position: relative;
  z-index: 5; /* sit above mythical background */
}

/* Small screens */
@media (max-width: 780px){
  .codex-notes-modal{
    width: 100%;
    max-height: 82vh;
    padding: 14px 14px 16px;
  }
  .codex-notes-image{
    max-width: 260px;
  }
}

/* Motion safety */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}