/* Sarah I'Anson Design Office
   Rebuilt from Wayback Machine captures (2026-05 generation).
   Tokens taken from the recovered Bricks/AutomaticCSS output. */

@font-face {
  font-family: "SIA";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url(../fonts/Antique-Legacy-Medium.woff2) format("woff2"),
       url(../fonts/Antique-Legacy-Medium.woff) format("woff");
}
@font-face {
  font-family: "SIA";
  font-weight: 500;
  font-style: italic;
  font-display: swap;
  src: url(../fonts/Antique-Legacy-Medium-Italic.woff2) format("woff2"),
       url(../fonts/Antique-Legacy-Medium-Italic.woff) format("woff");
}

:root {
  --primary: #909497;   /* page ground */
  --accent:  #f6f7f2;   /* type + grid blocks */
  --gap: 4px;
  --pad: 36px;      /* measured off the original: grid starts at x=36 */
  --head-top: 36px;
  --head-bottom: 19px;
}

*, *::before, *::after { box-sizing: border-box; }

html { background-color: var(--primary); }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "SIA", Georgia, serif;
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--accent);
  background-color: var(--primary);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
img { display: block; max-width: 100%; }

.skip {
  position: absolute; left: -9999px;
  padding: .5em 1em; background: var(--accent); color: var(--primary);
}
.skip:focus { left: var(--pad); top: var(--pad); z-index: 100; }

/* ---------- header ----------
   Rebuilt from the archived Bricks header, breakpoint for breakpoint:
   6 columns with no gap on desktop; 4 columns at ≤991 (Information then sits
   in an implicit 5th); hamburger replaces Information at ≤767; at ≤478 only
   the wordmark ("Sarah I'Anson Design Office") and the hamburger remain. */

.site-header {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  justify-items: start;
  align-items: center;
  padding: 36px 36px 18px;
  font-size: 14px;
  line-height: 14px;
}
.site-nav { display: contents; }
.wordmark-1 { grid-column: 1; letter-spacing: -0.02em; }
.wordmark-2 { grid-column: 2; margin-left: 2px; }
.nav-1 { grid-column: 4; }
.nav-2 { grid-column: 5; }
.nav-3 { grid-column: 6; }
.nav-1, .nav-2, .nav-3 { margin-left: 2px; }
.nav-1 a, .nav-2 a, .nav-3 a {
  display: block;
  border-bottom: 1px solid rgba(255, 0, 0, 0);
}
.site-header a:hover { text-decoration: none; }
.site-nav a[aria-current="page"] { border-bottom-color: var(--accent); }
.mobile { display: none; }

/* Hamburger: BricksExtras "slider" style, 40×24 drawn at half size. */
.nav-burger { display: none; grid-column: 6; }
.burger {
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.burger-box {
  position: relative;
  display: flex;
  width: 40px;
  height: 24px;
  transform: scale(.5);
  pointer-events: none;
}
.burger-inner,
.burger-inner::before,
.burger-inner::after {
  position: absolute;
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background-color: var(--accent);
  transition: transform .4s ease, opacity .4s ease;
}
.burger-inner { display: block; top: 2px; margin-top: -2px; }
.burger-inner::before, .burger-inner::after { display: block; content: ""; }
.burger-inner::before { top: 10px; }
.burger-inner::after { top: 20px; }
.burger[aria-expanded="true"] .burger-inner { transform: translate3d(0, 10px, 0) rotate(45deg); }
.burger[aria-expanded="true"] .burger-inner::before { transform: rotate(-45deg) translate3d(-5.71429px, -6px, 0); opacity: 0; }
.burger[aria-expanded="true"] .burger-inner::after { transform: translate3d(0, -20px, 0) rotate(-90deg); }

/* Slide-down menu under the header. menu.js animates the height. */
.mobile-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 99999;
  overflow: hidden;
  background-color: var(--primary);
  line-height: 21px;
}
.mobile-menu ul { margin: 0; padding: 0; list-style: none; }
.mobile-menu a { display: flex; padding: 10px 10px 10px 35px; }

/* ---------- home grid ---------- */

/* The home grid fills whatever height is left between header and footer. */
.home main { display: flex; padding: 0 var(--pad); }

.grid-container {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: var(--gap);
  min-height: 60vh;
  margin-bottom: 1px;   /* the original's 1px between grid and footer */
}
.grid-item { width: 100%; background-color: var(--accent); }

/* ---------- photo scroll ---------- */

