/* ═══════════════════════════════════════════════════════════════
   S.A.F V15 — Polish Layer
   Load AFTER styles.css. Pure additive — no overrides of identity.
   ═══════════════════════════════════════════════════════════ */

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

/* ── Better tap highlight on mobile ───────────────────────── */
html {
  -webkit-tap-highlight-color: rgba(201, 168, 76, 0.18);
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

/* ── Universal focus ring (a11y) ──────────────────────────── */
:focus-visible {
  outline: 2px solid #c9a84c;
  outline-offset: 3px;
  border-radius: 4px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
  box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.32);
}

/* ── Page-transition micro-fade (triggered by v15-upgrade.js) */
.v15-fade-in {
  animation: v15FadeIn 320ms cubic-bezier(.2, .7, .2, 1) both;
}
@keyframes v15FadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── content-visibility on long lists for perf ────────────── */
#members-grid > .member-list-item,
.news-card,
.bl-card,
#activity-feed > * {
  content-visibility: auto;
  contain-intrinsic-size: 0 180px;
}

/* ── Selection styling matches identity ───────────────────── */
::selection {
  background: rgba(201, 168, 76, 0.32);
  color: #f5e9c7;
}

/* ── Scrollbar polish (WebKit) ────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0a0608; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6b1a2a, #c9a84c);
  border-radius: 10px;
  border: 2px solid #0a0608;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #c9a84c, #6b1a2a); }

/* ── Image-fade when lazy-loaded ──────────────────────────── */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 320ms ease;
}
img[loading="lazy"].loaded,
img[loading="lazy"]:not([data-pending]) {
  opacity: 1;
}

/* ── Tighter modal entrance (no jank on slow phones) ──────── */
.modal-box, .admin-modal-box, .member-popup-box {
  will-change: transform, opacity;
  transform: translateZ(0);
}

/* ── Print: hide nav, show clean content ──────────────────── */
@media print {
  #app-header, #bottom-nav, #nav-drawer, #drawer-scrim,
  .nav-lock-btn, #announcement-banner { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
}
