/* ============================================================
   setMach.tech — shared stylesheet
   Used by every page of the site.
   Edit colours here once and the whole site updates.
   ============================================================ */

:root {
  --brand-blue: #1a4f8a;     /* headers, links */
  --brand-dark: #222222;     /* main text */
  --brand-grey: #f4f6f8;     /* light section backgrounds */
  --brand-border: #dde3e8;   /* card borders */
  --brand-accent: #e87722;   /* hover highlights */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--brand-dark);
  background: #ffffff;
  line-height: 1.5;
}

a { color: var(--brand-blue); text-decoration: none; }
a:hover { color: var(--brand-accent); }

/* ---------- Header / navigation ---------- */
.site-header {
  border-bottom: 2px solid var(--brand-border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.site-header .logo img { height: 70px; display: block; }

.main-nav { display: flex; gap: 20px; flex-wrap: wrap; }

.main-nav a {
  font-weight: bold;
  padding: 8px 4px;
  border-bottom: 3px solid transparent;
}

.main-nav a.active,
.main-nav a:hover { border-bottom-color: var(--brand-accent); }

/* Industry filter dropdown */
.industry-filter { margin-left: auto; }

.industry-filter label { font-weight: bold; margin-right: 8px; }

.industry-filter select {
  padding: 6px 10px;
  border: 1px solid var(--brand-border);
  border-radius: 4px;
  font-size: 14px;
}

/* Charity banner */
.charity-banner {
  background: var(--brand-grey);
  text-align: center;
  padding: 8px;
  font-size: 14px;
}

/* ---------- Page layout ---------- */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.page h1 { color: var(--brand-blue); margin-bottom: 8px; font-size: 26px; }
.page h2 { color: var(--brand-blue); margin: 28px 0 12px; font-size: 20px; }
.page h3 { margin: 20px 0 10px; font-size: 16px; }

.intro { margin-bottom: 16px; }

/* ---------- Equipment grid (homepage) ---------- */
.equipment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 18px;
  margin: 12px 0 28px;
}

.equipment-card {
  border: 1px solid var(--brand-border);
  border-radius: 6px;
  padding: 14px 10px;
  text-align: center;
  background: #fff;
  transition: box-shadow .15s, transform .15s;
}

.equipment-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  transform: translateY(-2px);
}

.equipment-card img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  margin-bottom: 8px;
}

.equipment-card span { display: block; font-size: 14px; font-weight: bold; }

/* ---------- Tool cards (tools page) ---------- */
.tool-list { display: flex; flex-direction: column; gap: 16px; margin: 12px 0 28px; }

.tool-card {
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--brand-border);
  border-radius: 6px;
  padding: 14px;
  background: #fff;
}

.tool-card img { width: 70px; height: 70px; object-fit: contain; flex-shrink: 0; }

.tool-card .tool-text strong { display: block; margin-bottom: 4px; }

/* ---------- Tool iframe page ---------- */
.tool-frame {
  width: 100%;
  height: 900px;          /* adjust per tool if needed */
  border: 1px solid var(--brand-border);
  border-radius: 6px;
}

/* ---------- Search box ---------- */
.search-box { display: flex; gap: 8px; max-width: 420px; }

.search-box input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--brand-border);
  border-radius: 4px;
}

.search-box button {
  padding: 8px 16px;
  background: var(--brand-blue);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.search-box button:hover { background: var(--brand-accent); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 2px solid var(--brand-border);
  margin-top: 40px;
  padding: 20px 24px;
  font-size: 14px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
  color: #555;
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  .site-header { flex-direction: column; align-items: flex-start; }
  .industry-filter { margin-left: 0; }
  .tool-card { flex-direction: column; text-align: center; }
}

/* ============================================================
   Front-page equipment-family panels (Pumps / Compressors / Gas turbines)
   Three equal cards; stack on narrow screens.
   ============================================================ */

.family-panels {
  display: flex;
  gap: 22px;
  margin: 22px 0 8px;
}

.family-panel {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 20px 22px;
  border: 1px solid var(--brand-border);
  border-top: 4px solid var(--brand-blue);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-dark);
  transition: box-shadow .18s, transform .18s, border-color .18s;
}

