/* =========================================================
   RSUD Kertosono — tema web2 (teal, minimalis, responsif)
   Dimuat SETELAH theme/assets/css/style.css (template lama),
   jadi aturan di sini menimpa gaya lama.
   ========================================================= */

:root {
  --brand: #0d8f82;
  --brand-dark: #0a6e64;
  --brand-light: #e6f4f2;
  --accent: #f5a15a;
  --accent-dark: #e2833a;
  --ink: #1f2937;
  --ink-soft: #5b6572;
  --bg-soft: #f7faf9;
  --line: #e7edec;
  --radius-lg: 1.25rem;
  --radius-md: 0.9rem;
  --radius-sm: 0.6rem;
  --shadow-soft: 0 10px 30px -14px rgba(16, 42, 40, 0.18);
  --shadow-pop: 0 16px 40px -12px rgba(16, 42, 40, 0.28);
  --font: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --cw: 100vw; /* lebar .container Bootstrap per breakpoint, dipakai page header */
}
@media (min-width: 576px)  { :root { --cw: 540px; } }
@media (min-width: 768px)  { :root { --cw: 720px; } }
@media (min-width: 992px)  { :root { --cw: 960px; } }
@media (min-width: 1200px) { :root { --cw: 1140px; } }
@media (min-width: 1400px) { :root { --cw: 1320px; } }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: clip; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font); color: var(--ink); }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

.text-brand { color: var(--brand) !important; }
.bg-brand { background: var(--brand) !important; }
.bg-soft { background: var(--bg-soft); }

