/* Arizona Flying Clubs. Colors live here. */
:root {
  --sky: #17364f;
  --sky-2: #2a5878;
  --copper: #c2592b;
  --copper-dark: #9e4520;
  --sand: #faf6ef;
  --sand-2: #f1e8da;
  --ink: #1f2328;
  --muted: #5d6670;
  --line: #e2d8c8;
  --card: #ffffff;
  --ok: #2d7a46;
  --warn: #a2601a;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 17px/1.6 var(--font); color: var(--ink); background: var(--sand); }
a { color: var(--sky-2); }
a:hover { color: var(--copper); }
h1, h2, h3 { font-family: var(--serif); color: var(--sky); line-height: 1.25; }
h1 { font-size: 2.2rem; margin: 1.6rem 0 .6rem; }
h2 { font-size: 1.5rem; margin: 2.2rem 0 .6rem; }
h3 { font-size: 1.15rem; margin: 0 0 .4rem; }
img { max-width: 100%; }
small { color: var(--muted); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-bottom: 3rem; min-height: 60vh; }
.lede { font-size: 1.15rem; color: #3b4148; max-width: 50em; }
.aside { color: var(--muted); font-size: .92rem; }

/* masthead */
.masthead { background: var(--sky); color: #fff; }
.masthead__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; flex-wrap: wrap; }
.brand { color: #fff; text-decoration: none; font-family: var(--serif); font-size: 1.3rem; font-weight: bold; }
.brand:hover { color: #fff; }
.brand__mark { color: #f0a477; }
.nav { display: flex; flex-wrap: wrap; gap: .2rem; }
.nav a { color: #dce8f1; text-decoration: none; padding: .4rem .65rem; border-radius: 6px; font-size: .95rem; }
.nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav a[aria-current="page"] { background: rgba(255,255,255,.16); color: #fff; }
.navtoggle { display: none; background: none; color: #fff; border: 1px solid rgba(255,255,255,.4); border-radius: 6px; padding: .35rem .7rem; font: inherit; }

@media (max-width: 860px) {
  .navtoggle { display: block; }
  .nav { display: none; width: 100%; flex-direction: column; padding-bottom: .8rem; }
  .nav.open { display: flex; }
}

/* buttons */
.btn { display: inline-block; background: var(--copper); color: #fff; border: 0; border-radius: 8px; padding: .65rem 1.15rem; font: 600 1rem var(--font); text-decoration: none; cursor: pointer; margin: .2rem .3rem .2rem 0; }
.btn:hover { background: var(--copper-dark); color: #fff; }
.btn--ghost { background: transparent; color: var(--sky); border: 1.5px solid var(--sky-2); }
.btn--ghost:hover { background: var(--sky); color: #fff; }
.btn[disabled] { opacity: .45; cursor: default; }

/* home */
.hero { padding: 2.2rem 0 1rem; }
.hero h1 { font-size: 2.6rem; margin-top: .5rem; }
.typegrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.typecard { display: block; background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--copper); border-radius: var(--radius); padding: 1.2rem 1.3rem; text-decoration: none; color: var(--ink); transition: transform .12s, box-shadow .12s; }
.typecard:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(23,54,79,.12); color: var(--ink); }
.typecard h2 { margin: 0 0 .4rem; font-size: 1.3rem; }
.typecard__count { color: var(--copper); font-weight: 600; }
.callout { background: var(--sand-2); border-radius: var(--radius); padding: 1.2rem 1.5rem; margin: 2.5rem 0 1rem; }
.callout h2 { margin-top: .2rem; }

/* club cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; display: flex; flex-direction: column; }
.card h3 a { text-decoration: none; color: var(--sky); }
.card__where { color: var(--muted); font-size: .92rem; margin: 0 0 .5rem; }
.card p { margin: 0 0 .6rem; }
.card__facts { margin: 0 0 .7rem; padding-left: 1.1rem; font-size: .95rem; }
.card__more { margin-top: auto; font-weight: 600; text-decoration: none; }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .7rem; }
.chip { background: #e6eef4; color: var(--sky); border-radius: 999px; padding: .1rem .6rem; font-size: .8rem; font-weight: 600; }
.badge { display: inline-block; border-radius: 4px; padding: 0 .4rem; font-size: .75rem; font-weight: 700; vertical-align: 1px; }
.badge--open { background: #dcefe2; color: var(--ok); }
.badge--full { background: #f7e6d3; color: var(--warn); }
.badge--todo { background: #eee; color: #666; }
.badge--ins { background: #e3e9f7; color: #34508c; }
.lede p { margin: 0 0 .8rem; }
.callout ul { padding-left: 1.2rem; }
.callout--q { background: #fde8d4; border-left: 5px solid var(--copper); margin: 1rem 0 1.5rem; }
.callout--q h3 { margin-top: .2rem; }
.callout--q li { margin-bottom: .5rem; }
.num { text-align: right !important; white-space: nowrap; }
.glance tbody th { font-weight: 600; }
.glance td { white-space: nowrap; }
.sortbtn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: .3em; }
.sortbtn:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
.sortbtn::after { content: "\2195"; opacity: .35; font-size: .85em; }
th[aria-sort="ascending"] .sortbtn::after { content: "\2191"; opacity: 1; }
th[aria-sort="descending"] .sortbtn::after { content: "\2193"; opacity: 1; }
.matrix__group th { background: var(--sand-2); text-align: left !important; font-family: var(--serif); color: var(--sky); }
.empty { background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 2rem; text-align: center; margin: 1.5rem 0; }

/* club detail */
.crumbs { margin: 1.4rem 0 -.8rem; font-size: .92rem; }
.crumbs a { text-decoration: none; }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2rem; align-items: start; }
.detail__main h2:first-child { margin-top: 0; }
.detail__side { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; position: sticky; top: 1rem; }
.facts { margin: 0 0 1rem; display: grid; grid-template-columns: auto 1fr; gap: .35rem .8rem; font-size: .93rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.side__actions .btn { display: block; text-align: center; margin: .4rem 0; }
.goodfor li::marker { content: "\2713  "; color: var(--ok); }
.notice { background: #fff6e9; border: 1px solid #f0d2a8; border-radius: 8px; padding: .7rem 1rem; }
@media (max-width: 860px) { .detail { grid-template-columns: 1fr; } .detail__side { position: static; } }

/* tables */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* Wide tables (the club-by-goal matrix) break out of the 1080px text column, up to 1500px. */
.tablewrap--wide { width: min(1500px, calc(100vw - 32px)); margin-left: calc(50% - min(750px, 50vw - 16px)); }
.table { width: 100%; border-collapse: collapse; background: var(--card); font-size: .93rem; }
.table th, .table td { border-bottom: 1px solid var(--line); padding: .55rem .6rem; text-align: left; vertical-align: top; }
.table thead th { background: var(--sand-2); color: var(--sky); }
.matrix td { text-align: center; color: var(--copper); font-size: 1.1rem; }
.matrix td.yes { background: #fbefe6; }
.matrix thead th:not(:first-child) { font-size: .8rem; text-align: center; min-width: 4.5rem; }
.matrix tbody th { font-weight: 600; min-width: 10rem; position: sticky; left: 0; background: var(--card); }
.matrix thead th:first-child { position: sticky; left: 0; z-index: 1; }

/* choosing */
.typecols, .qgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.typecol, .qgroup { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; }
.qgroup ul { padding-left: 1.1rem; margin: 0; }
.qgroup li { margin-bottom: .45rem; }
.picks li { margin-bottom: .3rem; }

/* forms */
.form { max-width: 720px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; }
.field { margin-bottom: 1rem; flex: 1; }
.field label { display: block; font-weight: 600; margin-bottom: .25rem; }
.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row .field { min-width: 220px; }
input:not([type=radio]):not([type=checkbox]), select, textarea { width: 100%; font: inherit; padding: .55rem .65rem; border: 1px solid #cbbfae; border-radius: 6px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--sky-2); outline-offset: 1px; }
.topics { border: 0; padding: 0; margin: 0 0 1.2rem; }
.topics legend { font-weight: 700; margin-bottom: .4rem; font-family: var(--serif); color: var(--sky); font-size: 1.15rem; }
.topics label { display: block; padding: .3rem 0; cursor: pointer; }
.hint { color: var(--muted); font-size: .92rem; margin-top: -.3rem; }
.hp { position: absolute; left: -9999px; }

/* wizard */
.wizard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem 1.5rem; max-width: 860px; }
.wiz__progress { height: 6px; background: var(--sand-2); border-radius: 3px; overflow: hidden; margin-bottom: 1.2rem; }
.wiz__progress span { display: block; height: 100%; background: var(--copper); transition: width .2s; }
.wiz__step { color: var(--muted); font-size: .88rem; margin: 0; }
.wiz__q { margin-top: .2rem; }
.wiz__opts { display: grid; gap: .5rem; margin: 1rem 0 1.3rem; }
.wiz__opt { display: flex; gap: .7rem; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 8px; padding: .7rem .9rem; cursor: pointer; }
.wiz__opt:hover { border-color: var(--sky-2); }
.wiz__opt:has(input:checked) { border-color: var(--copper); background: #fdf3ec; }
.wiz__opt input { margin-top: .35rem; }
.wiz__opt small { display: block; }
.wiz__nav { display: flex; justify-content: space-between; gap: .5rem; }
.wiz__range { display: flex; align-items: center; gap: 1rem; margin: 1.2rem 0 1.6rem; }
.wiz__range input { flex: 1; }
.wiz__range output { font-weight: 700; font-size: 1.3rem; color: var(--sky); min-width: 5.5rem; }
.result { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: .9rem; }
.result--top { border-color: var(--copper); border-width: 2px; }
.result h3 { margin-bottom: .1rem; }
.result h3 a { text-decoration: none; }
.result__meta { color: var(--muted); font-size: .9rem; margin: 0 0 .5rem; }
.result__cost { font-weight: 700; color: var(--sky); }
.result ul { list-style: none; padding: 0; margin: .3rem 0 0; font-size: .95rem; }
.result li.why::before { content: "\2713  "; color: var(--ok); font-weight: 700; }
.result li.but::before { content: "!  "; color: var(--warn); font-weight: 700; }

/* footer */
.footer { background: var(--sky); color: #c7d6e2; font-size: .9rem; padding: 1.4rem 0; }
.footer a { color: #fff; }

[hidden] { display: none !important; }

/* Club comments */
.comments { margin: 3rem 0 1rem; max-width: 760px; }
.comment { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.2rem; margin-bottom: .8rem; }
.comment p { margin: .4rem 0; overflow-wrap: anywhere; }
.comment__by { color: var(--muted); font-size: .92rem; }
.comment__by strong { color: var(--ink); }
.comments__form { margin-top: 1.5rem; }
.comments__form h3 { margin-top: 0; }
.comments__msg { background: #dcefe2; color: var(--ok); border-radius: 8px; padding: .6rem .9rem; }
.comments__msg--bad { background: #fbe4dc; color: #9e2a12; }

/* Staff moderation */
.staff__bar { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.scomment { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1rem; max-width: 760px; }
.scomment__meta { color: var(--muted); font-size: .92rem; margin-top: 0; overflow-wrap: anywhere; }
.scomment input, .scomment textarea { width: 100%; box-sizing: border-box; }
.card__links { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin: auto 0 0; padding-top: .6rem; }
.card__site { font-weight: 600; text-decoration: none; }
.card__links .card__more { margin: 0; }

.print-only { display: none; }
.pdflink { margin-top: -.4rem; }

/* Questions checklist (questions.html, printed to club-questions.pdf) */
.qsheet { max-width: 760px; }
.qsheet h1 { margin-bottom: .2rem; }
.qsheet__from { color: var(--muted, #5b6470); margin: 0 0 1rem; font-size: .95rem; }
.qsheet__fill { display: flex; gap: 2rem; margin: 0 0 1.4rem; }
.qsheet__fill span { flex: 1; border-bottom: 1px solid var(--ink); padding-bottom: .2rem; font-weight: 600; }
.qsheet__fill span:last-child { flex: 0 0 14rem; }
.qsheet h2 { font-size: 1.15rem; margin: 1.2rem 0 .5rem; }
.qsheet__top { background: #fde8d4; border-left: 5px solid var(--copper); border-radius: var(--radius); padding: .6rem 1.2rem .8rem; }
.qsheet__top h2 { margin-top: .4rem; }
.qsheet__list { margin: 0; padding-left: 1.4rem; }
.qsheet__list > li { margin-bottom: .5rem; }
ul.qsheet__list { list-style: none; padding-left: 0; }
ul.qsheet__list > li { padding-left: 1.6rem; position: relative; }
ul.qsheet__list > li::before { content: ""; position: absolute; left: 0; top: .3em; width: .85em; height: .85em; border: 1.5px solid var(--ink); border-radius: 2px; }
.qsheet__note { margin: .15rem 0 0; font-size: .92em; color: #3b4148; }
.pdflink a { font-weight: 600; }

/* Printing (and the Choosing a Club PDF): no nav, white page, the club matrix fits the page width. */
@media print {
  @page { size: letter; margin: .55in .5in; }
  html { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; font-size: 10.5pt; }
  .nav, .navtoggle, .footer p + p { display: none !important; }
  .masthead { position: static; }
  main.wrap { min-height: 0; padding-bottom: 0; }
  a { text-decoration: none; }
  .tablewrap { overflow: visible; }
  .tablewrap--wide { width: auto; margin-left: 0; }
  .matrix { font-size: 7.5pt; }
  .matrix thead th:not(:first-child) { min-width: 0; font-size: 7pt; }
  .matrix tbody th { min-width: 0; position: static; }
  .callout, .qgroup, .typecol, .matrix tr { break-inside: avoid; }
  .print-newpage { break-before: page; margin-top: 0; }
  .btn, .pdflink { display: none; }
  body:has(.qsheet) .masthead, body:has(.qsheet) .footer { display: none; }
  body:has(.qsheet) { font-size: 9.5pt; line-height: 1.45; }
  .qsheet__list > li { margin-bottom: .3rem; }
  .qsheet h2 { margin: .8rem 0 .35rem; }
  .qsheet__fill { margin-bottom: 1rem; }
  .qsheet { max-width: none; }
  .qsheet h1 { font-size: 20pt; margin-top: 0; }
  .qsheet__group, .qsheet__list > li { break-inside: avoid; }
  .print-only { display: inline !important; font-weight: 600; }
  h2, h3 { break-after: avoid; }
}

/* ?filter= notice on the club-type pages (src/filter.js) */
.filternote { background: var(--sand-2); border-left: 4px solid var(--copper); padding: .6rem .9rem; border-radius: 6px; }
