/* ================= CSS VARIABLES ================= */
:root{
  --brand: #8b5a2b;
  --brand-dark: #6f4722;

  --text: #2b2b2b;
  --muted: #777;

  --bg: #ffffff;
  --surface: #fafafa;

  --line: #eee;
  --radius: 14px;

  --header-h: 70px;
}

/* ================= VISIBILITY HELPERS ================= */
[hidden]{ display:none !important; }
.img-btn[hidden],
.modal-action[hidden]{ display:none !important; }

/* ================= GLOBAL RESET ================= */
*,
*::before,
*::after{ margin:0; padding:0; box-sizing:border-box; }

html{
  scroll-behavior:smooth;
  scroll-padding-top: calc(var(--header-h) + 10px);
}

body{
  font-family:'Montserrat',sans-serif;
  color:var(--text);
  background:var(--bg);
}

img{ max-width:100%; display:block; }

/* Aksesibilitas: fokus keyboard */
a:focus-visible,
button:focus-visible{
  outline:3px solid rgba(139, 90, 43, .55);
  outline-offset:3px;
  border-radius:10px;
}

/* fokus untuk card gallery (karena ada tabindex) */
.gallery-item:focus-visible{
  outline:3px solid rgba(139, 90, 43, .35);
  outline-offset:4px;
}

/* Skip link */
.skip-link{
  position:absolute;
  left:12px; top:12px;
  padding:10px 12px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:10px;
  transform: translateY(-150%);
  transition: transform .2s ease;
  z-index:2000;
}
.skip-link:focus{ transform: translateY(0); }

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *{ transition:none !important; }
}

