/* =========================================================
   Functions page – minimal, predictable layout
   Depends on styles.css for base theme, hero overlay, buttons, typography.
   ========================================================= */

:root {
  --mf-page-max: 1200px;
  --mf-page-pad: clamp(16px, 3vw, 28px);
  --mf-gap-lg: 72px;
  --mf-gap-md: 48px;
}

/* Page wrapper */
.mf-functions {
  width: 100%;
  background-color: var(--bg);
}

/* ---------------------------------------------------------
   Screenshot swap gating (prevents placeholder flash)
   --------------------------------------------------------- */
img[data-appscreen] {
  opacity: 0;
  transition: opacity 160ms ease;
}

html.mt-screens-ready img[data-appscreen] {
  opacity: 1;
}

/* ---------------------------------------------------------
   HERO (Functions)
   Uses .hero from styles.css for background + overlay.
   We only tune the internal layout and screenshot sizing.
   --------------------------------------------------------- */

.hero--functions {
  /* Keep it close to index feel; avoid unexpected tall hero */
  min-height: 60vh;
}

.hero--functions .hero-content {
  width: min(var(--mf-page-max), 100%);
  padding-left: var(--mf-page-pad);
  padding-right: var(--mf-page-pad);
}

.hero--functions .hero-layout {
  gap: var(--mf-gap-md);
}

/* 3/5 text, 2/5 phone */
.hero--functions .hero-text {
  flex: 3 1 0;
  max-width: none; /* do not cap */
}

.hero--functions .hero-app {
  flex: 2 1 0;
  padding-left: 0; /* remove global 80px */
  display: flex;
  justify-content: flex-end;
}

/* Phones are ready assets: NO crop, NO radius, NO border, NO shadow.
   Only size. */
.hero--functions .hero-app-image {
  width: min(520px, 100%);
  height: auto;
  display: block;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

@media (max-width: 900px) {
  .hero--functions .hero-layout {
    flex-direction: column;
    gap: 28px;
  }

  .hero--functions .hero-app {
    justify-content: center;
  }

  .hero--functions .hero-app-image {
    width: min(460px, 92vw);
  }

  .hero--functions .hero-text {
    text-align: center;
  }

  .hero--functions .hero-actions {
    justify-content: center;
  }
}

/* ---------------------------------------------------------
   FUNCTIONS LIST (5 segments)
   --------------------------------------------------------- */

.mf-functions-list {
  width: 100%;
  padding: 96px var(--mf-page-pad) 120px;
  display: flex;
  flex-direction: column;
  gap: var(--mf-gap-lg);
}

/* Each block is centered to the same max width as hero */
.mf-function-block {
  width: 100%;
  max-width: var(--mf-page-max);
  margin: 0 auto;

  display: flex;
  align-items: center;
  gap: var(--mf-gap-md);
}

.mf-function-block--reverse {
  flex-direction: row-reverse;
}

/* 2/5 phone, 3/5 text */
.mf-function-block__image {
  flex: 2 1 0;
  display: flex;
  justify-content: center;
}

.mf-function-block__image img {
  width: min(520px, 100%);
  height: auto;
  display: block;
}

.mf-function-block__text {
  flex: 3 1 0;
  max-width: none;
}

.mf-function-block__text h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.mf-function-block__text p {
  font-size: 1.02rem;
  line-height: 1.6;
  opacity: 0.9;
  margin-bottom: 16px;
}

.mf-function-block__text ul {
  padding-left: 18px;
  line-height: 1.55;
}

.mf-function-block__text li {
  margin-bottom: 6px;
}

@media (max-width: 900px) {
  .mf-functions-list {
    padding: 72px var(--mf-page-pad) 96px;
    gap: 72px;
  }

  .mf-function-block,
  .mf-function-block--reverse {
    flex-direction: column;
    text-align: center;
    gap: 28px;
  }

  .mf-function-block__image {
    justify-content: center;
  }

  .mf-function-block__image img {
    width: min(460px, 92vw);
  }

  .mf-function-block__text ul {
    display: inline-block;
    text-align: left;
  }
}