/* The layout of the site. The colors are custom properties set by the theme
   (pycal_dashboard/theme.py): the pycal blue and yellow by default, changed with the
   COLOR_... settings (docs/reference/settings.rst). */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
  background: var(--surface);
  color: var(--text);
}
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
h1, h2, h3 { line-height: 1.2; overflow-wrap: anywhere; }  /* long names such as dashboard.pycal.org wrap on phones */
.wrap { max-width: 64rem; margin: 0 auto; padding: 0 1rem; }
.muted { color: var(--text-muted); }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: .5rem; background: var(--surface); padding: .5rem; z-index: 10; }

.nav { background: var(--nav); color: var(--nav-text); border-bottom: .3rem solid var(--accent); }
.nav-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding-top: .6rem; padding-bottom: .6rem; }
.nav a, .nav .link-button { color: var(--nav-text); text-decoration: none; }
.nav a:hover, .nav .link-button:hover { text-decoration: underline; color: var(--nav-text); }
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.15rem; }
.menu { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; list-style: none; margin: 0; padding: 0; }
.menu form { margin: 0; }
.handle { opacity: .85; }
.link-button { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }

main.wrap { padding-top: 1.5rem; padding-bottom: 2rem; min-height: 60vh; }
.footer { border-top: 1px solid var(--border); background: var(--surface-tint); }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; padding-top: 1rem; padding-bottom: 1rem; }
.table-wrap { overflow-x: auto; }
.footer small a { color: inherit; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1rem; list-style: none; margin: 0; padding: 0; }
/* The menu of the colors, like the switch of the documentation: a dropdown with icons, without JavaScript. */
.icon { display: inline-block; vertical-align: -.2em; flex: none; }
.theme-menu { position: relative; }
/* The menu of the account in the top bar, without JavaScript. */
.account-menu { position: relative; }
.account-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .4rem; padding: .3rem .6rem; border: 1px solid color-mix(in srgb, var(--nav-text) 50%, transparent); border-radius: .4rem; color: var(--nav-text); }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary::after { content: "▾"; font-size: .8em; }
.account-menu summary:hover, .account-menu[open] summary { background: color-mix(in srgb, var(--nav-text) 18%, transparent); }
.account-menu ul { position: absolute; right: 0; top: calc(100% + .35rem); z-index: 20; min-width: 13rem; list-style: none; margin: 0; padding: .3rem; background: var(--surface); border: 1px solid var(--border); border-radius: .5rem; box-shadow: 0 .4rem 1.2rem rgba(0, 0, 0, .2); }
.nav .account-menu ul a, .account-menu ul button { display: flex; align-items: center; gap: .4rem; width: 100%; box-sizing: border-box; padding: .45rem .6rem; border: 0; border-radius: .3rem; background: none; color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.nav .account-menu ul a:hover, .account-menu ul button:hover { background: var(--surface-tint); text-decoration: none; color: var(--text); }
.account-menu form { margin: 0; }
.account-menu .menu-heading { padding: .2rem .6rem; color: var(--text-muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
/* the heading links to the Django admin for staff: it keeps the look of a heading */
.nav .account-menu ul .menu-heading a { display: inline; width: auto; padding: 0; border-radius: 0; color: inherit; font: inherit; text-decoration: none; }
.nav .account-menu ul .menu-heading a:hover { background: none; color: var(--text); text-decoration: underline; }
.account-menu .separator { height: 1px; margin: .3rem .2rem; background: var(--border); }
.count { display: inline-block; min-width: 1.3em; padding: 0 .35em; border-radius: 1em; background: var(--accent); color: var(--accent-text); font-size: .8em; font-weight: 700; text-align: center; }
.github-link { display: inline-flex; align-items: center; gap: .35em; }
.github-link .github-mark { width: 1em; height: 1em; }
.github-user { display: inline-flex; align-items: center; gap: .35em; text-decoration: none; }
.github-user:hover span:first-of-type { text-decoration: underline; }
.avatar { border-radius: 50%; background: var(--surface-tint); flex: none; }
.github-link-icon { color: var(--text-muted); text-decoration: none; padding: .1em; border-radius: .25em; vertical-align: middle; }
.github-link-icon:hover, .github-link-icon:focus-visible { color: var(--primary); background: var(--surface-tint); }
h1 .github-link-icon .github-mark { width: .75em; height: .75em; }
.theme-menu summary { list-style: none; display: flex; align-items: center; padding: .3rem .45rem; border: 1px solid color-mix(in srgb, var(--nav-text) 50%, transparent); border-radius: .4rem; color: var(--nav-text); font-weight: 400; }
.theme-menu summary::-webkit-details-marker { display: none; }
.theme-menu summary:hover, .theme-menu[open] summary { background: color-mix(in srgb, var(--nav-text) 18%, transparent); }
.theme-menu summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-menu form { position: absolute; right: 0; top: calc(100% + .35rem); z-index: 20; display: flex; flex-direction: column; min-width: 11rem; padding: .3rem; background: var(--surface); border: 1px solid var(--border); border-radius: .5rem; box-shadow: 0 .4rem 1.2rem rgba(0, 0, 0, .2); }
.theme-menu button { display: flex; align-items: center; gap: .55rem; width: 100%; white-space: nowrap; padding: .45rem .6rem; border: 0; border-radius: .3rem; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.theme-menu button:hover, .theme-menu button:focus-visible { background: var(--surface-tint); }
.theme-menu button[aria-pressed="true"] { color: var(--primary); font-weight: 700; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: .5rem; padding: 1rem 1.25rem; margin: 0 0 1rem; }
.card.narrow { max-width: 32rem; margin: 2rem auto; }
.card h2:first-child, .card h1:first-child { margin-top: 0; }
.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; }
.hero { border-left: .4rem solid var(--accent); background: var(--surface-tint); padding: 1.25rem 1.5rem; border-radius: .5rem; margin-bottom: 1.5rem; }
.hero .lead { font-size: 1.15rem; }
.stats { color: var(--text-muted); margin-bottom: 0; }

.button {
  display: inline-block; padding: .5rem 1rem; border-radius: .4rem; border: 1px solid var(--primary);
  background: var(--primary); color: var(--surface); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--surface); }
.nav .button-accent, .button-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.nav .button-accent:hover { color: var(--accent-text); text-decoration: none; filter: brightness(.95); }
.button-small { padding: .2rem .6rem; font-size: .9rem; }
.button-quiet { background: transparent; color: var(--primary); }
.button-quiet:hover { color: var(--surface); }
form.inline { display: inline; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1rem; }
input[type="email"], input:not([type]) { font: inherit; padding: .35rem .5rem; border: 1px solid var(--border); border-radius: .3rem; background: var(--surface); color: var(--text); }

.messages { margin-bottom: 1rem; }
.message { border-left: .3rem solid var(--primary); background: var(--surface-tint); padding: .6rem .9rem; border-radius: .3rem; }
.message-success { border-color: var(--success); }
.message-warning { border-color: var(--warning); }
.message-error { border-color: var(--danger); }
.error h1 { color: var(--danger); }

/* The pages of errors: the status large in the blue of the logo, underlined in its yellow. */
.status-page { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1rem 2.5rem; max-width: 52rem; margin: 2rem auto; padding: 1.5rem 1.75rem; background: var(--surface-tint); border-left: .4rem solid var(--accent); border-radius: .5rem; }
.status-page.error { border-left-color: var(--danger); }
.status-code { margin: 0; font-size: clamp(3.5rem, 12vw, 6rem); font-weight: 800; line-height: 1; color: var(--brand); letter-spacing: -.03em; border-bottom: .35rem solid var(--accent); }
.status-page.error .status-code { border-bottom-color: var(--danger); }
.status-text { flex: 1 1 20rem; min-width: 0; }
.status-text h1 { margin-top: 0; }
.status-text .lead { font-size: 1.1rem; }
.status-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.copy-details { margin: 1rem 0; }
.copy-details label { display: block; margin: .4rem 0; font-size: .9rem; }
textarea.copy { width: 100%; box-sizing: border-box; font: .85rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: .3rem; padding: .5rem; resize: vertical; }
form.stacked label { display: block; font-weight: 600; margin-bottom: .2rem; }
form.stacked input:not([type="hidden"]) { width: 100%; max-width: 26rem; box-sizing: border-box; }
form.stacked small { display: block; color: var(--text-muted); margin-top: .2rem; }
.status-help { color: var(--text-muted); font-size: .95rem; margin-bottom: 0; }
.detail code { white-space: pre-wrap; word-break: break-word; }

.badge { display: inline-block; font-size: .8rem; font-weight: 600; padding: .05rem .5rem; border-radius: 1rem; border: 1px solid currentColor; }
.badge-success { color: var(--success); }
.badge-warning { color: var(--warning); }
.badge-error { color: var(--danger); }
.badge.muted { color: var(--text-muted); }  /* optional: gray */
.badge-strong { color: var(--text); }  /* mandatory: black on light backgrounds */
.badges { display: inline-flex; flex-wrap: wrap; gap: .3rem; vertical-align: middle; font-weight: 400; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .4rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.list { padding-left: 1.2rem; }
.list.to-sign { padding-left: 0; }
.facts th { width: 8rem; white-space: nowrap; color: var(--text-muted); font-weight: 600; }
.list li { margin: .3rem 0; }
.steps li { margin: .4rem 0; }
/* a numbered list that is a card: room for the numbers inside its border */
ol.card, ul.card { padding-left: 2.75rem; }

@media (max-width: 40rem) {
  .table, .table tbody, .table tr, .table td { display: block; }
  .table thead { display: none; }
}

/* Policy pages keep long Markdown readable and choices usable without scripts. */
details { margin: .75rem 0; }
summary { cursor: pointer; font-weight: 600; }
input[type="radio"], input[type="checkbox"] { margin-right: .35rem; }
select { font: inherit; padding: .4rem; max-width: 100%; }

/* The dashboard: the numbers at the top, and lists of issues and pull requests. */
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: .2rem; text-underline-offset: .35rem; }
.lead { font-size: 1.1rem; }
.stats-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .75rem; list-style: none; padding: 0; margin: 0 0 1.5rem; }
.stats-tiles li { background: var(--surface-tint); border: 1px solid var(--border); border-top: .3rem solid var(--brand); border-radius: .5rem; padding: .75rem 1rem; color: var(--text-muted); }
.stats-tiles a { display: block; color: inherit; text-decoration: none; }
.stats-tiles a:hover strong { color: var(--primary-hover); }
.stats-tiles strong { display: block; font-size: 1.9rem; line-height: 1.1; color: var(--primary); }
.items { list-style: none; padding: 0; margin: 0; }
.item { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.item:last-child { border-bottom: 0; }
.item-title { font-weight: 600; overflow-wrap: anywhere; }
.item-meta { flex: 1 1 100%; font-size: .9rem; }
.labels { display: inline-flex; flex-wrap: wrap; gap: .25rem; }
.label { display: inline-block; font-size: .78rem; padding: 0 .5rem; border-radius: 1rem; background: var(--surface-tint); border: 1px solid var(--border); color: var(--text); }
.badge-open, .badge-done, .badge-success { color: var(--success); }
.badge-draft, .badge-closed, .badge-ignored { color: var(--text-muted); }
.badge-merged { color: var(--merged); }
.badge-failed, .badge-refused { color: var(--danger); }
.empty { font-style: italic; }
.people { padding-left: 1.5rem; }
.people li { margin: .3rem 0; }
.pages { display: flex; gap: 1rem; align-items: center; margin: 1rem 0; }
.days { margin: 0; }
.days label { font-weight: 600; }
.card-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.card-title h1, .card-title h2 { margin-top: 0; }
.facts-list { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; }
.facts-list dt { color: var(--text-muted); font-weight: 600; }
.facts-list dd { margin: 0; overflow-wrap: anywhere; }
label.check { display: block; font-weight: 400; margin: .25rem 0; }
.choice-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .75rem; }
label.choice { display: block; font-weight: 400; border: 1px solid var(--border); border-radius: .4rem; padding: .6rem .8rem; cursor: pointer; }
label.choice:has(input:checked) { border-color: var(--primary); background: var(--surface-tint); }
label.choice small { display: block; color: var(--text-muted); margin-top: .2rem; }
fieldset { border: 1px solid var(--border); border-radius: .4rem; padding: .5rem .8rem; }
pre.code { white-space: pre-wrap; background: var(--surface-tint); padding: .75rem; border-radius: .3rem; overflow-x: auto; }
.help-link { display: inline-flex; align-items: center; justify-content: center; margin-left: .25em; padding: .1em; border-radius: .25em; color: var(--primary); line-height: 1; text-decoration: none; vertical-align: -.1em; }
.help-link .book { width: 1.1em; height: 1.1em; }
.help-link:hover, .help-link:focus-visible { background: var(--surface-tint); color: var(--primary-hover); text-decoration: none; }
.log { list-style: none; padding: 0; display: grid; gap: .75rem; }
.log > li > p { margin: 0 0 .25rem; }
.addresses li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.addresses .address { overflow-wrap: anywhere; font-weight: 600; }

/* projects: tabs of a project, the progress of an update, the forms */
.tabs { display: flex; flex-wrap: wrap; gap: .25rem 1rem; list-style: none; padding: 0; margin: 0 0 1rem; border-bottom: 1px solid var(--border); }
.tabs a { display: inline-block; padding: .4rem 0; text-decoration: none; }
.tabs a[aria-current="page"] { font-weight: 700; color: var(--text); border-bottom: .2rem solid var(--accent); }
.heading-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
.heading-row h1 { margin: .5rem 0; }
.progress { width: 100%; max-width: 32rem; height: 1rem; accent-color: var(--primary); }
.project-list { list-style: none; padding: 0; margin: 0; }
.project-list li { padding: .75rem 0; border-bottom: 1px solid var(--border); }
.project-list h2 { font-size: 1.15rem; margin: 0 0 .25rem; }
.project-list p { margin: .2rem 0; }
form.stacked textarea { width: 100%; max-width: 40rem; box-sizing: border-box; font: inherit; padding: .35rem .5rem; border: 1px solid var(--border); border-radius: .3rem; background: var(--surface); color: var(--text); }
form.stacked fieldset { border: 1px solid var(--border); border-radius: .3rem; }
.numeric { text-align: right; white-space: nowrap; }
.choices { list-style: none; padding: 0; columns: 18rem; }
.choices li { margin: .2rem 0; break-inside: avoid; }

/* the pull requests of a project: a table whose columns the checkboxes of "Display" show and hide
   with CSS alone; without the column Status, the colour of the first cell tells it */
.table-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem 1rem; }
.table-head h2 { margin: 0; }
.per-page { display: flex; align-items: center; gap: .4rem; margin-left: auto; }
.columns-choice { margin: .75rem 0; }
.columns-choice summary { cursor: pointer; }
.columns-checks { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin: .5rem 0 0; }
.columns-checks label.check { display: inline-flex; gap: .3rem; align-items: center; }
.pull-requests .col-link { width: 1%; white-space: nowrap; }
.pull-requests .col-number, .pull-requests .col-created { white-space: nowrap; }
.pull-table:has(#column-status:not(:checked)) .col-status,
.pull-table:has(#column-title:not(:checked)) .col-title,
.pull-table:has(#column-organization:not(:checked)) .col-organization,
.pull-table:has(#column-repository:not(:checked)) .col-repository,
.pull-table:has(#column-number:not(:checked)) .col-number,
.pull-table:has(#column-creator:not(:checked)) .col-creator,
.pull-table:has(#column-created:not(:checked)) .col-created { display: none; }
/* the icon that links GitHub only while no title or number links the pull request */
.pull-table:has(#column-title:checked) .col-link,
.pull-table:has(#column-number:checked) .col-link { display: none; }
/* without the column of the status, the row starts with its color */
.pull-table:has(#column-status:not(:checked)) tr[data-status] { border-left: .3rem solid transparent; }
.pull-table:has(#column-status:not(:checked)) tr[data-status="open"] { border-left-color: var(--success); }
.pull-table:has(#column-status:not(:checked)) tr[data-status="merged"] { border-left-color: var(--merged); }
.pull-table:has(#column-status:not(:checked)) tr[data-status="closed"] { border-left-color: var(--danger); }
.pagination { display: flex; gap: 1rem; align-items: center; margin-top: 1rem; }

/* the proposals of a field, such as the people to share a project with */
.completion-field { position: relative; display: inline-block; }
.completion { position: absolute; z-index: 10; left: 0; top: 100%; min-width: 100%; max-height: 18rem; overflow-y: auto; margin: .2rem 0 0; padding: .25rem 0; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: .4rem; box-shadow: 0 .3rem 1rem rgba(0, 0, 0, .15); }
.completion li { display: flex; align-items: center; gap: .4rem; padding: .35rem .7rem; cursor: pointer; white-space: nowrap; }
.completion li[aria-selected="true"], .completion li:hover { background: var(--surface-tint); }

/* the update of a project, at the bottom of its overview */
.update-line { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-top: 1.5rem; padding-top: .75rem; border-top: 1px solid var(--border); font-size: .9rem; }

/* Markdown that people typed, and the field that edits it */
.markdown > :first-child { margin-top: 0; }
.markdown > :last-child { margin-bottom: 0; }
.markdown pre { overflow-x: auto; padding: .5rem .75rem; background: var(--surface-tint); border-radius: .3rem; }
.markdown blockquote { margin: .5rem 0; padding-left: .8rem; border-left: .25rem solid var(--border); color: var(--text-muted); }
.markdown-field { margin: 0 0 1rem; }
.markdown-field label { display: block; }
.markdown-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem; margin: .25rem 0; }
.markdown-bar markdown-toolbar { display: flex; flex-wrap: wrap; gap: .25rem; }
.markdown-bar button[aria-pressed="true"] { background: var(--surface-tint); }
.markdown-field textarea { width: 100%; }
.markdown-preview { min-height: 6rem; padding: .5rem .75rem; border: 1px solid var(--border); border-radius: .3rem; }

/* the red area that deletes an account */
.danger-zone { border: 2px solid var(--danger); background: var(--danger-bg); margin-top: 1.5rem; }
.danger-zone h2 { color: var(--danger); }
.button-danger { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.button-danger:hover, .button-danger:focus-visible { background: var(--text); border-color: var(--text); color: var(--surface); }

/* a notice at the top of a page that can be clicked away, such as of failed updates */
.notice { position: relative; padding: .75rem 2.75rem .75rem 1rem; margin: 0 0 1rem; border-radius: .4rem; border: 1px solid var(--border); }
.notice h2 { font-size: 1.05rem; margin: 0 0 .4rem; }
.notice-error { border-color: var(--danger); background: var(--danger-bg); }
.notice-close { position: absolute; top: .4rem; right: .4rem; font-size: 1.2rem; line-height: 1; }

/* text only for screen readers, such as the header of a column of icons */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
