/*
  2026 gallery redesign layer
  Simplifies discovery and keeps the HD viewer fully functional.
*/

:root {
  --gallery-ink: #141512;
  --gallery-ink-soft: #30322e;
  --gallery-muted: #6a6d66;
  --gallery-line: #d7d5cc;
  --gallery-surface: #f5f4ef;
  --gallery-surface-alt: #eceae2;
  --gallery-green: #1e5947;
  --gallery-green-dark: #163f32;
  --gallery-white: #fffefa;
  --gallery-gold: #c9a968;
  --gallery-graphite: #111311;
  --gallery-danger: #8d2f2b;
}

html[data-theme="dark"] {
  --gallery-ink: #f5f2e9;
  --gallery-ink-soft: #d6d5cd;
  --gallery-muted: #a6aaa1;
  --gallery-line: #343834;
  --gallery-surface: #111311;
  --gallery-surface-alt: #1c1f1c;
  --gallery-green: #83aa98;
  --gallery-green-dark: #6d9784;
  --gallery-white: #fffefa;
}

body {
  font-family: "MiSans", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--gallery-surface);
  letter-spacing: 0.005em;
}

.gallery-header,
.album-headerbar {
  min-height: 84px;
  padding: 10px clamp(28px, 4vw, 72px);
  border-bottom: 1px solid #2e322e;
  background: var(--gallery-graphite);
  color: #f5f2e9;
  backdrop-filter: none;
}

.gallery-header {
  grid-template-columns: minmax(190px, 0.75fr) minmax(0, 1.5fr) minmax(150px, 0.75fr);
}

.gallery-brand {
  width: clamp(180px, 16vw, 248px);
}

.gallery-brand__logo {
  width: 100%;
  height: 54px;
  object-fit: contain;
  object-position: left center;
}

.gallery-brand__mark,
.gallery-brand__text {
  display: none;
}

.gallery-header__nav {
  gap: clamp(18px, 2.5vw, 38px);
  font-size: 13px;
}

.gallery-header__nav a {
  color: #c9ccc6;
  font-weight: 560;
  letter-spacing: 0.035em;
}

.gallery-header__nav a::after {
  background: var(--gallery-gold);
}

.gallery-header__nav a:hover,
.gallery-header__nav a[aria-current="page"] {
  color: #fffefa;
}

.gallery-header__contact,
.album-contact {
  min-height: 42px;
  padding: 0 17px;
  border: 1px solid #59605a;
  background: transparent;
  color: #fffefa;
  font-size: 12px;
  letter-spacing: 0.03em;
}

.gallery-header__contact:hover,
.album-contact:hover {
  border-color: var(--gallery-gold);
  background: transparent;
  color: #e1d0a2;
}

.gallery-intro {
  min-height: 430px;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
  align-items: end;
  padding: clamp(72px, 8vw, 120px) clamp(28px, 6vw, 104px) clamp(58px, 7vw, 96px);
  border-bottom: 1px solid var(--gallery-line);
  background: var(--gallery-surface);
  color: var(--gallery-ink);
}

