/*
 * Commercial buildings page (Commercial module). Loaded after ms.css and
 * lw.css, whose heading, card, note, table, chip, workflow and project
 * styles it reuses. Logical properties only (RTL for ar and he). Button
 * labels never wrap; text keeps its distance from buttons.
 */

/* Five pillars: one row on desktop, two columns on tablets, a list on phones */
.cb-pillar-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 0; padding: 0; list-style: none; border: 1px solid var(--steel-200); background: var(--white); }
.cb-pillar + .cb-pillar { border-inline-start: 1px solid var(--steel-200); }
.cb-pillar-in { position: relative; display: flex; flex-direction: column; gap: 8px; block-size: 100%; padding: 22px 20px 20px; color: inherit; text-decoration: none; }
a.cb-pillar-in::before { content: ""; position: absolute; inset-inline: 0; inset-block-start: 0; block-size: 3px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .25s ease; }
[dir="rtl"] a.cb-pillar-in::before { transform-origin: right; }
a.cb-pillar-in:hover::before, a.cb-pillar-in:focus-visible::before { transform: scaleX(1); }
a.cb-pillar-in:focus-visible { outline: 2px solid var(--red); outline-offset: -2px; }
.cb-pillar-no { font-family: var(--f-mono); font-size: 13px; font-weight: 600; color: var(--red); }
.cb-pillar-label { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--steel-600, #5b6675); }
.cb-pillar h3 { font-size: 18px; line-height: 1.3; margin: 0; color: var(--navy-900); }
.lp-sec .cb-pillar p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.cb-pillar .textlink { margin-block-start: auto; padding-block-start: 10px; white-space: nowrap; }

/* Integrated solution ecosystem */
.cb-eco-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.cb-eco-group { display: flex; flex-direction: column; gap: 10px; padding: 22px 22px 16px; background: var(--white); border: 1px solid var(--steel-200); }
.cb-eco-top { display: flex; align-items: center; gap: 12px; }
.cb-eco-top h3 { font-size: 18px; line-height: 1.3; margin: 0; }
.lp-sec .cb-eco-group p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.cb-eco-links { margin: 4px 0 0; padding: 0; list-style: none; }
.cb-eco-links li + li { border-block-start: 1px solid var(--steel-100); }
.cb-eco-links a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-block-size: 44px; padding-block: 8px; color: var(--navy-900); font-weight: 600; font-size: 15px; text-decoration: none; }
.cb-eco-links a:hover span:first-child, .cb-eco-links a:focus-visible span:first-child { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.cb-eco-links .ms-arrow { flex: none; color: var(--red); }
[dir="rtl"] .cb-eco-links .ms-arrow { transform: scaleX(-1); }

/* Knowledge centre */
.cb-art-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.cb-art a { display: flex; flex-direction: column; block-size: 100%; background: var(--white); border: 1px solid var(--steel-200); color: inherit; text-decoration: none; transition: border-color .2s ease, box-shadow .2s ease; }
.cb-art a:hover, .cb-art a:focus-visible { border-color: var(--navy-900); box-shadow: 0 6px 18px rgba(10, 22, 40, .08); }
.cb-art a:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.cb-art-img { margin: 0; aspect-ratio: 16 / 10; overflow: hidden; background: var(--steel-100); }
.cb-art-img img { inline-size: 100%; block-size: 100%; object-fit: cover; }
.cb-art-body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 18px 20px; }
.cb-art-body h3 { font-size: 17px; line-height: 1.35; margin: 0; color: var(--navy-900); }
.lp-sec .cb-art-body p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.cb-art-body .textlink { margin-block-start: auto; padding-block-start: 8px; white-space: nowrap; }

/* Text never touches the buttons that follow it */
.lp-sec.cb-sec .ms-note + .ctas, .lp-sec.cb-sec .lw-note + .ctas { margin-block-start: 24px; }
.lp-sec.cb-sec .ctas .btn { white-space: nowrap; }

@media (max-width: 1099px) {
  .cb-pillar-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cb-pillar { border-block-end: 1px solid var(--steel-200); }
  .cb-pillar + .cb-pillar { border-inline-start: 0; }
  .cb-pillar:nth-child(even) { border-inline-start: 1px solid var(--steel-200); }
  .cb-eco-grid, .cb-art-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 719px) {
  .cb-pillar-list, .cb-eco-grid, .cb-art-grid { grid-template-columns: minmax(0, 1fr); }
  .cb-pillar:nth-child(even) { border-inline-start: 0; }
  .cb-pillar:last-child { border-block-end: 0; }
  .cb-pillar-in { padding: 18px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  a.cb-pillar-in::before { transition: none; }
  .cb-art a { transition: none; }
}
