/* ════════════════════════════════════════════════════
   ipal.css — Stylesheet untuk Materi Sosialisasi IPAL MBG
   EcoFilter · PT. Solusi Teknologi Aquatic
   ════════════════════════════════════════════════════ */

/* ── VARIABLES ── */
:root {
  --bg: #FFFFFF;
  --paper: #FFFFFF;
  --ink: #0A0E1A;
  --ink-2: #1F2937;
  --muted: #64748B;
  --line: #E2E8F0;
  --line-2: #F1F5F9;
  --accent: #1035a0;
  --accent-light: #1035a010;
  --blue: #1a56db;
  --blue-light: #EFF6FF;
  --green: #047857;
  --red: #991B1B;
  --amber: #B45309;
}

/* ── RESET & BASE ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: 'Cormorant Garamond', serif;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.01em;
}
h1 { font-size: 38px; line-height: 1.1; }
h2 { font-size: 26px; line-height: 1.2; margin-bottom: 16px; }
h3 { font-size: 18px; line-height: 1.3; margin-bottom: 12px; font-weight: 600; }
h4 { font-size: 15px; line-height: 1.3; margin-bottom: 8px; font-family: 'Inter', sans-serif; font-weight: 600; }

p { margin-bottom: 12px; color: var(--ink-2); }
.lead { font-size: 15px; color: var(--ink-2); }

.label {
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}
.section-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 1px;
  margin-bottom: 4px;
}

/* ── LAYOUT ── */
.doc {
  max-width: 1400px;
  margin: 0 auto;
  background: var(--paper);
}

.page {
  padding: 60px 80px;
  border-bottom: 1px solid var(--line-2);
}
.page:last-child { border-bottom: none; }

/* ── COVER ── */
.cover {
  min-height: 600px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 80px 64px;
  border-bottom: 2px solid var(--ink);
  background: linear-gradient(180deg, #FAFAF7 0%, #FFFFFF 100%);
}
.cover-mark {
  width: 50px;
  height: 2px;
  background: var(--accent);
  margin-bottom: 28px;
}
.cover h1 { font-size: 52px; line-height: 1.05; margin-bottom: 16px; }
.cover-subtitle {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 48px;
  font-style: italic;
  font-family: 'Cormorant Garamond', serif;
}
.cover-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}
.cover-meta-item .label { display: block; margin-bottom: 4px; }
.cover-meta-item .value { font-size: 13px; color: var(--ink-2); font-weight: 500; }

/* ── SECTION HEADER ── */
.section-header {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

/* ── TWO COL ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin: 20px 0;
}

.video-section {
  margin: 0 0 36px;
  padding: 28px;
  border: 1px solid var(--line);
  background: #F8FAFC;
}
.video-section-head {
  margin-bottom: 20px;
}
.video-section-head h3 {
  margin: 4px 0 0;
}
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.video-card {
  min-width: 0;
}
.video-frame {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ink);
}
.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(16, 53, 160, .16), rgba(10, 14, 26, .92)),
    var(--ink);
  color: white;
}
.video-placeholder span {
  display: block;
  margin-bottom: 8px;
  font-size: 10px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  opacity: .7;
}
.video-placeholder strong {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.15;
}
.video-caption {
  padding-top: 12px;
}
.video-index {
  display: block;
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.video-caption strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}
.video-caption p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

/* ── VIDEO GRID 3 KOLOM ── */
.video-grid-3col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: start;
  margin: 24px 0;
}
.video-card-3col {
  min-width: 0;
}
.video-frame-3col {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ink);
  margin-bottom: 12px;
}
.video-frame-3col iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-card-caption {
  padding: 0;
}
.video-card-caption .video-index {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.video-card-caption strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  margin-bottom: 4px;
}
.video-card-caption p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

