/* ==========================================================================
   IACEA member pages: "the drawing set"
   --------------------------------------------------------------------------
   IACEA's own look for the affiliation pages (the other six projects each have
   a different one). The pages read like architectural drawings: a sheet index
   beside gridded paper, sharp corners with registration marks, captions with
   detail numbers, a building elevation for the stages, a dimension line for the
   membership period and a title block closing every sheet.
   Colours and fonts are those of the website (iacea.css): navy, safety orange,
   Space Grotesk lettering, Fraunces italics, Inter text.
   ========================================================================== */

.af-root.afi {
  --af-surface: #ffffff;
  --af-surface-2: #f3f5f8;
  --af-line: #dde2ea;
  --af-line-strong: #b4bdcb;
  --af-text: #0d1117;
  --af-muted: #5d6675;
  --af-primary: #0b1f3a;
  --af-primary-ink: #ffffff;
  --af-accent: #c2660a;
  --af-ok: #17764f;        --af-ok-bg: #e4f4ec;
  --af-warn: #9a5700;      --af-warn-bg: #fff1e0;
  --af-bad: #b3261e;       --af-bad-bg: #fdecea;
  --af-info: #0b1f3a;      --af-info-bg: #e9eef6;
  --af-radius: 4px;
  --af-radius-sm: 3px;
  --af-font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --af-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --af-mono: "Space Grotesk", ui-monospace, Menlo, Consolas, monospace;
  --af-shadow: 0 1px 0 rgba(13, 17, 23, .03), 0 14px 34px -22px rgba(13, 17, 23, .35);
  --afi-orange: #f7931e;
  --afi-navy: #0b1f3a;
  --afi-grid: rgba(11, 31, 58, .055);
  padding: 44px 0 84px;
  background-image: linear-gradient(var(--afi-grid) 1px, transparent 1px), linear-gradient(90deg, var(--afi-grid) 1px, transparent 1px);
  background-size: 26px 26px;
}
[dir="rtl"] .af-root.afi { --af-display: "Inter", system-ui, sans-serif; }

.afi h2, .afi h3 { font-weight: 600; letter-spacing: -.01em; }
.afi .af-eyebrow, .afi .af-kv dt, .afi .af-table th, .afi .af-fee__label { font-family: var(--af-display); font-size: 11.5px; letter-spacing: .16em; font-weight: 600; color: var(--af-muted); }
.afi .af-eyebrow { color: var(--af-accent); }

/* sheets: sharp corners and two registration marks */
.afi .af-card, .afi .af-step { position: relative; border-color: var(--af-line-strong); border-radius: 4px; }
.afi .af-card::before, .afi .af-step::before, .afi .af-card::after, .afi .af-step::after { content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none; }
.afi .af-card::before, .afi .af-step::before { top: -1px; inset-inline-start: -1px; border-top: 3px solid var(--afi-orange); border-inline-start: 3px solid var(--afi-orange); }
.afi .af-card::after, .afi .af-step::after { bottom: -1px; inset-inline-end: -1px; border-bottom: 3px solid var(--afi-navy); border-inline-end: 3px solid var(--afi-navy); }
.afi .af-card__title { font-size: 21px; }
.afi .af-pill { border-radius: 3px; font-family: var(--af-display); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; }
.afi .af-pill::before { border-radius: 1px; transform: rotate(45deg); }
.afi .af-step__no { color: var(--af-accent); font-weight: 600; letter-spacing: .16em; }
.afi .af-step__title { font-weight: 600; }
.afi .af-alert, .afi .af-note { border-radius: 3px; }

