/* Ten By Ten wholesale catalog — white ground, deep green, cream rules
   (same family as the producer FAQ pages). */
:root {
  --ink: #1c2320;
  --muted: #5c6660;
  --green: #1a3a2a;
  --green-soft: #eef3ee;
  --rule: #d8d2c4;
  --cream: #faf8f3;
  --side-w: 270px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: #fff;
  line-height: 1.5;
}
a { color: var(--green); }
img { max-width: 100%; height: auto; }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 50;
  background: var(--green); color: #fff; padding: 8px 12px; border-radius: 8px;
}
.skip:focus { left: 8px; }

/* ---------- sidebar ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w);
  background: var(--cream);
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column;
  overflow-y: auto;
  z-index: 30;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 20px 18px;
  text-decoration: none; color: var(--ink);
  border-bottom: 1px solid var(--rule);
}
.brand img { border-radius: 10px; background: #fff; border: 1px solid var(--rule); padding: 4px; }
.brand-name { display: block; font-family: var(--serif); font-size: 1.25rem; font-weight: 700; line-height: 1.1; }
.brand-sub { display: block; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }

.nav { list-style: none; margin: 0; padding: 10px 10px 16px; }
.nav li { margin: 0; }
.nav li.home { margin-bottom: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--rule); }
.nav a {
  display: block;
  padding: 9px 12px 9px 14px;
  border-radius: 8px;
  border-left: 4px solid transparent;
  text-decoration: none;
  color: var(--ink);
}
.nav a:hover { background: #fff; }
.nav a:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.nav a[aria-current="page"] {
  background: #fff;
  border-left-color: var(--green);
  box-shadow: 0 1px 0 var(--rule), 0 0 0 1px var(--rule) inset;
}
.nav a[aria-current="page"] .nav-title { font-weight: 700; }
.nav-title { display: block; font-size: 0.97rem; font-weight: 500; line-height: 1.3; }
.nav-sub { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 1px; }

.side-foot { margin-top: auto; padding: 16px 20px 22px; border-top: 1px solid var(--rule); font-size: 0.85rem; }
.side-foot:empty { display: none; }
.side-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.side-mail { font-weight: 600; word-break: break-all; }

/* ---------- main column ---------- */
main { margin-left: var(--side-w); padding: 40px 48px 48px; outline: none; }
.page, .pager, .foot { max-width: 860px; margin: 0 auto; }
.loading { color: var(--muted); padding: 40px 0; }

.page h1.pname {
  font-family: var(--serif);
  font-size: 2.2rem; line-height: 1.15;
  margin: 0 0 4px;
  color: var(--ink);
}
.page h2.pname { font-family: var(--serif); font-size: 1.6rem; margin: 28px 0 4px; }
.page p { margin: 0 0 12px; font-size: 1.02rem; }
.page p.loc { color: var(--muted); font-size: 1rem; margin-bottom: 18px; }
.page .center { text-align: center; }
.page h3.sub {
  font-size: 1.05rem; margin: 28px 0 10px;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--green);
  border-bottom: 2px solid var(--rule); padding-bottom: 4px;
}
.page h3.sub strong { font-weight: 700; }
.page .gap { height: 14px; }
.page hr { border: 0; border-top: 1px solid var(--rule); margin: 24px 0; }
.page s { color: var(--muted); text-decoration-thickness: 2px; }

