/* Portal CRJ V12: motion and athlete photo viewer. CSS scoped to institutional pages. */
:root { --crj12-gold: #d7b36c; }

/* Interactive logo: pointer/focus only, without moving the page layout. */
@media (hover: hover) and (pointer: fine) {
  body.v7 .brand:hover .brand-mark,
  body.v7 .brand:focus-visible .brand-mark,
  body.v7 .hero-ring:hover img,
  body.v7 .hero-ring:focus-within img {
    animation: crj12-logo-pulse 1.15s ease-in-out infinite;
    box-shadow: 0 0 0 5px rgba(218,180,100,.20), 0 0 24px rgba(219,180,102,.43);
  }
}
@keyframes crj12-logo-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.065); }
}
body.v7 .brand-mark, body.v7 .hero-ring img {
  transform-origin: center;
  will-change: auto;
}

/* Gentle reveal; content stays readable even while animation runs. */
body.v7.crj12-motion .crj12-reveal { opacity: .78; }
body.v7.crj12-motion .crj12-reveal.crj12-visible {
  animation: crj12-fade-in .65s ease-out both;
}
@keyframes crj12-fade-in {
  from { opacity: .78; }
  to { opacity: 1; }
}
body.v7 .content-card,
body.v7 .academy-card,
body.v7 .gallery-tile,
body.v7 .crj-atleta-cartao {
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}
@media (hover: hover) and (pointer: fine) {
  body.v7 .content-card:hover,
  body.v7 .academy-card:hover,
  body.v7 .gallery-tile:hover,
  body.v7 .crj-atleta-cartao.crj12-zoomable:hover {
    box-shadow: 0 18px 40px rgba(8,27,46,.17);
    border-color: rgba(184,147,78,.65);
    transform: translateY(-4px);
  }
}
body.v7 :is(.btn-v7, .card-link, .text-link, .crj-atletas-filtros button):focus-visible,
body.v7 .crj12-photo-trigger:focus-visible {
  outline: 3px solid #d6aa52;
  outline-offset: 4px;
}

/* Responsive finishing touches: never touch administrative form widths. */
body.v7 #conteudo,
body.v7 .section-v7,
body.v7 .crj-atletas-conteudo {
  min-width: 0;
}
body.v7 .v7-grid > *, body.v7 .crj-atletas-grade > * { min-width: 0; }
body.v7 :is(.content-card, .academy-card, .crj-atleta-cartao) h3 { overflow-wrap: anywhere; }
body.v7 img { max-width: 100%; }
@media (max-width: 760px) {
  body.v7 .hero-content h1 { font-size: clamp(37px, 9vw, 64px); line-height: 1.07; }
  body.v7 .hero-actions { gap: 9px; }
  body.v7 .hero-actions .btn-v7 { min-height: 44px; }
  body.v7 .site-header .brand { min-width: 0; }
  body.v7 .site-header .brand > span:last-child { min-width: 0; }
  body.v7 .crj-atletas-grade { gap: clamp(9px, 2.5vw, 16px); }
  body.v7 .crj-atletas-filtros button { min-height: 44px; }
  body.v7 .site-header nav a { min-height: 44px; }
}
@media (max-width: 420px) {
  body.v7 .crj-atletas-grade { grid-template-columns: minmax(0,1fr); }
  body.v7 .crj-atleta-cartao { max-width: 380px; width: 100%; margin-inline: auto; }
  body.v7 .crj-atleta-dados h3 { font-size: clamp(24px, 6vw, 30px); }
  body.v7 .hero-visual { height: 270px; }
  body.v7 .hero-ring { width: 210px; height: 210px; }
  body.v7 .hero-ring::before { width: 225px; }
  body.v7 .hero-ring::after { width: 247px; }
}

