/* The how-to guide pages, written by `npm run website-guide` (#4570).
   Drawn from the guide-tiles mockup. It loads after style.css and uses the
   theme's tokens from theme.css, so it declares none of its own. It holds no
   script hook and no import, and the pages that use it carry no inline style.
   website/README.md, "The guide pages", has the rules. */

/* style.css gives every section the padding of a home page band. */
.guide-main section {
  padding: 0;
}

.guide-main {
  padding-bottom: 3rem;
}

.guide-crumbs {
  padding-top: 1.5rem;
  font-size: 0.88rem;
}

.guide-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--text-muted);
}

.guide-crumbs li + li::before {
  content: '›';
  margin-right: 0.5rem;
  color: var(--text-faint);
}

.guide-crumbs a {
  color: var(--text-muted);
}

.guide-crumbs a:hover {
  color: var(--accent);
}

.guide-task {
  max-width: 46rem;
  margin: 0 auto;
  padding-bottom: 3rem;
}

.guide-task-head {
  padding: 1.5rem 0;
}

.guide-task-head h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
}

.guide-intro {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin: 0 0 0.9rem;
}

.guide-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.guide-chips .badge {
  padding: 0.1rem 0.65rem;
  font-size: 0.75rem;
}

.guide-platform {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.75rem;
}

.guide-steps {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  counter-reset: step;
  display: grid;
  gap: 0.9rem;
}

.guide-steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1.15rem 1.35rem;
  background: var(--elevated);
  border: 1px solid var(--elevated-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  font-size: 1.05rem;
}

.guide-steps li::before {
  content: counter(step);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tile-bg);
  box-shadow: var(--tile-shadow);
  color: var(--accent);
  font-weight: 700;
}

.guide-steps li > span {
  padding-top: 0.35rem;
  overflow-wrap: anywhere;
}

.guide-steps strong {
  background: var(--subtle);
  border: 1px solid var(--elevated-border);
  border-radius: 6px;
  padding: 0.02rem 0.4rem;
  font-weight: 600;
}

.guide-callout {
  padding: 1.1rem 1.35rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent-soft);
  margin-bottom: 1.5rem;
}

.guide-callout-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 0;
}

.guide-callout p {
  margin: 0.15rem 0 0;
}

.guide-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 0 0 1rem;
}

.guide-pager a {
  display: block;
  padding: 1rem 1.25rem;
  border: 1px solid var(--elevated-border);
  border-radius: var(--radius);
  background: var(--elevated);
  text-decoration: none;
  color: var(--text);
}

.guide-pager a:hover {
  border-color: var(--accent);
}

.guide-pager .guide-next {
  grid-column: 2;
  text-align: right;
}

.guide-pager-label {
  display: block;
  color: var(--text-faint);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.guide-more h2 {
  font-size: 1.15rem;
  margin: 2rem 0 0.9rem;
}

.guide-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.guide-tile {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.25rem;
  color: inherit;
  text-decoration: none;
  background: linear-gradient(165deg, var(--elevated-raised), var(--elevated) 65%);
  border: 1px solid var(--elevated-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.guide-tile:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--card-shadow-hover);
}

.guide-tile h3 {
  font-size: 1.02rem;
  line-height: 1.3;
  margin: 0;
}

.guide-tile p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.guide-tile .badge {
  align-self: flex-start;
}

/* theme.css has no accent badge. Cadence Plus uses the accent colour. */
.guide-main .badge-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

/* The feature page: a head with an icon, then a main column and a column of facts. */
.guide-feature {
  padding-bottom: 3rem;
}

.guide-feature-head {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  padding: 1.5rem 0 2rem;
}

.guide-feature-head > div {
  min-width: 0;
}

.guide-feature-head h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.6rem;
  overflow-wrap: anywhere;
}

.guide-icon {
  width: 4.5rem;
  height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 27%;
  background: var(--tile-bg);
  border: var(--tile-border);
  box-shadow: var(--tile-shadow);
  color: var(--accent);
}

.guide-icon svg {
  width: 2rem;
  height: 2rem;
}

.guide-feature-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
}

.guide-feature-main,
.guide-feature-side {
  display: grid;
  gap: 1.5rem;
  min-width: 0;
  align-content: start;
}

