/*
 * BurghList — site chrome and list-page skeleton.
 *
 * Everything here is structure and neutral chrome. It must survive having any
 * theme stylesheet loaded on top of it, so it deliberately keeps specificity
 * low and expresses every visual decision through custom properties a theme
 * can redefine.
 *
 * The chrome itself is near-monochrome on purpose: the colour on the homepage
 * comes entirely from each list's own theme swatch.
 */

/* The reset lives in reset.css, loaded by both layouts. */

/* ─── chrome tokens ─────────────────────────────────────────────────── */

:root {
  --paper:     #F7F4EF;
  --paper-2:   #EDE7DC;
  --surface:   #FFFFFF;
  --ink:       #211E1A;
  --ink-soft:  #6B6459;
  --rule:      #D9D1C4;
  --focus:     #2F4858;
  --shadow:    rgba(33, 30, 26, .14);

  --nav-bg:    #211E1A;
  --nav-fg:    #F7F4EF;

  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino,
                  "Book Antiqua", Georgia, serif;
  --font-ui:      "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --font-mono:    ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --measure: 65ch;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:    #17150F;
    --paper-2:  #211E17;
    --surface:  #262219;
    --ink:      #F2EDE3;
    --ink-soft: #B4AA99;
    --rule:     #3E382C;
    --focus:    #8FC2D4;
    --shadow:   rgba(0, 0, 0, .5);
    --nav-bg:   #0E0D09;
    --nav-fg:   #F2EDE3;
  }
}

:root[data-theme="dark"] {
  --paper:    #17150F;
  --paper-2:  #211E17;
  --surface:  #262219;
  --ink:      #F2EDE3;
  --ink-soft: #B4AA99;
  --rule:     #3E382C;
  --focus:    #8FC2D4;
  --shadow:   rgba(0, 0, 0, .5);
  --nav-bg:   #0E0D09;
  --nav-fg:   #F2EDE3;
}

:root[data-theme="light"] {
  --paper:    #F7F4EF;
  --paper-2:  #EDE7DC;
  --surface:  #FFFFFF;
  --ink:      #211E1A;
  --ink-soft: #6B6459;
  --rule:     #D9D1C4;
  --focus:    #2F4858;
  --shadow:   rgba(33, 30, 26, .14);
  --nav-bg:   #211E1A;
  --nav-fg:   #F7F4EF;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  width: min(1180px, 92vw);
  margin-inline: auto;
}

/* ─── nav ───────────────────────────────────────────────────────────── */

.site-nav {
  background: var(--nav-bg);
  color: var(--nav-fg);
  position: relative;
  z-index: 20;
}

.site-nav__inner {
  width: min(1180px, 92vw);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 58px;
}

.wordmark {
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: .12em;
  line-height: 1;
}
/* Two voices in one wordmark — a nod to the premise that every list here
   wears a different face. */
.wordmark__burgh {
  font-family: var(--font-ui);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .95rem;
}
.wordmark__list {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
}

.site-nav__links {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 1.5rem;
  font-size: .82rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.site-nav__links a {
  text-decoration: none;
  opacity: .82;
  padding: .4rem 0;
  border-bottom: 1px solid transparent;
}
.site-nav__links a:hover { opacity: 1; border-bottom-color: currentColor; }

/* ─── footer ────────────────────────────────────────────────────────── */

.site-footer {
  margin-top: 5rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--rule);
  background: var(--paper-2);
}
.site-footer__inner {
  width: min(1180px, 92vw);
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem 1.5rem;
}
.site-footer__mark {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
}
.site-footer__note {
  font-size: .85rem;
  color: var(--ink-soft);
}

/* ─── flash ─────────────────────────────────────────────────────────── */

