/* =========================================================
   DATABASE FLORA & FAUNA EKOTEOLOGI NUSANTARA — CSS (scoped: .eff-scope)
   ========================================================= */

.eff-scope {
    --eff-green-950: #0c1f16;
    --eff-green-900: #10281c;
    --eff-green-800: #163a27;
    --eff-green-700: #1f5236;
    --eff-green-600: #2c6e48;
    --eff-green-500: #3d8f5f;
    --eff-clay: #c97b4a;
    --eff-clay-light: #f2e2cf;
    --eff-sand-50: #fbf8f2;
    --eff-sand-100: #f4efe3;
    --eff-ink: #16201a;
    --eff-ink-soft: #4a564d;
    --eff-radius: 18px;
    --eff-radius-sm: 12px;
    --eff-shadow: 0 10px 30px -12px rgba(12, 31, 22, .22);
    --eff-shadow-lg: 0 24px 50px -18px rgba(12, 31, 22, .32);
    --font-display: 'Fraunces', serif;
    --font-body: 'Manrope', sans-serif;

    display: block;
    font-family: var(--font-body);
    color: var(--eff-ink);
    line-height: 1.6;
    background: var(--eff-sand-50);
    padding: 56px 0;
    -webkit-font-smoothing: antialiased;
}
.eff-scope * { box-sizing: border-box; }
.eff-scope img { max-width: 100%; display: block; }
.eff-scope h1, .eff-scope h2, .eff-scope h3, .eff-scope h4 { font-family: var(--font-display); color: var(--eff-green-950); margin: 0 0 .4em; line-height: 1.2; }
.eff-scope p { margin: 0 0 1em; }
.eff-scope button { font-family: inherit; cursor: pointer; }

.eff-wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.eff-section-head { text-align: center; max-width: 700px; margin: 0 auto 34px; }
.eff-section-tag {
    display: inline-block; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    color: var(--eff-green-600); background: rgba(61,143,95,.1); padding: 6px 14px; border-radius: 999px; margin-bottom: 14px;
}
.eff-section-head h2 { font-size: clamp(24px, 3.4vw, 36px); }
.eff-section-head p { color: var(--eff-ink-soft); font-size: 15.5px; }

/* ---------- TOOLBAR ---------- */
.eff-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
    background: #fff; border-radius: var(--eff-radius); padding: 18px 22px;
    box-shadow: var(--eff-shadow); margin-bottom: 20px;
}
.eff-search { display: flex; align-items: center; gap: 10px; flex: 1 1 260px; background: var(--eff-sand-50); border: 1.5px solid rgba(12,31,22,.08); border-radius: 999px; padding: 10px 18px; }
.eff-search__icon { opacity: .6; }
.eff-search input { border: none; background: transparent; outline: none; font-family: inherit; font-size: 14.5px; width: 100%; }

