/* 肥仔集會所 V82：跨頁設計基礎、手機操作與可及性修復 */
:root {
  --fbc-bg: #14172a;
  --fbc-surface: #202543;
  --fbc-surface-strong: #292f52;
  --fbc-text: #f8f7ef;
  --fbc-muted: #c8c9d6;
  --fbc-orange: #ff7a18;
  --fbc-red: #f13c31;
  --fbc-cyan: #55e5ef;
  --fbc-gold: #f6d66c;
  --fbc-line: rgba(255, 255, 255, 0.16);
  --fbc-radius: 14px;
  --fbc-focus: 0 0 0 4px rgba(85, 229, 239, 0.32);
}

html {
  scroll-padding-top: 88px;
}

body {
  color: var(--fbc-text);
  background: var(--fbc-bg);
  text-rendering: optimizeLegibility;
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--fbc-cyan);
  outline-offset: 3px;
  box-shadow: var(--fbc-focus);
}

:where(button, .btn, .link-btn, input, select, textarea, summary) {
  font: inherit;
}

:where(button, .btn, .link-btn, .topnav a, .mobile-nav a, .admin-side-nav a) {
  min-height: 44px;
}

:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  min-height: 44px;
}

.skip-link {
  position: fixed;
  z-index: 9999;
  top: 10px;
  left: 10px;
  translate: 0 -160%;
  padding: 10px 14px;
  border-radius: 8px;
  color: #11162a;
  background: var(--fbc-cyan);
  font-weight: 900;
}

.skip-link:focus {
  translate: 0;
}

.section {
  padding-block: clamp(48px, 7vw, 82px);
}

.section > h2,
.home-memories h2 {
  max-width: 22ch;
  font-size: clamp(1.75rem, 5vw, 3.3rem);
  line-height: 1.08;
  text-wrap: balance;
}

.hero {
  min-height: auto;
  padding-block: clamp(34px, 7vw, 80px);
}

.hero-inner {
  gap: clamp(14px, 2.5vw, 24px);
}

.hero-logo-frame {
  max-width: min(100%, 520px);
  margin-inline: auto;
}

.hero-logo {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: cover;
}

.hero-sub {
  max-width: 58ch;
}

.home-quick-actions {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  max-width: 1180px;
  margin: -22px auto 0;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}

.home-quick-actions a {
  display: grid;
  place-items: center;
  min-height: 70px;
  padding: 10px;
  border: 1px solid var(--fbc-line);
  border-bottom: 3px solid var(--fbc-orange);
  border-radius: 10px;
  color: var(--fbc-text);
  background: var(--fbc-surface);
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.home-quick-actions a:hover {
  background: var(--fbc-surface-strong);
  border-bottom-color: var(--fbc-cyan);
}

#next {
  padding-bottom: 32px;
}

#calendar {
  padding-top: 38px;
}

#events .event-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

#events .event-card {
  min-width: 0;
  height: 100%;
  align-content: start;
  border-radius: var(--fbc-radius);
}

.home-list-toggle {
  grid-column: 1 / -1;
  justify-self: center;
  min-width: min(100%, 280px);
  margin-top: 8px;
}

#notice .notice-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

#notice .notice-card {
  margin: 0;
  border-radius: var(--fbc-radius);
}

#notice .home-list-toggle {
  grid-column: 1 / -1;
}

.points-disclosure {
  border: 1px solid var(--fbc-line);
  border-radius: var(--fbc-radius);
  background: var(--fbc-surface);
}

.points-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 58px;
  padding: 14px 18px;
  cursor: pointer;
  color: var(--fbc-gold);
  font-weight: 900;
  list-style: none;
}

.points-disclosure > summary::-webkit-details-marker {
  display: none;
}

.points-disclosure > summary::after {
  content: "+";
  font-size: 1.5rem;
}

.points-disclosure[open] > summary::after {
  content: "−";
}

.points-disclosure-body {
  padding: 0 18px 18px;
}

.admin-page .admin-side-nav {
  scrollbar-width: thin;
  overscroll-behavior: contain;
}

.admin-page .admin-section {
  scroll-margin-top: 88px;
}

.admin-page .admin-main-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-page .admin-main-actions .btn {
  justify-content: center;
}

.admin-page :where(.panel, .admin-section, .admin-stat-grid article) {
  border-radius: var(--fbc-radius);
}

.privacy-nav,
.page-anchor-nav {
  scrollbar-width: thin;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 900px) {
  .home-quick-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #events .event-list,
  #notice .notice-list {
    grid-template-columns: 1fr;
  }

  .admin-page .admin-main-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  html {
    scroll-padding-top: 70px;
  }

  .section {
    padding-block: 40px;
  }

  .hero {
    padding: 24px 16px 42px;
  }

  .hero-logo {
    max-height: 190px;
  }

  .hero h1 {
    font-size: clamp(2.15rem, 12vw, 3.45rem);
  }

  .home-quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: -18px;
    padding-inline: 14px;
  }

  .home-quick-actions a {
    min-height: 58px;
    padding: 8px;
    font-size: 0.9rem;
  }

  .hero-cta,
  .member-feedback-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .cal-nav,
  .cal-today,
  .cal-filter,
  .cal-date-button,
  .cal-more,
  .modal-close {
    min-width: 44px;
    min-height: 44px;
  }

  .cal-day {
    min-height: 58px;
  }

  .cal-ev {
    min-height: 34px;
  }

  .event-card .btn,
  .cal-agenda-action .btn,
  .auth-card .btn {
    width: 100%;
  }

  .mobile-nav a {
    min-height: 52px;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
  }

  .admin-page .admin-main-actions {
    grid-template-columns: 1fr;
  }

  .admin-page .admin-main-actions .btn {
    width: 100%;
  }

  .admin-page .admin-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 360px) {
  .home-quick-actions,
  .admin-page .admin-stat-grid {
    grid-template-columns: 1fr;
  }
}

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