/* ============================================================
   MULTITEK CONTROLS — infrastructure.css
   Page-specific additions for the Infrastructure page.
   Everything else reuses the global design system
   (style.css / pages.css / premium.css).
   ============================================================ */

/* ── GRID MODIFIERS ────────────────────────────────────────── */
.features-grid--quality {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

/* ── IMAGE PLACEHOLDERS (shown until real photos exist) ────── */
.infra-ph__box {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--muted);
  background:
    linear-gradient(rgba(148,163,184,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,.07) 1px, transparent 1px),
    var(--off-white);
  background-size: 26px 26px, 26px 26px, auto;
}

.infra-ph__label {
  font-family: var(--font-display);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink);
}

.infra-ph__hint {
  font-size: .72rem;
  letter-spacing: .02em;
  color: var(--light);
  word-break: break-all;
}

/* ── FACTORY TOUR CARDS ────────────────────────────────────── */
.tour-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
}

@media (min-width: 768px) {
  .tour-grid { grid-template-columns: 1fr 1fr; }
  .tour-card--wide { grid-column: 1 / -1; }
}

.tour-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.tour-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(77,123,247,.25);
}

.tour-card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--off-white);
}

@media (min-width: 768px) {
  .tour-card--wide .tour-card__media {
    aspect-ratio: auto;
    height: clamp(280px, 34vw, 440px);
  }
}

.tour-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .6s cubic-bezier(.16,1,.3,1);
}

.tour-card:hover .tour-card__media img { transform: scale(1.05); }

.tour-card__media.is-ph .infra-ph__box {
  display: flex;
  position: absolute;
  inset: 0;
}

.tour-card__body {
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.6rem 1.75rem;
}

.tour-card__desc {
  margin-top: .5rem;
  font-size: .92rem;
  line-height: 1.65;
  color: var(--muted);
}

/* Highlight pills (shared by tour cards) */
.cap-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 1.1rem;
  padding: 0;
  list-style: none;
}

.cap-tags li {
  padding: .34rem .75rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  transition: color var(--transition), border-color var(--transition);
}

.tour-card:hover .cap-tags li {
  color: var(--ink);
  border-color: rgba(77,123,247,.3);
}

/* ── MANUFACTURING PROCESS — timeline with icons ───────────── */
.process-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  row-gap: 3rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 1024px) {
  .process-flow { grid-template-columns: repeat(7, 1fr); }
}

.process-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .85rem;
  text-align: center;
  padding-inline: .4rem;
  /* per-step connector/badge stagger */
}

.process-step:nth-child(1) { --cd: 0s;   }
.process-step:nth-child(2) { --cd: .12s; }
.process-step:nth-child(3) { --cd: .24s; }
.process-step:nth-child(4) { --cd: .36s; }
.process-step:nth-child(5) { --cd: .48s; }
.process-step:nth-child(6) { --cd: .60s; }
.process-step:nth-child(7) { --cd: .72s; }

.process-step__icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--white);
  border: 1px solid rgba(77,123,247,.35);
  box-shadow: 0 0 0 6px rgba(77,123,247,.06);
  color: var(--electric);
  opacity: 0;
  transform: scale(.55);
  transition: opacity .5s cubic-bezier(.22,1,.36,1) var(--cd),
              transform .5s cubic-bezier(.22,1,.36,1) var(--cd);
}

.process-step__label {
  font-family: var(--font-display);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.4;
  color: var(--ink);
  max-width: 14ch;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .5s ease calc(var(--cd) + .1s),
              transform .5s ease calc(var(--cd) + .1s);
}

/* Animated connector — grows from the previous step's badge */
.process-step::before {
  content: '';
  position: absolute;
  top: 23px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, rgba(77,123,247,.12), rgba(77,123,247,.55));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .7s cubic-bezier(.22,1,.36,1) var(--cd);
}

.process-step:first-child::before { display: none; }

/* Tablet: 4 per row — no connector across row breaks */
@media (max-width: 1023px) {
  .process-step:nth-child(4n+1)::before { display: none; }
}

/* Activated by main.js adding .is-visible to the .reveal parent */
.process-flow.is-visible .process-step::before { transform: scaleX(1); }
.process-flow.is-visible .process-step__icon   { opacity: 1; transform: scale(1); }
.process-flow.is-visible .process-step__label  { opacity: 1; transform: translateY(0); }

