/* ==========================================================================
   Page-specific styles
   ========================================================================== */

/* ---------- Home ---------- */
.home-greeting { font-size: 13px; color: var(--color-muted); font-weight: 600; }
.home-title { font-size: 20px; font-weight: 800; margin-top: 2px; }
.home-header-row { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 18px; }
.home-header-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text);
  position: relative;
  flex-shrink: 0;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--color-danger); border: 1.5px solid var(--color-surface); }

.hero-panel {
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary) 60%, var(--color-secondary));
  border-radius: var(--radius-xl);
  color: #fff;
  padding: 26px 22px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}
.hero-panel::after {
  content: "";
  position: absolute;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  right: -60px; top: -60px;
}
.hero-panel::before {
  content: "";
  position: absolute;
  width: 170px; height: 170px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  left: -50px; bottom: -60px;
}
@media (prefers-reduced-motion: no-preference) {
  .hero-panel::after { animation: heroBlobFloatA 10s ease-in-out infinite; }
  .hero-panel::before { animation: heroBlobFloatB 12s ease-in-out infinite; }
}
@keyframes heroBlobFloatA {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-16px, 14px) scale(1.08); }
}
@keyframes heroBlobFloatB {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(14px, -12px) scale(1.1); }
}
.hero-panel .eyebrow { color: rgba(255,255,255,.75); letter-spacing: .02em; }
.hero-panel h1 { font-size: 22px; font-weight: 800; line-height: 1.3; margin: 8px 0 6px; position: relative; }
.hero-panel p { font-size: 13.5px; color: rgba(255,255,255,.82); max-width: 420px; position: relative; }

/* ---------- Home hero slider ---------- */
.hero-slider {
  padding-bottom: 32px; /* room for the dot rail */
}
.hero-slides {
  display: grid;
  padding: 0 30px; /* clears text from the overlaid prev/next buttons */
}
.hero-slide {
  grid-area: 1 / 1;
  position: relative;
  opacity: 0;
  transform: translateY(10px) scale(.99);
  pointer-events: none;
  visibility: hidden;
  transition: opacity .55s ease, transform .55s ease, visibility 0s linear .55s;
}
.hero-slide.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
  transition: opacity .55s ease, transform .55s ease;
}
.hero-slide-icon {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,.16);
  margin-bottom: 10px;
}
.hero-slide-icon svg { width: 19px; height: 19px; }

.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.14);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  opacity: .65;
  transition: background .2s ease, opacity .2s ease;
  z-index: 2;
}
.hero-nav:hover { background: rgba(255,255,255,.3); opacity: 1; }
.hero-nav svg { width: 17px; height: 17px; }
.hero-nav.prev { left: 8px; }
.hero-nav.next { right: 8px; }

.hero-dots {
  position: absolute;
  left: 22px;
  bottom: 16px;
  display: flex;
  gap: 7px;
  z-index: 2;
}
.hero-dot {
  width: 20px; height: 4px;
  border-radius: 2px;
  border: none;
  padding: 0;
  background: rgba(255,255,255,.3);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.hero-dot-fill {
  position: absolute;
  inset: 0;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left;
}
.hero-dot.active .hero-dot-fill {
  animation: heroDotFill 6s linear forwards;
}
@keyframes heroDotFill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-panel::after, .hero-panel::before { animation: none; }
  .hero-slide { transition: opacity .2s linear; transform: none; }
  .hero-slide.active { transition: opacity .2s linear; }
  .hero-dot.active .hero-dot-fill { animation: none; transform: scaleX(1); }
}

/* ---------- Home advertisement carousel ----------
   A real horizontal scroll-snap track, not a stacked crossfade like the
   hero slider above — banner images render at their own natural aspect
   ratio (auto width/height, no cropping), so each slide sizes itself. */
.ad-slider { position: relative; }
.ad-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  border-radius: var(--radius-lg);
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.ad-track::-webkit-scrollbar { display: none; }

.ad-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  min-width: 0;
}

.ad-slide-card {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  margin: 0 2px;
}

.ad-slide-img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--color-surface-alt);
}

.ad-member-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
}
.ad-member-row .avatar, .ad-member-row .avatar-placeholder { flex-shrink: 0; }

.ad-member-info { min-width: 0; flex: 1; }
.ad-member-name { font-size: 13.5px; font-weight: 700; color: var(--color-text); }
.ad-business-name { font-size: 12.5px; font-weight: 600; color: var(--color-primary); margin-top: 1px; }
.ad-business-keywords {
  font-size: 12px;
  color: var(--color-muted);
  margin-top: 2px;
  /* Full value shown, wrapping onto more lines rather than being cut off. */
}

