/* AutoLeads on mainlab.es: wide card on the home page and the four-step demo on the products page.
   The demo borrows AutoLeads' petrol and ivory so it reads as that product, like the other demos do. */

/* Home page: the card sits on its own row, poster and text aligned to the two columns above. */
@media (width >= 768px) {
  .prd.prd--wide {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: inherit;
    align-items: center;
  }
  .prd.prd--wide .prd__body { margin-top: 0; }
}

/* Products page: the "on this page" index was built for four items and now has five. */
@media (width >= 768px) {
  .guide .guide__list { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 28px; }
}
@media (width >= 1100px) {
  .guide .guide__list { grid-template-columns: repeat(5, minmax(0, 1fr)); row-gap: 0; }
}

/* Demo */
.ald {
  --ald-accent: #1f4e5f;
  --ald-accent-soft: #e1eaec;
  --ald-ivory: #f7f5f0;
  --ald-line: #e3ded2;
  --ald-ink: #16181d;
  --ald-ink-2: #4a4f57;
  --ald-ink-3: #6f737a;
  --ald-ok: #2d6a4f;
  --ald-ok-soft: #e1ede5;
  --ald-later: #eeeae0;
  --ald-bad: #9b2c2c;
  --ald-bad-soft: #f5e2df;
  background: var(--ald-ivory);
  border-radius: var(--r-stage);
  box-shadow: inset 0 0 0 1px var(--trazo);
  color: var(--ald-ink);
  font-family: var(--f-text);
  overflow: clip;
}
.ald *, .ald *::before { box-sizing: border-box; }
.ald p, .ald h3, .ald dl, .ald dd, .ald ul { margin: 0; padding: 0; }
.ald ul { list-style: none; }

.ald__bar {
  align-items: center;
  border-bottom: 1px solid var(--ald-line);
  display: flex;
  font: 500 15px/1 var(--f-display);
  gap: 9px;
  padding: 12px 16px;
}
.ald__bar img { border-radius: 6px; display: block; height: 24px; width: 24px; }
.ald__sample { color: var(--ald-ink-3); font: 400 13px/1.2 var(--f-text); margin-left: auto; text-align: right; }

