.agbook {
  --agbook-ink: #30291f;
  --agbook-muted: #645544;
  --agbook-line: rgba(73, 55, 29, .24);
  --agbook-accent: #794524;
  color: var(--agbook-ink);
  font: 1rem/1.5 "Helvetica Neue", Arial, sans-serif;
  background: #e7ddc5;
  border: 1px solid #cbbba1;
  box-shadow: 0 2px 0 #cfbda1, 0 4px 0 #f0e6d0, 0 6px 0 #c6b397;
  isolation: isolate;
  max-width: 100%;
}
.agbook, .agbook * { box-sizing: border-box; }
.agbook button { color: inherit; font: inherit; cursor: pointer; }
.agbook :is(button, a):focus-visible { outline: 3px solid var(--agbook-accent); outline-offset: 3px; }
.agbook-spread {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  background: #f2ead9;
}
.agbook-mat {
  min-width: 0;
  min-height: clamp(290px, 41vh, 440px);
  padding: clamp(22px, 4.6vw, 57px) clamp(21px, 3.6vw, 47px);
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(90deg, transparent 73%, rgba(85, 63, 31, .045) 94%, rgba(85, 63, 31, .16) 99%, rgba(85, 63, 31, .25)),
    linear-gradient(152deg, #f4eddc, #eadfc9 95%);
}
.agbook-print {
  width: 100%;
  min-width: 0;
  padding: clamp(6px, .7vw, 10px);
  background: #fff9ec;
  box-shadow: 0 1px 2px #594e3c55, 0 4px 9px -5px #46372399;
  transform: rotate(-1.4deg);
}
.agbook-photo { display: block; position: relative; cursor: zoom-in; color: #fff; text-decoration: none; }
.agbook-photo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(48vh, 450px);
  object-fit: contain;
  margin: 0;
}
.agbook-enlarge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  color: white;
  background: #1d1b17bf;
  opacity: 0;
  transition: opacity .18s;
}
.agbook-enlarge svg { width: 19px; height: 19px; }
.agbook-photo:is(:hover, :focus-visible) .agbook-enlarge { opacity: 1; }
.agbook-print.agbook-is-film { width: auto; max-width: 100%; transform: none; }
.agbook-print video {
  display: block;
  width: auto;
  height: clamp(200px, 37vh, 380px);
  max-width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: contain;
  background: #20211c;
}
.agbook-leaf {
  padding: clamp(24px, 4.4vw, 60px) clamp(22px, 3.2vw, 48px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  background:
    linear-gradient(90deg, rgba(91, 66, 35, .19), rgba(91, 66, 35, .06) 2%, transparent 9%),
    linear-gradient(128deg, #ece2cb, #f5eedd 85%);
}
.agbook-entry { margin: auto 0; }
.agbook p.agbook-subject {
  margin: 0 0 13px;
  font: 600 .73rem/1.35 ui-monospace, "SFMono-Regular", Menlo, monospace;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--agbook-muted);
}
.agbook h3.agbook-title {
  margin: 0;
  font: italic 400 clamp(2.05rem, 4.6vw, 4.4rem)/.98 "Instrument Serif", Georgia, "Times New Roman", serif;
  letter-spacing: -.045em;
  color: var(--agbook-ink);
  text-wrap: balance;
}
.agbook p.agbook-caption {
  max-width: 30ch;
  margin: 16px 0 0;
  color: #514535;
  font: 400 clamp(.93rem, 1.5vw, 1.08rem)/1.49 Georgia, "Times New Roman", serif;
}
.agbook-pagination { display: inline-flex; width: fit-content; align-items: center; gap: 12px; }
.agbook-pagination button {
  display: grid;
  place-items: center;
  border: 1px solid var(--agbook-line);
  border-radius: 50%;
  background: transparent;
  width: 40px;
  height: 40px;
  padding: 0;
  color: #513f2c;
}
.agbook-pagination button:hover { background: #e4d5b7; }
.agbook-pagination svg { width: 16px; height: 16px; }
.agbook-pagination [data-direction="-1"] svg { transform: rotate(180deg); }
.agbook-count { font: 500 .82rem/1 ui-monospace, "SFMono-Regular", Menlo, monospace; font-variant-numeric: tabular-nums; color: var(--agbook-muted); }
.agbook-strip {
  min-width: 0;
  display: flex;
  justify-content: center;
  gap: clamp(7px, 1.5vw, 19px);
  align-items: center;
  padding: 14px clamp(12px, 3vw, 35px);
  border-top: 1px solid var(--agbook-line);
  background: #e4d9c1;
}
.agbook-thumb {
  display: block;
  position: relative;
  width: clamp(40px, 8vw, 74px);
  min-height: 44px;
  aspect-ratio: 1.4;
  padding: 3px;
  border: 1px solid transparent;
  background: #f3eddf;
  box-shadow: 0 1px 2px #31271d36;
  opacity: .73;
}
.agbook-thumb[aria-current="page"] { opacity: 1; border-color: var(--agbook-accent); outline: 1px solid var(--agbook-accent); outline-offset: 2px; }
.agbook-thumb:hover { opacity: 1; }
.agbook-thumb img { display: block; width: 100%; height: 100%; aspect-ratio: inherit; object-fit: cover; }
.agbook-film {
  position: absolute;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  background: rgba(22, 20, 17, .8);
  border-radius: 50%;
  color: #fff;
}
.agbook-film svg { width: 9px; height: 9px; }

@media (max-width: 620px) {
  .agbook-spread { display: block; }
  .agbook-mat { min-height: 0; padding: 20px 21px 15px; background: #eee4cf; }
  .agbook-photo img { max-height: 32svh; }
  .agbook-print.agbook-is-film { padding: 4px; }
  .agbook-print video { height: clamp(160px, 33svh, 340px); }
  .agbook-leaf {
    display: block;
    position: relative;
    padding: 14px 20px;
    border-top: 1px solid #c7b99d;
    background: linear-gradient(#d8c9ae 0, #eee5d2 5px, #f1e8d7 15px);
  }
  .agbook p.agbook-subject { margin-bottom: 8px; }
  .agbook h3.agbook-title { font-size: clamp(1.8rem, 7.7vw, 2.4rem); }
  .agbook p.agbook-caption { margin-top: 8px; max-width: 38ch; }
  .agbook-pagination { margin-top: 10px; gap: 10px; }
  .agbook-pagination button { width: 44px; height: 44px; }
  .agbook-strip { padding: 10px 12px; gap: min(3vw, 12px); }
  .agbook-thumb { width: clamp(39px, 12vw, 55px); }
}
@media (prefers-reduced-motion: reduce) {
  .agbook * { transition: none; }
}