/* ── KPI GRID ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  margin: 24px 0;
}
.kpi {
  padding: 20px 16px;
  border-right: 1px solid var(--line);
}
.kpi:last-child { border-right: none; }
.kpi-label {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.kpi-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
  margin-bottom: 4px;
}
.kpi-note { font-size: 11px; color: var(--muted); }

/* ── CALLOUT ── */
.callout {
  border-left: 3px solid var(--accent);
  padding: 14px 18px;
  background: var(--accent-light);
  margin: 16px 0;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.6;
}
.callout-warning {
  border-left-color: var(--amber);
  background: #FFFBEB;
}
.callout-danger {
  border-left-color: var(--red);
  background: #FEF2F2;
}
.callout-success {
  border-left-color: var(--green);
  background: #F0FDF4;
}

/* ── TABLES ── */
.table-wrap {
  margin: 20px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead { background: var(--ink); color: white; }
thead th {
  padding: 12px 14px;
  text-align: left;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
}
thead th.center { text-align: center; }
tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-2);
  color: var(--ink-2);
  vertical-align: top;
}
tbody td.center { text-align: center; }
tbody td.label-cell { font-weight: 500; color: var(--ink); }
tbody td.bold { font-weight: 600; color: var(--ink); }
tbody td.blue { color: var(--blue); font-weight: 600; }
tbody tr:last-child td { border-bottom: none; }
tr.subtotal td { background: var(--line-2); font-weight: 600; color: var(--ink); }
tr.total td { background: var(--ink); color: white; font-weight: 600; }
tr.highlight td { background: #EFF6FF; }

/* ── FLOW DIAGRAM ── */
.flow {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 24px 0;
  overflow-x: auto;
}
.flow-step {
  flex: 1;
  min-width: 90px;
  border: 1px solid var(--line);
  padding: 14px 10px;
  text-align: center;
  border-right: none;
  position: relative;
}
.flow-step:last-child { border-right: 1px solid var(--line); }
.flow-step.active {
  background: var(--ink);
  border-color: var(--ink);
}
.flow-step .step-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}
.flow-step.active .step-num { color: white; }
.flow-step .step-name {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--ink);
  line-height: 1.3;
}
.flow-step.active .step-name { color: white; }
.flow-step .step-sub {
  font-size: 10px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.3;
}
.flow-step.active .step-sub { color: #aaa; }

/* ── GREASE TRAP VISUAL ── */
.gt-wrap {
  display: flex;
  border: 1.5px solid var(--ink);
  margin: 20px 0;
  height: 160px;
  font-size: 11px;
}
.gt-end {
  background: var(--ink);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  writing-mode: vertical-rl;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-size: 9px;
  font-weight: 600;
}
.gt-comp {
  flex: 1;
  border-left: 1.5px solid var(--ink);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.gt-comp:first-of-type { border-left: none; }
.gt-comp-label {
  background: var(--ink);
  color: white;
  text-align: center;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 0;
}
.gt-zone {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  text-align: center;
  position: relative;
}
.gt-top { background: #FEF3C7; border-bottom: 1px dashed var(--amber); }
.gt-top span { font-size: 9px; font-weight: 600; color: var(--amber); line-height: 1.3; }
.gt-mid { background: var(--blue-light); border-bottom: 1px dashed var(--blue); }
.gt-mid span { font-size: 9px; font-weight: 600; color: var(--blue); line-height: 1.3; }
.gt-bot { background: #F5F3EE; }
.gt-bot span { font-size: 9px; font-weight: 600; color: var(--muted); line-height: 1.3; }
.pipe-arrow {
  position: absolute;
  right: -8px;
  font-size: 12px;
  color: var(--blue);
  font-weight: 900;
  z-index: 2;
  background: var(--blue-light);
  line-height: 1;
}

/* ── IMPACT GRID ── */
.impact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}
.impact-item {
  border: 1px solid var(--line);
  padding: 14px;
  border-top: 2px solid var(--red);
}
.impact-item h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.impact-item p { font-size: 12px; color: var(--ink-2); margin: 0; line-height: 1.5; }
.impact-item .result { color: var(--red); font-size: 11px; font-weight: 600; margin-top: 6px; }

/* ── KEY POINTS ── */
.key-list { margin: 20px 0; }
.key-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-2);
  align-items: start;
}
.key-item:last-child { border-bottom: none; }
.key-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}
.key-title { font-weight: 600; color: var(--ink); font-size: 14px; margin-bottom: 4px; }
.key-desc { font-size: 13px; color: var(--ink-2); line-height: 1.6; }

