/* Pointe of Order: a council-minutes look. Warm paper, ink, and one colour per level of government. */

:root {
  --paper: #f7f3ea;
  --card: #fffdf8;
  --ink: #1d2433;
  --muted: #5b6272;
  --rule: #d9d0bd;
  --accent: #0f5c6e;

  --municipal: #0f6b5c;
  --agglomeration: #a23b2a;
  --metropolitan: #6b3f8f;
  --provincial: #0a3d91;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.6 var(--sans);
}

a { color: var(--accent); }
a:hover { color: var(--ink); }

h1, h2, h3 { font-family: var(--serif); line-height: 1.2; font-weight: 600; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin: 0.4rem 0 0.6rem; }
h2 { font-size: 1.35rem; }

.wrap { max-width: 64rem; margin: 0 auto; padding: 0 1.25rem; }

/* Masthead */
.masthead { border-bottom: 3px double var(--ink); background: var(--paper); }
.masthead__inner {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between;
  padding-block: 1rem;
}
.wordmark { text-decoration: none; color: var(--ink); display: grid; }
.wordmark__name { font-family: var(--serif); font-size: 1.6rem; font-weight: 700; letter-spacing: 0.01em; }
.wordmark__name::before { content: "§ "; color: var(--accent); }
.wordmark__tagline { font-size: 0.85rem; color: var(--muted); }
.masthead__nav { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; font-size: 0.95rem; }
.masthead__nav a { text-decoration: none; }
.masthead__nav a:hover { text-decoration: underline; }
.masthead__search input { width: 11rem; }
.locale-switch {
  border: 1px solid var(--ink); border-radius: 999px; padding: 0.15rem 0.7rem; color: var(--ink);
}

input[type="search"] {
  font: inherit; padding: 0.35rem 0.6rem; border: 1px solid var(--rule); border-radius: 0.4rem; background: var(--card);
}
input[type="submit"] {
  font: inherit; padding: 0.35rem 0.9rem; border: 0; border-radius: 0.4rem; background: var(--ink); color: var(--paper); cursor: pointer;
}

main { padding-block: 2rem 3rem; }

.intro { margin-bottom: 1.75rem; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 42rem; margin: 0; }
.count { font-weight: 600; margin-top: 0.75rem; }