.guide-panel,
.guide-box {
  padding: 1.5rem 1.75rem;
  background: var(--elevated);
  border: 1px solid var(--elevated-border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}

.guide-panel h2 {
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
}

.guide-panel p {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.guide-panel p:last-child {
  margin-bottom: 0;
}

.guide-howtos-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-bottom: 0.9rem;
}

.guide-howtos-head h2 {
  font-size: 1.5rem;
  margin: 0;
}

.guide-count {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.guide-numbered {
  counter-reset: howto;
}

.guide-numbered .guide-tile {
  counter-increment: howto;
}

.guide-numbered .guide-tile::before {
  content: counter(howto);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tile-bg);
  box-shadow: var(--tile-shadow);
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 700;
}

.guide-box h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 0 0 0.9rem;
}

.guide-facts {
  display: grid;
  gap: 0.9rem;
  margin: 0;
}

.guide-facts dt {
  color: var(--text-faint);
  font-size: 0.78rem;
}

.guide-facts dd {
  margin: 0.1rem 0 0;
  overflow-wrap: anywhere;
}

.guide-related {
  display: grid;
  gap: 0.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.guide-related a {
  color: var(--text);
}

.guide-related a:hover {
  color: var(--accent);
}

.guide-feature-pager {
  padding-top: 2.5rem;
}

/* The landing page: a heading, then groups of feature tiles. */
.guide-landing-head {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2.5rem 0 1rem;
  text-align: center;
}

.guide-landing-head h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.9rem;
}

.guide-lede {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin: 0;
}

/* The "Find a feature" box (#4583). The page writes it with hidden, and
   guide-search.js shows it, so a page with no script has no box. This rule
   keeps every hidden part of the guide hidden, whatever display another rule
   gives it: the box, a tile, a group and the no-match message. */
.guide-main [hidden] {
  display: none !important;
}

.guide-search {
  max-width: 28rem;
  margin: 1.5rem auto 0;
  text-align: left;
}

.guide-search label {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.guide-search .field {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  font: inherit;
}

.guide-search .field:focus-visible {
  border-color: var(--accent);
}

.guide-no-match {
  max-width: 34rem;
  margin: 2rem auto 0;
  padding: 1.5rem 1.75rem;
  text-align: center;
  background: var(--elevated);
  border: 1px solid var(--elevated-border);
  border-radius: var(--radius);
}

.guide-no-match p {
  margin: 0;
  color: var(--text-muted);
}

.guide-no-match .guide-no-match-title {
  margin-bottom: 0.4rem;
  color: var(--text);
  font-weight: 600;
  font-size: 1.1rem;
  overflow-wrap: anywhere;
}

.guide-group {
  padding-top: 2rem;
}

.guide-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1rem;
  margin-bottom: 1.1rem;
}

.guide-group-head h2 {
  font-size: 1.35rem;
  margin: 0;
}

.guide-group-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.guide-features {
  grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr));
  gap: 1.25rem;
}

.guide-features .guide-tile {
  gap: 0.9rem;
  padding: 1.5rem;
}

.guide-tile-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.guide-tile .guide-icon {
  width: 3.25rem;
  height: 3.25rem;
}

.guide-tile .guide-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.guide-features .guide-tile h3 {
  font-size: 1.1rem;
}

.guide-features .guide-tile p {
  font-size: 0.93rem;
}

.guide-tile-foot {
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px solid var(--elevated-border);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
}

@media (min-width: 52rem) {
  .guide-feature-layout {
    grid-template-columns: minmax(0, 1fr) 18rem;
    align-items: start;
  }
}

@media (max-width: 34rem) {
  .guide-feature-head {
    gap: 1rem;
  }

  .guide-icon {
    width: 3.5rem;
    height: 3.5rem;
  }

  .guide-icon svg {
    width: 1.6rem;
    height: 1.6rem;
  }

  .guide-panel,
  .guide-box {
    padding: 1.25rem;
  }

  .guide-pager {
    grid-template-columns: 1fr;
  }

  .guide-pager .guide-next {
    grid-column: 1;
    text-align: left;
  }

  .guide-steps li {
    grid-template-columns: 2rem 1fr;
    padding: 1rem;
  }

  .guide-steps li::before {
    width: 2rem;
    height: 2rem;
  }
}