/* ---------- Buttons ---------- */
.btn-brand {
  background: var(--brand);
  border: 1px solid var(--brand);
  color: #fff;
  border-radius: 50rem;
  padding: 0.65rem 1.6rem;
  font-weight: 600;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn-brand:hover, .btn-brand:focus {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}
.btn-outline-brand {
  border: 1.5px solid var(--brand);
  color: var(--brand);
  border-radius: 50rem;
  padding: 0.6rem 1.5rem;
  font-weight: 600;
  transition: all .18s ease;
  background: #fff;
}
.btn-outline-brand:hover { background: var(--brand); color: #fff; transform: translateY(-2px); }
.btn-accent {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  border-radius: 50rem;
  padding: 0.65rem 1.6rem;
  font-weight: 600;
  transition: all .18s ease;
}
.btn-accent:hover { background: var(--accent-dark); color: #fff; transform: translateY(-2px); }

/* Ikon TikTok (SVG) - Bootstrap Icons versi ini belum punya bi-tiktok */
.ico-tiktok { width: 1em; height: 1em; fill: currentColor; vertical-align: -.125em; display: inline-block; }
.ico-tiktok.me-1 { margin-right: .25rem; }
.social-btn .ico-tiktok { transform: translateY(2px); }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--brand-dark);
  color: #eafffb;
  font-size: .82rem;
}
.topbar a { color: #eafffb; }
.topbar a:hover { color: #fff; text-decoration: underline; }
.topbar .bi { margin-right: .3rem; }
.topbar .topbar-social a { font-size: .95rem; }
.topbar .topbar-social a:hover { text-decoration: none; opacity: .8; }

/* ---------- Navbar ---------- */
.navbar-rsud {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
  padding-top: .6rem;
  padding-bottom: .6rem;
  transition: box-shadow .2s ease;
  z-index: 1030;
}
.navbar-rsud.is-scrolled { box-shadow: 0 4px 24px -12px rgba(16,42,40,.25); }
.navbar-brand-rsud { display: flex; align-items: center; gap: .6rem; margin-right: 1rem; }
.navbar-brand-rsud img { height: 42px; width: 42px; object-fit: contain; }
.navbar-brand-rsud .brand-text { line-height: 1.1; }
.navbar-brand-rsud .brand-text strong { display: block; font-size: 1.02rem; color: var(--ink); }
.navbar-brand-rsud .brand-text .brand-tagline {
  display: block; font-size: .68rem; color: var(--ink-soft); letter-spacing: .04em;
}
.navbar-rsud .navbar-toggler { font-size: 1.6rem; color: var(--ink); padding: .25rem .5rem; }
.navbar-rsud .navbar-toggler:focus { box-shadow: 0 0 0 .2rem rgba(13,143,130,.2); }

.navbar-rsud .nav-link {
  color: var(--ink) !important;
  font-weight: 500;
  padding: .5rem .85rem !important;
  border-radius: 50rem;
  transition: background .15s ease, color .15s ease;
}
.navbar-rsud .nav-link:hover,
.navbar-rsud .nav-link.show { background: var(--brand-light); color: var(--brand-dark) !important; }
.navbar-rsud .nav-link.active { background: var(--brand); color: #fff !important; }
.navbar-rsud .dropdown-menu {
  border: 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
  padding: .5rem;
  min-width: 14rem;
}
.navbar-rsud .dropdown-item {
  border-radius: var(--radius-sm);
  padding: .5rem .8rem;
  font-size: .93rem;
  color: var(--ink);
}
.navbar-rsud .dropdown-item:hover,
.navbar-rsud .dropdown-item:focus { background: var(--brand-light); color: var(--brand-dark); }
.navbar-rsud .dropdown-item.active { background: var(--brand); color: #fff; }
.navbar-rsud .dropdown-item .bi-box-arrow-up-right { font-size: .7rem; opacity: .6; margin-left: .25rem; }

@media (max-width: 1199.98px) {
  .navbar-rsud .navbar-collapse {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    padding: .8rem 0 .4rem;
  }
  .navbar-rsud .dropdown-menu { box-shadow: none; background: var(--bg-soft); margin: .2rem 0 .4rem; }
  .navbar-rsud .nav-cta { margin-top: .6rem; }
}
@media (max-width: 575.98px) {
  .navbar-brand-rsud .brand-text .brand-tagline { display: none; }
}

/* ---------- Hero (beranda) ---------- */
section.hero {
  position: relative;
  background: linear-gradient(160deg, var(--brand-light) 0%, #ffffff 62%);
  padding: 3.5rem 0;
  overflow: hidden;
}
/* Layar pertama beranda hanya berisi hero (teks + gambar + strip info).
   --header-h diukur oleh JS (lihat v_home.php & rsud.js). */
@media (min-width: 768px) {
  section.hero {
    min-height: calc(100vh - var(--header-h, 111px));
    min-height: calc(100svh - var(--header-h, 111px));
    display: flex;
    align-items: center;
  }
  section.hero > .container { width: 100%; }
}
section.hero::after {
  content: "";
  position: absolute;
  right: -120px; top: -120px;
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(245,161,90,.25), transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
section.hero h1 { font-weight: 800; letter-spacing: -0.02em; }
section.hero .lead { color: var(--ink-soft); }
.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: #fff; border: 1px solid var(--line);
  border-radius: 50rem; padding: .4rem .9rem;
  font-size: .82rem; font-weight: 600; color: var(--brand-dark);
  box-shadow: var(--shadow-soft);
}
.hero-motto { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 1rem; }
.hero-motto span {
  background: #fff; border: 1px solid var(--line); color: var(--ink-soft);
  border-radius: 50rem; padding: .25rem .75rem; font-size: .8rem; font-weight: 600;
}
.hero-motto span b { color: var(--brand); }
.hero-art {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-pop);
}

/* Layar laptop yang pendek (mis. 1366x768): ringkaskan hero supaya
   teks, gambar, dan strip info tetap muat dalam satu layar. */
@media (min-width: 768px) and (max-height: 860px) {
  section.hero { padding: 1.75rem 0; }
  section.hero h1 { font-size: 2.5rem; margin-top: .8rem !important; margin-bottom: .6rem !important; }
  section.hero .lead { font-size: 1.05rem; margin-bottom: .4rem; }
  section.hero .hero-motto { margin-top: .6rem; }
  section.hero .hero-art { width: 100%; max-height: 46vh; object-fit: cover; }
  section.hero .quick-info { margin-top: 1.5rem; }
  section.hero .quick-item { padding: .85rem 1.1rem; }
  section.hero .quick-item .icon-wrap { width: 44px; height: 44px; font-size: 1.15rem; }
}

/* ---------- Quick info strip (di dalam hero, tepat di bawah gambar) ---------- */
.quick-info { position: relative; z-index: 3; margin-top: 2.5rem; }
.quick-info .card {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
}
.quick-item { display: flex; align-items: center; gap: .9rem; padding: 1.1rem 1.2rem; height: 100%; color: var(--ink); text-align: left; }
a.quick-item:hover { background: var(--bg-soft); color: var(--ink); }
.quick-item .icon-wrap {
  width: 50px; height: 50px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--brand-light); color: var(--brand);
  font-size: 1.3rem;
}
.quick-item h6 { margin: 0; font-weight: 700; font-size: .92rem; }
.quick-item small { color: var(--ink-soft); }
@media (min-width: 768px) {
  .quick-info .col-md-3 + .col-md-3 .quick-item { border-left: 1px solid var(--line); }
}
@media (max-width: 767.98px) {
  section.hero { padding: 3rem 0; text-align: center; }
  section.hero .hero-motto { justify-content: center; }
  .quick-info { margin-top: 2rem; }
  .quick-info .col-md-3 + .col-md-3 .quick-item { border-top: 1px solid var(--line); }
}

/* ---------- Sections ---------- */
section.section { padding: 4.5rem 0; }
section.section-tight { padding: 3rem 0; }
.eyebrow {
  color: var(--accent-dark);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .78rem;
}
.section-title { font-weight: 800; letter-spacing: -0.01em; margin-top: .3rem; }
.section-sub { color: var(--ink-soft); max-width: 640px; }

/* ---------- Cards ---------- */
.card-soft {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  transition: transform .2s ease, box-shadow .2s ease;
}
a:hover > .card-soft, .card-soft.hoverable:hover { transform: translateY(-6px); box-shadow: var(--shadow-pop); }

.service-card { padding: 1.8rem 1.5rem; height: 100%; }
.icon-badge {
  width: 56px; height: 56px; border-radius: 1rem;
  background: var(--brand-light); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; margin-bottom: 1rem;
}
.service-card h5 { font-weight: 700; }
.service-card p { color: var(--ink-soft); font-size: .92rem; margin-bottom: 0; }
.service-card .more { display: inline-flex; align-items: center; gap: .3rem; margin-top: 1rem; font-weight: 600; font-size: .9rem; color: var(--brand); }

.news-card { overflow: hidden; height: 100%; }
.news-card .news-thumb { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--brand-light); display: block; }
.news-card .news-thumb.is-fallback { object-fit: contain; padding: 2.5rem; }
.news-card .news-body { padding: 1.2rem 1.3rem 1.4rem; }
.badge-kat {
  background: var(--accent); color: #fff; font-weight: 600;
  border-radius: 50rem; font-size: .72rem; padding: .3rem .7rem; display: inline-block;
}
.news-card h5 { font-weight: 700; font-size: 1.05rem; margin: .7rem 0 .5rem; color: var(--ink); }
.news-card .meta { color: var(--ink-soft); font-size: .8rem; }

.list-soft { list-style: none; padding: 0; margin: 0; }
.list-soft li { display: flex; gap: .9rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.list-soft li:last-child { border-bottom: 0; }
.list-soft .date-box {
  flex: none; width: 58px; text-align: center; border-radius: var(--radius-sm);
  background: var(--brand-light); color: var(--brand-dark); padding: .35rem 0; line-height: 1.1;
}
.list-soft .date-box b { display: block; font-size: 1.25rem; }
.list-soft .date-box small { font-size: .7rem; text-transform: uppercase; font-weight: 600; }
.list-soft .file-icon {
  flex: none; width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: var(--brand-light); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.list-soft .min-w-0 { min-width: 0; }
.list-soft .flex-none { flex: none; border-radius: 50%; width: 38px; height: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
.list-soft h6 { font-weight: 700; margin-bottom: .2rem; }
.list-soft p { color: var(--ink-soft); font-size: .88rem; margin: 0; }

.contact-card { padding: 1.6rem 1.4rem; height: 100%; }
.contact-card h5 { font-weight: 700; }
.contact-card p { font-size: .92rem; margin-bottom: 0; overflow-wrap: anywhere; }
.contact-card .email-link { font-size: .84rem; }
.contact-card .more { display: inline-flex; align-items: center; gap: .3rem; margin-top: .8rem; font-weight: 600; font-size: .9rem; }
.map-card { overflow: hidden; height: 100%; min-height: 380px; }
.map-card iframe { display: block; width: 100%; height: 100%; min-height: 380px; border: 0; }

/* Halaman dokumen resmi (PPID, Maklumat Pelayanan) */
#main .maklumat-doc-img { max-width: 460px; width: 100%; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-soft); }
#main .maklumat-doc-img.maklumat-doc-wide { max-width: 100%; }
.content-body { color: var(--ink); line-height: 1.75; }
.content-body h4 { font-weight: 800; margin-bottom: 1rem; }
.content-body ol, .content-body ul { padding-left: 1.3rem; margin-bottom: 1.2rem; }
.content-body li { margin-bottom: .5rem; }

.about-img { border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); width: 100%; }
.check-list { list-style: none; padding: 0; margin: 1.2rem 0 0; }
.check-list li { display: flex; gap: .6rem; margin-bottom: .55rem; color: var(--ink); }
.check-list .bi { color: var(--brand); font-size: 1.1rem; line-height: 1.4; }

.insta-card { padding: 1rem; }
.insta-card blockquote.instagram-media,
.insta-card iframe { width: 100% !important; max-width: 100% !important; min-width: 0 !important; margin: 0 !important; border: 0 !important; box-shadow: none !important; }

.cta-strip {
  background: linear-gradient(120deg, var(--brand) 0%, var(--brand-dark) 100%);
  border-radius: var(--radius-lg);
  color: #fff;
  padding: 3rem;
}
.cta-strip h3 { color: #fff; font-weight: 800; }
@media (max-width: 767.98px) {
  .cta-strip { padding: 2rem 1.4rem; text-align: center; justify-content: center !important; }
}

.empty-state { padding: 2.5rem 1rem; text-align: center; color: var(--ink-soft); }
.empty-state .bi { font-size: 2.2rem; color: var(--brand); display: block; margin-bottom: .6rem; }

/* ---------- Footer ---------- */
footer.site-footer { background: #0f2926; color: #cfe7e3; font-size: .9rem; }
footer.site-footer h6 { color: #fff; font-weight: 700; letter-spacing: .02em; }
footer.site-footer a { color: #b7d9d4; }
footer.site-footer a:hover { color: #fff; }
footer.site-footer .footer-brand-name { color: #fff; font-weight: 700; font-size: 1.25rem; }
footer.site-footer .footer-contact li { display: flex; gap: .6rem; }
footer.site-footer .footer-contact .bi { color: #7fd1c6; }
footer.site-footer .footer-bottom { background: #0a1f1c; color: #8fb5b0; font-size: .85rem; }
.social-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.08); color: #fff !important;
  display: inline-flex; align-items: center; justify-content: center;
  margin-right: .4rem; transition: background .15s ease;
}
.social-btn:hover { background: var(--brand); }

/* ---------- Tombol melayang: WhatsApp + kembali ke atas ---------- */
.wa-float {
  position: fixed; right: 1.3rem; bottom: 1.3rem; z-index: 1040;
  display: inline-flex; align-items: center; gap: .5rem;
  background: #25d366; color: #fff; border-radius: 50rem;
  padding: .7rem 1.1rem; font-weight: 600; font-size: .92rem;
  box-shadow: var(--shadow-pop); transition: transform .18s ease;
}
.wa-float .bi { font-size: 1.25rem; }
.wa-float:hover { color: #fff; transform: translateY(-2px); }
@media (max-width: 575.98px) {
  .wa-float { padding: .8rem; }
  .wa-float span { display: none; }
}
.back-to-top {
  position: fixed; right: 1.55rem; bottom: 5rem; z-index: 1040;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--brand); color: #fff; display: flex;
  align-items: center; justify-content: center; box-shadow: var(--shadow-pop);
  font-size: 1.4rem;
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: all .2s ease;
}
.back-to-top:hover { color: #fff; background: var(--brand-dark); }
.back-to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }

/* ---------- Animasi muncul saat scroll ---------- */
.fade-up { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
.fade-up.in-view { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .fade-up { opacity: 1; transform: none; transition: none; }
}

/* =========================================================
   PENYESUAIAN HALAMAN LAMA (views/depan/*)
   Halaman dalam memakai pola:
   <main id="main"><section class="about"><hr/><header class="section-header"><p>Judul</p></header>...
   Aturan di bawah mengubah pola itu menjadi "page header" ala tema baru
   tanpa perlu mengedit puluhan file satu per satu.
   ========================================================= */
#main > section:first-child { padding-top: 0; }
#main > section:first-child > hr:first-child,
#main > section:first-child > .container > hr:first-of-type { display: none; }

#main .section-header {
  background: var(--brand-light);
  margin: 0 calc(50% - 50vw) 2.5rem;
  padding: 2.8rem calc((100vw - var(--cw)) / 2 + 12px) 2.4rem;
  text-align: left;
}
#main .section-header::before {
  content: "RSUD Kertosono";
  display: block;
  color: var(--accent-dark);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .78rem;
  margin-bottom: .35rem;
}
#main .section-header p,
#main .section-header h2 {
  margin: 0;
  font-family: var(--font);
  font-size: clamp(1.7rem, 3.5vw, 2.4rem) !important;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-transform: none;
}
@media (max-width: 575.98px) {
  #main .section-header { padding-left: 16px; padding-right: 16px; }
}

/* Konten lama: paksa gambar & container tidak melebar di layar kecil */
#main img { max-width: 100%; height: auto; }
@media (max-width: 767.98px) {
  #main .container[style*="vh"] { padding-left: 16px !important; padding-right: 16px !important; }
}

/* Kartu bolak-balik lama (.card3, halaman Pelayanan & Penunjang).
   Di perangkat sentuh tidak ada hover, dan tombol .button7 (translateZ)
   menembus ke sisi depan kartu. Tampilkan sisi depan saja; kartu tetap bisa diklik. */
@media (hover: none), (pointer: coarse) {
  .card3 .back { display: none !important; }
  .card3:hover .front,
  .card3:nth-child(even):hover .front { transform: none !important; }
}
