:root {
  color-scheme: light;
  --cream: #f9f7f1;
  --navy: #062653;
  --blue: #0866f5;
  --red: #f91d2d;
  --green: #008e56;
  --orange: #d96b00;
  --white: #fff;
  --border: #d1def0;
  --muted: #6c809d;
  --shadow: 0 3px 14px rgb(6 38 83 / 11%);
}

* { box-sizing: border-box; }
html { min-width: 0; background: var(--cream); }
body {
  margin: 0;
  color: var(--navy);
  background: var(--cream);
  font-family: "Segoe UI", Arial, sans-serif;
}
button { font: inherit; }
.page { width: min(100%, 560px); min-height: 100svh; margin-inline: auto; }

/* Only the hero layers use absolute positioning; all content follows flow. */
.hero {
  position: relative;
  isolation: isolate;
  aspect-ratio: 360 / 354;
  overflow: hidden;
  background: #198ef0;
}
/* The lower wave is a proportional crop of the same original background. */
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 50.282%;
  left: -100%;
  width: 200%;
  aspect-ratio: 2;
  background: url("/andres/background.png") center / cover no-repeat;
  clip-path: polygon(50% 35%, 71% 35%, 71% 100%, 50% 100%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  top: 49%;
  width: 100%;
  height: 12%;
  background: linear-gradient(transparent, rgb(205 229 247 / 44%) 33%, transparent);
  pointer-events: none;
}
.hero-background { display: block; width: 100%; height: auto; }
.portrait {
  position: absolute;
  z-index: 1;
  top: 23.729%;
  left: 41.667%;
  width: 62.222%;
  height: auto;
}
.identity {
  position: absolute;
  z-index: 2;
  top: 48.023%;
  left: -1.667%;
  width: 50%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.identity img { display: block; width: 100%; height: auto; }
.identity .list-logo { width: 83.333%; margin-top: -5%; margin-left: 2.222%; }
.hero-curve {
  position: absolute;
  z-index: 3;
  inset: auto 0 -1px;
  width: 100%;
  height: auto;
  fill: var(--cream);
  pointer-events: none;
}

.content { position: relative; margin-top: -18px; padding: 0 22px 74px; }
.slogan {
  margin: 0;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 32px;
  font-weight: 800;
  line-height: 32px;
  overflow-wrap: anywhere;
}
.slogan span { display: block; }
.slogan .victory { color: var(--blue); font-size: 35px; }
.slogan::after {
  content: "";
  display: block;
  width: 74px;
  height: 4px;
  margin-top: 24px;
  border-radius: 2px;
  background: var(--red);
}
.access-list {
  display: grid;
  gap: 10px;
  margin: 46px -2px 0;
  padding: 0;
  list-style: none;
}
.access {
  --accent: var(--blue);
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 17px;
  color: var(--navy);
  background: var(--white);
  box-shadow: var(--shadow);
  text-align: left;
  font: inherit;
  text-decoration: none;
  touch-action: manipulation;
}
.access--home { --accent: var(--red); }
.access--ia { --accent: var(--green); }
.access--report { --accent: var(--orange); }
.access:focus-visible { outline: 3px solid var(--navy); outline-offset: 3px; }
.access-icon {
  display: grid;
  flex: 0 0 35px;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--accent);
}
.access-icon svg { width: 22px; height: 22px; }
.access-label { min-width: 0; font-size: 14.5px; font-weight: 600; line-height: 20px; }
.access-arrow { flex: 0 0 20px; width: 20px; height: 20px; margin-left: auto; margin-right: 3px; color: var(--accent); }
.footer { margin-top: 48px; color: var(--muted); font-size: 12px; line-height: 16px; text-align: center; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 339px) {
  .content { padding-inline: 18px; }
  .access { gap: 9px; }
  .access-label { font-size: 13px; }
}
@media (min-width: 768px) {
  .page { width: min(calc(100% - 64px), 1440px); }
  .hero { aspect-ratio: 8 / 5; }
  .hero::before { content: none; }
  .hero::after { top: 75%; }
  .portrait { top: 16%; left: 50%; width: 46%; }
  .identity { top: 36%; left: 3%; width: 38%; }
  .content {
    display: grid;
    grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    column-gap: 32px;
    row-gap: 36px;
    margin-top: 0;
    padding: 24px 28px 44px;
  }
  .slogan { grid-column: 1; grid-row: 1; align-self: center; font-size: clamp(40px, 5.5vw, 56px); line-height: 1.05; }
  .slogan .victory { font-size: clamp(44px, 6vw, 60px); }
  .slogan::after { width: 96px; margin-top: 28px; }
  .access-list { grid-column: 2; grid-row: 1; gap: 14px; margin: 0; min-width: 0; }
  .access { min-height: 68px; gap: 14px; padding: 12px; border-radius: 19px; }
  .access-icon { flex-basis: 42px; width: 42px; height: 42px; }
  .access-icon svg { width: 26px; height: 26px; }
  .access-label { font-size: clamp(16px, 1.8vw, 18px); line-height: 24px; }
  .footer { grid-column: 1 / -1; margin-top: 0; font-size: 13px; line-height: 20px; }
}
@media (min-width: 1200px) {
  .page {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
    align-items: center;
    gap: clamp(32px, 4vw, 80px);
    width: min(calc(100% - 80px), 1440px);
    padding-block: 40px;
  }
  .hero { aspect-ratio: 360 / 354; }
  .hero::before { content: ""; top: 50.282%; }
  .hero::after { top: 49%; }
  .portrait { top: 23.729%; left: 41.667%; width: 62.222%; }
  .identity { top: 48.023%; left: -1.667%; width: 50%; }
  .content { display: flex; flex-direction: column; gap: 0; padding: 0; min-width: 0; }
  .slogan { align-self: stretch; font-size: clamp(56px, 4.5vw, 76px); }
  .slogan .victory { font-size: clamp(60px, 4.8vw, 80px); }
  .slogan::after { width: 112px; height: 5px; }
  .access-list { gap: 16px; margin-top: 36px; }
  .access { min-height: 80px; gap: 16px; padding: 14px 18px; border-radius: 20px; }
  .access-icon { flex-basis: 48px; width: 48px; height: 48px; }
  .access-icon svg { width: 28px; height: 28px; }
  .access-label { font-size: 18px; line-height: 26px; }
  .access-arrow { flex-basis: 24px; width: 24px; height: 24px; }
  .footer { margin-top: 36px; }
}