.ad-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}
.ad-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-border);
  border: none;
  padding: 0;
  transition: background var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard);
}
.ad-dot.active { background: var(--color-secondary); transform: scale(1.25); }

.section { margin-bottom: 28px; }

/* ---------- Login ---------- */
.login-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, var(--color-primary-dark), var(--color-primary) 55%, var(--color-secondary));
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
}
.login-card .brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; justify-content: center; }
.login-card .brand-row img { height: 40px; }
.login-card h1 { font-size: 21px; font-weight: 800; text-align: center; }
.login-card .subtitle { text-align: center; color: var(--color-muted); font-size: 13.5px; margin: 4px 0 22px; }
.login-forgot { text-align: right; font-size: 12.5px; font-weight: 600; color: var(--color-secondary); margin-top: -8px; margin-bottom: 18px; display: inline-block; min-height: 24px; background: none; border: none; padding: 0; font-family: inherit; cursor: pointer; }
.login-footer-note { text-align: center; font-size: 12px; color: var(--color-muted-2); margin-top: 20px; }
.form-error { background: var(--color-danger-bg); color: var(--color-danger); font-size: 13px; font-weight: 600; padding: 10px 12px; border-radius: var(--radius-md); margin-bottom: 16px; }
.static-value { padding: 10px 12px; border-radius: var(--radius-md); background: var(--color-surface-alt); font-size: 14px; color: var(--color-text); word-break: break-word; }

/* ---------- Offline page (shown when the live API can't be reached at all) ---------- */
.offline-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: linear-gradient(160deg, var(--color-primary-dark), var(--color-primary) 55%, var(--color-secondary));
}
.offline-card { max-width: 360px; }
.offline-card img { height: 44px; filter: brightness(0) invert(1); margin-bottom: 22px; }
.offline-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
  color: #fff;
}
.offline-icon svg { width: 28px; height: 28px; }
.offline-card h1 { font-size: 19px; font-weight: 800; color: #fff; margin: 0 0 8px; }
.offline-card p { font-size: 14px; color: rgba(255,255,255,.8); margin: 0 0 22px; line-height: 1.6; }
.offline-card .btn-primary { background: #fff; color: var(--color-primary-dark); border-color: #fff; padding: 0 26px; }
.offline-card .btn-primary:hover { background: rgba(255,255,255,.9); }

/* ---------- Member Profile ---------- */
.profile-hero {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  border: 1px solid var(--color-border);
}
.profile-hero .avatar, .profile-hero .avatar-placeholder { width: 88px; height: 88px; font-size: 28px; margin: 0 auto 12px; }
.profile-hero h1 { font-size: 18px; font-weight: 800; }
.profile-hero .designation { color: var(--color-secondary); font-weight: 700; font-size: 13.5px; margin-top: 2px; }
.profile-hero .idrow { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; }
.profile-actions { display: flex; gap: 10px; margin: 18px 0; }
.profile-actions .btn { flex: 1; }

/* ---------- Board / Leadership page ---------- */
.leadership-hero {
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  border-radius: var(--radius-xl);
  padding: 28px 22px;
  color: #fff;
  text-align: center;
  margin-bottom: 22px;
}
.leadership-hero .eyebrow { color: var(--color-accent); }
.leadership-hero h1 { font-size: 22px; font-weight: 800; margin-top: 8px; }

/* ---------- Past Presidents timeline ---------- */
.pp-timeline-card { display: flex; gap: 14px; align-items: center; padding: 16px 16px 20px; }
.pp-avatar-wrap { position: relative; flex-shrink: 0; }
.pp-year-chip {
  position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%);
  background: var(--color-primary-dark); color: #fff;
  font-weight: 800; font-size: 10.5px; line-height: 1; white-space: nowrap;
  padding: 3px 7px; border-radius: 999px; border: 2px solid var(--color-surface);
}

/* ---------- Events / Calendar ---------- */
.calendar-card { padding: 16px; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.calendar-head .month-label { font-weight: 700; font-size: 14.5px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.calendar-grid .dow { font-size: 10.5px; font-weight: 700; color: var(--color-muted-2); padding-bottom: 6px; }
.calendar-cell {
  aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--color-text);
  position: relative;
  min-height: 34px;
}
.calendar-cell.muted { color: var(--color-muted-2); font-weight: 400; }
.calendar-cell.today { background: var(--color-primary); color: #fff; }
.calendar-cell .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--color-secondary); margin-top: 2px; }
.calendar-cell.today .dot { background: #fff; }
.calendar-cell.has-birthday .dot { background: var(--color-accent); }
.calendar-cell:not(.today):hover { background: var(--color-surface-alt); cursor: default; }

/* ---------- Event details ---------- */
/* Full height, not cropped — the whole poster image is shown at its own
   aspect ratio (width:100%, height:auto), never object-fit:cover. The
   gradient + min-height only shows through as a placeholder while there's
   no image (or before it loads). */
.event-hero-img { border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--color-primary), var(--color-secondary)); overflow: hidden; margin-bottom: 16px; min-height: 220px; display: flex; align-items: center; justify-content: center; }
.event-hero-img img { display: block; width: 100%; height: auto; }

