/* ==========================================================================
   RS Bhirawa Bhakti — Prototype Stylesheet
   Tema: Nuansa TNI (hijau tentara) + aksen emas & merah (sesuai logo).
   Prototype desain (placeholder foto/dokter). Data asli menyusul.
   ========================================================================== */

:root {
  --primary: #2f5138;
  --primary-600: #447a51;
  --primary-700: #2f5138;
  --primary-800: #203827;
  --primary-50: #eef4ee;
  --accent: #d4a72c;
  --accent-600: #b8891f;
  --danger: #c92b2f;
  --danger-600: #a92024;
  --ink: #1a241c;
  --muted: #5c6b60;
  --bg: #f6f8f6;
  --card: #ffffff;
  --border: #e2e8e4;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(26, 36, 28, .06), 0 8px 24px rgba(26, 36, 28, .06);
  --shadow-lg: 0 12px 40px rgba(26, 36, 28, .12);
  --font: "Inter", "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container { width: min(1140px, 92%); margin: 0 auto; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--primary-800);
  color: #dbe7dd;
  font-size: .82rem;
}
.topbar .container {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; padding: .45rem 0; flex-wrap: wrap;
}
.topbar a { color: #dbe7dd; }
.topbar a:hover { color: #fff; }
.topbar .tb-item { display: inline-flex; align-items: center; gap: .35rem; margin-right: 1.1rem; }
.topbar .tb-right { display: flex; gap: .9rem; align-items: center; }
.topbar .sep { opacity: .4; }

/* ---------- Header ---------- */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 8px rgba(26,36,28,.05);
}
.header-inner { display: flex; align-items: center; gap: 1.25rem; height: 74px; }
.brand { display: flex; align-items: center; gap: .7rem; }
.brand-logo {
  width: 54px; height: 58px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 10px; padding: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.brand-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.05rem; letter-spacing: -.01em; color: var(--ink); }
.brand-text small { color: var(--primary-700); font-size: .74rem; font-weight: 700; letter-spacing: .08em; }

.main-nav { display: flex; align-items: center; gap: 1.15rem; margin-left: auto; }
.main-nav a {
  font-size: .92rem; font-weight: 500; color: var(--muted); padding: .4rem 0;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.main-nav a:hover { color: var(--primary-700); }
.main-nav a.active { color: var(--primary-700); border-bottom-color: var(--accent); }
.nav-phone {
  background: var(--primary-50); color: var(--primary-800) !important;
  padding: .45rem .8rem !important; border-radius: 999px; border: 1px solid #d7e5da;
  font-weight: 600;
}

.lang-switch {
  display: flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; flex: none;
}
.lang-switch .lang {
  padding: .3rem .65rem; font-size: .8rem; font-weight: 600; cursor: pointer; color: var(--muted);
}
.lang-switch .lang.active { background: var(--primary-700); color: #fff; }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--border);
  border-radius: 8px; font-size: 1.2rem; padding: .3rem .6rem; cursor: pointer; color: var(--ink);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; justify-content: center;
  padding: .75rem 1.4rem; border-radius: 10px; font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer; transition: .18s ease; line-height: 1;
}
.btn-primary { background: var(--primary-700); color: #fff; }
.btn-primary:hover { background: var(--primary-800); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-accent { background: var(--accent-600); color: #fff; }
.btn-accent:hover { background: #9a7319; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-wa { background: #25d366; color: #fff; }
.btn-wa:hover { background: #1eb85a; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-outline { background: #fff; color: var(--primary-700); border-color: var(--primary-600); }
.btn-outline:hover { background: var(--primary-50); }
.btn-ghost-light { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.4); }
.btn-ghost-light:hover { background: rgba(255,255,255,.24); }
.btn-lg { padding: .95rem 1.8rem; font-size: 1rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff;
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(212,167,44,.30), transparent 60%),
    linear-gradient(135deg, #14211a 0%, var(--primary-800) 55%, var(--primary-600) 100%);
  overflow: hidden;
}
.hero .container { position: relative; padding: 4.5rem 0 5rem; z-index: 2; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem; background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.25); padding: .4rem .9rem; border-radius: 999px;
  font-size: .82rem; font-weight: 500; margin-bottom: 1.2rem;
}
.hero h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); line-height: 1.15; letter-spacing: -.02em; margin-bottom: 1rem; }
.hero h1 span { color: #f3d376; }
.hero p.lead { font-size: 1.1rem; color: #dfe8e0; max-width: 46ch; margin-bottom: 1.8rem; }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; }

.emergency-card {
  background: #fff; color: var(--ink); border-radius: 18px; padding: 1.4rem;
  box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,.4);
}
.emergency-card .ec-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .8rem; }
.ec-icon { width: 40px; height: 40px; border-radius: 10px; background: #fdeaea; color: var(--danger); display: grid; place-items: center; font-size: 1.2rem; }
.emergency-card h3 { font-size: 1rem; color: var(--danger); }
.emergency-card .ec-phone { font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; }
.emergency-card .ec-note { font-size: .82rem; color: var(--muted); margin: .2rem 0 .9rem; }
.emergency-card .ec-row { display: flex; justify-content: space-between; font-size: .86rem; border-top: 1px solid var(--border); padding-top: .55rem; margin-top: .55rem; }

.hero-stats { display: flex; gap: 2rem; margin-top: 2.6rem; }
.hero-stats .stat b { font-size: 1.6rem; display: block; color: #fff; }
.hero-stats .stat span { color: #c3d2c6; font-size: .85rem; }

/* ---------- Section scaffolding ---------- */
.section { padding: 4rem 0; }
.section-alt { background: #fff; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 2.6rem; }
.eyebrow { display: inline-block; color: var(--accent-600); font-weight: 700; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .5rem; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -.02em; margin-bottom: .6rem; }
.section-head p { color: var(--muted); }

/* ---------- Service cards ---------- */
.grid { display: grid; gap: 1.4rem; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.4rem; box-shadow: var(--shadow); transition: .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #d6e3d8; }
.service-card .icon {
  width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center;
  font-size: 1.5rem; background: var(--primary-50); margin-bottom: 1rem;
}
.service-card h3 { font-size: 1.02rem; margin-bottom: .4rem; }
.service-card p { color: var(--muted); font-size: .9rem; }
.service-card { cursor: pointer; }
.service-card:hover { border-color: var(--primary-400); }
.service-more { display: inline-block; margin-top: .65rem; color: var(--primary-700); font-weight: 600; font-size: .82rem; }

/* ---------- Doctors ---------- */
.doctor-card { text-align: center; }
.doctor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.4rem; }
.doctor-scroll {
  display: flex;
  gap: 1.2rem;
  overflow-x: auto;
  padding: .5rem .25rem 1.1rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.doctor-scroll .doctor-card {
  flex: 0 0 auto;
  width: 260px;
  scroll-snap-align: start;
}
.doctor-avatar {
  width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--primary-600), var(--primary-800));
  color: #fff; display: grid; place-items: center; font-size: 1.9rem; font-weight: 700;
  overflow: hidden;
}
.doctor-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.doctor-card h3 { font-size: 1rem; line-height: 1.4; }
.doctor-card .spec { color: var(--primary-700); font-weight: 600; font-size: .85rem; margin: .2rem 0 .5rem; }
.doctor-card .schedule { font-size: .82rem; color: var(--muted); }
.doctor-card .schedule b { color: var(--ink); font-weight: 600; }
.sched-line { padding: .12rem 0; }

/* ---------- Articles ---------- */
.article-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.article-thumb { height: 150px; background: linear-gradient(135deg, var(--primary-700), var(--primary-600)); display: grid; place-items: center; color: #fff; font-size: 2rem; }
.article-body { padding: 1.2rem 1.3rem 1.4rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.article-body .meta { font-size: .78rem; color: var(--muted); }
.article-body h3 { font-size: 1rem; line-height: 1.4; }
.article-body p { color: var(--muted); font-size: .88rem; }
.article-body .more { margin-top: auto; color: var(--primary-700); font-weight: 600; font-size: .88rem; }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(135deg, var(--primary-800), var(--accent-600)); color: #fff;
  border-radius: 20px; padding: 3rem; display: flex; align-items: center;
  justify-content: space-between; gap: 2rem; flex-wrap: wrap;
}
.cta-band h2 { font-size: 1.6rem; margin-bottom: .4rem; }
.cta-band p { color: #e4ede5; }

/* ---------- Footer ---------- */
.site-footer { background: #14211a; color: #c7d6cb; margin-top: 4rem; }
.site-footer .foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 2.5rem; padding: 3.5rem 0 2.5rem; }
.site-footer h4 { color: #fff; font-size: .95rem; margin-bottom: 1rem; }
.site-footer a { color: #c7d6cb; font-size: .9rem; display: block; padding: .2rem 0; }
.site-footer a:hover { color: #f3d376; }
.site-footer .foot-brand p { font-size: .88rem; margin-top: .8rem; color: #9fb7a6; }
.foot-contact li { display: flex; gap: .5rem; font-size: .88rem; padding: .28rem 0; align-items: flex-start; }
.foot-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 1.2rem 0; font-size: .82rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: #7f9c87; }

.social-row { display: flex; gap: .7rem; margin-top: 1rem; }
.social-row a {
  width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.1);
  display: grid; place-items: center; font-size: 1rem; padding: 0 !important;
}

/* ---------- Page hero (subpages) ---------- */
.page-hero {
  background: linear-gradient(135deg, #14211a, var(--primary-700)); color: #fff; padding: 3rem 0;
}
.page-hero h1 { font-size: clamp(1.6rem, 3vw, 2.3rem); letter-spacing: -.02em; }
.page-hero p { color: #d3e0d5; margin-top: .4rem; }
.breadcrumb { font-size: .82rem; color: #b6c9bb; margin-bottom: .6rem; }
.breadcrumb a { color: #d3e0d5; }

/* ---------- Complaint page ---------- */
.complaint-layout { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2.5rem; align-items: start; }
.steps { counter-reset: step; display: flex; flex-direction: column; gap: 1rem; }
.step {
  display: flex; gap: 1rem; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow);
}
.step .num {
  counter-increment: step; flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary-50); color: var(--primary-700); font-weight: 800; display: grid; place-items: center;
}
.step .num::before { content: counter(step); }
.step h3 { font-size: .98rem; margin-bottom: .2rem; }
.step p { color: var(--muted); font-size: .88rem; }
.step code { background: var(--bg); padding: .1rem .35rem; border-radius: 6px; font-size: .82rem; }

.wa-panel {
  background: #fff; border: 1px solid var(--border); border-radius: 18px; padding: 1.8rem;
  box-shadow: var(--shadow-lg); text-align: center; position: sticky; top: 96px;
}
.wa-panel .wa-logo {
  width: 68px; height: 68px; margin: 0 auto 1rem; border-radius: 50%;
  background: #25d366; color: #fff; display: grid; place-items: center; font-size: 2rem;
}
.wa-panel h3 { font-size: 1.1rem; margin-bottom: .4rem; }
.wa-panel p { color: var(--muted); font-size: .9rem; margin-bottom: 1.1rem; }
.wa-panel .num { font-size: 1.25rem; font-weight: 800; margin-bottom: 1.1rem; }
.wa-panel .btn { width: 100%; }

/* ---------- Contact page ---------- */
.contact-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; margin-bottom: 2.5rem; }
.contact-card { text-align: left; }
.contact-card .icon { width: 48px; height: 48px; border-radius: 12px; background: var(--primary-50); display: grid; place-items: center; font-size: 1.3rem; margin-bottom: .8rem; }
.contact-card h3 { font-size: .95rem; margin-bottom: .3rem; }
.contact-card p, .contact-card a { color: var(--muted); font-size: .9rem; }
.contact-card a:hover { color: var(--primary-700); }

.map-wrap { border-radius: 18px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }
.map-wrap iframe { width: 100%; height: 420px; border: 0; display: block; }

/* ---------- Doctor table ---------- */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
table.schedule { width: 100%; border-collapse: collapse; min-width: 640px; }
table.schedule th, table.schedule td { padding: .85rem 1.1rem; text-align: left; font-size: .9rem; }
table.schedule thead th { background: var(--primary-50); color: var(--primary-800); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
table.schedule tbody tr { border-top: 1px solid var(--border); }
table.schedule tbody tr:hover { background: #f5f9f6; }
table.schedule .doc-cell { display: flex; align-items: center; gap: .7rem; }
.doc-mini { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, var(--primary-600), var(--primary-800)); color: #fff; display: grid; place-items: center; font-weight:700; font-size: .85rem; flex: none; }

.badge { display: inline-block; padding: .18rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 600; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-blue { background: #dbeafe; color: #1d4ed8; }

.note-placeholder {
  background: #fffbeb; border: 1px dashed #f59e0b; color: #92400e;
  padding: .7rem 1rem; border-radius: 10px; font-size: .85rem; margin: 1.4rem 0;
}

/* ---------- Poli group titles (schedule page) ---------- */
.poli-title {
  font-size: 1.3rem; letter-spacing: -.01em; margin: 2.2rem 0 1rem;
  padding-bottom: .55rem; border-bottom: 2px solid var(--primary-50);
  display: flex; align-items: center; gap: .55rem;
}
.poli-title:first-of-type { margin-top: .25rem; }

/* ---------- Modal layanan ---------- */
[hidden] { display: none !important; }
.modal-overlay {
  position: fixed; inset: 0; background: rgba(17, 35, 20, .55);
  display: flex; align-items: center; justify-content: center; padding: 1.2rem;
  z-index: 999;
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: #fff; border-radius: 18px; width: 100%; max-width: 460px;
  max-height: 88vh; overflow: auto; padding: 1.8rem 1.6rem 1.6rem;
  position: relative; box-shadow: var(--shadow-lg);
}
.modal-close {
  position: absolute; top: .8rem; right: .8rem; width: 34px; height: 34px;
  border-radius: 50%; border: none; background: #f1f5f2; color: var(--ink);
  font-size: 1rem; cursor: pointer;
}
.modal-photo { border-radius: 14px; overflow: hidden; margin-bottom: 1rem; max-height: 260px; }
.modal-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal-icon { font-size: 3.4rem; text-align: center; margin-bottom: .6rem; }
.modal h3 { font-size: 1.25rem; margin-bottom: .4rem; text-align: center; }
.modal-desc { color: var(--muted); font-size: .92rem; text-align: center; margin-bottom: 1.1rem; }
.modal-info {
  display: flex; gap: .7rem; align-items: flex-start; background: var(--primary-50);
  border-radius: 12px; padding: .8rem 1rem; margin-bottom: .7rem;
}
.mi-label { font-weight: 700; color: var(--primary-800); font-size: .85rem; white-space: nowrap; }
.mi-value { font-size: .9rem; color: var(--ink); }
.modal-call {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--primary-700); color: #fff; text-decoration: none;
  border-radius: 12px; padding: .8rem 1rem; font-weight: 700; font-size: .95rem;
}
.modal-call:hover { background: var(--primary-800); }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; }
  .site-footer .foot-grid { grid-template-columns: 1fr 1fr; }
  .complaint-layout { grid-template-columns: 1fr; }
  .contact-cards { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .main-nav {
    display: none; position: absolute; top: 74px; left: 0; right: 0;
    background: #fff; flex-direction: column; align-items: flex-start; padding: 1rem 4%;
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow); gap: .4rem;
  }
  .main-nav.open { display: flex; }
  .nav-toggle { display: block; margin-left: auto; }
  .lang-switch { display: none; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .hero .container { padding: 3rem 0 3.5rem; }
  .site-footer .foot-grid { grid-template-columns: 1fr; gap: 1.8rem; }
  .cta-band { padding: 2rem 1.4rem; }
  .topbar .tb-right { display: none; }
}

/* ---------- Galeri ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.gallery-item { padding: 0; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; }
.gallery-thumb {
  height: 210px; background: linear-gradient(135deg, var(--primary-700), var(--primary-600));
  display: grid; place-items: center; color: #fff; font-size: 2.4rem; overflow: hidden;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-cap { padding: 1rem 1.15rem 1.15rem; }
.gallery-cap h3 { font-size: 1rem; margin-bottom: .2rem; }
.gallery-cap .gallery-cat { font-size: .78rem; color: var(--primary-700); font-weight: 600; }

/* ---------- Berita ---------- */
.news-list { display: flex; flex-direction: column; gap: 1.2rem; }
.news-card { padding: 0; overflow: hidden; cursor: pointer; display: flex; align-items: stretch; }
.news-thumb {
  flex: 0 0 220px; min-height: 150px; background: linear-gradient(135deg, var(--primary-700), var(--primary-600));
  display: grid; place-items: center; color: #fff; font-size: 2.4rem; overflow: hidden;
}
.news-thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-body { padding: 1.2rem 1.4rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.news-body .meta { font-size: .78rem; color: var(--muted); }
.news-body h3 { font-size: 1.08rem; line-height: 1.4; }
.news-body p { color: var(--muted); font-size: .9rem; }
.news-body .more { margin-top: auto; color: var(--primary-700); font-weight: 600; font-size: .88rem; }

/* ---------- Modal lebar (galeri & berita) ---------- */
.modal-wide { max-width: 640px; }
.modal-wide .modal-photo { max-height: 420px; }
.modal-article { color: var(--ink); font-size: .95rem; text-align: left; line-height: 1.75; }

/* ---------- Responsive galeri & berita ---------- */
@media (max-width: 1020px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .news-card { flex-direction: column; }
  .news-thumb { flex: none; height: 200px; }
}
@media (max-width: 760px) {
  .gallery-grid { grid-template-columns: 1fr; }
}
