/* ============================================================
   KINGDOM — Community Inspiration Gallery
   Builds on kingdom.css + home.css tokens.
   ============================================================ */

/* ---------- Page intro ---------- */
.gal-intro {
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(200,161,90,0.07), transparent 60%),
    var(--ivory);
  padding: 112px 0 56px;
  text-align: center;
}
.gal-intro .wrap { max-width: 760px; }
.gal-intro .eyebrow { display: block; }
.gal-intro h1 {
  font-size: clamp(38px, 4.6vw, 64px);
  line-height: 1.06;
  margin-top: 16px;
}
.gal-intro .lede {
  margin: 22px auto 0;
  max-width: 600px;
  color: var(--charcoal);
  font-size: 18px;
}
.gal-stats {
  display: flex;
  justify-content: center;
  gap: 0;
  margin-top: 38px;
  flex-wrap: wrap;
}
.gal-stat { text-align: center; padding: 0 36px; }
.gal-stat:not(:first-child) { border-left: 1px solid var(--line); }
.gal-stat b {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 30px;
  color: var(--emerald);
  line-height: 1;
}
.gal-stat span {
  display: block;
  margin-top: 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-text);
}

/* ---------- Toolbar (filters + sort) ---------- */
.gal-toolbar {
  position: sticky;
  top: var(--hdr-h, 96px);
  z-index: 40;
  background: rgba(247,242,236,0.86);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.gal-toolbar-inner {
  display: flex;
  align-items: flex-start;
  gap: 14px 22px;
  padding-top: 16px;
  padding-bottom: 16px;
  flex-wrap: wrap;
}
.gal-filters {
  display: flex;
  align-items: center;
  gap: 12px 20px;
  flex: 1 1 540px;
  min-width: 0;
  flex-wrap: wrap;
}
.gal-fgroup { display: flex; align-items: center; gap: 10px 8px; flex: 1 1 auto; min-width: 0; flex-wrap: wrap; }
.gal-fgroup > .gal-flabel {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--charcoal);
  opacity: .65;
  margin-right: 2px;
}
.gal-chip {
  flex: 0 0 auto;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  color: var(--charcoal);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 7px 15px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.gal-chip:hover { border-color: var(--gold); color: var(--gold-deep); }
.gal-chip.active {
  background: var(--emerald);
  border-color: var(--emerald);
  color: var(--gold-soft);
}
.gal-divider { width: 1px; height: 26px; background: var(--line); flex: 0 0 auto; align-self: center; }

.gal-sort { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; margin-left: auto; }
.gal-sort label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--charcoal);
  opacity: .65;
}
.gal-select {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--emerald);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 34px 8px 13px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23A8823F' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}
.gal-select:hover { border-color: var(--gold); }

/* ---------- Grid ---------- */
.gal-section { padding: 44px 0 100px; background: var(--ivory); }
.gal-count {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-text);
  margin-bottom: 26px;
}
.gal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
}
.gal-empty {
  display: none;
  text-align: center;
  padding: 80px 0;
  color: var(--charcoal);
}
.gal-empty h3 { font-size: 26px; margin-bottom: 10px; }

/* ---------- Card ---------- */
.g-card {
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s ease;
  opacity: 0;
  transform: translateY(14px);
}
.g-card.in { opacity: 1; transform: none; }
.g-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.g-media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--beige-soft);
}
.g-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform-origin: var(--zx, 50%) var(--zy, 50%);
  transition: transform .5s cubic-bezier(.2,.7,.2,1), transform-origin .25s ease-out;
}
.g-card:hover .g-media img { transform: scale(1.12); }

