/* Category navigation catalog — horizontal tabs, load-more + page jump */

:root {
  --ember: #e94e1b;
  --ember-soft: rgba(233, 78, 27, 0.1);

  --snow: #f8f9fa;
  --white: #fff;
  --ice: #e4eaef;
  --fjord: #5a7d8c;
  --fjord-deep: #3d5f6e;
  --ink: #2c3338;
  --muted: #5a656d;
  --font: "Manrope", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--snow);
  line-height: 1.5;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 200;
  padding: 0.5rem 1rem;
  background: var(--fjord);
  color: var(--white);
}
.skip-link:focus { top: 1rem; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem clamp(1rem, 4vw, 2rem);
  background: var(--white);
  border-bottom: 1px solid var(--ice);
}

.logo {
  font-size: 1.25rem;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}

.back-link {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--fjord);
  text-decoration: none;
}

.catalog {
  max-width: 1280px;
  margin: 0 auto;
  padding-bottom: 4rem;
}

.catalog-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  padding: 2.5rem clamp(1rem, 4vw, 2rem) 2rem;
  background: var(--white);
  border-bottom: 1px solid var(--ice);
}

.hero-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fjord);
  margin: 0 0 0.5rem;
}

.catalog-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0;
}

.hero-desc {
  margin: 0.5rem 0 0;
  color: var(--muted);
  max-width: 32rem;
}

.hero-stats {
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-stats strong {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--fjord-deep);
  line-height: 1.1;
}

.hero-stats span {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Category bar */
.category-bar-wrap {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--white);
  border-bottom: 1px solid var(--ice);
  box-shadow: 0 4px 20px rgba(44, 51, 56, 0.04);
}

.category-bar {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 0 clamp(1rem, 4vw, 2rem);
  -webkit-overflow-scrolling: touch;
}

.category-bar::-webkit-scrollbar {
  display: none;
}

.category-hint {
  margin: 0;
  padding: 0.65rem clamp(1rem, 4vw, 2rem) 0.85rem;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
  max-width: 48rem;
}

.cat-tab {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.1rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.cat-tab:hover {
  color: var(--ink);
  background: var(--snow);
}

.cat-tab.is-active {
  color: var(--fjord-deep);
  border-bottom-color: var(--fjord);
}

.cat-tab .count {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  background: var(--ice);
  color: var(--fjord);
  border-radius: 100px;
}

.cat-tab.is-active .count {
  background: var(--fjord);
  color: var(--white);
}

/* Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem clamp(1rem, 4vw, 2rem);
}

.toolbar-search {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1rem;
  background: var(--white);
  border: 1px solid var(--ice);
  border-radius: 8px;
  color: var(--muted);
}

.toolbar-search input {
  flex: 1;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--ink);
  background: transparent;
}

.btn-filters {
  padding: 0.65rem 1.25rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--ice);
  border-radius: 8px;
  cursor: pointer;
}

.btn-filters:hover {
  border-color: var(--fjord);
  color: var(--fjord-deep);
}

.toolbar-sort select {
  padding: 0.65rem 1rem;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid var(--ice);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
}

.toolbar-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 clamp(1rem, 4vw, 2rem) 1rem;
}

.results-line {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0;
}

.view-toggle {
  display: flex;
  border: 1px solid var(--ice);
  border-radius: 8px;
  overflow: hidden;
  background: var(--white);
}

.view-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
}

.view-btn + .view-btn {
  border-left: 1px solid var(--ice);
}

.view-btn.is-active {
  background: var(--fjord);
  color: var(--white);
}

.view-btn svg {
  flex-shrink: 0;
}

/* Filter panel */
.filter-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 100;
  width: min(360px, 100vw);
  height: 100vh;
  background: var(--white);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -8px 0 32px rgba(44, 51, 56, 0.12);
}

.filter-panel.is-open {
  transform: translateX(0);
}

.filter-panel[hidden] {
  display: none;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--ice);
}

.panel-head h2 {
  font-size: 1.125rem;
  margin: 0;
}

.panel-head button {
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
}

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

