/* ═══════════════════════════════════════════════════════════════════════
   V3 — Content Gallery ("Live Intelligence Feed")
   Overrides existing .gallery-* / .content-gallery-section styles
   Theme: Military surveillance, Islamic geometric, defense aerospace
   Enhances — does NOT break existing functionality
   ═══════════════════════════════════════════════════════════════════════ */

/* ═══ SECTION BACKGROUND UPGRADE ═══ */
.content-gallery-section {
  background: linear-gradient(170deg, #070d1a 0%, #0c1629 45%, #080e1c 100%);
}

/* Replace floating elements with tactical hex grid */
.content-gallery-section .content-gallery-background::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 100' fill='none' stroke='%23f59e0b' stroke-width='0.4'/%3E%3C/svg%3E");
  background-size: 56px 100px;
  pointer-events: none;
}

/* Scanline across section */
.content-gallery-section .v2-cg-crt {
  opacity: 0.03;
  z-index: 2;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.15) 3px,
    rgba(0, 0, 0, 0.15) 4px
  );
}

/* ═══ HEADER — Military Command Style ═══ */

/* Badge → tactical label */
.content-gallery-section .gallery-status-badge {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 4px;
  padding: 0.35rem 0.75rem;
  font-family: var(--v2-hud-font, 'JetBrains Mono', monospace);
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  backdrop-filter: none;
}

