/* imun.cloud - a Model UN conference directory.
 *
 * The reader is sixteen, deciding whether to apply to something that costs
 * their parents money and a weekend, and every competing page is either a
 * school's own brochure or a listicle ranking conferences by prestige. Both
 * look expensive. So this deliberately does not: it reads like a reference
 * table someone keeps up to date, because that is the claim the site is making.
 *
 * The palette is the one association the subject genuinely owns - UN blue -
 * darkened until white text sits on it properly, which the actual UN blue does
 * not. Paper is warm rather than white: these are long pages read in a browser
 * tab at 11pm the night before a deadline.
 *
 * NO GOLD, NO CRESTS, NO SERIF DISPLAY FACE. That is the visual language of the
 * conferences themselves, and a directory that dresses like the thing it
 * describes has picked a side.
 */

:root[data-site="imun"] {
  --paper: #fcfcfa;
  --paper-alt: #f2f3f6;

  --ink: #16202c;
  --ink-soft: #3d4a59;
  --ink-faint: #64707e;

  /* UN blue at 5.9:1 against white. The official #418FDE carries nothing
     legibly and is a background colour pretending to be a brand colour. */
  --accent: #1f4e79;
  --accent-ink: #ffffff;
  --accent-soft: #e7eef6;

  /* Procedure is the fact that decides whether a delegate can function in the
     room, so it gets its own colour rather than sharing the accent: THIMUN and
     Harvard-style must never look like the same kind of statement as a fee. */
  --flag: #7a4b1e;
  --flag-soft: #f6eddf;

  --line: #dde1e8;
  --header-line: #c9d2dd;
  --subbar-label: #1f4e79;
  --link: #1a4a75;
  --link-visited: #4a3d73;
  --radius: 4px;
}

@media (prefers-color-scheme: dark) {
  :root[data-site="imun"] {
    --paper: #12171e;
    --paper-alt: #1a2029;
    --ink: #eef2f7;
    --ink-soft: #c6d0dc;
    --ink-faint: #94a1b0;
    /* Lifted clear of the light-mode blue, which is unreadable on this ground. */
    --accent: #7fb3e6;
    --accent-ink: #0d1620;
    --accent-soft: #1c2a3a;
    --flag: #d9a463;
    --flag-soft: #2a2015;
    --line: #26303c;
    --header-line: #313c4a;
    --subbar-label: #7fb3e6;
    --link: #9cc6ee;
    --link-visited: #b3a8dd;
  }
}

/* The specification table is the site. Everything else on a conference page is
   context for it, so it is set at full reading size with tabular figures and
   room to breathe, rather than shrunk into a footnote below the prose. */
:root[data-site="imun"] .spec-table {
  font-variant-numeric: tabular-nums;
}

