/* Cohentai A-Z Index — front.css (Canary Test v2.2.2)
   - WCAG 2.2 AA Touch Targets (min 44x44px)
   - Brand Alignment (#f15958)
   - Ranking Badges & Generous 58px Thumbnails
   - Pill Badges for Galleries Count
   - Fade-Mask Alphabet Navigation with Smooth Centering
   - Skeleton Shimmer Screen for Zero Perceived Latency
   - Layout Containment (CLS = 0)
*/

.cohentai-alpha-index.cohentai-az,
.cohentai-alpha-index-test.cohentai-az{
  --fg:#111827;
  --muted:#6b7280;
  --line:rgba(15,23,42,.10);
  --panel:rgba(255,255,255,.94);
  --card-bg:rgba(0,0,0,.02);
  --card-bg-hover:rgba(0,0,0,.045);
  --avatar-bg:rgba(0,0,0,.04);
  --shadow:0 10px 30px rgba(0,0,0,.08);
  --brand:#f15958;
  --brand-subtle:rgba(241,89,88,.12);
  --brand-border:rgba(241,89,88,.35);

  color:var(--fg);
}
.cohentai-alpha-index.cohentai-az.az-dark,
.cohentai-alpha-index-test.cohentai-az.az-dark{
  --fg:#e5e7eb;
  --muted:#9ca3af;
  --line:rgba(229,231,235,.14);
  --panel:rgba(18,18,18,.94);
  --card-bg:rgba(255,255,255,.04);
  --card-bg-hover:rgba(255,255,255,.07);
  --avatar-bg:rgba(255,255,255,.06);
  --shadow:0 10px 30px rgba(0,0,0,.4);
  --brand:#ff6867;
  --brand-subtle:rgba(241,89,88,.22);
  --brand-border:rgba(241,89,88,.45);
}

/* Hidden robust */
.cohentai-az [hidden]{display:none !important}
/* Fuerza legibilidad en enlaces */
.cohentai-az a{color:var(--fg) !important}
.cohentai-az .az-page-title{margin:0;padding:1rem .75rem .35rem;color:var(--fg);font-size:clamp(1.6rem,4vw,2.25rem);line-height:1.15}

/* ---- Search ---- */
.cohentai-az .alpha-search{position:relative;display:flex;gap:.5rem;align-items:center;padding:.75rem;border-bottom:1px solid var(--line)}
.cohentai-az .alpha-input{flex:1;padding:.75rem 1rem;border:1px solid var(--line);border-radius:.85rem;font-size:1rem;background:var(--card-bg);color:var(--fg);outline:none;transition:border-color .15s ease, box-shadow .15s ease}
.cohentai-az .alpha-input:focus{box-shadow:0 0 0 3px rgba(241,89,88,.2);border-color:var(--brand)}
.cohentai-az .clear-btn{border:1px solid var(--line);background:transparent;border-radius:.85rem;padding:.75rem 1rem;font-weight:800;line-height:1;cursor:pointer;color:var(--fg);transition:background-color .15s ease}
.cohentai-az .clear-btn:hover{background:var(--card-bg-hover)}

.cohentai-az .az-results{
  position:absolute;left:.75rem;right:.75rem;top:calc(100% + .4rem);
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:1rem;
  box-shadow:var(--shadow);
  max-height:52vh;
  overflow:auto;
  z-index:60;
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}
.cohentai-az .az-result{display:flex;align-items:center;gap:.75rem;padding:.65rem .85rem;text-decoration:none;color:var(--fg);transition:background-color .15s ease}
.cohentai-az .az-result:hover,.cohentai-az .az-result.active{background:var(--card-bg-hover)}
.cohentai-az .az-result-thumb{width:38px;height:38px;aspect-ratio:1/1;border-radius:.65rem;object-fit:cover;flex:0 0 auto;contain:paint layout}
.cohentai-az .az-result-avatar{width:38px;height:38px;border-radius:.65rem;background:var(--avatar-bg);display:grid;place-items:center;flex:0 0 auto}
.cohentai-az .az-result-name{flex:1 1 auto;font-weight:600;line-height:1.15}
.cohentai-az .az-result-name mark{background:rgba(241,89,88,.22);color:inherit;padding:0 .25rem;border-radius:.3rem}
.cohentai-az .az-result-count{color:var(--muted);font-size:.85em;font-weight:700}
.cohentai-az .az-nores{padding:.8rem .85rem;color:var(--muted);font-style:italic}

