/* Home page (index.md) styles.
   Colors use the theme's Bootstrap variables so light and dark mode both work.
   Borders and surfaces are mixed here because the dark theme leaves
   --bs-border-color and --bs-tertiary-bg at Bootstrap defaults. */

:root,
body.quarto-dark {
  --home-rule: color-mix(in srgb, var(--bs-body-color) 14%, transparent);
  --home-surface: color-mix(in srgb, var(--bs-body-color) 3%, var(--bs-body-bg));
  --home-input-bg: var(--bs-body-bg);
  --home-focus-ring: color-mix(in srgb, var(--bs-primary) 18%, transparent);
  --home-measure: 68ch;
}

a {
  text-decoration: none !important;
}

#quarto-document-content {
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Hero --- */

/* Override the theme's weight-400 headings for the page title */
#title-block-header {
  padding-top: 48px;
  text-align: center;
}

#title-block-header h1.title {
  font-size: 2.75rem !important;
  font-weight: 700 !important;
  line-height: 1.1;
  margin-bottom: 0 !important;
}

#title-block-header h1.title::before {
  content: "";
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin-right: 12px;
  vertical-align: -0.08em;
  background: url("../images/posit-icon-fullcolor.svg") no-repeat center / contain;
}

.hero {
  padding: 8px 0 48px;
  border-bottom: 1px solid var(--home-rule);
  text-align: center;
}

.hero-subtitle {
  font-size: 1.125rem;
  color: var(--bs-secondary-color);
  max-width: 52ch;
  margin: 0 auto 28px;
}

.hero-search {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 22px;
  background: var(--home-input-bg);
  border: 2px solid var(--bs-primary);
  border-radius: 10px;
  cursor: text;
}

.hero-search:focus-within {
  box-shadow: 0 0 0 4px var(--home-focus-ring);
}

.hero-search i {
  color: var(--bs-primary);
  font-size: 1.3rem;
  flex-shrink: 0;
}

.hero-search-input {
  flex: 1;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1.2rem;
  color: var(--bs-body-color);
}

.hero-search-input::placeholder {
  color: var(--bs-tertiary-color);
}

.hero-search-hint {
  font-size: 0.875rem;
  color: var(--bs-secondary-color);
  margin: 16px 0 6px;
}

/* Example questions styled as links, not chips */
.hero-examples {
  list-style: none;
  padding: 0;
  margin: 0;
}

.hero-example {
  padding: 2px 0;
  background: none;
  border: none;
  font: inherit;
  font-size: 0.95rem;
  color: var(--bs-primary);
  text-align: center;
  cursor: pointer;
}

.hero-example:hover {
  text-decoration: underline;
}

.hero-example:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- Section headings --- */

section.level2 > h2 {
  font-size: 1.6rem;
  margin-top: 56px;
  margin-bottom: 6px;
  border-bottom: none;
}

section.level2 > h2 + p {
  color: var(--bs-secondary-color);
  max-width: var(--home-measure);
  text-wrap: balance;
  margin-bottom: 24px;
}

#open-source-tools-from-posit > h2 + p {
  max-width: none;
  text-wrap: pretty;
}

/* --- Journey tabs (theme sets colors and weights) --- */

.panel-tabset > .nav-tabs {
  border-bottom: 1px solid var(--home-rule);
}

.panel-tabset > .nav-tabs .nav-link {
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  padding: 10px 0;
  margin-right: 32px;
  font-size: 1rem;
  border-radius: 0;
  background: transparent;
}

.panel-tabset > .nav-tabs .nav-link.active {
  border-bottom-color: var(--bs-primary);
}

/* Small screens: the tabs do not fit on one line, so show them as a
   vertical list. A bar on the left marks the selected tab. */
@media (max-width: 767.98px) {
  .panel-tabset > .nav-tabs {
    flex-direction: column;
    border: 1px solid var(--home-rule);
    border-radius: 8px;
    overflow: hidden;
  }

  .panel-tabset > .nav-tabs .nav-item {
    margin: 0;
    padding: 0;
  }

  .panel-tabset > .nav-tabs .nav-item + .nav-item {
    border-top: 1px solid var(--home-rule);
  }

  .panel-tabset > .nav-tabs .nav-link {
    width: 100%;
    margin: 0;
    padding: 12px 16px;
    border-bottom: none;
    border-left: 4px solid transparent;
    text-align: left;
  }

  .panel-tabset > .nav-tabs .nav-link.active {
    border-left-color: var(--bs-primary);
    background: var(--home-surface);
  }
}

.panel-tabset > .tab-content {
  border: none;
  padding: 24px 0 0;
}

.panel-tabset > .tab-content > .tab-pane > p:first-child {
  color: var(--bs-secondary-color);
  text-wrap: pretty;
  margin-bottom: 36px;
}

/* --- Journey steps --- */

/* One continuous line across all steps */
.tab-pane > .grid {
  position: relative;
}

.tab-pane > .grid::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--home-rule);
}

.journey-card {
  position: relative;
  padding-top: 28px;
}

.journey-card .step-num {
  position: absolute;
  top: -13px;
  left: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bs-primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 0 0 4px var(--bs-body-bg);
}

.journey-card h4 {
  font-size: 1.15rem;
  margin-top: 0;
  margin-bottom: 6px;
  border-bottom: none;
}