/* love button overlay */
.g-love {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px 0 10px;
  border: none;
  border-radius: 100px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 3px 12px rgba(15,31,27,0.14);
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--ink);
  backdrop-filter: blur(4px);
  transition: transform .18s ease, background .2s ease;
}
.g-love:hover { transform: scale(1.06); }
.g-love:active { transform: scale(.94); }
.g-love svg { width: 17px; height: 17px; display: block; transition: transform .2s ease; }
.g-love .heart-o { stroke: #8a8480; fill: none; stroke-width: 1.7; }
.g-love .heart-f { display: none; fill: #C0392B; }
.g-love.loved .heart-o { display: none; }
.g-love.loved .heart-f { display: block; }
.g-love.loved { color: #C0392B; }
.g-love.pop svg { animation: lovePop .42s cubic-bezier(.2,.8,.2,1); }
@keyframes lovePop {
  0% { transform: scale(1); }
  35% { transform: scale(1.42); }
  60% { transform: scale(.86); }
  100% { transform: scale(1); }
}

.g-info { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.g-info h3 { font-size: 19px; line-height: 1.2; }
.g-spec { font-size: 12.5px; color: var(--charcoal); letter-spacing: 0.01em; }
.g-by {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11.5px;
  color: var(--charcoal);
}
.g-ava {
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--beige); color: var(--emerald);
  font-weight: 700; font-size: 9.5px; letter-spacing: 0.02em;
  flex: 0 0 auto;
}
.g-by .dot { opacity: .45; }

/* estimasi harga — dihitung dari rumus, bukan angka tetap */
.g-price {
  margin-top: 12px;
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
  color: var(--emerald);
}
.g-price-k { font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--charcoal); opacity: .75; }
.g-price b { font-family: var(--serif); font-size: 18px; font-weight: 500; letter-spacing: 0.01em; }
.g-price-u { font-size: 11.5px; color: var(--charcoal); }

.g-modal-price {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(200,161,90,0.06);
}
.g-modal-price b { display: block; font-family: var(--serif); font-size: 22px; font-weight: 500; color: var(--emerald); letter-spacing: 0.01em; }
.g-ladder{list-style:none;margin:12px 0 0;padding:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.g-ladder li{display:flex;flex-direction:column;gap:2px;padding:8px 10px;border:1px solid var(--line);border-radius:4px;background:#fff}
.g-ladder em{font-style:normal;font-size:10.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--charcoal)}
.g-ladder i{font-style:normal;font-family:var(--serif);font-size:16px;color:var(--emerald)}
.g-modal-price span { display: block; margin-top: 6px; font-size: 11.5px; line-height: 1.6; color: var(--charcoal); }

/* load-more */
.gal-more { text-align: center; margin-top: 56px; }

/* ---------- Detail modal ---------- */
.g-modal[hidden] { display: none; }
.g-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.g-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10,23,20,0.62);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .3s ease;
}
.g-modal.open .g-modal-backdrop { opacity: 1; }
.g-modal-card {
  position: relative;
  z-index: 1;
  width: min(940px, 100%);
  max-height: 90vh;
  overflow: hidden;
  background: var(--ivory-warm);
  border-radius: 14px;
  box-shadow: 0 40px 100px rgba(10,23,20,0.5);
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  grid-template-rows: minmax(0, 1fr);
  transform: translateY(18px) scale(.98);
  opacity: 0;
  transition: transform .34s cubic-bezier(.2,.7,.2,1), opacity .34s ease;
}
.g-modal.open .g-modal-card { transform: none; opacity: 1; }
.g-modal-media {
  position: relative;
  background: #fff;
  min-height: 380px;
  overflow: hidden;
}
.g-modal-media img {
  width: 100%; height: 100%; object-fit: contain; display: block;
  transform-origin: var(--zx, 50%) var(--zy, 50%);
  transition: transform .4s cubic-bezier(.2,.7,.2,1), transform-origin .18s ease-out;
}
.g-modal-media.zoomable { cursor: zoom-in; }
.g-modal-media.zoomable:hover img,
.g-modal-media.zoomed img { transform: scale(1.8); }
.g-modal-media.zoomed { cursor: zoom-out; }
.g-zoom-hint {
  position: absolute;
  left: 14px; bottom: 14px;
  z-index: 3;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px;
  border-radius: 100px;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 3px 12px rgba(15,31,27,0.16);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--emerald);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.g-zoom-hint svg { width: 14px; height: 14px; stroke: var(--gold-deep); fill: none; stroke-width: 1.8; stroke-linecap: round; }
.g-modal-media:hover .g-zoom-hint,
.g-modal-media.zoomed .g-zoom-hint { opacity: 0; transform: translateY(6px); }
.g-modal-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 38px; height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 3px 12px rgba(15,31,27,0.18);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  z-index: 3;
  transition: transform .18s ease;
}
.g-modal-close:hover { transform: rotate(90deg); }
.g-modal-close svg { width: 18px; height: 18px; stroke: var(--emerald); }