.gallery-intro__context {
  margin-bottom: 28px;
  color: var(--gallery-green-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.gallery-intro h1 {
  max-width: 12ch;
  font-family: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", STSong, SimSun, serif;
  font-size: clamp(3.6rem, 6.7vw, 6.6rem);
  font-weight: 560;
  line-height: 1.04;
}

.gallery-intro__note {
  min-height: 290px;
  display: grid;
  align-content: end;
  gap: 18px;
  padding: 32px;
  border: 1px solid #303530;
  background: var(--gallery-graphite);
}

.gallery-intro__brand {
  min-height: 150px;
  display: grid;
  place-items: center;
}

.gallery-intro__brand img {
  width: min(60%, 180px);
  height: auto;
}

.gallery-intro__note p {
  color: #b8bcb4;
  font-size: 14px;
}

.gallery-intro__note span {
  color: #e2d4aa;
}

.catalog-controls {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(28px, 5vw, 76px);
  padding: clamp(36px, 5vw, 66px) clamp(28px, 6vw, 104px);
  border-bottom-color: var(--gallery-line);
  background: var(--gallery-white);
}

html[data-theme="dark"] .catalog-controls {
  background: #181b18;
}

.catalog-search {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  border-bottom-color: var(--gallery-ink);
}

.catalog-search__clear {
  grid-column: 3;
}

.catalog-search__submit {
  display: none;
}

.catalog-search input {
  font-size: 15px;
}

.filter-dimensions {
  display: grid;
  gap: 18px;
}

.filter-group {
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
}

.filter-group__label {
  color: var(--gallery-ink-soft);
  font-size: 12px;
  letter-spacing: 0.05em;
}

.filter-list {
  gap: 6px;
}

.filter-chip {
  min-height: 32px;
  padding: 4px 11px;
  border-radius: 0;
  border-color: var(--gallery-line);
  color: var(--gallery-ink-soft);
  font-size: 12px;
}

.filter-chip.is-active {
  border-color: var(--gallery-green-dark);
  background: var(--gallery-green-dark);
  color: #fffefa;
}

.active-filter-summary {
  padding-top: 18px;
  border-top: 1px solid var(--gallery-line);
}

.catalog-results {
  padding: clamp(72px, 9vw, 138px) clamp(28px, 6vw, 104px) clamp(96px, 12vw, 176px);
}

.catalog-empty {
  min-height: 420px;
  padding: clamp(3rem, 8vw, 7rem);
  border: 1px solid var(--gallery-line);
  background: var(--gallery-surface-alt);
}

.catalog-empty > i {
  color: var(--gallery-gold);
  font-size: 3.2rem;
}

.catalog-empty h3 {
  font-family: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", STSong, SimSun, serif;
  font-size: clamp(1.9rem, 3.5vw, 3rem);
  font-weight: 560;
}

.catalog-empty > p {
  color: #565b55;
}

html[data-theme="dark"] .catalog-empty > p {
  color: #b7bbb3;
}

.catalog-results__heading {
  align-items: end;
  margin-bottom: clamp(38px, 5vw, 70px);
}

.catalog-results__heading h2 {
  font-family: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", STSong, SimSun, serif;
  font-size: clamp(2.35rem, 4.5vw, 4.5rem);
  font-weight: 560;
}

.album-catalog {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(42px, 6vw, 80px) clamp(14px, 2vw, 28px);
}

.gallery-footer {
  min-height: 220px;
  align-items: end;
  padding-block: 48px;
}

.gallery-footer__brand {
  display: grid;
  gap: 14px;
}

.gallery-footer__brand img {
  width: 220px;
  height: auto;
}

.gallery-footer__brand p {
  color: #b8bcb4;
}

.catalog-card,
.catalog-card:nth-child(5n + 1),
.catalog-card:nth-child(5n + 2),
.catalog-card:nth-child(5n + 3),
.catalog-card--featured {
  grid-column: auto !important;
  padding-top: 0 !important;
}

.catalog-card__media,
.catalog-card--featured .catalog-card__media {
  aspect-ratio: 4 / 3;
  border-radius: 0;
  background: var(--gallery-surface-alt);
}

.catalog-card__media img {
  filter: saturate(0.86) contrast(1.04);
}

.catalog-card__count {
  right: 10px;
  bottom: 10px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(17, 19, 17, 0.82);
  font-size: 10px;
}

.catalog-card__body {
  display: grid;
  gap: 7px;
  padding: 16px 0 0;
}

.catalog-card__context {
  color: var(--gallery-muted);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.catalog-card h3 {
  font-family: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", STSong, SimSun, serif;
  font-size: clamp(1.25rem, 1.7vw, 1.7rem);
  font-weight: 560;
}

.catalog-card__description {
  display: none;
}

.catalog-card__action {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--gallery-line);
  color: var(--gallery-ink-soft);
  font-size: 11px;
}

.button {
  border-radius: 0;
}

.gallery-footer {
  min-height: 150px;
  border-top: 1px solid #303430;
  background: var(--gallery-graphite);
}

.album-headerbar {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
}

.album-back {
  color: #c9ccc6;
}

.album-back:hover {
  color: #e1d0a2;
}

.gallery-brand--compact {
  width: clamp(160px, 14vw, 220px);
  justify-self: start;
}

.album-headerbar__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2.2vw, 32px);
  min-width: 0;
  font-size: 12px;
}

.album-headerbar__nav a {
  color: #c9ccc6;
  white-space: nowrap;
}

.album-headerbar__nav a:hover,
.album-headerbar__nav a[aria-current="page"] {
  color: #fffefa;
}

.album-main {
  min-height: calc(100dvh - 84px);
}

.album-hero {
  min-height: min(680px, calc(100dvh - 84px));
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  background: var(--gallery-surface);
}

.album-hero__cover {
  min-height: 680px;
  background: var(--gallery-graphite);
}

.album-hero__cover img {
  filter: saturate(0.82) contrast(1.05);
}

.album-hero__content {
  display: grid;
  align-content: center;
  padding: clamp(58px, 8vw, 120px);
}

.album-breadcrumb {
  margin-bottom: clamp(34px, 5vw, 64px);
}

.album-hero h1 {
  font-family: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", STSong, SimSun, serif;
  font-size: clamp(3.2rem, 5.6vw, 5.9rem);
  font-weight: 560;
  line-height: 1.04;
}