.family-panel:hover {
  box-shadow: 0 8px 24px rgba(26, 79, 138, .15);
  transform: translateY(-4px);
  border-top-color: var(--brand-accent);
  color: var(--brand-dark);
}

.family-figure {
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.family-figure img {
  max-height: 150px;
  max-width: 90%;
  object-fit: contain;
}

.family-panel h2 {
  color: var(--brand-blue);
  margin: 0 0 6px;
  font-size: 22px;
}

.family-desc {
  color: #555;
  font-size: 14px;
  margin: 0 0 16px;
  min-height: 40px;      /* keeps the three CTAs aligned */
}

.family-cta {
  font-weight: bold;
  color: var(--brand-blue);
}

.family-panel:hover .family-cta { color: var(--brand-accent); }

@media (max-width: 760px) {
  .family-panels { flex-direction: column; }
  .family-desc { min-height: 0; }
}

/* ============================================================
   setMach classification tree  (Pumps / Compressors / Gas turbines)
   Underlined text labels, navy connector bars with triangle
   arrowheads, and clickable pictograms as the leaves — matching
   the original setMach diagrams.

   HTML shape:
     <div class="ctree">
       <span class="ct-title ct-parent">PUMPS</span>
       <div class="ct-branches fork-2">
         <div class="ct-branch"> ...label + leaves or nested branches... </div>
         <div class="ct-branch"> ... </div>
       </div>
     </div>
   Use fork-1 / fork-2 / fork-3 on .ct-branches to match the number
   of children (it sizes the horizontal bar between the outer branches).
   ============================================================ */

.ctree { text-align: center; padding: 6px 0 10px; overflow-x: auto; }

/* ----- labels ----- */
.ct-title,
.ct-label {
  display: inline-block;
  font-weight: bold;
  color: var(--brand-blue);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ct-title { font-size: 18px; letter-spacing: .5px; }
.ct-label { font-size: 15px; }

/* a parent label gets a small down-triangle beneath it (stem to the bar) */
.ct-parent { position: relative; }
.ct-parent::after {
  content: "";
  display: block;
  width: 0; height: 0;
  margin: 6px auto 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 11px solid var(--brand-blue);
}

/* ----- the branch row + connector bar ----- */
.ct-branches {
  display: flex;
  justify-content: space-around;
  position: relative;
  padding-top: 40px;          /* room for the bar + child triangles */
}
/* horizontal navy bar spanning between the outer child centres */
.ct-branches::before {
  content: "";
  position: absolute;
  top: 8px; height: 3px;
  background: var(--brand-blue);
}
.ct-branches.fork-2::before { left: 25%;     right: 25%; }
.ct-branches.fork-3::before { left: 16.666%; right: 16.666%; }
.ct-branches.fork-1::before { display: none; }   /* single child: no bar */

/* each branch column */
.ct-branch {
  flex: 1 1 0;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
/* down-triangle sitting on the bar, above each child label */
.ct-branch::before {
  content: "";
  position: absolute;
  top: -32px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 11px solid var(--brand-blue);
}
.ct-branches.fork-1 > .ct-branch::before { display: none; }

/* ----- pictogram leaves ----- */
.ct-leaves {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  max-width: 250px;        /* two leaves per row -> 2 columns */
  margin: 16px auto 0;
}
.ct-leaves.one-col { max-width: 150px; }

.ct-leaf {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 112px;
  color: var(--brand-dark);
  font-size: 13px;
  text-align: center;
}
.ct-leaf img {
  width: 84px; height: 84px;
  object-fit: contain;
  margin-bottom: 6px;
  transition: transform .15s;
}
.ct-leaf:hover img { transform: scale(1.08); }
.ct-leaf:hover { color: var(--brand-accent); }

/* a single central hero pictogram (gas-turbine page) */
.ct-hero { text-align: center; }
.ct-hero img { display: block; margin: 24px auto 0; max-width: 340px; width: 60%; height: auto; }

/* ----- responsive: stack branches, hide connector lines ----- */
@media (max-width: 720px) {
  .ct-branches { flex-direction: column; gap: 26px; padding-top: 20px; }
  .ct-branches::before,
  .ct-branch::before { display: none; }
  .ct-leaves { max-width: 340px; }
}
