/* =============================================================
   SLEEP DOWNUNDER 2026 — EventsAir Program Custom CSS
   Portal: sleep-downunder-2026  ·  Website: sleepdownunder.com
   Covers BOTH the program grid page and the session detail pages.

   Apply via EventsAir portal > Custom CSS field (replace all).

   Everything here targets EventsAir's page structure, not specific
   sessions, so it keeps working as sessions/rooms/days change.
   Session colours come from EventsAir inline styles — untouched.

   HOW TO USE FOR A NEW EVENT:
     1. Set the two brand colours in :root below (take them from
        the event website — e.g. heading colour + a dark colour).
     2. Paste the whole file into EventsAir > Custom CSS.
     3. If you use a legend, add program-legend.html as a Custom
        HTML element above the program tables.
     Nothing else needs changing.
============================================================= */

:root {
  --prog-accent: #00949f;   /* SDU teal — headings, icons, Back button     */
  --prog-dark:   #172c4a;   /* SDU navy — session titles, room headers, hover */
  --prog-scale:  1.2;       /* text/content size: 1 = EventsAir default */
}


/* ── Page base (white everywhere) ──────────────────────────── */
html, body {
  background-color: #ffffff !important;
}
body {
  padding-bottom: 0 !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  color: #111;
}
.body-content {
  background-color: #ffffff !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-bottom: 0 !important;
}
.main-form.delayed-component-content {
  box-shadow: none !important;
  max-width: none !important;
}
#contentareaOGkkprt > div:nth-child(1),
#contentareaOGkkprt > div:nth-child(2) {
  margin-right: 0 !important;
}
.col-sm-12 > div:nth-child(1) {
  margin-bottom: 0 !important;
}

/* Hide portal footer and the Print button */
.brand-footer {
  display: none !important;
}
body > div > div > div.marginBottom > button {
  display: none !important;
}

/* Links: no underlines */
a:any-link,
.marginBottom a {
  text-decoration: none !important;
}


/* Hide track label on session detail pages */
.agenda-track {
  display: none !important;
}


/* ── Navigation bar → "Back to full program" ───────────────── */
/* Hidden on the main program page (the only page with the
   program grid table), shown on session detail pages.          */
body:has(table.table-bordered) .navbar.navbar-inverse {
  display: none !important;
}

.navbar.navbar-inverse {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  min-height: 0 !important;
  margin: 12px 0 8px !important;
}
.navbar.navbar-inverse > div {
  max-width: none !important;
  padding: 0 !important;
}
/* Always show the link — no hamburger on mobile */
.navbar.navbar-inverse .navbar-header,
.navbar.navbar-inverse .navbar-toggle {
  display: none !important;
}
.navbar.navbar-inverse .navbar-collapse.collapse {
  display: block !important;
  height: auto !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
}
.navbar.navbar-inverse .navbar-nav {
  margin: 0 !important;
  float: none !important;
}
.navbar.navbar-inverse .navbar-nav > li {
  float: none !important;
  display: inline-block;
}
.navbar.navbar-inverse .navbar-nav > li:first-child {
  display: none !important; /* blank first menu item */
}
.navbar.navbar-inverse .navbar-nav > li > a {
  display: inline-block !important;
  font-size: 0 !important;           /* hide original label */
  padding: 8px 16px !important;
  background: var(--prog-accent) !important;
  border-radius: 999px;
  transition: background .15s ease;
}
.navbar.navbar-inverse .navbar-nav > li > a::before {
  content: "\2190  Back to full program";
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}
.navbar.navbar-inverse .navbar-nav > li > a:hover,
.navbar.navbar-inverse .navbar-nav > li > a:focus {
  background: var(--prog-dark) !important;
}


/* ── Headings ──────────────────────────────────────────────── */
/* Day headings (program) and "Speaker" heading (detail pages) */
h3 {
  font-size: 13px;
  font-weight: 700;
  color: #111;
  margin: 28px 0 10px;
  padding-left: 10px;
  border-left: 3px solid var(--prog-accent);
  line-height: 1.2;
}
/* Day headings on the program grid get extra size + brand red */
body:has(table.table-bordered) h3 {
  font-size: 18px;
  color: var(--prog-accent);
}


/* ── Program grid tables ───────────────────────────────────── */
/* Program grid = <table class="table table-bordered">;
   detail page tables have no class.                           */
table.table-bordered {
  width: 100%;
  border-collapse: separate !important;
  border-spacing: 3px !important;
  margin-bottom: 32px;
}
/* Desktop grid only: keep rooms readable; scroll sideways
   on narrower screens instead of squashing                    */
.visible-md.visible-lg table.table-bordered {
  min-width: 900px;
}
/* Same time-column width on every day. EventsAir gives each
   header an equal inline width (10% with 10 columns, 16% with
   6), so the time column grew on days with fewer tracks. Fix
   it at 10% and share the rest equally between the tracks.     */
