/*
 * BrickzBack discovery additions
 *
 * This file is intentionally limited to the extra discovery hooks present in
 * marketing.html. The approved landing-page primitives remain owned by
 * marketing-v14.css and marketing-v14-premium.css.
 */

/* Shared guardrails for the supplied screenshot / artwork additions. */
.product-info-grid,
.product-feature,
.product-steps,
.product-steps > *,
.search-answers,
.search-guide-links {
  min-width: 0;
  max-width: 100%;
}

/* Keep the interactive workflow comfortably spaced without adding a second art block. */
.rescue-lab.section {
  padding-block: 60px 68px;
}

/* Keep the collection/builds/wishlist cards in one compact visual family. */
.collection .product-info-grid {
  --product-feature-visual-height: clamp(158px, 12vw, 174px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.collection .product-info-grid > .product-feature,
.collection .product-info-grid > .feature-projects {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: var(--product-feature-visual-height) auto;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(11,13,10,.1);
  border-radius: 22px;
  color: #1a2015;
  background: #fffdf7;
  box-shadow: 0 16px 46px rgba(26,30,22,.05);
  padding: 0;
}

.collection .product-info-grid .product-feature-visual {
  min-width: 0;
  height: var(--product-feature-visual-height);
  box-sizing: border-box;
  background: #f2f4ed;
}

.collection .product-info-grid .product-feature-visual > img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  padding: 10px;
  object-fit: contain;
}

.collection .product-info-grid .product-project-visual {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  padding: 9px 12px;
}

.collection .product-info-grid .project-format {
  align-self: flex-end;
  color: #527b0a;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .1em;
  line-height: 1;
}

.collection .product-info-grid .project-stack {
  gap: 6px;
}

.collection .product-info-grid .project-card {
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: #fffdf7;
}

.collection .product-info-grid .project-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: .62rem;
}

.collection .product-info-grid .project-card b {
  font-size: .73rem;
  line-height: 1.2;
}

.collection .product-info-grid .project-card small {
  margin-top: 2px;
  font-size: .65rem;
  line-height: 1.25;
}

.collection .product-feature-copy {
  min-width: 0;
  padding: 18px 20px 20px;
}

.collection .product-feature-copy > .feature-topline {
  display: block;
  margin-bottom: 8px;
  color: #527b0a;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .13em;
}

.collection .product-feature-copy h3 {
  margin: 0 0 8px;
  color: #1a2015;
  font-size: 1.25rem;
  line-height: 1.15;
}

.collection .product-feature-copy p {
  margin: 0;
  color: #596052;
  font-size: .86rem;
  line-height: 1.6;
}

/* Keep the Trader workflow steps balanced and readable. */
.trader .product-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 16px;
}

.trader .product-steps > article {
  min-width: 0;
  padding: 24px;
  border: 1px solid rgba(36,62,0,.17);
  border-radius: 20px;
  color: #172000;
  background: rgba(255,255,255,.56);
}

.trader .product-steps > article > b {
  color: #5a8700;
  font-size: .76rem;
  letter-spacing: .12em;
}

.trader .product-steps > article h3 {
  margin: 14px 0 9px;
  color: #172000;
  font: 600 1.32rem/1.15 var(--display);
}

.trader .product-steps > article p {
  margin: 0;
  color: #465235;
  font-size: .87rem;
  line-height: 1.6;
}

/* Answers are an intentionally quieter companion to the approved principles
   list: two columns on wide screens, one readable list on narrow screens. */
.search-answers .principle-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(24px, 4vw, 56px);
  border-top: 1px solid rgba(31,37,28,.18);
}

/* Put the heading in normal flow above both the answer list and guide cards. */
.search-answers {
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: start;
  column-gap: clamp(28px, 5vw, 76px);
  row-gap: clamp(24px, 3vw, 36px);
  box-sizing: border-box;
  padding: clamp(28px, 4vw, 52px);
  border: 1px solid rgba(31,37,28,.1);
  border-radius: 28px;
  color: #20251c;
  background: #F5F3E8;
  box-shadow: 0 22px 58px rgba(0,0,0,.12);
}

.search-answers > .principles-copy h2 {
  color: #20251c;
}

.search-answers > .principles-copy h2 span {
  color: #5c7d1d;
}

.search-answers > .principles-copy .kicker {
  color: #536d1b;
}

.search-answers > .principles-copy {
  grid-column: 1 / -1;
  position: static;
  max-width: 980px;
}

.search-answers > .principle-list {
  grid-column: 1;
  grid-row: 2;
}

.search-answers > .search-guide-links {
  grid-column: 2;
  grid-row: 2;
  margin-top: 0;
}

.search-answers .principle-list article {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 16px;
  align-items: baseline;
  padding: 24px 0 26px;
  border-bottom: 1px solid rgba(31,37,28,.16);
}

.search-answers .principle-list article > b {
  grid-row: 1 / 3;
  color: #62851d;
}

.search-answers .principle-list h3 {
  min-width: 0;
  margin: 0 0 9px;
  color: #20251c;
  font-size: 1.08rem;
  line-height: 1.2;
}

.search-answers .principle-list p {
  min-width: 0;
  margin: 0;
  color: #48513e;
  font-size: .84rem;
  line-height: 1.62;
}

.search-guide-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 30px;
}