.g-modal-body {
  padding: 40px 40px 36px;
  overflow-y: auto;
  min-height: 0;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.g-modal-body .eyebrow { margin-bottom: 12px; }
.g-modal-body h2 { font-size: 30px; line-height: 1.12; }
/* Spesifikasi dipecah per keping jadi chip — satu baris kapital panjang terlalu sulit dibaca. */
.g-modal-spec { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.g-modal-spec span { font-size: 12px; font-weight: 700; letter-spacing: 0.02em; color: #8A6A24; border: 1px solid rgba(200,161,90,0.45); background: rgba(200,161,90,0.07); border-radius: 100px; padding: 7px 14px; }
.g-modal-spec span.sp-metal { color: var(--gold-soft); background: var(--emerald); border-color: var(--emerald); }
.g-modal-desc { margin-top: 16px; font-family: var(--serif-2, Georgia, serif); font-style: italic; font-size: 19px; line-height: 1.5; color: var(--emerald); text-wrap: pretty; }
.g-modal-meta {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.g-modal-loves {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: 14px;
  color: #C0392B;
}
.g-modal-loves svg { width: 19px; height: 19px; fill: #C0392B; }

.g-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.g-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-deep);
  border: 1px solid var(--line-gold);
  border-radius: 100px;
  padding: 6px 13px;
}
.g-modal-actions { margin-top: auto; padding-top: 30px; display: flex; flex-direction: column; gap: 12px; }
.g-modal-actions .btn { width: 100%; }
.g-modal-note {
  margin-top: 16px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--charcoal);
  opacity: .8;
  display: flex;
  gap: 8px;
}
.g-modal-note svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 2px; stroke: var(--gold); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .gal-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 880px) {
  .g-modal-card { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); max-height: 92vh; }
  .g-modal-media { min-height: 220px; max-height: 38vh; }
  .g-modal-body { max-height: none; }
}
@media (max-width: 760px) {
  .gal-grid { grid-template-columns: repeat(2, 1fr); }
  .gal-intro { padding: 56px 0 44px; }
  .gal-chip { padding: 12px 17px; }
  .g-love { height: 40px; padding: 0 14px 0 12px; }
  .gal-stat { padding: 0 26px; }  /* Filters stack as full-width groups whose chips wrap — no horizontal overflow,
     no collision with the screen edge. Bar is non-sticky here so height is fine. */
  /* Mobile: big header scrolls away; a slim glass filter bar pins in its place */
  .site-header { position: static; }
  .gal-toolbar { position: sticky; top: 0; z-index: 45; background: rgba(247,242,236,0.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
  .gal-toolbar-inner { flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 10px; padding-top: 11px; padding-bottom: 11px; }
  .gal-filters { flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 8px; padding: 2px 2px; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 22px), transparent); }
  .gal-filters::-webkit-scrollbar { display: none; }
  .gal-fgroup { flex: 0 0 auto; flex-wrap: nowrap; align-items: center; gap: 8px; }
  .gal-fgroup > .gal-flabel { display: none; }
  .gal-divider { display: none; }
  .gal-sort { flex: 0 0 auto; margin-left: 2px; gap: 0; padding-left: 12px; border-left: 1px solid var(--line); }
  .gal-sort label { display: none; }
  .gal-select { flex: 0 0 auto; min-width: 0; padding: 9px 30px 9px 13px; font-size: 12.5px; }
  .gal-chip { padding: 11px 16px; }
  .g-info h3 { font-size: 17px; }
}
@media (max-width: 460px) {
  .gal-intro { padding: 34px 0 36px; }
  .gal-grid { grid-template-columns: 1fr; gap: 18px; }
  .g-info { padding: 18px 18px 18px; }
  .g-info h3 { font-size: 21px; }
  .g-spec { font-size: 12.5px; }
  .g-by { font-size: 12px; }
  .g-modal-body { padding: 26px 22px 24px; }
  .g-modal-body h2 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .g-card { opacity: 1; transform: none; transition: none; }
  .g-media img, .g-card, .g-love svg, .g-modal-media img { transition: none; }
  .g-love.pop svg { animation: none; }
}


/* ---------- Pinterest board (official widget) ---------- */
.gal-pin { padding: 0 0 96px; background: var(--ivory); text-align: center; }
.gal-pin .wrap { max-width: 1120px; }
.gal-pin::before { content: ""; display: block; width: 100%; max-width: 1120px; height: 1px; margin: 0 auto 64px; background: var(--line); }
.gal-pin .eyebrow { display: block; }
.gal-pin h2 { font-size: clamp(28px, 3vw, 40px); line-height: 1.12; margin-top: 14px; }
.gal-pin-lede { margin: 18px auto 0; max-width: 560px; font-size: 15px; line-height: 1.75; color: var(--charcoal); }
.gal-pin-embed { margin-top: 40px; min-height: 60px; display: flex; justify-content: center; max-width: 100%; overflow-x: hidden; }
.gal-pin-embed iframe { max-width: 100%; }
.gal-pin-embed span[data-pin-href],
.gal-pin-embed > span { max-width: 100%; }
.gal-pin-fallback { margin-top: 28px; font-size: 14px; }
.gal-pin-fallback a { color: var(--gold-text); border-bottom: 1px solid var(--line-gold); padding-bottom: 2px; }
.gal-pin-fallback a:hover { color: var(--gold-deep); border-color: var(--gold); }
@media (max-width: 760px) {
  .gal-pin { padding-bottom: 68px; }
  .gal-pin::before { margin-bottom: 46px; }
  .gal-pin-embed { margin-top: 30px; }
}

/* ---- Library CAD "Siap Dikustom" ---- */
.g-badge-lib{background:rgba(15,31,27,.82);color:#F7F2EC}
.g-lmetals{display:inline-flex;gap:6px;align-items:center}
.g-lm{width:16px;height:16px;border-radius:50%;border:1px solid rgba(15,31,27,.18);padding:0;cursor:pointer;box-shadow:inset 0 1px 2px rgba(255,255,255,.5)}
.g-lm.on{outline:1.5px solid #B8902F;outline-offset:2px}
.g-lm-R{background:linear-gradient(135deg,#f1c9b6,#d99c83)}.g-lm-W{background:linear-gradient(135deg,#f4f5f6,#c9ccd0)}.g-lm-Y{background:linear-gradient(135deg,#f3dc9c,#d4ae55)}.g-lm-P{background:linear-gradient(135deg,#e9ebee,#b7bcc3)}.g-lm-X{background:#e8e2d8}
.g-lmetals-m{margin-left:6px}
.g-lmetals-m .g-lm{width:22px;height:22px}
