/* css/entry.css — Expanded entry overlay styles */

.entry-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(8, 8, 8, 0.97);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform-origin: top left;
  will-change: transform, opacity;
}

/* ── Entry Header Bar ───────────────────────────────────── */
.entry-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  z-index: 10;
  background: rgba(8, 8, 8, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.entry-close {
  font-family: var(--font-ui);
  font-size: 22px;
  color: var(--ink-secondary);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition:
    color var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out);
  line-height: 1;
}

.entry-close:hover {
  color: var(--ink-primary);
  background: var(--surface-hover);
}

.entry-download {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 5px 12px;
  transition:
    color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out);
}

.entry-download:hover {
  color: var(--ink-primary);
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

/* ── Entry Canvas ───────────────────────────────────────── */
.entry-canvas {
  width: 100%;
  flex: 0 0 58%;
  object-fit: cover;
  will-change: transform;
}

/* ── Entry Meta Panel ───────────────────────────────────── */
.entry-meta {
  flex: 1;
  overflow-y: auto;
  background: rgba(13, 12, 10, 0.95);
  backdrop-filter: var(--blur-heavy);
  -webkit-backdrop-filter: var(--blur-heavy);
  border-top: 1px solid var(--border);
  padding: var(--space-6) var(--space-8);
  padding-bottom: var(--space-12);
}

/* ── Mobile: portrait reflow ────────────────────────────── */
@media (max-width: 640px) {
  .entry-overlay {
    /* Ensure full height on mobile with browser chrome */
    height: 100dvh;
  }

  .entry-canvas {
    flex: 0 0 44%; /* shorter canvas so meta has room */
  }

  .entry-meta {
    padding: var(--space-4) var(--space-4);
    padding-bottom: var(--space-8);
  }

  .meta-day-name {
    font-size: clamp(22px, 6vw, 34px);
  }

  .meta-date-full {
    font-size: clamp(14px, 3.5vw, 18px);
  }

  .metric-row {
    grid-template-columns: 64px 1fr 38px;
    gap: var(--space-2);
  }

  .metric-text-row {
    grid-template-columns: 64px 1fr;
    gap: var(--space-2);
  }

  .metric-label,
  .metric-value,
  .metric-text-value {
    font-size: 11px;
  }

  .meta-description {
    font-size: 13px;
    padding: var(--space-3) var(--space-2);
  }

  .entry-header {
    padding: 0 var(--space-3);
  }

  .entry-close {
    width: 44px;
    height: 44px;
    font-size: 24px;
  }

  .entry-download {
    padding: 8px 14px;
    font-size: 11px;
    min-height: 36px;
  }
}

/* ── Very small screens (iPhone SE etc.) ────────────────── */
@media (max-width: 380px) {
  .entry-canvas {
    flex: 0 0 38%;
  }
  .hud-center {
    gap: 14px;
  }
}

/* ── Meta Content ───────────────────────────────────────── */
.meta-day-name {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 400;
  color: var(--ink-primary);
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.meta-date-full {
  font-family: var(--font-display);
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 400;
  color: var(--ink-secondary);
  margin-top: 2px;
}

.meta-session {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-tertiary);
  letter-spacing: 0.08em;
  margin-top: var(--space-2);
}

.meta-divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin: var(--space-4) 0;
}

/* ── Metric Rows ────────────────────────────────────────── */
.meta-metrics {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.metric-row {
  display: grid;
  grid-template-columns: 80px 1fr 44px;
  align-items: center;
  gap: var(--space-3);
}

.metric-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-tertiary);
}

.metric-bar-wrap {
  height: 4px;
  background: rgba(235, 228, 215, 0.08);
  border-radius: 2px;
  overflow: visible;
  position: relative;
}

.metric-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s var(--ease-precise);
  position: relative;
}

.metric-bar-fill::after {
  content: '';
  position: absolute;
  right: -1px;
  top: -2px;
  width: 3px;
  height: 7px;
  border-radius: 1px;
  background: inherit;
  opacity: 0.6;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-secondary);
  letter-spacing: 0.04em;
  text-align: right;
}

/* ── Metric bar colors ──────────────────────────────────── */
.metric-bar-fill[data-metric="energy"] {
  background: linear-gradient(90deg, rgba(255, 200, 120, 0.4), rgba(255, 200, 120, 0.7));
}
.metric-bar-fill[data-metric="silence"] {
  background: linear-gradient(90deg, rgba(180, 210, 190, 0.3), rgba(180, 210, 190, 0.55));
}
.metric-bar-fill[data-metric="bass"] {
  background: linear-gradient(90deg, rgba(150, 200, 160, 0.35), rgba(150, 200, 160, 0.6));
}
.metric-bar-fill[data-metric="treble"] {
  background: linear-gradient(90deg, rgba(200, 170, 255, 0.3), rgba(200, 170, 255, 0.5));
}

/* ── Text metrics (peaks, variance, dominant) ────────────── */
.metric-text-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: var(--space-3);
  align-items: baseline;
}

.metric-text-value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-secondary);
  letter-spacing: 0.04em;
}

/* ── Description ────────────────────────────────────────── */
.meta-description {
  font-family: var(--font-display);
  font-size: clamp(13px, 1.6vw, 16px);
  font-weight: 400;
  color: var(--ink-secondary);
  line-height: 1.65;
  font-style: italic;
  margin-top: var(--space-4);
  padding: var(--space-4) var(--space-3);
  border-left: 1px solid rgba(235, 228, 215, 0.1);
}

/* ── Delete button ──────────────────────────────────────── */
.meta-delete-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(235, 228, 215, 0.2);
  border: 1px solid rgba(235, 228, 215, 0.08);
  border-radius: var(--radius-xs);
  padding: 5px 10px;
  margin-top: var(--space-6);
  cursor: pointer;
  transition:
    color var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out);
  text-transform: uppercase;
}

.meta-delete-btn:hover {
  color: rgba(220, 100, 100, 0.6);
  border-color: rgba(220, 100, 100, 0.2);
}
