:root {
  --ink: #172026;
  --ink-soft: #3d484f;
  --paper: #f5efe4;
  --surface: #fffaf2;
  --line: #d4c5ae;
  --blue: #245c83;
  --blue-dark: #163f5c;
  --burgundy: #8e3342;
  --olive: #526443;
  --gold: #c79a3d;
  --white: #ffffff;
  --shadow: 0 18px 42px rgba(23, 32, 38, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.55;
}

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

a {
  color: inherit;
}

.museum-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 66px;
  padding: 10px 5vw;
  color: var(--surface);
  background: rgba(23, 32, 38, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.brand,
.museum-header nav {
  display: inline-flex;
  align-items: center;
}

.brand {
  gap: 10px;
  color: var(--surface);
  text-decoration: none;
}

.brand span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  background: var(--burgundy);
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  font-weight: 850;
}

.museum-header nav {
  gap: 16px;
  font-weight: 750;
}

.museum-header nav a {
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.museum-header nav a:hover,
.museum-header nav a:focus-visible {
  border-color: var(--gold);
}

.museum-hero {
  min-height: 560px;
  display: grid;
  align-items: end;
  padding: 90px 5vw 64px;
  color: var(--white);
  background:
    linear-gradient(90deg, rgba(23, 32, 38, 0.9), rgba(23, 32, 38, 0.42) 62%, rgba(23, 32, 38, 0.18)),
    url("../img/museo-sable.jpg") center / cover no-repeat;
}

.museum-hero > div,
.collection-section {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.kicker {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.1;
}

h1 {
  max-width: 760px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  letter-spacing: 0;
}

.museum-hero p:not(.kicker) {
  max-width: 680px;
  margin: 20px 0 0;
  font-size: 1.16rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.button,
.filters button,
.piece-card button,
.dialog-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: transparent;
  color: currentColor;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button--primary {
  color: var(--white);
  background: var(--burgundy);
  border-color: var(--burgundy);
}

.collection-section {
  padding: 72px 5vw;
}

.section-head {
  max-width: 760px;
  margin-bottom: 24px;
}

.section-head h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3rem);
}

.section-head p:not(.kicker) {
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
}

.filters button {
  color: var(--blue-dark);
  background: var(--surface);
}

.filters button.active {
  color: var(--white);
  background: var(--blue-dark);
}

.status {
  color: var(--ink-soft);
  font-weight: 750;
}

.status:empty {
  display: none;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.piece-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--white);
  border: 1px solid rgba(23, 32, 38, 0.1);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.piece-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--paper);
}

.piece-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 18px;
}

.piece-card__section {
  margin-bottom: 9px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.piece-card h3 {
  font-size: 1.18rem;
}

.piece-card p {
  margin: 10px 0 18px;
  color: var(--ink-soft);
}

.piece-card button {
  align-self: flex-start;
  margin-top: auto;
  color: var(--burgundy);
}

.piece-dialog {
  width: min(1080px, 94vw);
  max-height: 90vh;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  border-radius: 8px;
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.38);
}

.piece-dialog::backdrop {
  background: rgba(23, 32, 38, 0.78);
}

.dialog-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.05fr);
  max-height: 90vh;
}

.dialog-grid > img {
  width: 100%;
  height: 100%;
  min-height: 520px;
  object-fit: cover;
  background: var(--paper);
}

.dialog-grid article {
  overflow: auto;
  padding: 28px;
}

.dialog-grid h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.2rem;
}

.dialog-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0;
}

.dialog-tabs button {
  color: var(--blue-dark);
}

.dialog-tabs button.active {
  color: var(--white);
  background: var(--blue-dark);
}

.dialog-content p {
  margin: 0 0 14px;
  color: var(--ink-soft);
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(23, 32, 38, 0.2);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 250, 242, 0.9);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.museum-footer {
  padding: 28px 5vw;
  color: var(--surface);
  background: var(--ink);
}

.museum-footer p {
  width: min(1180px, 100%);
  margin: 0 auto;
}

@media (max-width: 980px) {
  .collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dialog-grid {
    grid-template-columns: 1fr;
  }

  .dialog-grid > img {
    max-height: 380px;
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .museum-header {
    align-items: flex-start;
  }

  .museum-header nav {
    gap: 10px;
    font-size: 0.88rem;
  }

  .museum-header nav a:nth-child(3) {
    display: none;
  }

  .collection-grid {
    grid-template-columns: 1fr;
  }

  .button,
  .filters button {
    width: 100%;
  }

  .actions,
  .filters {
    display: grid;
  }
}