/* ================= HEADER ================= */
header{
  position:fixed;
  top:0; left:0;
  width:100%;
  height:var(--header-h);
  background: rgba(255,255,255,.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom:1px solid var(--line);
  z-index:1000;
}

/* ✅ HERO MODE: navbar transparan polos (tanpa blur) */
body.has-hero header:not(.is-scrolled),
header.is-hero{
  background: transparent !important;
  border-bottom: 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
}

/* ✅ Saat scroll: balik solid */
header.is-scrolled{
  background: rgba(255,255,255,.95);
  border-bottom:1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* warna teks/icon saat hero (supaya kontras) */
body.has-hero header:not(.is-scrolled) .logo span,
header.is-hero .logo span{ color:#fff; }

body.has-hero header:not(.is-scrolled) .menu a,
header.is-hero .menu a{ color:#fff; }

body.has-hero header:not(.is-scrolled) .menu a:hover,
header.is-hero .menu a:hover{ opacity:.85; }

body.has-hero header:not(.is-scrolled) .hamburger span,
header.is-hero .hamburger span{ background:#fff; }

/* balik normal saat scrolled */
header.is-scrolled .logo span{ color: var(--brand); }
header.is-scrolled .menu a{ color: var(--text); }
header.is-scrolled .menu a:hover{ color: var(--brand); }
header.is-scrolled .hamburger span{ background: var(--text); }

.navbar{
  max-width:1200px;
  height:100%;
  margin:auto;
  padding:0 20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}

/* ================= LOGO ================= */
.logo{
  display:flex;
  align-items:center;
  gap:10px;
  line-height:1;
  text-decoration:none;
}
.logo img{ width:34px; height:34px; }

.logo span{
  font-family:'Playfair Display',serif;
  font-size:22px;
  font-weight:700;
  letter-spacing:1px;
  color:var(--brand);
}

/* ================= TOP LINK (KEMBALI) ================= */
.top-link{
  text-decoration:none;
  font-weight:700;
  color:var(--brand);
  padding:10px 14px;
  border-radius:999px;
  border:1px solid rgba(139, 90, 43, .25);
  background:#fff;
  transition:.2s;
  white-space:nowrap;
}
.top-link:hover{
  background: rgba(139, 90, 43, .08);
  border-color: rgba(139, 90, 43, .45);
}

/* ================= MENU DESKTOP ================= */
.menu{
  display:flex;
  gap:25px;
}

.menu a{
  text-decoration:none;
  font-weight:500;
  color:var(--text);
  transition:.3s;
}
.menu a:hover{ color:var(--brand); }

/* ================= HAMBURGER ================= */
.hamburger{
  display:none;
  width:25px;
  height:20px;
  position:relative;
  cursor:pointer;
  background:transparent;
  border:0;
  padding:0;
}

.hamburger span{
  position:absolute;
  width:100%;
  height:3px;
  background:var(--text);
  border-radius:3px;
  transition:.3s;
}

.hamburger span:nth-child(1){ top:0; }
.hamburger span:nth-child(2){ top:8px; }
.hamburger span:nth-child(3){ top:16px; }

.hamburger.active span:nth-child(1){
  top:8px;
  transform:rotate(45deg);
}
.hamburger.active span:nth-child(2){ opacity:0; }
.hamburger.active span:nth-child(3){
  top:8px;
  transform:rotate(-45deg);
}

/* ================= HERO ================= */
.hero{
  margin-top: 0;
  min-height: 100vh;
  padding: calc(var(--header-h) + 40px) 20px 40px;
  background:
    linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)),
    url("images/Bg.webp");
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
}

.hero-content{ max-width:800px; }

.hero-content h1{
  font-family:'Playfair Display',serif;
  font-size: clamp(28px, 5vw, 52px);
  margin-bottom:20px;
  font-weight:600;
}

.hero-content p{
  font-size: clamp(14px, 2.5vw, 20px);
  margin-bottom:30px;
}

.btn{
  display:inline-block;
  padding:14px 30px;
  background:var(--brand);
  color:#fff;
  text-decoration:none;
  border-radius:30px;
  font-weight:500;
  transition:.3s;
}
.btn:hover{ background:var(--brand-dark); }

/* ================= SECTION ================= */
section{
  padding:90px 20px;
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.container{
  max-width:1200px;
  margin:auto;
}

.center{ text-align:center; }

section h2,
.section-title{
  font-family:'Playfair Display',serif;
  font-size: clamp(24px, 4vw, 36px);
  text-align:center;
  margin-bottom:18px;
  color:var(--brand);
}

.section-subtitle{
  font-size:15px;
  color:var(--muted);
  margin-bottom:20px;
  text-align:center;
}

/* ================= CARDS ================= */
.cards{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap:25px;
}

.card{
  padding:30px;
  background:var(--surface);
  border-radius:var(--radius);
  transition:.3s;
}
.card:hover{ transform: translateY(-5px); }

/* ================= GALLERY FILTER/TABS ================= */
.gallery-filter{
  display:flex;
  justify-content:center;
  gap:12px;
  margin:10px 0 28px;
  flex-wrap:wrap;
}

.filter-btn{
  appearance:none;
  border:1px solid rgba(139, 90, 43, .25);
  background:#fff;
  color:var(--brand);
  padding:10px 16px;
  border-radius:999px;
  font-weight:600;
  cursor:pointer;
  transition: transform .12s ease, background .2s ease, border-color .2s ease, color .2s ease;
}
.filter-btn:hover{
  border-color: rgba(139, 90, 43, .45);
  transform: translateY(-1px);
}
.filter-btn.is-active{
  background:var(--brand);
  border-color:var(--brand);
  color:#fff;
}

/* animasi panel */
@keyframes fadeUp{
  from{ opacity:0; transform: translateY(8px); }
  to{ opacity:1; transform: translateY(0); }
}
.gallery:not([hidden]){ animation: fadeUp .22s ease; }

/* ================= GALERI GRID ================= */
.gallery{
  display:grid;
  gap:20px;
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px){
  .gallery{
    grid-template-columns: repeat(2, 1fr);
    gap:15px;
  }
}

.gallery-item{
  position:relative;
  width:100%;
  aspect-ratio: 1 / 1;
  overflow:hidden;
  border-radius:16px;
  cursor:pointer;
}

/* zoom image */
.gallery-item img{
  width:100%;
  height:100%;
  object-fit:cover;
  transition: transform .4s ease;
}
.gallery-item:hover img{ transform: scale(1.05); }

/* label motif */
.motif-label{
  position:absolute;
  left:10px;
  right:10px;
  bottom:10px;
  padding:10px 12px;
  border-radius:12px;
  color:#fff;
  font-weight:700;
  font-size:14px;
  line-height:1.2;
  background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,.18));
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  text-align:center;
  letter-spacing:.2px;
  z-index: 5;
  pointer-events:none;
}

@media (max-width: 430px){
  .motif-label{ font-size:13px; padding:9px 10px; }
}

/* ================= BUTTON MORE ================= */
.more-wrap{
  grid-column: 1 / -1;
  display:flex;
  justify-content:center;
  margin-top:8px;
}

.more-btn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:10px 18px;
  border-radius:999px;
  border:1px solid rgba(139, 90, 43, .25);
  background:#fff;
  color:var(--brand);
  font-weight:700;
  text-decoration:none;
  transition: transform .12s ease, background .2s ease, border-color .2s ease;
}
.more-btn::after{ content:"→"; font-size:1.05em; }
.more-btn:hover{
  background: rgba(139, 90, 43, .08);
  border-color: rgba(139, 90, 43, .45);
  transform: translateY(-1px);
}

/* ================= FOOTER ================= */
footer{
  background:#1f1f1f;
  color:#aaa;
  text-align:center;
  padding:25px;
  font-size:14px;
}

/* ================= MOBILE NAV ================= */
@media (max-width: 768px){
  .hamburger{ display:block; margin-right:12px; }
  .logo span{ font-size:18px; }
  .hero{ background-position:center 20%; }

  /* ✅ Hilangkan garis pemisah di mobile (yang kamu lingkari) */
  header{ border-bottom: 0 !important; box-shadow:none !important; }

  .menu{
    position:absolute;
    top:var(--header-h);
    left:0;
    width:100%;
    flex-direction:column;
    align-items:center;
    gap:20px;

    /* default tertutup */
    max-height:0;
    overflow:hidden;
    transition: max-height .4s ease, padding .4s ease;

    /* ✅ dropdown glass */
    background: rgba(255,255,255,.14);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 0;
  }

  .menu.active{
    max-height:400px;
    padding:20px 0;
    box-shadow: 0 18px 50px rgba(0,0,0,.18);
  }

  /* teks menu biar selalu kebaca */
  .menu a{
    font-weight:600;
    color: var(--text);
  }

  /* kalau lagi di hero (header transparan), teks menu putih biar kontras */
  body.has-hero header:not(.is-scrolled) .menu a,
  header.is-hero .menu a{
    color:#fff;
  }
}

@media (max-width: 430px){
  :root{ --header-h:60px; }
  .logo img{ width:28px; height:28px; }
  .logo span{ font-size:16px; }
  .gallery{ gap:12px; }
}

/* =========================================================
   PREMIUM OVERLAY (Preview / Shopee / TikTok)
   ========================================================= */
.img-overlay{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;

  background: rgba(0,0,0,.35);
  opacity:0;
  pointer-events:none;
  transform: translateY(6px);
  transition: opacity .18s ease, transform .18s ease;
  z-index: 20;
}

.gallery-item:hover .img-overlay,
.gallery-item:focus-within .img-overlay{
  opacity:1;
  pointer-events:auto;
  transform:none;
}

/* ✅ MOBILE TAP MODE: overlay tampil kalau .gallery-item punya class is-open */
.gallery-item.is-open .img-overlay{
  opacity:1;
  pointer-events:auto;
  transform:none;
}

.img-actions{
  width: min(78%, 300px);
  display:grid;
  gap:12px;
}

.img-btn{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;

  min-height:46px;        /* desktop */
  padding:12px 18px;
  border-radius:999px;

  font: inherit;
  font-weight:700;
  line-height:1;
  letter-spacing:.2px;

  border:1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.88);
  color: var(--brand);
  text-decoration:none;
  cursor:pointer;

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 10px 26px rgba(0,0,0,.22),
    inset 0 1px 0 rgba(255,255,255,.55);

  transition: transform .12s ease, filter .12s ease, background .18s ease, border-color .18s ease;
}

