/* KENANGA — Katalog Edisi 04
 * Konsep: katalog sebagai edisi cetak majalah.
 * Bukan landing page: tidak ada hero dua kolom, tidak ada marquee media,
 * tidak ada badge, tidak ada grid 4 kolom yang seragam.
 *
 * Palet: kertas hangat, tinta, plum pekat, oker. Terbatas dan tegas.
 */

:root {
  --paper: #f4f1ea;
  --paper-2: #eae5da;
  --ink: #1a1816;
  --ink-2: #4c4741;
  --ink-3: #7d766b;
  --line: #c9c2b4;
  --line-strong: #8b8477;
  --plum: #6b2533;
  --plum-deep: #4d1a25;
  --oker: #b58436;
  --oker-soft: #efe0c6;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Helvetica Neue", "Helvetica", Arial, sans-serif;

  --wrap: 1280px;
  --gut: 28px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
figure { margin: 0; }

:focus-visible { outline: 2px solid var(--plum); outline-offset: 2px; }
::selection { background: var(--plum); color: var(--paper); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
.kicker {
  font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase;
  font-weight: 700; color: var(--ink-3); margin: 0;
}
.rule-thin { border: 0; height: 1px; background: var(--line); margin: 0; }
.rule-double { border: 0; height: 5px; background: var(--ink); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); margin: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 0; top: -60px; z-index: 999;
  background: var(--ink); color: var(--paper); padding: 10px 18px;
  font-size: 12.5px; transition: top .2s;
}
.skip:focus { top: 0; }

/* ============ MASTHEAD ============ */
.masthead { padding-top: 18px; }
.mast-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding-bottom: 14px;
}
.brand {
  font-family: var(--serif); font-size: 27px; letter-spacing: .3em;
  text-transform: uppercase; line-height: 1;
}
.mast-nav { display: flex; gap: 22px; align-items: center; }
.mast-nav a {
  font-size: 12px; letter-spacing: .08em; color: var(--ink-2);
  padding-bottom: 2px; border-bottom: 1px solid transparent;
  transition: border-color .2s, color .2s;
}
.mast-nav a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.mast-wa {
  background: var(--plum); color: var(--paper) !important;
  padding: 8px 16px; border: 0; border-bottom: 1px solid var(--plum) !important;
}
.mast-wa:hover { background: var(--plum-deep); border-bottom-color: var(--plum-deep) !important; }
.mast-issue {
  display: flex; gap: 10px; align-items: center;
  font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 700; margin: 0 0 12px;
}
.mast-issue .dot { color: var(--line-strong); }

/* ============ HEADLINE ============ */
.headline { padding: 104px 0 88px; }
.headline h1 {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 7vw, 6rem);
  line-height: 1.02;
  letter-spacing: -.025em;
  font-weight: 400;
  margin: 20px 0 0;
  max-width: 16ch;
}
.headline h1 em {
  font-style: italic;
  color: var(--plum);
}
.headline-foot {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 48px; margin-top: 56px; flex-wrap: wrap;
}
.dek {
  margin: 0; font-size: 17px; color: var(--ink-2);
  max-width: 46ch; line-height: 1.6;
}
.arrow-link {
  font-size: 12.5px; letter-spacing: .08em; font-weight: 600;
  border-bottom: 1px solid var(--ink); padding-bottom: 3px;
  white-space: nowrap;
}
.arrow-link:hover { color: var(--plum); border-bottom-color: var(--plum); }

/* ============ PLATE ============ */
.plate { margin: 0; }
.plate img { width: 100%; height: auto; object-fit: cover; max-height: 62vh; }
.plate figcaption {
  font-size: 11px; letter-spacing: .1em; color: var(--ink-3);
  padding: 10px 0 14px; border-bottom: 1px solid var(--ink);
  font-style: italic; font-family: var(--serif);
}

