/* yokofukada.com
   Keeps the look of the 2008 site (grey navigation column, white page,
   Gill Sans, green for the current page), with a layout that adapts to
   phones. Measurements in px follow the old stylesheet. */

:root {
  --ink: #211e1f;
  --green: #14904f;
  --grey: #f0eeef;
  --muted: #898989;
  --en: "Gill Sans", "Gill Sans MT", "Gill Sans Nova", Seravek, Calibri, "Trebuchet MS", sans-serif;
  --ja: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif;
}

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

html { color-scheme: light; }

body {
  margin: 0;
  background: var(--grey);
  color: var(--ink);
  font: 13px/2 var(--en);
}

[lang="ja"] { font-family: var(--ja); }

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

a { color: inherit; }
a:hover { color: var(--green); }

/* Frame: navigation column and page
   -------------------------------------------------------------------- */

.frame {
  display: grid;
  grid-template-columns: 203px minmax(0, 774px);
  min-height: 100vh;
}

main {
  background: #fff;
  padding: 90px 40px 60px 151px;
}

.side {
  padding: 62px 20px 40px 38px;
}

.side .name {
  display: block;
  font-size: 22px;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
}
.side .name:hover { color: inherit; }

.side ul {
  margin: 48px 0 0;
  padding: 0;
  list-style: none;
}

.side li { margin: 0 0 18px; line-height: 1.3; }

.side li a {
  display: inline-block;
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.06em;
}

.side li a span {
  display: block;
  font-size: 8px;
  font-weight: bold;
  letter-spacing: 0.05em;
}

.side li.on a { color: var(--green); }

.email {
  margin: 30px 0 0;
  color: var(--green);
  font-size: 10.5px;
  letter-spacing: 0.08em;
}
.email a { color: inherit; text-decoration: none; }
.email a:hover { text-decoration: underline; }

.copyright {
  margin: 220px 0 0;
  font-size: 9px;
}

/* The copyright line at the foot of the page, shown only on phones,
   where the navigation column becomes a bar across the top. */
.foot { display: none; }

/* Common pieces
   -------------------------------------------------------------------- */

h1, h2 {
  font-weight: normal;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

h1 { font-size: 18px; margin: 0 0 1em; }

figure { margin: 0; }

figcaption {
  text-align: right;
  font-size: 9.5px;
  line-height: 1.5;
  padding-top: 8px;
}

figcaption [lang="ja"] { font-size: 8px; }

.credit {
  color: var(--muted);
  font-size: 9.5px;
}

.text { max-width: 450px; }
.text p { margin: 0 0 1em; }

/* About me */
.page-aboutme main { padding-top: 140px; }

/* Works: a grid of thumbnails, each opening a pop-up
   -------------------------------------------------------------------- */

.page-works .frame { grid-template-columns: 203px minmax(0, 1160px); }
.page-works main { padding: 112px 40px 80px 60px; }

.works.gallery {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px 36px;
  align-items: start;
}
.works.gallery li { display: block; }
.works.gallery a { text-decoration: none; }

.works .thumb {              /* every thumbnail in the same 4:3 box */
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
}
.works .thumb img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border: none;
  outline: 2px solid transparent;
  outline-offset: 1px;
}
.works a:hover .thumb img,
.works a:focus-visible .thumb img { outline-color: var(--green); }

.works .caption { display: block; margin-top: 10px; font-size: 12px; line-height: 1.5; }
.works .caption [lang="ja"] { font-size: 11px; }

.hidden {                    /* visible to screen readers only */
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

@media (max-width: 1000px) {
  .works.gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .works.gallery { grid-template-columns: minmax(0, 1fr); gap: 36px; }
}

/* Jewellery: thumbnails and lightbox
   -------------------------------------------------------------------- */

.gallery {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 28px;
  align-items: center;
}

.gallery li { display: flex; justify-content: center; }
.gallery a { display: block; }

.jewellery.gallery img {
  max-height: 130px;
  width: auto;
  border: 1px solid #c8c8c8;
}

.jewellery.gallery a:hover img { border-color: var(--green); }

.page-jewellery .credit { margin-top: 3em; }

.lightbox {
  border: none;
  padding: 24px;
  max-width: 100vw;
  max-height: 100vh;
  background: #fff;
  cursor: zoom-out;
}
.lightbox::backdrop { background: rgba(240, 238, 239, 0.95); cursor: zoom-out; }
.lightbox .content > img { max-height: calc(100vh - 48px); width: auto; margin: 0 auto; }

/* Works pop-up: each picture enlarged up to 1.6 times (the originals
   are small), within the window; a pair side by side. */
.lightbox .pictures { display: flex; gap: 24px; align-items: flex-start; justify-content: center; }
.lightbox figure { margin: 0; }
.lightbox figure img {
  width: min(calc(var(--w) * 1.6), calc(100vw - 96px), calc((100vh - 150px) * var(--r)));
  height: auto;
}
.lightbox .pair figure img {
  width: min(calc(var(--w) * 1.6), calc(50vw - 84px), calc((100vh - 150px) * var(--r)));
}
.lightbox figcaption { text-align: right; font-size: 12px; line-height: 1.5; margin-top: 8px; }
.lightbox figcaption [lang="ja"] { font-size: 11px; }
.lightbox .credit { text-align: right; font-size: 11px; margin: 12px 0 0; }
@media (max-width: 760px) {    /* a pair stacked, sharing the height */
  .lightbox .pictures { flex-direction: column; align-items: center; gap: 16px; }
  .lightbox .pair figure img {
    width: min(calc(var(--w) * 1.6), calc(100vw - 96px), calc((50vh - 110px) * var(--r)));
  }
}

/* Tapestries
   -------------------------------------------------------------------- */

.page-tapestries .frame { grid-template-columns: 203px minmax(0, 1160px); }
.page-tapestries main { padding: 70px 40px 80px 60px; }

.tapestries h1,
.tapestries h2 {
  text-transform: uppercase;
  font-size: 30px;
  letter-spacing: 0.03em;
  margin: 0 0 0.8em;
}

.t-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px 40px;
  align-items: end;
  margin-bottom: 100px;
}
.t-head h1 { grid-column: 1 / -1; }
.covers { display: flex; gap: 16px; }
.cover { width: 290px; aspect-ratio: 290 / 415; }
.cover.small { width: 145px; }

