/* Episu catalog — paper index, not a card grid */
:root {
  --ink: #1c1915;
  --muted: #534c43;
  --paper: #f3eee4;
  --sheet: #fffdf8;
  --line: #ddd4c6;
  --pine: #1f4d3a;
  --pine-ink: #f4fbf6;
  --copper: #8c3a1e;
  --max: 1120px;
  --font: "Outfit", "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
}

.ep-site {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.ep-site h1,
.ep-site h2,
.ep-site h3 {
  font-family: var(--display);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--ink);
  margin: 0;
}
.ep-site a { color: inherit; }
.ep-site img { max-width: 100%; height: auto; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.md-skip,
.ep-site .md-skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 80;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
  font-weight: 650;
}
.md-skip:focus { top: 12px; }

.ep-page,
.md-page {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}
.ep-wrap,
.md-container {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}
.ep-main,
.md-main { flex: 1; padding: 28px 0 64px; }
.md-main--narrow { width: min(760px, calc(100% - 32px)); margin: 0 auto; }
.md-main--wide { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; }

.md-sticky { position: sticky; top: 0; z-index: 40; }
.md-header {
  background: color-mix(in srgb, var(--paper) 92%, white);
  border-bottom: 1px solid var(--line);
}
.md-header__bar {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.md-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--display);
  font-size: 30px;
  letter-spacing: -0.04em;
  font-weight: 650;
}
.md-logo::before {
  content: "EP";
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.md-nav-desktop { display: none; gap: 4px; }
.md-nav-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  text-decoration: none;
  font-weight: 650;
  font-size: 15px;
}
.md-nav-link:hover { text-decoration: underline; }
.md-header__tools { margin-left: auto; display: flex; gap: 8px; }
.md-icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
}
.md-icon-btn:hover { background: var(--sheet); }
.md-header-search { display: none; }
.md-header-search:not([hidden]) {
  display: block;
  padding: 0 0 14px;
}
.md-search-form { display: flex; gap: 8px; align-items: stretch; }
.md-search-field { position: relative; flex: 1; }
.md-panel {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.md-panel__nav { display: grid; padding: 8px 0 16px; }
.md-header-search[hidden],
.md-panel[hidden],
.md-suggest[hidden] { display: none !important; }

.ep-input,
.md-input,
.md-textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font: inherit;
  border-radius: 0;
}
.md-textarea { min-height: 140px; }
.ep-input:focus,
.md-input:focus,
.md-textarea:focus { outline: 2px solid var(--pine); outline-offset: 2px; }

.ep-btn,
.md-btn {
  min-height: 48px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--pine);
  color: var(--pine-ink);
  text-decoration: none;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  border-radius: 0;
}
.md-btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.md-btn--icon { width: 48px; padding: 0; }
.ep-btn:hover,
.md-btn:hover { filter: brightness(1.08); }
.md-btn.is-disabled { opacity: 0.45; pointer-events: none; }

.ep-hero { padding: 36px 0 8px; }
.ep-kicker,
.md-kicker {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--copper);
}
.ep-hero h1 { font-size: clamp(42px, 7vw, 84px); max-width: 12ch; }
.ep-lead,
.md-lead { color: var(--muted); font-size: 18px; max-width: 38rem; margin: 14px 0 0; }
.ep-hero__grid {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 32px;
  align-items: end;
}
.ep-search { display: flex; gap: 12px; align-items: end; margin-top: 22px; max-width: 36rem; }
.ep-search .ep-input { flex: 1; }
.ep-stats { margin: 0; display: grid; gap: 14px; border-top: 1px solid var(--ink); }
.ep-stats div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 10px 0; }
.ep-stats dt { font-family: var(--display); font-size: 32px; }
.ep-stats dd { margin: 0; color: var(--muted); align-self: end; }

.ep-section { padding: 42px 0; }
.ep-section-head,
.md-section-head { margin-bottom: 18px; }
.ep-section-head h2,
.md-section-head h2,
.md-page-title { font-size: clamp(32px, 4vw, 52px); }
.ep-section-head p,
.md-section-head p,
.md-muted { color: var(--muted); margin: 8px 0 0; }
.md-page-title { margin: 0; }

