/* --- LINK CUSTOMIZATION --- */

/* Make links Confluence‑like blue and underline when hovered */
#main-content a,
#main-content a:link,
#main-content a:visited {
  color: #0052cc !important;        /* Confluence blue */
  text-decoration: none !important; /* no underline until hover */
}

#main-content a:hover,
#main-content a:focus,
#main-content a:active {
  color: #0052cc !important;
  text-decoration: underline !important;
}

/* --- HEADING CUSTOMIZATION --- */

/* Use larger spacing above H1–H5 */
#main-content h1,
#main-content h2,
#main-content h3,
#main-content h4,
#main-content h5 {
  margin-top: 0 !important;       /* remove theme/browser default spacing */
  padding-top: 25px !important;   /* fixed size, same for all headings */
}

/* Make H1 smaller */
h1.cell.article__heading,
#main-content h1 {
    font-size: 38px !important; /* change to any size you want */
}

/* Make H2 headings larger and heavier */
#main-content h2 {
  font-size: 32px !important; /* adjust size as needed */
  font-weight: 600 !important;
}

/* Make H3 headings larger */
#main-content h3 {
  font-size: 26px !important;
}

/* Custom style for H6 */
#main-content h6 {
  /* text appearance */
  font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif !important;
  font-weight: 400 !important;    /* remove bold */
  color: #777 !important;         /* grey color */

  /* spacing */
  margin-top: 0 !important;       /* remove spacing above */
  margin-bottom: 0 !important;    /* reset default bottom margin */
  padding-bottom: 30px !important;/* custom spacing below */
}

/* Remove anchor icon from H6 */
#main-content h6 .article__content__content__anchor--link-icon {
  display: none !important;
}

/* --- CHILDREN DISPLAY MACRO CUSTOMIZATION --- */

/* Remove default accordion container styling */
.accordion.megaAccordion.conf-macro.output-block {
  border: none !important;
  border-radius: 0 !important;
  margin: 1em 0 !important;
  padding: 0 0 0 2em !important; /* shorthand with left indent */
  background: transparent !important;
  display: block !important;
  list-style: disc outside !important;
}

/* First-level pages */
.accordion.megaAccordion > .accordion-item {
  display: list-item !important;
  list-style-type: disc !important;
  margin: 0 0 0.5em 0 !important;  /* vertical spacing only */
  padding-left: 8px !important;    /* bullet-to-text spacing */
  border: none !important;
  background: transparent !important;
  font: inherit !important;        /* shorthand for font-family, size, weight */
  line-height: 1.5 !important;
}

/* First-level links */
.accordion.megaAccordion > .accordion-item > a.accordion-title {
  display: inline !important;
  margin: 0 !important;
  padding: 0 !important;
  font: inherit !important;
  line-height: inherit !important;
}

/* Nested pages */
.megaAccordion__item--with-children__children__item {
  display: list-item !important;
  list-style-type: circle !important; /* hollow bullet */
  margin: 0 0 0.5em 1.5em !important;
  padding-left: 8px !important;
  border: none !important;
  background: transparent !important;
  font: inherit !important;
  line-height: 1.5 !important;
}

/* Nested links */
.megaAccordion__item--with-children__children__item > a[rel="subsection"] {
  display: inline !important;
  margin: 0 !important;
  padding: 0 !important;
  font: inherit !important;
  line-height: inherit !important;
}

/* Remove "read more" icons globally */
.accordion.megaAccordion .icon--read-more,
.megaAccordion__item--with-children__read-more-arrow {
  display: none !important;
}

/* Prevent expand icons from overlapping the link */
.accordion.megaAccordion .accordion-item a.accordion-title.toggle {
  position: relative !important;
  display: inline-block !important;
  padding-right: 1.2em !important;
}

.accordion.megaAccordion .accordion-item a.accordion-title.toggle .icon--expand {
  right: 0 !important;
  left: auto !important;
}

/* --- CODE BLOCK MACRO CUSTOMIZATION --- */

/* Hide the language label */
.code-macro__language {
  display: none !important;
}

/* Style code block titles to look like part of the code block */
.article .article__content article .code-macro__title {
  display: block;
  width: 100%;
  box-sizing: border-box;

  margin: 0 !important;
  padding: 0.4em 0.75em 0.4em 3.5em;
  font-size: 0.85em;
  font-weight: 600;  /* bold */
  color: #555;

  background-color: #f5f5f5;
  border: 1px solid #ddd;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
}

/* Code block itself */
.code-macro pre {
  margin: 0 !important;
  padding: 0.5em 0.5em 0.5em 3.5em !important;
  line-height: 1.4;
  white-space: pre-wrap !important;

  border: 1px solid #ddd;
  border-radius: 0 0 4px 4px;
}

/* Compact outer margins of the code block */
.code-macro {
  margin: 0.25em 0 !important;
}

/* Reset spacing on .code-toolbar (removes grey gap) */
.code-toolbar {
  position: relative !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
}

/* Keep line numbers aligned */
pre.line-numbers {
  counter-reset: linenumber 0;
}

/* Float Copy button in corner */
.code-toolbar .toolbar {
  position: absolute !important;
  top: 0.25em !important;
  right: 0.5em !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  box-shadow: none !important;
  z-index: 10;
}

/* --- ALLOW TEXT TO FILL MORE OF THE ARTICLE AREA --- */

/* Top-level text and panels */
#main-content > p,
#main-content > blockquote,
#main-content > p ~ .panel-macro,
#main-content .conf-macro.output-block[data-macro-name="sp-pagelayout"] .sp-grid-cell > p,
#main-content .conf-macro.output-block[data-macro-name="scroll-conditional-content"] > p {
  max-width: 90% !important;
  margin-right: auto !important;
}

