/* Quarter Master Design — "Gallery at Dusk" theme
   Evolution of the original 2001 palette: slate #5E70A6 band over periwinkle #CCCCFF,
   reworked as a quiet museum-catalogue look on warm canvas paper. */

:root {
  --indigo: #353f63;        /* deep slate-indigo: header, footer */
  --slate: #5e70a6;         /* original brand slate: links, rules */
  --slate-dark: #46557f;
  --peri: #c9cfec;          /* periwinkle: tags, selected tab */
  --peri-wash: #eef0f8;     /* pale periwinkle panels */
  --canvas: #faf8f3;        /* warm paper background */
  --ink: #262b3d;           /* body text */
  --ink-soft: #5a607a;
  --brass: #a87f3d;         /* warm accent: the cannery lamp */
  --rule: #d8d4c8;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", -apple-system, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- base ---------- */

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* gradient side rails — homage to the original left_grad/right_grad gifs */
@media (min-width: 1280px) {
  body::before,
  body::after {
    content: "";
    position: fixed;
    top: 0;
    bottom: 0;
    width: 18px;
    z-index: 50;
    pointer-events: none;
  }
  body::before { left: 0; background: linear-gradient(90deg, var(--indigo), rgba(53, 63, 99, 0)); }
  body::after { right: 0; background: linear-gradient(270deg, var(--indigo), rgba(53, 63, 99, 0)); }
}

img { max-width: 100%; height: auto; }

a { color: var(--slate-dark); text-decoration-color: var(--peri); text-underline-offset: 3px; }
a:hover { color: var(--brass); text-decoration-color: var(--brass); }

::selection { background: var(--peri); color: var(--indigo); }

/* ---------- masthead ---------- */

.qm-masthead {
  background: linear-gradient(180deg, var(--indigo) 0%, #3d4870 100%);
  color: #e8ebf7;
  text-align: center;
  padding: 2.4rem 1rem 1.6rem;
  border-bottom: 4px solid var(--peri);
}

.qm-masthead .brand {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  letter-spacing: 0.04em;
  margin: 0;
  line-height: 1.1;
}

.qm-masthead .brand a { color: #fff; text-decoration: none; }
.qm-masthead .brand a:hover { color: var(--peri); }

.qm-masthead .tagline {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  color: var(--peri);
  margin: 0.6rem 0 0;
}

/* ---------- tab nav (echo of the original image-button tabs) ---------- */

.qm-nav {
  background: var(--indigo);
  border-bottom: 1px solid var(--slate-dark);
  position: sticky;
  top: 0;
  z-index: 100;
}

.qm-nav.scrolled { box-shadow: 0 3px 14px rgba(38, 43, 61, 0.35); }

.qm-nav .nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.qm-nav a.tab {
  display: block;
  padding: 0.85rem 1.15rem;
  color: #cdd3ea;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

.qm-nav a.tab:hover { color: #fff; border-bottom-color: var(--slate); }

.qm-nav a.tab.selected {
  color: var(--indigo);
  background: var(--peri);
  border-bottom-color: var(--brass);
}

.qm-nav .nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--slate);
  color: #cdd3ea;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 0.55rem 1.1rem;
  margin: 0.55rem auto;
  cursor: pointer;
}

@media (max-width: 700px) {
  .qm-nav .nav-toggle { display: block; }
  .qm-nav .nav-inner { display: none; flex-direction: column; padding-bottom: 0.5rem; }
  .qm-nav .nav-inner.open { display: flex; }
  .qm-nav a.tab { width: 100%; text-align: center; }
}

/* ---------- room strip (gallery pagination homage: "Page: | 1 | 2 |") ---------- */

.room-strip {
  background: var(--peri-wash);
  border-bottom: 1px solid var(--rule);
  text-align: center;
  padding: 0.55rem 1rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

.room-strip .room-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--slate-dark);
  margin-right: 0.5rem;
}

.room-strip a { margin: 0 0.15rem; }
.room-strip .here { font-weight: 700; color: var(--brass); margin: 0 0.15rem; }
.room-strip .sep { color: var(--rule); margin: 0 0.3rem; }

/* ---------- main column ---------- */

main.qm-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}

main.qm-main h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.85rem, 4vw, 2.7rem);
  line-height: 1.18;
  color: var(--indigo);
  margin: 0 0 1.4rem;
}

main.qm-main h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.5rem;
  color: var(--indigo);
  margin: 2.6rem 0 0.9rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--rule);
}

main.qm-main h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--slate-dark);
  margin: 1.8rem 0 0.6rem;
}

main.qm-main p { margin: 0 0 1.2rem; }

main.qm-main ul, main.qm-main ol { margin: 0 0 1.4rem; padding-left: 1.3rem; }
main.qm-main li { margin-bottom: 0.55rem; }

main.qm-main strong { color: var(--indigo); }

/* drop cap on the opening paragraph */
main.qm-main h1 + p::first-letter {
  font-family: var(--serif);
  font-size: 3.1em;
  line-height: 0.85;
  float: left;
  padding: 0.08em 0.12em 0 0;
  color: var(--slate);
}

/* ---------- matted print figure (museum treatment) ---------- */

figure.qm-print {
  margin: 2.2rem 0 2.4rem;
  background: #fff;
  border: 1px solid var(--rule);
  outline: 1px solid var(--indigo);
  outline-offset: -7px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(38, 43, 61, 0.13);
}

figure.qm-print img { display: block; width: 100%; }

figure.qm-print figcaption {
  padding: 0.85rem 0.4rem 0.15rem;
  text-align: center;
}

figure.qm-print .label-no {
  display: block;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--brass);
  margin-bottom: 0.2rem;
}

figure.qm-print .label-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.98rem;
  color: var(--ink-soft);
}

/* ---------- footer ---------- */

footer.qm-footer {
  background: var(--indigo);
  color: #b9c0de;
  border-top: 4px solid var(--peri);
  padding: 3rem 1.25rem 2.2rem;
  font-size: 0.92rem;
}

footer.qm-footer .foot-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
}

footer.qm-footer h4 {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  color: var(--peri);
  margin: 0 0 0.8rem;
}

footer.qm-footer ul { list-style: none; margin: 0; padding: 0; }
footer.qm-footer li { margin-bottom: 0.45rem; }
footer.qm-footer a { color: #dde1f2; text-decoration: none; }
footer.qm-footer a:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--brass); }

footer.qm-footer .colophon {
  max-width: 1080px;
  margin: 2.4rem auto 0;
  padding-top: 1.4rem;
  border-top: 1px solid var(--slate-dark);
  text-align: center;
  font-size: 0.8rem;
  color: #8d96bd;
}

/* ---------- 404 ---------- */

.lost-room { text-align: center; padding: 4rem 1rem; }
.lost-room .big {
  font-family: var(--serif);
  font-size: 5rem;
  color: var(--peri);
  line-height: 1;
  margin: 0 0 1rem;
}
