/* ==========================================================================
   MyCPNS Design System — Materi (Fase 2 Disetujui)
   --------------------------------------------------------------------------
   Daftar Materi Hierarki (Kartu Unggulan + Grid) & Detail Kartu Baca Putih.
   ========================================================================== */

.demo-label { max-width: 1200px; margin: 26px auto 10px; padding: 0 20px; font: 800 13px var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.m-wrap { width: 100%; max-width: 100%; margin: 0; padding: 0 0 10px; box-sizing: border-box; }
.m-read { max-width: 850px; margin: 0 auto; padding: 6px 20px 10px; }
.m-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); margin: 0; }
.m-head p { color: var(--muted); font-size: 13.5px; margin-top: 4px; margin-bottom: 0; }
.m-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 16px 0 18px; }
.m-search { flex: 1 1 240px; display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: 9px 13px; color: var(--muted); font-size: 13.5px; }
.m-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.fchip { font: 700 12px var(--font); padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line-soft); background: #fff; color: var(--muted); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; transition: all .15s ease; }
.fchip.on-all { background: var(--ink); border-color: var(--ink); color: #fff; }
.fchip.on-twk { background: var(--cat-twk); border-color: var(--cat-twk); color: #fff; }
.fchip.on-tiu { background: var(--cat-tiu); border-color: var(--cat-tiu); color: #fff; }
.fchip.on-tkp { background: var(--cat-tkp); border-color: var(--cat-tkp); color: #fff; }
.fchip.on-pppk { background: var(--cat-pppk); border-color: var(--cat-pppk); color: #fff; }
.fchip.on-skb { background: var(--cat-skb); border-color: var(--cat-skb); color: #fff; }
.fchip.c-twk { color: var(--cat-twk); } .fchip.c-tiu { color: var(--cat-tiu); } .fchip.c-tkp { color: var(--cat-tkp); } .fchip.c-pppk { color: var(--cat-pppk); } .fchip.c-skb { color: var(--cat-skb); }
.m-feat { display: flex; gap: 18px; background: #fff; border: 1px solid var(--line-soft); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 20px 22px; margin-bottom: 16px; flex-wrap: wrap; }
.m-feat .ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; flex: none; }
.m-feat h3 { font-size: 18px; font-weight: 800; color: var(--ink); margin: 6px 0 5px; }
.m-feat p { font-size: 13.5px; color: var(--muted); line-height: 1.6; max-width: 520px; margin: 0; }
.m-feat .side { margin-left: auto; min-width: 190px; flex: 1 1 190px; max-width: 230px; }
.m-feat .side .lab { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 7px; }
.m-feat .side .lab b { color: var(--ink); }
.m-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 14px; }
.m-card { background: #fff; border: 1px solid var(--line-soft); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 17px 18px; display: flex; flex-direction: column; }
.m-card .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 11px; flex: none; }
.m-card h4 { font-size: 15px; font-weight: 800; color: var(--ink); margin: 7px 0 5px; line-height: 1.35; flex: 1; }
.m-card .meta { font-size: 12px; color: var(--muted); margin-bottom: 11px; }
.m-card .go { font: 700 13px var(--font); color: var(--primary); text-decoration: none; margin-top: auto; }
.m-banner { margin-top: 16px; background: #eef4ff; border: 1px solid #dbe6fa; border-radius: var(--r-lg); padding: 18px 22px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.m-banner h4 { font-size: 15px; font-weight: 800; color: var(--ink); margin: 0; }
.m-banner p { font-size: 13px; color: var(--muted); margin-top: 3px; margin-bottom: 0; }
.btn { display: inline-flex; align-items: center; gap: 8px; font: 700 13.5px var(--font); padding: 11px 18px; border-radius: var(--r-md); border: 0; cursor: pointer; text-decoration: none; transition: opacity .15s ease; }
.btn:hover { opacity: .92; }
.btn-primary { background: var(--grad-btn); color: #fff; }
.btn-ghost { background: #fff; border: 1px solid var(--line-soft); color: var(--ink); }
.crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.crumb b { color: var(--primary); font-weight: 700; }
.d-ttl { font-size: 27px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); line-height: 1.25; margin: 0; }
.d-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 18px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line-soft); margin-bottom: 18px; }
.tabs span { font: 700 13.5px var(--font); padding: 9px 14px; color: var(--muted); }
.tabs span.on { color: var(--primary); border-bottom: 2.5px solid var(--primary); margin-bottom: -1px; }
.d-body p { font-size: 15px; line-height: 1.75; color: #33415c; margin-bottom: 13px; }
.poin { background: #fff; border: 1px solid var(--line-soft); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 18px 20px; margin: 18px 0; }
.poin h4 { font-size: 14px; font-weight: 800; color: var(--ink); margin-bottom: 11px; }
.poin li { list-style: none; display: flex; gap: 10px; font-size: 14px; color: #33415c; padding: 6px 0; line-height: 1.55; }
.poin li svg { flex: none; margin-top: 2px; }
.kw { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 20px; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.cta-row .sp { flex: 1; }
.prevnext { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; border-top: 1px solid var(--line-soft); padding-top: 16px; font-size: 13px; }
.prevnext a { color: var(--primary); font-weight: 700; text-decoration: none; }
.notes { max-width: 1200px; margin: 8px auto 34px; padding: 0 20px; }
.notes li { font-size: 13.5px; color: var(--muted); line-height: 1.7; margin-left: 18px; }
.notes b { color: var(--ink); }
.ic svg { width: 24px; height: 24px; }
.m-card .ic svg { width: 21px; height: 21px; }

/* ===== DETAIL: satu kartu baca (v2) ===== */
.read-card { background: #fff; border: 1px solid var(--line-soft); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.read-head { background: linear-gradient(180deg, #eef4ff 0%, #ffffff 92%); padding: 24px 28px 0; }
.read-head .crumb { margin-bottom: 8px; }
.read-body { padding: 4px 28px 26px; }
.callout { border-left: 3.5px solid var(--cat-twk); background: #f6f9ff; border-radius: 0 12px 12px 0; padding: 13px 16px; margin: 2px 0 16px; }
.callout p { font-size: 14.5px; line-height: 1.65; color: #33415c; margin: 0; }
.read-card .poin { background: #f8fafc; border: 1px solid #edf1f7; box-shadow: none; }
.read-foot { border-top: 1px solid var(--line-soft); padding: 18px 28px 22px; }
.read-card .prevnext { margin-top: 16px; }
@media (max-width: 680px) { .read-head { padding: 18px 18px 0; } .read-body { padding: 4px 18px 20px; } .read-foot { padding: 16px 18px 18px; } }

/* ===== POIN INTI DITONJOLKAN (v3) ===== */
.read-card .poin { background: linear-gradient(180deg, #e8f0fe, #f6f9ff); border: 1.5px solid #c7dbfc; padding: 20px 22px; }
.poin h4 { font-size: 16.5px; display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.poin h4 .p-badge { width: 30px; height: 30px; border-radius: 10px; background: var(--cat-twk); color: #fff; display: grid; place-items: center; flex: none; }
.poin h4 .p-sub { font-size: 12.5px; font-weight: 700; color: var(--cat-twk); }
.poin li { font-size: 14.5px; padding: 10px 0; border-bottom: 1px dashed #c7dbfc; }
.poin li:last-child { border-bottom: 0; padding-bottom: 2px; }
.poin .ck { width: 22px; height: 22px; border-radius: 999px; background: #16a34a; display: grid; place-items: center; flex: none; margin-top: 1px; }

/* Responsive adjustments (Mobile: hug content, cegah rongga kosong vertikal) */
@media (max-width: 768px) {
  .m-wrap, .m-read {
    padding-bottom: 90px;
    height: auto !important;
    min-height: 0 !important;
  }
  .m-feat {
    flex-direction: column !important;
    height: auto !important;
    min-height: 0 !important;
    justify-content: flex-start !important;
    gap: 14px !important;
  }
  .m-feat > div[style*="flex:1"],
  .m-feat > div:nth-child(2) {
    flex: none !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
  }
  .m-feat .side {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    flex: none !important;
    margin-top: 10px !important;
    height: auto !important;
    min-height: 0 !important;
  }
  .m-card {
    height: auto !important;
    min-height: 0 !important;
    justify-content: flex-start !important;
  }
  .m-card h4 {
    flex: none !important;
  }
  .m-card .go {
    margin-top: 12px !important;
  }
  .m-cat-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .m-cat-card {
    height: auto !important;
    min-height: 0 !important;
    justify-content: flex-start !important;
  }
  .m-cat-card-body {
    flex: none !important;
    margin-bottom: 12px !important;
  }
  .m-cat-card-footer {
    margin-top: 12px !important;
  }
}

/* ==========================================================================
   MATERI GRUP TOPIK (DUA TINGKAT)
   ========================================================================== */

.m-cat-section {
	margin-bottom: 28px;
}
.m-cat-section-header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
	padding-bottom: 8px;
	border-bottom: 1.5px solid #eef2f7;
	flex-wrap: wrap;
}
.m-cat-section-title {
	font-size: 17px;
	font-weight: 800;
	color: var(--ink);
	margin: 0;
	letter-spacing: -0.01em;
}
.m-cat-section-meta {
	font-size: 12px;
	font-weight: 600;
	color: #64748b;
	margin-left: auto;
}

.m-topic-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.m-topic-block {
	background: #ffffff;
	border: 1px solid var(--line-soft);
	border-radius: 14px;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	overflow: hidden;
}
.m-topic-block:hover {
	border-color: #cbd5e1;
}
.m-topic-block.is-open {
	border-color: #bfdbfe;
	box-shadow: 0 4px 14px rgba(30, 64, 175, 0.08);
}

.m-topic-header {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 13px 18px;
	background: transparent;
	border: 0;
	cursor: pointer;
	text-align: left;
	font-family: inherit;
	transition: background 0.15s ease;
}
.m-topic-header:hover {
	background: #f8fafc;
}
.m-topic-block.is-open .m-topic-header {
	background: #fafcff;
	border-bottom: 1px solid #f1f5f9;
}

.m-topic-left {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
	flex: 1;
}

.m-topic-icon {
	width: 38px;
	height: 38px;
	border-radius: 10px;
	display: grid;
	place-items: center;
	flex: none;
}
.m-topic-icon svg {
	width: 20px;
	height: 20px;
}

.m-topic-info {
	min-width: 0;
	flex: 1;
}

.m-topic-title-row {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.m-topic-name {
	font-size: 14.5px;
	font-weight: 800;
	color: var(--ink);
	line-height: 1.35;
}

.m-topic-count {
	font-size: 11.5px;
	font-weight: 700;
	color: #64748b;
	background: #f1f5f9;
	padding: 2px 9px;
	border-radius: 999px;
	white-space: nowrap;
}

.m-topic-right {
	display: flex;
	align-items: center;
	gap: 16px;
	flex: none;
}

.m-topic-progress-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 140px;
}

.m-topic-progress-bar {
	flex: 1;
	height: 6px;
	background: #f1f5f9;
	border-radius: 999px;
	overflow: hidden;
}

.m-topic-progress-fill {
	height: 100%;
	border-radius: 999px;
	transition: width 0.3s ease;
}

.m-topic-progress-val {
	font-size: 12px;
	font-weight: 800;
	color: var(--ink);
	width: 32px;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.m-topic-chevron {
	color: #94a3b8;
	transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.15s ease;
	display: grid;
	place-items: center;
}
.m-topic-block.is-open .m-topic-chevron {
	transform: rotate(180deg);
	color: #1e40af;
}

.m-topic-content {
	padding: 16px 18px 20px;
	background: #ffffff;
}

.m-topic-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 14px;
}

@media (max-width: 760px) {
	.m-topic-grid {
		grid-template-columns: 1fr;
	}
	.m-topic-progress-wrap {
		width: 100px;
	}
}

@media (max-width: 580px) {
	.m-topic-header {
		padding: 11px 13px;
		gap: 8px;
	}
	.m-topic-progress-wrap {
		display: none;
	}
	.m-topic-content {
		padding: 12px 12px 16px;
	}
}

/* ==========================================================================
   KARTU KATEGORI MATERI (MODE SEMUA RINGKAS)
   ========================================================================== */

.m-cat-overview {
	margin: 20px 0 28px;
}

.m-cat-overview-header {
	margin-bottom: 16px;
}

.m-cat-overview-title {
	font-size: 19px;
	font-weight: 800;
	color: var(--ink);
	margin: 0 0 4px;
	letter-spacing: -0.01em;
}

.m-cat-overview-sub {
	font-size: 13px;
	color: var(--muted);
	margin: 0;
}

.m-cat-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 16px;
}

.m-cat-card {
	background: #ffffff;
	border: 1px solid var(--line-soft);
	border-radius: 16px;
	padding: 20px 22px;
	text-decoration: none;
	color: inherit;
	display: flex;
	flex-direction: column;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
	transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
	position: relative;
	overflow: hidden;
}

.m-cat-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 24px rgba(18, 46, 87, 0.08);
	border-color: #bfdbfe;
}

.m-cat-card-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 14px;
}

.m-cat-card-counts {
	font-size: 12px;
	font-weight: 600;
	color: #64748b;
}

.m-cat-card-body {
	flex: 1;
	margin-bottom: 16px;
}

.m-cat-card-name {
	font-size: 16px;
	font-weight: 800;
	color: var(--ink);
	margin: 0 0 6px;
	line-height: 1.35;
	letter-spacing: -0.01em;
}

.m-cat-card-progress-wrap {
	margin-top: 14px;
}

.m-cat-card-progress-label {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 11.5px;
	font-weight: 700;
	color: #64748b;
	margin-bottom: 6px;
}

.m-cat-card-progress-val {
	font-weight: 800;
	color: var(--ink);
}

.m-cat-card-progress-bar {
	height: 6px;
	background: #f1f5f9;
	border-radius: 999px;
	overflow: hidden;
}

.m-cat-card-progress-fill {
	height: 100%;
	border-radius: 999px;
	transition: width 0.3s ease;
}

.m-cat-card-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-top: 14px;
	border-top: 1px solid #f1f5f9;
	margin-top: auto;
}

.m-cat-card-link {
	font-size: 13px;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	transition: gap 0.15s ease;
}

.m-cat-card:hover .m-cat-card-link {
	gap: 9px;
}

/* Tombol Tampilkan Semua Topik */
.m-show-more-wrap {
	text-align: center;
	margin-top: 18px;
	padding-top: 10px;
}

.btn-show-all-topics {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 700;
	color: #1e40af;
	background: #eff6ff;
	border: 1.5px solid #bfdbfe;
	padding: 10px 22px;
	border-radius: 999px;
	cursor: pointer;
	transition: all 0.2s ease;
}

.btn-show-all-topics:hover {
	background: #1e40af;
	color: #ffffff;
	border-color: #1e40af;
	box-shadow: 0 4px 12px rgba(30, 64, 175, 0.2);
}
