/* ─────────────────────────────────────────────────────────────────────────
   Theme tokens.

   Every colour below is defined once here and referenced through the rest of
   the file, so dark mode is a matter of swapping this block rather than
   hunting hard-coded hex values.

   Resolution order:
     1. :root                              -> light, the default
     2. prefers-color-scheme: dark         -> follow the OS on a first visit
     3. [data-theme="dark"|"light"]        -> an explicit choice always wins
   ───────────────────────────────────────────────────────────────────────── */
:root {
  --bg: #ffffff;
  --fg: #212529;
  --muted: #808080;
  --border: #cccccc;
  --border-soft: #dedede;
  --surface: rgba(236, 240, 241, 0.7);
  --surface-solid: #f6f7f8;
  --accent: rgb(36, 101, 191);
  --accent-strong: #0097e6;
  --timer: #444444;
  --pre: #333333;
  --strip: #333333;
  --danger: #bb2d3b;
  --pwc: #1198b2;
  --selection: #e74c3c;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171c;
    --fg: #e6e8eb;
    --muted: #9aa2ad;
    --border: #3a4048;
    --border-soft: #2c313a;
    --surface: rgba(255, 255, 255, 0.06);
    --surface-solid: #1c2028;
    --accent: #7fb0ff;
    --accent-strong: #35b3ff;
    --timer: #e6e8eb;
    --pre: #c8cdd4;
    --strip: #0d1015;
    --danger: #e0596a;
    --pwc: #3fc9e0;
    --selection: #e74c3c;
  }
}

[data-theme="dark"] {
  --bg: #14171c;
  --fg: #e6e8eb;
  --muted: #9aa2ad;
  --border: #3a4048;
  --border-soft: #2c313a;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-solid: #1c2028;
  --accent: #7fb0ff;
  --accent-strong: #35b3ff;
  --timer: #e6e8eb;
  --pre: #c8cdd4;
  --strip: #0d1015;
  --danger: #e0596a;
  --pwc: #3fc9e0;
  --selection: #e74c3c;
}

body {
  background-color: var(--bg);
  color: var(--fg);
}

body {
  font-size: 16px;
  line-height: 23px;
  font-weight: 300;
  -webkit-font-smoothing: subpixel-antialiased;
}

body *::selection {
  background: var(--selection);
  color: #fff;
}

.container {
  max-width: 980px;
}

.top-strip {
  background-color: var(--strip);
  height: 0.25em;
  width: 100%;
}

h1,
h2,
h3 {
  /* font-weight: 300; */
}

h1 {
  margin: 0 0 10px;
  font-size: 30px;
  line-height: 35px;
}

h2 {
  margin: 0 0 10px;
  font-size: 25px;
  line-height: 30px;
}

h3 {
  margin: 0;
  font-size: 20px;
  line-height: 25px;
}

.page-header {
  margin-top: 20px;
  margin-bottom: 20px;
}

#conf-title.page-header {
  border-bottom: none;
}

#conf-full-name {
  margin-bottom: 5px;
}

p.authors {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 20px;
}

p.authors a {
  border-color: var(--border-soft);
}

img {
  max-width: 100%;
}

p {
  text-align: justify;
}

a {
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  color: inherit;
}

p.lead.authors a {
  border-bottom: none;
}

a:hover,
a:focus {
  color: inherit;
  text-decoration: none;
}

.thumb {
  margin: 20px 0;
  border: 1px solid var(--muted);
}

pre {
  color: var(--pre);
  font-size: 12px;
  line-height: 17px;
}

footer {
  font-size: 13px;
}

.conf-row {
  margin-bottom: 5px;
}

.conf-title,
.conf-title-small,
.conf-title-icon {
  font-size: 20px;
  font-weight: 400;

}

.conf-title-small {
  display: none;
}

.conf-title-icon {
  white-space: nowrap;
  font-size: 20px;
}

.deadline,
.meta {
  font-size: 13px;
}

.note {
  font-size: 13px;
  margin-bottom: 5px;
}

.timer,
.timer-small {
  font-size: 20px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

#confs {
  margin-top: 20px;
}
.timer-small {
  display: none;
}

#conf-timer {
  font-size: 72px;
  color: var(--timer);
  margin-top: 40px;
  margin-bottom: 0.5em;
}

#conf-key-facts {
  margin-bottom: 10px;
}

.conf-sub {
  color: var(--accent);
  background: var(--surface);
  font-size: 13px;
  padding: 3px 5px;
  margin-right: 8px;
  cursor: pointer;
  font-weight: 300;
}

.conf-sub::selection {
  background: var(--accent-strong);
}

.checkbox input[type="checkbox"]:checked:after {
  background-color: var(--accent-strong);
  border-color: var(--accent-strong);
}

.checkbox input[type="checkbox"]:after,
.checkbox input[type="checkbox"]:focus:after {
  border-color: var(--accent-strong);
}

#sort-order-checkbox {
    text-align: right;
    font-size: 14px;
    padding-top: 5px;
}

#sort-order-checkbox input[type="checkbox"]:checked:after {
    background-color: var(--accent-strong);
    border-color: var(--accent-strong);
  }
  