/* ============ SECTION HEAD ============ */
.cat-head {
  display: flex; align-items: flex-start; gap: 24px;
  padding: 88px 0 40px;
}
.index-no {
  font-family: var(--sans); font-size: 13px; font-weight: 700;
  color: var(--plum); letter-spacing: .1em; padding-top: 12px;
}
.cat-head h2 {
  font-family: var(--serif);
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  font-weight: 400; line-height: 1.06; letter-spacing: -.02em;
  margin: 8px 0 0;
}

/* ============ KATALOG LAYOUT ============ */
.cat-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 56px;
  align-items: start;
  padding-bottom: 96px;
}

/* Indeks sidebar */
.index { position: sticky; top: 24px; }
.index-label {
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  font-weight: 700; color: var(--ink-3); margin: 0 0 12px;
  padding-bottom: 6px; border-bottom: 1px solid var(--ink);
}
.index ul { display: flex; flex-direction: column; gap: 2px; }
.index .sub li { margin-left: 0; }
.index a, .index .filter-item {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 13.5px; color: var(--ink-2); cursor: pointer;
  background: none; border: 0; padding: 4px 0; width: 100%;
  text-align: left; border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.index a:hover, .index .filter-item:hover { color: var(--ink); border-bottom-color: var(--line); }
.index .filter-item[aria-current="true"] {
  color: var(--plum); font-weight: 700; border-bottom-color: var(--plum);
}
.index .n { font-family: var(--serif); font-size: 13px; color: var(--ink-3); }
.index-foot { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); }
.sort-toggle {
  font-size: 12px; letter-spacing: .06em; color: var(--ink-2);
  cursor: pointer; margin: 0 0 10px; padding-bottom: 3px;
  border-bottom: 1px solid var(--line-strong); display: inline-block;
}
.sort-toggle:hover { color: var(--plum); border-bottom-color: var(--plum); }
.result {
  font-size: 12px; letter-spacing: .06em; color: var(--ink-3); margin: 0;
  font-family: var(--serif); font-style: italic;
}

/* ============ GRID ASIMETRIS ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  border-top: 1px solid var(--ink);
}
.item {
  position: relative;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 20px 20px 24px;
  cursor: pointer;
  background: var(--paper);
  text-align: left; width: 100%;
  transition: background .2s;
  animation: itemIn .45s both;
}
@keyframes itemIn { from { opacity: 0; transform: translateY(10px); } }
.item:hover { background: var(--paper-2); }
.item:nth-child(3n+1) { grid-column: span 2; }
.item:nth-child(3n+2) { grid-column: span 2; }
.item:nth-child(3n+3) { grid-column: span 2; }
/* offset setiap baris ke-2 untuk kesan tak rata */
.item:nth-child(6n+4), .item:nth-child(6n+5) { padding-top: 52px; }

.item-media {
  position: relative; overflow: hidden;
  background: var(--paper-2);
  margin-bottom: 16px;
}
.item:nth-child(3n+2) .item-media { aspect-ratio: 4 / 5; }
.item:nth-child(3n+1) .item-media, .item:nth-child(3n+3) .item-media { aspect-ratio: 1 / 1; }
.item-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .7s cubic-bezier(.22,.61,.36,1);
  filter: saturate(.92);
}
.item:hover .item-media img { transform: scale(1.04); filter: saturate(1.02); }
.item-media.loading::after {
  content: ""; position: absolute; inset: 0; background: var(--paper-2);
  background-image: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent);
  background-size: 200% 100%; animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.item-no {
  font-size: 10px; letter-spacing: .14em; color: var(--ink-3);
  font-weight: 700; font-variant-numeric: tabular-nums;
}
.item-cat {
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--plum); font-weight: 700; margin: 8px 0 6px;
}
.item-name {
  font-family: var(--serif); font-size: 19px; line-height: 1.22;
  font-weight: 400; margin: 0; letter-spacing: -.005em;
}
.item:hover .item-name { text-decoration: underline; text-underline-offset: 3px; }
.item-meta {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
}
.item-price { font-family: var(--serif); font-size: 18px; line-height: 1; }
.item-weight { font-size: 11px; color: var(--ink-3); letter-spacing: .04em; }
.item-wa {
  margin-top: 14px;
  font-size: 11.5px; letter-spacing: .08em; font-weight: 600;
  color: var(--plum); border-bottom: 1px solid var(--plum);
  padding-bottom: 2px; align-self: flex-start;
}
.item:hover .item-wa { color: var(--plum-deep); }
.item-wa svg { display: none; }

