/* ============================================================
   MINISTRIES — International Typographic Style (Swiss)
   ------------------------------------------------------------
   Same grid, gutter and type scale as the homepage, so this page
   sits on the site's one left edge rather than its own.

   Everything is namespaced `min-`. The old file styled
   `.video-background-container` -- a class five other pages
   share -- and set a ministries photograph on it globally. It
   only ever looked right because every one of those pages
   happens to override the image inline.
   ============================================================ */

/* Tailwind's preflight is off in this project, so border-box is not the
   default anywhere. Without this the full-width mobile button renders its
   72px of horizontal padding OUTSIDE its 100% width and gets clipped by the
   hero. Scoped rather than global: the legacy stylesheets are built around
   content-box and would move if it changed under them. */
.min-hero,
.min-hero *,
.min-list,
.min-list * {
  box-sizing: border-box;
}

.min-hero,
.min-list {
  --min-ink: #000;
  --min-paper: #fff;
  --min-accent: #ff820d;
  --min-muted: #5c5c5c;
  --min-rule: #d8d8d8;
  --min-rule-strong: #000;

  --min-gutter: clamp(1.25rem, 5vw, 6rem);
  --min-max: 1440px;

  font-family: 'Sofia Pro', sans-serif;
}

/* ============================================================
   Hero
   ============================================================ */
.min-hero {
  position: relative;
  width: 100%;
  min-height: min(78svh, 720px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background-color: #1b1b1b;
}

.min-hero__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  /* Anchored to the top of the frame: `center` splits the crop between top
     and bottom, which takes the tops of heads off a photograph of people.
     Trimming from the bottom instead keeps faces in. */
  background-position: center top;
  background-repeat: no-repeat;
}

/* A flat scrim, not a vignette: the type needs contrast, and a
   gradient over a photograph is decoration this page does not use. */
.min-hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.82) 0%,
    rgba(0, 0, 0, 0.5) 45%,
    rgba(0, 0, 0, 0.25) 100%
  );
}

.min-hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--min-max);
  margin: 0 auto;
  padding: 0 var(--min-gutter) clamp(3rem, 8vh, 6rem);
  text-align: left;
}

