/* Content pages below the hero: About, Our Story, Places, Village Administration, Gallery, Community.
   One calm system: ivory / deep-ivory bands, gold-underlined headings, cards with a short accent tab, gold badges. */

.pg-sec { padding-block: var(--sp-8); }
.pg-alt { background: var(--ivory-deep); }
@media (max-width: 640px) { .pg-sec { padding-block: var(--sp-7); } }

/* section headings (the site hides eyebrows on standalone pages, so the heading carries a gold underline) */
.pg-head { max-width: 720px; margin-bottom: var(--sp-6); }
.pg-head.center { margin-inline: auto; text-align: center; }
.pg-head h2 { font-size: var(--h2); line-height: var(--lh-tight); color: var(--color-primary); }
.pg-head h2::after { content: ""; display: block; width: 56px; height: 4px; margin-top: var(--sp-3); border-radius: 4px; background: linear-gradient(90deg, var(--color-accent), var(--color-secondary)); }
.pg-head.center h2::after { margin-inline: auto; }
.pg-head p { margin-top: var(--sp-4); font-size: var(--lead); line-height: var(--lh-prose); color: var(--color-muted); }

/* cards: white, rounded, soft shadow, a short accent tab inside the top edge */
.pg-grid { display: grid; gap: var(--sp-5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .pg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .pg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .pg-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pg-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pg-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-3); min-width: 0; padding: var(--sp-6) var(--sp-5) var(--sp-5); background-color: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-xl); box-shadow: var(--shadow); color: var(--color-text); text-decoration: none; background-image: linear-gradient(var(--tab, var(--color-accent)), var(--tab, var(--color-accent))); background-repeat: no-repeat; background-size: 56px 4px; background-position: var(--sp-5) 0; }
.pg-card:nth-child(3n+2) { --tab: var(--color-secondary); }
.pg-card:nth-child(3n) { --tab: var(--green-700); }
.pg-card h3 { font-size: var(--h4); line-height: var(--lh-tight); color: var(--color-primary); overflow-wrap: anywhere; }
.pg-card p { font-size: var(--small); line-height: var(--lh-prose); color: var(--color-muted); }
.pg-card .pg-go { margin-top: auto; padding-top: var(--sp-2); display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--small); font-weight: 700; color: var(--color-secondary); }
a.pg-card .pg-go .btn-ic { transition: transform var(--dur) var(--ease); }
a.pg-card:hover .pg-go .btn-ic { transform: translateX(4px); }
.pg-ic { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--grad-warm); color: #fff; box-shadow: 0 6px 16px rgba(168,81,45,.28), inset 0 0 0 1px rgba(255,255,255,.35); }
.pg-ic .btn-ic { width: 24px; height: 24px; }

/* stat tiles */
.pg-stats { display: grid; gap: var(--sp-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 860px) { .pg-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pg-stat { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-5); border-radius: var(--radius-xl); color: #fff; background: radial-gradient(circle at 90% 0%, rgba(217,164,65,.28), transparent 55%), var(--grad-primary); border-left: 4px solid var(--color-accent); box-shadow: var(--shadow); }
.pg-stat strong { font-size: var(--h2); line-height: var(--lh-tight); }
.pg-stat span { font-size: var(--small); color: rgba(255,255,255,.85); }

/* image and text side by side */
.pg-split { display: grid; gap: var(--sp-6); align-items: center; }
@media (min-width: 960px) { .pg-split { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--sp-8); } .pg-split--flip > :first-child { order: 2; } }
.pg-art { border-radius: var(--radius-xl); padding: var(--sp-4); background: radial-gradient(circle at 80% 10%, rgba(217,164,65,.22), transparent 55%), var(--grad-soft); border: 1px solid var(--color-border); box-shadow: var(--shadow); }
.pg-art img { display: block; width: 100%; height: auto; filter: drop-shadow(0 14px 18px rgba(27,77,58,.28)); }
.pg-text p { font-size: var(--body); line-height: var(--lh-prose); color: var(--color-text); }
.pg-text p + p { margin-top: var(--sp-4); }
.pg-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin-top: var(--sp-6); }
@media (max-width: 640px) { .pg-actions .btn { width: 100%; } }