#sort-order-checkbox input[type="checkbox"]:after,
#sort-order-checkbox input[type="checkbox"]:focus:after {
    border-color: var(--accent-strong);
}

.filter-label {
  text-align: right;
}


.pwc-link {
  text-decoration: none;
  border: none;
  vertical-align: middle;
}

.pwc-link:hover {
  border-bottom: 1px solid var(--pwc);
}

.icon-inner {
  width: .95em;
  height: .95em;
  display: inline-block;
  vertical-align: middle;
  position: relative;
  fill: currentColor;
}

.pwc-icon {
  color: var(--pwc);
}

.twitter-github-icons {
  line-height: 16px;
}

#past-events-title {
  padding-bottom: 15px;
  border-bottom: 2px solid var(--danger);
}

#past_confs .past{
  opacity: 0.5;
}

.badge-link {
  vertical-align: middle; 
  margin-bottom: 3px;
  margin-left: 2px;
  margin-right: 2px;
}


.badge-danger {
  background-color: var(--danger);
}

@media only screen and (max-width: 768px) {
  #conf-timer {
    font-size: 64px;
  }
  .calendar {
    margin-bottom: 10px;
  }
  .filter-label {
    text-align: left;
  }
}

@media only screen and (max-width: 576px) {
  #conf-timer {
    font-size: 36px;
  }
  .conf-place {
    display: none;
  }
  .conf-date {
    display: none;
  }
  .note {
    display: none;
  }
  .conf-row {
    margin-bottom: 7px;
  }
  .timer {
    display: none;
  }
  .timer-small {
    text-align: right;
    display: grid;
  }
  .conf-title {
    display: none;
  }
  .conf-title-small {
    display: inline;
  }

}

@media only screen and (max-width: 375px) {
  #conf-timer {
    font-size: 28px;
  }
}

.checkbox {
  font-size: 12px;
}

.calendar {
  font-size: 12px;
  margin-top: 3px;
}

.calendar img {
  margin-right: 5px;
}

.ind-cal {
  margin: 0 5px;
}

.calendar img {
  height: 20px;
}

/* ─────────────────────────────────────────────────────────────────────────
   Dark mode: third-party components.

   Bootstrap, bootstrap-multiselect and js-year-calendar ship light-only
   stylesheets and are loaded before this file, so their surfaces are pinned
   here rather than in the token block above.
   ───────────────────────────────────────────────────────────────────────── */
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .form-control,
[data-theme="dark"] .multiselect-container,
[data-theme="dark"] .multiselect-container li a {
  background-color: var(--surface-solid);
  color: var(--fg);
  border-color: var(--border);
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
  border-color: var(--border);
}

[data-theme="dark"] .form-control::placeholder { color: var(--muted); }
[data-theme="dark"] .form-control:focus {
  background-color: var(--surface-solid);
  color: var(--fg);
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 0.2rem rgba(53, 179, 255, 0.25);
}

[data-theme="dark"] .dropdown-item { color: var(--fg); }
[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus,
[data-theme="dark"] .multiselect-container > li > a:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--fg);
}

[data-theme="dark"] .btn-default {
  background-color: var(--surface-solid);
  color: var(--fg);
  border-color: var(--border);
}

/* Bootstrap 4 draws the modal close as a text glyph: color #000 with a white
   text-shadow. Recolour it and drop the shadow — inverting it would only turn
   a light glyph dark again and leave it invisible on a dark modal. */
[data-theme="dark"] .close {
  color: var(--fg);
  text-shadow: none;
  opacity: 0.75;
}
[data-theme="dark"] .close:hover,
[data-theme="dark"] .close:focus {
  color: var(--fg);
  opacity: 1;
}

/* js-year-calendar chrome. Its own class names are used here; the .calendar
   class on the countdown page belongs to the per-conference export links and
   is a different element entirely. */
[data-theme="dark"] .calendar-header,
[data-theme="dark"] .month-container,
[data-theme="dark"] .month-title,
[data-theme="dark"] .day-header,
[data-theme="dark"] .calendar-context-menu,
[data-theme="dark"] .submenu {
  background-color: var(--surface-solid);
  color: var(--fg);
  border-color: var(--border);
}

[data-theme="dark"] .day { color: var(--fg); }
[data-theme="dark"] .day.disabled { opacity: 0.35; }
/* .day-content carries the per-event colour inline, so only unpainted days
   are tinted here. */
[data-theme="dark"] .day:not([style*="background"]) .day-content {
  background: rgba(255, 255, 255, 0.08);
}

/* ─────────────────────────────────────────────────────────────────────────
   The theme toggle, sitting in the navbar
   ───────────────────────────────────────────────────────────────────────── */
#theme-toggle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 5px 10px;
  margin-left: 12px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
#theme-toggle:hover { border-color: #fff; color: #fff; }
#theme-toggle:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  #theme-toggle { transition: none; }
}


/* The glyph is derived from the theme rather than set by script, so it is
   already correct on the first paint and stays correct with JS disabled. */
#theme-toggle::before { content: "\1F319"; }              /* crescent: offer dark */
[data-theme="dark"] #theme-toggle::before { content: "\2600"; }  /* sun: offer light */