/* Adult athlete photos: actual source stays the existing public age-checked route. */
body.v7 .crj-atleta-cartao.crj12-zoomable { cursor: zoom-in; }
body.v7 .crj-atleta-foto .crj12-photo-trigger {
  border: 0; padding: 0; margin: 0; width: 100%; height: 100%;
  display: block; background: transparent; cursor: zoom-in; font: inherit;
}
body.v7 .crj-atleta-foto .crj12-photo-trigger img {
  width: 100%; height: 100%; display: block; object-fit: cover;
  transition: transform .32s ease;
}
@media (hover: hover) and (pointer: fine) {
  body.v7 .crj-atleta-foto .crj12-photo-trigger:hover img { transform: scale(1.04); }
}
body.v7 .crj-atleta-foto .crj12-photo-trigger:focus-visible {
  outline: 4px solid #d9b675; outline-offset: -5px;
}

.crj12-lightbox[hidden] { display: none !important; }
.crj12-lightbox {
  position: fixed; inset: 0; z-index: 2147482000;
  display: flex; align-items: center; justify-content: center;
  padding: max(14px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
           max(14px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  color: #fff; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
}
.crj12-lightbox * { box-sizing: border-box; }
.crj12-lightbox__shade { position:absolute;inset:0;background:rgba(3,11,21,.95); }
.crj12-lightbox__panel {
  position:relative; z-index:1; width:min(100%, 1100px); max-height:100%;
  display:flex;flex-direction:column;align-items:stretch;overflow:hidden;
  background:#0b1e32; border:1px solid rgba(230,194,119,.45);
  border-radius:16px;box-shadow:0 25px 95px rgba(0,0,0,.5);
}
.crj12-lightbox__header {
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:11px 14px; min-height:56px; border-bottom:1px solid rgba(221,187,120,.25);
}
.crj12-lightbox__label { color:#e8c887;font-size:11px;font-weight:800;letter-spacing:.14em; }
.crj12-lightbox__header button,
.crj12-lightbox__nav button {
  color:#fff; background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.32);
  border-radius:50%;width:44px;height:44px;display:grid;place-items:center;
  cursor:pointer; font:32px/1 Arial,sans-serif; flex-shrink:0;
}
.crj12-lightbox__header button:hover,
.crj12-lightbox__nav button:hover { background:rgba(220,180,105,.22); }
.crj12-lightbox button:focus-visible { outline:3px solid #e7c27a;outline-offset:2px; }
.crj12-lightbox__nav {
  min-height:0; display:grid; grid-template-columns:52px minmax(0,1fr) 52px;
  align-items:center;gap:8px;padding:10px 8px;
}
.crj12-lightbox__photo {
  display:block; max-width:100%; width:100%;height:auto;
  max-height:min(70vh, 760px); max-height:min(70dvh, 760px);
  object-fit:contain; margin:auto; border-radius:6px;
}
.crj12-lightbox__nav button { justify-self:center; }
.crj12-lightbox__nav button:disabled { opacity:.3;cursor:default; }
.crj12-lightbox__details { padding:10px 19px 17px;text-align:center; }
.crj12-lightbox__details h2 { color:#f4f4f7;margin:0 0 3px;font-size:clamp(20px,3vw,28px);line-height:1.2; }
.crj12-lightbox__details p { margin:3px 0;color:#e0c28a;font-size:13px; }
.crj12-lightbox__counter {color:#abb8c7!important;font-size:11px!important;}
@media(max-width:540px) {
  .crj12-lightbox__panel { border-radius:9px; }
  .crj12-lightbox__nav { grid-template-columns:42px minmax(0,1fr) 42px;gap:1px;padding:8px 4px; }
  .crj12-lightbox__nav button { width:40px;height:40px;font-size:28px; }
  .crj12-lightbox__photo {max-height:65vh;max-height:65dvh;}
  .crj12-lightbox__header { min-height:52px; }
  .crj12-lightbox__details {padding:7px 10px 12px;}
}
@media(prefers-reduced-motion:reduce) {
  body.v7.crj12-motion .crj12-reveal,
  body.v7.crj12-motion .crj12-reveal.crj12-visible {opacity:1;animation:none!important;}
  body.v7 .brand-mark,
  body.v7 .hero-ring img {animation:none!important;transform:none!important;}
  body.v7 :is(.content-card,.academy-card,.gallery-tile,.crj-atleta-cartao),
  body.v7 .crj12-photo-trigger img {transition:none!important;transform:none!important;}
}
.crj12-lightbox [hidden] { display: none !important; }
