/* ==========================================================================
   Rereteewhioi - shared styles
   Design tokens follow /branding/branding-guidelines.html - keep in sync.
   ========================================================================== */

/* Self-hosted (same files as PunaOra) so visitors' IPs never go to Google. */
@font-face{font-family:'Big Shoulders Display';font-style:normal;font-weight:700 900;font-display:swap;src:url(fonts/bigshoulders-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA,U+1E00-1E9F,U+2020,U+2113;}
@font-face{font-family:'Big Shoulders Display';font-style:normal;font-weight:700 900;font-display:swap;src:url(fonts/bigshoulders-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+2000-206F,U+2122,U+2212,U+FEFF,U+FFFD;}
@font-face{font-family:'Inter';font-style:normal;font-weight:400 700;font-display:swap;src:url(fonts/inter-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA,U+1E00-1E9F,U+2020,U+2113;}
@font-face{font-family:'Inter';font-style:normal;font-weight:400 700;font-display:swap;src:url(fonts/inter-latin.woff2) format('woff2');unicode-range:U+0000-00FF,U+2000-206F,U+2122,U+2212,U+FEFF,U+FFFD;}

:root{
  --bush-900:#12241F;
  --bush-800:#173029;
  --bush-700:#1B362E;
  --bush-500:#2C4E42;
  --ink:#14181A;
  /* gold-700 is for gold TEXT on cream: gold-600 only reaches ~3:1 there */
  --gold-700:#85611F;
  --gold-600:#B0812F;
  --gold-500:#C99A3B;
  --gold-200:#E9D3A3;
  --sage-500:#7E8F6E;
  --sage-200:#DDE3D3;
  --cream-100:#FAF7F1;
  --cream-200:#F1ECE1;
  /* grey-600 clears 4.5:1 on cream-200; grey-400 is for de-emphasised
     but still legible text (~3:1) */
  --grey-600:#5E625F;
  --grey-400:#83867F;
  --grey-300:#DAD6CC;
  --white:#FFFFFF;

  --font-display:'Big Shoulders Display', sans-serif;
  --font-body:'Inter', sans-serif;

  --space-1:.5rem; --space-2:1rem; --space-3:1.5rem; --space-4:2rem;
  --space-5:3rem; --space-6:4.5rem;

  --radius-sm:6px; --radius-md:12px; --radius-lg:20px;
  --max-w:1240px;
  --nav-h:76px;
  --tab-h:52px;

  --ease:cubic-bezier(.4,0,.2,1);
}

*,*::before,*::after{box-sizing:border-box;}
html{scroll-behavior:smooth;}
/* column layout keeps the footer at the bottom on short pages */
body{
  margin:0;
  min-height:100dvh;
  display:flex; flex-direction:column;
  background:var(--cream-100);
  color:var(--ink);
  font-family:var(--font-body);
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
/* no single word stranded on a paragraph's last line */
p{text-wrap:pretty;}
body > main{flex:1 0 auto;}
img,svg,video{max-width:100%;display:block;}
a{color:inherit;}
button{font-family:inherit;}

@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto;}
  *,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;}
}

.wrap{max-width:var(--max-w);margin:0 auto;padding:0 var(--space-4);}
@media (max-width:640px){ .wrap{padding:0 var(--space-2);} }

.eyebrow{
  display:inline-block;
  text-transform:uppercase;
  letter-spacing:.16em;
  font-size:.72rem;
  font-weight:600;
  color:var(--gold-700);
}
h1,h2,h3,h4{
  font-family:var(--font-display);
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.01em;
  color:var(--ink);
  margin:0 0 var(--space-2);
}

/* Rule of thumb: the condensed display face is for headings and the wordmark.
   Small uppercase labels use Inter bold with tracking - Big Shoulders squashes
   at small sizes. */

.rule{width:56px;height:3px;background:var(--gold-500);border:0;margin:var(--space-2) 0 var(--space-3);}

.btn{
  display:inline-flex;align-items:center;gap:.5em;
  font-family:var(--font-body);font-weight:600;font-size:.9rem;
  padding:.8em 1.6em;border-radius:999px;border:1px solid transparent;
  cursor:pointer;text-decoration:none;
  transition:transform .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}
.btn:hover{transform:translateY(-1px);}
.btn:focus-visible{outline:3px solid var(--gold-500);outline-offset:2px;}
.btn-primary{background:var(--bush-700);color:var(--white);}
.btn-primary:hover{background:var(--bush-800);}
.btn-secondary{background:transparent;color:var(--bush-700);border-color:var(--bush-700);}
.btn-secondary:hover{background:var(--bush-700);color:var(--white);}
.btn-gold{background:var(--gold-500);color:var(--ink);}
.btn-gold:hover{background:var(--gold-600);}
.btn-ghost{background:rgba(255,255,255,.08);color:var(--white);border-color:rgba(255,255,255,.35);}
.btn-ghost:hover{background:rgba(255,255,255,.18);}
.btn[disabled]{opacity:.6;cursor:not-allowed;transform:none;}

/* ==========================================================================
   Site header / nav
   ========================================================================== */
.site-header{
  position:fixed; top:0; left:0; right:0; z-index:100;
  height:var(--nav-h);
  display:flex; align-items:center;
}
/* The scrim lives on a pseudo-element, not the header itself: backdrop-filter
   on .site-header would make it the containing block for the position:fixed
   mobile menu, shrinking that menu to the header's 76px height. It always
   carries its own dark tint so nav text stays readable over any hero photo. */
.site-header::before{
  content:""; position:absolute; inset:0; z-index:-1;
  background:rgba(18,36,31,.6);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  transition:background .25s var(--ease), box-shadow .25s var(--ease);
}
.site-header.solid::before{
  background:var(--bush-900);
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
  box-shadow:0 4px 24px rgba(0,0,0,.15);
}
.brand, .main-nav a, .nav-toggle{
  text-shadow:0 1px 3px rgba(0,0,0,.4);
}
.site-header .wrap{display:flex;align-items:center;justify-content:space-between;width:100%;}
.brand{
  display:inline-flex; align-items:center; gap:.55em;
  font-family:var(--font-display);
  font-weight:900;
  font-size:1.35rem;
  color:var(--white);
  text-decoration:none;
  letter-spacing:.02em;
  text-transform:uppercase;
}
/* white-on-transparent logo; sized by height so it lines up with the wordmark */
.brand-logo{height:2.1em; width:auto; flex:none;}
.main-nav{display:flex;align-items:center;gap:var(--space-4);}
.main-nav ul{list-style:none;display:flex;gap:var(--space-3);margin:0;padding:0;}
.main-nav a{
  color:var(--cream-100);
  text-decoration:none;
  font-size:.85rem;
  text-transform:uppercase;
  letter-spacing:.08em;
  font-weight:600;
  padding:.4em 0;
  position:relative;
}
.main-nav a::after{
  content:""; position:absolute; left:0; right:0; bottom:0; height:2px;
  background:var(--gold-500);
  transform:scaleX(0); transform-origin:left;
  transition:transform .25s var(--ease);
}
.main-nav a:hover::after, .main-nav a:focus-visible::after, .main-nav a[aria-current="page"]::after{transform:scaleX(1);}
.nav-toggle{
  display:none;
  background:none;border:0;cursor:pointer;
  width:44px;height:44px;padding:11px 9px;
  flex-direction:column;justify-content:space-between;
}
.nav-toggle span{
  display:block;height:2px;border-radius:2px;background:var(--white);
  box-shadow:0 1px 3px rgba(0,0,0,.4);
  transition:transform .25s var(--ease), opacity .2s var(--ease);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1){transform:translateY(10px) rotate(45deg);}
.nav-toggle[aria-expanded="true"] span:nth-child(2){opacity:0;}
.nav-toggle[aria-expanded="true"] span:nth-child(3){transform:translateY(-10px) rotate(-45deg);}
.nav-toggle:focus-visible{outline:2px solid var(--gold-500);outline-offset:2px;border-radius:var(--radius-sm);}
@media (max-width:860px){
  .nav-toggle{display:flex;}
  .main-nav{
    position:fixed; inset:var(--nav-h) 0 0 0;
    background:var(--bush-900);
    flex-direction:column; align-items:flex-start;
    padding:var(--space-4);
    transform:translateX(100%);
    /* hidden once slid away, so closed-menu links aren't keyboard-reachable */
    visibility:hidden;
    transition:transform .25s var(--ease), visibility 0s linear .25s;
  }
  .main-nav.open{transform:translateX(0); visibility:visible; transition:transform .25s var(--ease);}
  .main-nav ul{flex-direction:column;gap:var(--space-3);width:100%;}
  .main-nav a{font-size:1.1rem;}
}

/* ==========================================================================
   Home - hero
   ========================================================================== */
.hero{
  position:relative;
  min-height:100vh;
  display:flex;
  align-items:flex-end;
  overflow:hidden;
  background:linear-gradient(160deg, var(--bush-900), var(--bush-500));
}
.hero-media{
  position:absolute; inset:0; width:100%; height:100%; object-fit:cover;
  filter:grayscale(1) brightness(.55);
}
.hero::before{
  content:"";
  position:absolute; inset:0;
  background:linear-gradient(180deg, rgba(18,36,31,.4) 0%, rgba(18,36,31,.65) 45%, rgba(18,36,31,.95) 100%);
}
.hero-inner{position:relative;z-index:2;width:100%;padding-bottom:var(--space-6);}
.hero-welcome{
  color:var(--white);
  padding-top:calc(var(--nav-h) + var(--space-4));
  text-shadow:0 2px 16px rgba(0,0,0,.55);
}
.hero-welcome .eyebrow{color:var(--gold-200);font-size:1.3rem;font-weight:700;}
.hero-welcome h1{
  color:var(--white);
  font-size:clamp(2.4rem,6vw,4.2rem);
  line-height:.98;
  margin:var(--space-2) 0 0;
  max-width:16ch;
}

.actions{
  position:relative; z-index:3;
  display:grid; grid-template-columns:repeat(3,1fr);
  gap:1px; background:var(--grey-300);
  transform:translateY(50%);
  border-radius:var(--radius-md);
  overflow:hidden;
  box-shadow:0 12px 40px rgba(0,0,0,.18);
}
@media (max-width:760px){ .actions{grid-template-columns:1fr; transform:none; margin-top:var(--space-3);} }
.action-card{
  background:var(--white);
  padding:var(--space-3) var(--space-3);
  text-decoration:none;
  color:var(--ink);
  display:flex; flex-direction:column; gap:.35em;
  transition:background .15s var(--ease);
}
.action-card:hover{background:var(--cream-200);}
.action-card .label{
  font-family:var(--font-display); font-weight:800; text-transform:uppercase;
  font-size:1.1rem; letter-spacing:.01em;
}
.action-card .sub{font-size:.82rem;color:var(--grey-600);}
.ext-icon{display:inline-block; width:1em; height:1em; vertical-align:-.12em;}
.nowrap{white-space:nowrap;}
.action-icon{width:26px; height:26px; color:var(--bush-700); flex:none; margin-bottom:.25em;}
/* phones: the stacked cards filled most of the screen - one row of icon tiles instead */
@media (max-width:760px){
  .actions{grid-template-columns:repeat(3,1fr);}
  .action-card{padding:.65rem .4rem; align-items:center; text-align:center; gap:0;}
  .action-icon{width:20px; height:20px; margin-bottom:.3em;}
  .action-card .label{font-family:var(--font-body); font-weight:600; text-transform:none; letter-spacing:0; font-size:.78rem; line-height:1.2;}
  .action-card .sub{display:none;}
}

/* ==========================================================================
   Welcome / photo section
   ========================================================================== */
.section{padding:var(--space-6) 0;}
.section-tight{padding:var(--space-5) 0;}
.section-flush-top{padding-top:0;}
.section-alt{background:var(--cream-200);}
/* first section on pages without a hero: clears the fixed header */
.page-top{padding-top:calc(var(--nav-h) + var(--space-4));}
.section-cta{margin:var(--space-3) 0 0;}
.lede{max-width:64ch;}
.wrap-narrow{max-width:760px;}

.welcome-grid{
  display:grid; grid-template-columns:1fr 1fr; gap:var(--space-5); align-items:center;
  padding-top:calc(var(--space-6) + var(--space-3));
}
@media (max-width:860px){ .welcome-grid{grid-template-columns:1fr; padding-top:var(--space-5);} }

.gallery{position:relative;border-radius:var(--radius-lg);overflow:hidden;aspect-ratio:4/3;}
.gallery-slide{
  position:absolute; inset:0;
  background-size:cover; background-position:center;
  opacity:0; transition:opacity .6s var(--ease);
}
.gallery-slide.active{opacity:1;}
/* shown until the first photo loads, or if the folder has none yet */
.gallery-placeholder{background:linear-gradient(135deg,var(--bush-900),var(--sage-500));}
.gallery-dots{
  position:absolute; bottom:calc(var(--space-2) - 8px); left:0; right:0;
  display:flex; justify-content:center; z-index:2;
}
/* a small dot inside a 24px tap area, so it's easy to hit on a phone */
.gallery-dots button{
  display:grid; place-items:center; width:24px; height:24px;
  border:0; border-radius:50%; background:none; cursor:pointer; padding:0;
}
.gallery-dots button::before{
  content:""; width:8px; height:8px; border-radius:50%; background:rgba(255,255,255,.5);
}
.gallery-dots button[aria-current="true"]::before{background:var(--white);}
.gallery-pause{
  position:absolute; bottom:calc(var(--space-2) - 10px); right:var(--space-2); z-index:2;
  width:28px; height:28px; border-radius:50%; border:0; padding:0; cursor:pointer;
  background:rgba(18,36,31,.55); color:var(--white);
  display:flex; align-items:center; justify-content:center;
}
.gallery-pause:hover{background:rgba(18,36,31,.8);}
.gallery-pause:focus-visible, .gallery-dots button:focus-visible{outline:2px solid var(--gold-500); outline-offset:2px;}
.gallery-pause svg{width:12px; height:12px; fill:currentColor;}

/* Stand-in for a photo that hasn't been added yet: the marae mark, faint, on
   the gradient - so a gap reads as intentional rather than unfinished. */
.media-fallback{position:relative;}
.media-fallback::before{
  content:""; position:absolute; inset:0; margin:auto;
  width:34%; max-width:120px; aspect-ratio:268 / 182;
  background:url(images/logo.png) center / contain no-repeat;
  opacity:.28;
}

/* Loading placeholders, sized like the real content so nothing jumps */
.skeleton{
  background:linear-gradient(90deg, var(--cream-200) 0%, var(--cream-100) 50%, var(--cream-200) 100%);
  background-size:200% 100%;
  animation:shimmer 1.4s linear infinite;
  border-radius:var(--radius-md);
}
@keyframes shimmer{from{background-position:100% 0;} to{background-position:-100% 0;}}
.skeleton-card{aspect-ratio:4 / 4.2;}
.skeleton-row{height:74px; margin-bottom:var(--space-2);}
.skeleton-person{height:170px;}
.masonry .skeleton{break-inside:avoid; margin-bottom:var(--space-3);}
.people-grid .empty-note{grid-column:1 / -1;}
.empty-note{color:var(--grey-600); margin:0;}
.card-row .empty-note{grid-column:1 / -1;}
.empty-state{
  grid-column:1 / -1; text-align:center; padding:var(--space-5) var(--space-3);
  background:var(--white); border:1px dashed var(--grey-300); border-radius:var(--radius-lg);
}
.empty-state .media-fallback{
  width:96px; height:96px; margin:0 auto var(--space-3); border-radius:50%;
  background:linear-gradient(135deg,var(--bush-700),var(--sage-500));
}
.empty-state .media-fallback::before{width:70%; opacity:.9;}
.empty-state h3{font-size:1.5rem; margin-bottom:.3em;}
.empty-state p{color:var(--grey-600); max-width:44ch; margin:0 auto var(--space-3);}

/* Fade-and-rise as sections scroll in (class added by app.js only for
   content starting below the fold, and never with reduced motion) */
.reveal{opacity:0; transform:translateY(18px); transition:opacity .6s var(--ease), transform .6s var(--ease);}
.reveal.in{opacity:1; transform:none;}

/* ==========================================================================
   Cards (events / posts) - shared shape
   ========================================================================== */
.card-row{
  display:grid; grid-template-columns:repeat(auto-fit, minmax(220px,1fr));
  gap:var(--space-3);
}
/* Upcoming events: keep empty columns (auto-fill), so one or two events stay
   card-sized instead of stretching across the row. */
.card-row[data-upcoming-events]{grid-template-columns:repeat(auto-fill, minmax(240px,1fr));}
/* past events padding out the strip: present but clearly secondary */
/* Past events read as quieter through the photo and title colour only:
   fading the whole card took its text below readable contrast. */
.card-past .card-media{filter:grayscale(1); opacity:.6;}
.card-past .card-title{color:var(--grey-600);}
.card-past:hover{box-shadow:none; transform:none;}
.card-past .tag{background:var(--cream-200); color:var(--grey-600);}
.card{
  background:var(--white); border:1px solid var(--grey-300); border-radius:var(--radius-md);
  overflow:hidden; display:flex; flex-direction:column;
  transition:box-shadow .15s var(--ease), transform .15s var(--ease);
}
.card:hover{box-shadow:0 10px 30px rgba(18,36,31,.1); transform:translateY(-2px);}
.card-media{
  aspect-ratio:16/10; background:linear-gradient(135deg,var(--bush-700),var(--sage-500));
  overflow:hidden;
}
/* Real photo (event/post cover), when there is one - fills the placeholder's
   box exactly, same treatment across the upcoming-events strip, the events
   accordion, and the-marae-edit masonry tiles. */
.card-media img, .accordion-media img, .tile-media img{
  width:100%; height:100%; object-fit:cover;
  transition:transform .5s var(--ease);
}
.card:hover .card-media img, .tile:hover .tile-media img, .tile:focus-visible .tile-media img{transform:scale(1.04);}
.card-body{padding:var(--space-2) var(--space-2) var(--space-3);}
.tag{
  display:inline-block; background:var(--sage-200); color:var(--bush-700);
  font-size:.75rem; text-transform:uppercase; letter-spacing:.08em; font-weight:700;
  padding:.3em .7em; border-radius:4px; margin-bottom:.6em;
}
.card-title{font-weight:700; font-size:1rem; margin-bottom:.3em;}
.card-meta{font-size:.82rem; color:var(--grey-600);}

/* ==========================================================================
   Contact form
   ========================================================================== */
.contact{background:var(--bush-900); color:var(--white);}
.contact h2{color:var(--white);}
.contact .lede{color:var(--sage-200);}
.field-block{margin-bottom:var(--space-2);}
.form-grid{display:grid; grid-template-columns:1fr 1fr; gap:var(--space-2); margin-bottom:var(--space-2);}
@media (max-width:640px){ .form-grid{grid-template-columns:1fr;} }
.field{display:flex; flex-direction:column; gap:.4em;}
.field label{font-size:.78rem; text-transform:uppercase; letter-spacing:.08em; color:var(--sage-200);}
.field input, .field textarea{
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.25);
  border-radius:var(--radius-sm);
  padding:.8em 1em;
  color:var(--white);
  font-family:inherit; font-size:1rem;
}
.field input::placeholder, .field textarea::placeholder{color:rgba(255,255,255,.45);}
.field input:focus, .field textarea:focus{outline:2px solid var(--gold-500); outline-offset:1px;}
.hp-field{position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden;}
.form-status{margin-top:var(--space-2); font-size:.9rem;}
.form-status[data-state="success"]{color:var(--sage-200);}
.form-status[data-state="error"]{color:#E8B4A6;}

/* ==========================================================================
   Register page - light form card (the base .field styles are for the dark
   contact section, so the card overrides them)
   ========================================================================== */
.register-grid{display:grid; grid-template-columns:1fr 1.4fr; gap:var(--space-5); align-items:start;}
@media (max-width:860px){ .register-grid{grid-template-columns:1fr; gap:var(--space-3);} }
.register-intro p{max-width:48ch;}
.register-privacy{font-size:.88rem; color:var(--grey-600);}
.form-card{
  background:var(--white); border:1px solid var(--grey-300); border-radius:var(--radius-lg);
  padding:var(--space-4); box-shadow:0 12px 40px rgba(18,36,31,.06);
}
@media (max-width:640px){ .form-card{padding:var(--space-3) var(--space-2);} }
.form-card .field{margin-bottom:var(--space-2);}
.form-card .form-grid{margin-bottom:0;}
.form-card .field label{color:var(--bush-700); font-weight:600; letter-spacing:.06em;}
.form-card .req{color:var(--gold-700);}
.form-card .field input, .form-card .field textarea, .form-card .field select{
  background:var(--cream-100); border:1px solid var(--grey-300); color:var(--ink);
  border-radius:var(--radius-sm); padding:.8em 1em; font-family:inherit; font-size:1rem; width:100%;
}
.form-card .field input:focus, .form-card .field textarea:focus, .form-card .field select:focus{
  outline:2px solid var(--gold-500); outline-offset:1px; border-color:transparent;
}
.form-card .input-short{max-width:200px;}
.form-card .whakapapa-field{border:0; padding:0; margin:0 0 var(--space-2); min-width:0;}
.form-card legend{
  padding:0; margin-bottom:.4em;
  font-size:.78rem; text-transform:uppercase; letter-spacing:.06em; font-weight:600; color:var(--bush-700);
}
.choice-toggle{
  display:inline-flex; align-self:flex-start; gap:2px; padding:3px; margin-bottom:.6em;
  background:var(--cream-100); border:1px solid var(--grey-300); border-radius:999px;
}
.form-card .choice-toggle label{
  position:relative; text-transform:none; letter-spacing:0; padding:.45em 1.1em; border-radius:999px; cursor:pointer;
  font-size:.85rem; font-weight:600; color:var(--grey-600);
  transition:background .15s var(--ease), color .15s var(--ease);
}
.choice-toggle input{position:absolute; opacity:0; inset:0; margin:0; cursor:pointer;}
.form-card .choice-toggle label:has(input:checked){background:var(--bush-700); color:var(--white);}
.choice-toggle label:has(input:focus-visible){outline:2px solid var(--gold-500); outline-offset:2px;}
.form-card .whakapapa-field textarea, .form-card .whakapapa-field .file-input{
  background:var(--cream-100); border:1px solid var(--grey-300); color:var(--ink);
  border-radius:var(--radius-sm); padding:.8em 1em; font-family:inherit; font-size:1rem; width:100%;
}
.form-card .whakapapa-field textarea:focus{outline:2px solid var(--gold-500); outline-offset:1px; border-color:transparent;}
.form-card .whakapapa-field .hint{margin-top:.4em;}
.form-card .whakapapa-field .file-input{padding:.6em; cursor:pointer; font-size:.9rem;}
.form-card .file-input::file-selector-button{
  font-family:inherit; font-weight:600; font-size:.85rem;
  background:var(--bush-700); color:var(--white); border:0; border-radius:999px;
  padding:.55em 1.2em; margin-right:1em; cursor:pointer;
}
.form-card .file-input::file-selector-button:hover{background:var(--bush-800);}
.form-card .hint{font-size:.82rem; color:var(--grey-600); margin:.1em 0 0;}
.form-card .btn{margin-top:var(--space-1);}
.form-card .form-status{margin:0;}
.form-card .form-status:not(:empty){margin-bottom:var(--space-2);}
.form-card .form-status[data-state="error"]{color:#A4372A; font-weight:600;}
.register-done{text-align:center; padding:var(--space-4) 0;}
.register-done p{color:var(--grey-600); margin:0 auto var(--space-3); max-width:40ch;}

/* ==========================================================================
   Whaanau page - password sign-in (reuses the register form card) and the
   document list
   ========================================================================== */
[data-whaanau-page] [hidden]{display:none;}
[data-whaanau-docs]{max-width:860px;}
[data-whaanau-docs] .form-status:empty{display:none;}
[data-whaanau-docs] .form-status[data-state="error"]{color:#A4372A; font-weight:600;}
.doc-group + .doc-group{margin-top:var(--space-4);}
.doc-group h3{font-size:1.2rem; margin:0 0 var(--space-1);}
.doc-list{list-style:none; margin:0; padding:0; border-top:1px solid var(--grey-300);}
.doc-row{
  display:flex; align-items:center; justify-content:space-between; gap:var(--space-2);
  padding:var(--space-2) 0; border-bottom:1px solid var(--grey-300);
}
.doc-name{display:block; font-weight:600; color:var(--ink); overflow-wrap:anywhere;}
.doc-meta{display:block; font-size:.85rem; color:var(--grey-600); margin-top:.15em;}
.btn-sm{padding:.5em 1.1em; font-size:.85rem; flex:none;}
.addr-wrap{position:relative;}
.addr-menu{
  position:absolute; top:calc(100% + 4px); left:0; right:0; z-index:10;
  background:var(--white); border:1px solid var(--grey-300); border-radius:var(--radius-sm);
  box-shadow:0 12px 30px rgba(18,36,31,.12); overflow:hidden;
}
.addr-menu button{
  display:block; width:100%; text-align:left; background:none; border:0;
  padding:.65em 1em; font-size:.92rem; cursor:pointer; color:var(--ink);
}
.addr-menu button:hover, .addr-menu button:focus{background:var(--cream-200);}

/* ==========================================================================
   Long-form text (privacy policy)
   ========================================================================== */
.prose{max-width:68ch;}
.prose-meta{font-size:.85rem; color:var(--grey-600); margin-top:0;}
.prose h3{font-size:1.35rem; margin:var(--space-5) 0 var(--space-1);}
.prose h4{
  font-family:var(--font-body); text-transform:none; letter-spacing:0;
  font-size:1rem; font-weight:700; margin:var(--space-3) 0 .25em;
}
.prose ul{padding-left:1.2em;}
.prose li{margin-bottom:.4em;}
.prose a{color:var(--bush-700);}

.form-consent{font-size:.82rem; margin:var(--space-1) 0 var(--space-2);}
.contact .form-consent{color:var(--sage-200);}
.contact .form-consent a{color:var(--cream-100);}
.form-card .form-consent{color:var(--grey-600);}
.register-privacy a, .form-card .form-consent a{color:var(--bush-700);}
.footer-bottom a:not(.login-link){color:inherit;}
.footer-bottom a:not(.login-link):hover{color:var(--gold-500);}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer{background:var(--ink); color:var(--cream-100); padding:var(--space-5) 0 var(--space-3);}
.footer-grid{display:grid; grid-template-columns:2fr 1fr 1fr; gap:var(--space-4);}
@media (max-width:760px){
  .footer-grid{grid-template-columns:1fr 1fr;}
  .footer-about{grid-column:1 / -1;}
}
.footer-map{
  display:block; width:100%; max-width:360px; aspect-ratio:16/10;
  border:0; border-radius:var(--radius-md);
  /* monochrome to sit with the B&W hero; full colour when someone engages with it */
  filter:grayscale(1) contrast(1.05);
  transition:filter .3s var(--ease);
  margin-bottom:var(--space-2);
}
.footer-map:hover, .footer-map:focus-within{filter:none;}
.footer-address{color:var(--cream-200); font-size:.9rem; margin:0 0 .35em;}
.footer-about .footer-email{color:var(--cream-200); font-size:.9rem; text-decoration:none;}
.footer-about .footer-email:hover{color:var(--gold-500);}
.footer-grid h4{color:var(--gold-200); font-family:var(--font-body); font-weight:700; font-size:.75rem; letter-spacing:.14em; margin-bottom:var(--space-2);}
.footer-grid ul{list-style:none; margin:0; padding:0;}
.footer-grid li{margin-bottom:.1em;}
/* taller tap area for thumbs, same spacing as before */
.footer-grid a{display:inline-block; padding:.35em 0; color:var(--cream-200); text-decoration:none; font-size:.9rem;}
.footer-grid a:hover{color:var(--gold-500);}
.footer-brand{display:flex; align-items:center; gap:.55em; font-family:var(--font-display); font-weight:900; font-size:1.4rem; text-transform:uppercase; margin-bottom:.75em;}
.footer-bottom{
  display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:var(--space-2);
  margin-top:var(--space-5); padding-top:var(--space-3);
  border-top:1px solid rgba(255,255,255,.12);
  font-size:.8rem; color:var(--grey-300);
}
.login-link{
  display:inline-flex; align-items:center; gap:.5em;
  background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.2);
  padding:.6em 1.2em; border-radius:999px; text-decoration:none; color:var(--cream-100);
  font-size:.82rem;
}
.login-link:hover{background:rgba(255,255,255,.14);}

/* ==========================================================================
   About / tabbed page
   ========================================================================== */
/* The page scrolls normally; the tab bar sticks under the header. Panels sit
   side by side in a track that slides, and app.js sets the viewport's height
   to the open panel's, so the footer follows directly after it. */
.tab-bar{
  position:sticky; top:var(--nav-h); z-index:90; margin-top:var(--nav-h);
  background:var(--white); border-bottom:1px solid var(--grey-300);
}
.tab-bar ul{list-style:none; display:flex; gap:var(--space-4); margin:0; padding:0; max-width:var(--max-w); margin:0 auto; padding:0 var(--space-4);}
.tab-bar button{
  background:none; border:0; padding:0; margin:0; height:var(--tab-h);
  display:inline-flex; align-items:center;
  font-family:var(--font-body); font-weight:700; text-transform:uppercase; letter-spacing:.1em;
  font-size:.78rem; color:var(--grey-600); cursor:pointer;
  border-bottom:3px solid transparent;
}
.tab-bar button{white-space:nowrap;}
/* four tab names on a phone: tighter, and the row scrolls sideways on very narrow screens */
@media (max-width:640px){
  .tab-bar ul{gap:var(--space-2); padding:0 var(--space-2); overflow-x:auto; scrollbar-width:none;}
  .tab-bar ul::-webkit-scrollbar{display:none;}
  .tab-bar button{font-size:.72rem; letter-spacing:.06em;}
}
.tab-bar button[aria-selected="true"]{color:var(--ink); border-bottom-color:var(--gold-500);}
.tab-bar button:focus-visible{outline:2px solid var(--gold-500); outline-offset:2px;}

/* Te reo tab names reveal their English meaning on hover/focus. Both words
   share one grid cell, so the tab is always as wide as the longer one and
   nothing shifts when they swap. */
.tab-swap{display:inline-grid;}
.tab-swap > span{grid-area:1 / 1; text-align:center; transition:opacity .2s var(--ease), transform .2s var(--ease);}
.tab-en{opacity:0; transform:translateY(40%);}
@media (hover:hover){
  .tab-bar button:hover .tab-mi{opacity:0; transform:translateY(-40%);}
  .tab-bar button:hover .tab-en{opacity:1; transform:none;}
}
.tab-bar button:focus-visible .tab-mi{opacity:0; transform:translateY(-40%);}
.tab-bar button:focus-visible .tab-en{opacity:1; transform:none;}

.tab-viewport{overflow:hidden; transition:height .5s var(--ease);}
.tab-track{
  display:flex; align-items:flex-start; width:calc(var(--tabs, 3) * 100%);
  transition:transform .5s var(--ease);
}
.tab-panel{width:calc(100% / var(--tabs, 3)); padding:var(--space-5) 0;}

.our-marae-grid{display:grid; grid-template-columns:1fr 1fr; gap:var(--space-5); align-items:center;}
@media (max-width:860px){ .our-marae-grid{grid-template-columns:1fr;} }
.big-photo{position:relative; overflow:hidden; aspect-ratio:4/3; border-radius:var(--radius-lg); background:linear-gradient(135deg,var(--bush-900),var(--sage-500));}
.big-photo img{position:absolute; inset:0; width:100%; height:100%; object-fit:cover;}

.timeline{display:flex; gap:0; list-style:none; margin:var(--space-4) 0; padding:0 0 var(--space-2); overflow-x:auto;}
.timeline-point{flex:0 0 160px; text-align:center; position:relative; padding-top:var(--space-3);}
.timeline-point::before{content:"";position:absolute;top:0;left:50%;transform:translateX(-50%);width:12px;height:12px;border-radius:50%;background:var(--gold-500);}
.timeline-point::after{content:"";position:absolute;top:5px;left:0;right:0;height:2px;background:var(--grey-300);z-index:-1;}
.timeline-point:first-child::after{left:50%;}
.timeline-point:last-child::after{right:50%;}
.timeline-year{font-weight:700; letter-spacing:.04em; color:var(--bush-700); margin-top:.6em;}
.timeline-desc{font-size:.82rem; color:var(--grey-600); padding:0 .5em;}

/* Hiitori - the trust's history card. Every row is the same two columns:
   text on the left, its archive photos centred in a fixed right-hand column,
   so the page reads as one steady spine. */
/* rows are capped so the text never stretches far from its photos */
.history-row, .history .timeline{max-width:1120px;}
.history .timeline-point{flex:1 0 130px;}
.history-row{
  display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:var(--space-5);
  align-items:start; padding:var(--space-4) 0; border-top:1px solid var(--grey-300);
}
.history-row .sub-heading{margin-top:0;}
@media (max-width:860px){
  .history-row{grid-template-columns:1fr; gap:var(--space-3);}
}
.history-text p{margin:0 0 var(--space-2); max-width:72ch;}
.history-text p:last-child{margin-bottom:0;}
.history-aside{display:flex; flex-direction:column; align-items:center; gap:var(--space-2);}
/* the scans are small (~100-330px wide), so they're shown near natural size */
.archive-photo{margin:0; max-width:100%;}
.archive-photo img{border-radius:var(--radius-sm); box-shadow:0 8px 24px rgba(18,36,31,.12); height:auto; max-width:100%;}
.history .archive-wide{max-width:1120px; margin:0 0 var(--space-4);}
.archive-wide img{width:100%;}
.whaanau-photos{display:flex; flex-direction:column; align-items:center; gap:var(--space-3);}
.whaanau-photos figure{margin:0; text-align:center;}
.whaanau-pair{display:flex; align-items:flex-end; justify-content:center; gap:var(--space-1);}
.whaanau-pair img{height:130px; width:auto; border-radius:var(--radius-sm); box-shadow:0 8px 24px rgba(18,36,31,.12);}
.whaanau-photos figcaption{font-size:.82rem; font-weight:700; margin-top:.6em;}
@media (max-width:860px){
  .whaanau-photos{flex-direction:row; flex-wrap:wrap; justify-content:center;}
}
.history-credit{
  font-size:.88rem; font-style:italic; color:var(--grey-600);
  max-width:1120px; margin:0; padding-top:var(--space-3); border-top:1px solid var(--grey-300);
}

/* Whakawhanake - redevelopment stages, sponsors, support call-out */
/* heading for a section within a tab panel (Our facilities, The redevelopment, Our sponsors) */
.sub-heading{font-size:1.4rem; margin:var(--space-5) 0 var(--space-2);}
.facility .card-media{position:relative;}
.facility .card-media img{position:absolute; inset:0;}
.facility-desc{font-size:.88rem; color:var(--grey-600); margin:0 0 var(--space-2);}
/* Capacity/availability fact: pinned to the card bottom so facts line up
   across the row, even when descriptions differ in length. */
.facility .card-body{flex:1; display:flex; flex-direction:column;}
.facility .card-meta{
  margin-top:auto; padding-top:.8em; border-top:1px solid var(--grey-300);
  font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.08em;
  color:var(--bush-700);
}
.facility .card-meta:empty{display:none;}
.facility-cta{margin:var(--space-3) 0 0;}
.stages{list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(auto-fit, minmax(220px,1fr)); gap:var(--space-3);}
.stage{background:var(--white); border:1px solid var(--grey-300); border-radius:var(--radius-md); padding:var(--space-3);}
.stage-status{
  display:inline-block; font-size:.75rem; text-transform:uppercase; letter-spacing:.08em; font-weight:700;
  padding:.3em .7em; border-radius:4px; background:var(--cream-200); color:var(--grey-600); margin-bottom:.8em;
}
.stage-status.done{background:var(--sage-200); color:var(--bush-700);}
.stage-status.now{background:var(--gold-200); color:var(--ink);}
.stage-title{font-weight:700; margin-bottom:.3em;}
.stage-desc{font-size:.88rem; color:var(--grey-600); margin:0;}

.sponsor-grid{display:grid; grid-template-columns:repeat(auto-fill, minmax(180px,1fr)); gap:var(--space-3); margin-top:var(--space-3);}
.sponsor{
  display:flex; flex-direction:column; align-items:center; gap:.7em;
  background:var(--white); border:1px solid var(--grey-300); border-radius:var(--radius-md);
  padding:var(--space-3) var(--space-2); text-decoration:none; color:var(--ink);
  transition:box-shadow .15s var(--ease), transform .15s var(--ease);
}
a.sponsor:hover{box-shadow:0 10px 30px rgba(18,36,31,.1); transform:translateY(-2px);}
.sponsor-logo{
  width:100%; aspect-ratio:3/2; display:flex; align-items:center; justify-content:center;
  color:var(--grey-600); font-size:.72rem; text-transform:uppercase; letter-spacing:.08em;
  background:var(--cream-100); border-radius:var(--radius-sm);
}
.sponsor img{width:100%; aspect-ratio:3/2; object-fit:contain;}
/* white-on-transparent logos would vanish on the white card, so they're inverted to dark */
.sponsor img.logo-on-dark{filter:invert(1);}
.sponsor-name{font-size:.85rem; font-weight:600; text-align:center;}

.support-panel{
  display:flex; align-items:center; justify-content:space-between; gap:var(--space-3); flex-wrap:wrap;
  margin-top:var(--space-5); padding:var(--space-4);
  background:var(--bush-900); color:var(--cream-100); border-radius:var(--radius-lg);
}
.support-panel h3{color:var(--white); font-size:1.4rem; margin-bottom:.3em;}
.support-panel p{margin:0; color:var(--sage-200);}

.people-grid{margin-top:var(--space-3); display:grid; grid-template-columns:repeat(auto-fit, minmax(170px,1fr)); gap:var(--space-3);}
.person-card{background:var(--white); border:1px solid var(--grey-300); border-radius:var(--radius-md); padding:var(--space-2); text-align:center;}
.person-photo{
  width:84px; height:84px; border-radius:50%; margin:0 auto var(--space-2); overflow:hidden;
  background:linear-gradient(135deg,var(--sage-500),var(--bush-700));
}
.person-photo img{width:100%; height:100%; border-radius:50%; object-fit:cover;}
.person-name{font-weight:700;}
.person-role{font-size:.82rem; color:var(--grey-600);}

/* ==========================================================================
   Events page
   ========================================================================== */
.events-toolbar{display:flex; align-items:center; justify-content:space-between; gap:var(--space-2); flex-wrap:wrap; margin-bottom:var(--space-3);}
.month-nav{display:flex; align-items:center; gap:var(--space-2);}
.month-nav button{
  background:var(--white); border:1px solid var(--grey-300); border-radius:50%;
  width:44px; height:44px; cursor:pointer; font-size:1.1rem; color:var(--bush-700);
}
.month-nav button:disabled{opacity:.35; cursor:default;}
.month-nav button:focus-visible, .view-toggle button:focus-visible, .cal-chip:focus-visible{outline:2px solid var(--gold-500); outline-offset:2px;}
.month-label{font-weight:700; text-transform:uppercase; letter-spacing:.08em; font-size:.9rem; min-width:16ch; text-align:center;}
.view-toggle{display:flex; border:1px solid var(--grey-300); border-radius:999px; overflow:hidden;}
.view-toggle button{
  background:var(--white); border:0; padding:.5em 1.2em; font-size:.78rem; text-transform:uppercase; letter-spacing:.06em;
  cursor:pointer; color:var(--grey-600); font-weight:600;
}
.view-toggle button[aria-pressed="true"]{background:var(--bush-700); color:var(--white);}

.calendar{background:var(--white); border:1px solid var(--grey-300); border-radius:var(--radius-md); overflow:hidden;}
.cal-weekdays, .cal-grid{display:grid; grid-template-columns:repeat(7,1fr);}
.cal-weekdays div{padding:.7em; font-size:.72rem; text-transform:uppercase; letter-spacing:.08em; color:var(--grey-600); text-align:center; border-bottom:1px solid var(--grey-300);}
.cal-day{
  min-height:88px; border-right:1px solid var(--grey-300); border-bottom:1px solid var(--grey-300);
  padding:.5em; font-size:.82rem; color:var(--ink); position:relative; cursor:default;
}
.cal-day:nth-child(7n){border-right:0;}
.cal-day.outside{color:var(--grey-600); background:var(--cream-200);}
.cal-day .num{font-weight:600;}
.cal-chip{
  margin-top:.4em; background:var(--sage-200); color:var(--bush-700);
  font-size:.75rem; padding:.3em .7em; border-radius:4px; cursor:pointer; border:0; width:100%; text-align:left;
  font-family:inherit;
}
.cal-chip:hover{background:var(--sage-500); color:var(--white);}
.cal-day.has-selected{outline:2px solid var(--gold-500); outline-offset:-2px;}
.cal-day.today .num{
  display:inline-flex; align-items:center; justify-content:center;
  width:1.8em; height:1.8em; margin:-.3em 0 0 -.3em; border-radius:50%;
  background:var(--bush-700); color:var(--white);
}
/* Phones: seven columns leave ~50px a day, so titles become slim bars (the
   title stays as the button's accessible name) and the list view is the
   default - see initEventsPage. */
@media (max-width:640px){
  .cal-weekdays div{padding:.6em 0; letter-spacing:.02em;}
  .cal-day{min-height:58px; padding:.35em;}
  .cal-chip{font-size:0; height:6px; padding:0; margin-top:.3em; background:var(--bush-500);}
}

.accordion{margin-top:var(--space-3);}
.accordion-item{background:var(--white); border:1px solid var(--grey-300); border-radius:var(--radius-md); margin-bottom:var(--space-2); overflow:hidden;}
.accordion-header{
  display:flex; align-items:center; justify-content:space-between; gap:var(--space-2);
  width:100%; background:none; border:0; padding:var(--space-2); cursor:pointer; text-align:left;
}
.accordion-header .date-badge{
  font-weight:700; text-transform:uppercase; letter-spacing:.06em; background:var(--cream-200); color:var(--bush-700);
  border-radius:var(--radius-sm); padding:.5em .8em; font-size:.75rem; white-space:nowrap;
}
.accordion-header .title-block{flex:1;}
.accordion-header .title-block .t{font-weight:700;}
.accordion-header .title-block .m{font-size:.82rem; color:var(--grey-600);}
.accordion-header .chevron{transition:transform .2s var(--ease); color:var(--grey-600);}
.accordion-item[data-open="true"] .chevron{transform:rotate(180deg);}
.accordion-panel{
  /* Height is set inline by app.js to the panel's real scrollHeight when
     opened, so content is never clipped regardless of length. */
  max-height:0; overflow:hidden; transition:max-height .35s var(--ease);
}
.accordion-panel-inner{
  padding:0 var(--space-2) var(--space-3);
  display:grid; grid-template-columns:1fr 220px; gap:var(--space-3);
}
@media (max-width:640px){
  .accordion-panel-inner{grid-template-columns:1fr;}
  /* no photo: skip the stand-in box rather than stack a big empty tile */
  .accordion-media.media-fallback{display:none;}
}
.accordion-panel-inner .desc{font-size:.9rem; color:#33373A; white-space:pre-line;}
.accordion-actions{display:flex; gap:var(--space-2); margin-top:var(--space-2); flex-wrap:wrap;}
.accordion-media{
  aspect-ratio:4/3; border-radius:var(--radius-sm); background:linear-gradient(135deg,var(--gold-600),var(--sage-500));
  overflow:hidden;
}
.events-list{margin-top:var(--space-5);}
.events-list h3{margin-top:.5em;}

/* ==========================================================================
   The Marae Edit - masonry
   ========================================================================== */
.edit-toolbar{display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:var(--space-2); margin-bottom:var(--space-3);}
.edit-toolbar h2{margin-bottom:0;}

.masonry{
  columns:4 220px; column-gap:var(--space-3);
}
@media (max-width:1000px){ .masonry{columns:3 200px;} }
@media (max-width:700px){ .masonry{columns:2 160px;} }
.tile{
  break-inside:avoid; margin-bottom:var(--space-3); border-radius:var(--radius-md); overflow:hidden;
  cursor:pointer; border:1px solid var(--grey-300); background:var(--white);
  transition:box-shadow .15s var(--ease);
}
.tile:hover{box-shadow:0 10px 30px rgba(18,36,31,.1);}
.tile:focus-visible{outline:3px solid var(--gold-500); outline-offset:2px;}
.tile-media{overflow:hidden; aspect-ratio:1/1; background:linear-gradient(135deg,var(--bush-700),var(--sage-500));}
.tile.size-big .tile-media{aspect-ratio:4/3; background:linear-gradient(135deg,var(--sage-500),var(--bush-900));}
/* title always visible - touch screens have no hover to reveal it */
.tile-caption{padding:var(--space-2);}
.tile-caption .t{font-weight:700; font-size:.95rem; line-height:1.35;}
.tile.size-big .tile-caption .t{font-family:var(--font-display); font-weight:800; text-transform:uppercase; font-size:1.3rem; line-height:1.1;}
.tile-caption .d{font-size:.78rem; color:var(--grey-600); margin-top:.3em;}
.tile-caption .x{font-size:.85rem; color:#33373A; margin:.5em 0 0;}

.expand-panel{
  display:none;
  background:var(--white); border:1px solid var(--grey-300); border-radius:var(--radius-md);
  margin-bottom:var(--space-3); padding:var(--space-3); grid-template-columns:1fr 300px; gap:var(--space-3);
}
.expand-panel.open{display:grid;}
/* scrolled-to targets clear the fixed header */
.expand-panel, .accordion-item{scroll-margin-top:calc(var(--nav-h) + var(--space-2));}
@media (max-width:700px){ .expand-panel.open{grid-template-columns:1fr;} .expand-media{order:-1;} }
.expand-panel h3{margin-top:.4em;}
.expand-date{color:var(--grey-600); font-size:.85rem;}
.expand-close{
  background:none; border:0; cursor:pointer; font-size:.82rem; color:var(--grey-600);
  display:flex; align-items:center; gap:.3em; margin-bottom:var(--space-2);
}
.expand-media{
  aspect-ratio:16/9; border-radius:var(--radius-sm); overflow:hidden;
  background:linear-gradient(135deg,var(--bush-700),var(--sage-500));
}
.expand-media img{width:100%; height:100%; object-fit:cover;}
/* post body, built by renderPostBody() in app.js */
.post-body{max-width:68ch;}
.post-body h4{font-family:var(--font-body); text-transform:none; letter-spacing:0; font-size:1.05rem; font-weight:700; margin:var(--space-3) 0 .4em;}
.post-body img{border-radius:var(--radius-sm); margin:var(--space-2) 0; height:auto;}
.post-body a{color:var(--bush-700); overflow-wrap:anywhere;}

/* ==========================================================================
   Utility
   ========================================================================== */
.sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
  clip:rect(0,0,0,0); white-space:nowrap; border:0;
}
.skip-link{
  position:absolute; left:var(--space-2); top:-60px; z-index:200;
  background:var(--gold-500); color:var(--ink); padding:.8em 1.4em; border-radius:var(--radius-sm);
  text-decoration:none; font-weight:700; transition:top .2s var(--ease);
}
.skip-link:focus{top:var(--space-2);}

/* ==========================================================================
   404
   ========================================================================== */
.not-found h1{font-size:clamp(2rem,5vw,3.2rem); line-height:1;}
.not-found-links{display:flex; flex-wrap:wrap; gap:var(--space-2); margin-top:var(--space-3);}
