/* =============================================
   writing.css
   Purpose: Ahone Writer — two-panel Word-style
   layout (sidebar + greeting + list), same-window
   document view, locked drafts, toast popups.
============================================= */

.writer-window {
  position: relative;
  height: 100%;
  display: flex;
  font-family: var(--font-pixel);
}

/* ---------- Sidebar ---------- */

.writer-sidebar {
  width: 130px;
  flex-shrink: 0;
  background: #f7f0f0;
  border-right: 2px solid var(--pixel-dark);
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 0.6rem;
  letter-spacing: 0.5px;
  cursor: pointer;
  color: var(--pixel-dark);
  border-left: 3px solid transparent;
  transition: background 0.15s, border-left-color 0.15s, padding-left 0.15s;
}

.sidebar-icon {
  width: 18px;
  height: 18px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.sidebar-item:hover {
  background: rgba(255, 110, 180, 0.15);
  border-left-color: var(--pink-primary, #ff5fa2);   /* NEW — pink accent on hover */
  padding-left: 20px;   /* NEW — subtle "nudge in" motion */
}

/* ---------- Main area ---------- */

.writer-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.writer-list-layer {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 20px 24px;
  overflow-y: auto;
}

.writer-list-layer.hidden {
  display: none;
}

.writer-greeting {
  font-family: var(--font-pixel);
  font-size: 1rem;
  color: var(--pixel-dark);
  margin-bottom: 4px;   /* was 20px */
}

/* NEW — small decorative flourish under the greeting */
.writer-greeting::after {
  content: '✦ ✦ ✦';
  display: block;
  font-size: 0.5rem;
  color: var(--green-primary, #8ACE00);
  letter-spacing: 8px;
  margin: 8px 0 16px;
}

.writer-section-label {
  font-size: 0.5rem;
  letter-spacing: 1px;
  color: #999;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
  margin-bottom: 4px;
}

.writer-files {
  display: flex;
  flex-direction: column;
}

/* Spacious, Word-recent-list-style row */
.writer-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 10px;   /* was 14px 6px */
  cursor: pointer;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  border-radius: 4px;   /* NEW */
  transition: background 0.15s, transform 0.15s;
}

.writer-row:hover {
  background: rgba(255, 110, 180, 0.1);
  transform: translateX(4px);   /* NEW — a little slide, like Word's row highlight but livelier */
}

.doc-icon {
  width: 26px;
  height: 32px;
  background: #fff;
  border: 2px solid var(--pixel-dark);
  flex-shrink: 0;
  position: relative;
}

.doc-icon::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  background: #f0e8e8;
  border-left: 2px solid var(--pixel-dark);
  border-bottom: 2px solid var(--pixel-dark);
}

.writer-row-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.writer-row-title {
  font-size: 0.65rem;
  color: var(--pixel-dark);
}

.writer-row-date {
  font-size: 0.5rem;
  color: #999;
  letter-spacing: 0.5px;
}

/* ---------- Document / page view ---------- */

.writer-page-layer {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.writer-page-layer.hidden {
  display: none;
}

.writer-back-btn {
  align-self: flex-start;
  margin: 12px 16px;
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  background: var(--pink-primary, #ff5fa2);
  color: white;
  border: 2px solid var(--pixel-dark);
  padding: 6px 12px;
  cursor: pointer;
  letter-spacing: 1px;
}

.page-wrapper {
  flex: 1;
  overflow-y: auto;
  background: #ece4e4;
  padding: 20px;
  display: flex;
  justify-content: center;
}

/* NEW — a decorative oversized quote mark behind the page title,
   gives the page some visual personality instead of being flat white */
.page {
  background: #fffdfa;
  width: 100%;
  max-width: 600px;
  padding: 50px 60px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  font-family: 'Lora', serif;
  color: #2a2a2a;
  line-height: 1.9;
  height: fit-content;
  position: relative;
}

.page::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 20px;
  font-family: 'Playfair Display', serif;
  font-size: 6rem;
  color: rgba(255, 110, 180, 0.12);
  line-height: 1;
  pointer-events: none;
}

.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  text-align: center;
  margin-bottom: 30px;
}

.page-subtitle {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-style: italic;
  color: var(--pink-primary, #ff5fa2);
  margin: 28px 0 12px;
}

.page-subtitle-line {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 0.9rem;
  color: #888;
  text-align: center;
  margin-top: -20px;
  margin-bottom: 30px;
}

.page-body p {
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.page-footer {
  margin-top: 30px;
  padding-top: 12px;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: #999;
}

.substack-btn {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  padding: 6px 14px;
  border: 2px solid var(--pixel-dark);
  background: var(--cream, #fff8f0);
  cursor: pointer;
  margin-top: 16px;
}

.substack-btn:hover {
  background: rgba(255, 110, 180, 0.15);
}

/* ---------- Toast popup (for "New" dead-end etc.) ---------- */

.writer-toast {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--pixel-dark, #333);
  color: white;
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  padding: 10px 18px;
  letter-spacing: 0.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 20;
}

.writer-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Password modal ---------- */

.password-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9500;
}

.password-modal.visible {
  display: flex;
}

.password-box {
  background: #fffdf7;
  border: 3px solid var(--pixel-dark);
  box-shadow: 4px 4px 0px var(--pixel-dark);
  width: 300px;   /* was 260px */
  font-family: var(--font-pixel);
}

.password-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: linear-gradient(135deg, #FF6EB4, #FF1493);
  color: white;
  font-size: 0.65rem;
  letter-spacing: 2px;
}

.password-close {
  font-family: var(--font-pixel);
  color: white;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.5);
  padding: 2px 6px;
  cursor: pointer;
}

.password-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.password-hint {
  font-size: 0.65rem;  
  color: #999;
  font-style: italic;
}

.password-input {
  font-family: var(--font-pixel);
  font-size: 0.75rem; 
  padding: 8px 10px;
  border: 2px solid var(--pixel-dark);
}

.password-submit {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  padding: 6px 14px;
  border: 2px solid var(--pixel-dark);
  background: var(--pink-primary, #ff5fa2);
  color: white;
  cursor: pointer;
  letter-spacing: 1px;
}

.password-result {
  font-size: 0.7rem;
  color: #C2185B;
  min-height: 16px;
}