/*
 * Developer Hub pages: Page Hero, Card Grid, Feature Tiles, Accordion with
 * Visual and Link Cards (inc/devhub-pages.php). Loaded only on pages that
 * use them, after theme.css.
 *
 * Values come from the Figma frames "Community Extensions" and "Transform
 * Studio". Pieces the site already has keep the site's own classes and
 * look: .dremio-breadcrumb, .badge-project, .btn-primary.btn-fill,
 * .integration-see-more, the Events CTA block and [data-reveal].
 * Non-clickable containers have no hover.
 */

/* Sections page template (templates/sections-page.php): a page that doesn't
   open with a hero starts below the absolutely positioned header. */
.sections-page--no-hero {
  padding-top: 6rem;
}

/* Icons (figma-assets/devhub/<name>.svg) */
.devhub-icon {
  display: inline-block;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  background: center / contain no-repeat;
}
.devhub-icon.icon-geo-alt { background-image: url("../../figma-assets/devhub/geo-alt.svg"); }
.devhub-icon.icon-robot { background-image: url("../../figma-assets/devhub/robot.svg"); }
.devhub-icon.icon-lock { background-image: url("../../figma-assets/devhub/lock.svg"); }
.devhub-icon.icon-database { background-image: url("../../figma-assets/devhub/database.svg"); }
.devhub-icon.icon-clock-history { background-image: url("../../figma-assets/devhub/clock-history.svg"); }
.devhub-icon.icon-calculator { background-image: url("../../figma-assets/devhub/calculator.svg"); }
.devhub-icon.icon-book-half { background-image: url("../../figma-assets/devhub/book-half.svg"); }
.devhub-icon.icon-clipboard-check { background-image: url("../../figma-assets/devhub/clipboard-check.svg"); }
.devhub-icon.icon-bookshelf { background-image: url("../../figma-assets/devhub/bookshelf.svg"); }
.devhub-icon.icon-exclamation-diamond { background-image: url("../../figma-assets/devhub/exclamation-diamond.svg"); }
.devhub-icon.icon-grip-horizontal { background-image: url("../../figma-assets/devhub/grip-horizontal.svg"); }
.devhub-icon.icon-arrow-up-right { background-image: url("../../figma-assets/devhub/arrow-up-right.svg"); }
.devhub-icon.icon-github { background-image: url("../../figma-assets/devhub/github.svg"); }

.devhub-icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 41px;
  height: 41px;
  border-radius: 8px;
  background: #121723;
}
.devhub-icon-box .devhub-icon {
  width: 15px;
  height: 15px;
}

/* Icon before a button label */
.btn-label .devhub-icon,
.btn-text .devhub-icon {
  margin-right: 8px;
  vertical-align: -2px;
}

/* Breadcrumb parent visitors can't open (private "Dev Resources"): plain text
   in the link colour, as in the design */
.dremio-breadcrumb .breadcrumb-label {
  color: var(--color-gray-100);
}

/* Neutral badge (same shape as the project badges) */
.badge-project.devhub-badge {
  align-self: flex-start;
  background-color: #D2D6DB;
  color: #202020;
}

/* Editor placeholder for an empty block */
.devhub-placeholder {
  margin: 0;
  padding: 16px;
  border: 1px dashed currentColor;
  font-size: 14px;
}

/* ==========================================================================
   Page Hero
   ========================================================================== */
.devhub-hero {
  min-height: 569px;
  padding: 81px 0 76px; /* header (77px) + 4px; the breadcrumb adds 12px */
  background-color: #080C30;
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: cover;
  border-bottom: 1px solid #4D5761;
}
.devhub-hero__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 589px;
  margin-top: 36px;
}
.devhub-hero__title {
  margin: 24px 0 16px;
  color: var(--color-white);
  font-size: 40px;
  font-weight: 500;
  line-height: 48px;
}
.devhub-hero__content > .devhub-hero__title:first-child {
  margin-top: 0;
}
.devhub-hero__text {
  margin: 0;
  color: var(--color-white);
  font-size: var(--body-lg-size);
  line-height: var(--body-lg-line-height);
}
.devhub-hero__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
}
/* The site's focus ring (theme.css :focus-visible), which .btn:focus-visible
   removes from buttons. */
.devhub-hero .btn:focus-visible,
.devhub-section .btn:focus-visible {
  outline: 3px solid var(--color-teal-400);
  outline-offset: 2px;
}

@media (max-width: 767.98px) {
  .devhub-hero {
    min-height: 0;
    padding-top: 71px; /* header is 67px here */
    padding-bottom: 56px;
  }
  .devhub-hero__content {
    margin-top: 24px;
  }
}
@media (max-width: 576px) {
  /* Same phone title size as the site's hero */
  .devhub-hero__title {
    font-size: 32px;
    font-weight: 600;
    line-height: 38px;
  }
}

/* ==========================================================================
   Sections
   ========================================================================== */