/* facts and chips */
.pg-facts { display: grid; gap: var(--sp-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .pg-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pg-facts div { padding: var(--sp-4); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); }
.pg-facts dt { font-size: var(--xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--color-muted); }
.pg-facts dd { margin: 4px 0 0; font-size: var(--body); font-weight: 700; color: var(--color-primary); }
.pg-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.pg-chips li, .pg-chips a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: var(--color-surface); border: 1px solid var(--color-border); color: var(--color-primary); font-size: var(--small); font-weight: 600; text-decoration: none; }
.pg-chips li .btn-ic, .pg-chips a .btn-ic { color: var(--color-secondary); }
.pg-chips a:hover { border-color: var(--color-primary); background: var(--green-50); }
.pg-sub { margin: var(--sp-6) 0 var(--sp-3); font-size: var(--h4); color: var(--color-primary); }
.pg-note { margin-top: var(--sp-5); font-size: var(--small); color: var(--color-muted); }

/* timeline */
.pg-timeline { position: relative; display: grid; gap: var(--sp-5); max-width: 860px; margin-inline: auto; padding-left: var(--sp-7); }
.pg-timeline::before { content: ""; position: absolute; left: 14px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: linear-gradient(180deg, var(--color-accent), var(--color-secondary)); opacity: .55; }
.pg-tl { position: relative; padding: var(--sp-5); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-xl); box-shadow: var(--shadow); }
.pg-tl::before { content: ""; position: absolute; left: calc(-1 * var(--sp-7) + 6px); top: 24px; width: 18px; height: 18px; border-radius: 50%; background: var(--color-accent); border: 4px solid var(--color-background); box-shadow: 0 0 0 2px var(--color-accent); }
.pg-tl--open { border-style: dashed; background: var(--color-background); }
.pg-tl--open::before { background: var(--color-background); }
.pg-year { display: inline-block; padding: 3px 14px; margin-bottom: var(--sp-3); border-radius: 999px; background: var(--color-primary); color: #fff; font-size: var(--small); font-weight: 700; }
.pg-tl h3 { font-size: var(--h4); color: var(--color-primary); }
.pg-tl p { margin-top: var(--sp-2); font-size: var(--body); line-height: var(--lh-prose); color: var(--color-text); }
@media (max-width: 560px) { .pg-timeline { padding-left: var(--sp-6); } .pg-tl::before { left: calc(-1 * var(--sp-6) + 6px); } .pg-timeline::before { left: 11px; } }

/* places */
.pg-pl-card { padding: 0; overflow: hidden; background-image: none; }
.pg-pl-img { position: relative; width: 100%; aspect-ratio: 16 / 10; background: var(--green-50); display: grid; place-items: center; color: var(--green-700); overflow: hidden; }
.pg-pl-img img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; display: block; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.pg-pl-card:hover .pg-pl-img img { transform: scale(1.05); }
.pg-pl-img .btn-ic { width: 44px; height: 44px; opacity: .6; }
.pg-badge { position: absolute; left: var(--sp-3); top: var(--sp-3); padding: 3px 12px; border-radius: 999px; background: var(--color-primary); color: #fff; font-size: var(--xs); font-weight: 700; }
.pg-pl-body { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-5); width: 100%; }
.pg-loc { display: flex; align-items: center; gap: 6px; font-size: var(--xs); font-weight: 600; color: var(--color-secondary); }
.pg-map { border-radius: var(--radius-xl); overflow: hidden; border: 1px solid var(--color-border); box-shadow: var(--shadow); background: var(--color-surface); }
.pg-map iframe { display: block; width: 100%; height: clamp(280px, 40vw, 420px); border: 0; }
.pg-legend { display: grid; gap: var(--sp-2); margin-top: var(--sp-4); font-size: var(--small); }
.pg-legend li { display: flex; align-items: center; gap: var(--sp-3); }
.pg-legend i { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--d, var(--color-accent)); box-shadow: 0 0 0 3px rgba(26,34,30,.08); }