/* Only the parish list adapts to eight options; the home layout stays intact. */
@media (max-width: 767px) {
  .page--parishes .content { z-index: 1; }
}
@media (min-width: 768px) and (max-width: 1199px) {
  .page--parishes .slogan { align-self: start; }
  .parish-heading { grid-column: 1; grid-row: 1; min-width: 0; }
}
@media (min-width: 1200px) {
  .page--parishes .access-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page--parishes .access { gap: 12px; padding: 12px; }
  .page--parishes .access-icon { flex-basis: 35px; width: 35px; height: 35px; }
  .page--parishes .access-icon svg { width: 22px; height: 22px; }
  .page--parishes .access-label { font-size: 16px; line-height: 24px; }
  .page--parishes .access-arrow { flex-basis: 20px; width: 20px; height: 20px; }
}

/* Global navigation overlays the viewport without participating in page flow. */
html { scroll-padding-top: calc(64px + env(safe-area-inset-top, 0px)); }
.site-header {
  position: fixed;
  z-index: 10;
  inset: 0 0 auto;
  padding-top: env(safe-area-inset-top, 0px);
  color: var(--white);
  background-color: transparent;
  transition: background-color 120ms ease;
}
.site-header.is-scrolled { background-color: rgb(6 38 83 / 88%); }
.site-nav {
  position: relative;
  --nav-inset: 20px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
  width: min(100%, 560px);
  min-height: 56px;
  margin-inline: auto;
  padding: 6px 20px;
}
.site-nav__title {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.22;
  text-align: center;
  overflow-wrap: anywhere;
  -webkit-text-stroke: 2px var(--navy);
  paint-order: stroke fill;
}
.site-nav__control {
  display: grid;
  width: 44px;
  min-height: 44px;
  place-items: center;
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  touch-action: manipulation;
}
.site-nav__control:first-child { grid-column: 1; grid-row: 1; }
.site-nav__control:last-child { grid-column: 3; grid-row: 1; }
.site-nav__menu { appearance: none; grid-column: 3; grid-row: 1; padding: 0; border: 0; background: transparent; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
/* Transparent pointer barrier; panel and toggle remain above it. */
.site-nav__backdrop { position: fixed; z-index: 0; inset: 0; background: transparent; pointer-events: auto; }
.site-nav__backdrop[hidden] { display: none; }
.site-nav__menu { position: relative; z-index: 1; }
.site-nav__popover {
  position: absolute;
  z-index: 1;
  top: calc(100% + 8px);
  right: var(--nav-inset);
  width: min(352px, calc(100% - 2 * var(--nav-inset)));
  max-height: calc(100dvh - 80px - env(safe-area-inset-top, 0px));
  padding: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--cream);
  color: var(--navy);
  box-shadow: var(--shadow);
}
.site-nav__popover[hidden] { display: none; }
.site-nav__links { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.site-nav__links a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 12px;
  border-radius: 12px;
  color: var(--navy);
  font-size: 16px;
  line-height: 1.5;
  text-decoration: none;
  overflow-wrap: anywhere;
  touch-action: manipulation;
}
.site-nav__links a:hover,
.site-nav__links a:focus-visible { background: color-mix(in srgb, var(--blue) 10%, var(--cream)); }
.site-nav__links a:focus-visible { outline: 3px solid var(--navy); outline-offset: -3px; }
.site-nav__control svg { width: 24px; height: 24px; }
.site-nav__icon-outline { stroke: var(--navy); stroke-width: 3.6; }
.site-nav__icon-stroke { stroke: currentColor; stroke-width: 1.6; }
.site-nav__control:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--navy);
}
@media (max-width: 339px) {
  .site-nav { --nav-inset: 16px; padding-inline: 16px; }
}
@media (min-width: 768px) {
  .site-nav { --nav-inset: 28px; width: min(calc(100% - 64px), 1440px); padding-inline: 28px; }
}
@media (min-width: 1200px) {
  .site-nav { --nav-inset: 20px; width: min(calc(100% - 80px), 1440px); padding-inline: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .site-header { transition: none; }
}
/* D14-F3: approved Tablet block from D14-F2 (S2-01 / 02 / 03 / 04 / 05).
   Isolated to 768-1199px; hero limit applies only in landscape. */
@media (min-width: 768px) and (max-width: 1199px) {
  body > main.page .slogan--v2 {
    height: 0;
    overflow: hidden;
  }

  body > main.page:not([class*="page--"]) > .content,
  body > main.page.page--ia-machala:not(.page--housing) > .content {
    display: block;
  }

  body > main.page:not([class*="page--"]) > .content > .access-list,
  body > main.page.page--ia-machala:not(.page--housing) > .content > .access-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
  }

  body > main.page:not([class*="page--"]) > .content > .footer,
  body > main.page.page--ia-machala:not(.page--housing) > .content > .footer {
    margin-top: 36px;
  }

  body > main.page.page--ia-machala:not(.page--housing) > .content > .access-list {
    margin-top: 36px;
  }

  body > main.page.page--housing.page--ia-machala .housing-form {
    align-items: start;
  }
}

@media (min-width: 768px) and (max-width: 1199px) and (orientation: landscape) {
  body > main.page > .hero--v2 {
    width: 100%;
    max-height: 60svh;
  }
}