.ald__tabs { border-bottom: 1px solid var(--ald-line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ald__tab {
  appearance: none;
  background: none;
  border: 0;
  box-shadow: inset 0 -2px 0 transparent;
  color: var(--ald-ink-2);
  cursor: pointer;
  display: grid;
  font: 500 14px/1.2 var(--f-text);
  gap: 2px;
  justify-items: start;
  min-height: 56px;
  padding: 10px 8px 10px 16px;
  text-align: left;
  transition: box-shadow var(--d-ui) var(--ease-out), color var(--d-ui) var(--ease-out);
}
.ald__tab span { color: var(--ald-ink-3); font: 400 12px/1.2 var(--f-mono); }
.ald__tab:hover { color: var(--ald-ink); }
.ald__tab[aria-selected="true"] { box-shadow: inset 0 -2px 0 var(--ald-accent); color: var(--ald-accent); }
.ald__tab[aria-selected="true"] span { color: var(--ald-accent); }
.ald__tab:focus-visible { outline: 2px solid var(--ald-accent); outline-offset: -3px; }

.ald__panels { display: grid; }
.ald__panel { align-content: start; display: grid; gap: 18px; min-width: 0; padding: 20px 16px 22px; }
.ald__panel:focus-visible { outline: 2px solid var(--ald-accent); outline-offset: -3px; }
.ald__panel + .ald__panel { border-top: 1px solid var(--ald-line); }

/* With the script running the panels share one cell, so changing step never moves the page. */
.ald[data-ready] .ald__panel { border-top: 0; grid-area: 1 / 1; transition: opacity 0.28s var(--ease-out); }
.ald[data-ready] .ald__panel:not(.is-on) { opacity: 0; pointer-events: none; visibility: hidden; }
.ald:not([data-ready]) .ald__tabs { display: none; }

.ald__head { display: grid; gap: 8px; align-content: start; }
.ald__head h3 { font: 500 clamp(1.1875rem, 1.1rem + 0.5vw, 1.5rem)/1.2 var(--f-display); letter-spacing: -0.012em; text-wrap: balance; }
.ald__head p { color: var(--ald-ink-2); font-size: 0.9375rem; line-height: 1.55; text-wrap: pretty; }

.ald__ui { display: grid; gap: 10px; align-content: start; min-width: 0; }
.ald__card {
  background: #fff;
  border: 1px solid var(--ald-line);
  border-radius: 10px;
  box-shadow: 0 1px 2px #16181d0a, 0 10px 24px -18px #16181d33;
  min-width: 0;
  padding: 12px 14px;
}

/* 01 · Interview and criteria */
.ald__msg { border-radius: 10px; font-size: 0.875rem; line-height: 1.45; max-width: 88%; padding: 9px 12px; }
.ald__msg--app { background: #fff; border: 1px solid var(--ald-line); font-weight: 500; justify-self: start; }
.ald__msg--you { background: var(--ald-accent); color: #fff; justify-self: end; }
.ald .ald__title { color: var(--ald-ink-3); font: 500 12px/1.2 var(--f-text); letter-spacing: 0.06em; margin-bottom: 4px; text-transform: uppercase; }
.ald__row { border-top: 1px solid var(--ald-line); display: grid; font-size: 0.875rem; gap: 2px 12px; grid-template-columns: 5.25rem minmax(0, 1fr); line-height: 1.4; padding: 7px 0; }
.ald__row:first-of-type { border-top: 0; }
.ald__row dt { color: var(--ald-ink-3); }

/* 02 and 03 · A person */
.ald__who { align-items: center; display: grid; gap: 10px; grid-template-columns: auto minmax(0, 1fr) auto; }
.ald__avatar {
  align-items: center;
  background: var(--ald-accent-soft);
  border-radius: 50%;
  color: var(--ald-accent);
  display: flex;
  flex: none;
  font: 600 12px/1 var(--f-text);
  height: 34px;
  justify-content: center;
  width: 34px;
}
.ald__who b, .ald__reply b, .ald__agenda b { display: block; font-size: 0.875rem; font-weight: 600; line-height: 1.3; }
.ald__who small { color: var(--ald-ink-3); display: block; font-size: 0.8125rem; line-height: 1.3; }
.ald .ald__profile { color: var(--ald-ink-2); font-size: 0.875rem; line-height: 1.55; margin-top: 10px; }
.ald__profile mark { background: linear-gradient(transparent 62%, #f2cf6b 62%); color: var(--ald-ink); }
.ald .ald__checks { border-top: 1px solid var(--ald-line); display: grid; font-size: 0.8125rem; gap: 6px; line-height: 1.35; margin-top: 10px; padding-top: 10px; }
.ald__checks li { display: grid; gap: 8px; grid-template-columns: 16px minmax(0, 1fr); }
.ald__checks i { color: var(--ald-ink-3); font-style: normal; }
.ald__tick { background: var(--ald-ok-soft); border-radius: 50%; color: var(--ald-ok); font: 600 11px/16px var(--f-text); height: 16px; text-align: center; width: 16px; }
.ald .ald__mailnote { color: var(--ald-ink-3); font-size: 0.8125rem; line-height: 1.35; margin-bottom: 6px; }
.ald__mail { font-size: 0.9375rem; line-height: 1.5; text-wrap: pretty; }
.ald__status { align-items: center; color: var(--ald-ink-2); display: flex; font-size: 0.8125rem; gap: 8px; line-height: 1.35; padding-left: 14px; }

/* Tags */
.ald__tag { border-radius: 6px; font: 600 12px/1.2 var(--f-text); justify-self: end; padding: 5px 8px; white-space: nowrap; }
.ald__tag--ok { background: var(--ald-ok-soft); color: var(--ald-ok); }
.ald__tag--later { background: var(--ald-later); color: var(--ald-ink-2); }
.ald__tag--no { background: var(--ald-bad-soft); color: var(--ald-bad); }
.ald__tag--test { background: var(--ald-accent-soft); color: var(--ald-accent); }

/* 04 · Replies and agenda */
.ald__reply { align-items: start; display: grid; gap: 4px 10px; grid-template-columns: auto minmax(0, 1fr); padding: 10px 12px; }
.ald__reply p { color: var(--ald-ink-2); font-size: 0.875rem; line-height: 1.4; }
.ald__reply .ald__tag { grid-column: 2; justify-self: start; margin-top: 3px; }
.ald__agenda { align-items: center; background: var(--ald-accent); border-color: var(--ald-accent); color: #fff; display: grid; gap: 12px; grid-template-columns: auto minmax(0, 1fr); padding: 11px 14px; }
.ald__agenda p { color: #ffffffd9; font-size: 0.8125rem; line-height: 1.4; }
.ald__date { display: grid; font: 500 11px/1 var(--f-text); justify-items: center; letter-spacing: 0.06em; }
.ald__date b { font: 500 22px/1.1 var(--f-display); letter-spacing: 0; }

/* From a tablet up: the explanation on the left, the screen on the right. */
@container (width >= 640px) {
  .ald__bar { padding: 14px 24px; }
  .ald__tab { padding-left: 24px; }
  .ald__panel { gap: 32px; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); padding: 32px 24px 34px; }
  .ald__reply { grid-template-columns: auto minmax(0, 1fr) auto; }
  .ald__reply .ald__tag { align-self: start; grid-column: 3; grid-row: 1; justify-self: end; margin-top: 0; }
}

/* Very narrow phones: four tabs still have to fit. */
@container (width < 340px) {
  .ald__tab { font-size: 13px; padding-inline: 8px 2px; }
  .ald__who { grid-template-columns: auto minmax(0, 1fr); }
  .ald__who .ald__tag { grid-column: 2; justify-self: start; }
}

/* Poster for the home page: only the replies and the agenda, on a canvas of 620 by 393. */
.ald--poster { border-radius: 0; box-shadow: none; display: flex; flex-direction: column; height: 393px; width: 620px; }
.ald--poster .ald__ui { align-content: space-evenly; flex: 1; gap: 8px; padding: 8px 20px; }
.ald--poster .ald__reply { grid-template-columns: auto minmax(0, 1fr) auto; padding: 8px 12px; }
.ald--poster .ald__reply .ald__tag { align-self: start; grid-column: 3; grid-row: 1; justify-self: end; margin-top: 0; }
.ald--poster .ald__agenda { padding: 9px 14px; }

@media (prefers-reduced-motion: reduce) {
  .ald__tab, .ald[data-ready] .ald__panel { transition: none; }
}
