/* Custom overrides and additional styles for Equacom News WordPress Theme */

/* ============================================
   STICKY HEADER
   ============================================ */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 50;
  transition: box-shadow 0.5s ease;
}
.sticky-header.scrolled {
  box-shadow: 0 12px 40px -10px rgba(30,42,58,0.15);
}

/* Mobile nav open state */
.nav-menu.open {
  display: flex !important;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 100;
}
.nav-menu.open li a {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

/* WordPress specific overrides */
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 12px; color: var(--muted); margin-top: 4px; }
.aligncenter { display: block; margin: 0 auto; }
.alignleft { float: left; margin-right: 16px; }
.alignright { float: right; margin-left: 16px; }

/* Screen reader text */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

/* WordPress blocks */
.wp-block-image { margin: 24px 0; }
.wp-block-quote {
  border-left: 4px solid var(--primary);
  padding: 16px 24px;
  margin: 24px 0;
  background: rgba(0,119,204,0.05);
  font-style: italic;
}
.wp-block-quote cite {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  font-style: normal;
}

/* Gallery */
.wp-block-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }

/* Sticky header behavior */
.topbar,
.logo-centered-row,
.ticker-bar,
.logo-row,
.main-nav {
  position: relative;
  z-index: 50;
}

/* Shimmer animation for ad banners */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.ad-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(0,119,204,0.05), transparent);
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}

