/* Self-hosted Lato (400 + 700), served from assets/fonts/ instead of Google
   Fonts. Self-hosting keeps visitor IPs off Google's servers (GDPR) and lets
   the .htaccess use a strict 'self'-only CSP. latin + latin-ext subsets cover
   accented EU characters. Downloaded from fonts.gstatic.com (Lato v25). */
@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/lato-400-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/lato-400-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/lato-700-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(fonts/lato-700-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Palette + type taken from the InviteDesk Brand Book 2026:
   https://invitedeskmarketing.github.io/InviteDesk-Brand-Book/ */
:root {
  --bg: #ffffff;
  --text: #2e4057;         /* Dark Navy - brand body-text colour (never pure black) */
  --muted: #6b7a90;        /* Dark Navy lightened, for captions / secondary text */
  --border: #dbe6f0;       /* soft blue-grey derived from the Ice Blue family */
  --accent: #2581c4;       /* InviteDesk Blue, rgb(37 129 196) */
  --accent-hover: #6e9dd4; /* Soft Blue - brand secondary, used for hover states */
  --accent-tint: #f2f8fc;  /* Ice Blue - brand background tint */
  --orange: #f75c16;       /* InviteDesk Orange - reserved for a single highlight/CTA */
  --sidebar-bg: #f2f8fc;   /* Ice Blue */
  --footer-bg: #2e4057;    /* Dark Navy - brand dark surface for reversed logo */
  --footer-text: #d5deea;
  --radius: 8px;
  --header-h: 60px;        /* header padding (14+14) + 32px logo */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-weight: 400;
  line-height: 1.5;        /* brand body line height 1.4-1.6x */
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent-tint); }

/* ---------- Header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  border-bottom: 1px solid var(--accent);
  position: sticky;
  top: 0;
  background: var(--accent);   /* InviteDesk Blue header band with the reversed (white) logo */
  z-index: 40;
  gap: 12px;
}

.site-title {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.site-title img {
  height: 32px;
  width: auto;
  display: block;
}

/* Search stays pinned right; the logo sits next to the hamburger on mobile. */
.search-box { margin-left: auto; }

/* ---------- Hamburger toggle (mobile only) ---------- */

.nav-toggle {
  display: none;               /* shown via media query below */
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 9px 8px;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  z-index: 50;          /* always sits above the rest of the header */
}
.nav-toggle:hover { background: rgba(255 255 255 / 0.18); }
.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
body.nav-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-backdrop { display: none; }

.search-box { position: relative; }

#search-input {
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 260px;
  font-size: 14px;
  background: var(--sidebar-bg);
  transition: border-color 0.15s ease, background 0.15s ease;
}
#search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg);
}

#search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 320px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(11, 61, 145, 0.12);
  max-height: 360px;
  overflow-y: auto;
  display: none;
}
#search-results.open { display: block; }

#search-results a {
  display: block;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
}
#search-results a:hover { background: var(--accent-tint); }
#search-results a.search-no-result { color: var(--muted); }
#search-results a.search-no-result:hover { background: none; }

/* One group per matching page: the page link on top, then a link per section
   the term was found in. The separator sits on the group, so the section hits
   read as belonging to the page above them. */
#search-results .search-group { border-bottom: 1px solid var(--border); }
#search-results .search-group:last-child { border-bottom: none; }
#search-results .search-page { padding-bottom: 4px; }
#search-results .search-hit { padding: 6px 14px 8px 26px; }
#search-results .search-group > a:last-child { padding-bottom: 10px; }

#search-results .search-title { display: block; font-weight: 600; }
#search-results .search-section {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}
#search-results .search-section::before {
  content: '›';
  margin-left: -12px;
  margin-right: 5px;
  color: var(--muted);
  font-weight: 400;
}
/* Ancestor headings of the matched section, e.g. "Tips › Add dynamic content".
   Muted and lighter so the deepest heading - the one the hit is actually in -
   stays the thing you read first. */
#search-results .search-crumb {
  color: var(--muted);
  font-weight: 400;
}
#search-results .search-crumb::after {
  content: '›';
  margin: 0 4px;
}
#search-results .search-snippet {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}
#search-results mark {
  background: #ffe58a;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

/* ---------- Layout ---------- */

.layout {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
}

.sidebar {
  width: 260px;
  flex-shrink: 0;
  padding: 28px 16px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  min-height: calc(100vh - 60px);
}

