/* OneBlog Style - Advertisement Styles */
/* Dedicated ad zone styling and responsive rules */

/* ============================================
   AD ZONE BASE STYLES
   ============================================ */

.ad-zone {
  position: relative;
  margin: 1.5rem 0;
  overflow: hidden;
}

.ad-zone--centered {
  display: flex;
  justify-content: center;
  align-items: center;
}

.ad-zone--label {
  position: relative;
}

.ad-zone__label {
  display: inline-block;
  font-size: 0.625rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
  text-align: center;
  width: 100%;
}

.ad-zone__container {
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  border-radius: 8px;
  padding: 1rem;
  display: inline-block;
  min-width: 100%;
}

/* ============================================
   HEADER AD ZONE
   ============================================ */

.header-ad {
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
  padding: 1rem 0;
}

.header-ad__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.header-ad__slot {
  min-height: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.header-ad__slot--leaderboard {
  width: 728px;
  height: 90px;
}

/* ============================================
   SIDEBAR AD ZONE
   ============================================ */

.sidebar-ad {
  margin-bottom: 1.5rem;
}

.sidebar-ad__slot {
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  border-radius: 4px;
  padding: 1rem;
  text-align: center;
}

.sidebar-ad__slot--medium-rect {
  width: 300px;
  height: 250px;
  margin: 0 auto;
}

.sidebar-ad__slot--half-page {
  width: 300px;
  height: 600px;
  margin: 0 auto;
}

.sidebar-ad__label {
  font-size: 0.625rem;
  color: #9ca3af;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

/* ============================================
   INLINE AD ZONE (Within Articles)
   ============================================ */

.inline-ad {
  margin: 2rem 0;
  padding: 1.5rem;
  background: #f9fafb;
  border: 1px dashed #d1d5db;
  border-radius: 8px;
  text-align: center;
}

.inline-ad--article {
  max-width: 100%;
}

.inline-ad__label {
  font-size: 0.625rem;
  color: #9ca3af;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.inline-ad--native {
  background: #fff;
  border: 1px solid #e5e7eb;
  padding: 1.5rem;
}

.inline-ad--native .inline-ad__label {
  color: #6b7280;
}

/* ============================================
   FOOTER AD ZONE
   ============================================ */

.footer-ad {
  background: #f3f4f6;
  border-top: 1px solid #e5e7eb;
  padding: 2rem 0;
  margin-top: 3rem;
}

.footer-ad__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-ad__slot {
  min-height: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-ad__slot--leaderboard {
  width: 728px;
  height: 90px;
}

.footer-ad__slot--wide-skyscraper {
  width: 970px;
  height: 90px;
}

/* ============================================
   STICKY AD (Floating)
   ============================================ */

.sticky-ad {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 300px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.sticky-ad--hidden {
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
}

.sticky-ad__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 8px 8px 0 0;
}

.sticky-ad__title {
  font-size: 0.75rem;
  color: #6b7280;
  text-transform: uppercase;
}

.sticky-ad__close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: #9ca3af;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.sticky-ad__close:hover {
  background: #e5e7eb;
  color: #4b5563;
}

.sticky-ad__content {
  padding: 1rem;
}

.sticky-ad__slot {
  width: 100%;
  min-height: 250px;
}

/* ============================================
   AD RESPONSIVE RULES
   ============================================ */

@media (max-width: 1024px) {
  .header-ad__slot--leaderboard,
  .footer-ad__slot--leaderboard,
  .footer-ad__slot--wide-skyscraper {
    width: 728px;
  }
}

@media (max-width: 768px) {
  .header-ad__slot--leaderboard,
  .footer-ad__slot--leaderboard,
  .footer-ad__slot--wide-skyscraper {
    width: 100%;
    max-width: 728px;
  }

  .sidebar-ad__slot--medium-rect,
  .sidebar-ad__slot--half-page {
    width: 100%;
    max-width: 300px;
  }

  .sticky-ad {
    width: calc(100% - 40px);
    bottom: 10px;
    right: 10px;
  }
}

@media (max-width: 480px) {
  .header-ad__slot--leaderboard,
  .footer-ad__slot--leaderboard,
  .footer-ad__slot--wide-skyscraper {
    max-width: 100%;
  }

  .sidebar-ad__slot--medium-rect,
  .sidebar-ad__slot--half-page {
    max-width: 100%;
  }

  .inline-ad {
    padding: 1rem;
  }

  .sticky-ad {
    width: calc(100% - 20px);
  }
}

/* ============================================
   AD LOADING STATES
   ============================================ */

.ad-zone--loading {
  position: relative;
  min-height: 250px;
}

.ad-zone--loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: adSpin 0.8s linear infinite;
}

@keyframes adSpin {
  to {
    transform: rotate(360deg);
  }
}

.ad-zone--empty {
  display: none;
}

/* ============================================
   ADSENSE SPECIFIC
   ============================================ */

.adsbygoogle {
  display: block;
  margin: 0 auto;
}

.adsbygoogle[data-ad-status='unfilled'] {
  display: none !important;
}

/* ============================================
   NATIVE ADVERTISING
   ============================================ */

.ad-zone--native {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 1.5rem;
}

.ad-zone--native .ad-zone__label {
  color: #6b7280;
  font-size: 0.6875rem;
}

.native-ad__content {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.native-ad__image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
}

.native-ad__text {
  flex: 1;
}

.native-ad__title {
  font-size: 1rem;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 0.25rem;
}

.native-ad__description {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.4;
}

.native-ad__cta {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: #2563eb;
  color: #ffffff;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: background 0.2s;
}

.native-ad__cta:hover {
  background: #1e40af;
}

/* ============================================
   AFFILIATE BADGES
   ============================================ */

.affiliate-disclosure {
  font-size: 0.75rem;
  color: #9ca3af;
  text-align: center;
  padding: 0.5rem;
  border-top: 1px solid #e5e7eb;
  margin-top: 1rem;
}

.affiliate-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: #fef3c7;
  color: #92400e;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
}

/* ============================================
   AD ANIMATIONS
   ============================================ */

@keyframes adFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ad-zone--animated {
  animation: adFadeIn 0.4s ease-out;
}

.ad-zone--slide-in {
  animation: adFadeIn 0.5s ease-out;
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

@media (prefers-color-scheme: dark) {
  .ad-zone__container,
  .sidebar-ad__slot,
  .inline-ad,
  .sticky-ad {
    background: #1f2937;
    border-color: #374151;
  }

  .ad-zone__label,
  .sidebar-ad__label,
  .inline-ad__label,
  .sticky-ad__title {
    color: #6b7280;
  }

  .header-ad,
  .footer-ad {
    background: #111827;
    border-color: #374151;
  }

  .sticky-ad__header {
    background: #1f2937;
    border-color: #374151;
  }

  .sticky-ad__close:hover {
    background: #374151;
  }

  .ad-zone--native {
    background: #1f2937;
    border-color: #374151;
  }

  .native-ad__title {
    color: #f3f4f6;
  }

  .native-ad__description {
    color: #9ca3af;
  }

  .affiliate-disclosure {
    border-color: #374151;
  }

  .affiliate-badge {
    background: #422006;
    color: #fcd34d;
  }
}
