/* Footer balance (own file so theme.css rewrites can't wipe it) */
@media (min-width: 961px) {
  .footer-grid {
    grid-template-columns: 1.35fr 1fr 1.1fr 1.45fr;
    gap: 40px;
    align-items: start;
  }
  .footer-links {
    grid-template-columns: 1fr 1fr;
    column-gap: 24px;
    row-gap: 10px;
  }
}
@media (min-width: 561px) and (max-width: 960px) {
  .footer-links { grid-template-columns: 1fr 1fr; column-gap: 20px; }
}
.footer-links a { white-space: nowrap; }
@media (max-width: 380px) { .footer-links a { white-space: normal; } }

/* membership band above the footer + phone "Join free" button (all pages except /join) */
.member-band { padding: clamp(28px, 4vw, 44px) 0; background: linear-gradient(120deg, #0B4A22, #14532D 55%, #1B7F3B); color: #fff; position: relative; overflow: hidden; }
.member-band::after { content: ""; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%; border: 40px solid rgba(245, 160, 26, .18); pointer-events: none; }
.member-band-in { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; position: relative; z-index: 1; }
.member-band-ico { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: rgba(255, 255, 255, .12); color: #FBC66B; flex: none; }
.member-band-ico svg { width: 26px; height: 26px; }
.member-band-text { flex: 1 1 320px; }
.member-band-text h2 { margin: 0 0 4px; color: #fff; font-size: clamp(1.25rem, 2.4vw, 1.6rem); }
.member-band-text p { margin: 0; color: #D6EBDD; }
.member-band-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.member-band-link { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, .45); }
.member-band-link:hover { text-decoration-color: #FBC66B; }
.member-fab { display: none; }
@media (max-width: 1024px) {
  .member-fab { position: fixed; left: 16px; bottom: 16px; z-index: 60; display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 999px; background: #F5A01A; color: #1F1300; font-weight: 800; text-decoration: none; box-shadow: 0 12px 28px -10px rgba(0, 0, 0, .45); }
  .member-fab:hover { filter: brightness(1.05); }
}
@media (max-width: 560px) { .member-band-actions { width: 100%; } .member-band-actions .btn { flex: 1; justify-content: center; } }
@media print { .member-band, .member-fab { display: none; } }

/* ===== phone safety layer (2026-11-10): nothing may push the page wider than the screen ===== */
img, video, iframe, svg, canvas { max-width: 100%; }
.wrap > *, .panel-grid > *, .grid > *, .row-2 > *, .field { min-width: 0; }
.desk-mockup, .desk-mockup * { min-width: 0; overflow-wrap: anywhere; }
.desk-mockup { max-width: 100%; }
.ev-card > * { min-width: 0; }
.home-events .ev-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
@media (max-width: 600px) {
  .ev-card { grid-template-columns: 64px minmax(0, 1fr); }
  .home-events .ev-card { grid-template-columns: 56px minmax(0, 1fr); }
}
table { max-width: 100%; }
pre, code { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ===== footer bottom bar, redesigned ===== */
.footer-bottom.fb2 { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px 24px; padding: 20px 0 24px; margin-top: 28px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: .86rem; }
.fb2 p { margin: 0; }
.fb2 .fb-copy { color: rgba(255, 255, 255, .6); }
.fb2 .fb-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.fb2 .fb-links a { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .85); text-decoration: none; font-weight: 600; font-size: .8rem; background: rgba(255, 255, 255, .03); transition: background .15s, border-color .15s, color .15s; }
.fb2 .fb-links a:hover { background: rgba(245, 160, 26, .14); border-color: rgba(245, 160, 26, .5); color: #FBC66B; }
.fb2 .fb-credit { justify-self: end; color: rgba(255, 255, 255, .6); }
.fb2 .fb-credit a { color: #FBC66B; font-weight: 700; text-decoration: none; border-bottom: 1px solid rgba(251, 198, 107, .35); }
.fb2 .fb-credit a:hover { border-bottom-color: #FBC66B; }
@media (max-width: 900px) {
  .footer-bottom.fb2 { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 14px; padding-bottom: 96px; }
  .fb2 .fb-credit { justify-self: center; }
  .fb2 .fb-copy { order: 2; font-size: .8rem; }
  .fb2 .fb-links { order: 1; }
  .fb2 .fb-credit { order: 3; font-size: .8rem; }
}

/* membership band on phones: full-width button, link underneath; floating button steps aside */
@media (max-width: 560px) {
  .member-band-actions { flex-direction: column; align-items: stretch; gap: 12px; text-align: center; }
  .member-band-actions .btn { width: 100%; white-space: nowrap; }
}
.member-fab { transition: opacity .25s, transform .25s; }
.member-fab.is-away { opacity: 0; transform: translateY(16px); pointer-events: none; }

/* ===== system documents (certificate, receipt, invoice, loan slip...) on phones ===== */
@media (max-width: 640px) {
  .sysdoc { padding: 18px 16px; border-radius: 18px; }
  .sysdoc-cert::before { inset: 6px; border-radius: 13px; }
  .sysdoc-top { flex-direction: column; align-items: flex-start; gap: 8px; padding-bottom: 12px; margin-bottom: 14px; }
  .sysdoc-kicker { font-size: .66rem; letter-spacing: .08em; line-height: 1.3; }
  .sysdoc-serial { font-size: .68rem; padding: 3px 10px; white-space: nowrap; }

  /* letterhead: logo + name across, seal tucked into the corner */
  .sysdoc-letterhead { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 10px; margin-bottom: 14px; }
  .sysdoc-letterhead > *:not(.sysdoc-seal):not(.sysdoc-stamp) { min-width: 0; }
  .sysdoc-org { align-items: flex-start; gap: 10px; min-width: 0; }
  .sysdoc-org img { width: 38px; height: 38px; flex: none; }
  .sysdoc-org strong { font-size: .8rem; line-height: 1.25; letter-spacing: .02em; }
  .sysdoc-org small { font-size: .7rem; line-height: 1.35; display: block; margin-top: 2px; }
  .sysdoc-seal { width: 50px; height: 50px; font-size: .46rem; }
  .sysdoc-seal strong { font-size: .7rem; }
  .sysdoc-letterhead .sysdoc-stamp { font-size: .62rem; padding: 3px 8px; white-space: nowrap; }

  .sysdoc-title-block { margin-bottom: 12px; }
  .sysdoc-title-block .sysdoc-sub { font-size: .64rem; letter-spacing: .06em; }
  .sysdoc-title-block h3 { font-size: 1.12rem; line-height: 1.25; }
  .sysdoc-recipient { font-size: .92rem; line-height: 1.5; }
  .sysdoc-title-block p:not(.sysdoc-sub):not(.sysdoc-recipient) { font-size: .84rem; }

  .sysdoc-meta-grid { grid-template-columns: 1fr 1fr; gap: 10px 12px; padding: 12px; }
  .sysdoc-meta-grid div strong { font-size: .84rem; overflow-wrap: anywhere; }

  /* tables become stacked rows: the description on top, the other columns beneath it */
  .sysdoc-table, .sysdoc-table tbody { display: block; width: 100%; }
  .sysdoc-table thead { display: none; }
  .sysdoc-table tr { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--s200, #E2E8F0); }
  .sysdoc-table tr:last-child { border-bottom: 0; }
  .sysdoc-table td { display: block; padding: 0 !important; border: 0 !important; font-size: .8rem; }
  .sysdoc-table td:nth-child(2) { grid-column: 1 / -1; order: -1; font-size: .86rem; line-height: 1.4; }
  .sysdoc-table td:first-child { color: var(--s500, #64748B); font-size: .72rem; }
  .sysdoc-table td:last-child { text-align: right; }

  .sysdoc-foot { grid-template-columns: 1fr 1fr; gap: 12px; }
  .sysdoc-sig-line { font-size: .9rem; }
  .sysdoc-sig strong { font-size: .8rem; }
  .sysdoc-sig small { font-size: .68rem; }
  .sysdoc-qr { grid-column: 1 / -1; flex-direction: row; justify-content: center; gap: 10px; }
  .sysdoc-actions { flex-direction: column; align-items: stretch; text-align: center; }
  .sysdoc-actions .btn { justify-content: center; width: 100%; }
  .doc-tabs { gap: 8px; }
  .doc-tab { font-size: .8rem; padding: 8px 12px; }
}
@media (max-width: 360px) { .sysdoc-foot { grid-template-columns: 1fr; } .sysdoc-qr { grid-column: auto; } }
@media (max-width: 640px) {
  .doc-tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; padding: 2px 16px 10px; margin: 0 -16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 24px), transparent); }
  .doc-tabs::-webkit-scrollbar { display: none; }
  .doc-tab { flex: none; scroll-snap-align: start; white-space: nowrap; }
}

/* footer uses the header logo (wide) */
.footer-logo { display: inline-flex; align-items: center; padding: 12px 18px; border-radius: 16px; background: #fff; width: auto; height: auto; }
.footer-logo img { width: auto; height: 52px; max-width: 100%; display: block; }
@media (max-width: 560px) { .footer-logo img { height: 42px; } }

/* sample documents shown as PNG images */
.sysdoc-png { margin: 0; background: #fff; border: 1px solid #E3EAE5; border-radius: 22px; padding: 10px; box-shadow: 0 24px 52px -26px rgba(28, 25, 23, .22); }
.sysdoc-png .sp-img { display: block; border-radius: 14px; overflow: hidden; border: 0 !important; background: #EEF2EF; }
.sysdoc-png img { display: block; width: 100%; height: auto; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.sysdoc-png .sp-img:hover img { transform: scale(1.015); }
.sysdoc-png figcaption { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 8px 4px; font-size: .84rem; color: #475569; }
.sysdoc-png figcaption > span:first-child { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.sp-acts { display: flex; gap: 14px; }
.sp-acts a { font-weight: 700; color: #15803D; text-decoration: none; }
.sp-acts a:hover { text-decoration: underline; }
@media (max-width: 560px) { .sysdoc-png { padding: 6px; border-radius: 16px; } .sysdoc-png figcaption { flex-direction: column; align-items: flex-start; } }
/* samples: no saving, no printing */
.sysdoc-png .sp-img { position: relative; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.sysdoc-png img { pointer-events: none; -webkit-user-drag: none; }
.sp-shield { position: absolute; inset: 0; z-index: 2; background: transparent; }
.sp-note { font-size: .78rem; color: #94A3B8; }
@media print { .sysdoc-png, .sysdoc:not(.is-own) { visibility: hidden !important; } .sysdoc-png::before { content: "Sample documents cannot be printed."; visibility: visible; } }

/* event cards: optional thumbnail + RSVP button (home and events pages) */
.ev-card.has-img { grid-template-columns: 92px minmax(0, 1fr); grid-template-areas: "img img" "date body"; }
.ev-card.has-img .ev-img { grid-area: img; margin: -22px -22px 4px; border-radius: 18px 18px 0 0; overflow: hidden; aspect-ratio: 16 / 7; background: #E3EFE7; }
.ev-card.has-img .ev-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ev-card.has-img .ev-date { grid-area: date; } .ev-card.has-img .ev-body { grid-area: body; }
.home-events .ev-card.has-img { grid-template-columns: 70px minmax(0, 1fr); }
.home-events .ev-card.has-img .ev-img { margin: -18px -18px 4px; }
.ev-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.ev-rsvp small { font-weight: 500; opacity: .85; margin-left: 4px; }
.ev-full { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #FDECEC; color: #B91C1C; font-weight: 700; font-size: .84rem; }
@media (max-width: 600px) { .ev-card.has-img { grid-template-columns: 64px minmax(0, 1fr); } .ev-card.has-img .ev-img { margin: -16px -16px 4px; } }
.ev-actions a.ev-rsvp, .ev-actions a.ev-rsvp:hover { color: #fff !important; border-bottom: 0 !important; text-decoration: none !important; }
@media (min-width: 901px) {
  .ev-list .ev-card.has-img { grid-template-columns: 240px 92px minmax(0, 1fr); grid-template-areas: "img date body"; align-items: start; }
  .ev-list .ev-card.has-img .ev-img { margin: -22px 0 -22px -22px; border-radius: 18px 0 0 18px; aspect-ratio: auto; height: calc(100% + 44px); min-height: 180px; }
  .home-events .ev-list .ev-card.has-img { grid-template-columns: 70px minmax(0, 1fr); grid-template-areas: "img img" "date body"; }
  .home-events .ev-list .ev-card.has-img .ev-img { margin: -18px -18px 4px; border-radius: 18px 18px 0 0; aspect-ratio: 16 / 7; height: auto; min-height: 0; }
}

/* ---------- Menu dropdowns: compact and plain (2026-11-14) ---------- */
.site-nav .nav-dd { min-width: 0; width: max-content; max-width: 300px; }
.site-nav .nav-dd-inner { padding: 8px; gap: 2px; }
.site-nav .nav-dd-inner::before { height: 2px; margin: -8px -8px 6px; }
.site-nav .nav-dd-item { padding: 8px 12px 8px 8px; gap: 12px; align-items: center; }
.site-nav .nav-dd-item:hover, .site-nav .nav-dd-item:focus-visible { transform: none; }
.site-nav .nav-dd-ico { width: 34px; height: 34px; border-radius: 10px; flex: none; }
.site-nav .nav-dd-text strong { font-size: .92rem; font-weight: 600; line-height: 1.25; }
.site-nav .nav-dd-text small { font-size: .78rem; line-height: 1.3; white-space: nowrap; }

/* Footer bottom bar on phones (2026-11-24): text on the left, the right-hand strip is left free for the
   floating WhatsApp and back-to-top buttons, so nothing is covered and there is no empty block underneath. */
html { background: var(--s950, #0c0a09); }   /* pulling past the end of the page shows the footer colour, not a white strip */
@media (max-width: 900px) {
  .site-footer { padding-bottom: 22px; }
  .footer-bottom.fb2 { justify-items: start; text-align: left; gap: 12px; margin-top: 22px; padding: 18px 72px 0 0; }
  .fb2 .fb-links { justify-content: flex-start; gap: 6px 14px; }
  .fb2 .fb-links a { height: auto; padding: 2px 0; border: 0; border-radius: 0; background: none; font-size: .86rem; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .28); text-underline-offset: 4px; }
  .fb2 .fb-links a:hover { background: none; color: #FBC66B; text-decoration-color: #FBC66B; }
  .fb2 .fb-credit { justify-self: start; }
  .fb2 .fb-copy, .fb2 .fb-credit { font-size: .78rem; line-height: 1.5; }
}
@media (max-width: 600px) {
  /* back-to-top sits centred above the WhatsApp button */
  .to-top { right: 22px; bottom: 82px; width: 44px; height: 44px; border-radius: 50%; }
}
