/* ==========================================================================
   components.css — tombol, filter, grid foto, kartu album, lightbox, form
   ========================================================================== */

/* --- tombol --------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .72rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 500;
  letter-spacing: .01em;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); color: #fff; }

.btn--ghost {
  border-color: var(--border);
  background: transparent;
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn--ondark {
  border-color: rgba(255, 255, 255, .5);
  color: #fff;
  background: rgba(255, 255, 255, .06);
  backdrop-filter: blur(6px);
}
.btn--ondark:hover { background: #fff; color: #12181F; border-color: #fff; }

/* --- filter chip ---------------------------------------------------------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-bottom: clamp(1.5rem, 3.5vw, 2.25rem);
}

.chip {
  padding: .45rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: .85rem;
  font-weight: 500;
  transition: all var(--dur) var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.chip-count {
  opacity: .65;
  font-size: .78em;
  margin-left: .3em;
}

/* --- grid foto (masonry via CSS columns) ---------------------------------- */

.photo-grid {
  columns: 4;
  column-gap: 18px;
}

@media (max-width: 1440px) { .photo-grid { columns: 3; } }
@media (max-width: 1024px) { .photo-grid { columns: 2; } }
@media (max-width: 640px)  { .photo-grid { columns: 1; column-gap: 0; } }

/* grid rata (bukan masonry) untuk highlight beranda */
.photo-grid--even {
  columns: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.photo-grid--even .photo-card { margin-bottom: 0; }
.photo-grid--even .photo-card img { aspect-ratio: 4 / 3; object-fit: cover; }

.photo-card {
  break-inside: avoid;
  margin-bottom: 18px;
  padding: 0;
  border: 0;
  width: 100%;
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-alt);
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.photo-card img {
  width: 100%;
  transition: transform .5s var(--ease), filter .5s var(--ease);
}

.photo-card:hover img { transform: scale(1.045); }

.photo-card__overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.5rem .95rem .85rem;
  background: linear-gradient(180deg, transparent, rgba(6, 10, 14, .82));
  color: #fff;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.photo-card:hover .photo-card__overlay,
.photo-card:focus-visible .photo-card__overlay { opacity: 1; transform: none; }

.photo-card__title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.25;
}

.photo-card__meta {
  display: block;
  font-size: .76rem;
  color: rgba(255, 255, 255, .74);
  margin-top: .15rem;
}

.result-count {
  margin-bottom: 1.5rem;
  font-size: .88rem;
}

.grid-empty {
  padding: 3.5rem 0;
  text-align: center;
  color: var(--muted);
}

.load-more-wrap { text-align: center; margin-top: 2.5rem; }

/* --- kartu album ---------------------------------------------------------- */

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.album-card {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  aspect-ratio: 3 / 4;
  background: var(--surface-alt);
  color: #fff;
}
.album-card:hover { color: #fff; }

.album-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease);
}
.album-card:hover img { transform: scale(1.06); }

.album-card__body {
  position: absolute;
  inset: auto 0 0 0;
  padding: 3rem 1.25rem 1.25rem;
  background: linear-gradient(180deg, transparent, rgba(6, 10, 14, .85));
}

.album-card__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.album-card__count {
  font-size: .76rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .74);
}

/* --- lightbox ------------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  flex-direction: column;
  background: rgba(8, 11, 15, .97);
  color: #fff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.lightbox.is-open { display: flex; animation: lb-in .22s var(--ease); }

@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }

.lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem clamp(1rem, 3vw, 1.75rem);
  flex: none;
}

.lightbox__counter {
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, .66);
  letter-spacing: .08em;
}

.lb-btn {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  background: rgba(255, 255, 255, .05);
  color: #fff;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.lb-btn:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .5); }
.lb-btn svg { width: 19px; height: 19px; }
.lb-btn[disabled] { opacity: .3; cursor: default; }
.lb-btn[disabled]:hover { background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .22); }

.lightbox__stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(.5rem, 2vw, 1.5rem);
  padding-inline: clamp(.5rem, 2vw, 1.5rem);
  min-height: 0;
}

.lightbox__figure {
  margin: 0;
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
}

.lightbox__info {
  flex: none;
  padding: 1rem clamp(1rem, 3vw, 1.75rem) clamp(1.25rem, 3vw, 1.9rem);
  text-align: center;
}

.lightbox__title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  font-weight: 600;
  margin: 0 0 .2rem;
  color: #fff;
}

.lightbox__place {
  font-size: .86rem;
  color: rgba(255, 255, 255, .62);
  margin: 0 0 .85rem;
}

.lightbox__exif {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .4rem .5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lightbox__exif li {
  font-size: .74rem;
  letter-spacing: .04em;
  padding: .22rem .7rem;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  color: rgba(255, 255, 255, .78);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .lightbox__stage { padding-inline: .25rem; gap: .25rem; }
  .lightbox__nav { width: 34px; height: 34px; }
  .lightbox__nav svg { width: 16px; height: 16px; }
  .lightbox__exif li { font-size: .68rem; padding: .18rem .55rem; }
  .lightbox__info { padding-bottom: 1.1rem; }
}

/* --- tombol kontak -------------------------------------------------------- */

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin: 1.5rem 0 0;
}

/* --- form ----------------------------------------------------------------- */
/* Tidak dipakai saat ini (form diganti tombol kontak langsung), tetap
   disimpan kalau nanti form dihidupkan lagi lewat Formspree. */

.form { display: grid; gap: 1.15rem; max-width: 560px; }

.field { display: grid; gap: .4rem; }

.field label {
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--muted);
}

.field input,
.field textarea {
  padding: .72rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field textarea { resize: vertical; min-height: 140px; }

/* --- daftar info (about / contact) ---------------------------------------- */

.info-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .8rem;
}

.info-list li {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid var(--border);
  font-size: .93rem;
}
.info-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.info-list span:first-child { color: var(--muted); }
.info-list span:last-child { text-align: right; font-weight: 500; }

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.4rem, 3vw, 2rem);
  box-shadow: var(--shadow-sm);
}
.card > :first-child { margin-top: 0; }
.card + .card { margin-top: 1.25rem; }
.card .muted { font-size: .93rem; }

/* --- halaman 404 ---------------------------------------------------------- */

.error-page {
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: clamp(4rem, 14vw, 9rem);
}
.error-page .btn + .btn { margin-left: .6rem; }
.error-code {
  font-family: var(--font-display);
  font-size: clamp(5rem, 18vw, 10rem);
  line-height: 1;
  color: var(--accent);
  opacity: .28;
  margin: 0;
}
