/* reader.css — mobile overrides for Evangel book reader */

/* Reset old fixed margins */
body {
  margin: 0 !important;
  padding: 0 1rem 2rem !important;
  font-family: Georgia, serif;
  font-size: clamp(15px, 2.5vw, 19px);
  line-height: 1.7;
  background: #fff;
  color: #111;
}

/* Shell */
.eb-shell {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255,255,255,0.96);
  border-bottom: 1px solid #d8d8d8;
  backdrop-filter: blur(10px);
  margin: 0 0 1.25rem;
}

.eb-shell-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0.6rem 0 0.75rem;
}

.eb-topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.eb-home {
  display: inline-block;
  margin-bottom: 0.25rem;
  color: #444;
  font-size: 0.82rem;
  text-decoration: none;
}
.eb-home:hover { text-decoration: underline; }

.eb-title {
  margin: 0;
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  font-weight: 600;
  line-height: 1.25;
}

.eb-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.7rem;
}

.eb-buttons { display: flex; gap: 0.5rem; }

.eb-btn {
  border: 1px solid #cfcfcf;
  background: #fafafa;
  color: #111;
  padding: 0.45rem 0.9rem;
  font-size: 0.92rem;
  cursor: pointer;
  touch-action: manipulation;
}
.eb-btn:hover:not(:disabled) { background: #f1f1f1; }
.eb-btn:disabled { opacity: 0.45; cursor: default; }

.eb-page-count {
  font-size: 0.84rem;
  color: #666;
  white-space: nowrap;
}

#ebFrame {
  max-width: 760px;
  margin: 0 auto;
}

#eb-reader { min-height: 60vh; }

.eb-footer {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid #d8d8d8;
}
.eb-footer .eb-controls { margin-top: 0; }

#eb-reader h1 { font-size: 1.5em !important; margin: 0.6em 0 0.45em; }
#eb-reader h2 { font-size: 1.28em !important; margin: 0.85em 0 0.4em; }
#eb-reader h3 { font-size: 1.12em !important; margin: 0.8em 0 0.35em; }
#eb-reader h1, #eb-reader h2, #eb-reader h3,
#eb-reader h4, #eb-reader h5, #eb-reader h6 { clear: both; line-height: 1.3; }
#eb-reader .pagenum { display: none !important; }
#eb-reader p:first-child,
#eb-reader h1:first-child,
#eb-reader h2:first-child { margin-top: 0; }

@media (max-width: 640px) {
  body { padding: 0 0.75rem 1.5rem !important; }

  .eb-shell-inner { padding: 0.45rem 0 0.55rem; }

  .eb-title { font-size: 0.95rem; }

  .eb-controls { flex-wrap: wrap; gap: 0.5rem; }

  .eb-btn {
    padding: 0.55rem 1.1rem;
    font-size: 0.95rem;
    min-width: 64px;
  }

  .eb-page-count { width: 100%; text-align: center; }

  #eb-reader { font-size: 1rem; line-height: 1.75; }

  #eb-reader h1 { font-size: 1.25em !important; }
  #eb-reader h2 { font-size: 1.1em !important; }
}
