/* ==========================================================================
   Simple Faith Tools — catalog homepage
   Concept: a clean workshop. A wall of labelled slots, tools within reach.

   Structure carries the concept:
   - one continuous hairline lattice instead of floating cards (a rack, not a feed)
   - a heavy bench edge under the header
   - every card's Scripture line pinned to the bottom so anchors align across a row
   - accent (clay) appears in exactly two places: badges and the signup button
   ========================================================================== */

:root {
  /* Overwritten at runtime from site.theme in tools.json. */
  --paper: #F3F1E9;
  --card: #FFFFFF;
  --accent: #993C1D;
  --accent-tint: #FAECE7;

  --ink: #1B1917;
  --ink-muted: #5A544C;
  --rule: #D8D2C2;
  --rule-strong: #1B1917;

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;

  --gutter: 20px;
  --pad: 15px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.vh {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 8px; top: 8px;
  z-index: 10;
  background: var(--card);
  border: 1px solid var(--rule-strong);
  padding: 8px 12px;
  color: var(--ink);
}

a { color: inherit; }

/* --------------------------------------------------------------------------
   Header — the bench edge
   -------------------------------------------------------------------------- */

.bench-head {
  border-bottom: 3px solid var(--rule-strong);
}

.sitename {
  margin: 0;
  padding: 16px 0 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  border-bottom: 1px solid var(--rule);
}

.hero__line {
  margin: 0;
  padding-top: 28px;
  font-size: 29px;
  line-height: 1.1;
  font-weight: 600;
  letter-spacing: -0.018em;
  max-width: 17ch;
}

.hero__note {
  margin: 10px 0 0;
  padding-bottom: 24px;
  font-size: 14.5px;
  color: var(--ink-muted);
  max-width: 46ch;
}

/* --------------------------------------------------------------------------
   Sponsor slot — a labelled bin on the wall. Never blank.
   320x100 mobile, 728x90 desktop.
   -------------------------------------------------------------------------- */

/* Transparent so the slot recedes and the lighter cards below advance —
   the tools have to out-rank the ad. */
.slot {
  margin: 20px 0 26px;
  border: 1px solid var(--rule);
  background: transparent;
  max-width: 320px;
}

.slot__label {
  margin: 0;
  padding: 4px 10px 5px;
  border-bottom: 1px solid var(--rule);
  font-size: 11px;
  letter-spacing: 0.09em;
  color: var(--ink-muted);
}

.slot__body {
  height: 100px;
  display: flex;
  align-items: center;
  padding: 0 14px;
}

.slot__promo {
  text-decoration: none;
  display: block;
}

.slot__headline {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
}

.slot__promo:hover .slot__headline,
.slot__promo:focus-visible .slot__headline {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.slot__cue {
  margin: 4px 0 0;
  font-size: 12.5px;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}

/* --------------------------------------------------------------------------
   The rack — hairline lattice, no gaps, no shadows, no rounded corners.
   The 1px "gap" is the rack's own frame showing through.
   -------------------------------------------------------------------------- */

/* The shelf edge. Header rule, shelf rule, signup rule — three bench edges
   set the page's whole rhythm. */
.shelf {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--rule-strong);
}

.shelf__label {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  color: var(--ink);
}

.shelf__rule {
  flex: 1;
  height: 1px;
  background: var(--rule);
  transform: translateY(-3px);
}

.shelf__count {
  margin: 0;
  font-size: 12.5px;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* The rules are drawn by the cards themselves, not by a background showing
   through gaps — so a half-filled row ends where the tools end instead of
   leaving an empty painted cell. The shelf rule above closes the top edge. */
.rack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  border-left: 1px solid var(--rule);
}

.card {
  background: var(--card);
  padding: var(--pad);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

/* Badges — one of the two places clay is allowed. */
.badge {
  display: inline-block;
  font-size: 11.5px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  padding: 3px 8px;
  white-space: nowrap;
}

.badge--open {
  background: var(--accent);
  color: var(--accent-tint);
  border: 1px solid var(--accent);
}

.badge--gated {
  background: transparent;
  color: var(--ink-muted);
  border: 1px solid var(--rule);
}

.card__sponsor {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card__name {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.005em;
}

.card__name a {
  text-decoration: none;
}
.card__name a:hover,
.card__name a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card__tagline {
  margin: 5px 0 0;
  font-size: 14.5px;
  line-height: 1.35;
  color: var(--ink-muted);
}

/* The one non-functional line on the page. */
.card__anchor {
  margin-top: auto;
  padding-top: 11px;
  border-top: 1px solid var(--rule);
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-muted);
}

.card__anchor span {
  /* keeps the top rule flush at the card edge while the text stays inset */
  display: block;
  padding-top: 1px;
}

/* Card hover: the drawer front presses in a half-step. No shadow, no motion. */
.card:hover {
  background: #FAF8F2;
}

/* --------------------------------------------------------------------------
   Sections (site.layout.sections === true) — drawer labels across the rack
   -------------------------------------------------------------------------- */

.section + .section {
  margin-top: 24px;
}

/* --------------------------------------------------------------------------
   What's coming — one quiet line. Not a card, not a box.
   -------------------------------------------------------------------------- */

.coming {
  margin: 14px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-muted);
  max-width: 62ch;
}

/* --------------------------------------------------------------------------
   Signup — the last slot on the bench. Strongest element after the hero.
   -------------------------------------------------------------------------- */

.signup {
  margin: 24px 0 44px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--rule-strong);
  padding: 20px var(--pad) 22px;
}

