/*
Theme Name: Mitra Sanjaya Properti
Theme URI: https://mitrasanjayaproperti.com/
Author: Mitra Sanjaya Properti
Description: Tema blok ringan untuk portal perumahan Mitra Sanjaya Properti. Cepat, mobile-first dan SEO friendly.
Version: 1.2.3
Requires at least: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: mitra-sanjaya
*/

/* ===== Dasar ===== */
html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }
img { height: auto; }
a { text-underline-offset: 3px; }
:where(.wp-site-blocks) > * { margin-block-start: 0; }
.screen-reader-text:focus { clip: auto; }

/* ===== Header ===== */
.msp-topbar { font-size: 13px; }
.msp-topbar a { color: inherit; text-decoration: none; }
.msp-header { position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 14px rgba(36,65,104,.08); }
.msp-header .wp-block-site-title a { text-decoration: none; }
.msp-header .wp-block-site-logo img { border-radius: 10px; }
.msp-header .wp-block-navigation a { font-weight: 500; }
.msp-header .wp-block-navigation a:hover { color: var(--wp--preset--color--gold); }
.msp-header .wp-block-navigation__responsive-container.is-menu-open { padding: 24px; }

/* ===== Tombol ===== */
.wp-block-button__link { transition: transform .15s ease, box-shadow .15s ease; }
.wp-block-button__link:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.is-style-wa .wp-block-button__link { background: #25D366 !important; color: #fff !important; }
.is-style-wa .wp-block-button__link::before { content: ""; display: inline-block; width: 18px; height: 18px; margin-right: 8px; vertical-align: -3px; background: currentColor; -webkit-mask: var(--msp-wa-icon) center/contain no-repeat; mask: var(--msp-wa-icon) center/contain no-repeat; }
:root { --msp-wa-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M16 3C8.8 3 3 8.8 3 16c0 2.3.6 4.5 1.7 6.5L3 29l6.7-1.7c1.9 1 4.1 1.6 6.3 1.6 7.2 0 13-5.8 13-13S23.2 3 16 3zm0 23.6c-2 0-3.9-.5-5.6-1.5l-.4-.2-4 1 1.1-3.9-.3-.4C5.8 20 5.3 18 5.3 16 5.3 10.1 10.1 5.3 16 5.3S26.7 10.1 26.7 16 21.9 26.6 16 26.6zm5.9-8c-.3-.2-1.9-.9-2.2-1-.3-.1-.5-.2-.7.2-.2.3-.8 1-1 1.2-.2.2-.4.2-.7.1-.3-.2-1.4-.5-2.6-1.6-1-.9-1.6-1.9-1.8-2.2-.2-.3 0-.5.1-.7l.5-.6c.2-.2.2-.3.3-.6.1-.2 0-.4 0-.6l-1-2.4c-.3-.6-.5-.5-.7-.5h-.6c-.2 0-.6.1-.9.4-.3.3-1.2 1.1-1.2 2.8s1.2 3.2 1.4 3.5c.2.2 2.4 3.6 5.7 5 .8.3 1.4.5 1.9.7.8.3 1.5.2 2.1.1.6-.1 1.9-.8 2.2-1.5.3-.7.3-1.4.2-1.5-.1-.2-.3-.3-.6-.4z'/%3E%3C/svg%3E"); }

/* ===== Hero ===== */
.msp-hero { position: relative; overflow: hidden; }
.msp-hero h1 { text-wrap: balance; }
.msp-hero .msp-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.msp-chip { display: inline-block; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25); font-size: 14px; font-weight: 500; }
.msp-chip.gold { background: var(--wp--preset--color--gold); color: var(--wp--preset--color--navy); border-color: transparent; }

/* ===== Kotak pencarian cepat ===== */
.msp-search { box-shadow: 0 18px 40px rgba(36,65,104,.18); }
.msp-search .wp-block-buttons { gap: 8px; }
.msp-search .wp-block-button__link { font-size: 14px; }

/* ===== Kartu listing ===== */
.msp-grid { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.msp-grid > * { margin: 0 !important; }
.msp-card { background: #fff; border: 1px solid #E5E9F0; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .2s ease; height: 100%; }
.msp-card:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(36,65,104,.14); }
.msp-card .msp-card-img { margin: 0; position: relative; aspect-ratio: 4/3; overflow: hidden; background: #EEF2F7; }
.msp-card .msp-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.msp-card .msp-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.msp-card h3 { margin: 0; font-size: 18px; line-height: 1.35; }
.msp-card h3 a { color: var(--wp--preset--color--navy); text-decoration: none; }
.msp-card h3 a:hover { color: var(--wp--preset--color--gold-dark); }
.msp-loc { color: #5B6675; font-size: 14px; margin: 0; }
.msp-loc::before { content: "📍 "; }
.msp-price { font-size: 20px; font-weight: 700; color: var(--wp--preset--color--navy); margin: 4px 0 0; }
.msp-price small { font-size: 13px; font-weight: 500; color: #5B6675; }
.msp-specs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 0; padding: 0; list-style: none; }
.msp-specs li { font-size: 12.5px; background: #F2F5F9; color: #33404F; padding: 4px 9px; border-radius: 6px; }
.msp-card .wp-block-buttons { margin-top: auto; padding-top: 10px; }
.msp-card .wp-block-button { flex: 1; }
.msp-card .wp-block-button__link { width: 100%; font-size: 14px; padding: 10px 12px; }
.msp-tag { position: absolute; top: 12px; left: 12px; z-index: 2; padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: .02em; color: #fff; background: var(--wp--preset--color--navy); }
.msp-tag.subsidi { background: #0E9F6E; }
.msp-tag.komersial { background: #7C3AED; }
.msp-tag.ready { background: #E02424; }
.msp-tag.soon { background: #5B6675; }
.msp-num { position: absolute; top: 12px; right: 12px; z-index: 2; background: rgba(36,65,104,.85); color: #fff; font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 6px; }

/* ===== Fitur / keunggulan ===== */
.msp-feature { background: #fff; border-radius: 14px; border: 1px solid #E5E9F0; height: 100%; }
.msp-feature .msp-ico { font-size: 30px; line-height: 1; margin: 0; }
.msp-feature h3 { font-size: 17px; margin: 10px 0 6px; }
.msp-feature p { font-size: 15px; color: #4B5563; margin: 0; }

/* ===== Halaman detail proyek ===== */
.msp-crumb { font-size: 13.5px; color: #5B6675; }
.msp-crumb a { color: inherit; }
.msp-gallery .wp-block-image img { border-radius: 12px; aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.msp-gallery.wp-block-gallery { gap: 12px; }
.msp-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.msp-fact { background: #F6F8FB; border-radius: 12px; padding: 14px 16px; }
.msp-fact span { display: block; font-size: 12.5px; color: #5B6675; }
.msp-fact strong { display: block; font-size: 17px; color: var(--wp--preset--color--navy); margin-top: 2px; }
.msp-sticky { position: sticky; top: 96px; }
.msp-box { background: #fff; border: 1px solid #E5E9F0; border-radius: 16px; box-shadow: 0 10px 30px rgba(36,65,104,.08); }
.msp-check { list-style: none; padding-left: 0; }
.msp-check li { padding-left: 28px; position: relative; margin-bottom: 8px; }
.msp-check li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: #E7F7EF; color: #0E9F6E; font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.msp-table table { border-collapse: collapse; width: 100%; }
.msp-table td, .msp-table th { border: 1px solid #E5E9F0; padding: 10px 12px; }
.msp-table thead th { background: var(--wp--preset--color--navy); color: #fff; text-align: left; }
.msp-table tbody tr:nth-child(even) td { background: #F8FAFC; }
.msp-map iframe { width: 100%; height: 340px; border: 0; border-radius: 14px; }

/* ===== FAQ ===== */
.wp-block-details { background: #fff; border: 1px solid #E5E9F0; border-radius: 12px; padding: 14px 18px; }
.wp-block-details + .wp-block-details { margin-top: 10px; }
.wp-block-details summary { font-weight: 600; cursor: pointer; color: var(--wp--preset--color--navy); }
.wp-block-details[open] summary { margin-bottom: 8px; }

/* ===== Kalkulator KPR ===== */
.msp-kpr { background: #fff; border: 1px solid #E5E9F0; border-radius: 16px; padding: 24px; box-shadow: 0 10px 30px rgba(36,65,104,.08); }
.msp-kpr label { display: block; font-weight: 600; font-size: 14px; margin: 14px 0 6px; color: var(--wp--preset--color--navy); }
.msp-kpr input, .msp-kpr select { width: 100%; padding: 12px 14px; border: 1px solid #CBD5E1; border-radius: 10px; font: inherit; box-sizing: border-box; }
.msp-kpr .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.msp-kpr .out { margin-top: 20px; padding: 18px; border-radius: 12px; background: var(--wp--preset--color--navy); color: #fff; }
.msp-kpr .out b { display: block; font-size: 30px; color: var(--wp--preset--color--gold); }
.msp-kpr small { color: #5B6675; }

/* ===== Footer ===== */
.msp-footer a { color: #fff; text-decoration: none; opacity: .9; }
.msp-footer a:hover { color: var(--wp--preset--color--gold); opacity: 1; }
.msp-footer ul { list-style: none; padding: 0; margin: 0; }
.msp-footer li { margin-bottom: 8px; }
.msp-social { display: flex; gap: 10px; flex-wrap: wrap; }
.msp-social a { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.1); }
.msp-social svg { width: 20px; height: 20px; fill: #fff; }

/* ===== Tombol WhatsApp melayang ===== */
.msp-wa-float { position: fixed; right: 18px; bottom: 18px; z-index: 99; display: flex; align-items: center; gap: 8px; background: #25D366; color: #fff !important; text-decoration: none; padding: 12px 18px 12px 14px; border-radius: 999px; font-weight: 600; font-size: 15px; box-shadow: 0 10px 25px rgba(37,211,102,.45); }
.msp-wa-float svg { width: 26px; height: 26px; fill: #fff; }
.msp-wa-float:hover { transform: translateY(-2px); }
@media (max-width: 600px) { .msp-wa-float span { display: none; } .msp-wa-float { padding: 14px; } }

/* ===== Mobile ===== */
@media (max-width: 781px) {
  .msp-sticky { position: static; }
  .msp-kpr .row { grid-template-columns: 1fr; }
  .msp-hide-mobile { display: none !important; }
}

/* ===== v1.0.2: komponen portal ===== */
.msp-lead { font-size: clamp(16px, 1.6vw, 19px); opacity: .92; max-width: 720px; }
.msp-sub { color: var(--wp--preset--color--muted); margin-top: -8px; }
.msp-home-hero h1 { color: #fff; max-width: 900px; margin: 14px 0 12px; }
.msp-page-hero h1 { margin: 6px 0 12px; font-size: clamp(26px, 3.6vw, 40px); }
.msp-page-hero .msp-chip { background: #fff; border-color: #E5E9F0; color: var(--wp--preset--color--navy); }
.msp-page-hero .msp-chip.gold { background: var(--wp--preset--color--gold); border-color: transparent; }
.msp-home-hero { background-image: radial-gradient(1200px 400px at 85% -10%, rgba(247,181,42,.18), transparent 60%), linear-gradient(135deg, #244168 0%, #172B47 100%); }
.msp-home-hero .is-style-outline .wp-block-button__link { color: #fff; border-color: #fff; }
.msp-search { background: #fff; color: var(--wp--preset--color--text); border-radius: 18px; padding: 20px 22px; margin-top: 34px; }
.msp-search-title { font-weight: 700; color: var(--wp--preset--color--navy); margin: 0 0 12px; }
.msp-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.msp-quick a { padding: 9px 14px; border: 1px solid #DCE3EC; border-radius: 999px; text-decoration: none; font-size: 14px; font-weight: 500; color: var(--wp--preset--color--navy); background: #F6F8FB; }
.msp-quick a:hover { background: var(--wp--preset--color--gold); border-color: transparent; color: var(--wp--preset--color--navy-dark); }
.msp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid #E5E9F0; }
.msp-stats div { text-align: center; }
.msp-stats b { display: block; font-size: 22px; color: var(--wp--preset--color--navy); }
.msp-stats span { font-size: 12.5px; color: var(--wp--preset--color--muted); }
a.msp-card-img { display: block; }
.msp-card-cta { display: flex; gap: 8px; margin-top: auto; padding-top: 12px; }
.msp-btn { display: inline-flex; justify-content: center; align-items: center; gap: 6px; flex: 1; padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 14px; text-decoration: none; background: var(--wp--preset--color--navy); color: #fff !important; transition: transform .15s ease, box-shadow .15s ease; }
.msp-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.14); }
.msp-btn.wa { background: #25D366; }
.msp-btn.ghost { background: transparent; color: var(--wp--preset--color--navy) !important; border: 1.5px solid #CBD5E1; }
.msp-btn.block { display: flex; width: 100%; margin-top: 10px; padding: 13px 14px; box-sizing: border-box; }
.msp-box-label { margin: 0; font-size: 13px; color: var(--wp--preset--color--muted); }
.msp-price.big { font-size: 28px; margin: 0 0 4px; }
.msp-dev { font-size: 12.5px; color: var(--wp--preset--color--muted); margin: 12px 0 0; }
.msp-note { font-size: 13px; color: var(--wp--preset--color--muted); margin-top: 6px; }
.msp-main-img img { border-radius: 16px; width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.msp-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.msp-features .msp-feature { padding: 22px; }
.msp-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; counter-reset: s; }
.msp-step { background: #fff; border: 1px solid #E5E9F0; border-radius: 14px; padding: 22px; }
.msp-step b { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--wp--preset--color--gold); color: var(--wp--preset--color--navy-dark); font-size: 18px; }
.msp-step h3 { font-size: 17px; margin: 12px 0 6px; }
.msp-step p { margin: 0; font-size: 15px; color: #4B5563; }
.msp-cta-band { background-image: linear-gradient(135deg, #244168 0%, #172B47 100%); }
.msp-cta-band h2 { color: #fff; }
.msp-cta-band .is-style-outline .wp-block-button__link { color: #fff; border-color: #fff; background: transparent; }
.msp-crumb { margin-bottom: 4px; }
.msp-crumb a { text-decoration: none; }
@media (max-width: 781px) { .msp-stats { grid-template-columns: repeat(2, 1fr); } .msp-search { margin-top: 24px; } }

/* ===== v1.0.3: perbaikan warna & perataan hero ===== */
.has-white-color { color: #fff !important; }
.has-white-color p, .has-white-color li, .msp-topbar p, .msp-topbar a { color: inherit; }
.msp-topbar p { margin: 0; }
.msp-home-hero .msp-lead, .msp-home-hero h1 { margin-left: max(0px, calc((100% - 1200px) / 2)) !important; margin-right: auto !important; }
.msp-home-hero .msp-lead { color: rgba(255,255,255,.9); }
.msp-gallery.wp-block-gallery.has-nested-images figure.wp-block-image { flex-grow: 0 !important; width: calc((100% - 24px) / 3) !important; }
.msp-gallery.wp-block-gallery.has-nested-images figure.wp-block-image img { aspect-ratio: 4/3; object-fit: cover; height: auto; }
@media (max-width: 600px) { .msp-gallery.wp-block-gallery.has-nested-images figure.wp-block-image { width: calc((100% - 12px) / 2) !important; } }
.msp-sticky { top: 110px; }

/* ===== v1.0.4: halaman lokasi & SEO ===== */
a.msp-loccard { display: block; text-decoration: none; color: inherit; transition: transform .2s ease, box-shadow .2s ease; }
a.msp-loccard:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(36,65,104,.12); }
a.msp-loccard h3 { margin-top: 0; color: var(--wp--preset--color--navy); }
a.msp-loccard span { display: inline-block; margin-top: 10px; font-weight: 600; color: var(--wp--preset--color--gold-dark); }
.msp-seo-text { max-width: 900px; margin: 28px auto 0 !important; text-align: center; color: #4B5563; font-size: 15.5px; }
.msp-lead-dark { font-size: clamp(16px, 1.5vw, 18px); color: #374151; max-width: 860px; }
.msp-ol { padding-left: 22px; }
.msp-ol li { margin-bottom: 8px; }
.msp-page-hero .msp-btns { margin-top: 8px; }


/* === Hero: foto rumah bulat + latar rumah transparan === */
.msp-home-hero{
  background-image:
    linear-gradient(100deg, rgba(23,43,71,.94) 0%, rgba(23,43,71,.84) 45%, rgba(36,65,104,.6) 100%),
    url(assets/img/hero-bg.webp);
  background-size: cover; background-position: center 60%;
}
.msp-home-hero > *{ position: relative; z-index: 1; }
.msp-home-hero::after{
  content:""; position:absolute; z-index:0;
  top: 64px; right: max(32px, calc((100% - 1200px) / 2));
  width: 380px; aspect-ratio: 1/1; border-radius: 50%;
  background: url(assets/img/hero-rumah.webp) center/cover no-repeat;
  border: 8px solid #F7B52A;
  box-shadow: 0 0 0 14px rgba(255,255,255,.14), 0 25px 60px rgba(0,0,0,.45);
}
.msp-home-hero::before{
  content:"Rumah Siap Huni"; position:absolute; z-index:2;
  top: 78px; right: calc(max(32px, calc((100% - 1200px) / 2)) + 250px);
  background:#F7B52A; color:#172B47; font-weight:700; font-size:15px;
  padding:8px 18px; border-radius:999px; box-shadow:0 8px 20px rgba(0,0,0,.3);
}
@media (min-width: 1000px){
  .msp-home-hero h1{ max-width: min(720px, calc(100% - 460px)) !important; }
  .msp-home-hero .msp-lead{ max-width: min(640px, calc(100% - 460px)) !important; }
}
@media (max-width: 1180px) and (min-width: 1000px){
  .msp-home-hero::after{ width: 300px; top: 80px; }
  .msp-home-hero::before{ top: 86px; right: calc(max(32px, calc((100% - 1200px) / 2)) + 190px); }
  .msp-home-hero h1{ max-width: calc(100% - 360px) !important; }
  .msp-home-hero .msp-lead{ max-width: calc(100% - 360px) !important; }
}
@media (max-width: 999px){
  .msp-home-hero::after, .msp-home-hero::before{ display:none; }
}

/* === HP: link lokasi jadi 1 baris geser (swipe), tidak memanjang ke bawah === */
@media (max-width: 781px) {
	.msp-quick { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; gap: 6px; padding: 2px 20px 8px 0; margin-right: -20px; scrollbar-width: none; }
	.msp-quick::-webkit-scrollbar { display: none; }
	.msp-quick a { flex: 0 0 auto; white-space: nowrap; scroll-snap-align: start; font-size: 13px; padding: 8px 12px; }
	.msp-quick { -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); }
}