/* Situation cards */
.cards {
  list-style: none; padding: 0; margin: 0 0 2.5rem;
  display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
}
.card a {
  display: block; height: 100%; padding: 1.1rem 1.25rem; text-decoration: none; color: var(--ink);
  background: var(--card); border: 1px solid var(--rule); border-top: 4px solid var(--accent); border-radius: 0.5rem;
}
.card a:hover { border-color: var(--ink); }
.card__title { margin: 0 0 0.4rem; font-size: 1.25rem; }
.audience__heading { font-size: 1.15rem; text-transform: uppercase; letter-spacing: 0.06em; font-family: var(--sans); color: var(--muted); border-bottom: 1px solid var(--rule); padding-bottom: 0.4rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.columns { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); }
.topic-list { columns: 2; padding-left: 1.1rem; margin: 0; }
.topic-list li { margin-bottom: 0.3rem; }
.levels { display: grid; grid-template-columns: max-content 1fr; gap: 0.6rem 0.9rem; margin: 0; }
.levels dd { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Level badges */
.badge {
  display: inline-block; padding: 0.1rem 0.6rem; border-radius: 999px;
  font: 600 0.78rem/1.6 var(--sans); letter-spacing: 0.02em; color: #fff; white-space: nowrap;
}
.badge--municipal { background: var(--municipal); }
.badge--agglomeration { background: var(--agglomeration); }
.badge--metropolitan { background: var(--metropolitan); }
.badge--provincial { background: var(--provincial); }

/* Rules */
.level-group { margin-bottom: 2rem; }
.level-group__heading { border-bottom: 1px solid var(--rule); padding-bottom: 0.4rem; font-size: 1rem; }

.rule {
  background: var(--card); border: 1px solid var(--rule); border-radius: 0.5rem;
  padding: 1rem 1.25rem; margin-bottom: 0.9rem;
}
.rule--municipal { border-left: 5px solid var(--municipal); }
.rule--agglomeration { border-left: 5px solid var(--agglomeration); }
.rule--metropolitan { border-left: 5px solid var(--metropolitan); }
.rule--provincial { border-left: 5px solid var(--provincial); }
.rule__header { display: flex; flex-wrap: wrap; gap: 0.4rem 0.75rem; align-items: baseline; }
.rule__title { margin: 0; font-size: 1.15rem; }
.rule__title a { color: var(--ink); text-decoration: none; }
.rule__title a:hover { text-decoration: underline; }
.rule__summary p { margin: 0.5rem 0; }
.rule__footer { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; font-size: 0.85rem; color: var(--muted); }
.rule__flag { color: #8a5a00; }

.rule-detail { max-width: 44rem; }
.rule-detail__summary { font-size: 1.1rem; }
.caveat {
  background: #fff6e0; border-left: 4px solid #c98a00; padding: 0.75rem 1rem; margin: 1.25rem 0; border-radius: 0 0.4rem 0.4rem 0;
}
.caveat h2 { font-size: 1rem; margin: 0 0 0.3rem; font-family: var(--sans); }
.caveat p { margin: 0.3rem 0; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1rem; border-top: 1px solid var(--rule); padding-top: 1rem; }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; }

/* Forms and contacts */
.rule__practical {
  margin: 0.6rem 0; padding: 0.55rem 0.8rem; background: var(--paper); border-radius: 0.4rem; font-size: 0.92rem;
}
.rule__practical p { margin: 0.15rem 0; }
.rule__practical strong { margin-right: 0.25rem; }

.forms { list-style: none; padding: 0; margin: 0.5rem 0 1rem; display: grid; gap: 0.6rem; }
.form {
  background: var(--card); border: 1px solid var(--rule); border-radius: 0.5rem; padding: 0.7rem 0.9rem;
}
.form__link { display: inline-flex; gap: 0.5rem; align-items: baseline; font-weight: 600; }
.form__icon {
  display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 0.3rem;
  background: var(--accent); color: #fff; font-size: 0.85rem; flex: none;
}
.form__number { margin-left: 0.5rem; font-size: 0.8rem; color: var(--muted); }
.form__note { margin: 0.35rem 0 0 1.9rem; color: var(--muted); font-size: 0.92rem; }

.rule-detail__forms h2, .rule-detail__contact h2 { margin-top: 1.75rem; }

.office { background: var(--card); border: 1px solid var(--rule); border-top: 4px solid var(--accent); border-radius: 0.5rem; padding: 0.9rem 1.1rem; }
.office__name { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; margin: 0 0 0.5rem; }
.office__details { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; margin: 0; font-size: 0.95rem; }
.office__details dt { font-weight: 600; color: var(--muted); }
.office__details dd { margin: 0; }

.office-section { margin-bottom: 2rem; }
.office-section__forms { font-size: 1rem; font-family: var(--sans); margin: 0.9rem 0 0; }

.official { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: baseline; }
.official a { font-weight: 600; }
.checked { color: var(--muted); font-size: 0.85rem; }

.source-list { list-style: none; padding: 0; }
.source-list li { padding: 0.5rem 0; border-bottom: 1px dotted var(--rule); display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; justify-content: space-between; }

.search-form { display: flex; gap: 0.5rem; max-width: 32rem; }
.search-form input[type="search"] { flex: 1; }

.footer { border-top: 3px double var(--ink); color: var(--muted); font-size: 0.9rem; padding-block: 1.25rem 2rem; }

@media (max-width: 40rem) {
  .topic-list { columns: 1; }
  .masthead__search input { width: 8rem; }
}