.figure { margin: 8px 0 22px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.figure img, .layout-cell img { border-radius: 10px; }
.docimg { display: inline-block; vertical-align: top; }

/* home page */
.page.home h1.pname { text-align: center; }
.page.home > p { max-width: 640px; margin-left: auto; margin-right: auto; }

/* changelog ("What's New") */
.changelog { max-width: 640px; margin: 20px auto 8px; border-top: 1px solid var(--rule); }
.log-entry { display: grid; grid-template-columns: 4.5rem 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.log-date { font-weight: 700; color: var(--green); font-variant-numeric: tabular-nums; padding-top: 1px; }
.log-items { margin: 0; padding-left: 1.1rem; }
.log-items li { margin: 0 0 4px; }
.log-items li:last-child { margin-bottom: 0; }

.doclist { margin: 0 0 14px; padding-left: 1.3rem; }
.doclist li { margin-bottom: 4px; }
.doclist .lvl-1 { margin-left: 1.4rem; list-style-type: circle; }
.doclist .lvl-2 { margin-left: 2.8rem; list-style-type: square; }
.doclist .lvl-3, .doclist .lvl-4 { margin-left: 4.2rem; }

/* image + text side by side */
.layout-row { display: flex; gap: 22px; align-items: flex-start; margin: 10px 0 20px; }
.layout-cell { flex: 1 1 0; min-width: 0; }
.layout-cell.media { display: flex; justify-content: center; }
.layout-cell .p { margin: 0 0 12px; font-size: 1.02rem; }
.layout-cell .p:last-child { margin-bottom: 0; }

/* ---------- product tables ---------- */
.catalog-wrap { margin: 14px 0 26px; }
table.catalog {
  width: 100%;
  border-collapse: separate; border-spacing: 0;
  table-layout: fixed;
  border: 1px solid var(--rule); border-radius: 12px;
  overflow: hidden;
  font-size: 0.97rem;
}
.catalog th, .catalog td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); }
.catalog tr:last-child > * { border-bottom: 0; }
.catalog tr.head th {
  background: var(--green); color: #fff;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  line-height: 1.3;
}
.catalog tr.head th strong { font-weight: 700; }
.catalog tr.sub th {
  background: var(--green-soft);
  color: var(--green);
  font-size: 0.85rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  padding-top: 9px; padding-bottom: 9px;
}
.catalog tr.item:nth-child(even) td { background: #fcfbf8; }
.catalog td .cell-line + .cell-line { margin-top: 2px; }
.catalog td s { font-weight: 400; }

/* ---------- pager + footer ---------- */
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; }
.pager a {
  display: flex; flex-direction: column;
  padding: 12px 16px; min-width: 0; max-width: 48%;
  border: 1px solid var(--rule); border-radius: 10px;
  text-decoration: none; color: var(--ink);
}
.pager a:hover { border-color: var(--green); }
.pager .next { text-align: right; margin-left: auto; }
.pager-label { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pager .prev .pager-label::before { content: "\2190  "; }
.pager .next .pager-label::after { content: "  \2192"; }
.pager-title { font-weight: 600; }

.foot { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.85rem; }
.foot p { margin: 0 0 4px; }

/* ---------- phones / narrow windows ---------- */
.topbar, .scrim { display: none; }

@media (max-width: 860px) {
  .topbar {
    display: flex; align-items: center; gap: 10px;
    position: sticky; top: 0; z-index: 20;
    background: #fff; border-bottom: 1px solid var(--rule);
    padding: 8px 12px;
  }
  .menu-btn {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 42px; padding: 0 14px;
    border: 1px solid var(--rule); border-radius: 10px;
    background: var(--cream); color: var(--ink);
    font: inherit; font-weight: 700; font-size: 0.95rem;
    cursor: pointer;
  }
  .menu-icon, .menu-icon::before, .menu-icon::after {
    display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 1px; position: relative;
  }
  .menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
  .menu-icon::before { top: -6px; }
  .menu-icon::after { top: 6px; }
  .topbrand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 0.95rem; min-width: 0; }
  .topbrand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .sidebar {
    width: min(86vw, 320px);
    transform: translateX(-102%);
    transition: transform 0.2s ease;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.18);
    visibility: hidden;
  }
  body.menu-open .sidebar { transform: none; visibility: visible; }
  body.menu-open { overflow: hidden; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(20, 30, 25, 0.35); z-index: 25; }
  .scrim[hidden] { display: none; }

  main { margin-left: 0; padding: 22px 16px 36px; }
  .page h1.pname { font-size: 1.75rem; }
  .layout-row { flex-direction: column; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}

/* Tables turn into one card per product on phones. */
@media (max-width: 640px) {
  table.catalog, .catalog tbody, .catalog tr, .catalog th, .catalog td { display: block; width: auto; }
  table.catalog { border: 0; border-radius: 0; overflow: visible; }
  .catalog colgroup { display: none; }
  .catalog tr.head { display: none; }
  .catalog tr.sub th {
    background: none; padding: 18px 2px 6px; border-bottom: 2px solid var(--rule);
    margin-bottom: 10px;
  }
  .catalog tr.item {
    border: 1px solid var(--rule); border-radius: 12px;
    padding: 10px 14px; margin-bottom: 10px;
    background: #fff;
  }
  .catalog tr.item:nth-child(even) td { background: none; }
  .catalog tr.item td { border: 0; padding: 3px 0; }
  .catalog tr.item td.empty { display: none; }
  .catalog tr.item td:first-child { font-size: 1.05rem; padding-bottom: 6px; }
  .catalog tr.item td[data-label]:not(:first-child) {
    display: grid; grid-template-columns: minmax(7.5rem, 40%) 1fr; gap: 10px;
    border-top: 1px solid #eee9de; padding: 6px 0;
  }
  .catalog tr.item td[data-label]:not(:first-child)::before {
    content: attr(data-label);
    color: var(--muted); font-size: 0.85rem; font-weight: 600;
  }
}

@media print {
  .sidebar, .topbar, .pager, .scrim, .skip { display: none !important; }
  main { margin: 0; padding: 0; }
}
