/* ==========================================================================
   EPIGENETIKA.ID - FOCUSED 1-COLUMN ACADEMIC READING STYLESHEET (MATERI)
   ========================================================================== */

/* 1. TOP READING PROGRESS BAR */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3.5px;
  width: 0%;
  background: linear-gradient(90deg, #10b981 0%, #0ea5e9 50%, #047857 100%);
  z-index: 100000;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* 2. BODY & GENERAL RESET FOR MATERI PAGES */
body.materi-reading-body {
  background-color: #f8fafc !important;
  color: #1e293b !important;
  font-family: 'Plus Jakarta Sans', 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  line-height: 1.85 !important;
  -webkit-font-smoothing: antialiased;
  margin: 0 !important;
  padding: 0 !important;
}

/* 3. MATERI READING WRAPPER */
.materi-reader-wrapper {
  padding-top: clamp(100px, 15vw, 135px);
  padding-bottom: 80px;
  min-height: 100vh;
}

/* 4. MAIN 1-COLUMN FOCUSED CONTAINER */
.materi-reader-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
}

/* 5. HEADER META & BREADCRUMB */
.materi-breadcrumb-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 24px;
}

.materi-breadcrumb-bar a {
  color: #047857;
  text-decoration: none;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.materi-breadcrumb-bar a:hover {
  color: #064e3b;
  text-decoration: underline;
}

.breadcrumb-separator {
  color: #cbd5e1;
  font-size: 11px;
}

.materi-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.materi-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 9999px;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid rgba(4, 120, 87, 0.2);
}

.materi-reading-time {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: #64748b;
  font-weight: 500;
}

.materi-post-title {
  font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif !important;
  font-size: clamp(2rem, 5vw, 3rem) !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  color: #064e3b !important;
  margin: 0 0 24px 0 !important;
  letter-spacing: -0.02em !important;
  word-break: break-word !important;
}

.materi-header-divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(4, 120, 87, 0.3) 0%, rgba(226, 232, 240, 0.8) 70%, transparent 100%);
  border: none;
  margin: 20px 0 36px 0;
}

/* 6. CONTENT SANITIZATION & OVERRIDES FOR GUTENBERG INLINE STYLES */
.materi-reader-content {
  font-size: 1.075rem;
  color: #334155;
  line-height: 1.85;
}

/* Reset hardcoded margin 91px and padding 50px that broke mobile */
.materi-reader-content p,
.materi-reader-content .wp-block-paragraph,
.materi-reader-content div,
.materi-reader-content section {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  max-width: 100% !important;
}

.materi-reader-content p,
.materi-reader-content .wp-block-paragraph {
  margin-bottom: 1.65rem !important;
  font-size: 1.075rem !important;
  line-height: 1.85 !important;
  color: #334155 !important;
  letter-spacing: -0.01em;
}

.materi-reader-content p strong {
  color: #0f172a;
  font-weight: 700;
}

/* Compress giant Gutenberg spacers from 86px to harmonious 24px-32px */
.materi-reader-content .wp-block-spacer {
  height: clamp(20px, 3vw, 32px) !important;
}

/* Clean Separators */
.materi-reader-content hr.wp-block-separator {
  border: none !important;
  height: 1.5px !important;
  background: linear-gradient(90deg, transparent, #e2e8f0, transparent) !important;
  margin: clamp(30px, 5vw, 45px) 0 !important;
  opacity: 1 !important;
}

/* 7. HEADINGS WITH BIO-TECH ACCENTS */
.materi-reader-content h2,
.materi-reader-content .wp-block-heading:is(h2) {
  font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif !important;
  font-size: clamp(1.5rem, 3.5vw, 1.95rem) !important;
  font-weight: 800 !important;
  color: #064e3b !important;
  line-height: 1.3 !important;
  margin-top: clamp(36px, 6vw, 54px) !important;
  margin-bottom: 18px !important;
  padding: 0 0 0 16px !important;
  border-left: 4px solid #10b981 !important;
  letter-spacing: -0.015em !important;
}

.materi-reader-content h3,
.materi-reader-content .wp-block-heading:is(h3) {
  font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif !important;
  font-size: clamp(1.25rem, 2.5vw, 1.45rem) !important;
  font-weight: 700 !important;
  color: #065f46 !important;
  line-height: 1.35 !important;
  margin-top: 32px !important;
  margin-bottom: 14px !important;
  padding: 0 !important;
}

.materi-reader-content h4 {
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin-top: 24px !important;
  margin-bottom: 10px !important;
}

/* 8. SCIENTIFIC CALLOUT BOXES & BLOCKQUOTES */
.materi-reader-content blockquote,
.materi-reader-content .wp-block-quote {
  background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%) !important;
  border-left: 4.5px solid #059669 !important;
  border-radius: 0 16px 16px 0 !important;
  padding: 22px 26px !important;
  margin: 28px 0 !important;
  box-shadow: 0 6px 18px rgba(6, 95, 70, 0.06) !important;
  position: relative;
  overflow: hidden;
}

