/* Four Winds Toolkit — shared stylesheet. One file for every page. */

:root {
  --table-green: #123A2B;   /* page background, the felt */
  --green-deep:  #0D2A1F;   /* header, footer, depth */
  --bone:        #EFE7D3;   /* content panels, everything read closely */
  --ink:         #24201A;   /* text on bone */
  --brass:       #C08A2E;   /* accent, active state, links */
  --tile-red:    #A83A2B;   /* single-use: primary action or the winner */

  --bone-shade:  #D9CEB2;   /* borders and dividers on bone */
  --ink-soft:    #5A5347;   /* secondary text on bone */

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--table-green);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
}

a { color: var(--brass); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5rem;
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

:focus-visible {
  outline: 3px solid var(--brass);
  outline-offset: 2px;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem;
}

main { padding: 1.5rem 0 1rem; }

/* Header and footer, injected by assets/site.js */

.site-header { background: var(--green-deep); }
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 60px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--bone);
  text-decoration: none;
  padding: 0.5rem 0;
}
.site-nav a {
  display: inline-block;
  color: var(--bone);
  text-decoration: none;
  padding: 0.75rem 0.25rem;
  min-height: 44px;
}
.site-nav a:hover { text-decoration: underline; }

.site-footer {
  background: var(--green-deep);
  margin-top: 3rem;
  padding: 2rem 0;
  font-size: 0.95rem;
}
.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}
.site-footer a {
  color: var(--bone);
  display: inline-block;
  padding: 0.5rem 0;
}
.site-footer p { color: var(--bone); opacity: 0.85; max-width: 60ch; }

/* Page headings on the green */

.page-title { margin-bottom: 0.25rem; }
.page-lede {
  margin-bottom: 1.5rem;
  max-width: 60ch;
}

/* Panels: a bone surface for anything read closely. Not every block is one. */

.panel {
  background: var(--bone);
  color: var(--ink);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.panel h2 { margin-top: 0; }
.panel a { color: var(--ink); text-decoration-color: var(--brass); }
.muted { color: var(--ink-soft); }
.small { font-size: 0.95rem; }

/* Buttons. 52px minimum so a thumb lands on them. */

.btn {
  font: inherit;
  font-weight: 500;
  font-size: 1.05rem;
  min-height: 52px;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 2px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: center;
  line-height: 1.25;
}
.btn[aria-pressed="true"] {
  background: var(--brass);
  border-color: var(--brass);
  color: var(--ink);
}
.btn-primary {
  width: 100%;
  min-height: 60px;
  font-size: 1.2rem;
  font-weight: 600;
  background: var(--tile-red);
  border-color: var(--tile-red);
  color: var(--bone);
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-quiet {
  border-color: var(--bone-shade);
  color: var(--ink-soft);
  font-weight: 400;
}
.btn-quiet:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-row {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(2, 1fr);
}
.btn-row.one { grid-template-columns: 1fr; }
.btn-row.three { grid-template-columns: repeat(3, 1fr); }
.btn-row.last-full > :last-child { grid-column: 1 / -1; }
.btn-stack { display: grid; gap: 0.6rem; }

/* A quiet disclosure for non-standard options, kept out of the main flow */

details.variants summary {
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 0.5rem 0;
  min-height: 44px;
}
details.variants[open] summary { color: var(--ink); }
details.variants .variants-body { padding-top: 0.5rem; }
.count-summary { font-size: 1.05rem; margin: 0 0 0.25rem; }

/* Inputs */

.input {
  font: inherit;
  font-size: 1.15rem;
  min-height: 52px;
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #FFFDF7;
  color: var(--ink);
  width: 100%;
}
.input-num {
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
  min-height: 64px;
}
.field { margin-bottom: 1.25rem; }
.field:last-child { margin-bottom: 0; }
.field-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.field-hint { color: var(--ink-soft); font-size: 0.95rem; margin: 0.35rem 0 0; }

.num { font-variant-numeric: tabular-nums; }

/* Guides: the page itself goes bone below the header, and the text sits in
   a reading column. Prose is not a card. */

.guide-main {
  background: var(--bone);
  color: var(--ink);
  padding: 2rem 0 3rem;
}
body.guide .site-footer { margin-top: 0; }
.prose { max-width: 62ch; }
.prose h1 { font-size: 2.4rem; margin-bottom: 0.75rem; }
.prose h2 { margin-top: 2.25rem; }
.prose h3 { margin-top: 1.5rem; }
.prose .lede { font-size: 1.2rem; color: var(--ink-soft); margin-bottom: 1.5rem; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1rem; }
.prose li { margin-bottom: 0.35rem; }
.prose a { color: var(--ink); text-decoration-color: var(--brass); text-decoration-thickness: 2px; }
.prose table { border-collapse: collapse; width: 100%; margin: 0 0 1rem; font-variant-numeric: tabular-nums; }
.prose th, .prose td { text-align: left; padding: 0.5rem 0.5rem 0.5rem 0; border-bottom: 2px solid var(--bone-shade); vertical-align: top; }
.prose th { font-weight: 600; }
.table-scroll { overflow-x: auto; }
.callout {
  border-left: 4px solid var(--brass);
  padding: 0.5rem 0 0.5rem 1rem;
  margin: 1.5rem 0;
}
.callout p { margin: 0; }
.source {
  border-top: 2px solid var(--bone-shade);
  margin-top: 2.5rem;
  padding-top: 1rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.guide-list { margin-top: 2rem; }
.guide-list h2 { margin-bottom: 0.75rem; }

/* Home */

.hero { text-align: center; padding: 2rem 0 1.5rem; }
.hero h1 { font-size: 2.6rem; }
.hero p {
  font-size: 1.15rem;
  max-width: 36ch;
  margin: 0 auto 1rem;
}

.tool-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}
.tool-link {
  display: block;
  background: var(--bone);
  color: var(--ink);
  text-decoration: none;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  min-height: 64px;
}
.tool-link strong {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
}
.tool-link span { color: var(--ink-soft); }
.tool-link:hover strong { text-decoration: underline; text-decoration-color: var(--brass); }

@media (min-width: 600px) {
  .hero h1 { font-size: 3.25rem; }
}