/* Empty state */
.empty {
  grid-column: 1 / -1; padding: 72px 32px; text-align: center;
  border-right: 0;
}
.empty p { font-family: var(--serif); font-size: 24px; margin: 0 0 8px; }
.empty span { font-size: 13.5px; color: var(--ink-3); display: block; margin-bottom: 24px; }

/* ============ BAHAN ============ */
.bahan { border-top: 1px solid var(--ink); }
.bahan-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0; border-top: 1px solid var(--line);
  padding-bottom: 96px;
}
.bahan-item {
  padding: 28px 24px 32px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.bahan-item:last-child { border-right: 0; }
.bahan-item .no {
  font-family: var(--serif); font-size: 44px; line-height: 1;
  color: var(--plum); font-style: italic;
}
.bahan-item h3 {
  font-family: var(--serif); font-size: 21px; font-weight: 400;
  margin: 14px 0 8px;
}
.bahan-item p { font-size: 13.5px; color: var(--ink-2); margin: 0; }
.bahan-item .asal {
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 700; margin-top: 14px;
}

/* ============ COLOPHON ============ */
.colophon {
  background: var(--ink); color: var(--paper);
  padding: 72px 0 32px;
}
.colophon .index-label { color: rgba(244,241,234,.5); border-bottom-color: rgba(244,241,234,.3); }
.brand.big { font-size: 34px; letter-spacing: .3em; margin: 0 0 14px; }
.colophon-grid {
  display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.4fr;
  gap: 48px; padding-bottom: 48px;
}
.colophon-line { font-size: 13.5px; color: rgba(244,241,234,.7); line-height: 1.7; margin: 0; }
.colophon ul { display: flex; flex-direction: column; gap: 8px; }
.colophon ul a { font-size: 13.5px; color: rgba(244,241,234,.85); }
.colophon ul a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.colophon .rule-thin { background: rgba(244,241,234,.2); }
.colophon-foot {
  font-size: 12px; color: rgba(244,241,234,.5); margin: 20px 0 0;
  letter-spacing: .04em;
}

/* ============ MODAL ============ */
.overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(26,24,22,.6);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 28px; overflow-y: auto;
  opacity: 0; visibility: hidden;
  transition: opacity .25s, visibility .25s;
}
.overlay.open { opacity: 1; visibility: visible; }
.modal {
  position: relative;
  background: var(--paper);
  width: 100%; max-width: 980px;
  display: grid; grid-template-columns: 1.05fr 1fr;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.5);
  transform: translateY(16px);
  transition: transform .3s cubic-bezier(.22,.61,.36,1);
}
.overlay.open .modal { transform: none; }
.modal-media { background: var(--paper-2); }
.modal-media img { width: 100%; height: 100%; object-fit: cover; min-height: 420px; }
.modal-media figcaption {
  font-size: 10.5px; letter-spacing: .1em; color: var(--ink-3);
  padding: 10px 16px; background: var(--paper);
  border-top: 1px solid var(--line); font-style: italic; font-family: var(--serif);
}
.modal-close {
  position: absolute; top: 10px; right: 10px; z-index: 5;
  width: 38px; height: 38px; border: 1px solid var(--line);
  background: var(--paper); display: grid; place-items: center;
  cursor: pointer; transition: all .2s;
}
.modal-close:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.modal-close svg { width: 15px; height: 15px; }
.modal-body { padding: 40px 36px; display: flex; flex-direction: column; }
.modal-num {
  font-size: 10.5px; letter-spacing: .16em; font-weight: 700;
  color: var(--ink-3); margin: 0 0 10px; font-variant-numeric: tabular-nums;
}
#modalName {
  font-family: var(--serif); font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 400; line-height: 1.1; letter-spacing: -.018em;
  margin: 0 0 12px;
}
.modal-line { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--plum); font-weight: 700; margin: 0 0 20px; }
.modal-desc { font-size: 15px; color: var(--ink-2); margin: 0 0 28px; line-height: 1.65; }
.modal-spec { margin: 0 0 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.modal-spec dt {
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  font-weight: 700; color: var(--ink-3); margin: 0 0 6px;
}
.modal-spec dd { margin: 0 0 18px; font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.modal-spec dd:last-child { margin-bottom: 0; }

.qty {
  display: inline-flex; align-items: center; border: 1px solid var(--ink);
  margin-bottom: 16px;
}
.qty button {
  width: 42px; height: 46px; background: transparent; border: 0;
  cursor: pointer; font-size: 18px; color: var(--ink-2);
}
.qty button:hover { background: var(--paper-2); color: var(--ink); }
.qty output {
  min-width: 48px; text-align: center; font-family: var(--serif); font-size: 18px;
  border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  height: 46px; display: grid; place-items: center;
}
.btn-wa {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--plum); color: var(--paper);
  padding: 15px 26px; font-size: 13px; font-weight: 600; letter-spacing: .06em;
  align-self: flex-start; transition: background .2s;
}
.btn-wa:hover { background: var(--plum-deep); }

/* ============ TOAST ============ */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 300;
  transform: translate(-50%, 16px); opacity: 0; visibility: hidden;
  background: var(--ink); color: var(--paper);
  padding: 12px 20px; font-size: 13px;
  transition: all .3s; max-width: calc(100vw - 32px);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

/* ============ FAB ============ */
.fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 150;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--plum); color: var(--paper); border: 0;
  display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,.4);
  transition: transform .25s, background .25s;
}
.fab:hover { transform: scale(1.08); background: var(--plum-deep); }
.fab svg { width: 25px; height: 25px; }