/* Work page. Every photo is 500px tall at its own shape, so landscapes stay
   landscape and portraits stay portrait. No gap between frames. Markup: .scroll > ul.scroll-track > li > img, plus
   assets/js/scroll.js. */

.scroll {
  --frame-h: 500px;
  overflow-x: auto;
  scrollbar-width: none;
  cursor: grab;
}
.scroll::-webkit-scrollbar { display: none; }
.scroll.is-dragging { cursor: grabbing; }
.scroll:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }

.scroll-track {
  display: flex;
  width: max-content;
  margin: 0;
  padding: 0;
  list-style: none;
}
.scroll-track li { flex: none; }
.scroll-track img {
  width: auto;                 /* width follows each photo's own shape */
  height: var(--frame-h);
  max-width: none;
  background-color: rgba(246, 247, 242, 0.16);
  -webkit-user-drag: none;
  user-select: none;
}

/* ---------- generic page shell ---------- */

main { flex: 1 0 auto; padding: 0 var(--pad) 4rem; }

.page-title { font-size: inherit; font-weight: 500; margin: 0 0 1.5rem; }

.stack > * + * { margin-top: 1.5rem; }

/* ---------- image placeholders ----------
   Drop the real file into assets/img/ and it renders automatically.
   Until then the labelled block holds the correct aspect ratio. */

.shot {
  position: relative;
  margin: 0;
  aspect-ratio: var(--ar, 3 / 4);
  background-color: rgba(246, 247, 242, 0.16);
  outline: 1px solid rgba(246, 247, 242, 0.35);
  outline-offset: -1px;
  overflow: hidden;
}
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot figcaption {
  position: absolute; inset: auto 0 0 0;
  padding: .5em .6em;
  font-size: 11px;
  letter-spacing: 0;
  word-break: break-all;
  opacity: .85;
}
.shot img + figcaption { display: none; }
.shot:has(img) { outline: 0; background: none; }

/* ---------- gallery / work grids ---------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--gap);
}

.tile { display: block; }
.tile .meta { margin-top: .5rem; }
.tile .meta span { display: block; }

/* ---------- SI'A Gallery ---------- */

/* Each object spans from the left edge of the "S" in the "SI'A Gallery" nav
   link to the right edge of the "n" in "Information". These track the header
   columns: 6 equal columns on desktop, each nav link nudged 2px right, and
   "Information" set 72.5625px wide. */
.gallery { line-height: 16px; }
.gallery-item {
  margin-left: calc(50% + 2px);
  width: calc(100% / 3 + 72.5625px);
}
.gallery-item img { width: 100%; height: auto; }
.gallery-meta {
  display: flex;
  justify-content: space-between;
  padding: 10px 0 clamp(42.6453px, calc(42.6453px + 24.8547 * (100vw - 320px) / 960), 67.5px);
}
.gallery-meta a:hover { text-decoration: none; }

/* ---------- information ----------
   Matched to the archived page. Its spacing came from Automatic.css fluid
   tokens, which scale linearly between 320px and 1280px viewports; the same
   formulas are reproduced here so every breakpoint lines up, including the
   original's 30px (not 36px) left edge on wide screens. */

.info-page, .object-page {
  --ip-x:   clamp(24px, calc(24px + 6 * (100vw - 320px) / 960), 30px);
  --ip-xs:  clamp(10.6667px, calc(10.6667px + 2.6667 * (100vw - 320px) / 960), 13.3333px);
  --ip-xl:  clamp(42.6453px, calc(42.6453px + 24.8547 * (100vw - 320px) / 960), 67.5px);
  --ip-xxl: clamp(56.8462px, calc(56.8462px + 44.4038 * (100vw - 320px) / 960), 101.25px);
  --ip-s:   clamp(16px, calc(16px + 4 * (100vw - 320px) / 960), 20px);
}
.info-page {
  height: calc(100vh - 69px - 79px);   /* grows to fill on short pages, as the original did */
  padding: 112px var(--ip-x) 0;
  line-height: 21px;
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  justify-items: start;
  align-items: start;
}
.info-grid p { margin: 0; }
.info-label { padding-bottom: var(--ip-xs); }
.info-about { grid-column: span 3; padding-right: var(--ip-xxl); }
.info-about a { color: #fff; border-bottom: 1px solid #fff; }
.info-about a:hover { text-decoration: none; }
.info-keys p,
.info-values p { line-height: 18px; }

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

.notfound h1 { margin: 0 0 4px; font-size: inherit; font-weight: inherit; }
.notfound p { margin: 0; }
.notfound a { border-bottom: 1px solid var(--accent); }
.notfound a:hover { text-decoration: none; }

/* ---------- object pages ----------
   Matched to the archived object pages. Header swaps the nav for the
   object's name, number and a link back; no hamburger at any width. */

.object-header { line-height: 21px; }
.object-header .wordmark-1, .object-header .wordmark-2 { line-height: 14px; }
.oh-title { grid-column: 4; }
.oh-code { grid-column: 5; }
.oh-back { grid-column: 6; }
.oh-title, .oh-code, .oh-back a { line-height: 16px; letter-spacing: -0.02em; }

.object-page { padding: 0 var(--ip-x); line-height: 21px; }
.object-scroll { --frame-h: 500px; margin-bottom: var(--ip-s); }
.object-scroll li { position: relative; }
.object-scroll li::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.31);
  pointer-events: none;
  transition: opacity .6s ease;
}
/* Hovering a photo switches the lamp on: the dusk wash lifts. */
.object-scroll li:hover::before { opacity: 0; }
.object-scroll img { width: 400px; height: 500px; object-fit: cover; }

