/* galerie hallé skin: warm white, fine serif, hairline rules, sparse red */

:root {
  --paper: #f6f3ee;
  --paper-2: #fffefb;
  --ink: #17140f;
  --muted: #8d867a;
  --line: #e2dbcf;
  --line-strong: #cfc6b6;
  --accent: #9a1b12; /* Malle red, used sparingly */
  --serif: "Garamond", "Hoefler Text", "Georgia", serif;
  --sans: "Helvetica Neue", "Arial", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--serif);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* header, nav, content, footer: the content row absorbs the slack so the
     footer band closes the sheet at the bottom of the viewport. Without this a
     short page on a tall screen leaves the ink canvas exposed below the footer. */
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

/* small tracked sans labels, the editorial connective tissue */
#gallery-tagline,
#nav a,
.artwork-artist,
#work-medium,
#work-dims,
#footer,
#back-link {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 10.5px;
}

/* the black canvas above the sheet: overscroll shows ink, not paper */
html {
  background: #17130d;
}

/* the matching band below: bottom overscroll reveals ink as well */
body::before {
  content: "";
  position: fixed;
  bottom: -600px;
  left: 0;
  right: 0;
  height: 612px;
  z-index: 950;
  pointer-events: none;
  background: #17130d;
}

/* a slim black band frames the very top of the sheet, Malle-label style */
body::after {
  content: "";
  position: fixed;
  top: -600px;
  left: 0;
  right: 0;
  height: 608px;
  z-index: 950;
  pointer-events: none;
  background: #17130d;
}

/* ---------- header ---------- */
#header {
  position: relative;
  text-align: center;
  padding: 36px 48px 22px;
  background:
    url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='30'%20height='30'%3E%3Cpath%20d='M0%2015%20L15%200%20L30%2015%20L15%2030%20Z'%20fill='none'%20stroke='%239a1b12'%20stroke-width='0.8'%20opacity='.09'/%3E%3Ccircle%20cx='15'%20cy='15'%20r='1.1'%20fill='%239a1b12'%20opacity='.15'/%3E%3C/svg%3E") repeat top left / 30px 30px,
    radial-gradient(120% 140% at 50% -10%, #fdf4ec 0%, rgba(253, 244, 236, 0) 62%),
    linear-gradient(180deg, #fbf5ec 0%, var(--paper) 100%);
  border-bottom: 1px solid var(--line);
}

/* thin red rule pinned to the very top edge, like a Malle label frame */
#header::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 3px;
  background: var(--accent);
}

#gallery-kicker {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.34em;
  font-size: 10px;
  color: var(--accent);
  margin-bottom: 10px;
}

#gallery-name {
  position: relative;
  font-weight: 400;
  font-size: 34px;
  letter-spacing: 0.06em;
}

/* short centred red mark beneath the name */
#gallery-name::after {
  content: "";
  display: block;
  width: 40px;
  height: 2px;
  margin: 12px auto 0;
  background: var(--accent);
}

#gallery-tagline {
  margin-top: 10px;
  color: var(--muted);
}

/* ---------- nav (hairline rules) ---------- */
/* the width: 100% here and on #gallery/#viewing is load-bearing: as grid items
   these sections would otherwise shrink to their content instead of centering
   inside the 1180px measure */
#nav {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 16px 48px;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

#nav a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.25s ease;
}

#nav a:hover {
  color: var(--accent);
}

#search-box {
  margin-left: auto;
  width: 220px;
  padding: 8px 0;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-strong);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.1em;
}

#search-box::placeholder {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 10px;
}

#search-box:focus {
  outline: none;
  border-bottom-color: var(--accent);
}

/* ---------- the wall: a calm grid of works ---------- */
#gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 56px;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 52px 48px 40px;
}

@media (max-width: 860px) {
  #gallery {
    grid-template-columns: 1fr;
    gap: 64px;
  }
}

.artwork {
  display: block;
  text-decoration: none;
  color: inherit;
}

.artwork-image {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--paper-2);
  overflow: hidden;
  box-shadow: 0 1px 0 var(--line);
}

.artwork-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.artwork:hover .artwork-image img {
  opacity: 0.92;
  transform: scale(1.012);
}

.artwork-info {
  padding-top: 18px;
}

.artwork-title {
  font-size: 17px;
  font-style: italic;
  letter-spacing: 0.01em;
}

.artwork-artist {
  margin-top: 8px;
  color: var(--muted);
}

.artwork-price {
  margin-top: 10px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink);
}

/* ---------- detail / viewing room ---------- */
#viewing {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 44px 48px 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 72px;
  justify-content: center;
  align-items: flex-start;
}

/* the frame has no border, so #plate's 32px inset is the exact
   gap the spec measures: a generous white museum mat */
#frame {
  position: relative;
  width: 380px;
  height: 500px;
  background: var(--paper-2);
  box-shadow:
    inset 0 0 0 1px var(--line-strong),
    0 24px 50px rgba(23, 20, 15, 0.16);
}

#plate {
  position: absolute;
  top: 32px;
  left: 32px;
  right: 32px;
  bottom: 32px;
  overflow: hidden;
  background: var(--paper);
}

#plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* small "Acquired" tab overhanging the top-right corner */
#sold-ribbon {
  position: absolute;
  top: -11px;
  right: -11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 78px;
  height: 22px;
  background: var(--accent);
  color: #f6ece9;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

#caption-block {
  width: 260px;
  padding-top: 12px;
}

#work-title {
  font-weight: 400;
  font-style: italic;
  font-size: 26px;
  letter-spacing: 0.01em;
}

#work-artist {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

#work-medium {
  margin-top: 26px;
  color: var(--muted);
}

#work-dims {
  margin-top: 6px;
  color: var(--muted);
}

#work-price {
  margin-top: 26px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.08em;
}

#back-link {
  display: inline-block;
  margin-top: 34px;
  color: var(--ink);
  text-decoration: none;
}

#back-link:hover {
  color: var(--accent);
}

/* ---------- footer ---------- */
#footer {
  text-align: center;
  color: var(--muted);
  padding: 56px 48px 64px;
  margin-top: 40px;
  border-top: 1px solid var(--line);
  border-bottom: 12px solid #17130d;
  font-size: 9.5px;
}

/* ---------- draggable Editor's Pick card ---------- */
#featured-badge {
  position: fixed;
  top: 326px;
  left: calc(50% + 20px);
  width: 184px;
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  padding: 16px 16px 18px;
  z-index: 500;
  cursor: grab;
  user-select: none;
  box-shadow: 0 12px 30px rgba(23, 20, 15, 0.14);
}

#featured-badge.dragging {
  cursor: grabbing;
  box-shadow: 0 18px 40px rgba(23, 20, 15, 0.22);
}

#featured-badge .badge-title {
  font-family: var(--sans);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 10px;
}

#featured-badge .badge-content {
  font-size: 13px;
  line-height: 1.55;
}

#featured-badge .badge-content strong {
  font-weight: 400;
  font-style: italic;
}

#colophon {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 0.08em;
  opacity: 0.55;
}

#nav a.active {
  color: #9c2b23;
}

#legal-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: inherit;
  opacity: 0.55;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

#legal-link:hover {
  opacity: 0.85;
}