:root[data-site="imun"] .spec-table th {
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* Where a figure came from and when, beside the figure. Small, but never
   grey-on-grey: the provenance is the reason to believe the row. */
:root[data-site="imun"] .spec-table .spec-source {
  color: var(--ink-faint);
  font-size: 0.82em;
}

/* Rules of procedure, wherever a page states them. The one fact a first-timer
   most needs and least expects, so it is marked rather than left in the run of
   the prose. */
:root[data-site="imun"] .jurisdiction-note,
:root[data-site="imun"] .key-facts {
  background: var(--flag-soft);
  border-left: 3px solid var(--flag);
  padding: 0.9rem 1.1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}

:root[data-site="imun"] .prose { max-width: 70ch; }
:root[data-site="imun"] .prose p { line-height: 1.7; }

/* --- links ----------------------------------------------------------------
   site.css colours every <a> with --accent-ink. This theme set --accent-ink to
   #ffffff, reading the name as "ink that sits ON the accent" - the colour of
   button text - which made every link on the site white on a white page. It
   was invisible in every automated check here, because nothing measured
   contrast on a rendered page, and it shipped to production on all seven
   themes at once.

   The accent itself is the right colour for a link in both modes: each theme
   chose it dark enough to hold white text, which is exactly dark enough to
   read on paper, and each theme's dark-mode block lifts it for a dark ground.
   var() resolves per element, so this one declaration follows that switch. */
:root[data-site="imun"] {
  --accent-ink: var(--accent);
}

/* ==========================================================================
   Own layout (themes/imun). The site used the shared travel layout with this
   file only recolouring it, which left it looking like every other site on
   the platform - photo grids, coloured letter-tile logo, a footer listing
   "Categories". The structure below is built from the one thing this site
   is: a register of conferences and a handbook for using them.
   ========================================================================== */
:root[data-site="imun"] {
  --im-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --im-rule: #1f4e79;
  --im-foot: #0f1b2b;
  --im-foot-ink: #dbe4ef;
  --im-foot-soft: #a9bcd2;
}
@media (prefers-color-scheme: dark) {
  :root[data-site="imun"] { --im-rule: #7fb3e6; --im-foot: #0a1119; }
}
:root[data-site="imun"] body { background: var(--paper); }

/* header: an index bar under a single heavy rule */
.im-header { border-top: 6px solid var(--im-rule); border-bottom: 1px solid var(--line); background: var(--paper); }
.im-bar { display: flex; align-items: center; gap: 1.25rem; min-height: 64px; }
.im-mark { display: inline-flex; align-items: baseline; gap: .1rem; text-decoration: none; margin: 0; }
.im-mark-code {
  font-family: var(--im-mono); font-weight: 700; font-size: 1.05rem; letter-spacing: .02em;
  background: var(--im-rule); color: var(--paper); padding: .18rem .45rem; border-radius: 2px;
}
.im-mark-dot { font-family: var(--im-mono); font-size: .95rem; color: var(--ink-soft); }
.im-tabs { display: flex; gap: 1.25rem; flex: 1; flex-wrap: wrap; }
.im-tabs a {
  font-family: var(--im-mono); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-soft); text-decoration: none; padding: .35rem 0; border-bottom: 2px solid transparent;
}
.im-tabs a:hover { color: var(--ink); }
.im-tabs a.is-current { color: var(--ink); border-bottom-color: var(--im-rule); }
.im-search input {
  border: 1px solid var(--line); border-radius: 2px; background: var(--paper-alt); color: var(--ink);
  padding: .45rem .7rem; font-size: .88rem; min-width: 15rem;
}
.im-toggle { display: none; }
.nav-drawer .im-mark-code { font-size: .95rem; }
@media (max-width: 900px) {
  .im-tabs, .im-search { display: none; }
  .im-toggle { display: inline-flex; }
}

/* lede: a plain statement and three numbered steps */
.im-lede { background: var(--paper-alt); border-bottom: 1px solid var(--line); }
.im-lede-inner { padding: 2.5rem 0 2rem; }
.im-kicker { font-family: var(--im-mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--flag); margin: 0 0 .6rem; }
.im-lede h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.12; margin: 0 0 .75rem; max-width: 22ch; }
.im-standfirst { font-size: 1.1rem; color: var(--ink-soft); max-width: 60ch; margin: 0 0 1.5rem; }
.im-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.im-steps a {
  display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; text-decoration: none;
  background: var(--paper); border: 1px solid var(--line); border-left: 4px solid var(--im-rule);
  color: var(--ink); font-weight: 600;
}
.im-steps a:hover { border-color: var(--im-rule); }
.im-step-n { font-family: var(--im-mono); color: var(--im-rule); font-size: 1.1rem; }
@media (max-width: 700px) { .im-steps { grid-template-columns: 1fr; } }

.im-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  border-bottom: 2px solid var(--ink); margin: 2.75rem 0 1rem; padding-bottom: .4rem; }
.im-section-head h2 { font-size: 1.35rem; margin: 0; }
.im-more { font-family: var(--im-mono); font-size: .8rem; }

