/*
Theme Name: RejoSmart
Theme URI: https://example.com/rejosmart
Author: Tim RejoSmart
Description: Tema layanan digital Desa Kumpulrejo. Satu halaman bergaya Image Collage Split Section dengan transisi antar halaman.
Version: 2.0.0
Requires at least: 5.8
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: rejosmart
*/

/* ===== Dasar ===== */
html { scroll-behavior: auto; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; width: 100%; }
body { overflow-x: hidden; background: #f9f9ff; overscroll-behavior: none; }
::-webkit-scrollbar { display: none; }
img { max-width: 100%; }
h1, h2, h3 { overflow-wrap: anywhere; }
a, button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #006591; outline-offset: 2px; border-radius: .5rem; }
main { padding-top: 4rem; padding-bottom: 5rem; }

/* ===== Navbar atas & menu bawah (ponsel) ===== */
.rs-top { position: fixed; inset: 0 0 auto 0; z-index: 40; padding-top: env(safe-area-inset-top, 0px);
  background: rgba(249,249,255,.88); backdrop-filter: blur(16px); box-shadow: 0 1px 8px rgba(0,0,0,.05); }
.rs-top-in { height: 4rem; max-width: 1280px; margin: auto; padding: 0 1rem; display: flex; align-items: center; gap: 1rem; }
.rs-brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: #111c2d; }
.rs-brand img { height: 2rem; width: auto; }
.rs-brand b { display: block; font: 700 1.125rem/1.1 "Plus Jakarta Sans", sans-serif; color: #006c49; }
.rs-brand small { font-size: .75rem; color: #3c4a42; }
.rs-links { display: none; margin-left: auto; gap: .25rem; }
.rs-links a { padding: .5rem 1.1rem; border-radius: 9999px; font-weight: 600; font-size: .875rem; color: #3c4a42; text-decoration: none; transition: background .2s, color .2s; }
.rs-links a:hover { background: #dee8ff; }
.rs-links a.is-active { background: #006c49; color: #fff; }
.rs-actions { margin-left: auto; display: flex; gap: .25rem; }
.rs-ic { width: 2.75rem; height: 2.75rem; border: 0; border-radius: 9999px; background: none; display: grid; place-items: center; cursor: pointer; color: #3c4a42; }
.rs-ic:hover { background: #dee8ff; }
.rs-ic img { width: 2rem; height: 2rem; border-radius: 9999px; object-fit: cover; }
.rs-bottom { position: fixed; inset: auto 0 0 0; z-index: 40; display: flex; padding: .25rem .25rem env(safe-area-inset-bottom, 0px);
  background: rgba(249,249,255,.94); backdrop-filter: blur(16px); box-shadow: 0 -2px 12px rgba(15,41,34,.06); }
.rs-bottom a { flex: 1; min-width: 0; min-height: 3rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font: 600 .66rem/1 Inter, sans-serif; color: #3c4a42; text-decoration: none; }
.rs-bottom a.is-active { color: #006c49; }
.rs-bottom a.is-active .material-symbols-outlined { font-variation-settings: 'FILL' 1; }

/* ===== Hero split ===== */
.rs-section { scroll-margin-top: 4rem; }
.rs-hero { max-width: 1280px; margin: auto; padding: 1.5rem 1rem 2.5rem; display: grid; gap: 2rem; align-items: center; }
.rs-copy h1 { font: 800 clamp(2.25rem, 7vw, 4rem)/1.05 "Plus Jakarta Sans", sans-serif; letter-spacing: -.02em; color: #111c2d; margin: 0 0 .75rem; }
.rs-lead { font: 600 1.125rem/1.5 "Plus Jakarta Sans", sans-serif; color: #006c49; margin: 0 0 .6rem; }
.rs-copy p { color: #3c4a42; line-height: 1.7; max-width: 34rem; margin: 0; }
.rs-chips { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 1.25rem 0; }
.rs-chips li { display: flex; align-items: center; gap: .4rem; padding: .4rem .8rem; border-radius: 9999px; background: #fff; font-weight: 600; font-size: .8rem; box-shadow: 0 2px 8px rgba(17,28,45,.08); }
.rs-chips .material-symbols-outlined { font-size: 18px; color: #006c49; }
.rs-cta { display: flex; flex-wrap: wrap; gap: .75rem; }
.rs-btn { display: inline-flex; align-items: center; gap: .4rem; height: 3rem; padding: 0 1.4rem; border-radius: 9999px; background: #006c49; color: #fff;
  font-weight: 600; text-decoration: none; box-shadow: 0 4px 14px rgba(0,108,73,.3); transition: transform .15s, background .2s; }
.rs-btn:hover { background: #005236; } .rs-btn:active { transform: scale(.97); }
.rs-btn.ghost { background: #fff; color: #006c49; box-shadow: inset 0 0 0 2px #006c49; } .rs-btn.ghost:hover { background: #6ffbbe; }

/* ===== Kolase gambar ===== */
.rs-collage { display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(6, 1fr); gap: .6rem; aspect-ratio: 1; width: 100%; max-width: 34rem; }
.rs-collage img, .rs-tile { width: 100%; height: 100%; min-height: 0; box-shadow: 0 8px 24px rgba(17,28,45,.14); }
.rs-collage img { object-fit: cover; display: block; }
.c1 { grid-area: 1/1/5/4; border-radius: 2rem 2rem 2rem .5rem; }
.c2 { grid-area: 1/4/3/7; border-radius: .5rem 2rem .5rem 2rem; }
.c3 { grid-area: 3/4/5/7; border-radius: 2rem .5rem 2rem .5rem; }
.c4 { grid-area: 5/1/7/5; border-radius: 1rem 1rem 2rem 1rem; }
.rs-tile { grid-area: 5/5/7/7; border-radius: 1.5rem; background: linear-gradient(135deg, #006c49, #10b981); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: .4rem; gap: .1rem; }
.rs-tile.blue { background: linear-gradient(135deg, #006591, #39b8fd); }
.rs-tile b { font: 800 clamp(.95rem, 3.4vw, 1.4rem)/1 "Plus Jakarta Sans", sans-serif; }
.rs-tile small { font-size: .68rem; opacity: .92; line-height: 1.1; }

/* ===== Beranda (kartu) & section split ===== */
.rs-home { max-width: 1280px; margin: auto; padding: 0 1rem 2rem; }
.rs-grid { display: flex; flex-direction: column; gap: 1rem; }
.rs-inner { max-width: 1280px; margin: auto; padding: 2.5rem 1rem; }
.rs-split.alt { background: #f0f3ff; }
.rs-side { display: grid; gap: 1rem; margin-bottom: 1.5rem; }
.rs-side .rs-collage { aspect-ratio: 16/10; max-width: none; }
.rs-sidecopy h2 { font: 800 1.75rem/1.15 "Plus Jakarta Sans", sans-serif; margin: 0 0 .4rem; color: #111c2d; }
.rs-sidecopy p { margin: 0; color: #3c4a42; line-height: 1.6; }
.rs-body .px-margin, .rs-body .px-gutter { padding-left: 0; padding-right: 0; }
.rs-foot { text-align: center; padding: 1.5rem 1rem 2rem; color: #3c4a42; font-size: .8rem; background: #fff; }

/* ===== Transisi halaman (wipe) & kemunculan konten ===== */
.rs-wipe { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; pointer-events: none; transform: translateY(100%);
  background: linear-gradient(135deg, #006c49, #10b981 55%, #39b8fd); color: #fff; font: 800 1.5rem "Plus Jakarta Sans", sans-serif; }
.rs-wipe.in { transform: none; transition: transform .4s cubic-bezier(.7,0,.3,1); }
.rs-wipe.out { transform: translateY(-100%); transition: transform .4s cubic-bezier(.7,0,.3,1); }
.rs-js .rs-reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.rs-js .rs-reveal.rs-in { opacity: 1; transform: none; }
.rs-js .rs-collage img, .rs-js .rs-tile { opacity: 0; transform: scale(.92); }
.rs-js .rs-in .rs-collage img, .rs-js .rs-in .rs-tile { opacity: 1; transform: none; transition: opacity .6s, transform .6s; }
.rs-in .c2 { transition-delay: .1s !important; } .rs-in .c3 { transition-delay: .2s !important; }
.rs-in .c4 { transition-delay: .3s !important; } .rs-in .rs-tile { transition-delay: .4s !important; }

/* Toast bersama */
.rs-toast { position: fixed; left: 50%; bottom: 5.5rem; transform: translate(-50%, .5rem); z-index: 80; max-width: 90vw; text-align: center;
  padding: .6rem 1rem; border-radius: 9999px; background: #263143; color: #ecf1ff; font: 600 .75rem/1rem Inter, system-ui, sans-serif;
  box-shadow: 0 8px 24px rgba(0,0,0,.2); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.rs-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== Tablet ===== */
@media (min-width: 768px) { .rs-toast { bottom: 2rem; } .rs-hero, .rs-inner, .rs-home { padding-left: 1.5rem; padding-right: 1.5rem; } }

/* ===== Desktop: kolase kiri/kanan berselang-seling ===== */
@media (min-width: 1024px) {
  main { padding-bottom: 0; }
  .rs-links { display: flex; } .rs-actions { margin-left: 0; } .rs-bottom { display: none; }
  .rs-hero { grid-template-columns: 1fr 1fr; min-height: calc(100vh - 4rem); padding: 2rem 2rem 3rem; gap: 4rem; }
  .rs-visual { justify-self: end; width: 100%; max-width: min(36rem, calc(100vh - 8rem)); }
  .rs-home { padding: 0 2rem 3rem; }
  .rs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .rs-grid > :nth-child(1), .rs-grid > :nth-child(2), .rs-grid > :nth-child(8) { grid-column: 1 / -1; }
  .rs-inner { padding: 5rem 2rem; }
  .rs-split .rs-inner { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 4rem; align-items: start; }
  .rs-split.rev .rs-inner { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .rs-split.rev .rs-side { order: 2; }
  .rs-side { position: sticky; top: 6rem; margin: 0; }
  .rs-side .rs-collage { aspect-ratio: 1; max-width: min(100%, calc(100vh - 17rem)); }
}
@media (max-width: 359px) { .rs-bottom a { font-size: .6rem; } }

/* ===== Admin bar WordPress ===== */
body.admin-bar .rs-top { top: 32px; }
@media (min-width: 1024px) { body.admin-bar .rs-side { top: calc(6rem + 32px); } }
@media (max-width: 782px) { body.admin-bar .rs-top { top: 46px; } }
@media (max-width: 600px) { body.admin-bar .rs-top { top: 0; } }

/* ===== Aksesibilitas gerak ===== */
@media (prefers-reduced-motion: reduce) {
  .rs-js .rs-reveal, .rs-js .rs-collage img, .rs-js .rs-tile { opacity: 1 !important; transform: none !important; transition: none !important; }
  .rs-wipe { display: none; }
}