/* Vertical scroll for side news ticker */
@keyframes verticalScroll {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

/* ============================================
   PERFORMANCE: GPU acceleration for animations
   ============================================ */
.hero-slide,
.hero-slide-img,
.news-card,
.featured-main img,
.featured-side-item img,
.trending-card-image img,
.multimedia-card img,
.lugar-card img {
  will-change: transform;
  backface-visibility: hidden;
}

/* ============================================
   HIDE EMPTY AD SPACES
   ============================================ */
.ad-banner:empty,
.side-ad-inner:empty {
  display: none !important;
}

/* Print styles */
@media print {
  .topbar, .ticker-bar, .main-nav, .site-footer, .ad-banner, .newsletter-block,
  .floating-buttons, .contact-popup-trigger, .popup-overlay, .popup-panel,
  .side-ad, .logo-centered-row, .sticky-header { position: static !important; }
  body::before { display: none; }
  .floating-buttons, .contact-popup-trigger, .popup-overlay, .popup-panel,
  .side-ad { display: none !important; }
}

/* ============================================
   WORDPRESS PARITY SHIELD
   ============================================ */
body.equacom-app {
  margin: 0 !important;
  background: var(--background);
  color: var(--foreground);
}

body.equacom-app .container,
body.equacom-app .equacom-container {
  width: min(100%, 1280px) !important;
  max-width: 1280px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

body.equacom-app .wp-site-blocks,
body.equacom-app .site,
body.equacom-app .site-content,
body.equacom-app .site-main,
body.equacom-app .entry-content,
body.equacom-app .post,
body.equacom-app .page,
body.equacom-app .site-wrapper,
body.equacom-app .elementor,
body.equacom-app .elementor-section-wrap,
body.equacom-app .elementor-location-header,
body.equacom-app .elementor-location-footer,
body.equacom-app .elementor-section,
body.equacom-app .elementor-container,
body.equacom-app .elementor-widget-wrap,
body.equacom-app .elementor-widget-container,
body.equacom-app .elementor-column-gap-default > .elementor-column > .elementor-element-populated {
  margin: 0 !important;
  padding: 0 !important;
}

body.equacom-app .elementor-section.elementor-section-boxed > .elementor-container,
body.equacom-app .elementor-container,
body.equacom-app .e-con,
body.equacom-app .e-con-inner {
  max-width: none !important;
}

body.equacom-app main,
body.equacom-app section,
body.equacom-app article,
body.equacom-app aside,
body.equacom-app nav,
body.equacom-app div {
  min-width: 0;
}

body.equacom-app img {
  max-width: 100%;
  height: auto;
}

body.equacom-app [data-aos] {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

body.equacom-app.admin-bar .sticky-header {
  top: 32px;
}

body.equacom-app .logo-row .container {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto auto !important;
  align-items: center !important;
  gap: 12px !important;
}

body.equacom-app .header-action-buttons {
  max-width: 100%;
  justify-content: center;
}

body.equacom-app .action-buttons {
  justify-self: end;
}

body.equacom-app .main-nav {
  background: var(--secondary) !important;
}

body.equacom-app .main-nav .container {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative;
}

body.equacom-app .main-nav li a {
  color: var(--secondary-fg) !important;
  font-size: 13px;
  font-weight: 700;
  padding: 14px 16px;
}

body.equacom-app .main-nav li a:hover,
body.equacom-app .main-nav li.current-menu-item a {
  color: var(--primary-fg) !important;
  background: rgba(255, 255, 255, 0.08);
}

/* Hero with side ticker layout */
body.equacom-app .hero-with-ticker {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

body.equacom-app .hero-slider-shell {
  width: 100%;
  padding: 0;
}

body.equacom-app .hero-slider-main {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}

body.equacom-app .hero-slider-main .hero-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.equacom-app .hero-side-ticker {
  display: none;
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
}

body.equacom-app .side-ticker-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

body.equacom-app .side-ticker-pulse {
  margin-left: auto;
  width: 8px;
  height: 8px;
  background: var(--ticker-bg);
  border-radius: 50%;
  animation: pulse-dot 1.5s infinite;
}

body.equacom-app .side-ticker-body {
  height: calc(100% - 40px);
  overflow: hidden;
  position: relative;
}

body.equacom-app .side-ticker-scroll {
  animation: verticalScroll 40s linear infinite;
}
body.equacom-app .side-ticker-scroll:hover {
  animation-play-state: paused;
}

body.equacom-app .side-ticker-item {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: background 0.2s;
}
body.equacom-app .side-ticker-item:hover {
  background: rgba(0,0,0,0.03);
}

body.equacom-app .side-ticker-thumb {
  width: 56px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
body.equacom-app .side-ticker-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.equacom-app .side-ticker-info h4 {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--foreground);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
}

body.equacom-app .side-ticker-date {
  font-size: 8px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

/* Quick access bar - 4 items */
body.equacom-app .quick-access-bar {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px !important;
  width: 100%;
}

body.equacom-app .quick-access-item {
  min-height: 112px;
  height: 100%;
  padding: 16px 12px;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  gap: 10px;
  box-shadow: var(--shadow);
}

body.equacom-app .quick-access-item span {
  line-height: 1.25;
}

/* WhatsApp floating button */
.wa-floating {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.wa-floating-label {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.wa-floating-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37,211,102,0.4);
  transition: transform 0.3s, box-shadow 0.3s;
}
.wa-floating-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(37,211,102,0.5);
}

/* Ticker stability + speed */
body.equacom-app .ticker-bar {
  position: sticky !important;
  top: var(--equacom-header-offset, 0px);
  z-index: 45;
  display: flex;
  align-items: center;
  width: 100%;
  overflow: hidden;
}

body.equacom-app .ticker-scroll {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

body.equacom-app .ticker-track {
  width: max-content;
  animation-duration: 14s !important;
  will-change: transform;
}

body.equacom-app .quick-access-item img {
  height: 40px !important;
  width: auto;
}

body.equacom-app .quick-access-item-store {
  display: flex;
  align-items: center;
  justify-content: center;
}

body.equacom-app .home-news-grid-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr) 320px !important;
  gap: 20px !important;
  align-items: start;
}

body.equacom-app .home-news-grid-stack,
body.equacom-app .home-sidebar-shell,
body.equacom-app .home-side-ticker-col {
  min-width: 0;
}

body.equacom-app .home-news-grid-stack {
  display: grid;
  gap: 20px;
}

body.equacom-app .home-news-grid-layout .news-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

body.equacom-app .latest-news-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

body.equacom-app .featured-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 4px;
}

body.equacom-app .featured-side {
  display: grid;
  gap: 4px;
}

body.equacom-app .home-sidebar-shell aside {
  display: grid;
  gap: 20px;
}

body.equacom-app .home-side-ticker-col .side-news-ticker {
  height: 380px;
  display: flex;
  flex-direction: column;
}

body.equacom-app .home-side-ticker-col .side-ticker-viewport {
  height: calc(100% - 44px);
}

body.equacom-app .home-side-ticker-col .side-ticker-track {
  display: flex;
  flex-direction: column;
  animation-duration: 30s !important;
}

body.equacom-app .home-side-ticker-col .side-ticker-item {
  min-height: 84px;
  box-sizing: border-box;
  align-items: center;
}

body.equacom-app .home-side-ticker-col .side-ticker-thumb {
  width: 72px;
  height: 52px;
}

body.equacom-app .hero-with-ticker {
  align-items: stretch;
}

body.equacom-app .hero-side-ticker {
  height: var(--equacom-hero-height, auto);
}

body.equacom-app .hero-side-ticker .side-ticker-body {
  height: calc(var(--equacom-hero-height, 420px) - 40px);
}

body.equacom-app .hero-side-ticker .side-ticker-scroll {
  display: flex;
  flex-direction: column;
}

body.equacom-app .hero-side-ticker .side-ticker-item {
  min-height: calc((var(--equacom-hero-height, 420px) - 40px) / 4);
  box-sizing: border-box;
  align-items: stretch;
}

body.equacom-app .hero-side-ticker .side-ticker-thumb {
  width: 78px;
  height: auto;
}

body.equacom-app .hero-side-ticker .side-ticker-thumb img {
  height: 100%;
}

body.equacom-app .hero-side-ticker .side-ticker-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

body.equacom-app .ticker-store-link {
  display: inline-flex;
}

/* WhatsApp expanded panel */
.wa-expanded-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  width: 288px;
  overflow: hidden;
}

body.equacom-app .equacom-page-description {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow);
}

