/* ============================================================
   FAITH IN ACTION — Philippines mission photo gallery
   Homepage, directly above the More Than Meals October 2026 update.
   Desktop: portrait | story | horseback spotlight, then the banner
   photo full width over three rebuild photos, then the flyer card.
   Tablet/phone: the two spotlight photos side by side over the story,
   rebuild photos in two columns.
============================================================ */
.pmg {
  --pmg-navy:      #0d2a4e;
  --pmg-navy-deep: #081d38;
  --pmg-gold:      #ffc93c;
  --pmg-gold-dk:   #d9a521;
  --pmg-red:       #dc2626;
  --pmg-text:      #334155;

  position: relative;
  padding: 88px 0 80px;
  background:
    radial-gradient(ellipse at 8% 0%, rgba(255,201,60,.18) 0%, rgba(255,201,60,0) 50%),
    linear-gradient(180deg, #ffffff 0%, #f6f8fc 100%);
  font-family: 'Inter', sans-serif;
  color: var(--pmg-text);
}
.pmg *,
.pmg *::before,
.pmg *::after { box-sizing: border-box; }

.pmg-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ─────────────────────────────────────────── */
.pmg-header { text-align: center; margin-bottom: 44px; }
.pmg-kicker {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(13,42,78,.07);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--pmg-navy);
}
.pmg-title {
  margin: 0 0 16px;
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 4.2vw, 3rem);
  font-weight: 800;
  line-height: 1.12;
  color: var(--pmg-navy);
}
.pmg-title span {
  background: linear-gradient(transparent 62%, rgba(255,201,60,.55) 62%);
  padding: 0 .1em;
}
.pmg-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 28px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .98rem;
  font-weight: 700;
  color: var(--pmg-navy);
}
.pmg-meta li { display: inline-flex; align-items: center; gap: 8px; }
.pmg-meta li:first-child svg { color: var(--pmg-red); }
.pmg-meta svg { flex-shrink: 0; }

/* ── Photo tiles (shared) ───────────────────────────── */
.pmg-item { margin: 0; }
.pmg-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #e8edf5;
  cursor: zoom-in;
  font: inherit;
}
.pmg-item .pmg-open {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(13,42,78,.14);
  outline: 1px solid rgba(13,42,78,.06);
}
.pmg-item .pmg-open::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 3px rgba(255,201,60,0);
  transition: box-shadow .25s ease;
}
.pmg-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.pmg-open:hover img { transform: scale(1.035); }
.pmg-open:hover::after,
.pmg-open:focus-visible::after { box-shadow: inset 0 0 0 3px var(--pmg-gold); }
.pmg-open:focus-visible { outline: 3px solid var(--pmg-gold); outline-offset: 3px; }
.pmg-item figcaption {
  margin-top: 10px;
  font-size: .9rem;
  line-height: 1.5;
  color: #475569;
}

/* ── Spotlight: Pastor Buico · story · horseback ─────── */
.pmg-spotlight {
  display: grid;
  grid-template-columns: minmax(0, 290px) minmax(0, 1fr) minmax(0, 290px);
  grid-template-areas: "pastor story horseback";
  gap: 36px;
  align-items: center;
  margin-bottom: 56px;
}
.pmg-item--pastor    { grid-area: pastor; position: relative; }
.pmg-item--horseback { grid-area: horseback; }
.pmg-story           { grid-area: story; }

.pmg-item--pastor .pmg-open    { aspect-ratio: 306 / 428; background: #ffffff; }
.pmg-item--pastor img          { object-position: 50% 0; }
.pmg-item--horseback .pmg-open { aspect-ratio: 228 / 340; }

.pmg-nameplate {
  position: relative;
  z-index: 1;
  margin: -34px 14px 0 !important;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--pmg-navy) 0%, var(--pmg-navy-deep) 100%);
  border: 2px solid var(--pmg-gold);
  text-align: center;
  box-shadow: 0 12px 26px rgba(13,42,78,.28);
}
.pmg-nameplate strong {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
}
.pmg-nameplate span {
  display: block;
  margin-top: 2px;
  font-size: .82rem;
  font-weight: 700;
  color: var(--pmg-gold);
}

.pmg-story-lead {
  margin: 0 0 12px;
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--pmg-navy);
}
.pmg-story p:not(.pmg-story-lead) {
  margin: 0 0 22px;
  font-size: 1.02rem;
  line-height: 1.75;
}
.pmg-pillars {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pmg-pillars li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  background: #ffffff;
  border-left: 4px solid var(--pmg-gold);
  box-shadow: 0 6px 16px rgba(13,42,78,.07);
  font-weight: 700;
  color: var(--pmg-navy);
}
.pmg-pillars svg { flex-shrink: 0; color: var(--pmg-navy); }

/* ── Grid: banner feature + three rebuild photos ─────── */
.pmg-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 20px;
  max-width: 960px;
  margin: 0 auto 48px;
}
.pmg-item--banner { grid-column: 1 / -1; }
.pmg-item--banner .pmg-open { aspect-ratio: 578 / 254; }
.pmg-item--banner figcaption {
  text-align: center;
  font-size: .98rem;
  font-weight: 600;
  color: var(--pmg-navy);
}
.pmg-item--frame .pmg-open,
.pmg-item--sanctuary .pmg-open,
.pmg-item--roof .pmg-open { aspect-ratio: 16 / 9.6; }

