/* =====================================================
   Base / Reset
   ===================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  color: #333;
  background: #fff;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

[hidden] {
  display: none !important;
}

/* =====================================================
   Layout
   ===================================================== */
.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 44px 20px;
}

@media (max-width: 600px) {
  .wrap {
    padding: 24px 16px;
  }
}

.hero {
  text-align: center;
  padding-top: 36px;
  padding-bottom: 32px;
}

.footer {
  text-align: center;
  padding: 16px 0 24px;
  color: #666;
}

/* =====================================================
   Typography
   ===================================================== */
h1 {
  margin: 0 0 12px;
  font-weight: 700;
  font-size: clamp(1.5rem, 2.5vw + 1rem, 2.25rem);
}

h2 {
  margin: 0 0 16px;
  font-weight: 700;
  font-size: clamp(1.25rem, 1.5vw + 1rem, 1.6rem);
}

.sub {
  margin: 0 0 12px;
  font-size: clamp(1rem, 0.6vw + 0.9rem, 1.1rem);
}

.muted {
  color: #777;
  font-size: 0.95rem;
  display: block;
  margin-top: 20px;
}

.optional {
  color: #777;
  font-size: 0.95em;
  font-weight: normal;
}

/* =====================================================
   Branding
   ===================================================== */
.logo {
  display: block;
  margin: 0 auto 24px;
  width: 200px;
}

/* =====================================================
   Buttons / CTAs
   ===================================================== */
.btn {
  appearance: none;
  padding: 12px 18px;
  border-radius: 10px;
  border: none;
  background: #b87333;
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  min-width: 220px;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover {
  background: #a5642d;
}

.btn.secondary {
  background: transparent;
  color: #b87333;
  border: 2px solid #b87333;
}

.btn.ghost {
  background: transparent;
  border: 1px solid #ccc;
  color: inherit;
}

@media (max-width: 420px) {
  .btn {
    width: 100%;
    min-width: 0;
  }
}

/* CTA Rows */
.cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

@media (max-width: 640px) {
  .cta-row {
    flex-direction: column;
  }

  .cta-row .btn {
    max-width: 280px;
  }
}

/* =====================================================
   CTA row — proper centering on mobile
   ===================================================== */

.cta-row {
  display: flex;
  justify-content: center;
  align-items: center; /* ✅ important */
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .cta-row {
    flex-direction: column;
  }

  .cta-row .btn {
    width: 100%;
    max-width: 320px;   /* ✅ centers visually */
    text-align: center;
  }
}


/* =====================================================
   How-it-works grid
   ===================================================== */
.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 32px 0 12px;
}

.card {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.card h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

/* =====================================================
   Upload Box
   ===================================================== */
.upload-box {
  margin-top: 28px;
}

.upload-cta {
  margin-top: 24px;
}

.upload-box .file-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid #e3e3e3;
  border-radius: 999px;
  font-size: 0.85rem;
  background: #fafafa;
}

.upload-box .file-chip__clear {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

#file-browse.selected {
  outline: 2px solid rgba(0, 0, 0, 0.08);
}

/* =====================================================
   Forms
   ===================================================== */
.fh-form {
  max-width: 560px;
  margin: 32px auto 64px;
  padding: 20px;
  border: 1px solid #eee;
  border-radius: 12px;
  background: #fff;
}

label {
  display: block;
  margin-top: 12px;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  padding: 10px 12px;
  margin-top: 6px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
}

textarea {
  resize: vertical;
}

button[type="submit"] {
  margin-top: 16px;
}

.status {
  margin-top: 8px;
  color: #555;
  min-height: 1em;
}

.hp {
  position: absolute;
  left: -50000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Form visibility */
#buyer-form,
#maker-form {
  display: none;
}

section.active {
  display: block !important;
}

/* =====================================================
   Gallery
   ===================================================== */
#gallery {
  text-align: center;
}

.gallery-filters {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.gallery-filters .btn.active {
  border-bottom: 2px solid currentColor;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  text-align: left;
}

.gcard {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.gcard img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.gcard .meta {
  padding: 0.75rem 0.9rem;
}

.gcard .meta .name {
  font-weight: 600;
}

/* =====================================================
   Gallery card actions — centered outlined CTA
   ===================================================== */

.gcard .actions {
  display: flex;
  justify-content: center;
  padding: 12px 16px 16px;
}

.gcard .actions .btn.inquire {
  background: transparent;
  color: #b87333;
  border: 2px solid #b87333;
  min-width: auto;
  padding: 8px 14px;
  font-size: 0.95rem;
}

/* Hover / focus states */
.gcard .actions .btn.inquire:hover,
.gcard .actions .btn.inquire:focus-visible {
  background: rgba(184, 115, 51, 0.08);
  outline: none;
}

/* =====================================================
   Back to top
   ===================================================== */
#toTopBtn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #b87333;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
  display: none;
  z-index: 999;
}

#toTopBtn.show {
  display: block;
}

/* =====================================================
   Accessibility
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
/* =====================================================
   ForgeHub Gallery Lightbox (authoritative)
   ===================================================== */

#gh-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;

  display: none;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.92);
}

#gh-lightbox.is-open {
  display: flex;
}

#gh-lightbox img {
  max-width: 92vw;
  max-height: 86vh;
  object-fit: contain;
  display: block;

  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

/* Caption */
#gh-lightbox__caption,
#gh-lightbox .gh-lightbox__caption {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);

  color: #eee;
  font-size: 0.95rem;
  text-align: center;
  max-width: 90vw;
}

/* Close button */
#gh-lightbox .gh-lightbox__close {
  position: absolute;
  top: 12px;
  right: 12px;

  background: none;
  border: none;
  color: #fff;

  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

/* Prevent background scroll */
html.gh-no-scroll,
body.gh-no-scroll {
  overflow: hidden !important;
}

.suburb-options {
  position: absolute;
  z-index: 1000;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin-top: 4px;
  padding: 4px 0;
  width: 100%;
  max-height: 240px;
  overflow-y: auto;
  list-style: none;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.suburb-options li {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.95rem;
}

.suburb-options li:hover {
  background: #f4f4f4;
}