.album-hero__meta {
  color: var(--gallery-green-dark);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.album-hero__tags a {
  border-radius: 0;
}

.album-open-button {
  width: fit-content;
  min-width: 238px;
  margin-top: 38px;
  border-radius: 0;
  background: var(--gallery-green-dark);
}

.album-preview {
  padding: clamp(72px, 9vw, 136px) clamp(28px, 6vw, 104px) clamp(100px, 12vw, 180px);
}

.album-preview__heading h2 {
  font-family: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", STSong, SimSun, serif;
  font-size: clamp(2.35rem, 4.5vw, 4.5rem);
  font-weight: 560;
}

.photo-preview-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 1.5vw, 22px);
}

.photo-preview,
.photo-preview:nth-child(7n + 2),
.photo-preview:nth-child(7n + 3),
.photo-preview:nth-child(7n + 6),
.photo-preview:nth-child(7n + 7),
.photo-preview--lead {
  grid-column: auto;
  aspect-ratio: 4 / 3;
  border-radius: 0;
}

.photo-preview__number {
  padding: 6px 8px;
  background: rgba(17, 19, 17, 0.86);
}

.album-loading {
  min-height: calc(100dvh - 84px);
}

.album-viewer {
  background: #090a09;
}

.album-viewer::backdrop {
  background: rgba(5, 6, 5, 0.98);
}

.album-viewer__shell {
  background: #090a09;
}

.viewer-header,
.viewer-controls {
  border-color: #2b2e2b;
  background: #101210;
}

.viewer-progress span,
.viewer-thumbnail.is-active {
  border-color: var(--gallery-gold);
}

.viewer-progress span {
  background: var(--gallery-gold);
}

.viewer-control,
.viewer-icon-button,
.viewer-nav {
  border-radius: 0;
}

.viewer-control--primary {
  border-color: var(--gallery-green-dark);
  background: var(--gallery-green-dark);
}

@media (max-width: 1180px) {
  .album-catalog {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .photo-preview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .gallery-header {
    grid-template-columns: 1fr auto;
  }

  .gallery-header__nav {
    display: none;
  }

  .album-headerbar__nav {
    display: none;
  }

  .gallery-brand {
    width: 190px;
  }

  .gallery-intro,
  .catalog-controls,
  .album-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .gallery-intro {
    min-height: 560px;
    align-content: end;
  }

  .catalog-controls {
    gap: 34px;
  }

  .album-hero__cover {
    min-height: 560px;
  }

  .album-hero__content {
    padding: 64px 36px 76px;
  }
}

@media (max-width: 700px) {
  html,
  body.album-page {
    max-width: 100%;
    overflow-x: hidden;
  }

  .album-main,
  .album-hero,
  .album-preview,
  .album-viewer,
  .album-viewer__shell,
  .viewer-header,
  .viewer-stage,
  .viewer-canvas,
  .viewer-controls,
  .viewer-thumbnails {
    min-width: 0;
    max-width: 100%;
  }

  .album-viewer,
  .album-viewer__shell,
  .viewer-header,
  .viewer-controls,
  .viewer-thumbnails {
    width: 100%;
  }

  .gallery-header,
  .album-headerbar {
    min-height: 72px;
    padding-inline: 16px;
  }

  .gallery-brand,
  .gallery-brand--compact {
    width: 48px;
  }

  .gallery-brand__logo {
    height: 48px;
    object-fit: cover;
    object-position: left center;
  }

  .gallery-header__contact,
  .album-contact {
    min-height: 38px;
    padding-inline: 12px;
  }

  .album-headerbar {
    grid-template-columns: auto 1fr auto;
  }

  .gallery-brand--compact {
    justify-self: center;
  }

  .album-back span,
  .album-contact span {
    display: none;
  }

  .gallery-intro {
    min-height: 500px;
    padding: 64px 20px 48px;
  }

  .gallery-intro h1 {
    font-size: clamp(3rem, 14vw, 4.4rem);
  }

  .catalog-controls,
  .catalog-results,
  .album-preview {
    padding-inline: 20px;
  }

  .filter-group {
    grid-template-columns: minmax(0, 1fr);
  }

  .album-catalog,
  .photo-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-card__action {
    display: none;
  }

  .album-hero__cover {
    min-height: 480px;
  }

  .album-hero__content {
    padding: 56px 20px 68px;
  }

  .viewer-header__identity {
    max-width: calc(100% - 58px);
  }

  .viewer-controls {
    box-sizing: border-box;
    gap: 8px;
  }

  .viewer-controls__group--right {
    margin-left: 0;
  }

  .viewer-thumbnails {
    box-sizing: border-box;
  }
}

@media (max-width: 440px) {
  .album-catalog,
  .photo-preview-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .catalog-card__media img,
  .photo-preview img {
    transition: none;
  }
}
