/* hide Quarto's auto-generated title block */
#title-block-header { display: none !important; }

/* full-width layout — strip knitr cell wrapper constraints */
main.content,
.cell,
.cell-output-display {
  max-width: 100% !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.mm-header {
  text-align: center;
  padding: 3rem 1rem 1.5rem;
}
.mm-header h1 { font-size: 2rem; font-weight: 700; margin-bottom: 0.4rem; color: #222; }
.mm-header p  { font-size: 1rem; color: #666; max-width: 560px; margin: 0 auto; }

/* inline category text buttons in header */
button.mm-text-filter {
  background: none; border: none; padding: 0;
  font: inherit; font-weight: 600; color: #2c6e8a;
  text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer;
}
button.mm-text-filter:hover  { color: #1a4f65; }
button.mm-text-filter.active { color: #1a4f65; text-decoration: none; }

/* pill filters */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  justify-content: center; padding: 0.75rem 1rem 1.5rem;
}
.filter-bar button {
  border: 1px solid #bbb; background: #fff; color: #555;
  border-radius: 20px; padding: 0.3rem 1rem; font-size: 0.8rem;
  cursor: pointer; transition: all 0.15s;
}
.filter-bar button.active,
.filter-bar button:hover { background: #2c6e8a; color: #fff; border-color: #2c6e8a; }

/* grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 4px;
  padding: 0 0 4rem;
}

/* card */
.gallery-card {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #ccc;
  display: block;
  text-decoration: none;
  color: inherit;
}
.gallery-card .card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}
div.card-img {
  background-size: cover;
  background-position: center;
}
.gallery-card.pkg-card .card-img {
  object-fit: contain;
  padding: 2.5rem;
  background: #f0f4f7;
}
.gallery-card.pkg-card:hover .card-img { transform: scale(1.08); }
.gallery-card:hover .card-img { transform: scale(1.05); }

.gallery-card .card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.1) 50%, transparent 100%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1rem;
  transition: background 0.2s;
}
.gallery-card:hover .card-overlay { background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.25) 60%, rgba(0,0,0,0.05) 100%); }

.gallery-card .card-title {
  color: #fff; font-size: 1rem; font-weight: 700;
  margin: 0 0 0.25rem; text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.gallery-card .card-desc {
  color: rgba(255,255,255,0.88); font-size: 0.75rem; margin: 0;
  line-height: 1.35;
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease;
}
.gallery-card:hover .card-desc { max-height: 4rem; }

.gallery-card .card-tag {
  position: absolute; top: 0.6rem; left: 0.6rem;
  background: rgba(44,110,138,0.88); color: #fff;
  font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem; border-radius: 10px;
}

/* placeholder colours when no real image */
.img-census    { background: linear-gradient(135deg, #1a6b8a 0%, #3aa8c1 100%); }
.img-property  { background: linear-gradient(135deg, #8a4a1a 0%, #c17a3a 100%); }
.img-bike      { background: linear-gradient(135deg, #2a7a3a 0%, #5ab86a 100%); }
.img-3d        { background: linear-gradient(135deg, #5a2a8a 0%, #9a5ab8 100%); }
.img-transit   { background: linear-gradient(135deg, #8a7a1a 0%, #c1b03a 100%); }
.img-product   { background: linear-gradient(135deg, #1a3a8a 0%, #3a6ac1 100%); }
.img-other     { background: linear-gradient(135deg, #555 0%, #999 100%); }

footer.mm-footer {
  text-align: center; padding: 2rem; font-size: 0.8rem; color: #999;
  border-top: 1px solid #ddd;
}