/* village administration */
.pg-person { align-items: center; text-align: center; }
.pg-photo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; background: var(--green-50); color: var(--green-700); }
.pg-role { color: var(--color-secondary); font-size: var(--small); font-weight: 700; }
.pg-call { display: inline-flex; align-items: center; gap: var(--sp-2); padding: 8px 16px; min-height: 40px; border-radius: 999px; background: var(--green-50); color: var(--color-primary); font-weight: 700; font-size: var(--small); text-decoration: none; }
.pg-call:hover { background: var(--green-100); }
.pg-sos { display: grid; gap: var(--sp-4); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 860px) { .pg-sos { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pg-sos a { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-5); border-radius: var(--radius-xl); color: #fff; text-decoration: none; background: radial-gradient(circle at 90% 0%, rgba(217,164,65,.28), transparent 55%), var(--grad-primary); box-shadow: var(--shadow); }
.pg-sos a .btn-ic { color: var(--gold-light); margin-bottom: var(--sp-1); }
.pg-sos strong { font-size: var(--h3); line-height: var(--lh-tight); }
.pg-sos span { font-size: var(--small); color: rgba(255,255,255,.88); }
.pg-table-wrap { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-xl); box-shadow: var(--shadow); overflow: hidden; }
.pg-table { width: 100%; border-collapse: collapse; font-size: var(--small); }
.pg-table th { text-align: left; background: var(--green-50); color: var(--color-primary); padding: var(--sp-3) var(--sp-5); }
.pg-table td { padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--color-border); vertical-align: middle; }
.pg-table .pg-photo { width: 44px; height: 44px; }
@media (max-width: 640px) {
  .pg-table thead { display: none; }
  .pg-table tr { display: block; padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--color-border); }
  .pg-table tr:first-child { border-top: 0; }
  .pg-table td { display: flex; justify-content: space-between; gap: var(--sp-4); border: 0; padding: var(--sp-1) 0; }
  .pg-table td::before { content: attr(data-label); color: var(--color-muted); font-weight: 600; }
  .pg-table td.pg-td-photo::before { content: none; }
}
.pg-info { display: flex; align-items: flex-start; gap: var(--sp-4); padding: var(--sp-5); background: #FBF0D7; border-left: 4px solid var(--color-accent); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; color: #5C4510; font-size: var(--body); line-height: var(--lh-prose); }
.pg-info .btn-ic { flex: none; margin-top: 3px; color: var(--color-secondary); }

/* community */
.pg-story .pg-photo { width: 100%; height: auto; aspect-ratio: 16 / 10; border-radius: var(--radius-lg); }
.pg-quote { font-style: italic; }
.pg-strip { display: grid; gap: var(--sp-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .pg-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .pg-strip { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.pg-strip a { display: block; aspect-ratio: 1; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.pg-strip img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.pg-strip a:hover img { transform: scale(1.07); }
.pg-more { margin-top: var(--sp-6); display: flex; flex-wrap: wrap; gap: var(--sp-3); }
@media (max-width: 640px) { .pg-more .btn { width: 100%; } }

.pg-cta .container > * { max-width: 760px; margin-inline: auto; }
@media (prefers-reduced-motion: no-preference) { .pg-card { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); } a.pg-card:hover, .pg-pl-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift, 0 12px 32px rgba(26,34,30,.14)); } .pg-art img { transition: transform .6s cubic-bezier(.2,.7,.2,1); } .pg-art:hover img { transform: scale(1.03) translateY(-3px); } }

/* chips that wrap a link: one outline, not two */
.pg-chips li:has(> a) { padding: 0; border: 0; background: none; }
.pg-grid--2 { align-items: start; }

/* the homepage gives #people and #map their own backgrounds; on these pages the section classes decide */
body:not(.home) main.pg-page #people, body:not(.home) main.pg-page #map { background: none; }
body:not(.home) main.pg-page #people.pg-alt, body:not(.home) main.pg-page #map.pg-alt { background: var(--ivory-deep); }

/* leadership: photo cards that open a profile */
.pg-lead-grid { display: grid; gap: var(--sp-5); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .pg-lead-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .pg-lead-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pg-lead { min-width: 0; }
.pg-lead-card { display: flex; flex-direction: column; width: 100%; height: 100%; padding: 0; overflow: hidden; text-align: left; font: inherit; color: inherit; cursor: pointer; background-color: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-xl); box-shadow: var(--shadow); }
.pg-lead-card.is-empty { cursor: default; }
.pg-lead-photo { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: radial-gradient(circle at 80% 10%, rgba(217,164,65,.28), transparent 55%), var(--green-50); border-bottom: 4px solid var(--color-accent); }
.pg-lead-img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.pg-lead-ph { display: grid; place-items: center; color: var(--green-700); opacity: .65; }
.pg-lead-card:hover .pg-lead-img { transform: scale(1.05); }
.pg-lead-info { display: flex; flex-direction: column; gap: 4px; padding: var(--sp-5); }
.pg-lead-info strong { font-size: var(--h4); line-height: var(--lh-tight); color: var(--color-primary); }
.pg-lead-info .pg-role { font-size: var(--small); }
.pg-lead-info .pg-go { margin-top: var(--sp-2); display: inline-flex; align-items: center; gap: var(--sp-2); font-size: var(--small); font-weight: 700; color: var(--color-secondary); }
.pg-lead-info .pg-go .btn-ic { transition: transform var(--dur) var(--ease); }
.pg-lead-card:hover .pg-go .btn-ic { transform: translateX(4px); }
.pg-soon { color: var(--color-muted) !important; font-size: var(--body) !important; font-weight: 600; }
.pg-lead-card:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 3px; }

/* profile pop-up */
.pg-modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: var(--sp-4); background: rgba(15,42,33,0); overscroll-behavior: contain; transition: background .3s ease; }
.pg-modal[hidden] { display: none; }
.pg-modal.is-open { background: rgba(15,42,33,.62); }
.pg-m-box { position: relative; width: min(520px, 100%); max-height: calc(100svh - 2 * var(--sp-4)); overflow-y: auto; padding: var(--sp-7) var(--sp-6) var(--sp-6); text-align: center; background: var(--color-surface); border-radius: var(--radius-xl); border-top: 4px solid var(--color-accent); box-shadow: 0 24px 60px rgba(0,0,0,.35); opacity: 0; transform: translateY(18px) scale(.97); transition: opacity .3s ease, transform .35s cubic-bezier(.2,.7,.2,1); }
.pg-modal.is-open .pg-m-box { opacity: 1; transform: none; }
.pg-m-x { position: absolute; top: var(--sp-3); right: var(--sp-3); width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--color-border); background: var(--green-50); color: var(--color-primary); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.pg-m-x:hover { background: var(--green-100); }
.pg-p-photo { width: 160px; height: 160px; margin: 0 auto var(--sp-4); border-radius: 50%; overflow: hidden; border: 4px solid var(--color-accent); box-shadow: 0 8px 22px rgba(27,77,58,.25); background: var(--green-50); }
.pg-p-photo .pg-lead-img { width: 100%; height: 100%; }
.pg-p-name { font-size: var(--h3); line-height: var(--lh-tight); color: var(--color-primary); }
.pg-p-role { margin-top: var(--sp-2); display: inline-block; padding: 3px 14px; border-radius: 999px; background: #FBEFE6; color: #7E3F20; font-size: var(--small); font-weight: 700; }
.pg-p-bio { margin: var(--sp-4) 0 var(--sp-5); text-align: left; font-size: var(--body); line-height: var(--lh-prose); color: var(--color-text); white-space: pre-line; }
.pg-m-box .pg-call { margin-top: var(--sp-4); }
html.pg-lock { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .pg-modal, .pg-m-box { transition: none; } }

/* closing green band on the content pages: the arch takes the colour of the section above it (ivory, or deeper ivory after an alternate band) */
.pg-cta::before { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 56' preserveAspectRatio='none'%3E%3Cpath d='M0 0H1440V16C1080 54 360 54 0 16Z' fill='%23F8F5EC'/%3E%3Cpath d='M0 16C360 54 1080 54 1440 16' fill='none' stroke='%23D9A441' stroke-width='2' vector-effect='non-scaling-stroke'/%3E%3Cpath d='M0 24C360 62 1080 62 1440 24' fill='none' stroke='%23D9A441' stroke-opacity='.45' stroke-width='1' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.pg-alt + .pg-cta::before { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 56' preserveAspectRatio='none'%3E%3Cpath d='M0 0H1440V16C1080 54 360 54 0 16Z' fill='%23EFEBDD'/%3E%3Cpath d='M0 16C360 54 1080 54 1440 16' fill='none' stroke='%23D9A441' stroke-width='2' vector-effect='non-scaling-stroke'/%3E%3Cpath d='M0 24C360 62 1080 62 1440 24' fill='none' stroke='%23D9A441' stroke-opacity='.45' stroke-width='1' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }

/* the first section keeps the hero's rounded ivory sheet (#people was losing it) and gets a little more air below the hero */
body:not(.home) main.pg-page #people:first-child { background-color: var(--color-background); background-image: var(--pat-grid); }
body:not(.home) .ph-hero + main.pg-page > :first-child { padding-top: var(--sp-8); }
@media (max-width: 640px) { body:not(.home) .ph-hero + main.pg-page > :first-child { padding-top: var(--sp-7); } }

/* ward member profile: opens under the card, no pop-up (name, role and photo are already on the card) */
.pg-lead { display: flex; flex-direction: column; }
.pg-profile { margin-top: var(--sp-2); padding: var(--sp-4); border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); text-align: left; }
.pg-profile[hidden] { display: none; }
.pg-profile .pg-p-photo, .pg-profile .pg-p-name, .pg-profile .pg-p-role { display: none; }
.pg-profile .pg-p-bio { margin: 0; font-size: var(--small); line-height: 1.6; color: var(--color-text); }
.pg-profile .pg-call { margin-top: var(--sp-3); }