.sidebar ul { list-style: none; margin: 0; padding-left: 14px; }
.sidebar > ul.nav-level-0 { padding-left: 0; }

.sidebar a {
  display: block;
  padding: 7px 10px;
  color: var(--text);
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  transition: background 0.12s ease, color 0.12s ease;
}

.sidebar a:hover { background: var(--accent-tint); color: var(--accent); }
.sidebar a.active {
  background: var(--accent);
  color: white;
  font-weight: 700;
}

.content {
  flex: 1;
  padding: 40px 48px;
  max-width: 800px;
  line-height: 1.6;        /* brand body line height 1.4-1.6x */
}

/* Brand type hierarchy: H1 & H2 in InviteDesk Blue, H3 in Dark Navy,
   Lato Bold, no artificial letter-spacing on headings. */
.content h1, .content h2, .content h3 { font-weight: 700; }
.content h1 { margin-top: 0; color: var(--accent); font-size: 1.75rem; }
.content h2 { color: var(--accent); font-size: 1.35rem; }
.content h3 { color: var(--text); font-size: 1.1rem; }

.content img { max-width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.content a { color: var(--accent); }
.content a:hover { color: var(--accent-hover); }

/* Brand table style: blue headers, Ice Blue alternating rows. */
.content table { border-collapse: collapse; width: 100%; }
.content table td, .content table th {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}
.content table th {
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
}
.content table tbody tr:nth-child(even) td { background: var(--accent-tint); }

/* Sub-topic navigation lists rendered as a grid of button-cards
   (tagged .nav-cards by the build when every item is just a link). */
.content ul.nav-cards {
  list-style: none;
  margin: 20px 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.content ul.nav-cards li { margin: 0; }
.content ul.nav-cards li p { margin: 0; }
.content ul.nav-cards a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 100%;
  padding: 14px 16px;
  background: var(--accent-tint);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}
.content ul.nav-cards a::after {
  content: "→";
  color: var(--accent);
  transition: transform 0.15s ease;
}
.content ul.nav-cards a:hover {
  background: #ffffff;
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 6px 18px rgba(46, 64, 87, 0.1);
}
.content ul.nav-cards a:hover::after { transform: translateX(3px); }

.content pre {
  background: var(--sidebar-bg);
  padding: 14px;
  border-radius: var(--radius);
  overflow-x: auto;
  border: 1px solid var(--border);
}

/* ---------- Confluence macro conversions ---------- */

/* Info panels are styled as cards echoing the product-suite cards on
   invitedesk.com: a solid brand-colour header band with a label, sitting
   above a clean white body, with rounded corners and a soft shadow. */
.content .macro-info,
.content .macro-note,
.content .macro-tip,
.content .macro-warning {
  --panel: var(--accent);
  margin: 24px 0;
  padding: 0 20px 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(46, 64, 87, 0.08);
}
.content .macro-info    { --panel: #2581c4; }  /* InviteDesk Blue */
.content .macro-tip     { --panel: #6e9dd4; }  /* Soft Blue */
.content .macro-note    { --panel: #2e4057; }  /* Dark Navy */
.content .macro-warning { --panel: #f75c16; }  /* InviteDesk Orange */

/* the coloured header band, bled to the card edges */
.content .macro-info::before,
.content .macro-note::before,
.content .macro-tip::before,
.content .macro-warning::before {
  display: block;
  margin: 0 -20px 14px;
  padding: 9px 20px;
  background: var(--panel);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.content .macro-info::before    { content: "Info"; }
.content .macro-tip::before     { content: "Tip"; }
.content .macro-note::before    { content: "Note"; }
.content .macro-warning::before { content: "Warning"; }

.content .macro-info p, .content .macro-note p,
.content .macro-tip p, .content .macro-warning p { margin: 0 0 10px; }

/* Table of contents ("On this page:"), generated from page headings. */
.content .toc {
  margin: 8px 0 28px;
}
.content .toc ul { list-style: disc; margin: 0; padding: 0 0 0 20px; }
.content .toc ul ul { margin-left: 0; }
.content .toc li { margin: 4px 0; }
.content .toc a { color: var(--accent); text-decoration: none; }
.content .toc a:hover { color: var(--accent-hover); text-decoration: underline; }
.content .macro-info > :last-child, .content .macro-note > :last-child,
.content .macro-tip > :last-child, .content .macro-warning > :last-child { margin-bottom: 0; }

.content details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin: 18px 0;
}
.content details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--accent);
}
.content details[open] summary { margin-bottom: 8px; }

.content span[data-broken-link] {
  color: var(--muted);
  text-decoration: line-through dotted;
  cursor: help;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  text-align: center;
  padding: 32px 32px 24px;
  font-size: 13px;
}
.site-footer a { color: var(--footer-text); }
.site-footer img {
  height: 28px;
  width: auto;
  margin-bottom: 12px;
}
.site-footer p { margin: 0; opacity: 0.85; }

.site-copyright-bar {
  background: var(--accent); /* matches their real bg-primary on this bar */
  color: #ffffff;
  padding: 32px;
  font-size: 13px;
}
.site-copyright-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.site-copyright-bar a {
  color: #ffffff;
  text-decoration: underline;
}

/* ---------- Mobile ---------- */

@media (max-width: 720px) {
  .nav-toggle { display: flex; }

  /* Tighter gutters + a slightly smaller wordmark so the header row
     (hamburger + logo + search) fits within a phone viewport. */
  .site-header { padding: 12px 16px; gap: 10px; }
  .site-title img { height: 26px; }

  /* Search fills whatever space is left instead of forcing a fixed 260px
     width that pushes the input off the right edge and breaks the viewport. */
  .search-box { flex: 1 1 auto; min-width: 0; }
  #search-input { width: 100%; }

  /* Keep the results dropdown inside the viewport on narrow screens. */
  #search-results { width: min(320px, calc(100vw - 24px)); }

  .layout { display: block; }

  /* Sidebar becomes an off-canvas drawer sliding in from the left. */
  .sidebar {
    position: fixed;
    top: var(--header-h);
    bottom: 0;
    left: 0;
    z-index: 30;
    width: 82%;
    max-width: 300px;
    min-height: 0;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 2px 0 24px rgba(46, 64, 87, 0.15);
  }
  body.nav-open .sidebar { transform: translateX(0); }

  /* Dimmed overlay behind the open drawer; sits below the header so the
     hamburger stays visible and tappable to close. */
  .nav-backdrop {
    display: block;
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    background: rgba(46, 64, 87, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }
  body.nav-open .nav-backdrop { opacity: 1; visibility: visible; }
  body.nav-open { overflow: hidden; }   /* lock page scroll while drawer is open */

  .content { padding: 24px 20px; max-width: 100%; }
}

/* --- Video embeds (click-to-load) ------------------------------------- */
/* A self-hosted thumbnail + play button; video-embed.js swaps in the real
   YouTube/Loom iframe only on click, so no third party loads on page view. */
.video {
  margin: 24px 0;
  max-width: 760px;
}
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}
/* A player injected on click stands on its own (facade figure or grid cell). */
.video-embed--playing { margin: 24px 0; }
.video-grid .video-embed--playing { margin: 0; }

/* Muted cookie/privacy notice shown under a facade and above a video grid. */
.video-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}
.video-note--grid { margin: 0 0 12px; }
.video-embed--nothumb { background: var(--footer-bg); } /* Dark Navy when no preview */
.video-embed iframe { display: block; width: 100%; height: 100%; border: 0; }

.video-embed__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.video-embed__thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Play glyph: a rounded pill with a white triangle, tinted to the brand CTA
   orange on hover/focus. Shared by both the single facade and the grid cards. */
.video-embed__icon {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 48px;
  border-radius: 14px;
  background: rgba(46, 64, 87, 0.72); /* Dark Navy, translucent */
  transition: background 0.2s ease, transform 0.2s ease;
}
.video-embed__icon::before {
  content: "";
  display: block;
  margin-left: 4px;
  border-style: solid;
  border-width: 10px 0 10px 18px;
  border-color: transparent transparent transparent #fff;
}
.video-embed__play:hover .video-embed__icon,
.video-embed__play:focus-visible .video-embed__icon,
.video-card:hover .video-embed__icon,
.video-card:focus-visible .video-embed__icon {
  background: var(--orange);
  transform: scale(1.06);
}

/* Grid of video cards, e.g. a tutorial playlist. */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.video-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
  background: var(--accent-tint);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.video-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(46, 64, 87, 0.14);
}
.video-card__thumb-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  background: #000;
}
.video-card--nothumb .video-card__thumb-wrap { background: var(--footer-bg); }
.video-card__thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-card__title {
  padding: 10px 12px;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
}