.object-info {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));   /* the email can't widen its column */
  justify-items: start;
  align-items: start;
}
.object-info p { margin: 0; }
.oi-desc { grid-column: span 3; padding-right: var(--ip-xxl); }
.object-info p, .oi-label { letter-spacing: -0.02em; }
.oi-desc p, .oi-label { line-height: 16px; }
/* Title sits on the "Edition" line; materials start on the "Enquire" line.
   Enquire's 18px line puts its text 1px lower than a 16px line would. */
.oi-desc p { padding-top: 1px; }
.oi-label { padding-bottom: var(--ip-xs); }
/* Gallery convention: a red dot beside the label means the work has sold. */
.sold-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 6px;
  border-radius: 50%;
  background: #e30613;
  vertical-align: 0.15em;
}
.oi-keys p, .oi-vals p { line-height: 18px; }

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

/* Measured off the archived page with its live Klaviyo form: wordmark on
   column 1, label on 5, the form on 6. The last column never drops below the
   form's 140px minimum, which is how the original behaved on narrow screens. */
.site-footer {
  display: grid;
  grid-template-columns: repeat(5, 1fr) minmax(140px, 1fr);
  gap: var(--gap);
  padding: 20px var(--pad) 44px;
}
.site-footer > a { grid-column: 1; align-self: center; justify-self: start; line-height: 20px; }
.subscribe-label {
  grid-column: 5;
  align-self: center;
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
}
.subscribe { grid-column: 6; align-self: center; display: flex; align-items: stretch; }
.subscribe input {
  flex: 1;
  min-width: 0;
  height: 20px;
  margin: 5px 0;          /* Klaviyo's field wrapper padding: makes the row 30px */
  padding: 0;
  font: 500 11px "SIA", Georgia, serif;
  letter-spacing: normal;
  color: #cbcbcb;
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  outline: 0;
}
.subscribe { position: relative; }
.subscribe-status {
  margin: 0;
  align-self: center;
  font-size: 11px;
  line-height: 20px;
  letter-spacing: normal;
  color: #cbcbcb;
}
/* Errors sit under the field so the email stays editable. */
.subscribe-status.is-error { position: absolute; top: 100%; left: 0; white-space: nowrap; }
.subscribe input::placeholder { color: #cbcbcb; opacity: 1; }
.subscribe input:hover,
.subscribe input:focus { border-bottom-color: #cbcbcb; }
.subscribe button {
  padding: 5px 0;
  font: 700 12px/12px Arial, "Helvetica Neue", Helvetica, sans-serif;
  color: #cbcbcb;
  background: none;
  border: 0;
  cursor: pointer;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- responsive ---------- */

@media (max-width: 991px) {
  .site-header { grid-template-columns: repeat(4, 1fr); }
  /* Header: 4 columns plus Information's own 74.5625px column at the end. */
  .gallery-item {
    margin-left: calc((100% - 74.5625px) / 2 + 2px);
    width: calc((100% + 74.5625px) / 2 - 2px);
  }
  .nav-1 { grid-column: 3; }
  .nav-2 { grid-column: 4; }
  .nav-3 { grid-column: 5; }
  .info-page { padding-left: 36px; }
  .object-page { padding-left: 36px; }
  .object-scroll { margin-bottom: 36px; }
  .object-info { padding-bottom: 36px; }
}

@media (max-width: 767px) {
  .info-page { padding-right: 36px; }
  .object-page { padding-right: 36px; }
  .object-info { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ip-xl); }
  .object-scroll { --frame-h: 500px; }
  .info-grid { grid-template-columns: repeat(2, 1fr); gap: var(--ip-xl); }
  .grid-container { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); }
  .grid-item:nth-child(n + 9) { display: none; }

  /* A 500px-tall strip is too big for a phone; scale it with the screen. */
  .scroll { --frame-h: min(500px, 90vw); }

  .nav-3 { display: none; }
  .nav-burger { display: flex; }
  /* Information is hidden here, so the right edge follows the hamburger
     icon's right edge instead (20px in from the margin). */
  .gallery-item { margin-left: calc((100% - 60px) / 2 + 2px); width: calc(50% + 8px); }
}

/* Phones: the original dropped the subscribe form entirely. */
@media (max-width: 478px) {
  .gallery-item { margin-left: 0; width: 100%; }
  .object-scroll { margin-top: 35px; }
  .oh-title, .oh-code { display: none; }
  .oh-back { grid-column: 4; display: flex; align-self: stretch; width: 100%; justify-content: flex-end; align-items: flex-end; }
  .oh-back a, .object-info p, .oi-label { font-size: 13px; }
  .oi-desc { padding-right: 0; width: 100%; }
  main, .home main, .object-page { padding-left: 14px; padding-right: 14px; }   /* original phone gutter */
  .grid-container {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 1fr);
    height: calc(100vh - 11px - 74px);
  }
  .site-header { grid-template-columns: repeat(2, 1fr); gap: 5px; padding: 14px 14px 13px; }
  .wordmark-1 { grid-column: span 3; font-size: 13px; }
  .mobile { display: inline-block; }
  .wordmark-2, .nav-1, .nav-2 { display: none; }
  .nav-burger { grid-column: 4; align-self: stretch; width: 100%; justify-content: flex-end; align-items: flex-end; }
  .mobile-menu { letter-spacing: -0.1px; }
  .mobile-menu a { padding: 0 10px 10px 15px; }
  .info-page { height: calc(95vh - 69px - 79px); padding: 50px 14px 0; }
  .info-grid { letter-spacing: -0.1px; }
  .info-about, .info-label { display: none; }
  .info-keys p, .info-values p { font-size: 13px; }
  .site-footer { padding: 14px 14px 16px; }
  .site-footer > a { font-size: 13px; line-height: 14px; }
  .subscribe-label, .subscribe { display: none; }
}