.content-gallery-section .gallery-badge-icon {
  color: var(--z-accent, #f59e0b);
  animation: none;
}

.content-gallery-section .gallery-badge-text {
  color: var(--z-accent, #f59e0b);
}

.content-gallery-section .gallery-badge-shine { display: none; }

/* Title — sharper, military weight */
.content-gallery-section .gallery-main-title {
  letter-spacing: -0.02em;
}

.content-gallery-section .gallery-title-primary {
  font-weight: 800;
}

.content-gallery-section .gallery-title-underline {
  background: var(--z-accent, #f59e0b);
  opacity: 0.4;
  height: 2px;
}

/* Subtitle */
.content-gallery-section .gallery-subtitle {
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ═══ TAB NAVIGATION — Channel Selector ═══ */
.content-gallery-section .gallery-nav-tabs {
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 4px;
  display: inline-flex;
  margin-left: auto;
  margin-right: auto;
}

.content-gallery-section .gallery-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.6rem 1.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  gap: 0.5rem;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.content-gallery-section .gallery-tab-btn::before { display: none; }

.content-gallery-section .gallery-tab-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
  color: var(--z-text, #f1f5f9);
  transform: none;
  box-shadow: none;
}

.content-gallery-section .gallery-tab-btn.gallery-tab-active {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.25);
  color: var(--z-accent, #f59e0b);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.06);
}

.content-gallery-section .gallery-tab-counter {
  font-family: var(--v2-hud-font, 'JetBrains Mono', monospace);
  font-size: 0.5625rem;
  font-weight: 700;
  padding: 1px 6px;
  min-width: 20px;
  height: 18px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
}

.content-gallery-section .gallery-tab-btn.gallery-tab-active .gallery-tab-counter {
  background: rgba(245, 158, 11, 0.2);
  color: var(--z-accent, #f59e0b);
}

/* ═══ CONTENT CARDS — Surveillance File Style ═══ */

/* Card container */
.content-gallery-section .gallery-content-item {
  background: var(--z-surface-1, #1e293b);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease,
              box-shadow 0.4s ease;
}

.content-gallery-section .gallery-content-item::before { display: none; }

.content-gallery-section .gallery-content-item:hover {
  transform: translateY(-6px);
  border-color: rgba(245, 158, 11, 0.2);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.3),
    0 0 24px rgba(245, 158, 11, 0.04);
}

/* Image — desaturated surveillance style */
.content-gallery-section .gallery-media-container {
  border-radius: 10px 10px 0 0;
}

.content-gallery-section .gallery-item-image {
  filter: brightness(0.8) saturate(0.7) contrast(1.05);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
}

.content-gallery-section .gallery-content-item:hover .gallery-item-image {
  transform: scale(1.05);
  filter: brightness(0.88) saturate(0.9) contrast(1.05);
}

/* Hover overlay — military dark */
.content-gallery-section .gallery-hover-overlay {
  background: rgba(10, 16, 30, 0.8);
  backdrop-filter: blur(4px);
}

/* Action buttons — tactical circles */
.content-gallery-section .gallery-action-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  transition: all 0.25s ease;
}

.content-gallery-section .gallery-action-btn:hover {
  background: var(--z-accent, #f59e0b);
  border-color: var(--z-accent, #f59e0b);
  color: #0a101e;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

/* Status labels — classification badges */
.content-gallery-section .gallery-status-label {
  font-family: var(--v2-hud-font, 'JetBrains Mono', monospace);
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 3px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.content-gallery-section .gallery-featured-label {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--z-accent, #f59e0b);
}

.content-gallery-section .gallery-trending-label {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--z-danger, #ef4444);
}

.content-gallery-section .gallery-newest-label {
  background: rgba(14, 165, 233, 0.15);
  border-color: rgba(14, 165, 233, 0.3);
  color: var(--z-cyan, #0ea5e9);
}

/* Card details area */
.content-gallery-section .gallery-item-details {
  padding: 1.125rem;
  gap: 0.625rem;
}

/* Author section */
.content-gallery-section .gallery-author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.content-gallery-section .gallery-author-name {
  font-size: 0.75rem;
  font-weight: 600;
}

.content-gallery-section .gallery-verified-badge {
  color: var(--z-accent, #f59e0b);
  font-size: 0.625rem;
}

/* Stats — monospace */
.content-gallery-section .gallery-stat-item {
  font-family: var(--v2-hud-font, 'JetBrains Mono', monospace);
  font-size: 0.625rem;
  color: var(--z-text-muted, #64748b);
  gap: 3px;
}

.content-gallery-section .gallery-stat-item i {
  font-size: 0.5625rem;
}

/* Title */
.content-gallery-section .gallery-item-title {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.35;
}

.content-gallery-section .gallery-title-link {
  color: var(--z-text, #f1f5f9);
  text-decoration: none;
  transition: color 0.25s ease;
}

.content-gallery-section .gallery-title-link:hover {
  color: var(--z-accent, #f59e0b);
}

/* Tags — tactical pills */
.content-gallery-section .gallery-content-tag {
  font-family: var(--v2-hud-font, 'JetBrains Mono', monospace);
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--z-text-sec, #94a3b8);
}

/* Footer — separator + timestamp */
.content-gallery-section .gallery-item-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

.content-gallery-section .gallery-timestamp {
  font-family: var(--v2-hud-font, 'JetBrains Mono', monospace);
  font-size: 0.5625rem;
  color: var(--z-text-muted, #64748b);
}

.content-gallery-section .gallery-premium-indicator {
  color: var(--z-accent, #f59e0b);
  font-size: 0.625rem;
}

/* ═══ EMPTY STATE — "NO SIGNAL" ═══ */
.content-gallery-section .gallery-empty-state {
  text-align: center;
  padding: 3rem;
}

.content-gallery-section .gallery-empty-icon i {
  font-size: 2.5rem;
  color: var(--z-text-muted, #64748b);
  opacity: 0.2;
}

.content-gallery-section .gallery-empty-title {
  font-family: var(--v2-hud-font, 'JetBrains Mono', monospace);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--z-text-muted, #64748b);
}

/* ═══ VIEW ALL CTA — Tactical Button ═══ */
.content-gallery-section .gallery-view-all-btn {
  font-family: var(--v2-hud-font, 'JetBrains Mono', monospace);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.75rem 2rem;
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 8px;
  color: var(--z-accent, #f59e0b);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: all 0.35s ease;
}

.content-gallery-section .gallery-view-all-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.08), transparent);
  animation: v3-cg-sweep 4s linear infinite;
}

@keyframes v3-cg-sweep {
  0%   { left: -100%; }
  100% { left: 100%; }
}

.content-gallery-section .gallery-view-all-btn:hover {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.1);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.08);
  transform: translateY(-2px);
}

.content-gallery-section .gallery-view-all-btn:hover .gallery-btn-icon {
  transform: translateX(4px);
}

.content-gallery-section .gallery-btn-ripple { display: none; }

/* ═══ CARD STAGGER ANIMATION ═══ */
.content-gallery-section .gallery-content-item {
  opacity: 0;
  transform: translateY(20px);
}

.content-gallery-section[data-v2-section].v2-in-view .gallery-content-item {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.3s ease, box-shadow 0.4s ease;
}

.content-gallery-section.v2-in-view .gallery-content-item:nth-child(1) { transition-delay: 0.05s; }
.content-gallery-section.v2-in-view .gallery-content-item:nth-child(2) { transition-delay: 0.1s; }
.content-gallery-section.v2-in-view .gallery-content-item:nth-child(3) { transition-delay: 0.15s; }
.content-gallery-section.v2-in-view .gallery-content-item:nth-child(4) { transition-delay: 0.2s; }
.content-gallery-section.v2-in-view .gallery-content-item:nth-child(5) { transition-delay: 0.25s; }
.content-gallery-section.v2-in-view .gallery-content-item:nth-child(6) { transition-delay: 0.3s; }

/* ═══ RESPONSIVE OVERRIDES ═══ */
@media (max-width: 768px) {
  .content-gallery-section .gallery-nav-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 3px;
  }

  .content-gallery-section .gallery-tab-btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.75rem;
    flex-shrink: 0;
  }

  .content-gallery-section .v2-cg-crt {
    display: none;
  }

  .content-gallery-section .gallery-item-image {
    filter: brightness(0.85) saturate(0.85);
  }
}

@media (max-width: 480px) {
  .content-gallery-section .gallery-tab-btn {
    padding: 0.4rem 0.625rem;
  }

  .content-gallery-section .gallery-item-details {
    padding: 0.875rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .content-gallery-section .gallery-content-item {
    opacity: 1 !important;
    transform: none !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
  }

  .content-gallery-section .gallery-view-all-btn::before {
    animation: none;
  }

  .content-gallery-section .gallery-item-image {
    transition: none;
    filter: brightness(0.85) saturate(0.85);
  }
}