.search-guide-links a {
  min-width: 0;
  min-height: 142px;
  display: flex;
  flex-direction: column;
  padding: 19px;
  border: 1px solid rgba(31,37,28,.14);
  border-radius: 17px;
  color: #20251c;
  background: rgba(255,255,255,.62);
  text-decoration: none;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.search-guide-links a:first-child {
  grid-column: 1 / -1;
  min-height: 116px;
  background: #e8edda;
}

.search-guide-links a:hover,
.search-guide-links a:focus-visible {
  border-color: #66891e;
  background: #fffef8;
  box-shadow: 0 8px 20px rgba(44,58,23,.1);
}

.search-guide-links a:focus-visible {
  outline: 3px solid #527916;
  outline-offset: 3px;
}

.search-guide-links span {
  margin-bottom: 10px;
  color: #587a17;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .12em;
}

.search-guide-links strong {
  font: 600 1.04rem/1.25 var(--display);
}

.search-guide-links small {
  margin-top: 8px;
  color: #525b48;
  font-size: .82rem;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .rescue-lab.section {
    padding-block: 52px 60px;
  }

  .collection .product-info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .collection .product-info-grid > .product-feature:last-child {
    grid-column: 1 / -1;
    width: calc((100% - 16px) / 2);
    justify-self: center;
  }

  .trader .product-steps {
    grid-template-columns: 1fr;
  }

  .search-answers .principle-list {
    grid-template-columns: 1fr;
  }

  .search-answers {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
    row-gap: 28px;
    padding: clamp(26px, 5vw, 40px);
  }

  .search-answers > .principle-list,
  .search-answers > .search-guide-links {
    grid-column: 1;
    grid-row: auto;
  }

  .search-guide-links {
    grid-template-columns: 1fr;
    margin-top: 0;
  }

  .search-guide-links a:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .rescue-lab.section {
    padding-block: 44px 52px;
  }

  .collection .product-info-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .collection .product-info-grid > .product-feature:last-child {
    grid-column: auto;
    width: auto;
    justify-self: stretch;
  }

  .collection .product-feature-copy {
    padding: 16px 17px 18px;
  }

  .collection .product-feature-copy h3 {
    font-size: 1.1rem;
  }

  .collection .product-feature-copy p {
    font-size: .81rem;
    line-height: 1.52;
  }

  .trader .product-steps > article {
    padding: 19px 17px;
  }

  .search-answers .principle-list article {
    grid-template-columns: 34px minmax(0, 1fr);
    column-gap: 12px;
    padding: 20px 0 22px;
  }

  .search-answers {
    padding: 24px 18px;
    border-radius: 22px;
  }

  .search-answers .principle-list h3 {
    font-size: 1rem;
  }

  .search-answers .principle-list p {
    font-size: .8rem;
  }

  .search-guide-links {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 24px;
  }

  .search-guide-links a,
  .search-guide-links a:first-child {
    grid-column: auto;
    min-height: 0;
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .search-guide-links a {
    transition: none;
  }

  .search-guide-links a:hover,
  .search-guide-links a:focus-visible {
    transform: none;
  }
}

/* At phone widths, show the preview's existing mobile workspace rather than
   squeezing its desktop navigation into a narrow column. */
@media (max-width: 560px) {
  #product-lab .app-device:not(.is-mobile) {
    height: 720px;
    min-height: 720px;
  }

  #product-lab .app-device:not(.is-mobile) .app-shell {
    display: block;
    height: calc(100% - 42px);
  }

  #product-lab .app-device:not(.is-mobile) .app-rail {
    display: none;
  }

  #product-lab .app-device:not(.is-mobile) .app-workspace {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: 19px 14px 0;
  }

  #product-lab .app-device:not(.is-mobile) .workspace-header {
    align-items: flex-start;
    margin-bottom: 16px;
  }

  #product-lab .app-device:not(.is-mobile) .workspace-header h3 {
    font-size: 1.42rem;
  }

  #product-lab .app-device:not(.is-mobile) .search-trigger {
    width: 40px;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }

  #product-lab .app-device:not(.is-mobile) .search-trigger span {
    font-size: 1.1rem;
  }

  #product-lab .app-device:not(.is-mobile) .avatar-stack img:not(:last-child),
  #product-lab .app-device:not(.is-mobile) .chrome-dots,
  #product-lab .app-device:not(.is-mobile) .chrome-signal {
    display: none;
  }

  #product-lab .app-device:not(.is-mobile) .app-view {
    min-height: 0;
    padding-bottom: 0;
  }

  #product-lab .app-device:not(.is-mobile) .app-home-grid,
  #product-lab .app-device:not(.is-mobile) .build-preview,
  #product-lab .app-device:not(.is-mobile) .setup-preview {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    gap: 10px;
  }

  #product-lab .app-device:not(.is-mobile) .app-home-grid article {
    min-height: 0;
  }

  #product-lab .app-device:not(.is-mobile) .app-hero-card {
    grid-template-columns: minmax(0, 1fr) 82px;
    padding: 17px;
  }

  #product-lab .app-device:not(.is-mobile) .app-build-orbit {
    width: 76px;
  }

  #product-lab .app-device:not(.is-mobile) .app-hero-card h4 {
    font-size: 1.12rem;
  }

  #product-lab .app-device:not(.is-mobile) .mobile-app-nav {
    position: static;
    inset: auto;
    z-index: auto;
    display: flex;
    width: 100%;
    margin: 10px 0 0;
    padding: 5px;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 13px;
    background: #20231f;
    scrollbar-width: thin;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  #product-lab .app-device:not(.is-mobile) .mobile-app-nav button {
    flex: 0 0 auto;
    min-width: 42px;
    padding-inline: 7px;
    font-size: .58rem;
  }
}