.journey-card > p {
  font-size: 0.9rem;
  color: var(--bs-secondary-color);
  text-wrap: pretty;
  margin-bottom: 14px;
}

.journey-card ul,
.product-ref-card ul {
  padding-left: 0;
  list-style: none;
  margin-bottom: 8px;
}

.journey-card ul li,
.product-ref-card ul li {
  padding: 3px 0;
  font-size: 0.925rem;
  text-wrap: pretty;
}

.journey-card a,
.product-ref-card a,
.oss-list a {
  color: var(--bs-primary);
}

/* Hide heading anchor icons */
.journey-card h4 .anchorjs-link,
.product-ref-card h4 .anchorjs-link {
  display: none;
}

/* --- Product cards --- */

.product-ref-card {
  padding: 18px;
  border: 1px solid var(--home-rule);
  border-radius: 8px;
  background: var(--home-surface);
}

/* Align link lists across cards in a row */
@supports (grid-template-rows: subgrid) {
  .product-ref-card {
    display: grid;
    grid-row: span 4;
    grid-template-rows: subgrid;
    row-gap: 0;
    align-content: start;
  }
}

.product-ref-card h4 {
  margin-top: 0;
  margin-bottom: 12px;
  border-bottom: none;
  line-height: 1;
}

/* The Team logo's viewBox is shorter, so it is set smaller to match */
.product-ref-card h4 img.product-ref-logo {
  height: 34px;
  width: auto;
  max-width: 100%;
}

.product-ref-card h4 img[src*="team-horiz"] {
  height: 26px;
}

.product-ref-card > p:first-of-type {
  font-size: 0.875rem;
  color: var(--bs-secondary-color);
  line-height: 1.5;
  margin-bottom: 12px;
}

.all-docs-link {
  font-size: 0.875rem;
  font-weight: 600;
}

/* --- Open source tools --- */

.oss-list ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 48px;
  padding-left: 0;
  list-style: none;
  margin-bottom: 24px;
}

/* Hex on the left, name and description on the right */
.oss-list li {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.925rem;
  color: var(--bs-secondary-color);
  text-wrap: pretty;
}

.oss-list img.oss-hex {
  flex-shrink: 0;
  width: 52px;
  height: auto;
}

/* Some hexes have dark edges; outline them so they show on a dark page */
body.quarto-dark .oss-list img.oss-hex {
  filter: drop-shadow(0 0 1px rgb(255 255 255 / 0.45));
}

.oss-list .oss-text a {
  display: block;
  font-size: 1rem;
  font-weight: 600;
}

/* --- Responsive --- */

@media (max-width: 1100px) {
  .product-ref-card {
    grid-column: span 6 !important;
  }
}

/* Step indicator (added by index.md JS); narrow screens only */
.journey-progress {
  display: none;
}

/* Steps scroll sideways; each step gets its own rule */
@media (max-width: 900px) {
  .tab-pane > .grid {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    /* room for the step numbers */
    padding-top: 15px;
  }

  .tab-pane > .grid::-webkit-scrollbar {
    display: none;
  }

  .tab-pane > .grid::before {
    display: none;
  }

  .journey-card {
    flex: 0 0 85%;
    scroll-snap-align: start;
    border-top: 2px solid var(--home-rule);
  }

  .journey-card .step-num {
    top: -15px;
  }

  .journey-progress {
    position: relative;
    display: flex;
    padding: 0;
    margin: -12px 0 20px;
    list-style: none;
  }

  .journey-progress::before {
    content: "";
    position: absolute;
    top: 13px;
    left: calc(100% / 6);
    right: calc(100% / 6);
    height: 2px;
    background: var(--home-rule);
  }

  .journey-progress li {
    position: relative;
    flex: 1;
    text-align: center;
  }

  .journey-progress button {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0;
    background: none;
    border: none;
    font: inherit;
    font-size: 0.8rem;
    color: var(--bs-secondary-color);
    cursor: pointer;
  }

  .journey-progress .dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--home-rule);
    background: var(--bs-body-bg);
    font-size: 0.85rem;
    font-weight: 700;
  }

  .journey-progress button[aria-current="step"] {
    color: var(--bs-body-color);
    font-weight: 600;
  }

  .journey-progress button[aria-current="step"] .dot {
    border-color: var(--bs-primary);
    background: var(--bs-primary);
    color: #fff;
  }

  .journey-progress button:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
    border-radius: 4px;
  }
}

/* Small screens: stack the steps vertically. Same breakpoint as the
   vertical tab list. Must come after the 900px block to override it. */
@media (max-width: 767.98px) {
  .tab-pane > .grid {
    flex-direction: column;
    gap: 40px;
    overflow-x: visible;
    scroll-snap-type: none;
  }

  .journey-card {
    flex: 0 0 auto;
  }

  .journey-progress {
    display: none;
  }
}

@media (max-width: 600px) {
  #title-block-header h1.title {
    font-size: 2.1rem !important;
  }

  .hero-search {
    padding: 14px 16px;
  }

  .hero-search-input {
    font-size: 1rem;
  }

  .product-ref-card {
    grid-column: span 12 !important;
  }

  .oss-list ul {
    grid-template-columns: 1fr;
  }
}