/* Mobile: vertical timeline */
@media (max-width: 639px) {
  .process-flow {
    grid-template-columns: 1fr;
    row-gap: 1.5rem;
  }

  .process-step {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 1rem;
    padding-inline: 0;
  }

  .process-step__icon { flex-shrink: 0; }
  .process-step__label { max-width: none; }

  .process-step::before {
    top: -1.5rem;
    left: 23px;
    width: 2px;
    height: 1.5rem;
    background: linear-gradient(180deg, rgba(77,123,247,.12), rgba(77,123,247,.55));
    transform: scaleY(0);
    transform-origin: top center;
  }

  .process-flow.is-visible .process-step::before { transform: scaleY(1); }
}

@media (prefers-reduced-motion: reduce) {
  .process-step::before,
  .process-step__icon,
  .process-step__label {
    transition: none;
    transform: none;
    opacity: 1;
  }
  .process-step::before { transform: scaleX(1); }
}

/* ── ENGINEERING & DESIGN — badge grid tweaks ──────────────── */
.quality-badges--eng { margin-top: 0; }

@media (min-width: 1024px) {
  .quality-badges--eng { margin-top: 2.4rem; }
}

/* ── CERTIFICATION SHOWCASE ────────────────────────────────── */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.25rem;
}

.cert-tile {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: .9rem .9rem 1.1rem;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.cert-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(77,123,247,.3);
}

.cert-tile:focus-visible {
  outline: 2px solid var(--electric);
  outline-offset: 3px;
}

.cert-tile__thumb {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  margin-bottom: .55rem;
  border-radius: calc(var(--radius-md) - 4px);
  overflow: hidden;
  background:
    linear-gradient(rgba(148,163,184,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,.07) 1px, transparent 1px),
    var(--off-white);
  background-size: 22px 22px, 22px 22px, auto;
  border: 1px solid var(--border);
}

.cert-tile__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cert-tile__ph {
  display: none;
  position: absolute;
  inset: 0;
  place-items: center;
  color: var(--light);
}

.cert-tile.is-ph .cert-tile__ph { display: grid; }

.cert-tile__name {
  font-family: var(--font-display);
  font-size: .875rem;
  font-weight: 700;
  color: var(--ink);
}

.cert-tile__sub {
  font-size: .75rem;
  color: var(--muted);
}

/* ── CERTIFICATE MODAL ─────────────────────────────────────── */
.cert-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.cert-modal[hidden] { display: none; }

.cert-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11,17,32,.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .28s ease;
}

.cert-modal__panel {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 2.25rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 32px 80px -16px rgba(11,17,32,.45);
  opacity: 0;
  transform: translateY(18px) scale(.97);
  transition: opacity .28s ease, transform .28s cubic-bezier(.22,1,.36,1);
}

.cert-modal.is-open .cert-modal__backdrop { opacity: 1; }
.cert-modal.is-open .cert-modal__panel    { opacity: 1; transform: none; }

.cert-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--muted);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), transform var(--transition);
}

.cert-modal__close:hover {
  color: var(--ink);
  border-color: var(--ink);
  transform: rotate(90deg);
}

.cert-modal__preview {
  margin-bottom: 1.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.cert-modal__preview img {
  display: block;
  width: 100%;
  max-height: 46vh;
  object-fit: contain;
  background: var(--off-white);
}

.cert-modal__preview .infra-ph__box {
  display: flex;
  aspect-ratio: 4 / 3;
}

.cert-modal__preview .infra-ph__box[hidden] { display: none; }

.cert-modal__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--ink);
}

.cert-modal__body {
  margin-top: .75rem;
  font-size: .95rem;
  line-height: 1.7;
  color: var(--muted);
}

.cert-modal__note {
  margin-top: 1.4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: .85rem;
  color: var(--muted);
}

.cert-modal__note a {
  color: var(--electric);
  font-weight: 600;
}

@media (max-width: 480px) {
  .cert-modal__panel { padding: 1.75rem 1.4rem; }
}

/* ── BRAND WALL ────────────────────────────────────────────── */
.brand-wall {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1.25rem;
}

.brand-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  min-height: 110px;
  padding: 1.25rem 1rem;
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.brand-tile:hover {
  border-color: rgba(77,123,247,.3);
  box-shadow: 0 4px 16px -6px rgba(77,123,247,.15);
}

/* Logo image: grayscale, colour on hover */
.brand-tile img {
  max-height: 38px;
  max-width: 80%;
  object-fit: contain;
  filter: grayscale(1);
  opacity: .65;
  transition: filter var(--transition), opacity var(--transition);
}

.brand-tile:hover img {
  filter: none;
  opacity: 1;
}

/* Wordmark fallback (no logo file yet): gray, colour on hover */
.brand-tile__name {
  display: none;
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--light);
  transition: color var(--transition);
}

.brand-tile.is-text .brand-tile__name { display: block; }

.brand-tile:hover .brand-tile__name { color: var(--ink); }

.brand-tile__sub {
  font-size: .72rem;
  color: var(--muted);
}