.visible-md.visible-lg table.table-bordered {
  table-layout: fixed;
}
.visible-md.visible-lg table.table-bordered tbody tr:first-child th {
  width: auto !important;
}
.visible-md.visible-lg table.table-bordered tbody tr:first-child th:first-child {
  width: 10% !important;
}
/* Narrow screens / iframes: scroll grid sideways, don't squash */
.visible-md.visible-lg {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table.table-bordered,
table.table-bordered th,
table.table-bordered td {
  border: none !important;
  box-shadow: none !important;
}

/* Room headers */
table.table-bordered tbody tr th {
  font-size: 9px;
  font-weight: 600;
  color: var(--prog-dark);
  text-align: center;
  padding: 6px 4px;
  background-color: transparent !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  border-radius: 6px;
  vertical-align: middle;
}

/* Time column
   Session cells always carry an inline background colour; time
   cells never do. When a time spans several rows (rowspan), the
   session is the first cell in the following rows, so
   :first-child alone would wrongly style it as a time cell.     */
table.table-bordered tbody tr td:first-child:not([style*="background"]) {
  font-size: 9.5px;
  color: #555;
  font-weight: 400;
  vertical-align: top;
  padding: 6px 8px 0 0;
  white-space: nowrap;
  min-width: 80px;
  background-color: transparent !important;
}

/* Session cells (colour comes from EventsAir inline style) */
table.table-bordered tbody tr td:not(:first-child),
table.table-bordered tbody tr td[style*="background"] {
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  vertical-align: middle;
  border-radius: 6px;
  background-color: #ffffff;
  color: #111;
}
table.table-bordered tbody tr td:not(:first-child):empty {
  background-color: transparent !important;
}

/* Breaks / admin items (no link) */
table.table-bordered tbody tr td[style*="background"]:not(:has(a)) {
  font-size: 10px;
  font-weight: 400;
  color: #666;
}

/* Clickable sessions */
table.table-bordered tbody tr td a {
  color: inherit;
  text-decoration: none !important;
  display: block;
}
table.table-bordered tbody tr td:has(a) {
  cursor: pointer;
  transition: filter .15s ease, box-shadow .15s ease;
}
table.table-bordered tbody tr td:has(a):hover {
  filter: brightness(1.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18) !important;
}
table.table-bordered tbody tr td a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}


/* ── Mobile & tablet program layout ────────────────────────── */
/* On small screens EventsAir shows one table per room (time +
   session). These rules make those tables fit the screen width
   with no sideways scrolling, and hide time slots where that
   room has nothing scheduled.                                   */
.visible-xs table.table-bordered,
.visible-sm table.table-bordered {
  table-layout: fixed;
  width: 100% !important;
  min-width: 0;
  margin-bottom: 16px;
}
.visible-xs table.table-bordered td,
.visible-sm table.table-bordered td {
  overflow-wrap: anywhere;
}
.visible-xs table.table-bordered tbody tr th:first-child,
.visible-sm table.table-bordered tbody tr th:first-child,
.visible-xs table.table-bordered tbody tr td:first-child:not([style*="background"]),
.visible-sm table.table-bordered tbody tr td:first-child:not([style*="background"]) {
  width: 28% !important;
  min-width: 0;
  white-space: normal;
}
.visible-xs table.table-bordered tbody tr th:last-child,
.visible-sm table.table-bordered tbody tr th:last-child {
  width: auto !important;
  font-size: 11px;
}
.visible-xs table.table-bordered tr:has(> td:last-child:empty),
.visible-sm table.table-bordered tr:has(> td:last-child:empty) {
  display: none;
}


/* ── Session detail pages ──────────────────────────────────── */
/* Session title */
.main-form h2 {
  color: var(--prog-dark) !important;
  font-weight: 600;
}
/* Date / time / room icons: → brand red */
.main-form .brand-primary-foreground {
  color: var(--prog-accent) !important;
}
/* "Presentation Overview" / "Biography" headings */
.main-form h4 {
  color: var(--prog-accent) !important;
  font-weight: 600;
}
/* Speaker photo */
.main-form img.img-responsive {
  border-radius: 8px;
}


/* ── Legend block (program-legend.html) ────────────────────── */
.program-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  background-color: #fff;
  padding: 16px 20px;
  border-radius: 10px;
  margin-bottom: 28px;
  font-size: 11.5px;
  color: #111;
}
.program-legend__col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 180px;
}
.program-legend__col-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #999;
  margin-bottom: 2px;
}
.program-legend__item {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.3;
}
.program-legend__swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  flex-shrink: 0;
  display: inline-block;
  box-sizing: border-box;
}


/* ── Print ─────────────────────────────────────────────────── */
@media print {
  .navbar.navbar-inverse { display: none !important; }
  .visible-md.visible-lg { overflow: visible; }
  table.table-bordered { min-width: 0; }
}

/* ── Text size ─────────────────────────────────────────────── */
/* Scales all program and session page content proportionally.
   1 = original, 1.2 = 20 percent larger. */
.main-form.delayed-component-content {
  zoom: var(--prog-scale);
}

