/* ============================================================================
   /apps/sinaubumi — halaman embed peta Sinau Bumi. Tema hijau-kuning sama
   dengan homepage kementan.web.id.
   ========================================================================== */

:root {
    --brand-900: #081C15;
    --brand-700: #1B4332;
    --brand-600: #2D6A4F;
    --brand-100: #D8F3DC;
    --agri-yellow: #E9C46A;

    --background: hsl(210 17% 98%);
    --foreground: hsl(150 59% 7%);
    --muted-foreground: hsl(152 12% 35%);
    --border: hsl(214 14% 89%);

    --font-heading: 'Cabinet Grotesk', 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
    --font-sans: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;

    --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-sans);
    color: var(--foreground);
    background: var(--background);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2 { font-family: var(--font-heading); letter-spacing: -.01em; margin: 0; line-height: 1.2; }
a { color: inherit; text-decoration: none; }

/* ---------------------------------------------------------------- Topbar --- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, .88);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.topbar__inner {
    max-width: 80rem;
    margin-inline: auto;
    padding: .7rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

@media (min-width: 1024px) { .topbar__inner { padding-inline: 1.5rem; } }

.brand { display: flex; align-items: center; gap: .625rem; min-width: 0; }

.brand__logo {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius);
    background: var(--brand-700);
}
.brand__logo svg { width: 1.25rem; height: 1.25rem; color: var(--agri-yellow); }

.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-family: var(--font-heading); font-weight: 800; font-size: 1.02rem; color: var(--brand-900); }
.brand__sub { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-foreground); }

.crumbs { display: none; align-items: center; gap: .5rem; font-size: .85rem; color: var(--muted-foreground); }
.crumbs a:hover { color: var(--brand-700); }
.crumbs__current { color: var(--brand-900); font-weight: 600; }
@media (min-width: 640px) { .crumbs { display: flex; } }

/* ------------------------------------------------------------------ Page --- */
.page {
    flex: 1;
    width: 100%;
    max-width: 80rem;
    margin-inline: auto;
    padding: 1.75rem 1rem 2.5rem;
}
@media (min-width: 1024px) { .page { padding-inline: 1.5rem; } }

.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    padding: .25rem .6rem;
    border-radius: 6px;
    background: rgba(216, 243, 220, .7);
    color: var(--brand-700);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.hero__title { margin-top: .6rem; font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; color: var(--brand-900); }
.hero__lead { margin: .7rem 0 0; max-width: 52rem; color: var(--muted-foreground); }

/* ------------------------------------------------------------------ Tabs --- */
.maps { margin-top: 1.75rem; }

.tabs {
    display: flex;
    gap: .5rem;
    overflow-x: auto;
    padding-bottom: .5rem;
    scrollbar-width: thin;
}

.tabs::-webkit-scrollbar { height: 6px; }
.tabs::-webkit-scrollbar-thumb { background: rgba(45, 106, 79, .3); border-radius: 999px; }

.tab {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .1rem;
    min-width: 8.5rem;
    padding: .6rem .9rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: border-color .2s ease, background-color .2s ease, transform .15s ease, box-shadow .2s ease;
}

.tab:hover { border-color: var(--brand-600); transform: translateY(-1px); }

.tab__abbr {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1rem;
    color: var(--brand-900);
}

.tab__name { font-size: .72rem; color: var(--muted-foreground); }

.tab.is-active {
    background: var(--brand-700);
    border-color: var(--brand-700);
    box-shadow: 0 10px 24px -14px rgba(8, 28, 21, .6);
}
.tab.is-active .tab__abbr { color: var(--agri-yellow); }
.tab.is-active .tab__name { color: rgba(255, 255, 255, .85); }

/* ---------------------------------------------------------------- Panels --- */
.panel {
    margin-top: 1rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 8px 30px -20px rgba(8, 28, 21, .5);
}

.panel__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 1.1rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.panel__desc { margin: 0; font-size: .88rem; color: var(--muted-foreground); flex: 1; min-width: 16rem; }
.panel__desc strong { color: var(--brand-900); }

.btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: .6rem 1.1rem;
    font-family: var(--font-sans);
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .2s ease, color .2s ease;
}
.btn svg { width: 1rem; height: 1rem; }

.btn-outline-dark {
    background: #fff;
    color: var(--brand-700);
    border-color: var(--brand-600);
}
.btn-outline-dark:hover { background: var(--brand-700); color: var(--agri-yellow); }

/* Iframe AWS: lebar penuh, tinggi lega. */
.frame-wrap {
    position: relative;
    width: 100%;
    height: 72vh;
    min-height: 480px;
    background: #eef3ee;
}

.frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    position: relative;
    z-index: 1;
    opacity: 0;
    transition: opacity .4s ease;
}

/* Selama iframe memuat, peta disembunyikan dan loader tampil. */
.frame-wrap.is-ready .frame { opacity: 1; }

.frame-loader {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: linear-gradient(160deg, #f2f7f2, #e3efe6);
    color: var(--muted-foreground);
    transition: opacity .4s ease, visibility .4s ease;
}

.frame-wrap.is-ready .frame-loader {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Spinner cincin berputar. */
.frame-loader__spinner {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    border: 3px solid rgba(45, 106, 79, .18);
    border-top-color: var(--brand-700);
    animation: frame-spin .8s linear infinite;
}

.frame-loader__text {
    font-size: .88rem;
    font-weight: 600;
    letter-spacing: .02em;
}

/* Bar progres tipis di bawah spinner (animasi tak tentu). */
.frame-loader__bar {
    position: relative;
    width: 10rem;
    height: 4px;
    border-radius: 999px;
    background: rgba(45, 106, 79, .15);
    overflow: hidden;
}

.frame-loader__bar::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 40%;
    border-radius: 999px;
    background: var(--agri-yellow);
    animation: frame-slide 1.2s ease-in-out infinite;
}

@keyframes frame-spin {
    to { transform: rotate(360deg); }
}

@keyframes frame-slide {
    0%   { left: -40%; }
    100% { left: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .frame-loader__spinner { animation-duration: 2.5s; }
    .frame-loader__bar::after { animation: none; left: 30%; }
}

/* Notice untuk peta yang tidak bisa di-embed. */
.notice {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 2.5rem 1.5rem;
    min-height: 320px;
    justify-content: center;
    text-align: left;
}

.notice__icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 999px;
    background: rgba(233, 196, 106, .25);
    color: #8B6D1B;
}
.notice__icon svg { width: 1.4rem; height: 1.4rem; }

.notice p { margin: 0; max-width: 32rem; color: var(--muted-foreground); }

/* ------------------------------------------------------------------ Foot --- */
.foot { border-top: 1px solid var(--border); background: #fff; }

.foot__inner {
    max-width: 80rem;
    margin-inline: auto;
    padding: 1.2rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.5rem;
    justify-content: space-between;
    font-size: .8rem;
    color: var(--muted-foreground);
}
@media (min-width: 1024px) { .foot__inner { padding-inline: 1.5rem; } }

/* -------------------------------------------------------------- Mobile --- */
@media (max-width: 640px) {
    .frame-wrap { height: 70vh; min-height: 420px; }
    .panel__bar { padding: .8rem .9rem; }
    .btn { width: 100%; justify-content: center; }
}
