/* Mister End Grain: warm editorial reference style. No external fonts or frameworks. */
:root {
  --paper: #faf7f2; --surface: #fff; --ink: #1f1a14; --muted: #6b6157; --rule: #e7dfd3;
  --oak: #a8692c; --oak-deep: #7a4a1d; --walnut: #4a3020; --chip: #f1e8da;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px; --gutter: 16px; --max: 76rem;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #16120e; --surface: #1f1a15; --ink: #f1ebe3; --muted: #b3a796; --rule: #3a3027; --oak: #d39a5c; --oak-deep: #e7b57f; --walnut: #e9d6c0; --chip: #2a221b; }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1.0625rem/1.65 var(--sans); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--oak-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--oak); }
:focus-visible { outline: 2px solid var(--oak); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; color: var(--walnut); font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); margin: .2em 0 .3em; letter-spacing: -.01em; }
h2 { font-size: clamp(1.4rem, 1.2rem + .8vw, 1.8rem); margin: 2em 0 .6em; }
h3 { font-size: 1.2rem; margin: 1.5em 0 .4em; }
p { text-wrap: pretty; }
.container { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 42rem; padding-block: 3rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 0; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); background: var(--surface); }
.header-inner { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding-block: .75rem; }
.brand { display: flex; align-items: center; gap: .5rem; font: 600 1.25rem var(--serif); color: var(--walnut); text-decoration: none; }
.search { position: relative; flex: 1 1 14rem; max-width: 26rem; margin-left: auto; }
.search input { width: 100%; padding: .55rem .8rem; border: 1px solid var(--rule); border-radius: 999px; background: var(--paper); color: var(--ink); font: inherit; font-size: .95rem; }
.search-results { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: .25rem; list-style: none; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: 0 8px 24px rgb(0 0 0 / .08); }
.search-results a { display: block; padding: .45rem .6rem; border-radius: 6px; text-decoration: none; color: var(--ink); }
.search-results a small { display: block; color: var(--muted); font-size: .8rem; }
.search-results [aria-selected="true"] a, .search-results a:hover { background: var(--chip); }
.main-nav ul, .menu ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 1.1rem; flex-wrap: wrap; }
.main-nav { flex-basis: 100%; }
.main-nav a, .menu a { color: var(--ink); text-decoration: none; font-size: .95rem; }
.main-nav a[aria-current="page"] { color: var(--oak-deep); box-shadow: inset 0 -2px var(--oak); }
.menu { display: none; }
@media (max-width: 47.99rem) {
  .main-nav { display: none; }
  .menu { display: block; order: 2; }
  .menu summary { cursor: pointer; padding: .4rem .7rem; border: 1px solid var(--rule); border-radius: 999px; font-size: .9rem; list-style: none; }
  .menu[open] ul { flex-direction: column; gap: .6rem; padding: .75rem 0; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
}

/* Breadcrumbs & heads */
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: 1.25rem 0 0; font-size: .85rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "›"; margin-right: .35rem; }
.breadcrumbs a { color: var(--muted); }
.meta { color: var(--muted); font-size: .9rem; margin: 0 0 1rem; }
.meta a { color: inherit; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 46rem; }
.hub-head { padding-bottom: .5rem; }
.quick-answer { background: var(--chip); border-left: 3px solid var(--oak); border-radius: 0 var(--radius) var(--radius) 0; padding: .9rem 1.1rem; max-width: 48rem; }
.quick-answer p { margin: 0; }
.qa-label { font: 600 .75rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--oak-deep); margin-bottom: .3rem !important; }

/* Article */
.hero { margin: 1.5rem 0; max-width: 46rem; }
.hero img { border-radius: var(--radius); width: 100%; max-height: 30rem; object-fit: cover; }
.hero figcaption { font-size: .8rem; color: var(--muted); margin-top: .4rem; }
.article-layout { display: grid; gap: 2rem; }
.prose { max-width: 70ch; min-width: 0; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin: .25rem 0; }
.article-aside { min-width: 0; }
@media (min-width: 64rem) {
  .article-layout { grid-template-columns: minmax(0, 1fr) 19rem; align-items: start; }
  .article-aside { order: 2; position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; }
}
.toc { border: 1px solid var(--rule); border-radius: var(--radius); padding: .75rem 1rem; background: var(--surface); margin-bottom: 1rem; }
.toc summary { font-weight: 600; cursor: pointer; }
.toc ol { margin: .5rem 0 0; padding-left: 1.1rem; font-size: .9rem; }
.facts h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
.facts table { width: 100%; border-collapse: collapse; font-size: .9rem; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.facts th, .facts td { text-align: left; vertical-align: top; padding: .5rem .7rem; border-bottom: 1px solid var(--rule); }
.facts th { color: var(--muted); font-weight: 500; width: 42%; }
.facts tr:nth-child(even) { background: color-mix(in srgb, var(--chip) 50%, transparent); }
.profile { margin-top: 1rem; border: 1px solid var(--rule); border-radius: var(--radius); padding: .8rem 1rem; background: var(--surface); }
.profile p { margin: .2rem 0; }
.profile-name { font: 600 1.1rem var(--serif); }
.table-wrap { overflow-x: auto; margin: 1.25rem 0; border: 1px solid var(--rule); border-radius: var(--radius); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table-wrap th, .table-wrap td { padding: .55rem .75rem; text-align: left; border-bottom: 1px solid var(--rule); vertical-align: top; }
.table-wrap thead th { background: var(--chip); font-weight: 600; }
.table-wrap caption { text-align: left; padding: .6rem .75rem; color: var(--muted); font-size: .85rem; }
sup.cite { font-size: .7em; line-height: 0; margin-left: 1px; }
sup.cite a { text-decoration: none; color: var(--oak); font-weight: 600; }
sup.cite a:hover { text-decoration: underline; }
.faq-item { border-bottom: 1px solid var(--rule); padding: .7rem 0; }
.faq-item summary { cursor: pointer; font-weight: 600; }
.faq-item div { margin-top: .4rem; }
.sources ol { font-size: .9rem; padding-left: 1.4rem; }
.sources li { margin: .4rem 0; word-break: break-word; }
.sources li:target { background: var(--chip); border-radius: 4px; }
.editorial-note { margin-top: 2rem; font-size: .85rem; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 1rem; }

/* Cards */
.card-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); margin: 1rem 0 2rem; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s; position: relative; }
.card:hover { border-color: var(--oak); }
.card-thumb img, .thumb-placeholder { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; }
.thumb-placeholder { display: block; background: repeating-radial-gradient(circle at 30% 110%, #c99a63 0 6px, #b98650 6px 9px, #d3a874 9px 15px); }
.card-body { padding: .8rem 1rem 1rem; }
.card h3 { margin: 0 0 .35rem; font-size: 1.1rem; }
.card h3 a { color: var(--walnut); text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card p { margin: 0 0 .5rem; font-size: .9rem; color: var(--muted); }
.chip { display: inline-block; background: var(--chip); color: var(--oak-deep); border-radius: 999px; padding: .1rem .6rem; font-size: .78rem; font-weight: 600; }
.filters { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0 0; }
.filters button { font: inherit; font-size: .85rem; padding: .3rem .8rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--oak); border-color: var(--oak); color: #fff; }
.az-list { columns: 15rem; list-style: none; padding: 0; font-size: .92rem; }
.az-list li { break-inside: avoid; padding: .15rem 0; }
.related { margin-top: 3rem; border-top: 1px solid var(--rule); }

/* Listings */
.listing-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); }
.listing { border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem; background: var(--surface); }
.listing h3 { margin-top: 0; }
.listing p { margin: .3rem 0; font-size: .9rem; }
.listing-meta { color: var(--muted); font-size: .8rem !important; }
.city-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); }