fieldset {
  border: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

legend {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  cursor: pointer;
}

.year-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.year-row select {
  flex: 1;
  padding: 0.6rem;
  font-family: inherit;
  border: 1px solid var(--ice);
  border-radius: 6px;
}

.panel-foot {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--ice);
}

.btn-apply {
  flex: 1;
  padding: 0.85rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--white);
  background: var(--fjord);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.btn-apply:hover {
  background: var(--fjord-deep);
}

.btn-reset {
  padding: 0.85rem 1.25rem;
  font-family: inherit;
  font-weight: 600;
  background: none;
  border: 1px solid var(--ice);
  border-radius: 8px;
  cursor: pointer;
}

.panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(44, 51, 56, 0.35);
}

.panel-backdrop[hidden] {
  display: none;
}

/* Projects container */
.project-grid {
  padding: 0 clamp(1rem, 4vw, 2rem);
}

.project-grid.is-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.project-grid.is-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.project-card {
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.25s, transform 0.25s, border-color 0.2s;
}

/* Grid card */
.project-card--grid {
  display: block;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--ice);
}

.project-card--grid:hover {
  box-shadow: 0 12px 28px rgba(44, 51, 56, 0.08);
  transform: translateY(-2px);
}

.project-card--grid figure {
  position: relative;
  margin: 0;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--ice);
}

.project-card--grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card--grid .badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 1;
}

.project-card--grid .info {
  padding: 0.85rem;
}

.project-card--grid .cat {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fjord);
}

.project-card--grid h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0.25rem 0 0;
  line-height: 1.3;
}

.project-card--grid .meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* List card */
.project-card--list {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  align-items: start;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--white);
  border: 1px solid var(--ice);
  border-radius: 8px;
}

.project-card--list:hover {
  border-color: var(--fjord);
  box-shadow: 0 8px 24px rgba(44, 51, 56, 0.06);
}

.project-card--list figure {
  margin: 0;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: var(--ice);
}

.project-card--list img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.project-card--list h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
  width: 100%;
  letter-spacing: -0.02em;
}

.project-card--list .cat {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fjord);
}

.list-excerpt {
  margin: 0.65rem 0 0.85rem;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 40rem;
}

.card-details {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: 0.65rem 1.25rem;
  margin: 0;
}

.card-details div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.card-details dt {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.card-details dd {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink);
}

.list-action {
  align-self: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--fjord);
  white-space: nowrap;
}

.badge--featured {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  background: var(--fjord);
  color: var(--white);
  border-radius: 4px;
}

/* Footer / load more */
.catalog-footer {
  padding: 2rem clamp(1rem, 4vw, 2rem) 0;
  text-align: center;
}

.empty {
  color: var(--muted);
  padding: 3rem;
}

.empty button {
  font-family: inherit;
  background: none;
  border: none;
  color: var(--fjord);
  text-decoration: underline;
  cursor: pointer;
}

.btn-load {
  display: inline-block;
  padding: 1rem 2.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--white);
  background: var(--fjord);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.btn-load:hover {
  background: var(--fjord-deep);
}

.btn-load:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.load-meta {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0.75rem 0 0;
}

.page-jump {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 1.5rem;
}

.page-jump button {
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.4rem;
  font-family: inherit;
  font-size: 0.75rem;
  border: 1px solid var(--ice);
  border-radius: 6px;
  background: var(--white);
  cursor: pointer;
}

.page-jump button.is-active {
  background: var(--fjord);
  color: var(--white);
  border-color: var(--fjord);
}

.page-jump span {
  align-self: center;
  color: var(--muted);
  font-size: 0.75rem;
}

@media (max-width: 1024px) {
  .project-grid.is-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .project-card--list {
    grid-template-columns: 180px 1fr;
  }

  .list-action {
    grid-column: 2;
    justify-self: start;
    margin-top: 0.5rem;
  }
}

@media (max-width: 640px) {
  .hero-stats {
    width: 100%;
    justify-content: space-between;
    gap: 1rem;
  }

  .project-grid.is-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .project-card--list {
    grid-template-columns: 1fr;
  }

  .list-action {
    grid-column: 1;
  }

  .cat-tab {
    padding: 0.75rem 0.9rem;
    font-size: 0.75rem;
  }

  .view-btn span {
    display: none;
  }
}