.button {
  display: inline-block;
  border: 1px solid var(--ink);
  padding: 8px 26px;
  text-decoration: none;
  line-height: 1.6;
}
.button:hover { border-color: var(--green); }

.t-section {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 40px;
  margin-bottom: 110px;
}
.t-side { display: flex; flex-direction: column; }
.t-side .cover { margin-top: auto; }

.t-section.with-text { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.t-section.with-text .t-side { order: 2; }
.t-section.with-text h2 { font-size: 24px; }

.pieces {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--columns, 5), minmax(0, 1fr));
  gap: 48px 32px;
  align-items: end;
}
.with-text .pieces { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pieces li.wide { grid-column: 1 / -1; width: 80%; }
.piece { width: 100%; }
.tall .piece.placeholder { aspect-ratio: 3 / 10; }
.wide .piece.placeholder { aspect-ratio: 5 / 1; }

.placeholder {
  background: var(--grey);
  border: 1px dashed #bdbdbd;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  padding: 8px;
}

.caption {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.4;
}
.caption .num { font-weight: bold; margin-right: 0.4em; }

/* Tablets and narrow desktop windows: Tapestries in fewer columns */

@media (min-width: 761px) and (max-width: 1000px) {
  .page-tapestries main { padding-left: 32px; padding-right: 32px; }
  .t-head { grid-template-columns: minmax(0, 1fr); }
  .covers .cover { width: calc(50% - 8px); max-width: 290px; }
  .t-section,
  .t-section.with-text { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .t-section.with-text .t-side { order: 0; }
  .t-side .cover { display: none; }
  .pieces,
  .with-text .pieces { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Phones and narrow windows
   -------------------------------------------------------------------- */

@media (max-width: 760px) {
  body { font-size: 15px; line-height: 1.75; }

  .frame,
  .page-tapestries .frame,
  .page-works .frame {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr auto;
  }

  .side { padding: 20px 16px 12px; }
  .side ul {
    margin: 16px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
  }
  .side li { margin: 0; }
  .email { margin-top: 12px; }
  .copyright { display: none; }
  .foot { display: block; background: #fff; padding: 0 16px 24px; font-size: 11px; }
  .foot p { margin: 0; }

  main,
  .page-aboutme main, .page-works main,
  .page-tapestries main { padding: 28px 16px 48px; }

  .text { max-width: none; }

  figcaption { font-size: 11px; }
  figcaption [lang="ja"] { font-size: 10px; }
  .credit { font-size: 11px; }


  .jewellery.gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .jewellery.gallery img { max-height: 110px; }

  .tapestries h1, .tapestries h2 { font-size: 24px; }
  .t-head { grid-template-columns: minmax(0, 1fr); margin-bottom: 56px; }
  .covers .cover { width: calc(50% - 8px); }
  .t-section,
  .t-section.with-text { grid-template-columns: minmax(0, 1fr); gap: 20px; margin-bottom: 64px; }
  .t-section.with-text .t-side { order: 0; }
  .t-side .cover { display: none; }
  .pieces,
  .with-text .pieces { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
  .pieces li.wide { width: 100%; }
}

/* Tapestries: pieces with photographs */
.strips { display: flex; flex-direction: column; gap: 14px; }
.caption { display: flex; gap: 0.6em; align-items: baseline; }
.caption .num { margin-right: 0; flex: none; }
.square .piece { aspect-ratio: auto; }
.t-head .cover, .t-side .cover { height: auto; aspect-ratio: auto; }