/* Home */
.home-hero { background: var(--surface); border-bottom: 1px solid var(--rule); padding: 3rem 0; overflow: hidden; }
.home-hero-inner { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 56rem) { .home-hero-inner { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } }
.home-hero h1 { margin: 0 0 .2em; font-size: clamp(2.6rem, 1.6rem + 4vw, 4.6rem); letter-spacing: -.02em; }
.eyebrow { font: 600 .78rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--oak-deep); margin: 0; }
.search-hero { max-width: 34rem; margin: 1.5rem 0 0; }
.search-hero input { padding: .85rem 1.1rem; font-size: 1.05rem; border-width: 2px; }
/* End-grain block: concentric growth rings with an off-centre pith, like a sawn log face. */
.rings { aspect-ratio: 1; max-width: 22rem; width: 100%; justify-self: center; border-radius: 14px; transform: rotate(-3deg);
  background:
    radial-gradient(circle at 38% 58%, #5b3a1e 0 1.5%, transparent 2%),
    repeating-radial-gradient(circle at 38% 58%, #d9b07c 0 4px, #c2915a 4px 6px, #dcb583 6px 11px, #b9854e 11px 12.5px),
    #d2a46e;
  box-shadow: inset 0 0 0 10px rgb(255 255 255 / .12), 0 24px 48px -24px rgb(74 48 32 / .55); }
@media (max-width: 55.99rem) { .rings { display: none; } }
.tiles { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); margin: 2rem 0; }
.tile { display: flex; flex-direction: column; gap: .2rem; padding: 1rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); text-decoration: none; }
.tile:hover { border-color: var(--oak); }
.tile-label { font: 600 1.1rem var(--serif); color: var(--walnut); }
.tile-count { color: var(--muted); font-size: .85rem; }
.home-columns { display: grid; gap: 2rem; }
@media (min-width: 64rem) { .home-columns { grid-template-columns: minmax(0, 1fr) 20rem; } }
.hardest table { width: 100%; border-collapse: collapse; }
.hardest th, .hardest td { text-align: left; padding: .45rem 0; border-bottom: 1px solid var(--rule); font-size: .95rem; }
.hardest td { text-align: right; color: var(--muted); }

/* Hardness chart */
table.chart td[data-value] { white-space: nowrap; min-width: 9rem; }
.bar { display: block; height: 6px; width: var(--w); background: var(--oak); border-radius: 3px; margin-bottom: .25rem; }
table[data-sortable] thead th { cursor: pointer; user-select: none; }
table[data-sortable] th[aria-sort="ascending"]::after { content: " ▲"; font-size: .7em; }
table[data-sortable] th[aria-sort="descending"]::after { content: " ▼"; font-size: .7em; }
.button { display: inline-block; padding: .55rem 1rem; border-radius: 999px; background: var(--oak); color: #fff; text-decoration: none; font-weight: 600; font-size: .9rem; }
.button:hover { background: var(--oak-deep); color: #fff; }

/* Footer */
.site-footer { margin-top: 4rem; border-top: 1px solid var(--rule); background: var(--surface); font-size: .9rem; }
.footer-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); padding-block: 2rem; }
.site-footer h2 { font-size: 1rem; margin: 0 0 .5rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: .25rem 0; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--oak-deep); text-decoration: underline; }
.footer-bottom { border-top: 1px solid var(--rule); padding-block: 1rem; color: var(--muted); font-size: .8rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  .site-header, .article-aside, .related, .site-footer, .search { display: none; }
  .sources a::after { content: " (" attr(href) ")"; font-size: .8em; }
  body { background: #fff; color: #000; }
}
@media (min-width: 64rem) { .tiles { grid-template-columns: repeat(6, 1fr); } }