button.img-btn{
  appearance:none;
  -webkit-appearance:none;
}

.img-btn.primary{
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color:#fff;
  border-color: rgba(255,255,255,.08);
  box-shadow:
    0 14px 32px rgba(0,0,0,.28),
    inset 0 1px 0 rgba(255,255,255,.22);
}

.img-btn:hover{
  transform: translateY(-1px);
  filter: brightness(1.02);
}
.img-btn:active{
  transform: translateY(0);
  filter: brightness(.98);
}
.img-btn:focus-visible{
  outline: 3px solid rgba(255,255,255,.65);
  outline-offset: 3px;
}

/* ✅ MOBILE: tombol overlay tinggi 40px */
@media (max-width: 768px){
  .img-actions{
    width: min(68%, 260px);
    gap:10px;
  }
  .img-btn{
    min-height:40px;      /* sesuai request kamu */
    padding:10px 14px;
    font-size:14px;
  }
}

@media (max-width: 430px){
  .img-actions{ width: min(64%, 240px); }
  .img-btn{
    min-height:40px;      /* tetap 40 */
    padding:9px 12px;
    font-size:13px;
  }
}

/* =========================================================
   MODAL / LIGHTBOX
   ========================================================= */
body.modal-open{ overflow:hidden; }

.modal{
  position:fixed;
  inset:0;
  z-index:6000;
  display:none;
}
.modal.open{ display:block; }