/* ---- Top Cards (Hall of Fame) ---- */
.cohentai-az .az-top{padding:1.1rem .75rem 1.25rem;border-bottom:1px solid var(--line)}
.cohentai-az .az-top-head{display:flex;flex-direction:column;gap:.2rem;margin-bottom:.85rem}
.cohentai-az .az-top-h{margin:0;font-size:1.15rem;font-weight:800;letter-spacing:-0.01em}
.cohentai-az .az-top-sub{color:var(--muted);font-size:.9rem}
.cohentai-az .az-top-grid{display:grid;grid-template-columns:1fr;gap:.6rem}
@media (min-width:560px){ .cohentai-az .az-top-grid{grid-template-columns:1fr 1fr} }
@media (min-width:960px){ .cohentai-az .az-top-grid{grid-template-columns:1fr 1fr 1fr} }

.cohentai-az .az-top-card{
  position:relative;
  display:flex;
  align-items:center;
  gap:.8rem;
  border:1px solid var(--line);
  border-radius:1rem;
  background:var(--card-bg);
  padding:.75rem .85rem;
  text-decoration:none;
  color:var(--fg);
  transition:transform .15s cubic-bezier(.4,0,.2,1), border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
  overflow:hidden;
}
.cohentai-az .az-top-card:hover{
  background:var(--card-bg-hover);
  border-color:var(--brand-border);
  box-shadow:0 6px 20px rgba(0,0,0,.06);
  transform:translateY(-1px);
  text-decoration:none !important;
}
.cohentai-az .az-top-card:active{
  transform:scale(.98);
  border-color:var(--brand);
}