/* ── Flyer card ─────────────────────────────────────── */
.pmg-flyer {
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: 960px;
  margin: 0 auto;
  padding: 18px 28px 18px 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--pmg-navy) 0%, var(--pmg-navy-deep) 100%);
  box-shadow: 0 20px 44px rgba(13,42,78,.24);
  text-align: left;
  transition: transform .25s ease, box-shadow .25s ease;
}
.pmg-flyer:hover { transform: translateY(-3px); box-shadow: 0 26px 52px rgba(13,42,78,.3); }
.pmg-flyer img {
  flex-shrink: 0;
  width: 132px;
  height: auto;
  border-radius: 10px;
  border: 3px solid var(--pmg-gold);
}
.pmg-flyer-copy { display: flex; flex-direction: column; gap: 6px; }
.pmg-flyer-copy strong {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-weight: 800;
  color: var(--pmg-gold);
}
.pmg-flyer-copy span { font-size: 1rem; line-height: 1.6; color: rgba(255,255,255,.88); }
.pmg-flyer-copy em {
  margin-top: 4px;
  font-style: normal;
  font-weight: 800;
  font-size: .92rem;
  letter-spacing: .03em;
  color: #ffffff;
}

/* ── Lightbox ───────────────────────────────────────── */
.pmg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 72px;
  opacity: 0;
  transition: opacity .25s ease;
}
.pmg-lightbox[hidden] { display: none; }
.pmg-lightbox.open { opacity: 1; }
.pmg-lightbox-backdrop { position: absolute; inset: 0; background: rgba(5,14,30,.92); }
.pmg-lightbox-box {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
}
.pmg-lightbox-box img {
  display: block;
  max-width: min(100%, 1100px);
  max-height: calc(100vh - 170px);
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.pmg-lightbox-box figcaption {
  display: flex;
  gap: 16px;
  align-items: baseline;
  justify-content: center;
  max-width: 720px;
  text-align: center;
  color: #ffffff;
  font-size: .98rem;
  line-height: 1.5;
}
.pmg-lightbox-count { flex-shrink: 0; color: var(--pmg-gold); font-weight: 700; font-size: .85rem; }
.pmg-lightbox-close,
.pmg-lightbox-nav {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #ffffff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: background .2s ease;
}
.pmg-lightbox-close:hover,
.pmg-lightbox-nav:hover { background: rgba(255,201,60,.9); color: var(--pmg-navy); }
.pmg-lightbox-close { top: 16px; right: 16px; }
.pmg-lightbox-nav { top: 50%; transform: translateY(-50%); font-size: 2.4rem; padding-bottom: 4px; }
.pmg-lightbox-prev { left: 14px; }
.pmg-lightbox-next { right: 14px; }

/* ── Tablet ─────────────────────────────────────────── */
@media (max-width: 960px) {
  .pmg-spotlight {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "pastor horseback"
      "story  story";
    gap: 32px 20px;
    align-items: start;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
  }
  .pmg-item--horseback .pmg-open { aspect-ratio: 306 / 428; }
}

/* ── Phone ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .pmg { padding: 56px 0 52px; }
  .pmg-inner { padding: 0 16px; }
  .pmg-header { margin-bottom: 32px; }
  .pmg-meta { flex-direction: column; align-items: center; gap: 8px; font-size: .92rem; }
  .pmg-spotlight { gap: 26px 12px; margin-bottom: 40px; }
  .pmg-item .pmg-open { border-radius: 12px; }
  .pmg-item figcaption { font-size: .84rem; }
  .pmg-nameplate { margin: -26px 6px 0 !important; padding: 9px 8px; }
  .pmg-nameplate strong { font-size: .86rem; }
  .pmg-nameplate span { font-size: .74rem; }
  .pmg-story p:not(.pmg-story-lead) { font-size: 1rem; line-height: 1.7; }
  .pmg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; margin-bottom: 36px; }
  .pmg-item--roof { grid-column: 1 / -1; }
  .pmg-item--roof .pmg-open { aspect-ratio: 360 / 200; }
  .pmg-flyer { flex-direction: column; align-items: center; gap: 16px; padding: 20px 18px 22px; text-align: center; }
  .pmg-flyer img { width: min(100%, 300px); }
  .pmg-lightbox { padding: 64px 12px 84px; }
  .pmg-lightbox-box img { max-height: calc(100vh - 190px); }
  .pmg-lightbox-box figcaption { flex-direction: column; gap: 4px; align-items: center; font-size: .9rem; }
  .pmg-lightbox-nav { top: auto; bottom: 18px; transform: none; width: 44px; height: 44px; }
  .pmg-lightbox-prev { left: calc(50% - 56px); }
  .pmg-lightbox-next { right: calc(50% - 56px); }
}

@media (prefers-reduced-motion: reduce) {
  .pmg-item img,
  .pmg-flyer,
  .pmg-lightbox { transition: none; }
  .pmg-open:hover img { transform: none; }
}
