/* totetray.com directory — paper index, A–Z bullets */
:root {
  --paper: #f4efe6;
  --paper-2: #ebe4d6;
  --ink: #1c1914;
  --muted: #5c564c;
  --rule: #d4cbb8;
  --chip: #fffdf8;
  --chip-edge: #cfc4ae;
  --link: #1c1914;
  --here: #efe8d8;
  --focus: #2c261c;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", Times, serif;
  --sans: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 1.55;
}

.skip {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 10;
  padding: 0.4rem 0.65rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.85rem;
  text-decoration: none;
}

.skip:focus { top: 0.6rem; }

.mast,
main,
footer {
  width: min(44rem, calc(100% - 2rem));
  margin-left: auto;
  margin-right: auto;
}

.mast {
  padding: 2.1rem 0 0.2rem;
}

.brand {
  margin: 0 0 0.85rem;
  font-family: var(--sans);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: clamp(1.7rem, 5.4vw, 2.35rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.18;
}

.lede {
  margin: 0.7rem 0 0;
  font-size: 1.12rem;
}

.hub {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.search-wrap {
  margin: 1.7rem 0 0.15rem;
}

.search-wrap label {
  display: block;
  margin: 0 0 0.4rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

#q {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--chip-edge);
  border-radius: 3px;
  background: var(--chip);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.3;
  appearance: none;
  -webkit-appearance: none;
}

#q::placeholder { color: #8a8274; }

#q:focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.status {
  min-height: 1.2em;
  margin: 0.45rem 0 0;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
}

.block { margin: 1.8rem 0 0; }
.block[hidden] { display: none; }
.block h2 {
  margin: 0 0 0.15rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.dir {
  margin: 1.35rem 0 0;
  padding: 1.05rem 0 0 1.15rem;
  border-top: 1px solid var(--rule);
  list-style: disc;
}

.dir li {
  margin: 0 0 0.72rem;
  padding: 0;
  color: var(--ink);
  line-height: 1.45;
}

.dir li[hidden] { display: none; }

.dir a {
  color: var(--link);
  font-weight: 600;
  text-underline-offset: 0.14em;
  word-break: break-word;
}

.dir a:hover { color: #000; }

.dir a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.dir .name {
  font-weight: 600;
}

.dir .here {
  color: var(--ink);
}

.dir .here .name { color: var(--muted); }

.tag {
  display: inline;
  margin-left: 0.2rem;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.empty {
  margin: 2rem 0 0;
  color: var(--muted);
}

.empty[hidden] { display: none; }

footer {
  margin-top: 2.6rem;
  padding: 1.1rem 0 2.4rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--muted);
}

footer p { margin: 0; }

footer a {
  color: var(--ink);
  text-underline-offset: 0.15em;
}

footer a:hover { color: #000; }

@media (max-width: 40rem) {
  body { font-size: 1.02rem; }
  .mast,
  main,
  footer { width: calc(100% - 1.6rem); }
  .mast { padding-top: 1.5rem; }
  .block { margin: 1.8rem 0 0; }
.block[hidden] { display: none; }
.block h2 {
  margin: 0 0 0.15rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.dir { padding-left: 1.05rem; }
  .dir li { margin-bottom: 0.85rem; }
}

/* Shared mobile — phones first. Do not remove. */
/* Same rules as /workspace/people-sites/MOBILE.css. Phones 375-430px:
   no horizontal scroll, single column below 720px, full-width X rail
   below 980px, title cap 1.65rem. Desktop >=980px unchanged. */

/* 1. No horizontal scroll; media and rails cannot blow the viewport. */
html, body { overflow-x: hidden; }
img, video, iframe, .x-media, .x-rail, table { max-width: 100%; }
body, main, .wrap, .article-body { overflow-wrap: anywhere; }

/* 7. Wide tables / pre scroll inside themselves instead of the page. */
table, pre, .table-wrap { max-width: 100%; overflow-x: auto; }

/* 8. Sticky mast must not cover in-page headings. */
h1, h2, h3, .post-title, .lead-copy .post-title, .section-head {
  scroll-margin-top: 4.5rem;
}

.home-body > *,
.lead,
.x-rail,
.card,
.home-grid { min-width: 0; }

/* 3 + 4. Below 980px: home-body is lead → x-rail → rest, full-width rail.
   Some sites never received this block. Harmless if those classes are absent. */
@media (max-width: 979px) {
  .home-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "lead"
      "x"
      "rest";
  }
  .home-body .lead { grid-area: lead; }
  .x-rail {
    grid-area: x;
    width: 100%;
    max-width: 100%;
    position: static;
  }
  .home-rest { grid-area: rest; }

  .x-rail, .x-card-link, .x-text { max-width: 100%; }

  /* Clamp tweet copy to 4–5 lines — no tweet walls. */
  .x-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    overflow: hidden;
  }

  .x-media { grid-template-columns: 1fr; }
  .x-media img {
    width: 100%;
    max-height: 10rem;
    object-fit: cover;
  }
}

/* 3 + 5 + 6 + 8. Phones (and small tablets under 720px): one column, readable type. */
@media (max-width: 719px) {
  .wrap { padding: 1rem 1rem 3rem; }
  .mast-inner {
    padding: 0.7rem 1rem 0.65rem;
    flex-wrap: wrap;
  }
  .brand { font-size: 1.1rem; }

  .lead,
  .home-grid,
  .card { grid-template-columns: 1fr; }

  .card img,
  .card-media img,
  .lead-media img,
  .hero img {
    max-width: 100%;
    height: auto;
  }
  .credit, figcaption { overflow-wrap: anywhere; }

  /* Cap titles. Lieber’s clamp(2rem, 4.2vw, 2.95rem) is too big on a 390px phone. */
  .post-title,
  .lead-copy .post-title {
    font-size: 1.65rem;
    line-height: 1.18;
  }

  nav.top a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0.45rem 0.2rem;
  }
  .x-open {
    display: inline-block;
    min-height: 2.75rem;
    padding: 0.55rem 0 0.2rem;
  }
}

/* Desktop ≥980px is owned by each site’s existing min-width: 980px rules.
   This file must not override that two-column lead + sticky 20rem X rail. */
