
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

.gallery-page { padding-top: 55px; padding-bottom: 70px; }
.gallery-heading { max-width: 750px; margin-bottom: 30px; }
.gallery-heading h1 { margin: 12px 0; font-size: clamp(34px, 5vw, 48px); line-height: 1.12; letter-spacing: -1.8px; }
.gallery-heading > p { max-width: 680px; color: var(--muted); line-height: 1.8; }

.gallery-toolbar { display: flex; gap: 12px; margin-top: 28px; }
.search-field, .filter-field {
  display: flex; align-items: center; gap: 10px; min-height: 48px;
  border: 1px solid #dce3ef; border-radius: 10px; background: white;
}
.search-field { flex: 1; padding: 0 14px; }
.search-field svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: #78849a; stroke-width: 1.8; stroke-linecap: round; }
.search-field input { width: 100%; min-width: 0; padding: 12px 0; border: 0; outline: 0; color: var(--ink); background: transparent; }
.filter-field select { width: 190px; min-height: 46px; padding: 0 35px 0 12px; border: 0; border-radius: 10px; background: white; color: var(--ink); }
.template-count { margin: 20px 0 14px; color: var(--muted); font-size: 13px; }

.template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.template-card { min-width: 0; overflow: hidden; border: 1px solid #e4e8f0; border-radius: 13px; background: white; transition: box-shadow .2s, transform .2s; }
.template-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px #1b326010; }
.template-card-info { padding: 14px; }
.template-card-info h2 { margin: 0; font-size: 14px; line-height: 1.45; }
.template-card-info > p { margin: 5px 0 13px; color: var(--muted); font-size: 11px; text-transform: capitalize; }
.template-card-actions { display: flex; gap: 8px; }
.template-action { display: inline-flex; justify-content: center; align-items: center; flex: 1; min-height: 38px; padding: 8px; border-radius: 8px; font-size: 12px; font-weight: 700; text-align: center; }
.template-action-primary { color: white; background: var(--blue); }
.template-action-primary:hover { background: var(--blue-dark); }
.template-action-secondary { border: 1px solid #dce3ef; background: white; color: var(--ink); }
.template-action-secondary:hover { border-color: var(--blue); }
.template-pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; margin-top: 30px; }
.page-button { min-width: 39px; min-height: 39px; padding: 7px 11px; border: 1px solid #dce3ef; border-radius: 8px; background: white; color: var(--ink); cursor: pointer; }
.page-button.is-active { border-color: var(--blue); background: var(--blue); color: white; }
.page-button:disabled { cursor: not-allowed; opacity: .4; }
.empty-state { padding: 40px 15px; text-align: center; color: var(--muted); }
.gallery-guidance { margin-top: 65px; padding-top: 35px; border-top: 1px solid var(--line); }
.gallery-guidance > h2 { font-size: 25px; letter-spacing: -.7px; }
.guidance-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; }
.guidance-grid h3 { font-size: 14px; }
.guidance-grid p { color: var(--muted); font-size: 13px; line-height: 1.8; }

@media (max-width: 800px) {
  .template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
  .guidance-grid { grid-template-columns: 1fr; gap: 5px; }
}
@media (max-width: 520px) {
  .gallery-page { padding-top: 36px; }
  .gallery-toolbar { flex-direction: column; }
  .filter-field select { width: 100%; }
  .filter-field { width: 100%; }
  .template-grid { gap: 10px; }
  .template-card-info { padding: 10px; }
  .template-card-info h2 { font-size: 12px; }
  .template-action { font-size: 11px; padding: 7px 4px; }
  .gallery-heading h1 { letter-spacing: -1.2px; }
}