.modal-backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.80);
}

.modal-dialog{
  position:relative;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
}

.modal-figure{
  position:relative;
  width: min(1100px, 92vw);
  max-height:88vh;
  margin:0;
  border-radius:18px;
  overflow:hidden;
  background:#0b0b0b;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  display:flex;
  align-items:center;
  justify-content:center;
}

.modal-image{
  width:100%;
  height:auto;
  max-height:88vh;
  object-fit:contain;
  display:block;
  background:#000;
}

.modal-caption{
  position:absolute;
  left:0; right:0; bottom:0;
  padding:14px 16px;
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:12px;
  color:#fff;
  background: linear-gradient(to top, rgba(0,0,0,.70), rgba(0,0,0,0));
}

.modal-meta{
  display:flex;
  flex-direction:column;
  gap:4px;
  font-weight:700;
}

.modal-title{ opacity:.95; }
.modal-count{ opacity:.85; }

.modal-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.modal-action{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:9px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.28);
  background: rgba(0,0,0,.25);
  color:#fff;
  text-decoration:none;
  font-weight:700;
}
.modal-action:hover{ background: rgba(0,0,0,.40); }

.modal-close{
  position:absolute;
  top:14px;
  right:16px;
  z-index:10;
  width:44px;
  height:44px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.35);
  color:#fff;
  font-size:26px;
  line-height:1;
  cursor:pointer;
}

.modal-nav{
  position:absolute;
  top:50%;
  transform: translateY(-50%);
  z-index:10;
  width:48px;
  height:48px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.35);
  color:#fff;
  font-size:30px;
  cursor:pointer;
}
.modal-prev{ left:14px; }
.modal-next{ right:14px; }

@media (max-width: 430px){
  .modal-nav{ width:44px; height:44px; }
  .modal-close{ width:42px; height:42px; }
  .modal-caption{ padding:12px 12px; }
}