.devhub-section {
  padding: 76px 0;
}
.devhub-section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: 32px;
}
.devhub-section-header__text {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1116px;
}
.devhub-section-title {
  margin: 0;
  color: var(--color-white);
  font-size: 28px;
  font-weight: 500;
  line-height: 32px;
}
.devhub-section-intro {
  margin: 0;
  color: var(--color-white);
  font-size: var(--body-lg-size);
  line-height: var(--body-lg-line-height);
}
.devhub-section-header__link {
  white-space: nowrap;
}

/* Two sections on the page background in a row share one gap. */
.devhub-section:not(.devhub-section--gradient) + .devhub-section:not(.devhub-section--gradient) {
  padding-top: 0;
}
/* Dark gradient sections: the band's visible top edge needs more room above
   the heading (as in the design: about 128px). Phones keep the sections'
   56px (no phone design). */
.devhub-section--gradient {
  padding-top: 128px;
  background: linear-gradient(180deg, var(--color-slate-900) 0%, #121723 94%);
}
/* The band fades into the page colour, so its bottom edge is invisible: the
   section after it adds the design's 56px block gap, not a second 76px
   section padding (76 + 56 = 132px, as in the design). */
@media (min-width: 768px) {
  .devhub-section--gradient + .devhub-section:not(.devhub-section--gradient) {
    padding-top: 56px;
  }
}

@media (max-width: 767.98px) {
  .devhub-section {
    padding: 56px 0;
  }
  .devhub-section-title br,
  .devhub-hero__title br,
  .devhub-link-card__title br {
    display: none;
  }
}

/* Bordered card: the look of the site's integration cards. A card that is a
   link (a.devhub-card) also gets their hover and pressed states: theme.css
   adds it to the .integration-card state rules. The .integration-card class
   itself can't be used, because its descendant rules restyle the title and
   text. */
.devhub-card {
  position: relative;
  border-radius: 10.25px;
  background: linear-gradient(139deg, rgba(255, 255, 255, 0.1) -4.45%, rgba(255, 255, 255, 0.05) 76.07%);
}
.devhub-card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 0.854px;
  border-radius: inherit;
  background: linear-gradient(119deg, #A5A5A5 14.11%, rgba(192, 192, 192, 0.53) 50.55%, rgba(97, 97, 97, 0.4) 91.46%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
/* The rest of the link card: the link reset (as .kb-card and
   .blogroll-card-link), and the parts of the .integration-card base rules
   that can't be shared, because .devhub-card has no 0.854px border: its
   rings sit at inset 0. */
a.devhub-card {
  color: inherit;
  text-decoration: none;
  transition: background 0.3s ease;
}
a.devhub-card::before {
  transition: opacity 0.3s ease;
}
a.devhub-card::after {
  inset: 0;
}

/* ==========================================================================
   Card Grid
   ========================================================================== */
.devhub-card-grid__cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.devhub-card-grid .devhub-card {
  padding: 24px;
}
/* Card and tile type (shared by Card Grid and Feature Tiles) */
.devhub-card__title,
.devhub-tile__title {
  color: var(--color-white);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}
.devhub-card__title {
  margin: 0 0 10px;
}
.devhub-card__text,
.devhub-tile__text {
  margin: 0;
  color: #9DA4AE;
  font-size: 12px;
  line-height: 1.7;
}

/* ==========================================================================
   Feature Tiles: one panel, tiles separated by 1px of the section background
   ========================================================================== */
.devhub-tiles__panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border-radius: 12px;
  background: #121723;
}
.devhub-tile {
  padding: 24px;
  background: var(--color-slate-900);
}
.devhub-tile__title {
  margin: 12px 0 10px;
}

@media (max-width: 991.98px) {
  .devhub-card-grid__cards,
  .devhub-tiles__panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 767.98px) {
  .devhub-card-grid__cards,
  .devhub-tiles__panel {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==========================================================================
   Link Cards
   ========================================================================== */
.devhub-link-cards__cards {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 20.5px;
}
.devhub-link-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px;
}
.devhub-link-card__title {
  margin: 8px 0 0;
  color: var(--color-white);
  font-size: 24px;
  font-weight: 500;
  line-height: 32px;
}
.devhub-link-card .badge + .devhub-link-card__title {
  margin-top: 16px;
}
.devhub-link-card__text {
  margin: 8px 0 0;
  color: var(--color-white);
  font-size: var(--body-lg-size);
  line-height: var(--body-lg-line-height);
}
.devhub-link-card__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
}
.devhub-link-card__title + .devhub-link-card__link,
.devhub-link-card__text + .devhub-link-card__link {
  margin-top: 32px;
}
.devhub-link-card .badge + .devhub-link-card__title + .devhub-link-card__link {
  margin-top: 16px;
}

@media (max-width: 991.98px) {
  .devhub-link-cards__cards {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 767.98px) {
  .devhub-link-cards__cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==========================================================================
   Accordion with Visual (layout and behaviour from the www.dremio.com
   "Iceberg accordion"; look from the Figma). Theme hooks: --iav-*.
   ========================================================================== */
.iceberg-av {
  --iav-transition-duration: 320ms;
  --iav-layout-gap: 16px;
  --iav-card-gap: 16px;
  --iav-card-radius: 12px;
  --iav-card-fill: rgba(212, 212, 212, 0.1);
  --iav-card-border: linear-gradient(131deg, rgba(189, 189, 189, 0.5) 0%, rgba(255, 255, 255, 0.1) 53%);
  --iav-card-border-width: 3px;
  --iav-card-shadow: 0 2px 16px rgba(0, 0, 0, 0.15);
  --iav-visual-radius: 16px;
  --iav-visual-shadow: 0 2px 16px rgba(0, 0, 0, 0.15);
  --iav-title-color: #E5E7EB;
  --iav-title-active-color: #F5F7FA;
  --iav-body-color: #D2D6DB;
  --iav-icon-color: #4A5565;
  --iav-icon-active-color: #E0E5EB;
  --iav-cta-color: var(--color-white);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--iav-layout-gap);
}
/* Stacked (below 1200px): the visual stops at 600px wide, left-aligned
   under the list, so it doesn't fill a whole tablet screen. */
@media (max-width: 1199.98px) {
  .iceberg-av__visuals {
    width: 100%;
    max-width: 600px;
  }
}
@media (min-width: 1200px) {
  .iceberg-av.has-visual {
    display: flex;
    align-items: flex-start;
    gap: 24px;
  }
  .iceberg-av.has-visual .iceberg-av__list {
    flex: 0 0 55.4%;
    min-width: 0;
  }
  .iceberg-av.has-visual .iceberg-av__visuals {
    flex: 0 0 42%;
    min-width: 0;
  }
}

.iceberg-av__list {
  display: flex;
  flex-direction: column;
  gap: var(--iav-card-gap);
}
.iceberg-av__item {
  position: relative;
  overflow: hidden;
  padding: 12px;
  border-radius: var(--iav-card-radius);
  background: var(--iav-card-fill);
  box-shadow: var(--iav-card-shadow);
  -webkit-backdrop-filter: blur(17.5px);
  backdrop-filter: blur(17.5px);
}
.iceberg-av__item::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: var(--iav-card-border-width);
  border-radius: inherit;
  background: var(--iav-card-border);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.iceberg-av__heading {
  margin: 0;
}
.iceberg-av__question {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--iav-title-color);
  text-align: left;
  cursor: pointer;
}
.iceberg-av__label {
  font-size: var(--heading-5-size);
  font-weight: var(--heading-5-weight);
  line-height: var(--heading-5-line-height);
}
.iceberg-av__icon {
  display: flex;
  flex: 0 0 24px;
  align-items: center;
  justify-content: center;
  height: 32px;
  color: var(--iav-icon-color);
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
}
.iceberg-av__icon::before {
  content: "+";
}
.iceberg-av__item.is-active .iceberg-av__question {
  color: var(--iav-title-active-color);
}
.iceberg-av__item.is-active .iceberg-av__icon {
  color: var(--iav-icon-active-color);
}
.iceberg-av__item.is-active .iceberg-av__icon::before {
  content: "\2212";
}

.iceberg-av__answer {
  overflow: hidden;
  transition: max-height var(--iav-transition-duration) ease;
  color: var(--iav-body-color);
  font-size: 14px;
  line-height: 1.4;
}
.iceberg-av__answer-inner {
  display: grid;
  row-gap: 16px;
  padding-top: 12px;
}
.iceberg-av__answer-inner p {
  margin: 0;
  line-height: 1.5;
}
.iceberg-av__cta a {
  font-size: 16px;
  font-weight: 500;
}
.iceberg-av__cta a span {
  margin-left: 8px;
}

.iceberg-av__visuals {
  display: grid;
  aspect-ratio: 39 / 38;
}
.iceberg-av__visual {
  grid-area: 1 / 1;
  overflow: hidden;
  margin: 0;
  border-radius: var(--iav-visual-radius);
  background: var(--color-slate-900);
  box-shadow: var(--iav-visual-shadow);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s 0.1s ease-out;
}
.iceberg-av.has-visual .iceberg-av__visual.is-active {
  z-index: 1;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.iceberg-av__image,
.iceberg-av__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.iceberg-av__custom-html,
.iceberg-av__custom-html svg {
  display: block;
  width: 100%;
  height: 100%;
}

@media (max-width: 640px) {
  .iceberg-av__question {
    align-items: center;
  }
  .iceberg-av__label {
    font-size: 16px;
  }
  .iceberg-av__icon {
    font-size: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  /* 1ms, not none: devhub-pages.js needs transitionend to hide closed answers */
  .iceberg-av__answer {
    transition-duration: 1ms;
  }
  .iceberg-av__visual,
  .iceberg-av.has-visual .iceberg-av__visual.is-active {
    transition: none;
  }
}
