/* MahjongMate — warm print-style community handbook design */
:root {
  --paper: #FAF7F0;
  --card: #FFFFFF;
  --ink: #2B2118;
  --muted: #5D5248;
  --green: #1F5A4A;
  --green-dark: #17463A;
  --red: #C8442E;
  --border: #E8E1D4;
  --radius: 6px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.7;
}

img, svg { max-width: 100%; height: auto; }

h1, h2, h3 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  line-height: 1.25;
  color: var(--ink);
}

h1 { font-size: 2.1rem; font-weight: 700; margin: 0 0 1rem; }
h2 { font-size: 1.5rem; font-weight: 700; margin: 2.5rem 0 1rem; }
h3 { font-size: 1.15rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }

p { margin: 0 0 1.1rem; }

a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover { color: var(--red); }

ul, ol { padding-left: 1.4rem; margin: 0 0 1.2rem; }
li { margin-bottom: 0.45rem; }

/* Layout */
.wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header / nav */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--green);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand .dot { flex: none; }
.brand:hover { color: var(--red); }
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  width: 100%;
}
.site-nav a {
  display: inline-block;
  padding: 10px 2px;
  min-height: 44px;
  line-height: 24px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.98rem;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--red); }

/* Dot divider — the single signature motif: a row of "one dot" tiles */
.dot-divider {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin: 2.75rem 0;
}
.dot-divider span {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at center,
    var(--green) 0 4px,
    var(--paper) 4px 7px,
    var(--green) 7px 10px,
    var(--paper) 10px);
}
.dot-divider--inline { margin: 1.9rem 0; }
.dot-divider--inline span { width: 16px; height: 16px; }

/* Hero */
.hero { padding: 2.4rem 0 1.4rem; }
.hero .lede {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 62ch;
}
.kicker {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.8rem;
}

/* Key points */
.key-points {
  display: grid;
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 1.6rem 0 0;
}
.key-points li {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 0;
  font-size: 1rem;
}

/* Search box */
.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 1.4rem 0 0.4rem;
  max-width: 560px;
}
.search-form label {
  width: 100%;
  font-weight: 600;
  font-size: 0.95rem;
}
.search-form input[type="text"] {
  flex: 1 1 240px;
  min-height: 48px;
  padding: 10px 14px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.search-form input:focus, .btn:focus, a:focus, summary:focus {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

.btn {
  display: inline-block;
  min-height: 48px;
  padding: 11px 22px;
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  color: #FFFFFF;
  background: var(--green);
  border: none;
  border-radius: var(--radius);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--green-dark); color: #fff; }

.search-note {
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 0.6rem;
}

/* Cards / grids */
.card-grid {
  display: grid;
  gap: 14px;
  margin: 1.2rem 0;
}
@media (min-width: 640px) {
  .card-grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .card-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

/* Compact row list (tool pages / future city pages) */
.row-list {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.row-list th, .row-list td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.row-list tr:last-child td { border-bottom: none; }
.row-list th {
  background: var(--paper);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.table-scroll { overflow-x: auto; }

/* Checklist */
.checklist {
  list-style: none;
  padding: 0;
}
.checklist li {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px 12px 44px;
  margin-bottom: 10px;
  position: relative;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 20px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at center,
    var(--green) 0 3px,
    var(--card) 3px 5px,
    var(--green) 5px);
}

/* Steps */
.steps ol {
  counter-reset: step;
  list-style: none;
  padding: 0;
}
.steps li {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 14px 52px;
  margin-bottom: 10px;
  position: relative;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 14px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 26px;
  text-align: center;
}

/* FAQ (details/summary — readable with JS off) */
.faq details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.faq summary {
  cursor: pointer;
  padding: 14px 46px 14px 16px;
  min-height: 48px;
  font-weight: 600;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.05rem;
  position: relative;
  color: var(--ink);
}
.faq summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-family: "Inter", sans-serif;
  font-size: 1.3rem;
  color: var(--green);
}
.faq details[open] summary::after { content: "−"; color: var(--red); }
.faq details p { padding: 0 16px 14px; margin: 0; }

/* Calculator */
.calc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 1.4rem 0;
}
.calc fieldset {
  border: none;
  padding: 0;
  margin: 0 0 16px;
}
.calc legend, .calc label {
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}
.calc select, .calc input[type="number"] {
  min-height: 46px;
  padding: 8px 12px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 260px;
}
.calc .checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-bottom: 8px;
  font-weight: 500;
}
.calc .checkbox-row input { width: 20px; height: 20px; flex: none; }
.calc-result {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 1.05rem;
}
.calc-result strong { font-size: 1.3rem; }
.calc-hint { font-size: 0.92rem; color: var(--muted); margin-top: 10px; }

/* Breadcrumb */
.breadcrumb {
  font-size: 0.9rem;
  color: var(--muted);
  padding: 14px 0 0;
}
.breadcrumb ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: "›"; margin-right: 4px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--red); }

/* Footer */
.site-footer {
  background: var(--card);
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding: 2rem 0 2.4rem;
}
.site-footer .wrap {
  display: grid;
  gap: 18px;
}
@media (min-width: 640px) {
  .site-footer .wrap { grid-template-columns: 1fr 1fr; }
}
.footer-nav ul { list-style: none; padding: 0; margin: 0; }
.footer-nav a {
  display: inline-block;
  padding: 8px 0;
  min-height: 44px;
  line-height: 28px;
  text-decoration: none;
  color: var(--ink);
}
.footer-nav a:hover { color: var(--red); }
.footer-meta {
  font-size: 0.9rem;
  color: var(--muted);
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.footer-meta a { color: var(--muted); }

/* Note / disclaimer block */
.note {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 0.95rem;
  color: var(--muted);
}
.note strong { color: var(--ink); }