.min-hero__overline {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0 0 clamp(1rem, 2vw, 1.75rem);
  color: var(--min-accent);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.min-hero__overline::before {
  content: "";
  width: clamp(2.5rem, 6vw, 5rem);
  height: 2px;
  background: var(--min-accent);
  flex: none;
}

.min-hero__title {
  margin: 0;
  color: #fff;
  font-size: clamp(2.75rem, 9vw, 7rem);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.035em;
}

.min-hero__cta {
  display: inline-flex;
  align-items: center;
  margin-top: clamp(1.75rem, 4vw, 2.75rem);
  padding: 1rem 2.25rem;

  background: #fff;
  border: 0;
  border-radius: 0;                /* was a 9999px pill */
  color: #000;

  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background-color .15s ease;
}

.min-hero__cta:hover {
  background: var(--min-accent);
}

.min-hero__cta:focus-visible {
  outline: 2px solid var(--min-accent);
  outline-offset: 3px;
}

/* ============================================================
   List
   ============================================================ */
.min-list {
  width: 100%;
  background: var(--min-paper);
  color: var(--min-ink);
  padding: clamp(3.5rem, 8vw, 7rem) 0 clamp(3.5rem, 7vw, 6rem);
}

/* ------------------------------------------------------------
   Index — the three logos used to be the only way to jump
   between ministries. Named links say which is which.
   ------------------------------------------------------------ */
.min-index {
  max-width: var(--min-max);
  margin: 0 auto clamp(2.5rem, 5vw, 4rem);
  padding-inline: var(--min-gutter);
}

.min-index__label {
  margin: 0 0 clamp(0.85rem, 1.6vw, 1.15rem);
  color: var(--min-muted);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.min-index__items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 clamp(1.5rem, 4vw, 3.5rem);
  border-top: 2px solid var(--min-rule-strong);
  border-bottom: 1px solid var(--min-rule);
}

.min-index__link {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: clamp(0.85rem, 1.6vw, 1.15rem) 0;

  color: var(--min-ink);
  font-size: clamp(1rem, 1.3vw, 1.1875rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: color .15s ease;
}

.min-index__link:hover {
  color: var(--min-accent);
}

.min-index__link:focus-visible {
  outline: 2px solid var(--min-accent);
  outline-offset: 3px;
}

.min-index__num {
  color: var(--min-accent);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

/* ------------------------------------------------------------
   Blocks — text one side, picture the other, mirrored down the
   page. Alternation is what stops three of anything reading as
   a repeated template.
   ------------------------------------------------------------ */
.min-block {
  max-width: var(--min-max);
  margin: 0 auto;
  padding-inline: var(--min-gutter);

  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: clamp(1rem, 2vw, 2rem);
  row-gap: clamp(1.75rem, 4vw, 2.5rem);
  align-items: center;

  /* Anchored from the homepage's Plan Your Visit links, so the
     fixed header must not land on top of the heading. */
  scroll-margin-top: clamp(5rem, 12vh, 7rem);
}

.min-block + .min-block {
  margin-top: clamp(3.5rem, 7vw, 6rem);
  padding-top: clamp(3.5rem, 7vw, 6rem);
  border-top: 1px solid var(--min-rule);
}

.min-block__text {
  grid-column: 1 / span 6;
  min-width: 0;
}

.min-block__media {
  grid-column: 8 / span 5;
  min-width: 0;
}

/* Mirrored on the even blocks. DOM order is untouched, so the
   reading order stays text-then-picture for a screen reader. */
.min-block:nth-of-type(even) .min-block__text {
  grid-column: 7 / span 6;
  grid-row: 1;
}

.min-block:nth-of-type(even) .min-block__media {
  grid-column: 1 / span 5;
  grid-row: 1;
}

.min-block__overline {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0 0 clamp(1.25rem, 2.5vw, 1.75rem);
  color: var(--min-accent);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.min-block__num {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.min-block__num::after {
  content: "";
  display: inline-block;
  width: clamp(1.5rem, 3vw, 3rem);
  height: 1px;
  background: var(--min-accent);
  vertical-align: middle;
  margin-left: 0.9rem;
}

/* The three marks are wildly different shapes -- one is 2.8:1,
   two are square -- so they are pinned by height and left edge,
   which is the only way three of them line up as a set. */
.min-block__logo {
  display: block;
  height: clamp(2.75rem, 5vw, 3.75rem);
  width: auto;
  max-width: min(100%, 15rem);
  object-fit: contain;
  object-position: left center;
  margin: 0 0 clamp(1rem, 2vw, 1.5rem);
}

.min-block__heading {
  margin: 0;
  font-size: clamp(1.75rem, 3.2vw, 2.75rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--min-ink);
  text-wrap: balance;
}

.min-block__meta {
  margin: clamp(0.6rem, 1.2vw, 0.9rem) 0 0;
  padding-top: clamp(0.6rem, 1.2vw, 0.9rem);
  border-top: 1px solid var(--min-rule);
  color: var(--min-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.min-block__body {
  margin: clamp(1rem, 2vw, 1.5rem) 0 0;
  font-size: clamp(1rem, 1.15vw, 1.125rem);
  font-weight: 300;
  line-height: 1.6;
  color: var(--min-ink);
  max-width: 56ch;
}

/* The three photographs are 2:3, 2:3 and 4:5. One ratio for all
   three is what makes them a column rather than three snapshots;
   4:5 is the shallowest that does not crop the tall two hard. */
.min-block__image {
  width: 100%;
  aspect-ratio: 4 / 5;
  background-size: cover;
  /* Top-anchored for the same reason the heroes are: these are photographs
     of people, and a centred crop takes the tops of their heads off. */
  background-position: center top;
  background-repeat: no-repeat;
}

/* ============================================================
   Responsive — the grid collapses, the left edge never moves
   ============================================================ */
@media screen and (max-width: 1024px) {

  .min-block__text,
  .min-block__media,
  .min-block:nth-of-type(even) .min-block__text,
  .min-block:nth-of-type(even) .min-block__media {
    grid-column: 1 / -1;
  }

  /* Stacked, the picture leads and the words follow it. The DOM keeps text
     first, so a screen reader still reads the heading before the photograph;
     only the visual order swaps. */
  .min-block__media,
  .min-block:nth-of-type(even) .min-block__media {
    grid-row: 1;
  }

  .min-block__text,
  .min-block:nth-of-type(even) .min-block__text {
    grid-row: 2;
  }

  /* Square once it is full width: a 4:5 portrait at this size is a wall of
     photograph, and 3:2 crops these portraits too hard. */
  .min-block__image {
    aspect-ratio: 1 / 1;
  }
}

@media screen and (max-width: 620px) {

  /* Sized to its label, not stretched across the screen: the hero's
     overline, title and lead all begin on the gutter, and a button
     spanning the full measure is the only thing that would not. */
  .min-hero__cta {
    width: auto;
    align-self: flex-start;
  }

  .min-index__items {
    flex-direction: column;
    gap: 0;
  }

  .min-index__items li + li {
    border-top: 1px solid var(--min-rule);
  }

  .min-block__body {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {

  .min-hero__cta,
  .min-index__link {
    transition: none;
  }
}