.materi-reader-content blockquote::before {
  content: '🧬';
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 24px;
  opacity: 0.35;
}

.materi-reader-content blockquote p {
  color: #064e3b !important;
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  line-height: 1.75 !important;
  margin-bottom: 0 !important;
}

/* 9. SCIENTIFIC FIGURES & IMAGES */
.materi-reader-content figure.wp-block-image {
  margin: 32px 0 !important;
  padding: 0 !important;
  text-align: center;
}

.materi-reader-content figure.wp-block-image img {
  border-radius: 18px !important;
  box-shadow: 0 14px 35px -5px rgba(6, 78, 59, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.04) !important;
  border: 1.5px solid rgba(15, 23, 42, 0.07) !important;
  max-width: 100% !important;
  height: auto !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.materi-reader-content figure.wp-block-image img:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px -5px rgba(6, 78, 59, 0.16) !important;
}

.materi-reader-content figcaption {
  font-size: 13px !important;
  color: #64748b !important;
  margin-top: 10px !important;
  font-style: italic;
  line-height: 1.5;
}

/* 10. LISTS & BULLETS */
.materi-reader-content ul,
.materi-reader-content ol {
  margin: 20px 0 28px 24px !important;
  padding: 0 !important;
  color: #334155;
}

.materi-reader-content li {
  margin-bottom: 10px !important;
  line-height: 1.75;
}

/* 11. NEXT / PREVIOUS MODULE NAVIGATION BOX */
.module-navigation-box {
  margin-top: 56px;
  padding-top: 36px;
  border-top: 2px solid #e2e8f0;
}

.module-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.module-nav-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #047857;
  display: flex;
  align-items: center;
  gap: 8px;
}

.module-nav-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 640px) {
  .module-nav-grid {
    grid-template-columns: 1fr;
  }
}

.module-nav-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1.5px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  padding: 20px 22px;
  text-decoration: none;
  color: inherit;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
}

.module-nav-card:hover {
  border-color: #10b981;
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -5px rgba(6, 78, 59, 0.14);
}

.module-nav-card.nav-prev {
  text-align: left;
}

.module-nav-card.nav-next {
  text-align: right;
  border-color: rgba(4, 120, 87, 0.2);
  background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
}

.module-nav-card.nav-next:hover {
  border-color: #059669;
}

.module-nav-direction {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-next .module-nav-direction {
  justify-content: flex-end;
  color: #047857;
}

.module-nav-name {
  font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  transition: color 0.2s ease;
}

.module-nav-card:hover .module-nav-name {
  color: #065f46;
}

.module-nav-all-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  width: 100%;
  padding: 13px 20px;
  border-radius: 14px;
  background: #ecfdf5;
  border: 1.5px solid #a7f3d0;
  color: #065f46;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.module-nav-all-btn:hover {
  background: #047857;
  color: #ffffff;
  border-color: #047857;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(4, 120, 87, 0.2);
}

/* 12. FLOATING BACK TO TOP & QUICK TOOLS */
.floating-reading-tools {
  position: fixed;
  bottom: 28px;
  right: 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 999;
}

.btn-floating-tool {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ffffff;
  border: 1.5px solid rgba(6, 78, 59, 0.15);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #047857;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-floating-tool:hover {
  background: #047857;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(4, 120, 87, 0.25);
}

/* 13. MODAL DAFTAR MODUL LENGKAP */
.module-list-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.module-list-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.module-modal-content {
  background: #ffffff;
  border-radius: 24px;
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: modalPopIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPopIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.module-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.module-modal-title {
  font-size: 18px;
  font-weight: 800;
  color: #064e3b;
  display: flex;
  align-items: center;
  gap: 8px;
}

.module-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #64748b;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  line-height: 1;
}

.module-modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.module-modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-module-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  color: #0f172a;
  transition: all 0.2s ease;
}

.modal-module-item:hover {
  background: #ecfdf5;
  border-color: #10b981;
  transform: translateX(4px);
}

.modal-module-item.current {
  background: #065f46;
  border-color: #065f46;
  color: #ffffff;
}

.modal-module-item.current .item-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.item-badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  background: #e2e8f0;
  color: #475569;
}

.item-title {
  font-weight: 600;
  font-size: 14.5px;
}
