:root {
  color-scheme: light;
  --paper: #f6f4ec;
  --white: #fffef8;
  --ink: #172a22;
  --green: #254a39;
  --muted: #4f6054;
  --line: #d6dbce;
  --serif: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif CJK JP", serif;
  font-family: "Hiragino Sans", "Yu Gothic", Meiryo, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, h3, p, figure { margin: 0; }
a { color: inherit; text-underline-offset: .25em; }
:focus-visible { outline: 3px solid #98641e; outline-offset: 4px; }
button, input { font: inherit; }

.shell { max-width: 1296px; width: calc(100% - 96px); margin-inline: auto; }
.skip { position: absolute; z-index: 1; left: 16px; top: 12px; padding: 12px; background: var(--white); }
.skip:not(:focus) { clip-path: inset(50%); }

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
}

.masthead a, .footer a { font-size: .8rem; font-weight: 650; }
.masthead a { text-decoration: none; }
.masthead a:hover { text-decoration: underline; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: Georgia, serif;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .11em;
}
.brand-divider { display: block; height: 13px; width: 1px; background: #708074; transform: rotate(24deg); }

.hero {
  position: relative;
  overflow: hidden;
  color: #fffbed;
  background: #203c30;
  border-radius: 16px;
}

.hero-with-photo {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

.hero-copy { padding: clamp(32px, 4.1vw, 70px); align-self: center; }
.unofficial {
  display: inline-block;
  font-size: .72rem;
  letter-spacing: .12em;
  border: 1px solid #9dae97;
  border-radius: 99px;
  padding: 3px 12px;
  margin-bottom: 21px;
}

h1, h2 { font-family: var(--serif); }
h1 { font-size: clamp(2.3rem, 4vw, 4.35rem); line-height: 1.23; letter-spacing: .025em; }
.intro { margin-top: 21px; color: #e2ebde; font-size: clamp(.85rem, 1.1vw, 1rem); }
.collection {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  color: #e4ecdf;
  margin-top: 29px;
  padding-top: 15px;
  border-top: 1px solid #688073;
  font-size: .83rem;
}
.collection b { color: #f5dcc0; font: 400 1.75rem/1.1 Georgia, serif; }
.hero-photo { position: relative; min-height: 100%; }
.hero-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 54%; }
.hero-photo figcaption {
  position: absolute;
  bottom: 12px;
  right: 13px;
  padding: 3px 9px;
  border-radius: 4px;
  background: #12231ee8;
  color: #fffbed;
  font-size: .68rem;
}

.catalog { margin-top: 43px; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 15px; }
h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); letter-spacing: .025em; }
#count { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 15px 27px;
  align-items: end;
  padding: 17px 20px 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 22px;
}
.search label, legend { display: block; padding: 0; margin-bottom: 6px; font-size: .78rem; font-weight: 700; }
.search input {
  width: 100%;
  min-height: 46px;
  padding: 8px 13px;
  border: 1px solid #a0ada1;
  border-radius: 7px;
  background: #fdfdf8;
  color: var(--ink);
}
.search input::placeholder { color: #536759; opacity: 1; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.sizes { display: flex; flex-wrap: wrap; gap: 5px; }
.sizes label { position: relative; cursor: pointer; }
.sizes input { position: absolute; inset: 0; margin: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.sizes span {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 46px;
  padding: 5px 10px;
  border: 1px solid #c3cec1;
  border-radius: 7px;
  color: var(--green);
  font-size: .8rem;
  font-weight: 700;
}
.sizes label:hover span { background: #e8eee1; }
.sizes input:checked + span { background: var(--green); color: #fff; border-color: var(--green); }
.sizes input:focus-visible + span { outline: 3px solid #98641e; outline-offset: 2px; }

.horse-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.horse {
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: var(--white);
}
.horse h3 { padding: 12px 16px; font-size: 1rem; background: #e8ede0; letter-spacing: .025em; }
.editions { list-style: none; padding: 0 15px; margin: 0; }
.edition { padding: 9px 0 11px; }
.edition + .edition { border-top: 1px solid var(--line); }
.edition-title { font-size: .86rem; font-weight: 650; overflow-wrap: anywhere; }
.edition-note { display: block; font-size: .75rem; font-weight: 500; color: var(--muted); }
.size-links { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.size-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 3px 9px;
  border: 1px solid #d4decf;
  border-radius: 6px;
  font-size: .74rem;
  font-weight: 700;
  text-decoration: none;
}
.size-link:hover { border-color: var(--green); background: #edf1e7; }

.empty { text-align: center; padding: 28px 16px; border: 1px dashed #9fad9f; border-radius: 10px; }
.empty button {
  margin-top: 10px;
  min-height: 44px;
  border: 1px solid var(--green);
  border-radius: 6px;
  padding: 6px 12px;
  color: #fff;
  background: var(--green);
  cursor: pointer;
}
.empty button:hover { background: #173428; }
.about { border-top: 1px solid #a9b6a8; padding-top: 23px; margin-top: 49px; }
.about p { margin-top: 9px; color: var(--muted); max-width: 68ch; font-size: .87rem; }
.sources { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; padding: 0; font-size: .85rem; }
.footer { border-top: 1px solid var(--line); margin-top: 28px; padding-block: 14px 23px; }

@media (max-width: 960px) {
  .shell { width: calc(100% - 48px); }
  .hero-copy { padding: 30px; }
  .horse-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .desktop-break { display: none; }
}

@media (max-width: 620px) {
  .shell { width: calc(100% - 32px); }
  .masthead { min-height: 58px; }
  .brand { font-size: .76rem; gap: 6px; }
  .masthead a { font-size: .73rem; }
  .hero-with-photo { display: block; }
  .hero-copy { padding: 24px; }
  .unofficial { margin-bottom: 12px; }
  h1 { font-size: clamp(1.9rem, 8vw, 2.7rem); }
  .intro { margin-top: 12px; }
  .collection { margin-top: 16px; padding-top: 11px; }
  .collection b { font-size: 1.4rem; }
  .hero-photo { min-height: 0; aspect-ratio: 2.05; }
  .hero-photo img { object-position: center 34%; }
  .catalog { margin-top: 30px; }
  .filters { grid-template-columns: 1fr; padding: 13px; gap: 12px; }
  .size-link { min-height: 44px; }
  .horse-list { grid-template-columns: 1fr; gap: 10px; }
  #count { font-size: .76rem; white-space: nowrap; }
}