/* ============ RESPONSIF ============ */
@media (max-width: 1080px) {
  .cat-layout { grid-template-columns: 200px 1fr; gap: 36px; }
  .bahan-grid { grid-template-columns: 1fr 1fr; }
  .bahan-item:nth-child(2) { border-right: 0; }
  .colophon-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
}

@media (max-width: 860px) {
  .mast-nav { gap: 14px; }
  .mast-nav a { font-size: 11px; }
  .mast-nav a:not(.mast-wa) { display: none; }
  .headline { padding: 56px 0 48px; }
  .cat-head { padding: 56px 0 32px; }
  .cat-layout { grid-template-columns: 1fr; gap: 32px; }
  .index { position: static; }
  .index ul { flex-direction: row; flex-wrap: wrap; gap: 6px 18px; }
  .modal { grid-template-columns: 1fr; }
  .modal-media img { min-height: 280px; max-height: 40vh; }
  .modal-body { padding: 28px 24px 32px; }
  .plate img { max-height: 44vh; }
}

@media (max-width: 640px) {
  :root { --gut: 18px; }
  body { font-size: 14.5px; }
  .mast-top { flex-wrap: wrap; gap: 12px; }
  .brand { font-size: 22px; letter-spacing: .22em; }
  .mast-issue { flex-wrap: wrap; gap: 6px 10px; font-size: 9.5px; }
  .headline h1 { font-size: clamp(2.2rem, 10vw, 3.2rem); max-width: none; }
  .headline-foot { margin-top: 32px; gap: 24px; }
  .dek { font-size: 15.5px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .item, .item:nth-child(6n+4), .item:nth-child(6n+5) {
    grid-column: span 1 !important; padding: 16px 14px 20px; padding-top: 16px !important;
  }
  .item-media { aspect-ratio: 1 / 1 !important; }
  .item-name { font-size: 16px; }
  .item-price { font-size: 16px; }
  .bahan-grid { grid-template-columns: 1fr; }
  .bahan-item { border-right: 0; }
  .colophon-grid { grid-template-columns: 1fr; gap: 32px; }
  .overlay { padding: 0; }
  .modal { max-width: none; }
  .fab { right: 14px; bottom: 14px; width: 50px; height: 50px; }
  .toast { bottom: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