/* ── DOC FOOTER ── */
.doc-footer {
  padding: 32px 64px;
  background: var(--ink);
  color: white;
  font-size: 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.doc-footer .small {
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: .6;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .doc { width: 100%; overflow-x: hidden; }
  .page { padding: 28px 20px; }
  .cover { padding: 40px 20px; min-height: auto; }
  .cover h1 { font-size: 30px; }
  h2 { font-size: 20px; }
  .cover-meta { grid-template-columns: 1fr; gap: 12px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi:nth-child(2) { border-right: none; }
  .kpi:nth-child(1), .kpi:nth-child(2) { border-bottom: 1px solid var(--line); }
  .two-col { grid-template-columns: 1fr; gap: 16px; }
  .video-section { padding: 20px; margin-bottom: 28px; }
  .video-grid { grid-template-columns: 1fr; gap: 22px; }
  .video-frame {
    max-width: 320px;
    margin: 0 auto;
  }
  .video-caption {
    max-width: 320px;
    margin: 0 auto;
  }

  /* ── Table scroll wrapper ── */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    /* subtle right-fade as scroll hint */
    background:
      linear-gradient(to right, white 20px, transparent 80px),
      linear-gradient(to left,  #f0f4ff 20px, transparent 80px) right;
    background-attachment: local, local;
    background-repeat: no-repeat;
  }
  .table-wrap table {
    min-width: 520px;
    white-space: nowrap;
  }
  /* allow long-text columns to wrap naturally */
  .table-wrap td:last-child,
  .table-wrap td:nth-last-child(2) {
    white-space: normal;
    min-width: 140px;
  }

  .flow { gap: 0; flex-direction: column; overflow-x: visible; }
  .flow-step {
    min-width: unset;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    text-align: left;
    border: 1px solid var(--line);
    border-bottom: none;
  }
  .flow-step:last-child { border-bottom: 1px solid var(--line); }
  .flow-step .step-num { font-size: 26px; min-width: 32px; margin-bottom: 0; }
  .flow-step .step-name { font-size: 12px; }
  .flow-step .step-sub { margin-top: 1px; }
  .video-grid-3col { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi { padding: 16px 12px; }
  .kpi:nth-child(2) { border-right: none; }
  .kpi:nth-child(1), .kpi:nth-child(2) { border-bottom: 1px solid var(--line); }
  .kpi-value { font-size: 24px; }
  .kpi-label { font-size: 9px; }
  .kpi-note { font-size: 10px; }
  .impact-grid { grid-template-columns: 1fr 1fr; }
  .gt-wrap { height: 140px; }
  .doc-footer { flex-direction: column; gap: 8px; padding: 24px; text-align: center; }
  p, h1, h2, h3, h4 { word-break: break-word; overflow-wrap: break-word; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi { padding: 12px 8px; border-right: none; }
  .kpi:nth-child(1), .kpi:nth-child(2) { border-bottom: 1px solid var(--line); }
  .kpi:nth-child(3), .kpi:nth-child(4) { border-bottom: none; }
  .kpi-value { font-size: 20px; }
  .kpi-label { font-size: 8px; }
  .kpi-note { font-size: 9px; }
  .video-grid-3col { grid-template-columns: 1fr; gap: 12px; }
  .impact-grid { grid-template-columns: 1fr; }
}

@media print {
  body { background: white; font-size: 11px; }
  .doc { box-shadow: none; max-width: 100%; }
  .page { padding: 30px; page-break-after: auto; }
  .cover { page-break-after: always; }
}
