/* =====================================================================
   Situs publik: header, footer, halaman hasil survei (rekapitulasi & grafik), dan cetak PDF.
   Dimuat setelah style template dan survei.css.
   ===================================================================== */
:root { --sv-hdr: 76px; }
@media (max-width: 991px) { :root { --sv-hdr: 64px; } }

body.pub { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Open Sans", "Helvetica Neue", Arial, sans-serif; color: var(--sv-text, #1f2d27); background: var(--sv-bg, #f1f5f3); padding-top: 0; }
body.pub #services { background: var(--sv-bg, #f1f5f3); padding: calc(var(--sv-hdr) + 20px) 0 36px; overflow: visible; }
body.pub #main { min-height: 60vh; }

/* ---------- header ---------- */
#header.pub-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000; height: auto; padding: 0;
    background: linear-gradient(120deg, #2f8a5b 0%, #2a7d6a 55%, #286780 100%);
    box-shadow: 0 2px 12px rgba(20, 60, 50, .22); transition: box-shadow .2s;
}
#header.pub-header.menempel { box-shadow: 0 6px 22px rgba(20, 60, 50, .32); }
.pub-header-in { max-width: 1240px; margin: 0 auto; padding: 8px 20px; display: flex; align-items: center; gap: 16px; min-height: var(--sv-hdr); }
.pub-brand { display: block; flex: 0 0 auto; }
.pub-brand img { display: block; height: 54px; width: auto; max-width: 62vw; }
.pub-nav { margin-left: auto; }
.pub-nav > ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.pub-nav li { margin: 0; position: relative; }
.pub-link {
    display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border: 0; border-radius: 11px; background: transparent; cursor: pointer;
    color: #fff; font-family: inherit; font-weight: 600; font-size: 14.5px; line-height: 1.2; text-decoration: none; white-space: nowrap; transition: background .15s;
}
.pub-link:hover, .pub-link.aktif, .pub-dd.buka > .pub-link { background: rgba(255, 255, 255, .17); color: #fff; }
.pub-link i { font-size: 15px; }
.pub-caret { font-size: 11px !important; transition: transform .2s; }
.pub-dd.buka .pub-caret { transform: rotate(180deg); }
.pub-cta { background: #fff; color: #256f48 !important; box-shadow: 0 4px 12px rgba(0, 0, 0, .16); margin-left: 6px; }
.pub-cta:hover { background: #f1fbf5; color: #1d5a3a !important; }
.pub-gt { margin-left: 4px; }
.pub-dd-menu {
    position: absolute; top: calc(100% + 10px); left: 0; min-width: 350px; max-height: 70vh; overflow: auto; margin: 0; padding: 8px; list-style: none;
    background: #fff; border-radius: 14px; box-shadow: 0 18px 44px rgba(10, 40, 30, .24); display: none; z-index: 1010;
}
.pub-dd-menu a { display: block; padding: 9px 12px; border-radius: 9px; color: #1f2d27; font-size: 14px; font-weight: 500; text-decoration: none; }
.pub-dd-menu > li > a:hover { background: #eef7f2; color: #256f48; }
.pub-dd-title { padding: 12px 12px 4px; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #6a7a72; }
.pub-arsip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 8px; }
.pub-arsip a.pub-thn { display: inline-block; min-width: 54px; padding: 6px 8px; font-weight: 700; }
.pub-arsip a.pub-tw { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #eef7f2; color: #256f48; font-size: 12.5px; font-weight: 700; }
.pub-arsip a.pub-tw:hover { background: #2f8a5b; color: #fff; }
.pub-burger { display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, .4); border-radius: 12px; background: rgba(255, 255, 255, .12); color: #fff; font-size: 24px; line-height: 1; cursor: pointer; padding: 0; }
.pub-nav-latar { display: none; }
/* Dropdown hanya terbuka lewat klik (kelas .buka), tidak lagi saat kursor melintas. */
.pub-dd.buka > .pub-dd-menu { display: block; }

@media (max-width: 991px) {
    .pub-header-in { padding: 6px 14px; }
    .pub-brand img { height: 46px; }
    .pub-burger { display: inline-flex; align-items: center; justify-content: center; }
    .pub-nav {
        display: none; position: fixed; top: var(--sv-hdr); left: 0; right: 0; bottom: 0; margin: 0; padding: 12px 14px 32px; overflow-y: auto;
        background: #fff; border-top: 1px solid #dfe7e2;
    }
    .pub-nav.buka { display: block; }
    body.pub-menu-buka { overflow: hidden; }
    .pub-nav > ul { flex-direction: column; align-items: stretch; gap: 2px; }
    .pub-link { color: #1f2d27; width: 100%; justify-content: flex-start; padding: 13px 14px; font-size: 15.5px; border-radius: 12px; }
    .pub-link:hover, .pub-link.aktif, .pub-dd.buka > .pub-link { background: #eef7f2; color: #256f48; }
    .pub-dd-btn .pub-caret { margin-left: auto; }
    .pub-dd-menu { position: static; display: none; min-width: 0; max-height: none; margin: 2px 0 8px 10px; padding: 6px; box-shadow: none; background: #f6faf8; border-radius: 12px; }
    .pub-dd-menu::before { display: none; }
    .pub-dd.buka > .pub-dd-menu { display: block; }
    .pub-cta { margin: 10px 0 0; justify-content: center; background: linear-gradient(120deg, #2f8a5b, #2a8a72); color: #fff !important; box-shadow: 0 6px 14px rgba(47, 138, 91, .3); }
    .pub-gt { margin: 10px 0 0; }
}

/* ---------- footer ---------- */
.pub-footer { background: linear-gradient(120deg, #1f5a47 0%, #1b4f5d 100%); color: #d6e6dd; margin-top: 0; }
.pub-footer-in { max-width: 1240px; margin: 0 auto; padding: 38px 20px 26px; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.pub-foot-brand strong { display: block; color: #fff; font-size: 16px; line-height: 1.4; }
.pub-foot-brand span { display: block; margin-top: 2px; color: #b8d3c6; font-size: 13px; }
.pub-foot-brand p { margin: 12px 0 0; font-size: 13.5px; line-height: 1.6; color: #c3d9cd; max-width: 460px; }
.pub-foot-col h4 { margin: 0 0 10px; color: #fff; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; }
.pub-foot-col ul { list-style: none; margin: 0; padding: 0; }
.pub-foot-col li { margin: 0 0 7px; }
.pub-foot-col a { color: #d6e6dd; text-decoration: none; font-size: 14px; }
.pub-foot-col a:hover { color: #fff; text-decoration: underline; }
.pub-foot-bawah { border-top: 1px solid rgba(255, 255, 255, .14); padding: 14px 20px 18px; text-align: center; font-size: 12.5px; color: #b8d3c6; }
@media (max-width: 767px) { .pub-footer-in { grid-template-columns: 1fr; gap: 22px; padding: 28px 18px 18px; } }

/* ---------- pembungkus kartu halaman umum ---------- */
body.pub #services > .container > .card.border-primary { border: 1px solid var(--sv-border, #dfe7e2) !important; border-radius: 16px; box-shadow: 0 1px 3px rgba(20, 40, 30, .06); }
body.pub-hasil #services > .container { max-width: 1240px; }
body.pub-hasil #services .card-body { padding: 22px 24px; }
@media (max-width: 767px) { body.pub-hasil #services .card-body { padding: 14px 10px; } body.pub-hasil #services > .container { padding-left: 10px; padding-right: 10px; } }

/* ---------- halaman hasil survei ---------- */
.sv-hasil { color: #1f2d27; font-size: 14.5px; }
.sv-toolbar { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin: 0 0 16px; }
.sv-toolbar .sv-btn { min-height: 44px; padding: 9px 20px; font-size: 14.5px; border-radius: 12px; }
.sv-hasil .full-width, .sv-hasil .one-third, .sv-hasil .two-third { width: 100%; float: none; margin: 0; }
.sv-hasil .module { background: #fff; border: 1px solid #dfe7e2; border-radius: 14px; margin: 0 0 18px; overflow: hidden; box-shadow: 0 1px 2px rgba(20, 40, 30, .04); }
.sv-hasil .module-head { padding: 14px 18px; background: #f5faf7; border-bottom: 1px solid #dfe7e2; }
.sv-hasil h3, .sv-hasil h4 { font-size: 17px; font-weight: 700; line-height: 1.45; margin: 6px 0; color: #1f2d27; }
.sv-hasil h2 { font-size: 19px; font-weight: 700; }
.sv-hasil table.table, .sv-hasil table.responstable { width: 100%; margin: 0 0 14px; font-size: 13.5px; border-collapse: separate; border-spacing: 0; border: 1px solid #dfe7e2; border-radius: 10px; overflow: hidden; }
.sv-hasil .table-bordered > :not(caption) > * > * { border-width: 0 1px 1px 0; border-color: #e3ece7; }
.sv-hasil .table-bordered > :not(caption) > * > *:last-child { border-right-width: 0; }
.sv-hasil .table-bordered > tbody > tr:last-child > * { border-bottom-width: 0; }
.sv-hasil .btn-primary { background: #2f8a5b; border-color: #2f8a5b; font-weight: 600; border-radius: 9px; }
.sv-hasil .btn-primary:hover { background: #256f48; border-color: #256f48; }
.sv-hasil .form-control { border-radius: 9px; border-color: #cfdad3; }
.sv-hasil select, .sv-hasil input[type="text"] { height: 40px; padding: 6px 12px; border: 1.5px solid #cfdad3; border-radius: 9px; background-color: #fff; font-size: 14px; color: #1f2d27; max-width: 100%; }
.sv-hasil select:focus, .sv-hasil input[type="text"]:focus { border-color: #2f8a5b; box-shadow: 0 0 0 3px rgba(47, 138, 91, .15); outline: 0; }
.sv-hasil .btn-success { background: #2f8a5b; border-color: #2f8a5b; border-radius: 9px; font-weight: 600; }
.sv-hasil .btn-success:hover { background: #256f48; border-color: #256f48; }
.sv-hasil .rb-chart-blok h5, .sv-hasil h5 { font-size: 15px; font-weight: 700; }
.sv-hasil .table th, .sv-hasil table.responstable th { background: #eaf3ee; color: #24553b; font-weight: 700; padding: 10px 12px; border-bottom: 1px solid #cfe3d7; vertical-align: middle; }
.sv-hasil .table td, .sv-hasil table.responstable td { padding: 9px 12px; border-top: 1px solid #e6eee9; vertical-align: middle; }
.sv-hasil .table > thead > tr:first-child > th { border-top: 0; }
.sv-hasil .table tbody tr:nth-child(even) > td { background: #fafcfb; }
.sv-hasil .table tbody tr:hover > td { background: #f0f8f4; }
.sv-hasil div[style*="min-width:900px"], .sv-hasil div[style*="min-width: 900px"], .sv-hasil div[style*="min-width:800px"], .sv-hasil div[style*="min-width: 800px"] {
    min-width: 0 !important; overflow-x: auto !important; overflow-y: visible !important; -webkit-overflow-scrolling: touch;
}
.sv-hasil div[style*="overflow-y:auto"] { overflow-x: auto !important; overflow-y: visible !important; }
.sv-hasil canvas { max-width: 100%; }
.sv-hasil .cetak { display: inline-block; }
.sv-hasil .cetak a { display: inline-block; margin: 4px 8px 6px 0; padding: 9px 16px; border-radius: 10px; background: #2f8a5b; color: #fff !important; font-size: 13.5px; font-weight: 700; text-decoration: none; }
.sv-hasil .cetak a:hover { background: #256f48; }
.sv-hasil .text-muted { color: #66766e !important; }
.sv-hasil ol.list, .sv-hasil ol.list ol { list-style: none; margin: 0; padding: 0; counter-reset: pub-hitung; }
.sv-hasil ol.list > li { counter-increment: pub-hitung; display: block; margin: 0 0 10px; padding: 12px 16px; background: #fff; border: 1px solid #dfe7e2; border-radius: 12px; }
.sv-hasil ol.list > li::before { content: counter(pub-hitung); display: inline-block; width: 26px; height: 26px; line-height: 26px; margin-right: 10px; border-radius: 50%; background: #2f8a5b; color: #fff; font-size: 12.5px; font-weight: 700; text-align: center; }
.sv-hasil ol.list > li > a { font-weight: 700; font-size: 15px; text-decoration: none; color: #256f48; }
.sv-hasil ol.list ol { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 2px 36px; }
.sv-hasil ol.list ol li { display: inline-block; margin: 0; padding: 0; border: 0; background: none; }
.sv-hasil ol.list ol li::before { display: none; content: none; }
.sv-hasil ol.list ol li a { display: inline-block; padding: 6px 14px; border-radius: 20px; background: #eef7f2; color: #256f48; font-size: 13px; font-weight: 600; text-decoration: none; }
.sv-hasil ol.list ol li a:hover { background: #2f8a5b; color: #fff; }

/* paging & pencarian daftar layanan */
.pg-bar { margin: 12px 0; text-align: center; }
.pg-info { font-size: 12.5px; color: #66766e; margin-bottom: 8px; }
.pg-btn, .pg-aktif, .pg-mati { display: inline-block; padding: 6px 12px; margin: 0 2px 4px; border: 1px solid #cfdad3; border-radius: 9px; text-decoration: none; font-size: 13.5px; color: #256f48; background: #fff; }
.pg-btn:hover { background: #eef7f2; }
.pg-aktif { background: #2f8a5b; border-color: #2f8a5b; color: #fff; font-weight: 700; }
.pg-mati { color: #a3b0a9; background: #f6f8f7; }
.pg-gap { margin: 0 4px; color: #66766e; }

/* ---------- tampilan khusus cetak (halaman hasil publik) ---------- */
.pub-print-head { display: none; }
.rb-print-img { display: none; }
@media print {
    @page { size: A4 portrait; margin: 12mm; }
    #header, .pub-header, .pub-footer, .sv-toolbar, .no-print, .gtranslate_wrapper, .pub-nav-latar { display: none !important; }
    html, body.pub { background: #fff !important; width: auto !important; }
    body.pub #services, body.pub #main { padding: 0 !important; margin: 0 !important; background: #fff !important; }
    body.pub #services > .container, body.pub-hasil #services > .container { max-width: none !important; width: 100% !important; padding: 0 !important; }
    body.pub #services > .container > .card { border: 0 !important; box-shadow: none !important; margin: 0 !important; }
    body.pub #services .card-body, body.pub-hasil #services .card-body { padding: 0 !important; }
    .pub-print-head { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 2px solid #2f8a5b; }
    .pub-print-head img { height: 40px; width: auto; }
    .pub-print-head div { text-align: right; font-size: 11px; color: #444; line-height: 1.4; }
    .pub-print-head strong { display: block; font-size: 13px; color: #1f2d27; }
    .sv-hasil { font-size: 11pt; }
    .sv-hasil .module { border: 0 !important; box-shadow: none !important; border-radius: 0 !important; margin-bottom: 10px; }
    .sv-hasil .module-head { background: #fff !important; padding: 6px 0; }
    .sv-hasil .table, .sv-hasil table.responstable { font-size: 9.5pt; }
    .sv-hasil .table th, .sv-hasil .table td { padding: 4px 6px; }
    .sv-hasil thead { display: table-header-group; }
    .sv-hasil tr, .sv-hasil canvas, .sv-hasil img, .sv-hasil .module-head { break-inside: avoid; page-break-inside: avoid; }
    .sv-hasil div[style*="overflow"] { overflow: visible !important; }
    .sv-hasil canvas { display: none !important; }
    .rb-print-img { display: block !important; max-width: 100%; margin: 0 auto 8px; }
    .sv-hasil .cetak { display: none !important; }
}