/* Ranking Badges (#1, #2, #3, ...) */
.cohentai-az .az-rank-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:26px;
  height:26px;
  border-radius:.6rem;
  font-size:.74rem;
  font-weight:900;
  letter-spacing:-.02em;
  flex-shrink:0;
  background:rgba(15,23,42,.07);
  color:var(--muted);
}
.cohentai-az.az-dark .az-rank-badge{
  background:rgba(255,255,255,.09);
  color:#cbd5e1;
}
.cohentai-az .az-rank-badge.az-rank-1{
  background:linear-gradient(135deg, #f59e0b, #d97706);
  color:#fff;
  box-shadow:0 2px 8px rgba(217,119,6,.35);
}
.cohentai-az .az-rank-badge.az-rank-2{
  background:linear-gradient(135deg, #94a3b8, #64748b);
  color:#fff;
  box-shadow:0 2px 8px rgba(100,116,139,.35);
}
.cohentai-az .az-rank-badge.az-rank-3{
  background:linear-gradient(135deg, #d97706, #b45309);
  color:#fff;
  box-shadow:0 2px 8px rgba(180,83,9,.35);
}

.cohentai-az .az-top-thumb{
  width:58px;
  height:58px;
  aspect-ratio:1/1;
  border-radius:.85rem;
  object-fit:cover;
  flex:0 0 auto;
  contain:paint layout;
  background-color:var(--avatar-bg);
  box-shadow:0 4px 14px rgba(0,0,0,.10);
}
.cohentai-az .az-top-avatar{
  width:58px;
  height:58px;
  border-radius:.85rem;
  background:var(--avatar-bg);
  display:grid;
  place-items:center;
  font-weight:900;
  flex:0 0 auto;
  border:1px solid var(--line);
}

.cohentai-az .az-top-info{
  display:flex;
  flex-direction:column;
  gap:.25rem;
  min-width:0;
  flex:1 1 auto;
}
.cohentai-az .az-top-title{
  font-weight:700;
  line-height:1.2;
  font-size:.95rem;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.cohentai-az .az-top-count{
  align-self:flex-start;
  display:inline-flex;
  align-items:center;
  background:var(--brand-subtle);
  color:var(--brand) !important;
  font-size:.76rem;
  font-weight:800;
  padding:.18rem .55rem;
  border-radius:999px;
  line-height:1.2;
  letter-spacing:.01em;
}

/* ---- Alpha bar (WCAG 2.2 AA Touch Target 44x44px + Fade-Mask) ---- */
.cohentai-az .alpha-bar-wrap{
  position:relative;
}
.cohentai-az .alpha-bar-wrap::after{
  content:"";
  position:absolute;
  top:0; right:0; bottom:1px;
  width:36px;
  background:linear-gradient(to right, transparent, var(--panel));
  pointer-events:none;
  z-index:55;
}

.cohentai-az .alpha-bar{
  position:sticky;top:0;z-index:50;
  display:flex;gap:.35rem;overflow-x:auto;
  padding:.6rem .75rem;border-bottom:1px solid var(--line);
  background:var(--panel);
  -webkit-overflow-scrolling:touch;
  scroll-snap-type:x mandatory;
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}
.cohentai-az .alpha-bar::-webkit-scrollbar{height:5px}
.cohentai-az .alpha-bar::-webkit-scrollbar-thumb{background:var(--line);border-radius:999px}
.cohentai-az .alpha-btn{
  scroll-snap-align:center;
  display:inline-flex;align-items:center;justify-content:center;
  min-width:44px;min-height:44px;
  box-sizing:border-box;
  padding:0 .55rem;
  border:1px solid var(--line);border-radius:999px;
  text-decoration:none;color:var(--fg);background:transparent;
  font-weight:700;font-size:.95rem;line-height:1;
  touch-action:manipulation;
  transition:all .15s ease;
}
.cohentai-az .alpha-btn:active{transform:scale(.96)}
.cohentai-az .alpha-btn:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.cohentai-az .alpha-btn.active{
  border-color:var(--brand);
  background:var(--brand) !important;
  color:#ffffff !important;
  box-shadow:0 3px 12px rgba(241,89,88,.38);
  transform:translateY(-1px);
}

/* ---- Letter Section & Cards ---- */
.cohentai-az .az-live{position:absolute;left:-9999px;top:auto;width:1px;height:1px;overflow:hidden}
.cohentai-az .az-letter-wrap{
  padding:.4rem 0 1.25rem;
  min-height:280px;
  contain-intrinsic-size:0 280px;
}
.cohentai-az .az-placeholder{margin:1rem .75rem;color:var(--muted);font-style:italic}
.cohentai-az .az-empty-letter,.cohentai-az .az-error{margin:1rem .75rem;color:var(--muted)}

.cohentai-az .alpha-letter{position:sticky;top:3.4rem;z-index:10;margin:1rem 0 .4rem;padding:.4rem .75rem;background:var(--panel);border-top:1px solid var(--line);border-bottom:1px solid var(--line);font-size:1.05rem;font-weight:800;letter-spacing:-.01em}
.cohentai-az .alpha-list{list-style:none;margin:.4rem 0 1rem;padding:0 .75rem;display:grid;grid-template-columns:1fr;gap:.5rem}
@media (min-width:560px){ .cohentai-az .alpha-list{grid-template-columns:1fr 1fr} }
@media (min-width:980px){ .cohentai-az .alpha-list{grid-template-columns:1fr 1fr 1fr} }
.cohentai-az .alpha-item{list-style:none;margin:0;padding:0}

.cohentai-az .alpha-card{
  display:flex;
  align-items:center;
  gap:.75rem;
  border:1px solid var(--line);
  border-radius:.95rem;
  background:var(--card-bg);
  padding:.65rem .8rem;
  width:100%;
  text-decoration:none;
  color:var(--fg);
  transition:transform .15s ease, border-color .15s ease, background-color .15s ease;
}
.cohentai-az .alpha-card:hover{
  background:var(--card-bg-hover);
  border-color:var(--brand-border);
  text-decoration:none !important;
  transform:translateY(-1px);
}
.cohentai-az .alpha-card:active{
  transform:scale(.98);
  border-color:var(--brand);
}

.cohentai-az .alpha-thumb{
  width:48px;
  height:48px;
  aspect-ratio:1/1;
  border-radius:.8rem;
  object-fit:cover;
  flex:0 0 auto;
  contain:paint layout;
  background-color:var(--avatar-bg);
  box-shadow:0 2px 8px rgba(0,0,0,.08);
}
.cohentai-az .alpha-avatar{
  width:48px;
  height:48px;
  border-radius:.8rem;
  background:var(--avatar-bg);
  display:inline-grid;
  place-items:center;
  font-weight:900;
  flex:0 0 auto;
  border:1px solid var(--line);
}
.cohentai-az .alpha-title{
  flex:1 1 auto;
  font-weight:700;
  line-height:1.25;
  font-size:.95rem;
}
.cohentai-az .alpha-count{
  display:inline-flex;
  align-items:center;
  background:rgba(15,23,42,.06);
  color:var(--muted);
  padding:.18rem .55rem;
  border-radius:999px;
  font-size:.76rem;
  font-weight:700;
  margin-left:auto;
  flex-shrink:0;
}
.cohentai-az.az-dark .alpha-count{
  background:rgba(255,255,255,.08);
  color:var(--muted);
}

/* ---- Skeleton Shimmer Loading ---- */
.cohentai-az .az-skeleton-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:.5rem;
  padding:.4rem .75rem 1rem;
}
@media (min-width:560px){ .cohentai-az .az-skeleton-grid{grid-template-columns:1fr 1fr} }
@media (min-width:980px){ .cohentai-az .az-skeleton-grid{grid-template-columns:1fr 1fr 1fr} }

.cohentai-az .az-skeleton-card{
  display:flex;
  align-items:center;
  gap:.75rem;
  border:1px solid var(--line);
  border-radius:.95rem;
  background:var(--card-bg);
  padding:.65rem .8rem;
}
.cohentai-az .az-sk-thumb{
  width:48px;
  height:48px;
  border-radius:.8rem;
  background:rgba(127,127,127,.12);
  flex-shrink:0;
}
.cohentai-az .az-sk-info{
  display:flex;
  flex-direction:column;
  gap:.45rem;
  flex:1 1 auto;
}
.cohentai-az .az-sk-line{
  height:12px;
  border-radius:4px;
  background:linear-gradient(90deg, rgba(127,127,127,.10) 0%, rgba(127,127,127,.22) 50%, rgba(127,127,127,.10) 100%);
  background-size:200% 100%;
  animation:cohentai-az-shimmer 1.4s infinite linear;
}
@keyframes cohentai-az-shimmer{
  0%{background-position:-200% 0}
  100%{background-position:200% 0}
}
.cohentai-az .az-sk-w80{width:80%}
.cohentai-az .az-sk-w75{width:75%}
.cohentai-az .az-sk-w70{width:70%}
.cohentai-az .az-sk-w65{width:65%}
.cohentai-az .az-sk-w60{width:60%}
.cohentai-az .az-sk-w50{width:50%}
.cohentai-az .az-sk-w40{width:40%}
.cohentai-az .az-sk-w35{width:35%}
.cohentai-az .az-sk-w30{width:30%}
.cohentai-az .az-sk-w25{width:25%}
.cohentai-az .az-sk-w20{width:20%}

/* ---- In-Feed Sponsored / Ad Card ---- */
.cohentai-az .az-top-card.az-top-card--ad {
  border: 1px dashed var(--brand-border);
  background: var(--brand-subtle);
}
.cohentai-az .az-top-card.az-top-card--ad:hover {
  background: rgba(241, 89, 88, 0.16);
  border-color: var(--brand);
}
.cohentai-az .az-rank-badge.az-rank-ad {
  background: var(--brand);
  color: #ffffff;
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 6px rgba(241, 89, 88, 0.3);
}
.cohentai-az .az-top-avatar.az-top-avatar--ad {
  background: rgba(241, 89, 88, 0.15);
  color: var(--brand);
  border-color: var(--brand-border);
  font-size: 1.3rem;
}
.cohentai-az .az-top-count.az-top-count--ad {
  background: var(--brand);
  color: #ffffff !important;
}

/* ---- Recent Searches in Dropdown ---- */
.cohentai-az .az-recents-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.85rem 0.4rem;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--line);
}
.cohentai-az .az-recents-clear {
  background: none;
  border: none;
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  border-radius: 0.4rem;
  transition: opacity 0.15s ease;
}
.cohentai-az .az-recents-clear:hover {
  opacity: 0.75;
  text-decoration: underline;
}
.cohentai-az .az-result.az-result-recent {
  opacity: 0.94;
}