.flash-stack {
  width: min(1180px, 92vw);
  margin: 1rem auto 0;
  display: grid;
  gap: .5rem;
}
.flash {
  padding: .7rem 1rem;
  border-left: 3px solid var(--focus);
  background: var(--paper-2);
  font-size: .9rem;
}
.flash--alert { border-left-color: #B33A3A; }

/*
 * The homepage does not use any of the chrome above — it gets its own layout
 * and its own stylesheet (desktop.css). See app/views/layouts/desktop.html.erb.
 */

/* ─── directory & profiles ──────────────────────────────────────────── */
/*
 * Deliberately unthemed. Lists get to be costumes; a business profile is the
 * commercial surface — the page an owner claims and pays for — so it stays in
 * the neutral house style across the whole directory.
 */

.directory, .profile { padding-block: clamp(2.5rem, 7vw, 4rem) 2rem; }

.directory__head, .profile__head {
  max-width: var(--measure);
  display: grid;
  gap: .75rem;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.directory__eyebrow, .profile__eyebrow {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.directory__title, .profile__name {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.5vw, 3.2rem);
  line-height: 1.05;
  font-weight: 400;
}

.directory__lede { color: var(--ink-soft); max-width: 52ch; }

.directory__list {
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.directory__item { border-bottom: 1px solid var(--rule); }
.directory__item a {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  padding: 1rem .25rem;
  text-decoration: none;
}
.directory__item a:hover { background: var(--paper-2); }
.directory__name {
  font-family: var(--font-display);
  font-size: 1.25rem;
}
.directory__meta {
  font-size: .82rem;
  color: var(--ink-soft);
  text-align: right;
}

.taglist {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.taglist li {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: .2rem .7rem;
}

.profile__closed {
  border-left: 3px solid var(--focus);
  background: var(--paper-2);
  padding: .7rem 1rem;
  font-size: .9rem;
}

.profile__grid {
  display: grid;
  gap: clamp(2rem, 5vw, 3.5rem);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}
@media (min-width: 900px) {
  .profile__grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .profile__aside { position: sticky; top: 2rem; }
}

.profile__description {
  font-size: 1.1rem;
  max-width: var(--measure);
  margin-bottom: 2.5rem;
}

.coverage__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: .3rem;
}
.coverage__count, .coverage__empty {
  color: var(--ink-soft);
  font-size: .9rem;
  margin-bottom: 1.5rem;
}

.coverage__items {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1.5rem;
}

.mention {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--focus);
  padding: 1.2rem 1.3rem;
}
.mention__source {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .7rem;
  align-items: baseline;
  margin-bottom: .7rem;
}
.mention__source a {
  font-family: var(--font-display);
  font-size: 1.1rem;
  text-underline-offset: 3px;
}
.mention__section {
  font-family: var(--font-mono);
  font-size: .66rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.mention__blurb {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
}

/* Passing mentions are quieter than entries written about the business —
   the visual weight should match the strength of the claim. */
.coverage--passing { margin-top: 2.5rem; }
.mention--passing {
  border-left-color: var(--rule);
  background: transparent;
}
.mention--passing .mention__blurb { font-size: .94rem; color: var(--ink-soft); }

/* Inline links to other profiles inside blurb prose. Underlined rather than
   coloured, so a blurb with four of them doesn't turn into confetti. */
.blurb__mention {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: var(--rule);
}
.blurb__mention:hover { text-decoration-color: currentColor; }
.mention__note {
  margin-top: .8rem;
  padding-top: .8rem;
  border-top: 1px dotted var(--rule);
  font-size: .88rem;
  color: var(--ink-soft);
}
.mention__credit {
  margin-top: .8rem;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .08em;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.factbox, .claimbox {
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 1.2rem 1.3rem;
}
.claimbox { margin-top: 1.2rem; background: var(--paper-2); }

.factbox__title {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}
.factbox__list { display: grid; gap: .2rem; margin: 0; }
.factbox__list dt {
  font-family: var(--font-mono);
  font-size: .64rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: .6rem;
}
.factbox__list dt:first-child { margin-top: 0; }
.factbox__list dd { margin: 0; font-size: .95rem; }
.factbox__thin { font-size: .85rem; color: var(--ink-soft); }

.claimbox__lead { font-weight: 700; font-size: .95rem; margin-bottom: .3rem; }
.claimbox__body { font-size: .85rem; color: var(--ink-soft); }

.claimform {
  display: grid;
  gap: .45rem;
  margin-top: .9rem;
}
.claimform__label {
  font-family: var(--font-mono);
  font-size: .64rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.claimform__input {
  width: 100%;
  padding: .55rem .65rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--surface);
  color: var(--ink);
  font-size: .95rem;
}
.claimform__input::placeholder { color: var(--ink-soft); opacity: .7; }
.claimform__submit {
  justify-self: start;
  padding: .5rem 1.1rem;
  border: 1px solid var(--focus);
  border-radius: 3px;
  background: var(--focus);
  color: var(--paper);
  font-size: .88rem;
  cursor: pointer;
}
.claimform__submit:hover { filter: brightness(1.1); }

/* Honeypot: off-canvas rather than display:none, since some bots skip
   anything explicitly hidden. Kept out of the tab order in the markup. */
.claimform__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.claimbox__done {
  font-size: .88rem;
  line-height: 1.5;
  border-left: 3px solid var(--focus);
  padding: .6rem .8rem;
  background: var(--surface);
}
.claimbox__error {
  font-size: .85rem;
  color: #B33A3A;
  margin-top: .6rem;
}
.claimbox__fine {
  margin-top: .7rem;
  font-size: .75rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.empty-state {
  padding: 3rem 0;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
}

/* ─── list-page skeleton ────────────────────────────────────────────── */
/*
 * Structure only. A theme supplies every colour, texture and typeface, and
 * decides what each card material actually looks like.
 */

.list-page { padding-bottom: 4rem; }

.list-section { margin-top: clamp(2.5rem, 7vw, 4.5rem); }

.board {
  columns: 3 300px;
  column-gap: 1.7rem;
}

.card {
  break-inside: avoid;
  margin-bottom: 1.7rem;
  position: relative;
}

.card__title { text-wrap: balance; }
.card__link { text-decoration: none; }
.card__link:hover { text-decoration: underline; text-underline-offset: 3px; }

.card__by {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .8rem;
}
.card__votes {
  font-variant-numeric: tabular-nums;
  flex: none;
}

/*
 * Tilt and rise are composed through custom properties rather than each
 * setting `transform` outright — otherwise a theme's crooked-card rotation
 * and the scroll reveal's rise silently cancel each other out, and the more
 * specific selector just wins.
 */
.card, .reveal {
  transform: rotate(var(--tilt, 0deg)) translateY(var(--rise, 0px));
  transition: opacity .55s ease, transform .4s cubic-bezier(.2, .8, .3, 1),
              box-shadow .3s ease;
}
.reveal { opacity: 0; --rise: 22px; }
.reveal.is-in { opacity: 1; --rise: 0px; }

@media (max-width: 640px) {
  .board { columns: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .list-card:hover { transform: none; }
}
