/* Single-page layout for the main page (index.html only): the latest memo
   on top, every older memo continuing below it on the same page.
   Loaded after theme.css / the inline <style>, so it overrides them. */

:root {
  --glass-strong: var(--bg-elevated);
  --glass-edge: var(--border);
}

/* Only the offline badge floats in the corner. ----------------------- */
#statusBadge {
  position: fixed;
  bottom: max(14px, env(safe-area-inset-bottom));
  right: max(12px, env(safe-area-inset-right));
  z-index: 40;
}

/* Scrollbars stay hidden everywhere. */
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; }

body > .app {
  display: block;
  max-width: 820px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px 40px;
}

.editor-card {
  padding: 0;
  gap: 14px;
  background: transparent;
  border: none;
  box-shadow: none;
}

.editor-head { align-items: flex-end; }
.selected-date-label { font-size: clamp(1.4rem, 4vw, 1.9rem); font-weight: 600; }
.selected-date-weekday { font-size: 0.95rem; color: var(--text-faint); }

#contentView {
  border: none;
  background: transparent;
  padding: 0;
  min-height: 0;
  max-height: none;
  overflow: visible;
}
#contentEdit { min-height: 60dvh; padding: 14px 16px; }
body.is-admin #contentView { border-radius: var(--radius-sm); transition: background var(--t-fast); }
body.is-admin #contentView:hover { background: var(--accent-dim); }

body > footer { display: none; }

@media (prefers-reduced-motion: reduce) {
  .editor-card { transition: none; }
}

/* Copy-to-reveal cover (view mode only) ---------------------------------- */
.reveal-cover { display: none; }
body.view-mode.is-covered #contentView,
body.view-mode.is-covered .archive {
  filter: blur(14px);
  opacity: 0.8;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  transition: filter 0.4s var(--ease), opacity 0.4s var(--ease);
}
body.view-mode.is-covered .reveal-cover {
  display: block;
  position: fixed; /* centred in the viewport, however tall the page is */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  padding: 14px 26px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md);
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
  transition: background var(--t-fast), transform var(--t-fast);
}
body.view-mode.is-covered .reveal-cover:hover { background: var(--accent-dim); }
body.view-mode.is-covered .reveal-cover:active { transform: translate(-50%, -50%) scale(0.97); }

/* "コピーしました！" then fade the blur away */
body.view-mode.is-covered.is-revealing #contentView,
body.view-mode.is-covered.is-revealing .archive { filter: blur(0); opacity: 1; transition: filter 0.7s var(--ease), opacity 0.7s var(--ease); }
body.view-mode.is-covered .reveal-cover { transition: opacity 0.7s var(--ease), background var(--t-fast), transform var(--t-fast); }
body.view-mode.is-covered.is-revealing .reveal-cover { opacity: 0; pointer-events: none; }