/* buttons follow the site: pills, orange for the main action */
.afi .af-btn { border-radius: 999px; font-family: var(--af-display); font-weight: 600; font-size: 14.5px; padding: 10px 22px; transition: transform .2s, background .2s, border-color .2s, box-shadow .2s; }
.afi .af-btn--primary { background: var(--afi-orange); color: #fff !important; box-shadow: 0 10px 26px -12px rgba(247, 147, 30, .9); }
.afi .af-btn--primary:hover { background: #d9740a; filter: none; transform: translateY(-1px); }
.afi .af-btn--ghost { background: #fff; border-color: var(--af-line-strong); }
.afi .af-btn--ghost:hover { border-color: var(--af-text); color: var(--af-text) !important; }
.afi .af-btn--link { border-radius: 0; font-family: var(--af-font); }
.afi .af-btn--sm { padding: 6px 16px; font-size: 13px; }

/* inputs: drawn boxes */
.afi .af-label { font-family: var(--af-display); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.af-root.afi .af-input { border-radius: 3px; border-color: var(--af-line-strong); }
.afi .af-input:focus { border-color: var(--afi-navy); box-shadow: 0 0 0 3px rgba(247, 147, 30, .28); }
.afi .af-tile__body { border-radius: 3px; }
.afi .af-tile input:checked + .af-tile__body { border-color: var(--afi-navy); background: #f1f4f9; box-shadow: inset 4px 0 0 var(--afi-orange); }
.afi .af-tile input:checked + .af-tile__body i { color: var(--af-accent); }
.afi .af-choice input, .afi .af-check input { accent-color: var(--afi-navy); }
.afi .af-fee, .afi .af-upload, .afi .af-accept, .afi .af-terms, .afi .af-bank, .afi .af-pair__item { border-radius: 3px; }
.afi .af-upload__drop { border-radius: 3px; }
.afi .af-upload__drop:hover, .afi .af-upload.has-files .af-upload__drop { border-color: var(--afi-orange); color: var(--af-accent); }
.afi .af-progress { height: 3px; border-radius: 0; }
.afi .af-progress::before { background: var(--afi-orange); }
.afi .af-meter { border-radius: 0; height: 8px; }

/* ---------- the set: index + paper ---------- */
.afi-set { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 32px; align-items: start; }
.afi-set--form { grid-template-columns: minmax(0, 1fr); }
.afi-index { position: sticky; top: 104px; background: var(--afi-navy); color: #fff; border-radius: 4px; padding: 22px 0 18px; box-shadow: var(--af-shadow); }
.afi-index__head { padding: 0 22px 18px; border-bottom: 1px solid rgba(255, 255, 255, .14); }
.afi-index__head span { display: block; font-family: var(--af-display); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--afi-orange); }
.afi-index__head b { display: block; font-family: var(--af-display); font-size: 18px; font-weight: 600; line-height: 1.25; margin-top: 4px; overflow-wrap: anywhere; }
.af-root .afi-index__list { padding: 10px 0; }
.afi-sheet { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 11px 22px; color: #c8d2e0 !important; text-decoration: none !important; border-inline-start: 3px solid transparent; font-size: 14.5px; }
.afi-sheet__no { font-family: var(--af-display); font-size: 11.5px; letter-spacing: .08em; color: #8fa0b8; }
.afi-sheet__name { font-weight: 500; }
.afi-sheet:hover { background: rgba(255, 255, 255, .06); color: #fff !important; }
.afi-sheet.is-active { background: rgba(247, 147, 30, .14); border-inline-start-color: var(--afi-orange); color: #fff !important; }
.afi-sheet.is-active .afi-sheet__no { color: var(--afi-orange); }
.afi-sheet__rev { width: 20px; height: 20px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--afi-navy); background: var(--afi-orange); clip-path: polygon(50% 0, 100% 100%, 0 100%); padding-top: 6px; }
.af-root .afi-index__block { margin: 4px 22px 14px; border: 1px solid rgba(255, 255, 255, .22); display: grid; }
.afi-index__block > div { padding: 9px 12px; }
.afi-index__block > div + div { border-top: 1px solid rgba(255, 255, 255, .22); }
.afi-index__block dt { font-family: var(--af-display); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: #8fa0b8; margin: 0; }
.afi-index__block dd { margin: 2px 0 0; font-family: var(--af-display); font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.afi-state--active { color: #6fd9a8; }
.afi-state--due, .afi-state--upcoming { color: var(--afi-orange); }
.afi-state--expired { color: #ff8f86; }
.afi-index form { margin: 0; padding: 0 22px; }
.afi-out { border: 0; background: none; padding: 4px 0; color: #8fa0b8; font: 600 13px var(--af-display); cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.afi-out:hover { color: #fff; }

.afi-paper { min-width: 0; }
.afi-titleblock { display: grid; grid-template-columns: 1.3fr 1.6fr 1fr 1fr; border: 1px solid var(--af-text); background: #fff; margin-top: 8px; font-family: var(--af-display); font-size: 13.5px; font-weight: 600; color: var(--af-text); }
.afi-titleblock span { padding: 8px 12px 9px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.afi-titleblock span + span { border-inline-start: 1px solid var(--af-text); }
.afi-titleblock b { display: block; font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--af-muted); font-weight: 600; }

/* captions: a detail number in a circle, the title, a scale note */
.afi-cap { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--af-text); }
.afi-cap__no { width: 34px; height: 34px; border: 1.5px solid var(--af-text); border-radius: 50%; display: grid; place-items: center; font: 600 13px var(--af-display); flex: none; }
.afi-cap h2 { font-size: 19px; text-transform: uppercase; letter-spacing: .08em; }
.afi-cap__scale { margin-inline-start: auto; font: 500 11.5px var(--af-display); letter-spacing: .1em; text-transform: uppercase; color: var(--af-muted); text-align: end; }

/* ---------- general arrangement ---------- */
.afi-ga { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.afi-ga > .af-card { margin-bottom: 0; }

.afi-building { display: grid; padding-inline-start: 8px; }
.afi-storey { display: grid; grid-template-columns: minmax(120px, 44%) minmax(0, 1fr); align-items: stretch; gap: 18px; }
.afi-storey__slab { position: relative; min-height: 62px; display: flex; align-items: center; justify-content: space-evenly; gap: 6px; padding: 0 10px; border: 2px solid var(--afi-navy); border-bottom-width: 0; background: var(--afi-navy); }
.afi-storey:first-child .afi-storey__slab { border-top-width: 5px; }
.afi-storey__slab i { width: 13%; max-width: 26px; height: 26px; background: #ffd08a; box-shadow: inset 0 -9px 0 rgba(247, 147, 30, .55); }
.afi-storey.is-current .afi-storey__slab { background: repeating-linear-gradient(135deg, #fff 0 7px, #ffe2bd 7px 9px); border-color: var(--afi-orange); }
.afi-storey.is-current .afi-storey__slab i { background: #fff; box-shadow: inset 0 0 0 1.5px var(--afi-orange); }
.afi-storey.is-todo .afi-storey__slab { background: transparent; border-style: dashed; border-color: #9aa5b6; }
.afi-storey.is-todo .afi-storey__slab i { background: transparent; box-shadow: inset 0 0 0 1px #b9c2cf; }
.afi-storey.is-problem .afi-storey__slab { background: repeating-linear-gradient(135deg, #fff 0 7px, #f6c9c5 7px 9px); border-color: var(--af-bad); }
.afi-storey.is-problem .afi-storey__slab i { background: #fff; box-shadow: inset 0 0 0 1.5px var(--af-bad); }
.afi-storey__tag { position: relative; display: grid; align-content: center; padding: 8px 0 8px 22px; border-bottom: 1px dashed var(--af-line-strong); min-width: 0; }
[dir="rtl"] .afi-storey__tag { padding: 8px 22px 8px 0; }
.afi-storey__datum { position: absolute; inset-inline-start: 0; bottom: -1px; width: 0; height: 0; border: 7px solid transparent; border-top: 9px solid var(--af-text); border-bottom: 0; transform: translateY(0); }
.afi-storey__level { font: 600 10.5px var(--af-display); letter-spacing: .18em; text-transform: uppercase; color: var(--af-muted); }
.afi-storey__tag strong { font: 600 16px var(--af-display); color: var(--af-text); }
.afi-storey__tag em { font-style: normal; font-size: 13px; color: var(--af-muted); }
.afi-storey.is-done .afi-storey__tag em { color: var(--af-ok); }
.afi-storey.is-current .afi-storey__tag em { color: var(--af-accent); font-weight: 600; }
.afi-storey.is-problem .afi-storey__tag em { color: var(--af-bad); font-weight: 600; }
.afi-ground { height: 16px; border-top: 3px solid var(--af-text); background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(13, 17, 23, .35) 6px 7px); margin-inline-start: -8px; }
.af-root .afi-key { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; font: 500 11px var(--af-display); letter-spacing: .1em; text-transform: uppercase; color: var(--af-muted); }
.afi-key li { display: inline-flex; align-items: center; gap: 7px; }
.afi-key li::before { content: ""; width: 20px; height: 12px; border: 1.5px solid var(--afi-navy); background: var(--afi-navy); }
.afi-key .is-current::before { background: repeating-linear-gradient(135deg, #fff 0 4px, #ffd08a 4px 6px); border-color: var(--afi-orange); }
.afi-key .is-todo::before { background: none; border-style: dashed; border-color: #9aa5b6; }
.afi-key .is-problem::before { background: repeating-linear-gradient(135deg, #fff 0 4px, #f0a9a3 4px 6px); border-color: var(--af-bad); }

.afi-member { display: flex; flex-direction: column; }
.afi-stamp { position: absolute; top: 62px; inset-inline-end: 22px; transform: rotate(-9deg); border: 3px double currentColor; padding: 5px 14px; font: 700 15px var(--af-display); letter-spacing: .2em; text-transform: uppercase; opacity: .88; border-radius: 2px; }
.afi-stamp--ok { color: var(--af-ok); }
.afi-stamp--warn { color: #c2660a; }
.afi-stamp--bad { color: var(--af-bad); }
.af-root.af-root .afi-member__name { font: 600 25px/1.2 var(--af-display); color: var(--af-text); margin: 0 0 4px; padding-inline-end: 130px; overflow-wrap: anywhere; }
.af-root.af-root .afi-member__type { font-family: "Fraunces", Georgia, serif; font-style: italic; font-size: 17px; color: var(--af-muted); margin: 0 0 20px; }
.af-root .afi-specs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--af-text); margin: 0 0 26px; }
.afi-specs > div { padding: 9px 12px; min-width: 0; }
.afi-specs > div + div { border-inline-start: 1px solid var(--af-text); }
.afi-specs dt { font: 600 9.5px var(--af-display); letter-spacing: .18em; text-transform: uppercase; color: var(--af-muted); margin: 0; }
.afi-specs dd { margin: 2px 0 0; font: 600 15px var(--af-display); color: var(--af-text); overflow-wrap: anywhere; }

/* dimension line: |<---- 364 days left ---->| */
.afi-dim { display: grid; grid-template-columns: 1px minmax(0, 1fr) 1px; align-items: center; margin: 0 4px 26px; }
.afi-dim__ext { height: 46px; background: var(--af-text); }
.afi-dim__line { position: relative; height: 46px; display: grid; place-items: center; }
.afi-dim__line::before { content: ""; position: absolute; inset-inline: 0; top: 50%; height: 1px; background: var(--af-text); }
.afi-dim__line::after { content: ""; position: absolute; inset-inline: 0; top: 50%; height: 9px; transform: translateY(-50%); background: linear-gradient(to right, var(--af-text) 0 1.5px, transparent 1.5px) left / 9px 100% no-repeat, linear-gradient(to left, var(--af-text) 0 1.5px, transparent 1.5px) right / 9px 100% no-repeat; transform: translateY(-50%) skewX(-45deg); }
.afi-dim__line i { position: absolute; inset-inline-start: 0; bottom: 6px; height: 4px; background: var(--afi-orange); max-width: 100%; }
.afi-member--expired .afi-dim__line i { background: var(--af-bad); }
.afi-dim__line b { position: relative; z-index: 1; background: #fff; padding: 0 12px; font: 600 24px/1 var(--af-display); color: var(--af-text); }
.afi-dim__line small { font: 500 11px var(--af-display); letter-spacing: .14em; text-transform: uppercase; color: var(--af-muted); }
.afi-member__actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }

/* note: the next action */
.afi-note { position: relative; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 22px 24px; margin-bottom: 20px; background: #fffaf2; border: 1.5px dashed var(--afi-orange); border-radius: 4px; }
.afi-note--bad { background: #fff6f5; border-color: var(--af-bad); }
.afi-note--ok { background: #f3faf6; border-color: var(--af-ok); }
.afi-note > div { flex: 1 1 320px; min-width: 0; }
.afi-note__delta { flex: none; width: 46px; height: 42px; display: grid; place-items: end center; padding-bottom: 5px; font: 700 15px var(--af-display); color: #fff; background: var(--afi-orange); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.afi-note--bad .afi-note__delta { background: var(--af-bad); }
.afi-note--ok .afi-note__delta { background: var(--af-ok); }
.afi-note h2 { font-size: 21px; margin: 4px 0 4px; }
.af-root.af-root .afi-note p { margin: 0; color: #2a313c; }

/* schedule */
.afi-rows { border: 1px solid var(--af-text); }
.afi-row { display: grid; grid-template-columns: 54px minmax(120px, 1fr) minmax(0, 2.2fr) minmax(0, 1.2fr) 96px; align-items: center; gap: 14px; padding: 12px 14px; font-size: 14.5px; }
.afi-row + .afi-row { border-top: 1px solid var(--af-line-strong); }
.afi-row--head { background: var(--afi-navy); color: #fff; font: 600 10.5px var(--af-display); letter-spacing: .18em; text-transform: uppercase; padding-block: 9px; }
.afi-row__ref { font: 600 12px var(--af-display); letter-spacing: .06em; color: var(--af-accent); }
.afi-row strong { font: 600 15px var(--af-display); color: var(--af-text); }
.afi-row > span { min-width: 0; overflow-wrap: anywhere; color: #2a313c; }
.afi-row .af-pill { white-space: normal; }
.afi-row .af-btn { justify-self: end; }
.afi-bad { display: block; color: var(--af-bad); font-size: 13px; }

/* ---------- forms: one sheet, index beside it ---------- */
.afi .af-shell { grid-template-columns: 240px minmax(0, 1fr); gap: 30px; }
.afi .af-shell__nav { top: 104px; }
.afi-toc { background: #fff; border: 1px solid var(--af-text); padding: 18px 16px 14px; }
.afi-toc__title { display: block; font: 600 11px var(--af-display); letter-spacing: .2em; text-transform: uppercase; color: var(--af-accent); margin-bottom: 12px; }
.af-root.afi .af-steps { gap: 0; border-top: 1px solid var(--af-line); }
.afi .af-steps__item { padding: 9px 2px; border-radius: 0; border-bottom: 1px solid var(--af-line); align-items: center; }
.afi .af-steps__no { width: auto; height: auto; border: 0; border-radius: 0; background: none; font: 600 11.5px var(--af-display); letter-spacing: .08em; color: #8b95a5; min-width: 28px; justify-items: start; }
.afi .af-steps__label { font: 500 14.5px var(--af-display); }
.afi .af-steps__hint { display: none !important; }
.afi .af-steps__item.is-active .af-steps__no { background: none; color: var(--af-accent); }
.afi .af-steps__item.is-active .af-steps__label { font-weight: 700; }
.afi .af-steps__item.is-done .af-steps__no { background: none; color: var(--af-ok); }
.afi-toc__links { display: grid; gap: 8px; margin-top: 14px; font-size: 13.5px; font-weight: 600; }
.afi-toc__links a { display: inline-flex; gap: 8px; align-items: center; color: var(--af-text) !important; }
.afi-toc__links a:hover { color: var(--af-accent) !important; }

/* ---------- small screens ---------- */
@media (max-width: 1100px) {
  .afi-ga { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 991px) {
  .af-root.afi { padding-top: 26px; }
  .afi-set { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .afi-index { position: static; padding: 14px 0 0; }
  .afi-index__head { padding: 0 16px 12px; }
  .af-root .afi-index__list { display: flex; overflow-x: auto; padding: 0; scrollbar-width: none; }
  .afi-index__list::-webkit-scrollbar { display: none; }
  .afi-sheet { grid-template-columns: auto auto auto; padding: 12px 16px; border-inline-start: 0; border-bottom: 3px solid transparent; white-space: nowrap; }
  .afi-sheet.is-active { border-bottom-color: var(--afi-orange); }
  .af-root .afi-index__block, .afi-index form { display: none; }
  .afi .af-shell { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .afi .af-shell__nav { position: static; }
  .afi-row { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .afi-row--head { display: none; }
  .afi-row > span:nth-of-type(2) { grid-column: 2 / -1; }
  .afi-row > span:nth-of-type(3) { grid-column: 2 / 3; }
  .afi-row .af-btn { grid-column: 3; grid-row: 1; }
}
@media (max-width: 640px) {
  .afi-titleblock { grid-template-columns: 1fr 1fr; font-size: 12.5px; }
  .afi-titleblock span:nth-child(3) { border-inline-start: 0; }
  .afi-titleblock span:nth-child(n+3) { border-top: 1px solid var(--af-text); }
  .afi-cap__scale { display: none; }
  .afi-storey { grid-template-columns: 38% minmax(0, 1fr); gap: 12px; }
  .afi-storey__slab i:nth-child(n+4) { display: none; }
  .afi-storey__slab i { width: 22%; height: 22px; }
  .afi-stamp { position: static; align-self: flex-start; transform: rotate(-4deg); margin: 0 0 14px; font-size: 13px; }
  .af-root.af-root .afi-member__name { padding-inline-end: 0; font-size: 21px; }
  .af-root .afi-specs { grid-template-columns: 1fr; }
  .afi-specs > div + div { border-inline-start: 0; border-top: 1px solid var(--af-text); }
  .afi-dim__line b { font-size: 20px; }
  .afi-note { padding: 18px; }
}