/* Line under procedure names */
p + hr {
  max-width: 90% !important; 
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Standalone panels (not inside lists) */
#main-content .panel-macro:not(ul .panel-macro):not(ol .panel-macro),
#main-content .panel:not(ul .panel):not(ol .panel) {
  max-width: 90% !important;
  margin-right: auto !important;
}

/* Paragraphs inside Panel macros */
.panelContent p {
  max-width: 100% !important;
}

/* Remove extra bottom margin from Panel macros */
.panel .panelContent p:last-child {
  margin-bottom: 0 !important;
}

/* Top-level lists */
#main-content ul,
#main-content ol {
  max-width: 87% !important;
  margin-right: auto !important;
}

/* Nested list items and their content */
#main-content li ul,
#main-content li ol,
#main-content li p {
  max-width: 100% !important;
  margin-right: auto !important;
}

/* --- REMOVE LOGO FROM SPACE BLOCKS ON HOME PAGE --- */

/* Hide the logo inside each tile (space block) */
.tile img {
    display: none !important;
}

/* Center space names inside tiles */
.tile.tile--compact {
    display: flex;
    flex-direction: column;      /* stack content vertically */
    justify-content: center;     /* vertical centering */
    align-items: center;         /* horizontal centering */
    text-align: center;          /* center multi-line text */
    height: 100px;               /* keep the height you set */
    padding: 20px;               /* padding you already applied */
}

/* Adjust space description font size */
.tile.tile--compact p.tile__description {
    font-size: 14px;
    margin-top: 12px;
}

/* --- PROCEDURE CUSTOMIZATION --- */

/* Remove extra spacing from icon images and lines with links*/
.article .article__content article ol li > .confluence-embedded-file-wrapper.conf-macro.output-inline,
.article .article__content article ul li > .confluence-embedded-file-wrapper.conf-macro.output-inline,
.article .article__content article ol li > .confluence-embedded-file-wrapper.conf-macro.output-inline:last-child,
.article .article__content article ul li > .confluence-embedded-file-wrapper.conf-macro.output-inline:last-child,
.article .article__content article ol li > .conf-macro.output-inline,
.article .article__content article ul li > .conf-macro.output-inline {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Removing spacing from paragraphs followed by horizontal lines and lists */
p:has(+ hr),
p:has(+ ul),
p:has(+ ol) {
    margin-bottom: 0px !important; /* adjust as needed */
}

/* Remove extra spacing below images inside lists */
ol li figure + br,
ul li figure + br {
  display: none;
}

/* --- ADJUST TOP AND BOTTOM FIGURE MARGINS --- */

/* Stand alone figures */
figure,
p:has(figure) {
  margin-top: 16px !important;
  margin-bottom: 16px !important;
}

/* --- EXPAND THE AREA FOR ENLARGED IMAGES --- */

#colorbox,
#cboxWrapper,
#cboxContent,
#cboxLoadedContent {
  overflow: visible !important;
}

#cboxLoadedContent img.cboxPhoto {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;

  max-width: 95vw !important;
  max-height: 95vh !important;
  width: auto !important;
  height: auto !important;

  margin: 0 !important;
  float: none !important;
  display: block !important;
}

/* --- CENTER ALL VIDEOS --- */
.sp-grid-cell.sp-grid-100 iframe.youtube-player.conf-macro.output-block {
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* --- ADD BACKGROUND COLOR TO THE EXPAND MACRO --- */
.expand-container.conf-macro.output-block {
  background-color: #f5f5f5;   /* very light grey */
}

.expand-container .expand-content p {
  max-width: 90% !important;
}

/* --- FLASHING DOT NEXT TO VERSION AND VARIANT PICKERS --- */

li.picker.picker--scroll.is-dropdown-submenu-parent.opens-left:has(> ul.variants-picker) > a,
li.picker.picker--scroll.is-dropdown-submenu-parent.opens-left:has(> ul.versions-picker) > a {
  position: relative;
}

li.picker.picker--scroll.is-dropdown-submenu-parent.opens-left:has(> ul.variants-picker) > a::before,
li.picker.picker--scroll.is-dropdown-submenu-parent.opens-left:has(> ul.versions-picker) > a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 9px;
  height: 9px;
  background-color: #ffbf00;
  border-radius: 50%;
  animation: pulse 1.5s infinite; /* the duration of the pulse and the number of cycles */
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: translateY(-50%) scale(1); }
  50% { opacity: 1; transform: translateY(-50%) scale(1.4); }
}

/* --- ADD A SCROLLBAR TO THE RIGHT-SIDE TOC --- */

.scroll-y > .js-tocBot {
  max-height: calc(100vh - 10rem); /* adjust if header/footer differs */
  overflow-y: auto;
}

/* WebKit (Chrome, Edge, Safari) */
.scroll-y > .js-tocBot::-webkit-scrollbar {
  width: 6px;
}

.scroll-y > .js-tocBot::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,.35);
  border-radius: 4px;
}

/* Firefox */
.scroll-y > .js-tocBot {
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,.35) transparent;
}

/* --- ADD A SCROLLBAR TO THE LEFT-SIDE TREE --- */

#js-desktop-pageTree ul.renderPageTree::-webkit-scrollbar {
  width: 6px;
}

#js-desktop-pageTree ul.renderPageTree::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,.35);
  border-radius: 4px;
}

/* Firefox */
#js-desktop-pageTree ul.renderPageTree {
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,.35) transparent;
}