.eff-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.eff-chip {
    font-size: 13px; font-weight: 700; padding: 8px 16px; border-radius: 999px; cursor: pointer;
    background: var(--eff-sand-100); color: var(--eff-green-800); transition: all .2s ease; user-select: none;
}
.eff-chip:hover { background: rgba(61,143,95,.18); }
.eff-chip.is-selected { background: var(--eff-green-600); color: #fff; }

.eff-count { font-size: 13px; font-weight: 700; color: var(--eff-ink-soft); margin-left: auto; white-space: nowrap; }

/* ---------- EXPORT BAR ---------- */
.eff-export-bar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 14px; margin-top: 36px; padding-top: 28px; border-top: 1px solid rgba(12,31,22,.08); }
.eff-export-bar__label { font-size: 13px; color: var(--eff-ink-soft); font-weight: 700; }
.eff-export-bar__buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.eff-add-bar { display: flex; justify-content: flex-end; margin-bottom: 18px; }
.eff-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; padding: 9px 18px; border-radius: 999px; border: 1.5px solid transparent; transition: transform .2s ease, background .2s ease, border-color .2s ease; white-space: nowrap; }
.eff-btn--outline { border-color: rgba(12,31,22,.18); color: var(--eff-green-800); background: #fff; }
.eff-btn--outline:hover { background: var(--eff-sand-100); border-color: var(--eff-green-500); transform: translateY(-2px); color: var(--eff-green-800); }
.eff-btn--add { background: var(--eff-clay); border-color: var(--eff-clay); color: #fff; font-size: 14px; padding: 10px 22px; box-shadow: 0 8px 18px -8px rgba(201,123,74,.6); }
.eff-btn--add:hover { background: #b56536; border-color: #b56536; transform: translateY(-2px); color: #fff; }

/* ---------- LOAD MORE (tombol "Lihat Semua") ---------- */
.eff-loadmore { display: flex; justify-content: center; margin-top: 28px; }
.eff-btn--loadmore { padding: 11px 28px; font-size: 14px; }

/* ---------- GRID / CARDS ---------- */
.eff-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.eff-empty { text-align: center; padding: 60px 20px; color: var(--eff-ink-soft); background: #fff; border-radius: var(--eff-radius); }

.eff-card {
    background: #fff; border-radius: var(--eff-radius); overflow: hidden; box-shadow: var(--eff-shadow);
    cursor: pointer; transition: transform .3s ease, box-shadow .3s ease; display: flex; flex-direction: column;
    opacity: 0; transform: translateY(20px); animation: eff-fade-up .5s ease forwards;
}
@keyframes eff-fade-up { to { opacity: 1; transform: translateY(0); } }
.eff-card:hover { transform: translateY(-7px); box-shadow: var(--eff-shadow-lg); }
.eff-card:focus-visible { outline: 3px solid var(--eff-green-500); outline-offset: 2px; }

.eff-card-media { aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--eff-green-700), var(--eff-green-500)); overflow: hidden; }
.eff-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.eff-card:hover .eff-card-media img { transform: scale(1.08); }
.eff-card-media .eff-emoji { font-size: 46px; }

.eff-card-body { padding: 18px 20px 22px; }
.eff-card-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.eff-card-tags span { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--eff-clay); background: var(--eff-clay-light); padding: 3px 9px; border-radius: 999px; }
.eff-card-title { font-size: 18.5px; margin: 0 0 2px; }
.eff-card-latin { font-style: italic; opacity: .65; margin: 0 0 8px; font-size: 13px; }
.eff-card-desc { font-size: 13.5px; color: var(--eff-ink-soft); margin: 0; }

/* ---------- MODAL (Panel Info Detail) ---------- */
/* Catatan: .eff-modal dipindahkan ke document.body lewat JS (lihat eff-page.js)
   supaya tidak terjebak di dalam stacking context elemen lain (mis. header
   sticky/transform milik tema), dan z-index dibuat setinggi mungkin agar
   popup selalu tampil DI ATAS header website, bukan tertimpa olehnya. */
.eff-modal {
    position: fixed; inset: 0; z-index: 2147483647; display: none;
    isolation: isolate;
}
.eff-modal.is-open { display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.eff-modal__overlay { position: fixed; inset: 0; background: rgba(12,31,22,.55); backdrop-filter: blur(3px); }
.eff-modal__panel {
    position: relative; width: 100%; max-width: 700px; background: #fff; border-radius: 20px;
    max-height: 88vh; overflow: hidden; box-shadow: 0 30px 70px rgba(0,0,0,.35); font-family: var(--font-body);
    animation: eff-modal-in .25s ease;
    display: flex; flex-direction: column;
}
@keyframes eff-modal-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.eff-modal__close {
    position: absolute; top: 18px; right: 18px; background: transparent; border: none;
    width: 32px; height: 32px; border-radius: 50%; cursor: pointer; color: #8a938d; z-index: 3;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s ease, color .2s ease;
}
.eff-modal__close:hover { background: rgba(12,31,22,.06); color: var(--eff-ink); }

/* Seluruh konten (avatar + teks) digulir bersama di dalam panel. */
.eff-modal__scroll { overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; }
.eff-modal__content { padding: 36px 36px 32px; }

/* Avatar/foto: persegi, sejajar (satu baris) dengan judul & nama latin —
   bukan lagi foto banner selebar panel. */
.eff-modal__header { display: flex; align-items: center; gap: 18px; padding-right: 28px; }
.eff-modal__avatar {
    flex: 0 0 auto; width: 76px; height: 76px; border-radius: 18px; overflow: hidden;
    background: var(--eff-sand-100); display: flex; align-items: center; justify-content: center;
}
.eff-modal__avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.eff-modal__avatar .eff-emoji { font-size: 44px; line-height: 1; }
.eff-modal__headtext h3 { margin: 0; font-size: 1.85rem; font-weight: 700; color: var(--eff-ink); line-height: 1.15; }
.eff-modal__latin { margin: 6px 0 0; font-style: italic; font-family: var(--font-body); color: var(--eff-ink-soft); font-size: 1.05rem; }

.eff-modal__tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; }
.eff-modal__tags span { font-size: .85rem; padding: 7px 16px; border-radius: 999px; background: var(--eff-sand-100); color: var(--eff-green-700); font-weight: 700; letter-spacing: .01em; }

.eff-modal__body { margin-top: 8px; display: grid; }
.eff-modal__block { padding: 22px 0; border-top: 1px solid rgba(12,31,22,.08); }
.eff-modal__block h4 {
    display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 1.15rem;
    color: var(--eff-green-700); font-family: var(--font-body); font-weight: 800;
}
.eff-modal__block h4 .eff-icon { font-size: 1rem; color: var(--eff-green-700); width: 1.1em; text-align: center; }
.eff-modal__block p { margin: 0; line-height: 1.7; color: var(--eff-ink); font-size: 1rem; }

@media (min-width: 700px) {
    .eff-modal__panel { max-height: 84vh; }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 960px) {
    .eff-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .eff-grid { grid-template-columns: 1fr; }
    .eff-toolbar { flex-direction: column; align-items: stretch; }
    .eff-count { margin-left: 0; }
    .eff-add-bar { justify-content: stretch; }
    .eff-add-bar .eff-btn--add { width: 100%; justify-content: center; }
    .eff-export-bar { flex-direction: column; }
    .eff-modal.is-open { padding: 0; }
    .eff-modal__panel { width: 100%; max-width: 100%; max-height: 100vh; height: 100%; border-radius: 0; }
    .eff-modal__content { padding: 30px 22px 26px; }
    .eff-modal__avatar { width: 64px; height: 64px; border-radius: 14px; }
    .eff-modal__headtext h3 { font-size: 1.5rem; }
}

/* ---------- PRINT (dipakai saat window.print() untuk ekspor PDF) ---------- */
@media print {
    body * { visibility: hidden; }
    .eff-print-table, .eff-print-table * { visibility: visible; }
    .eff-print-table { position: absolute; left: 0; top: 0; width: 100%; }
}