.signup__head {
  margin: 0;
  font-size: 21px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.012em;
  max-width: 26ch;
}

.signup__note {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--ink-muted);
  max-width: 60ch;
}

.signup__form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.signup__input {
  flex: 1 1 220px;
  min-width: 0;
  height: 46px;
  padding: 0 12px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #FFFFFF;
  border: 1px solid var(--ink-muted);
  border-radius: 0;
  appearance: none;
}

.signup__input:focus-visible {
  outline: 2px solid var(--rule-strong);
  outline-offset: -2px;
}

/* The second and last place clay appears. */
.signup__button {
  flex: 0 0 auto;
  height: 46px;
  padding: 0 22px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-tint);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 0;
  cursor: pointer;
}

.signup__button:hover { filter: brightness(0.93); }
.signup__button:focus-visible { outline: 2px solid var(--rule-strong); outline-offset: 2px; }

.signup__status {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--ink-muted);
  min-height: 1em;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.foot {
  border-top: 1px solid var(--rule);
  padding: 18px 0 34px;
}

.foot__address {
  margin: 0;
  font-style: normal;
  font-size: 12.5px;
  color: var(--ink-muted);
}

.foot__links {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12.5px;
}

.foot__links a {
  color: var(--ink-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.foot__links a:hover { color: var(--ink); }

.foot__by {
  margin: 8px 0 0;
  font-size: 12.5px;
}
.foot__by a {
  color: var(--ink-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.foot__by a:hover { color: var(--ink); }

/* One quiet sentence about who builds the catalog */
.about {
  margin: 28px 0 32px;
  max-width: 62ch;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink-muted);
}
.about a {
  color: var(--ink-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.about a:hover { color: var(--ink); }

/* --------------------------------------------------------------------------
   Manifest failure notice (local file:// double-click, or a bad edit)
   -------------------------------------------------------------------------- */

.notice {
  border: 1px solid var(--rule-strong);
  background: var(--card);
  padding: var(--pad);
  font-size: 14px;
  line-height: 1.5;
}
.notice h2 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.notice p { margin: 0 0 6px; color: var(--ink-muted); }
.notice code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 1px 5px;
}

/* --------------------------------------------------------------------------
   Wider than a phone
   -------------------------------------------------------------------------- */

/* On a phone the button is the whole width — it is the page's one ask. */
@media (max-width: 599px) {
  .signup__button { flex: 1 1 100%; }
}

@media (min-width: 600px) {
  .rack { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  :root { --gutter: 32px; --pad: 17px; }

  .hero__line { font-size: 37px; padding-top: 40px; }
  .hero__note { padding-bottom: 34px; font-size: 15px; }

  .slot { max-width: 728px; }
  .slot__body { height: 90px; }

  .signup {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(330px, 40%);
    align-items: center;
    column-gap: 32px;
    padding: 22px var(--pad) 24px;
  }
  .signup__head { font-size: 24px; }
  .signup__form { margin-top: 0; flex-wrap: nowrap; }
  .signup__status { grid-column: 1 / -1; }

  .foot .wrap {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 24px;
  }
  .foot__links { margin-top: 0; }
}

@media (min-width: 1000px) {
  .rack { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