/* Original quirk: landscape screens up to 900px wide get the 4×2 grid. */
@media (orientation: landscape) and (max-width: 900px) {
  .grid-container { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); }
  .grid-item:nth-child(n + 9) { display: none; }
}

/* The menu only exists alongside the hamburger. */
@media (min-width: 768px) {
  .mobile-menu { display: none !important; }
}

/* ---------- print ----------
   Printing an object page produces a gallery room sheet. Other pages print
   plainly without the site chrome. */
@media print {
  @page { size: A4; margin: 16mm 16mm 18mm; }
  html, body { background: #fff; color: #000; }
  body { display: block; min-height: 0; font-size: 10pt; line-height: 1.4; }
  a { color: inherit; border: 0 !important; }
  .skip, .site-footer, .nav-burger, .mobile-menu { display: none !important; }

  .object-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0 0 4mm;
    border-bottom: .3pt solid #000;
    line-height: 1.4;
  }
  .object-header .mobile { display: inline; }
  .object-header .wordmark-2, .oh-title, .oh-back { display: none; }

  .object-page { height: auto; padding: 0; }
  .object-scroll { overflow: visible; margin: 10mm 0 8mm; cursor: auto; }
  .object-scroll .scroll-track { display: block; width: auto; }
  .object-scroll li:not(:first-child) { display: none; }
  .object-scroll li::before { display: none; }
  .object-scroll img { width: 95mm; height: auto; aspect-ratio: auto; object-fit: contain; }

  .object-info { display: block; padding: 0; }
  .oi-desc { padding: 0 0 6mm; }
  .oi-desc .oi-label { font-size: 12pt; padding-bottom: 1mm; }
  .oi-keys, .oi-vals { display: inline-block; vertical-align: top; margin-right: 14mm; }
  .oi-label, .object-info p { line-height: 1.4; padding-bottom: 0; }
  .sold-dot { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  .object-page::after {
    content: "Sarah I\2019 Anson Design Office \00B7  SI\2019 A Gallery \00B7  Sydney \00B7  sarahianson.com";
    display: block;
    margin-top: 12mm;
    padding-top: 3mm;
    border-top: .3pt solid #000;
    font-size: 8pt;
  }
}