/* the register */
.im-table-wrap { overflow-x: auto; }
.im-table { width: 100%; border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; }
.im-table thead th {
  text-align: left; font-family: var(--im-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-soft); font-weight: 600; padding: .5rem .75rem; border-bottom: 1px solid var(--ink);
}
.im-table td, .im-table tbody th { padding: .75rem; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.im-table tbody tr:nth-child(even) { background: var(--paper-alt); }
.im-table tbody th a { display: flex; flex-direction: column; gap: .1rem; text-decoration: none; }
.im-code { font-family: var(--im-mono); font-weight: 700; color: var(--im-rule); font-size: 1rem; letter-spacing: .02em; }
.im-name { color: var(--ink); font-weight: 500; font-size: .85rem; }
.im-table tbody th a:hover .im-name { text-decoration: underline; }
.im-level { display: inline-block; font-size: .78rem; font-weight: 600; padding: .1rem .45rem; border-radius: 2px; white-space: nowrap; }
.im-level-school { background: var(--flag-soft); color: var(--flag); }
.im-level-uni { background: var(--accent-soft); color: var(--im-rule); }

/* the handbook: clause-numbered lists in three stages */
.im-stage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.75rem; }
.im-stage h3 { display: flex; align-items: baseline; gap: .6rem; font-size: 1.05rem; margin: 0 0 .5rem; }
.im-stage-n { font-family: var(--im-mono); color: var(--paper); background: var(--im-rule); padding: 0 .4rem; border-radius: 2px; font-size: .85rem; }
.im-clauses { list-style: none; counter-reset: clause; margin: 0; padding: 0; }
.im-clauses li { counter-increment: clause; display: grid; grid-template-columns: 2.4rem 1fr; padding: .5rem 0; border-top: 1px solid var(--line); }
.im-clauses li::before { content: counter(clause, decimal-leading-zero); font-family: var(--im-mono); color: var(--ink-faint); font-size: .8rem; padding-top: .15rem; }
.im-clauses a { color: var(--ink); text-decoration: none; }
.im-clauses a:hover { color: var(--im-rule); text-decoration: underline; }
.im-clauses-rest { margin-top: 1rem; columns: 2; column-gap: 1.75rem; }
@media (max-width: 800px) { .im-stage-grid { grid-template-columns: 1fr; } .im-clauses-rest { columns: 1; } }

/* comparisons and shortlists as labelled rows */
.im-versus-list { list-style: none; margin: 0 0 3rem; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.im-vs a { display: grid; gap: .25rem; padding: .9rem 1rem; border: 1px solid var(--line); background: var(--paper); text-decoration: none; height: 100%; }
.im-vs a:hover { border-color: var(--im-rule); }
.im-vs-label { font-family: var(--im-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--flag); }
.im-vs-list .im-vs-label { color: var(--im-rule); }
.im-vs-title { color: var(--ink); font-weight: 600; }
.im-vs-blurb { color: var(--ink-soft); font-size: .88rem; }
@media (max-width: 700px) { .im-versus-list { grid-template-columns: 1fr; } }

/* footer: dark, with the register's codes as the index */
.im-footer { background: var(--im-foot); color: var(--im-foot-ink); margin-top: 3rem; }
.im-footer a { color: var(--im-foot-soft); text-decoration: none; }
.im-footer a:hover { color: #ffffff; text-decoration: underline; }
.im-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; padding: 2.5rem 0 1.5rem; }
.im-footer-col { display: flex; flex-direction: column; gap: .35rem; }
.im-footer-col a { font-family: var(--im-mono); font-size: .82rem; }
.im-footer-head { font-family: var(--im-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--im-foot-ink); margin: 0 0 .35rem; }
.im-footer .im-mark-code { background: #dbe4ef; color: var(--im-foot); }
.im-footer .im-mark-dot { color: var(--im-foot-soft); }
.im-footer-legal { border-top: 1px solid #253449; padding: 1rem 0 1.75rem; font-size: .8rem; color: var(--im-foot-soft); }
.im-footer-legal p { margin: .25rem 0; }
@media (max-width: 700px) { .im-footer-grid { grid-template-columns: 1fr; } }

/* inner pages: the same reference register, not the travel magazine */
:root[data-site="imun"] .breadcrumbs { font-family: var(--im-mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
:root[data-site="imun"] .doc-head h1 { border-top: 4px solid var(--im-rule); padding-top: .9rem; }
:root[data-site="imun"] .card a { border-radius: 2px; border-top: 3px solid var(--im-rule); }
:root[data-site="imun"] .card-meta { font-family: var(--im-mono); text-transform: uppercase; letter-spacing: .06em; font-size: .7rem; }
:root[data-site="imun"] .children h2, :root[data-site="imun"] .doc h2 { letter-spacing: -.01em; }
:root[data-site="imun"] .topic-nav-head, :root[data-site="imun"] .rail-group-title { font-family: var(--im-mono); text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; }

/* On a phone the row labels must wrap: nowrap on "Individual delegates or
   school delegations" pushed every conference page 185px sideways. */
@media (max-width: 640px) {
  :root[data-site="imun"] .spec-table th { white-space: normal; }
}