body.equacom-app .equacom-page-empty {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 24px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  background: var(--card);
  text-align: center;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

@media (min-width: 1024px) {
  body.equacom-app .hero-with-ticker {
    grid-template-columns: 1fr 320px;
  }

  body.equacom-app .hero-side-ticker {
    display: block;
  }

  body.equacom-app .quick-access-bar {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 1024px) {
  body.equacom-app .topbar .container {
    justify-content: flex-end;
  }

  body.equacom-app .topbar-left {
    display: none;
  }

  body.equacom-app .logo-row .container {
    grid-template-columns: 1fr !important;
    justify-items: center;
  }

  body.equacom-app .action-buttons {
    justify-self: center;
  }

  body.equacom-app .main-nav .container {
    justify-content: space-between !important;
  }

  body.equacom-app .menu-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  body.equacom-app .home-news-grid-layout {
    grid-template-columns: 1fr !important;
  }

  body.equacom-app .home-side-ticker-col {
    display: none;
  }

  body.equacom-app .quick-access-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.equacom-app .latest-news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.equacom-app .latest-news-item {
    flex-direction: row;
  }

  body.equacom-app .latest-news-image {
    width: 96px;
    height: 80px;
    flex-shrink: 0;
  }

  body.equacom-app .featured-grid {
    grid-template-columns: 1fr;
  }

  body.equacom-app .ticker-store-link {
    display: none !important;
  }
}

@media (max-width: 782px) {
  body.equacom-app.admin-bar .sticky-header {
    top: 46px;
  }
}

@media (max-width: 640px) {
  body.equacom-app .logo-centered-img {
    height: 72px;
    max-width: 220px;
  }

  body.equacom-app .header-action-buttons {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.equacom-app .header-btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  body.equacom-app .header-action-buttons .header-btn:last-child {
    grid-column: 1 / -1;
    max-width: 220px;
    justify-self: center;
  }

  body.equacom-app .hero-slider-shell .hero-content,
  body.equacom-app .hero-slider-shell .hero-dots {
    padding-left: 24px;
    padding-right: 24px;
  }

  body.equacom-app .hero-slider-shell .hero-author-box {
    max-width: 100%;
  }

  body.equacom-app .quick-access-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.equacom-app .quick-access-item-store {
    grid-column: 1 / -1;
    max-width: 240px;
    width: 100%;
    justify-self: center;
  }

  body.equacom-app .home-news-grid-layout .news-grid {
    grid-template-columns: 1fr;
  }

  body.equacom-app .latest-news-grid {
    grid-template-columns: 1fr;
  }

  body.equacom-app .latest-news-item {
    flex-direction: row;
  }

  body.equacom-app .latest-news-image {
    width: 96px;
    height: 80px;
    flex-shrink: 0;
  }
}