/* =====================================================================
   UI STATES - modals, banners, empty states, subscription notices.

   This file is ADDITIVE ONLY. It introduces new class names (.ofe-*,
   .state-*, .sub-*) and does not alter any existing selector, so it
   cannot affect the homepage, shelves, reader, or the open-book pages.
   Loaded only by the pages that need it.
   ===================================================================== */

/* =====================================================================
   MODAL / DIALOG
   ===================================================================== */
.ofe-modal-scrim {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(40, 26, 14, .52);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity .28s ease;
}
.ofe-modal-scrim.show { opacity: 1; pointer-events: auto; }

@media (prefers-reduced-motion: reduce){
  .ofe-modal-scrim { transition: none !important; }
}
.ofe-btn {
  cursor: pointer; font-family: var(--font-ui); font-size: 14.5px;
  font-weight: 500; padding: 11px 24px; border-radius: 24px;
  border: 1.5px solid var(--maroon); text-decoration: none;
  transition: background .16s, color .16s, transform .16s;
}
.ofe-btn-primary { background: var(--maroon); color: #fff; }
.ofe-btn-primary:hover { background: var(--maroon-dark); transform: translateY(-1px); }
.ofe-btn-ghost { background: transparent; color: var(--maroon); }
.ofe-btn-ghost:hover { background: rgba(123, 51, 53, .08); }

/* =====================================================================
   EMPTY / ERROR STATES
   ===================================================================== */
.state-block {
  display: grid; place-items: center; text-align: center;
  padding: clamp(30px, 5vw, 62px) 20px;
  max-width: 520px; margin: 0 auto;
}
.state-mark {
  width: 72px; height: 72px; margin-bottom: 16px;
  border-radius: 50%; display: grid; place-items: center;
  background: rgba(123, 51, 53, .08);
  border: 2px solid rgba(123, 51, 53, .20);
  color: var(--maroon); font-size: 32px; line-height: 1;
}
.state-block h2 {
  margin: 0 0 8px; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(20px, 2vw, 27px); color: var(--maroon-dark);
}
.state-block p {
  margin: 0 0 6px; font-size: 14.5px; line-height: 1.68; color: #5f4c37;
}
.state-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }

/* On the wall background the text needs the lighter palette. */
.library-room .state-block h2 { color: var(--frame-gold); }
.library-room .state-block p { color: var(--frame-text); }
.library-room .state-mark {
  background: rgba(255, 245, 225, .10);
  border-color: rgba(255, 245, 225, .28);
  color: var(--frame-gold);
}

/* Inside a book page the parchment palette applies instead. */
.page-static-book .state-block h2 { color: var(--page-ink); }
.page-static-book .state-block p { color: #6f5c44; }

/* =====================================================================
   STANDALONE PAGE SHELL (404, access denied, user guide, legal)
   ===================================================================== */
.page-shell {
  flex: 1;
  min-height: calc(100vh - var(--site-header-h));
  padding: clamp(24px, 4vw, 56px) clamp(16px, 4vw, 48px) clamp(40px, 5vw, 72px);
  background: linear-gradient(var(--wall), var(--wall-dark));
}

@media (max-width: 720px){
}

/* =====================================================================
   SHELL PAGES - user guide, legal, subscription states, errors
   ===================================================================== */
.shell-wrap { width: min(100%, 880px); margin: 0 auto; }
.shell-title {
  margin: 0 0 6px; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(26px, 3vw, 40px); color: var(--frame-gold);
}
.shell-lede {
  margin: 0 0 clamp(18px, 2.4vw, 30px);
  color: var(--frame-text); font-size: 15px; line-height: 1.68; opacity: .92;
}
.shell-section {
  background: linear-gradient(180deg, #fffaf0, #f7eddc);
  border: 1px solid rgba(160, 120, 70, .22);
  border-radius: 13px;
  padding: clamp(18px, 2.4vw, 30px);
  margin-bottom: clamp(14px, 1.8vw, 22px);
  box-shadow: 0 2px 5px rgba(40, 22, 8, .14), 0 14px 32px rgba(46, 26, 10, .22);
}
.shell-subtitle {
  margin: 0 0 8px; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(18px, 1.8vw, 24px); color: var(--maroon-dark);
}
.shell-section h3 {
  margin: 16px 0 6px; font-size: 15px; font-weight: 600; color: var(--maroon-dark);
}
.shell-section p, .shell-section li {
  font-size: 14.5px; line-height: 1.7; color: #5f4c37;
}
.shell-section p { margin: 0 0 9px; }
.shell-section ul { margin: 0 0 9px; padding-left: 20px; }
.shell-note { font-size: 13.5px; color: #7d6a50; margin-bottom: 12px; }
.shell-placeholder {
  margin-top: 10px; padding: 12px 15px; border-radius: 9px;
  background: rgba(196, 148, 62, .10);
  border-left: 3px solid rgba(196, 148, 62, .5);
  font-size: 13.5px; color: #7a6229;
}