.ep-index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.ep-index a {
  display: grid;
  grid-template-columns: 48px 28px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.ep-index a:hover { background: color-mix(in srgb, var(--sheet) 70%, var(--paper)); }
.ep-num { font-family: var(--display); color: var(--copper); }
.ep-index__name { font-weight: 650; font-size: 18px; }
.ep-index__meta { color: var(--muted); font-size: 14px; }
.ep-index .ci,
.ep-index .ci-sm {
  width: 22px;
  height: 22px;
  border-radius: 0;
  background: none;
  color: var(--pine);
}
.ep-index .ci .ci-svg { width: 22px; height: 22px; }

.ep-rows,
.md-product-grid {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  border-top: 1px solid var(--ink);
  display: flex;
  flex-direction: column;
}
.md-product-card {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 8px 16px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}
.md-product-card__media {
  display: block;
  width: 72px;
  height: 72px;
  background: var(--sheet);
  position: relative;
}
.md-product-card__media img { width: 72px; height: 72px; object-fit: contain; }
.md-product-card__badge {
  position: static;
  display: inline;
  background: none;
  color: var(--copper);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.md-product-card__body h2 { margin: 0; }
.md-product-card__badge {
  text-decoration: none;
  white-space: nowrap;
}
.md-product-card h2 { font-size: 22px; }
.md-product-card h2 a { text-decoration: none; }
.md-product-card h2 a:hover { text-decoration: underline; }
.md-chip { margin: 0; color: var(--muted); font-size: 14px; }

.md-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 8px; }
.md-search-inline { display: flex; gap: 8px; align-items: end; min-width: min(100%, 320px); }
.md-bc { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.md-bc a { text-decoration: underline; }
.md-empty { margin: 32px 0; color: var(--muted); }

.md-pager, .md-pager-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.md-pager a, .md-pager span {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  text-decoration: none;
  background: var(--sheet);
}
.md-pager .is-current { background: var(--ink); color: var(--paper); }

.md-suggest {
  position: absolute;
  left: 0; right: 0; top: 100%;
  z-index: 30;
  background: var(--sheet);
  border: 1px solid var(--line);
}
.md-suggest__item, .md-suggest__empty {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 6px 10px;
  text-decoration: none;
}
.md-suggest__item:hover, .md-suggest__item:focus-visible { background: var(--paper); }
.md-suggest__img { width: 36px; height: 36px; object-fit: contain; }

.md-footer {
  margin-top: auto;
  background: var(--ink);
  color: #e6dfd4;
  padding: 36px 0 24px;
}
.md-footer a { color: #fff; }
.md-footer a:hover { text-decoration: underline; }
.md-footer__grid { display: grid; gap: 24px; }
.md-footer__brand { font-family: var(--display); font-size: 32px; color: #fff; margin: 0; }
.md-footer__nav, .md-footer__cats { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; }
.md-footer__nav a, .md-footer__cats a { min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; font-size: 14px; }
.md-footer .md-kicker { color: #e7c3b4; }
.md-footer-cms { margin-top: 8px; max-width: 36rem; color: #e6dfd4; font-size: 14px; }
.md-footer-cms p { margin: 0 0 8px; }
.md-copy { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.15); font-size: 13px; color: #cfc6ba; }

.md-form { display: grid; gap: 16px; margin-top: 20px; max-width: 36rem; }
.md-label { display: block; font-weight: 650; margin-bottom: 6px; }
.md-alert { margin: 16px 0; padding: 12px 14px; border: 1px solid var(--line); background: var(--sheet); }
.md-alert--err { border-color: #8c3a1e; }
.md-prose { margin-top: 16px; max-width: 68ch; }
.md-prose a { text-decoration: underline; }
.md-404 { padding: 64px 0; }
.md-article { margin-top: 28px; }
.md-article__body { margin-top: 16px; white-space: pre-line; max-width: 68ch; }
.md-feature-product { margin-top: 20px; border-top: 1px solid var(--ink); padding-top: 16px; }
.md-feature-product__inner { display: flex; gap: 16px; align-items: center; }
.md-feature-product img { width: 120px; height: 120px; object-fit: contain; background: var(--sheet); }
.md-link-list, .md-review-list, .md-related { list-style: none; margin: 16px 0 0; padding: 0; }
.md-link-list a, .md-related a, .md-related__row, .md-review-card {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 56px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.md-related img, .md-review-card img { width: 56px; height: 56px; object-fit: cover; }
.md-section { margin-top: 32px; }

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--pine);
  outline-offset: 3px;
}

@media (min-width: 900px) {
  .md-nav-desktop { display: flex; }
  .md-header-nav-menu-btn { display: none; }
  .md-footer__grid { grid-template-columns: 1.1fr 1fr; }
}
@media (max-width: 720px) {
  .ep-hero__grid, .ep-search, .md-search-inline, .md-toolbar { grid-template-columns: 1fr; display: grid; }
  .ep-index a { grid-template-columns: 36px 22px 1fr; }
  .ep-index__meta { grid-column: 3; }
  .md-feature-product__inner { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .ep-btn, .md-btn { transition: none; }
}