/* Event photo gallery — horizontal slider of thumbnails; tap one to open
   it (and step through the rest) in the full-screen lightbox. */
.event-gallery { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.event-gallery-item { flex: 0 0 auto; width: 110px; height: 110px; border-radius: var(--radius-md); overflow: hidden; scroll-snap-align: start; border: none; padding: 0; cursor: zoom-in; background: var(--color-surface-alt); }
.event-gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.event-gallery-item:focus-visible { outline: 2px solid var(--color-secondary); outline-offset: 2px; }
.sticky-cta {
  position: sticky;
  bottom: calc(var(--bottomnav-height) + env(safe-area-inset-bottom) + 10px);
  z-index: 5;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: var(--shadow-md);
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
@media (min-width: 1024px) { .sticky-cta { position: static; } }

/* ---------- Blood ---------- */
.blood-hero {
  background: linear-gradient(135deg, #7A1626, var(--color-blood));
  border-radius: var(--radius-xl);
  color: #fff;
  padding: 26px 22px;
  margin-bottom: 20px;
  text-align: center;
}
.blood-hero h1 { font-size: 21px; font-weight: 800; margin-top: 6px; }
.blood-hero p { font-size: 13px; color: rgba(255,255,255,.85); margin-top: 4px; }
.blood-actions-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.blood-actions-row.single { grid-template-columns: minmax(0, 200px); justify-content: center; }
.blood-action-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 8px;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  text-align: center;
}
.blood-action-card .icon { width: 40px; height: 40px; border-radius: 50%; background: var(--color-blood-bg); color: var(--color-blood); display: flex; align-items: center; justify-content: center; }
.blood-action-card span { font-size: 12px; font-weight: 700; }

/* ---------- Roll of Honour ---------- */
.roh-filter-row { margin-bottom: 16px; }

/* ---------- About pages ---------- */
.about-hero {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 26px 22px;
  margin-bottom: 20px;
}
.value-card { padding: 16px; text-align: center; }
.value-card .icon { width: 44px; height: 44px; border-radius: var(--radius-md); background: var(--color-secondary-light); color: var(--color-primary); display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; }

.app-credit { margin-top: 4px; }
.app-credit-card { text-align: center; }
.app-credit-card .text-xs { margin-bottom: 4px; }
.app-credit-link { font-size: 13.5px; font-weight: 700; color: var(--color-secondary); text-decoration: none; }
.app-credit-link:hover { text-decoration: underline; }

/* ---------- Notifications ---------- */
.notif-filter-row { margin-bottom: 14px; }

/* ---------- Search page ---------- */
.search-group-title { font-size: 12.5px; font-weight: 700; color: var(--color-muted); text-transform: uppercase; letter-spacing: .04em; margin: 18px 0 8px; }
.search-group-title:first-child { margin-top: 0; }

/* ---------- More menu ---------- */
.more-section-title { font-size: 12px; font-weight: 700; color: var(--color-muted); text-transform: uppercase; letter-spacing: .05em; padding: 18px 16px 8px; }
.more-link { display: flex; align-items: center; gap: 14px; padding: 13px 16px; font-size: 14.5px; font-weight: 600; min-height: 44px; }
.more-link svg { width: 20px; height: 20px; color: var(--color-primary); }
.more-link:active { background: var(--color-surface-alt); }

/* ---------- Settings ---------- */
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; min-height: 44px; }
.settings-row .label-group .title { font-size: 14px; font-weight: 600; }
.settings-row .label-group .desc { font-size: 12px; color: var(--color-muted); margin-top: 1px; }

.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; background: var(--color-border-strong); border-radius: var(--radius-full); transition: background var(--duration-base) var(--ease-standard); }
.switch .thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; box-shadow: var(--shadow-sm); transition: transform var(--duration-base) var(--ease-standard); }
.switch input:checked ~ .track { background: var(--color-secondary); }
.switch input:checked ~ .thumb { transform: translateX(20px); }

/* ---------- Splash (first load) ---------- */
.splash-screen {
  position: fixed; inset: 0;
  background: linear-gradient(160deg, var(--color-primary-dark), var(--color-primary));
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px;
  z-index: 200;
  transition: opacity var(--duration-slow) var(--ease-standard);
}
.splash-screen img { height: 52px; filter: brightness(0) invert(1); }
.splash-screen .spinner {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.splash-screen.hide { opacity: 0; pointer-events: none; }
